:root {
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a;
  --bg: #f4f6fa; --panel: #ffffff; --ink: #1b2330; --muted: #657085; --line: #e2e6ee;
  --brand: #2563eb; --brand-ink: #ffffff; --brand-soft: #e8efff;
  --ok: #15803d; --ok-soft: #e3f5e9; --warn: #b45309; --warn-soft: #fdf1dc; --bad: #c2410c; --bad-soft: #fde8df;
  --info: #0e7490; --info-soft: #dff4f8; --gray-soft: #eef0f4;
  --side: #111a2b; --side-ink: #c9d2e3; --side-active: #22314d;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1420; --panel: #171e2c; --ink: #e5e9f1; --muted: #9aa5b8; --line: #2a3346;
    --brand: #4f86ff; --brand-soft: #1d2a47; --ok: #4ade80; --ok-soft: #173326; --warn: #fbbf24; --warn-soft: #3a2e12;
    --bad: #fb923c; --bad-soft: #3d2216; --info: #22d3ee; --info-soft: #11323a; --gray-soft: #222a3a;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70;
    --side: #0b101a; --side-active: #1d2a47; --shadow: none;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.err { color: var(--bad); min-height: 18px; font-size: 13px; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

/* layout */
.app { display: flex; min-height: 100vh; }
.side { width: 220px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { font-weight: 700; font-size: 16px; padding: 18px 18px 14px; color: #fff; display: flex; gap: 8px; align-items: center; }
.brand.big { color: var(--ink); font-size: 20px; padding: 0 0 18px; justify-content: center; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--brand); color: #fff; font-size: 15px; }
nav { flex: 1; overflow-y: auto; padding: 4px 10px; }
nav a { display: flex; gap: 10px; align-items: center; color: var(--side-ink); padding: 9px 10px; border-radius: 8px; margin: 2px 0; }
nav a:hover { background: var(--side-active); text-decoration: none; color: #fff; }
nav a.active { background: var(--side-active); color: #fff; font-weight: 600; }
nav .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #6e7a91; padding: 14px 10px 4px; }
.side-foot { padding: 14px 18px; border-top: 1px solid #22304a; }
.side-foot a { color: var(--side-ink); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-right { margin-left: auto; }
.client-pick select { min-width: 220px; }
.menu-btn { display: none; }
.view { padding: 22px 24px 60px; max-width: 1400px; width: 100%; }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 16px; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush > h2, .panel.flush > .panel-head { padding: 14px 16px 0; }
.panel-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 22px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.card .s { color: var(--muted); font-size: 12px; }
.card.ok .v { color: var(--ok); } .card.bad .v { color: var(--bad); } .card.warn .v { color: var(--warn); }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--gray-soft); white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--brand-soft); }
tr.click { cursor: pointer; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 16px; }

/* forms */
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
label > input, label > select, label > textarea { margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
input[type=checkbox], input[type=radio] { width: auto; margin: 0 6px 0 0; vertical-align: middle; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea { min-height: 120px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--ink); font-size: 14px; margin: 4px 0; }
.checklist { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; max-height: 220px; overflow-y: auto; margin-top: 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; margin-top: 4px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters label { margin: 0; min-width: 130px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--brand); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 10px; font-size: 12px; }
.btn.icon { padding: 6px 10px; }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.btn:disabled { opacity: .5; cursor: default; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.info { background: var(--info-soft); color: var(--info); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* bars */
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 10px; align-items: center; font-size: 13px; }
.bar { height: 14px; background: var(--brand); border-radius: 4px; min-width: 2px; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--gray-soft); margin: 6px 0 10px; }
.stack > div { height: 100%; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: middle; }
.c-ok { background: var(--ok); } .c-warn { background: var(--warn); } .c-bad { background: var(--bad); } .c-info { background: var(--info); } .c-gray { background: #9aa5b8; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13px; }
.kv div:nth-child(odd) { color: var(--muted); }
.list-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.list-item:hover { background: var(--gray-soft); }
.list-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.list-item .count { margin-left: auto; }
.secret { background: var(--gray-soft); padding: 10px; border-radius: 8px; word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
audio { height: 32px; max-width: 260px; }
.recbox { display: flex; align-items: center; gap: 12px; margin: 4px 0 10px; }
#recTime { font-size: 18px; min-width: 50px; }
#recPrev { width: 100%; max-width: none; margin-bottom: 10px; }
.namevoice { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.namevoice label.btn { margin: 0; color: var(--ink); font-size: 12px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }

/* modal & toasts */
dialog.wide { width: min(860px, calc(100vw - 32px)); }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--panel); color: var(--ink); }
dialog::backdrop { background: rgba(10, 15, 25, .45); }
#modalBody { padding: 20px; max-height: 80vh; overflow-y: auto; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); max-width: 380px; }
.toast.bad { background: var(--bad); color: #fff; }

/* charts */
.c-s1 { background: var(--s1); } .c-s2 { background: var(--s2); } .c-s3 { background: var(--s3); }
.chart .legend { margin-bottom: 10px; }
.plot { position: relative; margin-left: 40px; }
.plot .grid > div { position: absolute; left: 0; right: 0; border-top: 1px solid var(--line); }
.plot .grid span { position: absolute; left: -40px; width: 34px; text-align: right; top: -8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cols { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3px; }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; cursor: default; min-width: 0; }
.col.hover { background: var(--gray-soft); border-radius: 4px 4px 0 0; }
.stackcol { width: 100%; max-width: 38px; display: flex; flex-direction: column; gap: 2px; border-radius: 4px 4px 0 0; overflow: hidden; }
.seg { min-height: 2px; }
.xlabels { display: flex; gap: 3px; margin-left: 40px; margin-top: 4px; }
.xlabels > div { flex: 1; min-width: 0; text-align: center; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: visible; }
.charttip { position: fixed; z-index: 60; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0,0,0,.15); pointer-events: none; }
.charttip strong { display: block; margin-bottom: 4px; }
.dir { font-weight: 700; } .dir.in { color: var(--ok); } .dir.out { color: var(--brand); }
.quick { display: flex; gap: 4px; align-items: flex-end; padding-bottom: 2px; }
.tabs { flex-wrap: wrap; }
.convrow > td { background: var(--gray-soft); }
.convrow:hover { background: transparent; }
.timeline { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.tl-item { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; background: var(--panel); border-left: 4px solid var(--line); max-width: 760px; }
.tl-item.reply { border-left-color: var(--brand); margin-left: 40px; }
.tl-item.playing { outline: 2px solid var(--brand); }
.tl-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 300px; flex: 1; }
.panel.note { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); padding: 10px 14px; }

@media (max-width: 900px) {
  .side { position: fixed; left: -240px; z-index: 20; transition: left .2s; }
  .side.open { left: 0; }
  .menu-btn { display: inline-flex; }
  .grid2, .grid3, .split { grid-template-columns: minmax(0, 1fr); }
  .view { padding: 16px; }
  .top { padding: 10px 16px; }
  .client-pick select { min-width: 0; max-width: 55vw; }
}
@media print {
  .side, .top, .no-print, .btn, .pager, .filters { display: none !important; }
  .view { padding: 0; max-width: none; }
  .panel, .card { box-shadow: none; break-inside: avoid; }
  body { background: #fff; }
}

/* ---------- browser phone ---------- */
.navbadge { margin-left: auto; background: #ef4444; color: #fff; border-radius: 10px; font-size: 11px; font-weight: 700; padding: 1px 7px; }
.ext-warn { display: block; color: var(--bad); font-size: 12px; font-weight: 500; margin-top: 3px; }
input.invalid { border-color: var(--bad); }
.exttable td { vertical-align: top; }
.exttable tr.dirty { background: var(--warn-soft); }
.exttable tr.error { background: var(--bad-soft); }
.zp-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 24px; box-shadow: 0 4px 14px rgba(0,0,0,.25); display: grid; place-items: center; }
.zp-dot { position: absolute; right: 4px; top: 4px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--panel); background: #9aa5b8; }
.zp-fab[data-state="ok"] .zp-dot { background: #22c55e; }
.zp-fab[data-state="err"] .zp-dot { background: #ef4444; }
.zp-fab[data-state="wait"] .zp-dot { background: #f59e0b; }
.zp-badge { position: absolute; left: -2px; top: -2px; min-width: 20px; height: 20px; border-radius: 10px; background: #ef4444; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.zp-box { position: fixed; right: 20px; bottom: 88px; z-index: 41; width: 320px; max-width: calc(100vw - 32px); max-height: calc(100vh - 110px); overflow-y: auto;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 14px; }
.zp-head { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.zp-head > div { flex: 1; }
.zp-sub { font-size: 12px; color: var(--muted); }
.zp-x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.zp-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.zp-row select { flex: 1; }
.zp-dnd { display: flex; align-items: center; gap: 4px; margin: 0; font-size: 12px; white-space: nowrap; }
.zp-dialrow { display: flex; gap: 6px; margin-bottom: 8px; }
.zp-dialrow input { font-size: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.zp-back { border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 8px; padding: 0 12px; cursor: pointer; }
.zp-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.zp-pad button { font-size: 18px; padding: 10px 0; border-radius: 10px; border: 1px solid var(--line); background: var(--gray-soft); color: var(--ink); cursor: pointer; }
.zp-pad button:hover { border-color: var(--brand); }
.zp-call, .zp-ans { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: #16a34a; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; }
.zp-call:disabled { opacity: .5; cursor: default; }
.zp-hang, .zp-dec { width: 100%; padding: 12px; border: 0; border-radius: 10px; background: #dc2626; color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 8px; }
.zp-incoming { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.zp-incoming .zp-dec { margin-top: 0; }
.zp-peer { font-size: 22px; font-weight: 700; text-align: center; margin-top: 8px; font-variant-numeric: tabular-nums; }
.zp-callstate { text-align: center; color: var(--muted); margin: 4px 0 12px; font-size: 13px; }
.zp-ctrls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.zp-ctrls button { padding: 8px 4px; font-size: 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; }
.zp-ctrls button.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 700; }
#zpRec.on { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.zp-newcall { width: 100%; margin: 4px 0 10px; padding: 8px; border: 1px dashed var(--line); background: none; color: var(--brand); border-radius: 8px; cursor: pointer; font-weight: 600; }
.zp-card { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: var(--panel); }
.zp-card.ringing { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.25); animation: zpPulse 1.2s infinite; }
.zp-card.active { border-color: var(--brand); }
.zp-card.held { background: var(--warn-soft); border-color: var(--warn); }
.zp-card.ended { opacity: .6; }
@keyframes zpPulse { 50% { box-shadow: 0 0 0 5px rgba(22,163,74,.12); } }
.zp-cpeer { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.zp-cstate { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.zp-cbtns { display: flex; flex-wrap: wrap; gap: 6px; }
.zp-b { flex: 1 1 auto; padding: 7px 8px; font-size: 12px; font-weight: 600; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; white-space: nowrap; }
.zp-b:disabled { opacity: .5; cursor: default; }
.zp-b.ans { background: #16a34a; border-color: #16a34a; color: #fff; }
.zp-b.dec { background: #dc2626; border-color: #dc2626; color: #fff; }
.zp-b.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.zp-b.rec { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.zp-xlist { display: grid; gap: 6px; margin-bottom: 12px; }
.zp-xlist .btn { justify-content: flex-start; }
.zp-xdot { width: 9px; height: 9px; border-radius: 50%; background: #9aa5b8; display: inline-block; }
.zp-xdot.on { background: #22c55e; }
.zp-hist-h { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.zp-link { border: 0; background: none; color: var(--brand); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.zp-hist { max-height: 200px; overflow-y: auto; }
.zp-h { display: flex; align-items: center; gap: 8px; padding: 5px 2px; border-bottom: 1px solid var(--line); font-size: 13px; }
.zp-hn { flex: 1; font-variant-numeric: tabular-nums; }
.zp-ht { color: var(--muted); font-size: 11px; }
.zp-hd.out { color: var(--brand); } .zp-hd.in { color: var(--ok); } .zp-hd.miss { color: var(--bad); }
.zp-empty { color: var(--muted); font-size: 13px; padding: 10px 0; text-align: center; }
[data-dial] { text-decoration: none; }
@media print { .zp-fab, .zp-box { display: none !important; } }

/* ---------- contact book ---------- */
.panel.warnbox { border-color: var(--info); background: var(--info-soft); color: var(--ink); padding: 10px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel.warnbox .btn { margin-left: auto; }
.msel { position: relative; margin-top: 4px; }
.msel > summary { list-style: none; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; padding: 8px 30px 8px 10px; background: var(--panel); color: var(--ink); font-weight: 500; font-size: 14px; position: relative; }
.msel > summary::-webkit-details-marker { display: none; }
.msel > summary::after { content: '▾'; position: absolute; right: 10px; top: 8px; color: var(--muted); }
.msel[open] > summary { border-color: var(--brand); }
.msel-list { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.15); max-height: 240px; overflow-y: auto; }

/* ---------- caller panel (slides in from the left) ---------- */
.zc-panel { position: fixed; left: 0; top: 0; bottom: 0; z-index: 42; width: 420px; max-width: 100vw; overflow-y: auto; background: var(--panel); color: var(--ink);
  border-right: 1px solid var(--line); box-shadow: 8px 0 30px rgba(0,0,0,.18); padding: 16px; transform: translateX(-105%); transition: transform .25s ease; }
.zc-panel.open { transform: translateX(0); }
.zc-head { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 8px; }
.zc-head > div { flex: 1; min-width: 0; }
.zc-head h2 { margin: 2px 0; font-size: 20px; }
.zc-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }
.zc-alert { border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 13px; background: var(--gray-soft); }
.zc-alert.bad { background: var(--bad-soft); color: var(--bad); }
.zc-alert.warn { background: var(--warn-soft); color: var(--warn); }
.zc-sec { border-top: 1px solid var(--line); padding: 12px 0 4px; margin-top: 10px; }
.zc-sec h3 { margin-bottom: 8px; }
.zc-sec .kv { grid-template-columns: 120px 1fr; }
.zc-btns { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.zc-unknown { margin-top: 10px; padding: 10px; border: 1px dashed var(--line); border-radius: 8px; display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.zc-note { border-left: 3px solid var(--brand-soft); padding: 4px 8px; margin: 6px 0; white-space: pre-wrap; }
.zc-pre { white-space: pre-wrap; background: var(--gray-soft); padding: 8px; border-radius: 8px; }
.zc-row { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.zc-rems { position: fixed; right: 20px; top: 64px; z-index: 45; display: flex; flex-direction: column; gap: 8px; width: 330px; max-width: calc(100vw - 32px); }
.zc-rem { background: var(--panel); border: 1px solid var(--warn); border-left: 5px solid var(--warn); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.zp-vit { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin: 2px 0 4px; }
.zp-vbad { color: var(--bad); font-weight: 600; }
.zp-vwarn { color: var(--warn); font-weight: 600; }
@media (max-width: 640px) { .zc-panel { width: 100vw; } }

/* ---------- office hours, greetings, urgent ---------- */
.nowbox { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; border-left: 6px solid var(--line); }
.nowbox.ok { border-left-color: var(--ok); } .nowbox.bad { border-left-color: var(--bad); }
.nowbig { font-size: 22px; font-weight: 700; margin: 2px 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { margin: 0; display: block; }
.seg input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg span { display: block; padding: 7px 12px; cursor: pointer; font-weight: 600; color: var(--muted); font-size: 13px; border-right: 1px solid var(--line); }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--brand); color: #fff; }
.seg input:disabled + span { opacity: .4; cursor: not-allowed; }
.seg.sm span { padding: 4px 9px; font-size: 12px; }
table.hours input[type=time] { width: auto; }
table.hours td, table.hours th { padding: 6px 10px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--line); border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(18px); }
.teamcard { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.teamcard ol { margin: 6px 0; padding-left: 20px; }
.memrow { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.memrow select, .memrow input { flex: 1; min-width: 0; }
.memno { width: 20px; text-align: center; font-weight: 700; color: var(--muted); }
.zu-bar { position: fixed; top: 58px; left: 50%; transform: translateX(-50%); z-index: 44; display: flex; flex-direction: column; gap: 6px; width: min(640px, calc(100vw - 32px)); }
.zu { background: var(--bad-soft); color: var(--ink); border: 1px solid var(--bad); border-left: 6px solid var(--bad); border-radius: 10px; padding: 8px 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: 0 8px 24px rgba(0,0,0,.15); }
.zu .zc-btns { margin: 0; }
.autogreet { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--gray-soft); }
.agtext { margin: 6px 0; font-style: italic; }
.warnline { color: var(--warn); }

/* urgent case responses (voice reply / recorded call back) */
.urgresp{margin:2px 0;font-size:13px}
.urgresp .namevoice{margin:4px 0 8px}

/* urgent mark (same icon as the menu) */
.urg-ico{display:inline-block;margin-right:4px;font-size:13px;line-height:1;vertical-align:-1px}
#urgLoop .timeline{max-height:360px;overflow:auto}

/* name · company label next to phone numbers (who is this number?) */
.who-tag{margin-left:6px;font-size:12px;color:var(--muted);font-family:inherit}
td .who-tag,.tl-item .who-tag{display:block;margin-left:0;line-height:1.35}
.who-tag.staff{color:var(--ink);opacity:.75}
@media print{.who-tag{color:#444}}

/* browser phone: dial by name */
.zp-sug{display:flex;flex-direction:column;gap:2px;margin:-4px 0 8px;max-height:220px;overflow:auto;border:1px solid var(--line);border-radius:8px;background:var(--panel)}
.zp-sug button{display:flex;flex-wrap:wrap;gap:4px 8px;align-items:baseline;text-align:left;border:0;background:none;padding:7px 10px;cursor:pointer;color:var(--ink);font:inherit}
.zp-sug button:hover,.zp-sug button:focus{background:var(--bg)}
.zp-sug button span{color:var(--muted);font-size:12px}
.zp-sug button em{margin-left:auto;font-style:normal;font-family:ui-monospace,monospace;font-size:12px}
/* caller panel: follow-up after a call */
.zc-follow{border:1px solid var(--line);border-left:4px solid #d97706;border-radius:10px;padding:10px 12px;margin:10px 0;background:var(--bg)}
.zc-follow.ok{border-left-color:#16a34a}
.zc-follow h3{margin:0 0 4px;text-transform:none;letter-spacing:0;font-size:14px;color:var(--ink)}
.zc-fgrid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:8px}
.zc-fgrid .btn{justify-content:flex-start;text-align:left;white-space:normal;line-height:1.25}
.zc-chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.zc-chip{border:1px solid var(--line);background:var(--panel);color:var(--ink);border-radius:999px;padding:4px 10px;font-size:12px;cursor:pointer}
.zc-chip.on{background:#1d4ed8;border-color:#1d4ed8;color:#fff}
.zc-state{display:inline-block;font-size:12px;padding:1px 8px;border-radius:999px;background:var(--bg);border:1px solid var(--line);margin-left:6px}
.zc-state.calling{border-color:#2563eb;color:#2563eb}.zc-state.connected{border-color:#16a34a;color:#16a34a}.zc-state.failed{border-color:#d97706;color:#b45309}
@media (max-width:520px){.zc-fgrid{grid-template-columns:1fr}}

/* user form: access */
.permgrp{border:1px solid var(--line);border-radius:8px;padding:8px 10px;margin:6px 0}
.permgrp .check{margin:4px 0}

/* browser phone: call quality */
.zp-q{font-size:12px;margin:4px 0;padding:3px 8px;border-radius:6px}
.zp-q.weak{background:#fef3c7;color:#92400e}
.zp-q.bad{background:#fee2e2;color:#991b1b}

/* missed-call pop-ups (bottom-right, above the phone button) */
.zc-missed{position:fixed;right:20px;bottom:88px;z-index:46;display:flex;flex-direction:column;gap:8px;width:330px;max-width:calc(100vw - 32px)}
.zc-rem.missed{border-left:4px solid #dc2626}
@media (max-width:560px){.zc-missed{right:8px;left:8px;width:auto}}
/* my day */
.md-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,460px),1fr));gap:14px;align-items:start}
.md-grid .md-sec{margin:0}
.md-count{display:inline-block;min-width:22px;padding:0 7px;border-radius:999px;background:var(--bg);border:1px solid var(--line);font-size:12px;text-align:center;color:var(--muted)}
.md-count.on{background:#dc2626;border-color:#dc2626;color:#fff}
.bad-text{color:#dc2626}

/* caller panel: recent calls incl. same company */
.zc-call{padding:5px 0;border-bottom:1px dashed var(--line)}
.zc-call:last-child{border-bottom:0}
.zc-call .zc-row{padding:0;border:0}
.zc-callwho{margin-top:1px}
.zc-call.other{background:linear-gradient(90deg,rgba(37,99,235,.06),transparent);padding-left:6px;border-radius:4px}

/* ⓘ next to phone numbers: opens the caller panel */
.who-open{border:0;background:none;color:#2563eb;cursor:pointer;font-size:13px;padding:0 3px;margin-left:2px;line-height:1;vertical-align:baseline}
.who-open:hover{color:#1d4ed8;transform:scale(1.15)}
@media print{.who-open{display:none}}

/* two-step login */
.twostep{background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:10px 14px;margin:8px 0}
.twostep ol{padding-left:18px;margin:6px 0}.twostep li{margin:6px 0}
.tskey{font-size:17px;letter-spacing:1px;background:var(--panel);border:1px dashed var(--line);border-radius:8px;padding:8px 10px;margin:6px 0;word-break:break-all;user-select:all}
