/* Helios design system: "Lagoon".
   Soft, friendly and rounded: teal for actions, warm coral for the brand and
   for hints, pill-shaped controls, big touch targets. Every colour is a token
   below; components use only tokens, so the dark "night lagoon" theme (for
   dark-mode screens and wall TVs) is just a second set of values.

   Status colours carry one meaning everywhere (agent states, campaign states,
   call outcomes): each has a strong colour (dots, bars), a soft background
   and a text colour that passes 4.5:1 on that background. */

@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(fonts/nunito-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+20B9, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url(fonts/nunito-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/dmmono-400-latin.woff2) format("woff2"); }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/dmmono-500-latin.woff2) format("woff2"); }

:root {
  color-scheme: light;
  /* surfaces */
  --bg: #EEF6F5;            /* shallows: page ground */
  --panel: #FFFFFF;         /* cards */
  --panel-2: #F4FAF9;       /* insets inside cards */
  --border: #D3E5E3;
  --border-strong: #B7D3D0;
  --shadow: 0 2px 10px rgba(15, 42, 42, 0.06);
  --shadow-lift: 0 8px 28px rgba(15, 42, 42, 0.12);
  /* text */
  --text: #0F2A2A;
  --muted: #4F6B6A;
  /* brand */
  --accent: #0E7C76;        /* lagoon: primary actions, selection */
  --accent-strong: #0A5F5A;
  --accent-soft: #D5EDEA;
  --accent-text: #FFFFFF;
  --coral: #FF8A66;         /* brand mark, hints */
  --coral-soft: #FFF1EC;
  --coral-text: #B44A2A;
  /* status: strong / soft background / text on soft */
  --ok: #1E9E60;      --ok-soft: #DDF3E7;      --ok-text: #126B41;
  --call: #3B7DD8;    --call-soft: #E1ECFB;    --call-text: #24589F;
  --warn: #E08A1E;    --warn-soft: #FCEBD5;    --warn-text: #8C4E00;
  --pause: #8AA2A1;   --pause-soft: #E6EEED;   --pause-text: #46605F;
  --bad: #D23B2F;     --bad-soft: #FDE3E1;     --bad-text: #AC2A20;
  --machine: #8B5CF6; --machine-soft: #EEE6FD; --machine-text: #5B3FA8;
  --on-strong: #FFFFFF;     /* text on a strong status colour (red Hang up, green tile) */
  /* shape and type */
  --radius: 24px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --pill: 999px;
  --font: "Nunito", "Noto Sans Devanagari", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --focus: 0 0 0 3px rgba(14, 124, 118, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1E1E; --panel: #112A2A; --panel-2: #163333; --border: #23403F; --border-strong: #2F5352;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.35); --shadow-lift: 0 8px 28px rgba(0, 0, 0, 0.5);
    --text: #E3F2F0; --muted: #9DB9B6;
    --accent: #3CC4BB; --accent-strong: #6FD8D0; --accent-soft: #133F3C; --accent-text: #062322;
    --coral: #FF9C7E; --coral-soft: #3A2219; --coral-text: #FFB59D;
    --ok: #4FD08E; --ok-soft: #12332A; --ok-text: #7FE0AE;
    --call: #7AAEF0; --call-soft: #16294A; --call-text: #A9C9F6;
    --warn: #F2B04F; --warn-soft: #3A2A10; --warn-text: #F6C77F;
    --pause: #8FA9A6; --pause-soft: #1C3332; --pause-text: #B5CBC8;
    --bad: #FF7A6E; --bad-soft: #3E1A18; --bad-text: #FF9D93;
    --machine: #B49BFF; --machine-soft: #2A2148; --machine-text: #CBB8FF;
    --on-strong: #062322;
    --focus: 0 0 0 3px rgba(60, 196, 187, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1E1E; --panel: #112A2A; --panel-2: #163333; --border: #23403F; --border-strong: #2F5352;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35); --shadow-lift: 0 8px 28px rgba(0, 0, 0, 0.5);
  --text: #E3F2F0; --muted: #9DB9B6;
  --accent: #3CC4BB; --accent-strong: #6FD8D0; --accent-soft: #133F3C; --accent-text: #062322;
  --coral: #FF9C7E; --coral-soft: #3A2219; --coral-text: #FFB59D;
  --ok: #4FD08E; --ok-soft: #12332A; --ok-text: #7FE0AE;
  --call: #7AAEF0; --call-soft: #16294A; --call-text: #A9C9F6;
  --warn: #F2B04F; --warn-soft: #3A2A10; --warn-text: #F6C77F;
  --pause: #8FA9A6; --pause-soft: #1C3332; --pause-text: #B5CBC8;
  --bad: #FF7A6E; --bad-soft: #3E1A18; --bad-text: #FF9D93;
  --machine: #B49BFF; --machine-soft: #2A2148; --machine-text: #CBB8FF;
  --on-strong: #062322;
  --focus: 0 0 0 3px rgba(60, 196, 187, 0.45);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font: 16px/1.5 var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { text-wrap: balance; }
a { color: var(--accent); font-weight: 700; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: none; box-shadow: var(--focus); }

/* ---------- app header: a floating white pill ---------- */
header, nav.groups, nav.tabs, .alertbar { max-width: 1240px; }
header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 16px auto 0; padding: 8px 10px 8px 16px;
  background: var(--panel); border-radius: var(--pill); box-shadow: var(--shadow);
}
header h1 { font-size: 19px; font-weight: 900; margin: 0; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
header a { text-decoration: none; padding: 8px 12px; border-radius: var(--pill); font-size: 15px; }
header a:hover { background: var(--accent-soft); }
.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; display: block; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 16px 40px; display: grid; gap: 18px; }
.grid2 { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; }
@media (max-width: 800px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- cards ---------- */
.card {
  background: var(--panel); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); min-width: 0;
}
.card h2 { font-size: 19px; font-weight: 900; color: var(--text); margin: 0 0 14px; }
.card h3 { font-size: 16px; font-weight: 800; margin: 16px 0 8px; }

/* ---------- forms ---------- */
label { display: block; font-size: 14px; font-weight: 800; color: var(--text); margin: 10px 0 6px; }
input, select, textarea {
  width: 100%; padding: 11px 14px; font: inherit; font-size: 15.5px; color: var(--text);
  background: var(--panel); border: 2px solid var(--border); border-radius: var(--radius-md);
  transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--accent); }
input[type="range"] { accent-color: var(--accent); border: 0; padding: 0; }
textarea { border-radius: 18px; }

/* ---------- buttons: pills ---------- */
button {
  font: inherit; font-size: 15px; font-weight: 800; padding: 10px 18px; border-radius: var(--pill);
  border: 2px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer;
  transition: background-color .15s, border-color .15s, transform .05s;
  min-height: 44px;
}
button:hover { border-color: var(--border-strong); background: var(--panel-2); }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.danger { background: var(--bad); color: var(--on-strong); border-color: var(--bad); }
button.danger:hover { filter: brightness(0.95); }
button.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-strong); }
button.ghost { background: transparent; border-color: transparent; }
button.sm, .sm { min-height: 34px; padding: 5px 12px; font-size: 13.5px; }
button:disabled { opacity: .5; cursor: default; transform: none; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* Buttons inside tables and toolbars are compact. */
td button, .toolbar button { min-height: 36px; padding: 5px 12px; font-size: 13.5px; border-width: 1px; }
@media (pointer: coarse) { td button, .toolbar button { min-height: 44px; } }
td .row, td { gap: 6px; }

/* ---------- pills: agent / campaign states ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--pill);
  font-size: 13.5px; font-weight: 800; background: var(--pause-soft); color: var(--pause-text); white-space: nowrap;
}
.st-available { background: var(--ok-soft); color: var(--ok-text); }
.st-on_call, .st-reserved { background: var(--call-soft); color: var(--call-text); }
.st-wrap_up { background: var(--warn-soft); color: var(--warn-text); }
.st-paused, .st-logged_out { background: var(--pause-soft); color: var(--pause-text); }
.st-bad { background: var(--bad-soft); color: var(--bad-text); }
.pill .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }

/* ---------- text ---------- */
.muted { color: var(--muted); }
.sub { font-size: 13.5px; color: var(--muted); }
.big { font-size: 24px; font-weight: 900; }
.mono, td.num { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
::placeholder { color: var(--muted); opacity: 0.8; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.kv dt { color: var(--muted); font-weight: 600; }
dl.kv dd { margin: 0; font-weight: 700; }

/* ---------- tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--muted); font-weight: 800; font-size: 13px; background: var(--panel-2); }
thead th:first-child { border-top-left-radius: var(--radius-sm); }
thead th:last-child { border-top-right-radius: var(--radius-sm); }
tbody tr:hover td { background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; font-size: 14.5px; }
.tablewrap { overflow-x: auto; }

/* ---------- misc components ---------- */
.dispos { display: flex; flex-wrap: wrap; gap: 8px; }
.dispos button.sel { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.hidden { display: none !important; }
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: var(--pill);
  font-weight: 700; box-shadow: var(--shadow-lift); max-width: calc(100% - 32px);
}
.chip {
  display: inline-block; padding: 3px 10px; margin: 2px; border-radius: var(--pill);
  background: var(--panel-2); border: 1px solid var(--border); font-size: 13px; font-weight: 700;
}
.hint { background: var(--coral-soft); color: var(--text); border-radius: var(--radius-md); padding: 14px 16px; }
.hint .hint-label { font-size: 13px; font-weight: 900; color: var(--coral-text); }

/* ---------- admin navigation: groups (pill bar) + pages (chips) ---------- */
nav.groups {
  display: flex; gap: 4px; flex-wrap: wrap; align-items: center;
  margin: 12px auto 0; padding: 6px; background: var(--panel); border-radius: var(--pill); box-shadow: var(--shadow);
}
nav.groups button {
  border: 0; min-height: 40px; padding: 8px 18px; background: transparent; color: var(--text);
}
nav.groups button:hover { background: var(--panel-2); }
nav.groups button.active { background: var(--accent); color: var(--accent-text); }
nav.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px auto 0; padding: 0 4px; }
nav.tabs button {
  min-height: 36px; padding: 6px 14px; font-size: 14px; font-weight: 700;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
}
nav.tabs button:hover { color: var(--text); }
nav.tabs button.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 800; }
nav.tabs a { align-self: center; font-size: 14px; padding: 6px 10px; text-decoration: none; }

/* ---------- admin forms and stats ---------- */
.form { display: grid; gap: 4px 18px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.form .wide { grid-column: 1 / -1; }
.form label.check { display: flex; gap: 10px; align-items: center; font-weight: 700; margin-top: 30px; }
.form label.check input { width: auto; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.tile { background: var(--panel); border-radius: 20px; padding: 14px 18px; box-shadow: var(--shadow); }
.card .tile { background: var(--panel-2); box-shadow: none; }
.tile .v { font-family: var(--mono); font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .k { color: var(--muted); font-size: 13.5px; font-weight: 700; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-top: 8px; overflow-x: auto; }
.bars .bar { flex: 0 1 44px; min-width: 14px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; height: 100%; }
.bars .pair { width: 100%; display: flex; gap: 2px; align-items: flex-end; height: 100%; }
.bars .bar span.fill { width: 100%; background: var(--accent); border-radius: 8px 8px 3px 3px; min-height: 2px; }
.bars .bar span.fill.conn { background: var(--coral); }
.bars .bar small { color: var(--muted); font-size: 11.5px; font-weight: 700; }
.legend { display: flex; gap: 16px; font-size: 13.5px; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.disp-table input { padding: 6px 10px; border-radius: var(--radius-sm); }
.disp-table td { padding: 4px 6px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 10px; }
#view { min-width: 0; display: grid; gap: 18px; }

/* ---------- alerts and health ---------- */
.alertbar {
  margin: 12px auto 0; background: var(--bad-soft); color: var(--bad-text); padding: 10px 18px;
  border-radius: var(--radius-md); font-size: 14.5px; font-weight: 700; display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.alertbar a { color: var(--bad-text); }
.okdot, .baddot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.okdot { background: var(--ok); } .baddot { background: var(--bad); }

/* ---------- sign-in screens ---------- */
.auth-card { max-width: 440px; width: 100%; margin: 6vh auto 0; }
.auth-card .brand { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 900; margin-bottom: 6px; }

@media (max-width: 1272px) { header, nav.groups, nav.tabs, .alertbar { margin-left: 16px; margin-right: 16px; } }
@media (max-width: 640px) {
  header { margin: 10px 10px 0; border-radius: 24px; }
  nav.groups { margin: 10px 10px 0; border-radius: 24px; }
  nav.tabs { margin: 10px 10px 0; }
  main { padding: 14px 10px 32px; }
  .card { padding: 18px 16px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== admin core ===== */
/* Page heads, campaign cards, sectioned editors, filters, empty states,
   health rows and the start / sign-in pages. Tokens only. */

/* ---------- page head: title + subtitle + actions ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 6px 4px 0; }
.page-title { min-width: 0; flex: 1 1 320px; }
.page-head h1 { margin: 0; font-size: 32px; line-height: 1.15; font-weight: 900; letter-spacing: -0.01em; }
.page-head .sub { margin: 4px 0 0; font-size: 15px; max-width: 72ch; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* "Show archived" style toggle: a pill-shaped checkbox label */
label.toggle {
  display: inline-flex; align-items: center; gap: 10px; margin: 0; min-height: 44px; padding: 8px 16px;
  background: var(--panel); border: 2px solid var(--border); border-radius: var(--pill);
  font-size: 14.5px; font-weight: 800; color: var(--text); cursor: pointer;
}
label.toggle:hover { border-color: var(--border-strong); }
label.toggle input { width: 18px; height: 18px; margin: 0; }
label.toggle:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }

/* a select or input with its label beside it */
label.inline-field { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 800; color: var(--muted); }
label.inline-field select, label.inline-field input { width: auto; color: var(--text); }

/* link styled as a button */
a.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px;
  border-radius: var(--pill); border: 2px solid var(--border); background: var(--panel); color: var(--text);
  font-size: 15px; font-weight: 800; text-decoration: none; transition: background-color .15s, border-color .15s;
}
a.btn:hover { border-color: var(--border-strong); background: var(--panel-2); color: var(--text); }
a.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
a.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }

/* ---------- campaign cards ---------- */
.camp-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); }
.camp-card {
  background: var(--panel); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.camp-card.archived { opacity: .8; }
.camp-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.camp-name { min-width: 0; }
.camp-name h2 { margin: 0; font-size: 19px; font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; }
.camp-name .sub { font-size: 12.5px; }
.camp-top .pill { flex: 0 0 auto; }
.camp-top .pill .dot { width: 8px; height: 8px; background: var(--ok); }
.camp-mode { font-size: 14.5px; color: var(--muted); font-weight: 700; }
.camp-meta { margin-top: -6px; }
.camp-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 2px; }
.camp-stats .stat { background: var(--panel-2); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.camp-stats .v { font-family: var(--mono); font-size: 20px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.camp-stats .k { font-size: 12.5px; color: var(--muted); font-weight: 700; line-height: 1.3; }
.stat.tone-ok .v { color: var(--ok-text); }
.stat.tone-warn .v { color: var(--warn-text); }
.stat.tone-bad .v { color: var(--bad-text); }
.camp-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
.camp-actions .row { gap: 6px; }
.camp-actions button { min-height: 38px; padding: 6px 14px; font-size: 14px; }
button.stop { background: var(--bad-soft); border-color: transparent; color: var(--bad-text); }
button.stop:hover { background: var(--bad-soft); border-color: var(--bad); }
button.ghost:hover { background: var(--panel-2); border-color: transparent; }
.camp-actions button.danger, td button.danger { background: var(--bad); color: #FFFFFF; border-color: var(--bad); }

/* ---------- editors (campaign, agent, user) ---------- */
.card.narrow { max-width: 480px; }
.editor-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 4px; }
.editor-head h2 { margin: 0; }
.editor-head .sub { margin: 4px 0 0; }
.editor-head button.ghost { flex: 0 0 auto; width: 44px; padding: 0; font-size: 18px; }
.narrow > input { margin-top: 12px; }
.form-section { padding: 18px 0 6px; border-top: 1px solid var(--border); margin-top: 14px; }
.editor-head + .form-section { border-top: 0; margin-top: 4px; padding-top: 6px; }
.form-section > h3 { margin: 0 0 2px; font-size: 13px; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); }
.form-section > .sub { margin: 0 0 4px; }
.form label.check.wide { margin-top: 12px; }
.form-actions {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  position: sticky; bottom: 0; z-index: 2; margin: 18px -24px -22px; padding: 14px 24px;
  background: var(--panel); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
}
.narrow .form-actions { position: static; }
/* calling days, agent queues: checkbox chips */
.day-picks { display: flex; flex-wrap: wrap; gap: 8px; }
label.day {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; padding: 8px 14px;
  border: 2px solid var(--border); border-radius: var(--pill); background: var(--panel);
  font-size: 14.5px; font-weight: 800; cursor: pointer;
}
label.day input { margin: 0; width: 18px; height: 18px; }
label.day:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.tablewrap.inset { border: 1px solid var(--border); border-radius: var(--radius-md); }
.disp-table th { white-space: nowrap; }
.disp-table input:not([type="checkbox"]) { min-width: 90px; }
.disp-table td button { min-height: 34px; width: 34px; padding: 0; font-size: 18px; }

/* ---------- filters row, tables in cards ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.filters > input, .filters > select { width: auto; min-height: 46px; }
.filters > .grow { flex: 1 1 220px; min-width: 0; }
.filters input[type="file"] { padding: 8px 12px; }
.filter-card { padding-top: 18px; padding-bottom: 6px; }
.table-card > .sub { margin-top: -6px; }
td.actions { white-space: nowrap; }
td.actions > * + * { margin-left: 6px; }
td.chips { min-width: 140px; }
td.chips.data { min-width: 320px; }
td.notes { min-width: 160px; max-width: 320px; overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.chips-row .chip { margin: 0; }
.chip b { font-weight: 500; }
code { font-family: var(--mono); font-size: .92em; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; }
.pager { flex-wrap: wrap; }
tr.edit-row > td, tbody tr.edit-row:hover > td { background: var(--panel-2); padding: 16px; }
.inline-editor { position: sticky; left: 0; max-width: min(1160px, calc(100vw - 76px)); }
.inline-editor h3 { margin: 0 0 4px; }
.inline-editor button { min-height: 44px; padding: 10px 18px; font-size: 15px; border-width: 2px; }
.inline-editor input, .inline-editor select, .inline-editor textarea { background: var(--panel); }
.report-body { display: grid; gap: 18px; min-width: 0; }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.empty strong { font-size: 17px; font-weight: 900; }
.empty p { margin: 0 0 6px; color: var(--muted); max-width: 52ch; }
tr.empty-row > td, tbody tr.empty-row:hover > td { background: transparent; }

/* ---------- DNC lookup ---------- */
.lookup-result { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; }
.lookup-result:empty { display: none; }

/* ---------- system health ---------- */
.health-summary { display: flex; align-items: center; font-weight: 900; font-size: 17px; padding: 4px 4px 14px; }
.health-summary.ok { color: var(--ok-text); }
.health-summary.bad { color: var(--bad-text); }
.health-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.health-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  background: var(--panel-2); border-radius: var(--radius-md); padding: 12px 16px;
}
.health-row.bad { background: var(--bad-soft); }
.health-row .okdot, .health-row .baddot { margin: 0; width: 12px; height: 12px; }
.health-main { min-width: 0; }
.health-main .sub { overflow-wrap: anywhere; }
.health-side { text-align: right; }
.health-side .sub { font-size: 12.5px; margin-top: 2px; }

/* ---------- audit log ---------- */
table.audit td { vertical-align: top; }
table.audit td.detail { color: var(--muted); font-size: 14px; min-width: 240px; max-width: 560px; overflow-wrap: anywhere; }
table.audit ul.changes { margin: 0; padding: 0; list-style: none; }
table.audit ul.changes b { color: var(--text); }
table.audit .from { text-decoration: line-through; text-decoration-color: var(--border-strong); }
table.audit .to { color: var(--text); font-weight: 700; }
table.audit summary { cursor: pointer; color: var(--accent); font-weight: 700; min-height: 24px; }
table.audit pre { font-family: var(--mono); font-size: 12.5px; background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0 0; max-height: 320px; overflow: auto; white-space: pre-wrap; color: var(--text); }

/* ---------- sign-in, reset ---------- */
.auth-card { padding: 34px 32px 28px; }
.auth-card .brand { font-size: 28px; gap: 12px; margin-bottom: 18px; }
.auth-card .brand .brand-mark { width: 44px; height: 44px; }
.auth-card h2 { font-size: 24px; margin: 0; }
.auth-lead { margin: 4px 0 8px; font-size: 15px; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; margin-top: 18px; }
.auth-actions button.primary { flex: 1 1 160px; min-height: 48px; font-size: 16px; }
.auth-actions a { font-size: 14.5px; min-height: 44px; display: inline-flex; align-items: center; }
.auth-sso { margin-top: 6px; }
.auth-sso button { width: 100%; min-height: 48px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; font-weight: 800; margin: 6px 0 14px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-msg:empty { display: none; }
.auth-msg { margin: 16px 0 0; padding: 12px 14px; border-radius: var(--radius-md); background: var(--panel-2); font-weight: 700; }

/* ---------- start page ---------- */
main.start { gap: 22px; }
.start-hero { padding: 18px 4px 0; }
.start-hero h1 { margin: 0; font-size: 36px; font-weight: 900; line-height: 1.15; }
.start-hero .sub { font-size: 16px; margin: 6px 0 0; }
.start-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.start-card { display: flex; flex-direction: column; gap: 4px; }
.start-card h2 { margin: 8px 0 0; }
.start-card p { margin: 4px 0 16px; flex: 1; }
.start-icon {
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); font-size: 24px; font-weight: 900;
}
.start-icon.coral { background: var(--coral-soft); color: var(--coral-text); }

@media (max-width: 640px) {
  .page-head h1 { font-size: 26px; }
  .page-actions { width: 100%; }
  .page-actions > button.primary { flex: 1 1 auto; }
  .camp-card { padding: 18px 16px; border-radius: 20px; }
  .camp-actions button { min-height: 44px; }
  .camp-stats .v { font-size: 18px; }
  .form-actions { margin: 18px -16px -18px; padding: 12px 16px; border-radius: 0 0 20px 20px; }
  .form-actions button { flex: 1 1 auto; }
  .filters > input, .filters > select, .filters > button { flex: 1 1 140px; }
  label.inline-field { flex: 1 1 140px; }
  label.inline-field select, label.inline-field input { flex: 1; min-width: 0; }
  .health-row { grid-template-columns: auto 1fr; }
  .health-side { grid-column: 2; text-align: left; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .auth-card { padding: 26px 20px 22px; margin-top: 3vh; }
  .start-hero h1 { font-size: 28px; }
}

/* ===== admin modules ===== */
/* Feature pages (prompts, IVR, QA, live assist, webhooks, tokens,
   LeadSquared, coaching, rate cards, report emails). Tokens only. */

/* page title + subtitle + primary action, sitting on the page ground */
.mod-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; padding: 4px 4px 0; }
.mod-head > div:first-child { min-width: 0; flex: 1 1 320px; }
.mod-head h1 { margin: 0; font-size: 30px; font-weight: 900; line-height: 1.15; letter-spacing: -0.01em; }
.mod-head .mod-sub { margin: 4px 0 0; font-size: 15px; color: var(--muted); max-width: 820px; }
.mod-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* placeholders for forms and panels take no space until filled */
#view > div:empty { display: none; }
/* Let wide tables scroll inside their card instead of widening the page. */
#view > * { min-width: 0; }
.mod-stack { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }

/* card heading with actions on the right */
.card-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h2, .card-head h3 { flex: 1 1 auto; margin: 0; min-width: 0; }
.card .lead-sub { margin: 0 0 14px; font-size: 14.5px; color: var(--muted); max-width: 860px; }
.sec-title { font-size: 13px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.card > .sec-title:first-child { margin-top: 0; }

/* filter bar above a report */
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters input, .filters select { width: auto; max-width: 100%; }
.filters .to { color: var(--muted); font-weight: 700; }
.filters label.inline { display: flex; gap: 8px; align-items: center; margin: 0; font-size: 14px; color: var(--muted); }

/* compact action buttons in a table cell */
.act { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* empty states: say what to do */
td.empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14.5px; }
td.empty strong, .empty strong { display: block; color: var(--text); font-size: 15.5px; font-weight: 800; margin-bottom: 2px; }
tbody tr:hover td.empty { background: transparent; }
.empty { padding: 22px 16px; text-align: center; color: var(--muted); font-size: 14.5px; background: var(--panel-2); border-radius: var(--radius-md); }

/* callouts: info / warning / problem */
.callout { border-radius: var(--radius-md); padding: 12px 16px; margin: 10px 0; font-size: 14.5px; background: var(--accent-soft); color: var(--text); }
.callout.warn { background: var(--warn-soft); }
.callout.warn strong:first-child { color: var(--warn-text); }
.callout.bad { background: var(--bad-soft); }
.callout.bad strong:first-child { color: var(--bad-text); }
.callout ul { margin: 6px 0 0; padding-left: 20px; }

/* secrets shown once: a highlighted card */
.secret-card { background: var(--coral-soft); box-shadow: inset 0 0 0 2px var(--coral), var(--shadow); }
.once { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 900; letter-spacing: .06em;
  text-transform: uppercase; color: var(--coral-text); margin-bottom: 6px; }
.once::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); }
.secret-card h2 { margin-bottom: 6px; }
.secret-box { background: var(--coral-soft); border-radius: var(--radius-md); padding: 14px 16px; margin-top: 12px; box-shadow: inset 0 0 0 2px var(--coral); }
.secret-value { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.secret-value input { flex: 1 1 260px; width: auto; min-width: 0; font-family: var(--mono); font-size: 15px; background: var(--panel); border-color: var(--coral); }
.masked { font-family: var(--mono); font-size: 13.5px; color: var(--muted); }

/* checkbox choices laid out as pills (scopes, events, campaigns) */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices label.check, .form .choices label.check {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; min-height: 44px; padding: 8px 14px;
  border: 2px solid var(--border); border-radius: var(--pill); background: var(--panel); font-size: 14px; font-weight: 700; cursor: pointer;
}
.choices label.check:hover { border-color: var(--border-strong); }
.choices label.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.choices label.check .sub { font-weight: 600; }
.choices.stack { flex-direction: column; align-items: stretch; }
.choices.stack label.check { border-radius: var(--radius-md); }

/* editable rows (playbooks, rubric, agent maps) */
table.edit-table { width: 100%; }
table.edit-table td { padding: 6px; vertical-align: top; }
table.edit-table input, table.edit-table textarea, table.edit-table select { padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14.5px; }
table.edit-table tbody tr:hover td { background: transparent; }
table.edit-table td:last-child { width: 1%; white-space: nowrap; }

/* status and score pills */
.pill.st-accent { background: var(--accent-soft); color: var(--accent-strong); }
.pill.sc-good, .score-big.sc-good { background: var(--ok-soft); color: var(--ok-text); }
.pill.sc-mid, .score-big.sc-mid { background: var(--warn-soft); color: var(--warn-text); }
.pill.sc-low, .score-big.sc-low { background: var(--bad-soft); color: var(--bad-text); }
.pill.sc-good, .pill.sc-mid, .pill.sc-low { font-family: var(--mono); font-weight: 500; }
.score-big { font-family: var(--mono); font-size: 38px; line-height: 1; padding: 12px 18px; border-radius: var(--radius-md); background: var(--panel-2); }
.chip.ok { background: var(--ok-soft); color: var(--ok-text); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn-text); border-color: transparent; }
.err-text { color: var(--bad-text); }
audio.inline { height: 36px; max-width: 260px; vertical-align: middle; }

/* ---------- IVR builder ---------- */
.ivr-steps { display: grid; gap: 12px; margin: 10px 0 14px; }
.ivr-step { background: var(--panel-2); border: 2px solid var(--border); border-radius: 20px; padding: 14px 16px; min-width: 0; }
.ivr-step.first { border-color: var(--accent); }
.ivr-step-head { display: flex; gap: 8px 10px; flex-wrap: wrap; align-items: center; }
.ivr-num { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-strong); font-family: var(--mono); font-weight: 500; font-size: 15px; }
.ivr-step.first .ivr-num { background: var(--accent); color: var(--accent-text); }
.ivr-step-head .ivr-id { flex: 0 1 170px; min-width: 120px; }
.ivr-step-head .ivr-type { flex: 0 1 250px; min-width: 170px; }
.ivr-step-head .ivr-note { flex: 1 1 160px; min-width: 140px; }
.ivr-step-head .ivr-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-left: auto; }
.ivr-step .ivr-id input { font-family: var(--mono); font-size: 14.5px; }
.ivr-step select, .ivr-add select { border-radius: var(--pill); padding-left: 16px; }
.ivr-step .form { margin-top: 8px; }
.pill.first-pill { background: var(--accent); color: var(--accent-text); }
.ivr-keys { display: grid; gap: 8px; }
.ivr-key { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ivr-key > select { width: auto; flex: 0 0 auto; }
.ivr-key > .arrow { color: var(--muted); font-weight: 900; }
.ivr-key > .target { flex: 1 1 200px; min-width: 0; }
.ivr-sound { display: flex; gap: 8px; align-items: center; }
.ivr-sound input { flex: 1 1 auto; min-width: 0; }
.ivr-sound button { flex: 0 0 auto; }
.ivr-add { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px; border: 2px dashed var(--border-strong); border-radius: 20px; }
.ivr-add select { width: auto; max-width: 100%; }
.ivr-hours td, .ivr-hours th { padding: 4px 10px 4px 0; border: 0; background: transparent; }
.ivr-hours tbody tr:hover td { background: transparent; }
.ivr-hours input[type="time"] { width: auto; padding: 7px 10px; border-radius: var(--radius-sm); }
.ivr-hol { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0; }
.ivr-hol input[type="date"] { width: auto; }
.ivr-hol input:not([type]) { flex: 1 1 160px; width: auto; min-width: 0; }
.ivr-outline { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-family: var(--mono); font-size: 13.5px; line-height: 1.7;
  background: var(--panel-2); border-radius: var(--radius-md); padding: 14px 16px; color: var(--text); }
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }

