/* AI Calling panel — design tokens + components. One file, no build step. */

:root {
  --sidebar: #10192b;
  --sidebar-2: #1a2540;
  --nav-active: #2a3b63;
  --bg: #f1f4f9;
  --card: #ffffff;
  --border: #e1e6ee;
  --border-strong: #cdd4df;
  --text: #141a23;
  --muted: #5b6472;
  --faint: #8a919c;
  --accent: #e9b949;
  --accent-ink: #1d1503;
  --link: #1b3a9e;

  --done-bg: #e1f0e8;   --done-fg: #0a5a3e;
  --calling-bg: #e2eafb; --calling-fg: #1b3a9e;
  --retry-bg: #fbe9d6;  --retry-fg: #843805;
  --queued-bg: #eceef1; --queued-fg: #3b4452;
  --danger-bg: #f5e1e1; --danger-fg: #8a1c1c;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(16, 25, 43, .04), 0 1px 1px rgba(16, 25, 43, .03);
  --shadow-lg: 0 10px 30px rgba(16, 25, 43, .10), 0 2px 6px rgba(16, 25, 43, .06);
  --sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --sidebar-w: 232px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); }
h1, h2, h3 { margin: 0; line-height: 1.25; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { flex: none; vertical-align: -3px; }
.ico3d { flex: none; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(16, 25, 43, .12)); }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--sidebar); color: #c9d1e0;
  display: flex; flex-direction: column; padding: 18px 12px; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; color: #fff; text-decoration: none; }
