:root {
  /* "Gotham" theme: near-black and charcoal, bat-signal yellow accent, high contrast text */
  color-scheme: dark;
  --bg: #0a0a0c; --panel: #141418; --panel-2: #1b1b20; --line: #26262d; --line-2: #36363f;
  --text: #ededf0; --muted: #9b9ba8; --navy: #050507; --navy-2: #18181d; --navy-3: #2a2a31;
  --gold: #ffd60a; --gold-2: #ffe24d; --gold-ink: #ffe24d; --gold-bg: #2a2408;
  --accent: #ffd60a; --accent-bg: #26220c; --on-accent: #0a0a0c;
  --good: #2fbf71; --good-bg: #0f2a1c; --bad: #ff4d5e; --bad-bg: #3a141a;
  --warn: #ffc94d; --warn-bg: #2f240b;
  --bubble-in: #222228; --bubble-out: #ffd60a;
  --radius: 12px; --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 8px 24px rgba(0, 0, 0, .35);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-size: 14px; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); min-width: 0; }
input:focus, select:focus, textarea:focus, [contenteditable]:focus { outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); outline-offset: 0; border-color: var(--accent); }
textarea { resize: vertical; }
label { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
label > input, label > select, label > textarea, label > .row { color: var(--text); font-size: 14px; font-weight: 400; }
a { color: var(--accent); }
h1, h2 { margin: 0; letter-spacing: -.01em; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; gap: 4px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: 13px; font-weight: 400; }
.small { font-size: 12px; }
.error { color: var(--bad); font-size: 14px; min-height: 1em; margin: 0; }
.check { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 13px; font-weight: 500; }
.check input { width: auto; margin: 0; }

.btn { border: 1px solid var(--line-2); background: var(--panel); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--gold-2); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn.gold:hover { background: var(--gold-2); }
.btn.call { background: var(--good); border-color: var(--good); color: #fff; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.xl { padding: 12px 26px; font-size: 16px; border-radius: 999px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 2px 4px; font-size: 13px; text-decoration: none; }
.link.danger { color: var(--bad); }
.tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bubble-in); color: var(--muted); white-space: nowrap; }
.tag.due { background: var(--warn-bg); color: var(--warn); }
.tag.hot { background: var(--gold-bg); color: var(--gold-ink); }
.tag.stale { background: var(--bad-bg); color: var(--bad); }
.late { color: var(--bad); font-weight: 600; }
.count:not(:empty) { background: var(--bad); color: #fff; border-radius: 999px; padding: 0 6px; font-size: 11px; margin-left: 4px; }

/* stage colours */
.st-prospects { --st: #8a8a96; }
.st-attempt-to-connect { --st: #7c9cff; }
.st-connected { --st: #3cc6e8; }
.st-interested { --st: #ffd60a; }
.st-in-build { --st: #a78bfa; }
.st-closed-won-site-live { --st: #2fbf71; }
.st-lto { --st: #fb923c; }
.st-lost { --st: #ff4d5e; }
.pill-stage { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--st) 14%, var(--panel)); color: var(--text); white-space: nowrap; }
.pill-stage::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }

.avatar { --h: 210; width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 700; font-size: 12px;
  background: hsl(var(--h) 18% 20%); color: hsl(var(--h) 60% 80%); }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 72px; height: 72px; font-size: 24px; }

.brand { font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; font-size: 18px; }
.brand b { font-weight: 400; }
.fin { width: 20px; height: 20px; border-radius: 4px 16px 4px 4px; background: linear-gradient(135deg, var(--gold-2), var(--gold)); display: inline-block; }

.login { min-height: 100%; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at 50% 0%, rgba(255, 214, 10, .14), transparent 55%), var(--navy); }
.login-card { border: 1px solid var(--line); }
.login-card { background: var(--panel); border-radius: 16px; padding: 28px; width: min(360px, 100%); display: grid; gap: 16px; }

/* shell */
.shell { display: grid; grid-template-columns: 76px 1fr; height: 100dvh; }
.rail { background: var(--navy); border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; padding: 12px 8px; gap: 4px; }
.rail-brand { display: grid; place-items: center; height: 44px; margin-bottom: 8px; }
.rail .fin { width: 26px; height: 26px; }
.nav { position: relative; display: grid; justify-items: center; gap: 3px; padding: 9px 4px; border-radius: 10px; color: #8d8d99; text-decoration: none; font-size: 11px; font-weight: 600; background: none; border: 0; cursor: pointer; }
.nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.nav[data-page="home"] svg, .nav[data-page="dialer"] svg, .nav[data-page="pipeline"] svg, .nav[data-page="contacts"] svg { fill: currentColor; stroke: none; }
.nav:hover { color: #fff; background: var(--navy-2); }
.nav.active { color: var(--navy); background: var(--gold); }
.nav.small { padding: 6px 4px; }
.badge:not(:empty) { position: absolute; top: 4px; right: 10px; background: var(--bad); color: #fff; font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 999px; line-height: 16px; }
.rail-foot { margin-top: auto; display: grid; gap: 2px; justify-items: stretch; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #56627a; justify-self: center; margin-bottom: 8px; cursor: pointer; }
.dot.on { background: var(--good); box-shadow: 0 0 0 4px rgba(18, 161, 80, .25); }

.main { min-width: 0; min-height: 0; overflow-y: auto; }
.page { padding: 20px 24px 32px; max-width: 1440px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 700; }
.page-head p { margin: 2px 0 0; }
.head-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-actions input[type=search] { width: 220px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.card h2 { font-size: 15px; font-weight: 700; }
.empty-row { color: var(--muted); padding: 10px 0; list-style: none; }
.notice { background: var(--gold-bg); color: var(--gold-ink); border: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13px; }

/* home */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 12px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); border-top: 3px solid var(--c); }
.kpi-gold { --c: var(--gold); } .kpi-green { --c: var(--good); } .kpi-blue { --c: var(--accent); } .kpi-red { --c: var(--bad); }
.kpi .k { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 28px; color: #fff; font-weight: 800; letter-spacing: -.02em; }
.kpi .s { font-size: 12px; color: var(--muted); }
.funnel { margin-bottom: 12px; }
.funnel-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; align-items: end; }
.fstep { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--text); text-align: center; padding: 4px; border-radius: 8px; }
.fstep:hover { background: var(--panel-2); }
.fbar { width: 100%; max-width: 90px; border-radius: 6px 6px 2px 2px; background: var(--st); opacity: .85; }
.fstep b { font-size: 18px; }
.fstep span { font-size: 12px; color: var(--muted); }
.fstep em { font-style: normal; font-size: 12px; font-weight: 600; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.worklist { list-style: none; margin: 0; padding: 0; display: grid; }
.worklist > li { padding: 10px 0; border-top: 1px solid var(--line); }
.worklist > li:first-child { border-top: 0; }
.work { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.w-main { min-width: 0; flex: 1 1 180px; }
.w-name { font-weight: 600; color: var(--text); text-decoration: none; margin-right: 6px; }
.w-name:hover { color: var(--accent); }
.w-act { display: flex; gap: 6px; flex-wrap: wrap; }
.task { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; }
.task .check { align-items: flex-start; font-weight: 500; }
.task .check input { margin-top: 2px; }
.task > .muted { grid-column: 1; grid-row: 2; padding-left: 22px; }
.task > .link { grid-column: 2; grid-row: 1; }
.task.done span { text-decoration: line-through; color: var(--muted); }
.task a { text-decoration: none; }
.task-add { display: grid; grid-template-columns: 1fr 150px auto; gap: 6px; margin-top: 10px; }
.task-add.stack { grid-template-columns: 1fr auto; }
.task-add.stack input:first-child { grid-column: 1 / -1; }
.upcoming { margin-top: 10px; }
.upcoming summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13px; }
.prospect-form { display: grid; gap: 8px; margin-top: 8px; }

/* dialer */
.session { display: flex; gap: 8px; }
.session div { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 6px 14px; display: grid; justify-items: center; min-width: 76px; }
.session b { font-size: 18px; }
.session span { font-size: 11px; color: var(--muted); font-weight: 600; }
.dial-grid { display: grid; grid-template-columns: 280px 1fr 320px; gap: 12px; align-items: start; }
.queue { display: grid; gap: 10px; max-height: calc(100dvh - 160px); grid-template-rows: auto auto 1fr; }
.queue .card-head { margin: 0; }
.queue-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; }
.queue-list li[data-qi] { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; cursor: pointer; }
.queue-list li[data-qi]:hover { background: var(--panel-2); }
.queue-list li.cur { background: var(--accent-bg); box-shadow: inset 3px 0 0 var(--accent); }
.queue-list li.past { opacity: .55; }
.queue-list .muted { font-size: 12px; }
.queue-list li[data-qi] .grow b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb { font-weight: 500; }
.cb input { width: 150px; }
.props[open] > label { margin-bottom: 2px; }
.dial-main { display: grid; gap: 14px; padding: 20px; }
.dial-empty { text-align: center; padding: 40px 12px; display: grid; gap: 4px; justify-items: center; }
.dial-empty p { margin: 0; }
.dialpad-inline { display: flex; gap: 8px; margin-top: 14px; width: min(360px, 100%); }
#dialCard { display: grid; gap: 14px; }
.dial-who { display: flex; gap: 14px; align-items: center; }
.dial-who h2 { font-size: 22px; font-weight: 700; }
.dial-who .row { margin-top: 6px; }
.dial-phone { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--panel-2); border-radius: 10px; border: 1px solid var(--line); }
.big-number { font-size: 26px; font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.dial-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.call-state { color: var(--muted); font-weight: 600; flex: 1; }
.dial-context { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dial-context p { margin: 2px 0 0; font-weight: 500; }
.outcomes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.outcome { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-weight: 600; text-align: left; }
.outcome:hover { border-color: var(--accent); background: var(--accent-bg); }
.outcome kbd { font: inherit; font-size: 11px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
.oc-interested { border-color: color-mix(in srgb, var(--gold) 60%, var(--line)); }
.oc-connected { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.oc-not_interested { color: var(--bad); }
.optin-yes { background: var(--panel-2); border: 1px dashed var(--line-2); border-radius: 8px; padding: 8px 10px; }
.script { position: sticky; top: 0; }
.script-box { font-size: 14px; line-height: 1.5; max-height: calc(100dvh - 230px); overflow-y: auto; padding: 2px; }
.script-box p { margin: 0 0 8px; }
.script-box mark { background: var(--gold-bg); color: var(--gold-ink); padding: 0 3px; border-radius: 4px; }
.keypad { display: grid; grid-template-columns: repeat(3, 48px); gap: 6px; justify-content: start; }
.keypad button { height: 40px; border-radius: 8px; border: 0; background: var(--navy-3); color: #fff; font-size: 16px; cursor: pointer; }
.keypad.light button { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); }

/* pipeline board */
.board-page { max-width: none; display: flex; flex-direction: column; height: 100%; padding-bottom: 12px; }
.board { flex: 1; min-height: 0; display: flex; gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { flex: 0 0 272px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; min-height: 0; border-top: 3px solid var(--st); }
.col.over { outline: 2px dashed var(--gold); outline-offset: -2px; }
.col header { padding: 10px 12px; }
.col-title { display: flex; justify-content: space-between; align-items: center; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; }
.col-n { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; }
.col .cards { padding: 0 8px 8px; overflow-y: auto; display: grid; gap: 8px; align-content: start; flex: 1; min-height: 80px; }
.col-empty { color: var(--muted); text-align: center; padding: 20px 0; font-size: 13px; border: 1px dashed var(--line-2); border-radius: 8px; }
.col-foot { border-top: 1px solid var(--line); padding: 8px 12px; display: flex; justify-content: space-between; font-size: 13px; }
.dcard { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; cursor: grab; display: grid; gap: 6px; box-shadow: var(--shadow); }
.dcard:hover { border-color: var(--accent); }
.dcard.is-hot { box-shadow: inset 3px 0 0 var(--gold), var(--shadow); }
.dcard.dragging { opacity: .4; }
.d-top { display: flex; gap: 8px; align-items: center; }
.d-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.d-amt { font-size: 13px; font-weight: 600; }
.d-next { font-size: 12px; color: var(--muted); }
.d-icons { display: flex; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 700; }
.d-icons:empty { display: none; }

/* contacts table */
.table-card { padding: 0; overflow: hidden; }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.views { display: flex; gap: 2px; }
.tab { border: 0; background: none; padding: 8px 12px; cursor: pointer; font-weight: 600; color: var(--muted); border-radius: 8px; }
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab.active { color: var(--gold); box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.filters { display: flex; gap: 8px; flex: 1; justify-content: flex-end; }
.filters input { max-width: 320px; }
.filters select { max-width: 200px; }
.table-wrap { overflow-x: auto; }
.ctable { width: 100%; border-collapse: collapse; }
.ctable th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.ctable td { padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ctable tr[data-id] { cursor: pointer; }
.ctable tr[data-id]:hover td { background: var(--panel-2); }
.ctable .num { text-align: right; font-variant-numeric: tabular-nums; }
.ctable tr.unread .cname { font-weight: 800; }
.name-cell { display: flex; gap: 10px; align-items: center; min-width: 220px; }
.name-cell .muted { font-size: 12px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cname { font-weight: 600; text-decoration: none; color: var(--text); }
.cname:hover { color: var(--accent); }

/* record */
.crumbs { margin-bottom: 10px; }
.crumbs a { text-decoration: none; font-weight: 600; font-size: 13px; }
.record-grid { display: grid; grid-template-columns: 300px 1fr 320px; gap: 12px; align-items: start; }
.rec-left { display: grid; gap: 14px; }
.rec-id { display: grid; justify-items: center; text-align: center; gap: 4px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.rec-id h1 { font-size: 18px; font-weight: 700; margin-top: 6px; word-break: break-word; }
.quick { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
.qa { display: grid; justify-items: center; gap: 3px; width: 48px; background: none; border: 0; cursor: pointer; color: var(--text); font-size: 11px; font-weight: 600; text-decoration: none; }
.qa svg { width: 36px; height: 36px; padding: 8px; border-radius: 50%; border: 1px solid var(--line-2); fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; background: var(--panel); }
.qa:hover svg { border-color: var(--accent); color: var(--accent); }
#callBtn svg { fill: currentColor; stroke: none; }
.qa.disabled { opacity: .4; cursor: not-allowed; }
.props { display: grid; gap: 10px; }
.props summary { font-weight: 700; cursor: pointer; margin-bottom: 10px; }
.props[open] { display: grid; gap: 10px; }
.rec-mid { padding: 0; overflow: hidden; }
.rec-mid > .tabs { display: flex; gap: 4px; padding: 6px 12px 0; border-bottom: 1px solid var(--line); }
#tabActivity { padding: 16px; display: grid; gap: 14px; }
.note-form { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.seg { display: flex; gap: 4px; flex-wrap: wrap; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; width: 1px; }
.seg span { display: inline-block; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); cursor: pointer; font-size: 12px; color: var(--text); background: var(--panel); }
.seg input:checked + span { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.activity { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.act { position: relative; display: flex; gap: 10px; }
.act-ic { position: absolute; left: -29px; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); border: 2px solid var(--line); display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.act-dial .act-ic, .act-call .act-ic { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.act-dm .act-ic { color: #c13584; }
.act-text .act-ic { color: var(--accent); }
.act-body { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-left: 10px; }
.act-head { display: flex; justify-content: space-between; gap: 8px; }
.act-body p { margin: 4px 0 0; white-space: pre-wrap; word-wrap: break-word; }
.act-body audio { display: block; margin-top: 6px; width: 100%; max-width: 320px; }
.texts { display: flex; flex-direction: column; height: min(70dvh, 640px); }
.timeline { list-style: none; margin: 0; padding: 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.timeline li { max-width: 78%; }
.timeline .msg { padding: 8px 12px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.35; }
.timeline .in { align-self: flex-start; }
.timeline .in .msg { background: var(--bubble-in); border-bottom-left-radius: 4px; }
.timeline .out { align-self: flex-end; text-align: right; }
.timeline .out .msg { background: var(--bubble-out); color: var(--on-accent); border-bottom-right-radius: 4px; text-align: left; }
.timeline .out.failed .msg { background: var(--bad); }
.timeline .meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.timeline .callrow { align-self: center; max-width: 100%; font-size: 13px; color: var(--muted); }
.banner { margin: 0 16px; padding: 8px 12px; border-radius: 8px; background: var(--warn-bg); color: var(--warn); font-size: 14px; }
.optin { margin: 8px 16px 0; padding: 12px; border: 1px dashed var(--accent); border-radius: 10px; display: grid; gap: 8px; background: var(--panel); }
.optin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.optin-record { padding: 10px; border-radius: 8px; background: var(--bubble-in); font-size: 13px; display: grid; gap: 4px; }
.optin-record .link { justify-self: start; padding: 0; }
.composer { border-top: 1px solid var(--line); padding: 10px 16px; display: grid; gap: 6px; }
.composer-row { display: flex; align-items: center; gap: 10px; }
.composer-row .check { flex: 1; font-size: 12px; }
.rec-right { display: grid; gap: 12px; }
.deal { display: grid; gap: 10px; }
.deal .card-head { margin: 0; }
.stagebar { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
.sb { flex: 1; height: 8px; border-radius: 999px; border: 0; background: var(--line); cursor: pointer; padding: 0; min-width: 20px; }
.sb.on { background: var(--gold); }
.sb.cur { background: var(--accent); }
.sb-label { flex-basis: 100%; font-size: 12px; color: var(--muted); }
.deal .row input { flex: 1; }
.touch-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding-top: 4px; border-top: 1px solid var(--line); }
.touch-row .muted { flex: 1 1 100%; padding-top: 6px; }

/* call overlays */
.callbar, .incoming { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 16px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 10; max-width: calc(100% - 32px); }
.callbar .muted, .incoming .muted { color: #9b9ba8; }
.callbar .btn:not(.danger) { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }
.incoming { bottom: auto; top: 16px; }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); padding: 0; width: min(440px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(0, 0, 0, .7); }
.dialog-form { padding: 20px; display: grid; gap: 12px; }
.dialog-form h2 { font-size: 18px; }
.dialog-form p { margin: 0; }
.toast { position: fixed; bottom: 20px; right: 20px; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 10px; z-index: 20; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }

@media (max-width: 1200px) {
  .dial-grid { grid-template-columns: 240px 1fr; }
  .script { grid-column: 1 / -1; position: static; }
  .record-grid { grid-template-columns: 280px 1fr; }
  .rec-right { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: 1fr 1fr; }
  .home-grid { grid-template-columns: 1fr; }
  .dial-grid { grid-template-columns: 1fr; }
  .queue { max-height: 260px; }
  .record-grid { grid-template-columns: 1fr; }
  .rec-right { order: 2; } .rec-mid { order: 3; }
  .rec-right { grid-template-columns: 1fr; }
  .funnel-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .rail { order: 2; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .rail-brand, .rail-foot .nav.small:first-of-type { display: none; }
  .rail .nav { flex: 1; }
  .rail-foot { margin: 0; display: flex; align-items: center; }
  .rail-foot .dot { margin: 0 6px; }
  .badge:not(:empty) { right: 22%; }
  .page { padding: 14px 16px 24px; }
  .page-head h1 { font-size: 20px; }
  .head-actions input[type=search] { width: 100%; }
  .head-actions { width: 100%; }
  .session { width: 100%; }
  .session div { flex: 1; }
  .hide-s { display: none; }
  .ctable th, .ctable td { padding: 10px; }
  .name-cell { min-width: 160px; }
  .table-tools .filters { flex-direction: column; }
  .filters input, .filters select { max-width: none; }
  .views { overflow-x: auto; }
  .task-add { grid-template-columns: 1fr 130px; }
  .task-add .btn { grid-column: 1 / -1; }
  .dial-who { flex-wrap: wrap; }
  .dial-who h2 { font-size: 18px; }
  .avatar.xl { width: 48px; height: 48px; font-size: 17px; }
  .big-number { font-size: 22px; }
  .queue { max-height: 230px; }
  .name-cell { min-width: 0; }
  .name-cell .muted { max-width: 52vw; }
  .dial-context { grid-template-columns: 1fr; }
  .outcomes { grid-template-columns: 1fr 1fr; }
  .col { flex-basis: 84vw; }
  .callbar { bottom: 76px; }
  .toast { bottom: 80px; left: 16px; right: 16px; }
}

/* lead assistant */
.ai-fab { position: fixed; right: 20px; bottom: 20px; z-index: 15; display: inline-flex; gap: 8px; align-items: center; padding: 11px 16px; border-radius: 999px; border: 0; background: var(--gold); color: var(--navy); font-weight: 700; cursor: pointer; box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 0 0 4px rgba(255, 214, 10, .12); }
.ai-fab:hover { background: var(--gold-2); }
.ai-panel { position: fixed; right: 20px; bottom: 20px; z-index: 16; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100dvh - 40px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,.55); overflow: hidden; }
.ai-head { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,214,10,.07), transparent); }
.icon-x { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px; }
.ai-log { list-style: none; margin: 0; padding: 14px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { max-width: 92%; padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.ai-msg.me { align-self: flex-end; background: var(--accent-bg); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.ai-msg.bot { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }
.ai-msg.err { color: var(--bad); }
.ai-msg img { max-width: 120px; max-height: 90px; border-radius: 6px; display: block; margin-top: 6px; }
.ai-card { align-self: stretch; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.ai-card .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ai-card label { font-size: 11px; }
.ai-card input, .ai-card textarea, .ai-card select { padding: 6px 8px; font-size: 13px; }
.ai-dup { background: var(--warn-bg); color: var(--warn); border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.ai-dup a { color: var(--warn); font-weight: 700; }
.ai-form { border-top: 1px solid var(--line); padding: 10px 12px; display: grid; gap: 8px; }
.ai-form.drag { outline: 2px dashed var(--gold); outline-offset: -6px; }
.ai-thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-thumbs:empty { display: none; }
.ai-thumbs span { position: relative; }
.ai-thumbs img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-2); }
.ai-thumbs button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; font-size: 10px; cursor: pointer; line-height: 18px; padding: 0; }
.attach { cursor: pointer; }
.typing::after { content: "…"; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }
@media (max-width: 700px) {
  .ai-fab { bottom: 76px; right: 12px; padding: 10px 14px; }
  .ai-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: calc(100dvh - 16px); }
}
