/* Colours: the IVR logo's blues with the YSRCP party blue #144995 and green #009247. */
:root {
  color-scheme: light;
  --ink: #071d52;
  --header-bg: linear-gradient(90deg, #071d52 0%, #144995 55%, #0b5ce0 100%);
  --hero-bg: linear-gradient(160deg, #061848 0%, #144995 65%, #0a6e63 130%);
  --bg: #f4f8fe;
  --surface: #ffffff;
  --surface-2: #eef4fd;
  --border: #dce6f5;
  --text: #0b1a3a;
  --muted: #5a6b8a;
  --primary: #0b5ce0;
  --primary-strong: #0847b3;
  --primary-ink: #ffffff;
  --primary-soft: rgba(11, 92, 224, .09);
  --primary-border: rgba(11, 92, 224, .22);
  --sky: #0a9cf0;
  --sky-soft: rgba(10, 156, 240, .12);
  --green: #009247;
  --green-soft: rgba(0, 146, 71, .11);
  --accent-2: #009247;
  --gradient: linear-gradient(120deg, #0b4fd6 0%, #0a86f0 48%, #0aa36f 100%);
  --flag: linear-gradient(90deg, #144995 0 33.3%, #ffffff 33.3% 66.6%, #009247 66.6% 100%);
  --glow: rgba(11, 92, 224, .25);
  --glow-strong: rgba(11, 92, 224, .38);
  --disabled-bg: #dfe7f3;
  --disabled-ink: #8796ae;
  --success: #00813f;
  --success-soft: rgba(0, 146, 71, .12);
  --warn: #a15c07;
  --warn-soft: #fff4d6;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --info-soft: rgba(11, 92, 224, .07);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 26, 58, .05), 0 10px 28px rgba(11, 26, 58, .07);
  --shadow-lg: 0 2px 4px rgba(11, 26, 58, .05), 0 24px 56px rgba(11, 26, 58, .16);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* Dark theme: when chosen, or when the device is dark and "System" is chosen. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #030a1f;
  --header-bg: linear-gradient(90deg, #030a1f 0%, #0a1f4d 60%, #0d2d6e 100%);
  --hero-bg: linear-gradient(160deg, #030a1f 0%, #0a1f4d 65%, #07473f 130%);
  --bg: #050d22;
  --surface: #0a1733;
  --surface-2: #10214a;
  --border: #1b3263;
  --text: #e8f0ff;
  --muted: #9db0d3;
  --primary: #4d9bff;
  --primary-strong: #7db6ff;
  --primary-soft: rgba(77, 155, 255, .15);
  --primary-border: rgba(77, 155, 255, .32);
  --sky: #38bdf8;
  --sky-soft: rgba(56, 189, 248, .14);
  --green: #22c58b;
  --green-soft: rgba(34, 197, 139, .14);
  --accent-2: #22c58b;
  --gradient: linear-gradient(120deg, #1a5fe0 0%, #1a95f2 48%, #12b07c 100%);
  --glow: rgba(26, 120, 240, .32);
  --glow-strong: rgba(26, 120, 240, .5);
  --disabled-bg: #15284f;
  --disabled-ink: #5f74a0;
  --success: #3ddc97;
  --success-soft: rgba(61, 220, 151, .14);
  --warn: #f5c04a;
  --warn-soft: rgba(245, 192, 74, .14);
  --danger: #ff7a6b;
  --danger-soft: rgba(255, 122, 107, .14);
  --info-soft: rgba(77, 155, 255, .1);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 24px 56px rgba(0, 0, 0, .55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ink: #030a1f;
    --header-bg: linear-gradient(90deg, #030a1f 0%, #0a1f4d 60%, #0d2d6e 100%);
    --hero-bg: linear-gradient(160deg, #030a1f 0%, #0a1f4d 65%, #07473f 130%);
    --bg: #050d22;
    --surface: #0a1733;
    --surface-2: #10214a;
    --border: #1b3263;
    --text: #e8f0ff;
    --muted: #9db0d3;
    --primary: #4d9bff;
    --primary-strong: #7db6ff;
    --primary-soft: rgba(77, 155, 255, .15);
    --primary-border: rgba(77, 155, 255, .32);
    --sky: #38bdf8;
    --sky-soft: rgba(56, 189, 248, .14);
    --green: #22c58b;
    --green-soft: rgba(34, 197, 139, .14);
    --accent-2: #22c58b;
    --gradient: linear-gradient(120deg, #1a5fe0 0%, #1a95f2 48%, #12b07c 100%);
    --glow: rgba(26, 120, 240, .32);
    --glow-strong: rgba(26, 120, 240, .5);
    --disabled-bg: #15284f;
    --disabled-ink: #5f74a0;
    --success: #3ddc97;
    --success-soft: rgba(61, 220, 151, .14);
    --warn: #f5c04a;
    --warn-soft: rgba(245, 192, 74, .14);
    --danger: #ff7a6b;
    --danger-soft: rgba(255, 122, 107, .14);
    --info-soft: rgba(77, 155, 255, .1);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 24px 56px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", "Noto Sans Telugu", system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 700; }
a { color: var(--primary); }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.hidden { display: none !important; }
.mobile-only { display: none; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

/* ------------------------------------------------------------ sign-in */
.auth-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  padding: 40px 48px;
  background: var(--hero-bg); color: #e8ecf8;
}
.auth-hero::before, .auth-hero::after {
  content: ""; position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; pointer-events: none;
}
.auth-hero::before { width: 420px; height: 420px; background: #1d63c4; top: -120px; right: -120px; }
.auth-hero::after { width: 380px; height: 380px; background: #009247; bottom: -160px; left: -80px; opacity: .45; }
.auth-hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 20px; color: #fff; }
.hero-brand .logo-tile { width: 48px; height: 48px; border-radius: 14px; }
.hero-brand .logo-tile img { width: 42px; height: 42px; }
.hero-art {
  width: 168px; height: 168px; border-radius: 36px; margin-bottom: 26px;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35), 0 0 0 8px rgba(255, 255, 255, .08);
}
.hero-art img { width: 140px; height: 140px; }
.hero-copy { max-width: 480px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); color: #d6e6ff; margin-bottom: 16px;
}
.hero-copy h1 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 14px; }
.hero-copy p { color: #a9b3cc; font-size: 16px; margin: 0 0 24px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.hero-points li { display: flex; align-items: center; gap: 12px; color: #e8ecf8; }
.hero-points li::before {
  content: "✓"; display: grid; place-items: center; flex-shrink: 0;
  width: 24px; height: 24px; border-radius: 50%; font-size: 12px; font-weight: 800; color: #fff;
  background: var(--gradient);
}
.hero-foot { color: #a9b3cc; font-size: 13px; }
.flag-strip { width: 96px; height: 6px; border-radius: 3px; background: var(--flag); margin-bottom: 18px; }
.auth-panel { display: grid; place-items: center; padding: 32px 20px; }

.auth-card { width: 100%; max-width: 400px; text-align: center; padding: 32px 28px; box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 22px; font-weight: 800; }
.auth-card form { display: grid; gap: 10px; margin-top: 12px; }
.auth-logo { display: block; margin: 0 auto 14px; filter: drop-shadow(0 8px 18px var(--glow)); }
.access-brand {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 700; font-size: 13px; color: var(--muted); margin-bottom: 20px;
}

.fine-print { margin: 16px 0 0; }
.google-btn { display: flex; justify-content: center; margin: 22px 0 8px; min-height: 44px; }
.divider { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin: 8px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ------------------------------------------------------------ controls */
input[type=text], input[type=email], input[type=search], input:not([type]), textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=search] { width: 220px; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }

.btn {
  font: inherit; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s, filter .15s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary:disabled { background: var(--disabled-bg); color: var(--disabled-ink); box-shadow: none; opacity: 1; }
.btn.primary {
  background: var(--gradient); border-color: transparent; color: var(--primary-ink);
  box-shadow: 0 6px 18px var(--glow);
}
.btn.primary:hover:not(:disabled) { background: var(--gradient); filter: brightness(1.08); box-shadow: 0 8px 24px var(--glow-strong); }
.btn.danger-ghost { color: var(--danger); }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.link { border: none; background: none; color: var(--muted); margin-top: 14px; box-shadow: none; }
.btn.wide { width: 100%; }

.notice { padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; text-align: left; margin: 12px 0; }
.notice.info { background: var(--info-soft); }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.error { background: var(--danger-soft); color: var(--danger); }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; overflow: hidden;
  display: inline-grid; place-items: center;
  background: var(--gradient); color: #fff; font-weight: 700; font-size: 12px;
}
.icon-btn {
  font: inherit; font-size: 16px; line-height: 1; cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: background .15s, transform .15s var(--ease);
}
.icon-btn:hover { transform: rotate(-12deg); }
.topbar .icon-btn { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); }
.theme-fab { position: fixed; top: 16px; right: 16px; z-index: 6; box-shadow: var(--shadow); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 72px; height: 72px; font-size: 24px; margin: 0 auto 10px; display: grid; }

/* ------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 20px;
  padding: 10px 28px;
  background: var(--header-bg); color: #fff;
  box-shadow: 0 8px 24px rgba(11, 35, 80, .18);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--flag);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, .35);
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo-tile {
  display: grid; place-items: center; flex-shrink: 0;
  background: #fff; border-radius: 12px; padding: 3px;
  box-shadow: 0 2px 8px rgba(3, 10, 31, .25);
}
.brand .logo-tile { width: 40px; height: 40px; }
.brand .logo-tile img { width: 34px; height: 34px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 15px; }
.brand-product { font-size: 11.5px; color: #c4d4ee; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; flex: 1; margin-left: 12px; }
.tab {
  font: inherit; font-weight: 600; border: none; background: none; color: #c4d4ee;
  padding: 8px 16px; border-radius: 999px; cursor: pointer; transition: background .15s, color .15s;
}
.tab:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.tab.active { background: rgba(255, 255, 255, .14); color: #fff; }
.badge {
  display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; margin-left: 4px;
  background: var(--accent-2); color: #fff; font-size: 11px; line-height: 18px; text-align: center;
}
.user-menu { display: flex; align-items: center; gap: 10px; }
.me-name { color: #e8ecf8; font-weight: 600; }
.topbar .btn.small { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #fff; }
.topbar .btn.small:hover { background: rgba(255, 255, 255, .16); }
.banner { background: var(--warn-soft); color: var(--warn); text-align: center; padding: 7px 16px; font-size: 13px; font-weight: 600; }

/* ------------------------------------------------------------ layout */
.container { max-width: 1200px; margin: 0 auto; padding: 28px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head h1 { font-size: 26px; font-weight: 800; margin-bottom: 2px; }
.page-head p { margin: 0; }
.overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px;
}
.kpi-icon {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 20px; background: var(--primary-soft);
}
.kpi:nth-child(2) .kpi-icon { background: var(--sky-soft); }
.kpi:nth-child(3) .kpi-icon { background: var(--primary-soft); }
.kpi:nth-child(4) .kpi-icon { background: var(--green-soft); }
.kpi:nth-child(4) .kpi-v { color: var(--green); }
.kpi { transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.kpi-v { font-size: 24px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 12.5px; color: var(--muted); font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid-2 .card { margin-bottom: 18px; }
.grid-2 form { display: grid; gap: 10px; }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.row-between h3 { margin: 0; }
.gap { gap: 8px; }
.wrap { flex-wrap: wrap; }
.end { justify-content: flex-end; }

.page-head.wrap { flex-wrap: wrap; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.toolbar h3 { margin-bottom: 2px; }
.toolbar p { margin: 0; }
select {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 12px; max-width: 100%;
}
select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
dialog select { width: 100%; }
audio { height: 34px; width: 220px; max-width: 100%; }

.flows-help { margin: 0; max-width: 720px; }
.flows-list { display: grid; gap: 8px; margin-bottom: 14px; }
.flow-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2);
}
.flow-item.default { border-color: var(--primary-border); background: var(--primary-soft); }
.flow-item .flow-name { font-weight: 700; }
.flow-form { display: grid; grid-template-columns: 1.2fr .7fr 1.2fr 1.4fr auto; gap: 8px; align-items: center; }
.length-field { display: flex; gap: 6px; align-items: center; }
.length-field input { min-width: 0; }
.length-field .btn { white-space: nowrap; }
.heard { display: grid; gap: 4px; min-width: 110px; }
.heard-bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.heard-bar > div { height: 100%; border-radius: 3px; background: var(--primary); }
.heard-bar.full > div { background: var(--green); }

.footer {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 16px 32px; color: var(--muted); font-size: 13px;
}
.footer img { border-radius: 50%; }
.footer strong { color: var(--text); font-weight: 700; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--primary); }

.dropzone {
  display: grid; place-items: center; gap: 4px; text-align: center;
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 30px 16px; cursor: pointer; transition: .15s; background: var(--surface-2);
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.tag-actions strong { color: var(--primary); }
.tag-actions { border-left: 4px solid var(--green); }
.dz-icon {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-size: 20px; color: #fff; background: var(--gradient); margin-bottom: 6px;
}

.file-results { display: grid; gap: 6px; margin-bottom: 12px; }
.file-result { display: flex; gap: 8px; align-items: center; font-size: 13px; }

/* ------------------------------------------------------------ tags */
.inline-field { display: grid; gap: 4px; font-weight: 600; margin-bottom: 12px; max-width: 420px; }
.tag-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 5px 14px; transition: background .15s, border-color .15s;
}
.chip:hover { border-color: var(--primary); }
.chip.active { background: var(--gradient); border-color: transparent; color: #fff; }
.chip .n { opacity: .7; margin-left: 6px; font-weight: 500; }
.tag {
  display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; margin: 1px 4px 1px 0; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary);
}
.tag-actions {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--primary-soft); border: 1px solid var(--primary-border);
  border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 14px;
}
.bulk-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 14px;
}
.bulk-bar input { width: 180px; padding: 6px 10px; }
.spacer { flex: 1; }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; max-height: 560px; overflow-y: auto; }
.table-wrap.short { max-height: 280px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
  position: sticky; top: 0; z-index: 1; background: var(--surface-2);
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700;
}
th:first-child { border-top-left-radius: var(--radius-sm); }
th:last-child { border-top-right-radius: var(--radius-sm); }
td.wrap-cell { white-space: normal; max-width: 280px; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--surface-2); }
th.check, td.check { width: 40px; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }

.pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--surface-2); color: var(--muted);
}
.pill.green { background: var(--success-soft); color: var(--success); }
.pill.amber { background: var(--warn-soft); color: var(--warn); }
.pill.red { background: var(--danger-soft); color: var(--danger); }
.pill.blue { background: var(--primary-soft); color: var(--primary); }

/* ------------------------------------------------------------ call batches */
.campaign-layout { display: grid; grid-template-columns: 340px 1fr; gap: 18px; align-items: start; }
.campaign-item {
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.campaign-item:hover { border-color: var(--primary); }
.campaign-item.active { border-color: var(--primary); background: var(--primary-soft); }
.campaign-item .title { font-weight: 700; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 10px 0 4px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--primary), var(--green)); transition: width .4s var(--ease); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 16px 0; }
.section-title { margin: 6px 0 0; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.stat .v { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); font-weight: 500; }

/* ------------------------------------------------------------ dialog */
dialog {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 26px;
  width: min(480px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog::backdrop { background: rgba(5, 15, 35, .55); backdrop-filter: blur(2px); }
dialog h3 { font-size: 19px; font-weight: 800; }
dialog label { display: grid; gap: 4px; font-weight: 600; margin: 12px 0; }
.toast.error { background: var(--danger); }

.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid var(--border); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------ tablet */
@media (max-width: 960px) {
  .hero-art { width: 96px; height: 96px; border-radius: 24px; margin-bottom: 16px; }
  .hero-art img { width: 80px; height: 80px; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 24px; gap: 20px; }
  .hero-copy h1 { font-size: 26px; }
  .hero-copy p { font-size: 14.5px; margin-bottom: 16px; }
  .hero-points, .hero-foot { display: none; }
  .auth-panel { padding: 24px 16px 40px; }
  .overview { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .grid-2, .campaign-layout { grid-template-columns: 1fr; }
  .grid-2 { gap: 0; }
  .topbar { flex-wrap: wrap; padding: 10px 16px 0; gap: 8px 12px; }
  .brand { flex: 1; }
  .tabs { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 -16px; padding: 4px 12px 8px; }
  .tab { flex: 1; text-align: center; }
  .me-name { display: none; }
  .container { padding: 16px; }
  .campaign-list #campaigns-list { max-height: 300px; overflow-y: auto; }
}

/* ------------------------------------------------------------ phone */
@media (max-width: 640px) {
  /* 16px stops iOS Safari from zooming into fields on focus. */
  input, textarea, select { font-size: 16px !important; }
  .card { padding: 16px; border-radius: 14px; }
  .auth-card { padding: 26px 20px; }
  .container { padding: 12px 12px 96px; }
  .page-head h1 { font-size: 21px; }
  .overview { gap: 10px; margin-bottom: 14px; }
  .kpi { padding: 12px; gap: 10px; }
  .kpi-icon { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }
  .kpi-v { font-size: 20px; }
  .row-between { flex-wrap: wrap; }
  .row-between > .row { width: 100%; }
  .row-between > .row > .btn { flex: 1; }
  input[type=search] { width: 100%; flex-basis: 100%; }
  .tag-bar { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-right: -16px; }
  .chip { flex-shrink: 0; padding: 7px 14px; }
  .tag-actions > .row, .tag-actions .btn { width: 100%; }
  .bulk-bar > span:first-child, .bulk-bar input { flex-basis: 100%; }
  .bulk-bar .btn { flex: 1; }
  .bulk-bar .spacer { display: none; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 8px 10px; }
  .stat .v { font-size: 18px; }
  .btn { padding: 10px 14px; }
  .btn.small { padding: 7px 10px; }
  .dropzone { padding: 20px 12px; }
  .toast { bottom: 88px; }
  .footer { padding-bottom: 100px; }

  /* "Call selected" floats at the bottom of the screen once numbers are picked. */
  #call-selected:not(:disabled) {
    position: fixed; left: 12px; right: 12px; bottom: 16px; z-index: 10;
    padding: 14px; font-size: 15px; border-radius: 14px;
    box-shadow: 0 10px 28px var(--glow-strong);
  }

  /* Tables become a list of cards. */
  .table-wrap { max-height: none; overflow: visible; }
  .table-wrap.short { max-height: 320px; overflow-y: auto; }
  table.cards thead { display: none; }
  table.cards, table.cards tbody { display: block; }
  table.cards tr {
    display: grid; grid-template-columns: 1fr auto; gap: 2px 12px;
    position: relative; padding: 12px 14px; margin-bottom: 8px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
  }
  table.cards td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    grid-column: 1 / -1; padding: 3px 0; border: none; white-space: normal;
  }
  table.cards td[data-label]::before {
    content: attr(data-label); color: var(--muted); font-size: 12px; flex-shrink: 0;
  }
  table.cards td.wrap-cell { max-width: none; text-align: right; }
  table.cards td.wrap-cell[data-label] { justify-content: space-between; }
  table.cards td.primary-cell { font-size: 15px; font-weight: 700; padding-bottom: 6px; }
  table.cards td.check { position: absolute; top: 12px; right: 12px; width: auto; padding: 0; }
  table.cards td.check input { width: 22px; height: 22px; }
  table.cards tr:has(td.check) td.primary-cell { padding-right: 36px; }
  table.cards tr:has(td.check input:checked) { border-color: var(--primary); background: var(--primary-soft); }
  table.cards td.actions-cell { padding-top: 8px; }
  table.cards td.actions-cell .row { width: 100%; }
  table.cards td.actions-cell .btn { flex: 1; }
  tbody tr:hover { background: var(--surface); }
  /* Tap anywhere on a number card to select it. */
  #contacts-body tr { cursor: pointer; }
  .mobile-only { display: flex; }
  .select-all-m { align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 600; }
  .select-all-m input { width: 20px; height: 20px; }

  .toolbar .row, .toolbar select { width: 100%; }
  .flow-form { grid-template-columns: 1fr; }
  table.cards .heard { justify-items: end; min-width: 140px; }
  table.cards .heard-bar { width: 140px; }
  .flow-item .row { width: 100%; }
  .flow-item .row .btn { flex: 1; }
  .toolbar .row .btn { flex: 1; }
  #new-batch { width: 100%; }
  table.cards audio { width: 100%; }
  dialog { padding: 20px; margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 18px 18px 0 0; }
  dialog .row.end .btn { flex: 1; }
}