.brand-mark { flex: none; display: block; line-height: 0; }
.brand-mark img { display: block; border-radius: 10px; }
.brand b { display: block; font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; }
.brand small { display: block; font-size: 11.5px; color: #8d98ae; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav span.nav-off {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px;
  border-radius: 9px; color: #c9d1e0; text-decoration: none; font-weight: 450;
}
.nav a:hover { background: var(--sidebar-2); color: #fff; }
.nav a.active { background: var(--nav-active); color: #fff; font-weight: 550; box-shadow: inset 3px 0 0 var(--accent); }
.nav .ico { opacity: .8; }
.nav .badge { margin-left: auto; font: 600 11px var(--sans); padding: 1px 8px; border-radius: 99px; background: #e2eafb; color: var(--calling-fg); }
.nav .badge.warn { background: var(--danger-bg); color: var(--danger-fg); }
.nav .live-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; margin-right: 4px; animation: pulse 1.4s infinite; }
.nav-sep { height: 1px; background: #1f2a44; margin: 12px 8px; }
.nav span.nav-off { color: #6f7a92; cursor: default; }
.nav .phase { margin-left: auto; font-size: 10.5px; border: 1px solid #34405c; border-radius: 6px; padding: 0 6px; color: #8d98ae; }
.meter { margin-top: auto; background: var(--sidebar-2); border-radius: 12px; padding: 14px; }
.meter-label { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: #8d98ae; }
.meter-value { color: #fff; font: 500 22px var(--mono); margin: 4px 0 8px; }
.meter-value small { font-size: 12px; color: #8d98ae; }
.bar { height: 5px; border-radius: 99px; background: #2c3854; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bar.hot > i { background: #e5684a; }
.meter-note { font-size: 11.5px; color: #8d98ae; margin-top: 8px; }

.main { flex: 1; margin-left: var(--sidebar-w); padding: 24px 28px 120px; min-width: 0; }
.container { max-width: 1760px; margin: 0; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.eyebrow { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.page-head h1 { font-size: 26px; font-weight: 600; letter-spacing: -.01em; }
.page-sub { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin-bottom: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: #fff; color: var(--text); font: 550 14px var(--sans); text-decoration: none; cursor: pointer;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: #f5f7fb; border-color: #c2c9d5; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid rgba(233, 185, 73, .55); outline-offset: 2px; }
.btn-dark { background: var(--sidebar); color: #fff; border-color: var(--sidebar); }
.btn-dark:hover { background: #1c2844; border-color: #1c2844; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: #f0c45c; border-color: #f0c45c; }
.btn-danger { color: var(--danger-fg); border-color: #e9c2c2; }
.btn-danger:hover { background: var(--danger-bg); border-color: #e0aeae; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; border: 0; color: var(--link); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.card-head h2, .card-title { font-size: 15.5px; font-weight: 600; }
.card-head .sub, .card-sub { font-size: 12.5px; color: var(--muted); }
.card-body { padding: 14px 20px 20px; }
.grid { display: grid; gap: 16px; }
.grid > *, .stack > * { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr); align-items: start; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.mt { margin-top: 16px; } .mt-lg { margin-top: 24px; } .mb { margin-bottom: 16px; }

/* ---------- pills ---------- */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 99px; font: 550 12px/1.6 var(--sans); white-space: nowrap; }
.pill-done { background: var(--done-bg); color: var(--done-fg); }
.pill-calling { background: var(--calling-bg); color: var(--calling-fg); }
.pill-retry { background: var(--retry-bg); color: var(--retry-fg); }
.pill-queued { background: var(--queued-bg); color: var(--queued-fg); }
.pill-danger { background: var(--danger-bg); color: var(--danger-fg); }
.pill-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- campaign banner (dashboard) ---------- */
.banner-dark { background: radial-gradient(1200px 300px at 85% -40%, #263760 0%, var(--sidebar) 55%); color: #fff; border-radius: 14px; padding: 22px 24px; display: flex; gap: 24px; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); flex-wrap: wrap; }
.banner-dark h2 { font-size: 19px; font-weight: 600; margin: 10px 0 12px; }
.banner-dark .meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #b9c3d6; margin-top: 10px; }
.banner-dark .meta b { color: #fff; font-family: var(--mono); font-weight: 500; }
.banner-left { flex: 1; min-width: 260px; }
.seg { display: flex; height: 8px; border-radius: 99px; overflow: hidden; background: #2b3753; max-width: 620px; }
.seg i { display: block; height: 100%; transition: width .5s; }
.seg .s-done { background: #3fb68b; } .seg .s-call { background: #7ea1f0; } .seg .s-retry { background: var(--accent); }
.tag-live { display: inline-flex; align-items: center; gap: 6px; background: #2a3b63; color: #cfe0ff; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.tag-live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #7ea1f0; animation: pulse 1.4s infinite; }

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { position: relative; padding: 16px 16px 14px; border-top: 3px solid var(--k, var(--sidebar)); overflow: hidden; }
.kpi .kpi-label { font-size: 12.5px; color: var(--muted); }
.kpi .kpi-value { font: 500 28px/1.15 var(--mono); margin: 8px 0 4px; letter-spacing: -.02em; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); }
.kpi .ico3d { position: absolute; right: 10px; top: 12px; opacity: .95; }
.k-dark { --k: var(--sidebar); } .k-green { --k: #1e8a5e; } .k-amber { --k: #e08a2b; } .k-red { --k: #c23b3b; } .k-blue { --k: #2f56c9; }

/* ---------- result bars ---------- */
.hbar { display: grid; grid-template-columns: 120px 1fr 28px; align-items: center; gap: 10px; padding: 7px 0; font-size: 13.5px; }
.hbar .track { height: 8px; background: #edf0f5; border-radius: 99px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: inherit; }
.hbar .n { text-align: right; font-family: var(--mono); }
.foot-note { border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px; font-size: 12.5px; color: var(--muted); }

/* ---------- promise list ---------- */
.plist { display: flex; flex-direction: column; }
.prow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.prow:first-child { border-top: 0; }
.datetile { width: 46px; flex: none; text-align: center; border: 1px solid var(--border); border-radius: 9px; padding: 4px 0; background: #f8fafc; }
.datetile small { display: block; font-size: 10px; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.datetile b { display: block; font: 500 17px/1.1 var(--mono); }
.prow .who { flex: 1; min-width: 0; }
.prow .who b { display: block; font-weight: 550; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .who small { color: var(--muted); font-size: 12px; }
.prow .amt { font-family: var(--mono); font-size: 13.5px; }

/* ---------- task list ---------- */
.task { padding: 12px 0; border-top: 1px solid var(--border); }
.task:first-child { border-top: 0; padding-top: 4px; }
.task-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.task-top b { font-weight: 550; }
.task p { margin: 4px 0 10px; font-size: 12.5px; color: var(--muted); }
.task .actions { gap: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 14px; border-bottom: 1px solid var(--border); background: #f9fafc; white-space: nowrap; }
.t td { padding: 12px 14px; border-bottom: 1px solid #edf0f5; vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr:hover td { background: #f8fafc; }
.t td.num, .t td .num { font-family: var(--mono); }
.t .cust b { font-weight: 550; display: block; }
.t .cust small { font: 12px var(--mono); color: var(--muted); }
.t tr.is-live td { background: #f3f6fe; }
.t tr.is-skip td { color: var(--muted); }
.rowlink { color: inherit; text-decoration: none; }
.rowlink:hover b { text-decoration: underline; }
.listen { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }

/* ---------- tabs / filters ---------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; padding: 16px 16px 4px; }
.tab { min-height: 40px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border-strong); color: var(--text); text-decoration: none; font-size: 13.5px; font-weight: 500; background: #fff; }
.tab:hover { background: #f5f7fb; }
.tab.on { background: var(--sidebar); color: #fff; border-color: var(--sidebar); }

/* ---------- count cards ---------- */
.counts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.count { padding: 14px 16px; display: flex; justify-content: space-between; align-items: center; }
.count small { color: var(--muted); font-size: 12.5px; display: block; }
.count b { display: block; font: 500 26px/1.2 var(--mono); margin-top: 4px; }
.c-done b { color: var(--done-fg); } .c-call b { color: var(--calling-fg); } .c-retry b { color: var(--retry-fg); }

/* ---------- live strip ---------- */
.live-strip { display: flex; align-items: center; gap: 16px; justify-content: space-between; background: #e6ecfb; border: 1px solid #ccd8f6; border-radius: var(--radius); padding: 16px 18px; flex-wrap: wrap; }
.live-strip b { font-size: 15px; }
.live-strip .tail { color: var(--calling-fg); font-size: 13px; margin-top: 2px; }
.dot-live { width: 9px; height: 9px; border-radius: 50%; background: var(--calling-fg); flex: none; animation: pulse 1.4s infinite; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 12px; align-items: center; padding: 12px 16px; border-radius: 10px; border: 1px solid; font-size: 13.5px; margin-bottom: 16px; }
.alert .ico3d { width: 28px; height: 28px; }
.alert-warn { background: #fdf4e3; border-color: #f0dcae; color: #6b4a06; }
.alert-danger { background: var(--danger-bg); border-color: #ecc5c5; color: var(--danger-fg); }
.alert-ok { background: var(--done-bg); border-color: #c2e0d0; color: var(--done-fg); }
.alert-info { background: var(--calling-bg); border-color: #cbd8f6; color: var(--calling-fg); }
.alert .grow { flex: 1; }

/* ---------- forms ---------- */
label.lbl, .lbl { display: block; font-size: 12.5px; font-weight: 550; margin-bottom: 6px; color: #2b3340; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 9px; border: 1px solid var(--border-strong);
  background: #fff; font: 14px var(--sans); color: var(--text);
}
textarea.input { resize: vertical; line-height: 1.5; }
.input::placeholder { color: #9aa1ab; }
.input.err { border-color: #d28b8b; background: #fffafa; }
.field-err { color: var(--danger-fg); font-size: 12px; margin-top: 4px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; }
.fields-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--sidebar); flex: none; }
.check small { color: var(--muted); font-size: 12px; }
.chip { display: inline-block; font: 12px var(--mono); background: #eef1f6; border: 1px solid var(--border); padding: 1px 7px; border-radius: 6px; cursor: pointer; }
.chip:hover { background: #e9ebe5; }
.danger-note { background: var(--danger-bg); color: var(--danger-fg); padding: 12px 14px; border-radius: 9px; font-size: 13px; margin-top: 12px; }
.option-card { display: block; border: 1px solid var(--border-strong); border-radius: 10px; padding: 14px; cursor: pointer; margin-bottom: 10px; }
.option-card:has(input:checked) { border: 2px solid var(--sidebar); background: #f3f6fa; padding: 13px; }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card b { display: block; font-size: 14px; }
.option-card span { font-size: 12.5px; color: var(--muted); }
.preview-box { background: #f5f7fb; border: 1px dashed var(--border-strong); border-radius: 9px; padding: 12px 14px; font-size: 13.5px; }
.retry-row { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid #edf0f5; font-size: 13.5px; align-items: center; }
.retry-row:first-child { border-top: 0; }

/* ---------- sticky action bar ---------- */
.actionbar {
  position: fixed; left: calc(var(--sidebar-w) + 32px); right: 32px; bottom: 20px; z-index: 15;
  background: var(--sidebar); color: #fff; border-radius: 14px; padding: 16px 20px;
  display: flex; gap: 16px; align-items: center; justify-content: space-between; box-shadow: var(--shadow-lg); flex-wrap: wrap;
}
.actionbar b { font-size: 16px; }
.actionbar small { display: block; color: #b9c3d6; font-size: 12.5px; margin-top: 2px; }
.actionbar .btn-dark { background: #2a3b63; border-color: #2a3b63; }
.actionbar select { min-height: 44px; border-radius: 10px; border: 1px solid #34405c; background: #1a2540; color: #fff; padding: 0 10px; font: 14px var(--sans); }

/* ---------- call detail ---------- */
.player { background: var(--sidebar); color: #fff; border-radius: var(--radius); padding: 16px 18px; display: flex; align-items: center; gap: 16px; }
.player .play { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: var(--sidebar); display: grid; place-items: center; cursor: pointer; flex: none; }
.player .play:hover { background: #f0c45c; }
.player .body { flex: 1; min-width: 0; }
.player .row { display: flex; justify-content: space-between; font-size: 13px; color: #c9d1e0; margin-bottom: 8px; }
.player .row .mono { color: #fff; }
.player .track { height: 6px; background: #2c3854; border-radius: 99px; cursor: pointer; position: relative; }
.player .track i { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: inherit; width: 0; }
.player.locked { background: #eceef1; color: var(--queued-fg); }
.tline { display: grid; grid-template-columns: 52px 82px 1fr; gap: 10px; padding: 12px 6px; border-top: 1px solid #edf0f5; cursor: pointer; border-radius: 8px; }
.tline:first-child { border-top: 0; }
.tline:hover { background: #f8fafc; }
.tline.on { background: #fdf6e3; }
.tline .ts { font: 12.5px var(--mono); color: var(--muted); padding-top: 1px; }
.tline .sp { font-size: 12.5px; font-weight: 600; }
.tline .sp.ai { color: var(--calling-fg); } .tline .sp.cu { color: var(--done-fg); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid #edf0f5; font-size: 13.5px; }
.kv:first-child { border-top: 0; }
.kv span:first-child { color: var(--muted); }
.kv b { font-weight: 600; text-align: right; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: flex; gap: 10px; padding: 7px 0; font-size: 13.5px; align-items: flex-start; }
.steps .ico { margin-top: 2px; }
.steps .ok { color: var(--done-fg); } .steps .wait { color: var(--muted); } .steps .bad { color: var(--danger-fg); }

/* ---------- empty / login / misc ---------- */
.empty { text-align: center; padding: 36px 20px; color: var(--muted); }
.empty .ico3d { margin-bottom: 10px; }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: radial-gradient(900px 500px at 20% 10%, #263760 0%, var(--sidebar) 60%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h2 { font-size: 30px; font-weight: 600; line-height: 1.25; max-width: 420px; }
.login-art p { color: #b9c3d6; max-width: 420px; }
.login-art .floaters { display: flex; gap: 18px; margin: 28px 0; }
.login-form { display: grid; place-items: center; padding: 32px 20px; }
.login-form .card { width: 100%; max-width: 400px; padding: 28px; }
.demo-logins { font-size: 12.5px; color: var(--muted); margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.demo-logins button { font: 12.5px var(--mono); }
dialog { border: 0; border-radius: 14px; padding: 0; box-shadow: var(--shadow-lg); max-width: 440px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(16, 25, 43, .45); }
dialog .card-pad { padding: 22px; }
.toast { position: fixed; right: 24px; top: 20px; z-index: 50; max-width: 420px; animation: toast 4.5s forwards; }
@keyframes toast { 0%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-8px); pointer-events: none; } }
.code { font: 12.5px/1.6 var(--mono); background: #f5f7fb; border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; white-space: pre-wrap; overflow-x: auto; }
.flow { display: grid; gap: 10px; counter-reset: step; }
.flow li { list-style: none; display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.flow li::before { counter-increment: step; content: counter(step); width: 28px; height: 28px; border-radius: 50%; background: var(--sidebar); color: #fff; display: grid; place-items: center; font: 600 12.5px var(--mono); }
.flow li small { display: block; color: var(--muted); font-size: 12.5px; }
.mobile-nav-toggle { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) {
  .g-3 { grid-template-columns: 1fr 1fr; }
  .g-main-side { grid-template-columns: 1fr; }
  .counts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  /* sidebar becomes an off-canvas drawer opened from the top bar */
  .mobile-top { display: flex; }
  .sidebar { width: min(300px, 86vw); transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow-lg); overflow-y: auto; z-index: 40; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-backdrop { display: block; }
  body.nav-open { overflow: hidden; }
  .shell { flex-direction: column; }
  .main { margin-left: 0; padding: 18px 16px 140px; }
  .g-2, .g-3, .fields-2, .form-row { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .counts { grid-template-columns: 1fr 1fr; }
  .actionbar { left: 16px; right: 16px; bottom: 12px; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .auth-mobile-brand { display: flex; }
  .login-form { place-items: start center; padding-top: 20px; }
  .page-head h1 { font-size: 22px; }
  .hbar { grid-template-columns: 100px 1fr 24px; }
  .tline { grid-template-columns: 44px 1fr; }
  .tline .tx { grid-column: 1 / -1; }
  .retry-row { grid-template-columns: 1fr; gap: 6px; }
  .card-head { flex-wrap: wrap; }
  .t td, .t th { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }

/* ---------- auth (login / sign up / OTP) ---------- */
.auth-card { width: 100%; max-width: 440px; padding: 28px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: #eef1f6; border-radius: 10px; padding: 4px; margin-bottom: 22px; }
.auth-tabs a { min-height: 40px; display: grid; place-items: center; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; }
.auth-tabs a.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.auth-title { font-size: 22px; margin: 0 0 4px; }
.auth-sub { margin: 0 0 18px; font-size: 13.5px; }
.auth-foot { margin: 16px 0 0; }
.otp-input { font: 600 26px var(--mono); letter-spacing: .5em; text-align: center; padding-left: .5em; }
.art-points { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; color: #c9d1e0; font-size: 14px; }
.art-points li { display: flex; gap: 10px; align-items: center; }
.art-points .ico { color: var(--accent); }
@media (max-width: 860px) { .auth-card { padding: 22px 18px; } }
.hero-bot { position: relative; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 14px; margin: 8px 0 28px; }
.hero-bot::before { content: ''; position: absolute; left: -10px; top: -10px; width: 148px; height: 148px; border-radius: 50%; background: radial-gradient(circle, rgba(126, 161, 240, .28), transparent 70%); z-index: -1; }
.hero-bot-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: #cfe0ff; background: rgba(42, 59, 99, .7); border: 1px solid #34405c; border-radius: 99px; padding: 4px 12px; }
.hero-bot-tag .dot-live { background: #3fb68b; }

/* ---------- responsive extras ---------- */
.mobile-top { display: none; position: sticky; top: 0; z-index: 30; align-items: center; gap: 12px; background: var(--sidebar); color: #fff; padding: 10px 12px; }
.mobile-top .brand { padding: 0; flex: 1; }
.mobile-top .brand small { display: block; }
.menu-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid #34405c; border-radius: 10px; background: #1a2540; color: #fff; cursor: pointer; }
.mobile-top .badge-live { font-size: 11px; font-weight: 600; background: #e2eafb; color: var(--calling-fg); border-radius: 99px; padding: 2px 8px; display: inline-flex; align-items: center; gap: 4px; }
.nav-backdrop { display: none; position: fixed; inset: 0; background: rgba(16, 25, 43, .5); z-index: 35; border: 0; }
.auth-mobile-brand { display: none; flex-direction: column; align-items: center; gap: 10px; text-align: center; margin-bottom: 18px; }
.auth-mobile-brand b { font-size: 17px; }
.auth-mobile-brand small { color: var(--muted); display: block; font-size: 12.5px; }
.btn, .listen { white-space: nowrap; }

/* tablet / small laptop: an odd last card spans the full row instead of hanging half-width */
@media (max-width: 1100px) and (min-width: 861px) {
  .g-3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .banner-dark .meta { gap: 10px 18px; }
}

/* phones: tables marked .t-cards turn into stacked cards (no hidden columns) */
@media (max-width: 640px) {
  .t-cards thead { display: none; }
  .t-cards, .t-cards tbody, .t-cards tr, .t-cards td { display: block; width: 100%; }
  .t-cards tr { border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .t-cards tr:last-child { border-bottom: 0; }
  .t-cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .t-cards td[data-label]::before { content: attr(data-label); color: var(--muted); font: 600 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; text-align: left; flex: none; }
  .t-cards td.cust { text-align: left; padding-bottom: 6px; }
  .t-cards td.cust b { font-size: 15px; }
  .t-cards td:empty, .t-cards td.right:not(:has(*)) { display: none; }
  .t-cards td.right { justify-content: flex-end; padding-top: 8px; }
  .t-cards tr:hover td { background: transparent; }
  .t-cards tr.is-live { background: #f3f6fe; }
  .t-cards tr.is-live td { background: transparent; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; }
  .kpi .kpi-value { font-size: 24px; }
  .banner-dark { padding: 18px; }
  .banner-dark .actions { width: 100%; }
  .banner-dark .actions > * { flex: 1; }
  .banner-dark .actions form .btn { width: 100%; }
}
/* must come after the base `display: none` rules above */
@media (max-width: 860px) {
  .mobile-top, .auth-mobile-brand { display: flex; }
  .login-form { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 28px 16px; }
}

/* ---------- smooth page changes (same screen feel) ----------
   Cross-document View Transitions: on every same-origin navigation the parts
   that don't change (login art panel, sidebar, mobile top bar) stay put and only
   the content crossfades. Browsers without support simply navigate normally. */
/* off: prefetch already makes page changes instant, and a full-page crossfade
   on every click felt slower than just showing the next page */
@view-transition { navigation: none; }
.login-art { view-transition-name: auth-art; }
.sidebar { view-transition-name: sidebar; }
.mobile-top { view-transition-name: topbar; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .16s; animation-timing-function: ease-out; }
::view-transition-group(auth-art), ::view-transition-group(sidebar), ::view-transition-group(topbar) { animation-duration: .16s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- auth card: same screen, smooth switching ---------- */
/* anchored to the top so the tabs never move when the form height changes */
.login-form { place-items: start center; padding-top: clamp(32px, 10vh, 110px); }
.auth-card { view-transition-name: auth-card; }
.auth-tabs { position: relative; }
.auth-tabs-pill { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border-radius: 8px; box-shadow: var(--shadow); transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
.auth-tabs[data-active="signup"] .auth-tabs-pill { transform: translateX(100%); }
.auth-tabs a { position: relative; z-index: 1; transition: color .2s; }
.auth-tabs a.on { background: transparent; box-shadow: none; }
.auth-body { transition: opacity .16s ease; }
.auth-body.is-leaving { opacity: 0; }
.auth-body.is-entering { opacity: 0; transition: none; }

/* full navigations (form submits, panel links): old content leaves, then new arrives —
   never both at once, so no "double image" ghosting */
::view-transition-old(root), ::view-transition-old(auth-card) { animation: vt-out .11s ease-in both; }
::view-transition-new(root), ::view-transition-new(auth-card) { animation: vt-in .18s ease-out .07s both; }
::view-transition-group(auth-card) { animation-duration: .28s; animation-timing-function: cubic-bezier(.2, .8, .2, 1); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .auth-card, .auth-tabs-pill, .auth-body { transition: none; }
}

/* ---------- auth screen: fixed to the viewport, no page scrollbar ----------
   The page itself never scrolls; if a form is taller than a small screen, only
   the form column scrolls, with the scrollbar hidden. */
body.auth-page { overflow: hidden; height: 100vh; height: 100dvh; }
.auth-page .login-wrap { height: 100vh; height: 100dvh; min-height: 0; }
.auth-page .login-art { height: 100%; overflow: hidden; padding: clamp(28px, 6vh, 48px) 48px; }
.auth-page .login-form { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: clamp(20px, 6vh, 72px) 20px 24px; }
.auth-page .login-form::-webkit-scrollbar { display: none; }
.auth-page .auth-card { flex: none; }
@media (max-height: 760px) and (min-width: 861px) {
  .auth-page .login-art h2 { font-size: 26px; }
  .auth-page .art-points { margin-top: 12px; gap: 8px; }
  .auth-page .auth-card { padding: 22px 26px; }
  .auth-page .auth-sub { margin-bottom: 12px; }
  .auth-page .mb { margin-bottom: 12px; }
}

/* panel pages keep normal scrolling, with a slim scrollbar that matches the theme */
html { scrollbar-width: thin; scrollbar-color: #c2c9d5 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c2c9d5; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

/* auth card sits a bit lower on laptops/desktops (still top-anchored, so the
   tabs stay put when switching Log in / Sign up) */
.auth-page .login-form { padding-top: clamp(48px, 13vh, 130px); }
@media (max-width: 860px) { .auth-page .login-form { padding-top: 24px; } }

/* auth card is fixed in place: it never moves or scrolls with the page. The card
   always fits the screen; a long form (sign-up on a short screen) scrolls INSIDE
   the card, under fixed tabs, with no visible scrollbar. */
.auth-page .login-form { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow: hidden; padding-bottom: 24px; }
.auth-page .auth-mobile-brand { flex: none; }
.auth-page .auth-card { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
.auth-page .auth-tabs { flex: none; }
.auth-page .auth-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 4px; margin: -4px; }
.auth-page .auth-body::-webkit-scrollbar { display: none; }

/* ---------- AI agent mascot (login / sign up) ----------
   The image has a dark square background; a radial mask fades its edges into the
   panel. Motion: slow float + breathing glow + a ground shadow that shrinks as the
   robot rises — all on the same 5 s ease-in-out loop so they stay in sync. */
.agent { position: relative; width: 200px; height: 220px; }
.agent-img {
  position: relative; z-index: 1; display: block; width: 200px; height: 200px;
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 50%, transparent 70%);
          mask-image: radial-gradient(circle at 50% 46%, #000 50%, transparent 70%);
  animation: agent-float 5s ease-in-out infinite;
  will-change: transform;
}
.agent-glow {
  position: absolute; z-index: 0; left: 50%; top: 46%; width: 170px; height: 170px; margin: -85px 0 0 -85px;
  border-radius: 50%; background: radial-gradient(circle, rgba(94, 234, 234, .32), rgba(94, 234, 234, 0) 68%);
  animation: agent-glow 5s ease-in-out infinite;
}
.agent-shadow {
  position: absolute; left: 50%; bottom: 4px; width: 96px; height: 14px; margin-left: -48px;
  border-radius: 50%; background: radial-gradient(ellipse, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0) 70%);
  animation: agent-shadow 5s ease-in-out infinite;
}
@keyframes agent-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes agent-glow { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes agent-shadow { 0%, 100% { opacity: .5; transform: scaleX(1); } 50% { opacity: .25; transform: scaleX(.75); } }

.hero-bot { gap: 8px; margin: 0 0 22px -18px; }
.hero-bot::before { display: none; }
.hero-bot .hero-bot-tag { margin-left: 18px; }

/* small version above the form on phones */
.agent-sm { width: 96px; height: 104px; }
.agent-sm .agent-img { width: 96px; height: 96px; animation-name: agent-float-sm; }
.agent-sm .agent-glow { width: 84px; height: 84px; margin: -42px 0 0 -42px; }
.agent-sm .agent-shadow { width: 48px; height: 8px; margin-left: -24px; bottom: 2px; }
@keyframes agent-float-sm { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* short laptop screens: a bit smaller so everything fits */
@media (max-height: 760px) and (min-width: 861px) {
  .auth-page .agent { width: 150px; height: 166px; }
  .auth-page .agent .agent-img { width: 150px; height: 150px; }
  .auth-page .agent .agent-glow { width: 128px; height: 128px; margin: -64px 0 0 -64px; }
}
@media (prefers-reduced-motion: reduce) {
  .agent-img, .agent-glow, .agent-shadow { animation: none; }
}
/* art panel: brand at the top, mascot + headline centred in the remaining space */
.auth-page .login-art { justify-content: flex-start; }
.auth-page .login-art > div:last-child { margin: auto 0; }

/* mascot only: centred in the art panel, larger */
.hero-center { flex: 1; display: flex; align-items: center; justify-content: center; }
.auth-page .login-art > .hero-center { margin: 0; }
.agent-lg { width: 300px; height: 330px; }
.agent-lg .agent-img { width: 300px; height: 300px; animation-name: agent-float-lg; }
.agent-lg .agent-glow { width: 250px; height: 250px; margin: -125px 0 0 -125px; }
.agent-lg .agent-shadow { width: 140px; height: 18px; margin-left: -70px; bottom: 6px; }
@keyframes agent-float-lg { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }
@media (max-height: 760px) and (min-width: 861px) {
  .auth-page .agent-lg { width: 230px; height: 254px; }
  .auth-page .agent-lg .agent-img { width: 230px; height: 230px; }
  .auth-page .agent-lg .agent-glow { width: 190px; height: 190px; margin: -95px 0 0 -95px; }
}

/* =====================================================================
   Design pass: calmer and more "made by people".
   - numbers use the text font with aligned digits (no terminal look)
   - sentence-case table headers, fewer colours, no decorative borders
   ===================================================================== */
:root {
  --text: #18202b;
  --muted: #5d6673;
  --border: #e6e7e3;
  --code: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}
body { font-size: 14.5px; line-height: 1.55; }

.mono, .num, .t td.num, .t .cust small, .kpi .kpi-value, .count b, .meter-value, .datetile b,
.prow .amt, .player .row .mono, .tline .ts, .hbar .n, .banner-dark .meta b {
  font-family: var(--sans) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.code, .otp-input, .chip { font-family: var(--code); }

.page-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -0.02em; }
.eyebrow { font-size: 13px; color: var(--muted); }
.card-head h2, .card-title { font-size: 16px; font-weight: 600; letter-spacing: -0.005em; }
.card-head .sub { font-size: 13px; }
.card-head .sub.good { color: var(--done-fg); font-weight: 600; font-size: 14px; }

/* tables: quiet headers */
.t th { text-transform: none; letter-spacing: 0; font: 500 12.5px var(--sans); color: var(--muted); background: transparent; }
.t td { padding: 13px 16px; }
.t th { padding: 10px 16px; }
.pill { font-weight: 500; }

/* KPI cards: label, number, one plain sentence */
.kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi { border-top: 0; padding: 18px 20px; }
.kpi .kpi-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.kpi .kpi-value { font-size: 30px; font-weight: 600; margin: 6px 0 2px; letter-spacing: -0.02em; line-height: 1.2; }
.kpi .kpi-sub { font-size: 13px; color: var(--muted); }
.kpi-good .kpi-value { color: #0a6b47; }
.kpi-warn .kpi-value { color: #b4530a; }
.count b { font-size: 26px; font-weight: 600; }
.count small { font-size: 13px; font-weight: 500; }

/* notices: one calm style instead of coloured alert boxes with big icons */
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--border); margin-bottom: 16px; box-shadow: var(--shadow); }
.notice p { margin: 0; }
.notice .ico { margin-top: 3px; color: var(--muted); flex: none; }
.notice-danger { border-color: #efc9c9; background: #fdf7f7; }
.notice-danger .ico { color: var(--danger-fg); }
.notice-good .ico { color: var(--done-fg); }

/* the running campaign: a light card, not a dark banner */
.campaign-strip { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 20px 24px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: var(--shadow); }
.campaign-strip-main { flex: 1; min-width: 260px; }
.campaign-strip-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #c2c9d5; }
.status-dot.is-live { background: #1e9e6a; box-shadow: 0 0 0 4px rgba(30, 158, 106, .15); animation: pulse 1.6s infinite; }
.campaign-strip h2 { font-size: 20px; font-weight: 600; margin: 6px 0 12px; letter-spacing: -0.01em; }
.progress { display: flex; height: 6px; border-radius: 99px; background: #edf0f5; overflow: hidden; max-width: 560px; }
.progress i { display: block; height: 100%; transition: width .5s; }
.p-done { background: #1e9e6a; } .p-call { background: #5b7fe0; } .p-retry { background: #e9b949; }
.campaign-strip-meta { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.campaign-strip-meta b { color: var(--text); font-weight: 600; }
.btn-quiet { background: #fff; }

.count-badge { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 99px; background: var(--danger-bg); color: var(--danger-fg); font-size: 12.5px; font-weight: 600; display: inline-grid; place-items: center; }
.select-sm { min-height: 36px; padding: 4px 8px; width: auto; font-size: 13px; }
.last-campaign { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.muted-inline { color: var(--muted); font-weight: 400; margin-left: 4px; }
.foot-note { font-size: 13px; }
.empty .ico3d { opacity: .9; }
.empty b { font-weight: 600; }

/* sidebar: a touch softer */
.nav a { font-weight: 500; }
.meter-value small { font-size: 12.5px; }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .kpi .kpi-value { font-size: 24px; }
  .campaign-strip { padding: 18px; }
  .campaign-strip .actions { width: 100%; }
  .campaign-strip .actions > * { flex: 1; }
  .campaign-strip .actions form .btn { width: 100%; }
}

/* no visible scrollbars anywhere — pages still scroll with wheel, touchpad, touch and keys */
html, body, .table-wrap, .sidebar, .auth-body, .login-form { scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .sidebar::-webkit-scrollbar { display: none; width: 0; height: 0; }
::-webkit-scrollbar { width: 0; height: 0; }

/* add-a-number row: fields line up at the top, so an error message under one
   field never pushes the others down; the button sits level with the inputs */
.form-row { align-items: start; }
.form-row > .btn { margin-top: calc(12.5px * 1.55 + 6px); }
@media (max-width: 860px) { .form-row > .btn { margin-top: 4px; } }

/* small counters under a card title */
.counters { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.counter { display: inline-block; white-space: nowrap; line-height: 1.6; font-size: 12.5px; color: var(--muted); background: #eef1f6; border-radius: 99px; padding: 2px 10px; cursor: default; }
.counter b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.counter-good { background: var(--done-bg); color: var(--done-fg); }
.counter-good b { color: var(--done-fg); }

/* ---------- your profile in the sidebar ---------- */
.sidebar { overflow-y: auto; }                       /* short screens: everything stays reachable */
.userbox { display: flex; align-items: center; gap: 6px; margin-top: 12px; padding: 10px 0 0; border-top: 1px solid #1f2a44; }
.userbox-me { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; text-decoration: none; color: inherit; }
.userbox-me:hover, .userbox-me.active { background: var(--sidebar-2); }
.userbox-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.userbox-text b { color: #fff; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.userbox-text small { color: #8d98ae; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--sidebar); font: 600 13px var(--sans); }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.logout-btn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 0; background: none; color: #8d98ae; cursor: pointer; }
.logout-btn:hover { background: var(--sidebar-2); color: #fff; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head h1 { margin: 0; }

/* right-aligned columns: header and cells line up (beats the generic `.t th { text-align: left }`) */
.t th.right, .t td.right { text-align: right; }

/* ---------- Logic Flow page ---------- */
.logic .card-title { margin: 0 0 14px; }
.logic-intro { margin: -10px 0 16px; color: var(--muted); font-size: 13.5px; }
.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 8px; }
.steps-list li { counter-increment: step; display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.steps-list li::before { content: counter(step); width: 26px; height: 26px; border-radius: 50%; background: #eef1f6; color: var(--text); display: grid; place-items: center; font: 600 12.5px var(--sans); }
.steps-list li:not(:has(.pill)) { grid-template-columns: 28px 1fr; }
.step-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.step-text b { font-weight: 600; font-size: 14px; }
.step-text span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.never { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: #fdf3f3; border: 1px solid #f1d4d4; color: #7a2020; font-size: 13.5px; }
.never b { font-weight: 600; }
.rule-table { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 0 16px; }
.rule-table dt, .rule-table dd { margin: 0; padding: 11px 0; border-top: 1px solid #edf0f5; font-size: 13.5px; }
.rule-table dt:first-of-type, .rule-table dd:first-of-type { border-top: 0; }
.rule-table dt { display: flex; align-items: flex-start; }
.rule-table dd { color: var(--muted); }
.rule-table-wide dt b { font-weight: 600; font-size: 13.5px; }
@media (max-width: 640px) {
  .steps-list li { grid-template-columns: 26px 1fr; }
  .steps-list li .pill { grid-column: 2; justify-self: start; }
  .rule-table { grid-template-columns: 1fr; }
  .rule-table dd { padding-top: 2px; border-top: 0; }
}

/* contacts list header: title · filter tabs · search, on one line */
.list-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px 14px; }
.list-head h2 { font-size: 16px; font-weight: 600; margin: 0; }
.list-search { margin-left: auto; min-width: 240px; flex: 0 1 300px; }
.seg-tabs { display: inline-flex; gap: 2px; padding: 3px; background: #eef1f6; border-radius: 10px; }
.seg-tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.seg-tabs a:hover { color: var(--text); }
.seg-tabs a.on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.seg-tabs a span { font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 600; color: var(--muted); background: rgba(0, 0, 0, .05); border-radius: 99px; padding: 0 7px; line-height: 1.6; }
.seg-tabs a span.good { color: var(--done-fg); background: var(--done-bg); }
@media (max-width: 860px) {
  .list-search { margin-left: 0; flex: 1 1 100%; min-width: 0; }
  .seg-tabs { overflow-x: auto; max-width: 100%; }
}
.page-sub .campaign-name { color: var(--text); font-weight: 600; }

/* ---------- running campaign strip (dashboard) ---------- */
.campaign-strip { display: block; padding: 20px 24px; }
.strip-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.strip-title { min-width: 0; }
.strip-title h2 { margin: 8px 0 0; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.state-chip { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 500; padding: 3px 10px 3px 8px; border-radius: 99px; background: #eef1f6; color: var(--muted); }
.state-chip.is-live { background: var(--done-bg); color: var(--done-fg); }
.state-chip.is-waiting { background: #fbf3e2; color: #8a5a07; }
.state-chip.is-waiting .status-dot { background: #e0a43a; }
.state-chip.is-paused { background: #eef1f6; color: var(--muted); }
.campaign-strip .progress { max-width: none; margin: 16px 0 14px; height: 8px; }
.strip-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; }
.strip-stats > div { padding: 2px 0 2px 14px; border-left: 2px solid #edf0f5; }
.strip-stats dt { font-size: 12.5px; color: var(--muted); }
.strip-stats dd { margin: 2px 0 0; font-size: 16px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.strip-note { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
@media (max-width: 860px) {
  .strip-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip-head .actions { width: 100%; }
  .strip-head .actions > * { flex: 1; }
  .strip-head .actions form .btn { width: 100%; }
}

/* ---------- status tags: a small coloured dot + plain text (no coloured bubbles) ---------- */
.pill {
  background: none !important; padding: 0; border-radius: 0; gap: 7px;
  font: 500 13px/1.5 var(--sans); color: var(--text);
}
.pill::before { content: ''; flex: none; width: 7px; height: 7px; border-radius: 50%; background: #a3a9b2; }
.pill-done::before { background: #1e9e6a; }
.pill-calling::before { background: #4f74d9; }
.pill-retry::before { background: #e0a43a; }
.pill-queued::before { background: #a3a9b2; }
.pill-danger::before { background: #d14343; }
.pill-danger { color: #8a1c1c; }
.pill-live::before { animation: pulse 1.4s infinite; }

/* ---- No sideways movement: the page never scrolls or swipes left/right ---- */
html { overscroll-behavior: none; }
body { overflow-x: clip; }
.table-wrap, .sidebar, dialog { overscroll-behavior: none; }
@media (min-width: 861px) and (max-width: 1280px) {
  .t th, .t td { padding-left: 10px; padding-right: 10px; }
  .t td.nowrap { white-space: normal; }
}
/* tablets and small laptops: wide tables stack into cards instead of scrolling sideways */
@media (max-width: 1000px) {
  .t-cards thead { display: none; }
  .t-cards, .t-cards tbody, .t-cards tr, .t-cards td { display: block; width: 100%; }
  .t-cards tr { border-bottom: 1px solid var(--border); padding: 12px 16px; }
  .t-cards tr:last-child { border-bottom: 0; }
  .t-cards td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
  .t-cards td[data-label]::before { content: attr(data-label); color: var(--muted); font: 600 11px var(--sans); letter-spacing: .06em; text-transform: uppercase; text-align: left; flex: none; }
  .t-cards td.cust { text-align: left; padding-bottom: 6px; }
  .t-cards td:empty, .t-cards td.right:not(:has(*)) { display: none; }
  .t-cards td.right { justify-content: flex-end; padding-top: 8px; }
  .t-cards tr:hover td { background: transparent; }
}
@media (max-width: 1000px) {
  .t-cards td { flex-wrap: wrap; min-width: 0; }
  .t-cards td.cust small { overflow-wrap: anywhere; }
}
@media (max-width: 480px) {
  .seg-tabs { display: flex; width: 100%; overflow: visible; }
  .seg-tabs a { flex: 1 1 auto; justify-content: center; padding: 0 6px; gap: 4px; font-size: 13px; }
}

/* ---- Script & Rules: retry rules ---- */
.rules { display: flex; flex-direction: column; }
.rule { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 14px 0; border-top: 1px solid #edf0f5; align-items: start; }
.rule:first-child { border-top: 0; }
.rule-name .pill { font-size: 13.5px; }
.rule-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rule-fields { display: flex; flex-wrap: wrap; gap: 8px; }
.numf { display: inline-flex; align-items: center; gap: 10px; padding: 3px 12px 3px 3px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; font-size: 13.5px; color: var(--muted); white-space: nowrap; cursor: text; }
.numf:focus-within { border-color: var(--link); background: #fff; }
.numf .input { width: 56px; height: 32px; min-height: 0; padding: 0 6px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; border-radius: 8px; }
.rule-note { margin: 0; font-size: 13.5px; color: var(--muted); }

/* ---- Script & Rules: call script ---- */
.script-vars { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; color: var(--muted); }
.script-vars > span { font-weight: 600; margin-right: 4px; }
.script-vars .chip { background: #fff; padding: 2px 8px; }
.script-vars .chip:hover { background: #eef1f6; border-color: var(--border-strong); }
.script-line + .script-line { margin-top: 18px; }
.script-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.script-n { width: 22px; height: 22px; border-radius: 50%; background: var(--sidebar); color: #fff; display: grid; place-items: center; font-size: 11.5px; font-weight: 600; flex: none; }
.script-head label { font-weight: 600; font-size: 14px; }
.script-when { font-size: 12.5px; color: var(--faint); margin-left: auto; }
.script-box { border: 1px solid var(--border-strong); border-radius: 10px; background: #fff; overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.script-box:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px rgba(27, 58, 158, .12); }
.script-box.has-err { border-color: #d14343; }
.script-input { display: block; width: 100%; border: 0; outline: 0; resize: vertical; padding: 12px 14px; font: inherit; font-size: 14px; line-height: 1.6; color: var(--text); background: transparent; }
.script-preview { padding: 10px 14px 12px; border-top: 1px dashed var(--border); background: #f8fafc; font-size: 13.5px; line-height: 1.6; color: var(--text); }
.script-preview-tag { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); margin-bottom: 2px; }
@media (max-width: 640px) { .script-when { margin-left: 30px; flex-basis: 100%; } }

/* ---- detail pages: a quiet chevron right before the title ---- */
.title-row { display: flex; align-items: center; gap: 4px; min-width: 0; margin-left: -10px; }
.title-row h1 { min-width: 0; overflow-wrap: anywhere; }
.back-btn { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); text-decoration: none; transition: background .12s, color .12s; }
.back-btn svg { stroke-width: 2.25; }
.back-btn:hover { background: #e6eaf1; color: var(--text); }
.back-btn:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.title-row + .page-sub { padding-left: 30px; }
.page-sub.meta > span:not(.pill) + span::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; margin: 0 10px 0 2px; }
@media (max-width: 640px) { .title-row + .page-sub { padding-left: 0; } .title-row { margin-left: -8px; } }

/* ---- call detail: result card ---- */
.result-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.result-head .pill { font-size: 14px; }
.result-sure { font-size: 12.5px; color: var(--muted); background: #eef1f6; border-radius: 99px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.result-summary { margin: 0 0 14px; color: #2b3340; line-height: 1.6; }
.result-hi { display: flex; flex-direction: column; gap: 2px; background: var(--done-bg); color: var(--done-fg); border-radius: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 14px; }
.result-hi.is-blue { background: var(--calling-bg); color: var(--calling-fg); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.fact { border: 1px solid var(--border); border-radius: 10px; padding: 9px 12px; background: #f8fafc; min-width: 0; }
.fact span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.fact b { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--text); }
.fact b.ok { color: var(--done-fg); }
.fact b.bad { color: var(--danger-fg); }
.fact b.warn { color: var(--retry-fg); }
.grid.pair { align-items: start; }
@media (max-width: 1280px) and (min-width: 1001px) { .grid.pair { grid-template-columns: 1fr; } }
/* short calls: result, next steps and call info sit in one row under the transcript */
.detail-cards { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 860px) { .detail-cards { grid-template-columns: 1fr; } }
.detail-cards > .stack { min-width: 0; }

/* ---- Tasks page: one clean card per task ---- */
.task-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
@media (max-width: 1100px) { .task-grid { grid-template-columns: 1fr; } }
.tcard { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.tcard-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tcard-who { min-width: 0; }
.tcard-who > a b { font-size: 16px; font-weight: 600; }
.tcard-meta { margin-top: 2px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; }
.tcard-meta b { color: var(--text); font-weight: 600; }
.tcard-meta > span + span::before { content: ''; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .55; vertical-align: middle; margin: 0 9px; }
.tcard-tags { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.tcard-note { margin: 0; padding: 12px 14px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; color: #2b3340; font-size: 14px; line-height: 1.55; }
.tcard-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tcard-when { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.tcard-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tcard-close { border-top: 1px solid var(--border); padding-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.tcard-close fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.tcard-close legend { font-size: 13px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.choices { display: flex; flex-direction: column; gap: 6px; }
.choice-wrap { border: 1px solid var(--border); border-radius: 10px; transition: border-color .12s, background .12s; }
.choice-wrap:hover { border-color: var(--border-strong); }
.choice-wrap:has(input[type=radio]:checked) { border-color: var(--sidebar); background: #f5f7fb; }
.choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; font-size: 14px; }
.choice input { margin: 0; width: 16px; height: 16px; accent-color: var(--sidebar); flex: none; }
.choice-extra { display: none; padding: 0 12px 12px 38px; }
.choice-wrap:has(input[type=radio]:checked) .choice-extra { display: block; }
.phone-field { display: flex; align-items: stretch; height: 40px; background: #fff; border: 1px solid var(--border-strong); border-radius: 8px; overflow: hidden; }
.phone-field:focus-within { border-color: var(--link); box-shadow: 0 0 0 3px rgba(27, 58, 158, .12); }
.phone-field span { display: grid; place-items: center; padding: 0 12px; background: #f5f7fb; border-right: 1px solid var(--border); color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.phone-field input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0 12px; font: inherit; font-size: 14px; letter-spacing: .02em; background: transparent; color: var(--text); }
.tcard-submit { display: flex; gap: 8px; }
.tcard-submit .input { flex: 1; min-width: 0; }
.tcard-submit .btn { flex: none; }
.tcard-done { display: flex; gap: 8px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--done-fg); }
.tcard-done svg { margin-top: 3px; flex: none; }
@media (max-width: 480px) { .tcard-submit { flex-direction: column; } .tcard-head { flex-direction: column; } .tcard-tags { justify-content: flex-start; } }

/* live site on the mock phone line */
.test-strip { display: flex; align-items: center; gap: 8px; margin: -8px 0 16px; padding: 8px 14px; border-radius: 10px; background: #fdf4e3; border: 1px solid #f1d9a8; color: #6b4a0f; font-size: 13px; }
.test-strip .status-dot { background: #e0a43a; }

/* ---- Try Luna ---- */
.try-chat { display: flex; flex-direction: column; height: min(72vh, 680px); min-height: 460px; overflow: hidden; }
.try-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.try-head b { display: block; font-size: 15px; }
.try-head small { display: block; font-size: 12.5px; color: var(--muted); }
.try-avatar img { display: block; border-radius: 10px; }
.try-voice { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.try-voice input { accent-color: var(--sidebar); }
.try-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; overscroll-behavior: contain; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.ai { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble.customer { align-self: flex-end; background: var(--sidebar); color: #fff; border-bottom-right-radius: 4px; }
.bubble.typing { color: var(--muted); font-style: italic; }
.bubble.note { align-self: center; max-width: 92%; background: var(--danger-bg); color: var(--danger-fg); font-size: 13px; border-radius: 10px; }
.try-quick { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px 0; }
.try-quick .chip { font: 12.5px var(--sans); padding: 4px 10px; border-radius: 99px; background: #fff; }
.try-input { display: flex; gap: 8px; padding: 12px 18px 16px; }
.try-input .input { flex: 1; min-width: 0; }
.try-facts { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.try-facts > div { flex: 1; min-width: 120px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: #f8fafc; }
.try-facts span { display: block; font-size: 12px; color: var(--muted); }
.try-facts b { font-size: 14px; }
.try-setup code { font: 12.5px var(--mono); background: #eef1f6; padding: 1px 6px; border-radius: 5px; }
@media (max-width: 640px) { .try-chat { height: 70vh; } .bubble { max-width: 88%; } }
.hear-btn { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; padding: 1px 8px; border: 1px solid var(--border); border-radius: 99px; background: #fff; color: var(--text); font: 600 11px var(--sans); letter-spacing: 0; text-transform: none; cursor: pointer; vertical-align: middle; }
.hear-btn:hover { border-color: var(--border-strong); }
.hear-btn:disabled { opacity: .5; cursor: progress; }