/* ---------- reports extras: heatmap and cost ---------- */
.seg { display: inline-flex; padding: 4px; gap: 4px; background: var(--panel-2); border-radius: var(--pill); }
.seg button { border: 0; min-height: 36px; padding: 6px 14px; font-size: 14px; background: transparent; }
.seg button.on { background: var(--accent); color: var(--accent-text); }
.hm { width: auto; border-collapse: separate; border-spacing: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.hm th { font-weight: 500; color: var(--muted); padding: 2px 4px; text-align: center; background: transparent; font-family: var(--mono); font-size: 11.5px; border: 0; }
.hm th.day { text-align: right; padding-right: 8px; font-family: var(--font); font-weight: 800; font-size: 12.5px; }
.hm td { width: 46px; min-width: 40px; height: 40px; text-align: center; border-radius: 10px; padding: 0; border: 0; line-height: 1.15; cursor: default;
  background: var(--panel-2); color: var(--text); }
.hm td b { display: block; font-weight: 800; font-size: 12px; }
.hm td small { display: block; font-size: 10px; font-family: var(--mono); }
/* Teal scale, light to strong. The two strongest steps flip to the accent
   text colour so every cell keeps at least 4.5:1 in both themes. */
.hm td.l1, .hm tbody tr:hover td.l1, .ramp i.l1 { background: color-mix(in srgb, var(--accent-strong) 8%, var(--panel)); }
.hm td.l2, .hm tbody tr:hover td.l2, .ramp i.l2 { background: color-mix(in srgb, var(--accent-strong) 18%, var(--panel)); }
.hm td.l3, .hm tbody tr:hover td.l3, .ramp i.l3 { background: color-mix(in srgb, var(--accent-strong) 28%, var(--panel)); }
.hm td.l4, .hm tbody tr:hover td.l4, .ramp i.l4 { background: color-mix(in srgb, var(--accent-strong) 40%, var(--panel)); }
.hm td.l5, .hm tbody tr:hover td.l5, .ramp i.l5 { background: color-mix(in srgb, var(--accent-strong) 84%, var(--panel)); color: var(--accent-text); }
.hm td.l6, .hm tbody tr:hover td.l6, .ramp i.l6 { background: var(--accent-strong); color: var(--accent-text); }
.hm td.low, .hm tbody tr:hover td.low { background: repeating-linear-gradient(135deg, var(--panel-2), var(--panel-2) 4px, var(--border) 4px, var(--border) 6px); color: var(--text); }
.hm td.none, .hm tbody tr:hover td.none { background: var(--panel-2); color: var(--muted); }
.hm td:hover { box-shadow: inset 0 0 0 2px var(--text); }
.hmlegend { display: flex; gap: 10px 18px; align-items: center; flex-wrap: wrap; font-size: 13px; font-weight: 700; color: var(--muted); margin: 12px 0 4px; }
.hmlegend .ramp { display: inline-flex; gap: 3px; vertical-align: middle; margin: 0 8px; }
.hmlegend .ramp i { width: 22px; height: 14px; border-radius: 5px; display: inline-block; }
.hmlegend .lowsw { width: 22px; height: 14px; border-radius: 5px; display: inline-block; vertical-align: middle; margin-right: 6px;
  background: repeating-linear-gradient(135deg, var(--panel-2), var(--panel-2) 4px, var(--border) 4px, var(--border) 6px); }
.besthours { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 8px; }
.besthours > div { background: var(--panel-2); border-radius: var(--radius-md); padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
.besthours .rank { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-text);
  font-family: var(--mono); font-size: 13px; }
.besthours strong { display: block; font-size: 14.5px; }
.costgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr)); margin: 14px 0; }
.costgrid > div, #costCard, #heatmapCard { min-width: 0; }
.costgrid > div { background: var(--panel-2); border-radius: 20px; padding: 12px 14px; }
.costgrid h3 { font-size: 13px; margin: 2px 4px 8px; color: var(--muted); font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.costgrid th { background: var(--panel); }
.costgrid tbody tr:hover td { background: var(--panel); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
iframe.preview { width: 100%; height: 900px; border: 0; border-radius: var(--radius-md); background: #FFFFFF; box-shadow: inset 0 0 0 1px var(--border); }

/* ---------- QA ---------- */
.qa-score { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 14px 0; }
.tips { margin: 6px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.tips li { background: var(--coral-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14.5px; }

@media (max-width: 640px) {
  .mod-head h1 { font-size: 26px; }
  .mod-actions, .mod-actions button { width: 100%; }
  .filters > input, .filters > select, .filters > button { flex: 1 1 140px; }
  .ivr-step { padding: 12px; }
  .ivr-step-head .ivr-tools { margin-left: 0; }
  .secret-value button { flex: 1 1 auto; }
}

/* ===== broadcast ===== */
/* Power and agentless dialling: campaign editor (admin-broadcast.js) and
   live floor (live.js). Only Lagoon tokens; dark mode follows them. */
.bc-sections [hidden], .lv-lane[hidden] { display: none !important; }
.bc-report[hidden] { display: none; }
/* Agentless campaigns show a fifth lane, "Playing message". */
.lv-camp.bc-agentless .lv-lanes { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@container (max-width: 760px) {
  .lv-camp.bc-agentless .lv-lanes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@container (max-width: 480px) {
  .lv-camp.bc-agentless .lv-lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.lv-call.agentless { background: var(--call-soft); color: var(--call-text); }
.lv-call.dot.agentless { background: var(--call); }
[data-o="message"] { --c: var(--call); --c-soft: var(--call-soft); --c-text: var(--call-text); }
[data-o="optout"] { --c: var(--warn); --c-soft: var(--warn-soft); --c-text: var(--warn-text); }
/* ===== crm connectors ===== */
/* Salesforce / Zoho CRM / HubSpot: a status card per CRM, then the chosen
   one's settings (admin-crm.js). Tokens only. */
.crm-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.crm-card { display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.crm-card.selected { box-shadow: inset 0 0 0 2px var(--accent), var(--shadow-lift); }
.crm-top { display: flex; align-items: flex-start; gap: 12px; }
.crm-top .pill { flex: 0 0 auto; }
.crm-name { min-width: 0; flex: 1 1 auto; }
.crm-name h2 { margin: 0; font-size: 19px; line-height: 1.25; overflow-wrap: anywhere; }
.crm-name .sub { overflow-wrap: anywhere; }
.crm-badge { flex: 0 0 auto; width: 40px; height: 40px; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-weight: 900; font-size: 18px; background: var(--accent-soft); color: var(--accent-strong); }
.crm-badge.crm-zoho { background: var(--coral-soft); color: var(--coral-text); }
.crm-badge.crm-hubspot { background: var(--warn-soft); color: var(--warn-text); }
.crm-badge.crm-salesforce { background: var(--call-soft); color: var(--call-text); }
.crm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.crm-stats .stat { background: var(--panel-2); border-radius: 14px; padding: 10px 12px; min-width: 0; }
.crm-stats .v { font-family: var(--mono); font-size: 20px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.crm-stats .k { font-size: 12.5px; color: var(--muted); font-weight: 700; line-height: 1.3; }
.crm-err { background: var(--bad-soft); border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; overflow-wrap: anywhere; }
.crm-err .sub { color: var(--bad-text); font-weight: 700; }
.crm-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
#crm_detail .form-section { margin-top: 18px; }
#crm_detail .form .sub { margin-top: 4px; }
#crm_detail textarea.mono { font-size: 14px; }
@media (max-width: 640px) {
  .crm-actions button { flex: 1 1 auto; }
  .crm-stats .v { font-size: 18px; }
}

/* ===== voicebots ===== */
.vb-opening { margin: 0; padding: 12px 16px; background: var(--accent-soft); color: var(--text); border-radius: var(--radius-md); font-size: 15px; }
.vb-note { color: var(--warn-text); }
.vb-problems:not(:empty) { margin-top: 14px; padding: 12px 16px; background: var(--bad-soft); color: var(--bad-text); border-radius: var(--radius-md); }
.vb-problems ul { margin: 6px 0 0; padding-left: 20px; }
.vb-phrases { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.vb-phrases summary { cursor: pointer; font-weight: 800; color: var(--accent-strong); }
.vb-phrases .form { margin-top: 8px; }
.vb-editor .form label.check.wide { margin-top: 6px; align-items: flex-start; }
.vb-chat { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding: 12px; background: var(--panel-2); border-radius: var(--radius-md); }
.vb-chat > .sub { margin: 0; }
.vb-msg { max-width: min(78%, 640px); padding: 10px 14px; border-radius: 18px; font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.vb-msg .vb-who { display: block; font-size: 12px; font-weight: 800; color: var(--muted); margin-bottom: 2px; }
.vb-msg .chips-row { margin: 6px 0 0; }
.vb-bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.vb-you { align-self: flex-end; background: var(--accent-soft); border-bottom-right-radius: 6px; }
.vb-sys { align-self: center; max-width: 100%; background: var(--coral-soft); color: var(--coral-text); font-size: 13.5px; }
.vb-input { margin-top: 10px; flex-wrap: nowrap; }
.vb-input input { flex: 1 1 auto; min-width: 0; }
.vb-transcript { margin-top: 14px; }
.vb-transcript .vb-chat { max-height: 520px; }
.pill.st-bot { background: var(--machine-soft); color: var(--machine-text); }
.vb-handoff { border-left: 6px solid var(--machine); }
.vb-handoff .vb-summary { margin: 0 0 8px; font-size: 15px; }
.vb-handoff details summary { cursor: pointer; font-weight: 800; color: var(--accent-strong); }
@media (max-width: 640px) { .vb-msg { max-width: 92%; } }

/* ===== AI supervisor (admin-aisup.js, live-aisup.js, aisup-cards.js) ===== */
.ai-list { display: grid; gap: 12px; }
.ai-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 14px 16px; display: grid; gap: 6px; min-width: 0; }
.ai-card.ai-live { border-left: 6px solid var(--bad); }
.ai-card-top { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.ai-card-top h3 { margin: 0; font-size: 16px; font-weight: 800; flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.ai-card p { margin: 0; overflow-wrap: anywhere; }
.ai-target { font-weight: 700; color: var(--accent-strong); font-size: 14px; }
.ai-why { font-size: 14.5px; }
.ai-effect { font-size: 14px; color: var(--muted); }
.ai-meta { font-size: 12.5px; color: var(--muted); }
.ai-error { color: var(--bad-text); font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.ai-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ai-reject input { width: 100%; }
.ai-answer { display: grid; gap: 10px; margin-top: 10px; }
.ai-answer-text { white-space: pre-wrap; font-size: 15px; margin: 0; overflow-wrap: anywhere; }
.ai-headline { font-size: 18px; font-weight: 800; margin: 0 0 10px; }
.ai-kv { margin-top: 6px; }
.ai-kv dd { overflow-wrap: anywhere; min-width: 0; }
.ai-form { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.ai-hist-note { max-width: 320px; overflow-wrap: anywhere; font-size: 13.5px; }
.ai-askrow { display: flex; gap: 8px; }
.ai-askrow input { flex: 1 1 auto; min-width: 0; }
.ai-note, .ai-empty { margin: 0; font-size: 14px; }
.ai-count { display: inline-block; min-width: 22px; padding: 0 6px; border-radius: var(--pill); background: var(--pause-soft); color: var(--pause-text); font-weight: 800; }
#aiBtn.ai-has .ai-count { background: var(--coral); color: var(--on-strong); }
@media (max-width: 640px) { .ai-askrow { flex-direction: column; } .ai-actions button { flex: 1 1 auto; } }
.lv-drawer .ai-card-top h3 { text-transform: none; letter-spacing: 0; font-size: 16px; color: var(--text); }
/* ===== call actions ===== */
.ca-bar { align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.ca-bar .seg { flex-wrap: wrap; border-radius: var(--radius-md); }
.ca-pre { margin: 6px 0 0; padding: 12px 14px; background: var(--panel-2); border-radius: var(--radius-md); font-family: var(--mono, ui-monospace, monospace);
  font-size: 13px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 360px; overflow-y: auto; }
.ca-url { font-size: 12.5px; overflow-wrap: anywhere; }
.ca-wrap { overflow-wrap: anywhere; max-width: 360px; }
.ca-rows input { min-width: 90px; }
.ca-test, .ca-vars { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.ca-test summary, .ca-vars summary { cursor: pointer; font-weight: 800; color: var(--accent-strong); }
.ca-test .form { margin-top: 8px; }
.ca-vars ul { margin: 8px 0 0; padding-left: 20px; columns: 2; column-gap: 24px; }
.ca-card .ca-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ca-card .ca-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ca-card .ca-field { display: flex; flex-direction: column; gap: 4px; }
.ca-runs { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ca-runs li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; background: var(--panel-2); border-radius: var(--radius-md); }
.ca-runs .ca-run-name { font-weight: 800; }
.ca-runs .ca-result { font-weight: 700; color: var(--accent-strong); overflow-wrap: anywhere; }
@media (max-width: 640px) { .ca-vars ul { columns: 1; } .ca-wrap { max-width: none; } }
/* ===== Answer-rate diagnosis (admin-diagnosis.js) ===== */
.dg-card { border-left: 6px solid var(--border-strong); }
.dg-card.dg-warning { border-left-color: var(--warn); }
.dg-card.dg-info { border-left-color: var(--call); }
.dg-card .card-head { gap: 10px; flex-wrap: wrap; }
.dg-card .card-head .chips-row { margin: 0; }
.dg-card > .sub { margin: 0 0 6px; }
.dg-summary { font-size: 16px; line-height: 1.5; margin: 6px 0 12px; overflow-wrap: anywhere; }
.dg-actions { display: grid; gap: 10px; margin: 6px 0 12px; }
.dg-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dg-act .sub { flex: 1 1 220px; min-width: 0; }
.dg-act select.dg-hours { width: auto; }
.dg-taken { color: var(--ok-text); }
.dg-more:empty { display: none; }
.dg-fig { margin: 12px 0 4px; }
.dg-chart { width: 100%; height: auto; display: block; background: var(--panel-2); border-radius: var(--radius-sm); }
.dg-chart .grid { stroke: var(--border); stroke-width: 1; }
.dg-chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.dg-chart path { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.dg-chart path.seg { stroke: var(--bad); }
.dg-chart path.rest { stroke: var(--accent); stroke-dasharray: 6 5; stroke-width: 2; }
.dg-chart .dot { fill: var(--bad); }
.dg-key { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--bad); vertical-align: middle; margin: 0 6px 0 0; }
.dg-key.rest { border-top: 3px dashed var(--accent); margin-left: 10px; }
.dg-evidence tr.dg-flag td { background: var(--bad-soft); }
.dg-evidence tr.dg-flag td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.dg-clip { max-width: 520px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dg-bars { display: flex; align-items: flex-end; gap: 2px; height: 56px; margin: 14px 0; padding: 6px; background: var(--panel-2); border-radius: var(--radius-sm); }
.dg-bar { flex: 1 1 0; min-width: 2px; height: 100%; display: flex; align-items: flex-end; }
.dg-bar i { display: block; width: 100%; background: var(--warn); border-radius: 3px 3px 0 0; min-height: 0; }
.dg-autos { display: grid; gap: 10px; margin: 8px 0; }
.dg-auto { display: flex; gap: 10px; align-items: flex-start; margin: 0; font-weight: 400; }
.dg-auto input { width: auto; margin-top: 4px; }
.dg-save { margin-top: 12px; }
.lv-diaglink { color: inherit; font-weight: 800; text-decoration: underline; }
@media (max-width: 640px) {
  .dg-summary { font-size: 15px; }
  .dg-clip { max-width: 240px; }
}
/* ===== complaint shield ===== */
.sh-legal { margin: 0 0 16px; padding: 12px 16px; background: var(--coral-soft); color: var(--coral-text); border-radius: var(--radius-md); font-size: 14.5px; }
.sh-tiles { margin-bottom: 16px; }
.tile.tone-ok .v { color: var(--ok-text); }
.tile.tone-warn .v { color: var(--warn-text); }
.tile.tone-bad .v { color: var(--bad-text); }
.sh-tiles .tile .v { overflow-wrap: anywhere; }
.pill.sh-risk { white-space: nowrap; }
.sh-riskbox { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.sh-reasons { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); }
.sh-numrisk { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start; margin: 4px 0 14px; padding: 12px 16px; background: var(--panel-2); border-radius: var(--radius-md); }
.sh-ev { min-width: 260px; font-size: 13.5px; overflow-wrap: anywhere; }
.sh-actions { margin-top: 12px; }
.sh-reason { width: auto; min-width: 0; flex: 1 1 160px; }
td.actions:has(.sh-reason) { display: flex; gap: 8px; flex-wrap: wrap; min-width: 220px; }
.sh-sub { margin: 18px 0 8px; }
.sh-pats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.sh-pat { padding: 12px 14px; background: var(--panel-2); border-radius: var(--radius-md); min-width: 0; }
.sh-pat h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.sh-pat ul { list-style: none; margin: 0; padding: 0; }
.sh-pat li { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; overflow-wrap: anywhere; }
.sh-words summary { cursor: pointer; font-weight: 800; color: var(--accent-strong); margin-top: 8px; }
.sh-slot:not(:empty) { margin-left: 6px; }
.ag-shield { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.ag-shield .ag-risk-why { flex: 1 1 200px; min-width: 0; }
/* ===== cost optimiser (admin-costpacing.js) ===== */
.cp-panel { display: flex; flex-direction: column; gap: 18px; }
.cp-panel > .card, .cp-panel .card { margin: 0; }
.cp-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; margin-bottom: 12px; }
.cp-head h2 { margin: 0; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cp-head .sub { margin: 4px 0 0; max-width: 70ch; }
.cp-sub { margin: 18px 0 8px; font-size: 16px; }
.cp-decisions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.cp-decisions li { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 14px; line-height: 1.45; overflow-wrap: anywhere; }
.cp-decisions .chip { margin: 0 6px 0 0; }
.cp-live { margin: 12px 0 0; }
.cp-note { margin: 10px 16px 14px; }
.cp-hours { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin: 10px 0; }
.cp-hour { border-radius: 10px; padding: 6px 4px; text-align: center; font-size: 12.5px; line-height: 1.25; position: relative; }
.cp-hour b { display: block; font-family: var(--mono); font-size: 13px; font-weight: 500; }
.cp-hour span { font-variant-numeric: tabular-nums; }
.cp-hour i { display: block; font-style: normal; font-size: 11px; font-weight: 800; }
.cp-hour.none { background: var(--panel-2); color: var(--muted); }
.cp-hour.lo2, .cp-sw.lo2 { background: var(--bad-soft); color: var(--bad-text); }
.cp-hour.lo1, .cp-sw.lo1 { background: var(--warn-soft); color: var(--warn-text); }
.cp-hour.hi1, .cp-sw.hi1 { background: var(--accent-soft); color: var(--accent-strong); }
.cp-hour.hi2, .cp-sw.hi2 { background: var(--accent); color: var(--accent-text); }
.cp-legend .cp-sw { border-radius: 3px; }
.cp-grid { align-items: start; }
.cp-dl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; margin: 8px 0; }
.cp-dl dt { color: var(--muted); font-weight: 700; }
.cp-dl dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cp-levers { display: flex; flex-wrap: wrap; gap: 6px 18px; }
@media (max-width: 640px) { .cp-dl { grid-template-columns: 1fr; } .cp-dl dd { text-align: left; } }
/* ===== Hinglish: Devanagari text, never-say lines, test a sentence ===== */
/* Devanagari falls back to the system's Hindi font (no web font is loaded:
   nothing is fetched from third parties). Matras need extra line height. */
:lang(hi) {
  font-family: "Nunito", "Noto Sans Devanagari", "Nirmala UI", "Mangal", "Kohinoor Devanagari", "Devanagari Sangam MN",
    "Lohit Devanagari", "Shree Devanagari 714", system-ui, sans-serif;
  line-height: 1.6;
}
#assistCheck li.broken { color: var(--bad-text); font-weight: 700; }
#assistCheck li.broken::before { content: "!" / "said: avoid"; background: var(--bad); border-color: var(--bad); color: var(--panel); }
#assistHints .hint.k-tone { background: var(--bad-soft); }
#assistHints .hint.k-tone .hint-label { color: var(--bad-text); }
.lv-flag { padding: 8px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn-text); font-size: 13.5px; margin-bottom: 6px; overflow-wrap: anywhere; }
.lv-flag[data-kind="frustration"], .lv-flag[data-kind="compliance"] { background: var(--bad-soft); color: var(--bad-text); }
.as-lang { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.as-lang select { width: 100%; }
td.as-alts { min-width: 240px; }
.as-test:empty { display: none; }
.as-test { margin-top: 14px; display: grid; gap: 10px; overflow-wrap: anywhere; }
.as-test h3 { font-size: 14px; margin: 6px 0; }
.as-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.as-results li { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.as-results .as-mark { flex: 0 0 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 12px; background: var(--panel-2); color: var(--muted); }
.as-results li.as-yes .as-mark { background: var(--ok); color: var(--panel); }
.as-results li.as-bad .as-mark { background: var(--bad); color: var(--panel); }
.as-results li.as-no { color: var(--muted); }
.pill.as-pill-bad { background: var(--bad-soft); color: var(--bad-text); }
.pill.as-pill-warn { background: var(--warn-soft); color: var(--warn-text); }
/* ===== Phone agents: audio picker, phone line card, live floor icon ===== */
.ap-modes { border: 0; padding: 0; margin: 12px 0 4px; display: grid; gap: 6px; min-width: 0; }
.ap-modes legend { font-weight: 700; margin-bottom: 6px; padding: 0; }
.ap-mode { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--panel-2); cursor: pointer; font-weight: 400; margin: 0; }
.ap-mode input { margin: 3px 0 0; flex: none; width: auto; height: auto; padding: 0; border: 0; box-shadow: none;
  background: none; appearance: auto; accent-color: var(--accent); }
.ap-mode > span { display: grid; min-width: 0; }
.ap-mode .sub { font-size: 13px; }
.ap-mode:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.ap-mode:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ap-note:empty { display: none; }
.ap-card .ap-text { margin: 8px 0; overflow-wrap: anywhere; }
.ap-keys { margin: 6px 0; padding-left: 18px; }
.ap-change .ag-line { margin-top: 8px; }
.ap-change .ag-line input { min-width: 0; }
.pa-cost p { overflow-wrap: anywhere; }
.lv-audio { order: 1; margin-left: auto; flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; background: var(--panel); color: var(--muted); }
.lv-audio svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lv-audio.warn { background: var(--warn-soft); color: var(--warn-text); }
.lv-audio.bad { background: var(--bad-soft); color: var(--bad-text); }

/* ===== Agent app: remembered devices (admin-agentapp.js) ===== */
.aa-slot { display: grid; gap: 18px; }
.aa-foot { margin-top: 10px; }
.aa-msgrow { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr) auto; gap: 8px; }
@media (max-width: 640px) { .aa-msgrow { grid-template-columns: minmax(0, 1fr); } }
.aa-check { display: flex; align-items: center; gap: 8px; min-height: 44px; margin: 0; }
/* ===== Network quality (docs/NETWORK_QUALITY.md) ===== */
/* Grade colours: good = ok, fair = call blue, poor = warn, bad = bad. */
.nq-good { --nq: var(--ok); --nq-soft: var(--ok-soft); --nq-text: var(--ok-text); }
.nq-fair { --nq: var(--call); --nq-soft: var(--call-soft); --nq-text: var(--call-text); }
.nq-poor { --nq: var(--warn); --nq-soft: var(--warn-soft); --nq-text: var(--warn-text); }
.nq-bad { --nq: var(--bad); --nq-soft: var(--bad-soft); --nq-text: var(--bad-text); }
.nq-none { --nq: var(--pause); --nq-soft: var(--pause-soft); --nq-text: var(--pause-text); }
.nq-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.nq-bars i { display: block; width: 4px; border-radius: 2px; background: var(--border-strong); }
.nq-bars i:nth-child(1) { height: 25%; } .nq-bars i:nth-child(2) { height: 50%; }
.nq-bars i:nth-child(3) { height: 75%; } .nq-bars i:nth-child(4) { height: 100%; }
.nq-bars i.on { background: var(--nq, var(--accent)); }
/* Agent panel: the indicator in the header and its details. */
.nq-ind { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: var(--pill);
  background: var(--nq-soft); color: var(--nq-text); border: 1px solid transparent; font-weight: 800; min-height: 36px; }
.nq-ind:hover { border-color: var(--nq); }
.nq-ind.hidden { display: none; }
.nq-pop { position: fixed; top: 64px; right: 16px; width: min(380px, calc(100vw - 32px)); max-height: calc(100vh - 80px); overflow: auto;
  z-index: 40; box-shadow: var(--shadow-lift); }
.nq-pop.hidden { display: none; }
.nq-pophead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nq-pophead h2 { margin: 0; }
.nq-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; font-size: 14px; }
.nq-kv dt { color: var(--muted); }
.nq-kv dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.nq-tip { margin: 8px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn-text); font-weight: 700; }
.nq-tip.sub { background: var(--panel-2); color: var(--muted); font-weight: 400; }
.nq-note { margin: 8px 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad-text); font-weight: 700; }
.nq-testrow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; margin-top: 12px; }
.nq-testhead { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.nq-advice { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.pill.nq-pill { background: var(--nq-soft); color: var(--nq-text); }
/* Live floor: badge on each agent card, banner, filter chip, drawer chart. */
.nq-badge { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; max-width: 100%;
  border-radius: var(--pill); background: var(--panel); color: var(--nq-text); font-size: 12.5px; font-weight: 800;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nq-badge .nq-bars { height: 12px; flex: 0 0 auto; } .nq-badge .nq-bars i { width: 3px; }
.nq-badge.nq-poor, .nq-badge.nq-bad { background: var(--nq-soft); box-shadow: inset 0 0 0 1px var(--nq); }
.nq-badge.hidden { display: none; }
.nq-banner { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--bad-soft); color: var(--bad-text);
  font-weight: 700; overflow-wrap: anywhere; }
.nq-banner.hidden { display: none; }
.nq-chip { --c: var(--warn); --c-soft: var(--warn-soft); --c-text: var(--warn-text); }
.nq-chart { width: 100%; height: auto; display: block; }
.nq-chart .grid { stroke: var(--border); stroke-width: 1; }
.nq-chart .axis { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.nq-chart .mos { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.nq-chart .loss { fill: var(--bad-soft); stroke: var(--bad); stroke-width: 1; }
.nq-chart .cust { fill: none; stroke: var(--call); stroke-width: 2; stroke-dasharray: 5 4; }
.nq-chart .band { fill: var(--warn-soft); opacity: 0.5; }
.nq-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.nq-legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 5px; background: var(--accent); }
.nq-legend .l-loss i { background: var(--bad); } .nq-legend .l-cust i { background: var(--call); }
/* Wallboard summary pill. */
.wb-nq.hidden { display: none; }
/* Admin: network report and call quality. */
.nq-verdict { white-space: nowrap; }
.nq-sum { margin: 8px 0 0; }

/* ===== Keys & integrations (admin-keys.js, docs/KEYS.md) ===== */
.keys-intro { margin: 0 0 8px; }
.keys-group { margin-top: 18px; }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: 16px; align-items: start; }
.keys-card { min-width: 0; margin: 0; }
.keys-card .lead-sub { margin-bottom: 10px; }
.keys-fields { display: grid; gap: 12px; }
.keys-field { background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.keys-field.broken { border-color: var(--warn); }
.keys-field-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.keys-field-top label { margin: 0; font-weight: 800; }
.sm-pill { font-size: 12px; padding: 2px 10px; }
.keys-now { margin: 4px 0 6px; font-size: 14px; overflow-wrap: anywhere; }
.keys-val { font-size: 13px; }
.keys-edit { display: flex; gap: 8px; align-items: center; }
.keys-edit input { flex: 1 1 auto; min-width: 0; }
.keys-env, .keys-when { margin-top: 4px; overflow-wrap: anywhere; }
.keys-uses { margin: 0 0 10px; padding-left: 18px; font-size: 14px; }
.keys-uses li { margin: 2px 0; overflow-wrap: anywhere; }
.keys-reload { font-size: 13.5px; }
.keys-actions { margin-top: 12px; flex-wrap: wrap; align-items: center; }
.keys-res { overflow-wrap: anywhere; min-width: 0; }
.keys-res.ok { color: var(--ok-text); }
.keys-res.bad { color: var(--bad-text); }
