/* ══════════════════════════════════════════════════════════════
   VSELL — redesign layer

   Loaded after app.css. This is the commercial-SaaS visual system:
   a calm grey canvas, white surfaces, one cobalt accent, clear
   hierarchy and one set of reusable controls. app.css still owns
   the component behaviours that predate it; this sheet retunes
   those components and adds the dashboard, inbox and navigation
   components the redesign introduces.

   Rules kept from the original sheet: one accent, status hues
   only on status, spacing on an 8px rhythm, motion only for
   feedback, and light/dark as the same design re-tokenised.
   ══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────── */

:root {
  --sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-caption: 0.75rem;
  --fs-ui: 0.8125rem;
  --fs-body: 0.875rem;
  --fs-lead: 0.9375rem;
  --fs-h3: 1rem;
  --fs-h2: 1.25rem;
  --fs-kpi: 1.875rem;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;

  --r-xs: 6px; --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-xl: 20px;

  --sidebar-w: 248px;
  --sidebar-w-collapsed: 78px;
  --header-h: 68px;
  --content-w: 1440px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  /* Light: cool grey canvas, white surfaces. */
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #F4F6FA;
  --surface-3: #EDF0F6;
  --line: #E8ECF2;
  --line-strong: #D8DEE9;
  --text: #111827;
  --text-2: #4B5563;
  --text-3: #6B7280;
  --accent: #2563EB;
  --accent-hover: #1D4ED8;
  --accent-text: #FFFFFF;
  --accent-soft: #EFF4FF;
  --accent-line: #DBE5FE;
  --chart-muted: #C8D7FB;

  --good: #15803D; --good-bg: #ECFDF3; --good-line: #C6F0D6;
  --wait: #B45309; --wait-bg: #FFF7E6; --wait-line: #FDE7BE;
  --bad: #DC2626; --bad-bg: #FEF2F2; --bad-line: #FBD5D5;
  --active: #0E7490; --active-bg: #E8F7FA; --active-line: #C2E9F1;
  --note: #7C3AED; --note-bg: #F5F1FF; --note-line: #E3D8FD;

  --shadow-border:
    0 1px 2px rgb(16 24 40 / 0.04),
    0 0 0 1px rgb(16 24 40 / 0.05);
  --shadow-border-hover:
    0 4px 12px rgb(16 24 40 / 0.07),
    0 0 0 1px rgb(16 24 40 / 0.07);
  --shadow-pop:
    0 18px 44px -12px rgb(16 24 40 / 0.22),
    0 0 0 1px rgb(16 24 40 / 0.08);
  --btn-shadow: 0 0 0 1px var(--line), 0 1px 2px rgb(16 24 40 / 0.04);
  --btn-primary-shadow: 0 1px 2px rgb(37 99 235 / 0.24), inset 0 1px 0 rgb(255 255 255 / 0.16);
  --nav-active: #EAF1FF;
  --nav-active-text: #1D4ED8;
  color-scheme: light;
}

:root[data-theme='dark'] {
  --bg: #0F1115;
  --surface: #151922;
  --surface-2: #1B202A;
  --surface-3: #232A36;
  --line: #262D3A;
  --line-strong: #364153;
  --text: #F3F5F9;
  --text-2: #B0B9C8;
  --text-3: #8A95A8;
  --accent: #3B82F6;
  --accent-hover: #60A5FA;
  --accent-text: #FFFFFF;
  --accent-soft: #12203D;
  --accent-line: #1E3A6E;
  --chart-muted: #23365B;

  --good: #4ADE80; --good-bg: #10261B; --good-line: #1C4130;
  --wait: #FBBF24; --wait-bg: #2A2010; --wait-line: #4A3817;
  --bad: #F87171; --bad-bg: #2C1316; --bad-line: #4C1F25;
  --active: #38BDF8; --active-bg: #0C2328; --active-line: #164049;
  --note: #A78BFA; --note-bg: #1E1730; --note-line: #352857;

  --shadow-border: 0 1px 2px rgb(0 0 0 / 0.22), 0 0 0 1px rgb(255 255 255 / 0.06);
  --shadow-border-hover: 0 6px 18px rgb(0 0 0 / 0.28), 0 0 0 1px rgb(255 255 255 / 0.09);
  --shadow-pop: 0 20px 48px -12px rgb(0 0 0 / 0.65), 0 0 0 1px rgb(255 255 255 / 0.09);
  --btn-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 0 0 1px rgb(255 255 255 / 0.09);
  --btn-primary-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18);
  --nav-active: #17233C;
  --nav-active-text: #8CB4FF;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0F1115;
    --surface: #151922;
    --surface-2: #1B202A;
    --surface-3: #232A36;
    --line: #262D3A;
    --line-strong: #364153;
    --text: #F3F5F9;
    --text-2: #B0B9C8;
    --text-3: #8A95A8;
    --accent: #3B82F6;
    --accent-hover: #60A5FA;
    --accent-text: #FFFFFF;
    --accent-soft: #12203D;
    --accent-line: #1E3A6E;
    --chart-muted: #23365B;
    --good: #4ADE80; --good-bg: #10261B; --good-line: #1C4130;
    --wait: #FBBF24; --wait-bg: #2A2010; --wait-line: #4A3817;
    --bad: #F87171; --bad-bg: #2C1316; --bad-line: #4C1F25;
    --active: #38BDF8; --active-bg: #0C2328; --active-line: #164049;
    --note: #A78BFA; --note-bg: #1E1730; --note-line: #352857;
    --shadow-border: 0 1px 2px rgb(0 0 0 / 0.22), 0 0 0 1px rgb(255 255 255 / 0.06);
    --shadow-border-hover: 0 6px 18px rgb(0 0 0 / 0.28), 0 0 0 1px rgb(255 255 255 / 0.09);
    --shadow-pop: 0 20px 48px -12px rgb(0 0 0 / 0.65), 0 0 0 1px rgb(255 255 255 / 0.09);
    --btn-shadow: inset 0 1px 0 rgb(255 255 255 / 0.05), 0 0 0 1px rgb(255 255 255 / 0.09);
    --btn-primary-shadow: inset 0 1px 0 rgb(255 255 255 / 0.18);
    --nav-active: #17233C;
    --nav-active-text: #8CB4FF;
    color-scheme: dark;
  }
}

/* ── Base ────────────────────────────────────────────────────── */

html, body { max-width: 100%; overflow-x: hidden; }
body {
  background: var(--bg);
  font-size: var(--fs-body);
  line-height: 1.5;
}
main.content {
  padding: 0;
  min-width: 0;
}
.content-inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: var(--sp-6);
}
h1, h2, h3, h4 { color: var(--text); letter-spacing: -0.015em; }
h1 { font-size: 1.25rem; font-weight: 650; }
h2 { font-size: var(--fs-h2); font-weight: 650; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--accent-soft); color: var(--text); }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 12px; top: -60px; z-index: 200;
  background: var(--surface); color: var(--text); padding: 10px 14px;
  border-radius: var(--r-sm); box-shadow: var(--shadow-pop); font-weight: 600;
  transition: top 150ms var(--ease-out);
}
.skip-link:focus { top: 12px; }

/* ── Application shell ───────────────────────────────────────── */

.app { display: block; min-height: 100dvh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 60;
  width: var(--sidebar-w); height: 100dvh;
  display: flex; flex-direction: column;
  gap: 0;
  padding: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow: hidden;
  transition: width 200ms var(--ease-out), transform 220ms var(--ease-out);
}

.sidebar-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  height: var(--header-h); padding: 0 var(--sp-4) 0 20px; flex: none;
}
.brand { padding: 0; gap: 0; }
.brand-lockup { font-size: 22px; font-weight: 650; letter-spacing: -0.045em; gap: 9px; }
.brand-lockup svg { width: 22px; height: 22px; color: var(--accent); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.05; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.045em; }
.brand-tagline {
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  color: var(--text-3); white-space: nowrap; margin-top: 3px;
}
.sidebar-collapse {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-3); cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.sidebar-collapse:hover { background: var(--surface-2); color: var(--text); }
.sidebar-collapse .icon { width: 15px; height: 15px; transition: transform 200ms var(--ease-out); }

.nav-scroll {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--sp-2) 12px var(--sp-4);
}
nav { display: flex; flex-direction: column; gap: 22px; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  padding: 0 10px 6px; font-size: 10.5px; font-weight: 650;
  letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-3);
}
nav button {
  position: relative;
  display: flex; align-items: center; gap: 11px; width: 100%;
  height: 38px; padding: 0 10px; border: none; border-radius: 10px;
  background: transparent; color: var(--text-2);
  font: 500 var(--fs-body)/1 var(--sans); text-align: left; cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
nav button .icon { width: 18px; height: 18px; color: var(--text-3); transition: color 120ms ease; }
nav button .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav button:hover { background: var(--surface-2); color: var(--text); }
nav button:hover .icon { color: var(--text-2); }
nav button.active {
  background: var(--nav-active); color: var(--nav-active-text);
  box-shadow: none; font-weight: 600;
}
nav button.active .icon { color: var(--nav-active-text); }
nav button.active::before {
  content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-count {
  display: none; min-width: 20px; height: 20px; padding: 0 6px;
  align-items: center; justify-content: center;
  border-radius: 99px; background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums;
}
.nav-count.on { display: inline-flex; }
nav button.active .nav-count { background: var(--surface); color: var(--accent); }

.sidebar-foot {
  flex: none; margin: 0; padding: 12px;
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px;
}
.connection-card {
  padding: 11px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line);
}
.connection-card .sellbird-status { font-size: var(--fs-ui); font-weight: 600; color: var(--text); }
.connection-card .connection-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 4px; font-size: 11.5px; color: var(--text-3);
}
.connection-card .connection-link {
  color: var(--accent); text-decoration: none; font-weight: 550;
}
.connection-card .connection-link:hover { text-decoration: underline; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3);
}
.status-dot.running { background: var(--good); box-shadow: 0 0 0 3px var(--good-bg); }
.status-dot.offline { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-bg); }

.sidebar-account {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 2px 4px;
}
.account-avatar {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2563EB, #1E40AF); color: #fff;
  font-size: 13px; font-weight: 700; letter-spacing: -0.02em;
}
.account-meta { min-width: 0; flex: 1; line-height: 1.25; }
.account-meta b { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.account-meta span { display: block; font-size: 10.5px; color: var(--text-3); }
.sidebar-theme {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-2); cursor: pointer;
}
.sidebar-theme:hover { background: var(--surface-2); color: var(--text); }

/* Collapsed desktop sidebar: icons, tooltips, no labels. */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .app-main { margin-left: var(--sidebar-w-collapsed); }
body.sidebar-collapsed .brand-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed nav button .label,
body.sidebar-collapsed .nav-count,
body.sidebar-collapsed .connection-card,
body.sidebar-collapsed .account-meta { display: none; }
body.sidebar-collapsed .sidebar-head { justify-content: center; padding: 0; }
body.sidebar-collapsed .brand-lockup { gap: 0; }
body.sidebar-collapsed .sidebar-collapse { display: none; }
body.sidebar-collapsed .nav-scroll { padding-inline: 12px; }
body.sidebar-collapsed nav button { justify-content: center; padding: 0; }
body.sidebar-collapsed nav button.active::before { left: -12px; }
body.sidebar-collapsed .sidebar-account { justify-content: center; }
body.sidebar-collapsed .sidebar-theme { display: none; }
body.sidebar-collapsed nav button::after {
  content: attr(data-tooltip); position: absolute; left: calc(100% + 12px); top: 50%;
  translate: 0 -50%; z-index: 80; white-space: nowrap;
  padding: 6px 9px; border-radius: var(--r-xs);
  background: var(--text); color: var(--bg);
  font-size: 11.5px; font-weight: 550; opacity: 0; pointer-events: none;
  transition: opacity 120ms ease;
}
body.sidebar-collapsed nav button:hover::after,
body.sidebar-collapsed nav button:focus-visible::after { opacity: 1; }
body.sidebar-collapsed .sidebar-foot { border-top: none; }

.app-main {
  margin-left: var(--sidebar-w);
  min-height: 100dvh;
  display: flex; flex-direction: column;
  transition: margin-left 200ms var(--ease-out);
}

/* ── Topbar ──────────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 40;
  height: var(--header-h); flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  padding: 0 var(--sp-6);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.2) blur(10px);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-heading { min-width: 0; }
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-3); line-height: 1.2; margin-bottom: 2px;
}
.breadcrumb b { font-weight: 550; color: var(--text-2); }
.topbar h1 {
  margin: 0; font-size: 1.0625rem; font-weight: 650;
  letter-spacing: -0.02em; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.search-trigger {
  display: inline-flex; align-items: center; gap: 9px;
  width: min(290px, 26vw); height: 36px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text-3); cursor: pointer;
  font: 400 var(--fs-ui)/1 var(--sans); text-align: left;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search-trigger:hover { border-color: var(--line-strong); box-shadow: var(--shadow-border); }
.search-trigger .icon { width: 15px; height: 15px; }
.search-trigger span { flex: 1; }
.search-trigger kbd { background: var(--surface-2); border: 1px solid var(--line); opacity: 1; color: var(--text-3); }

.top-icon {
  position: relative; width: 36px; height: 36px;
  display: grid; place-items: center; flex: none;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--text-2); cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}
.top-icon:hover { background: var(--surface); border-color: var(--line); color: var(--text); }
.top-icon .icon { width: 18px; height: 18px; }
.notif-dot {
  position: absolute; top: 7px; right: 7px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: 99px; display: none;
  align-items: center; justify-content: center;
  background: var(--bad); color: #fff; font: 650 9.5px/1 var(--sans);
  box-shadow: 0 0 0 2px var(--bg);
}
.notif-dot.on { display: inline-flex; }
.user-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 8px 0 4px; margin-left: 2px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text); cursor: pointer;
  font: 550 var(--fs-ui)/1 var(--sans);
}
.user-btn .account-avatar { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.user-btn .icon { width: 13px; height: 13px; color: var(--text-3); }
.mobile-menu { display: none; }
.search-only { display: none; }

.popover {
  position: absolute; z-index: 90; top: calc(100% + 8px); right: 0;
  width: 340px; max-width: calc(100vw - 24px);
  background: var(--surface); border-radius: var(--r-md);
  box-shadow: var(--shadow-pop); border: 1px solid var(--line);
  animation: pop-in 140ms var(--ease-out);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
.popover-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.popover-head b { font-size: var(--fs-ui); }
.popover-head span { font-size: 11px; color: var(--text-3); }
.popover-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.popover-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%;
  padding: 9px 10px; border-radius: var(--r-sm); border: none;
  background: transparent; color: var(--text); text-align: left; cursor: pointer;
}
.popover-item:hover { background: var(--surface-2); }
.popover-item .tile { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.popover-item .pi-text { min-width: 0; }
.popover-item .pi-text b { display: block; font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.popover-item .pi-text span { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; line-height: 1.4; }
.popover-empty { padding: 22px 16px; text-align: center; color: var(--text-3); font-size: var(--fs-ui); }
.menu-wrap { position: relative; }
.menu { width: 220px; padding: 6px; }
.menu button, .menu a.menu-link {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--text); text-decoration: none;
  font: 500 var(--fs-ui)/1 var(--sans); text-align: left; cursor: pointer;
}
.menu button:hover, .menu a.menu-link:hover { background: var(--surface-2); }
.menu .icon { width: 15px; height: 15px; color: var(--text-3); }
.menu-divider { height: 1px; background: var(--line); margin: 5px 6px; }
.menu-label { padding: 8px 10px 4px; font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }

/* ── Page headers ────────────────────────────────────────────── */

.section { display: none; }
.section.active { display: block; animation: section-in 180ms var(--ease-out); }
@keyframes section-in { from { opacity: 0; transform: translateY(3px); } }

.page-tools {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--sp-4); flex-wrap: wrap; margin-bottom: var(--sp-5);
}
.page-tools .page-sub {
  font-size: var(--fs-body); color: var(--text-2);
  max-width: 70ch; margin: 0; text-wrap: pretty;
}
.page-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; align-items: center; }
.section-head { display: none; } /* titles now live in the topbar */
.section-head p, .section-head h2 { display: none; }
.page-tools h2 { display: none; }
.subhead {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  font-size: var(--fs-h3); font-weight: 650; color: var(--text);
  margin: var(--sp-6) 0 var(--sp-3); letter-spacing: -0.015em;
}
.subhead .hint { font-weight: 400; font-size: var(--fs-caption); color: var(--text-3); }
.subhead:first-child { margin-top: 0; }

/* ── Surfaces ────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: none;
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: 0; margin-bottom: var(--sp-4); border: none;
}
.card-head h3 { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.015em; }
.card-head .meta { font-size: var(--fs-caption); color: var(--text-3); }
.card > h2, .card-title {
  font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.015em;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: var(--sp-4);
}
.inset { background: var(--surface-2); border-radius: var(--r-md); padding: var(--sp-4); }

.dash-grid {
  display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(300px, 1fr);
  gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4);
}
.dash-grid-2 {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4);
}
.dash-grid-3 {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-4); align-items: start; margin-bottom: var(--sp-4);
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }

/* ── Buttons ─────────────────────────────────────────────────── */

.btn {
  height: 36px; padding: 0 14px; gap: 7px; border-radius: 10px;
  font: 550 var(--fs-ui)/1 var(--sans);
  background: var(--surface); color: var(--text); box-shadow: var(--btn-shadow);
}
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-text); box-shadow: var(--btn-primary-shadow); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-secondary { background: var(--surface); color: var(--text); }
.btn-ghost { background: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--bad-bg); color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad-line); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad-bg) 70%, var(--bad) 8%); }
.btn-sm { height: 30px; padding: 0 10px; border-radius: 8px; font-size: var(--fs-caption); }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { height: 40px; padding: 0 16px; border-radius: 11px; }
.btn-icon, .btn.btn-icon { width: 36px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn-group { display: flex; gap: 8px; margin-top: var(--sp-4); flex-wrap: wrap; align-items: center; }
.icon-btn, .refresh-btn {
  height: 32px; padding: 0 10px; border-radius: 8px; font-size: var(--fs-caption);
  background: var(--surface); box-shadow: var(--btn-shadow); color: var(--text-2);
}
.icon-btn:hover, .refresh-btn:hover { background: var(--surface-2); color: var(--text); }

/* ── Forms ───────────────────────────────────────────────────── */

.form-group { margin-bottom: var(--sp-4); }
.form-label {
  display: block; font-size: var(--fs-ui); font-weight: 600; color: var(--text);
  margin-bottom: 6px;
}
.form-input, select.form-input, textarea.form-input {
  width: 100%; min-height: 38px; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--text);
  font: 400 var(--fs-body)/1.4 var(--sans);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.form-input:hover { border-color: color-mix(in srgb, var(--line-strong) 70%, var(--text-3)); }
.form-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.form-input:disabled { background: var(--surface-2); color: var(--text-3); cursor: not-allowed; }
.form-input::placeholder { color: var(--text-3); }
select.form-input {
  appearance: none; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%),
                    linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) 16px, calc(100% - 12px) 16px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.form-row { display: flex; gap: var(--sp-3); align-items: flex-end; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 150px; }
.form-hint { font-size: var(--fs-caption); color: var(--text-3); margin-top: 5px; line-height: 1.5; }
.check-line, label.check-line {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-ui); color: var(--text-2); cursor: pointer; min-height: 24px;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.more-fields { margin-bottom: var(--sp-3); }
.more-fields summary { cursor: pointer; font-size: var(--fs-ui); color: var(--text-2); margin-bottom: var(--sp-3); }
.with-btn { display: flex; gap: 8px; align-items: center; }
.with-btn .form-input { flex: 1; min-width: 0; }
@media (max-width: 640px) { .form-input, select.form-input, textarea.form-input { font-size: 16px; } }

/* ── Badges & chips ──────────────────────────────────────────── */

.badge, .tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px; border-radius: 99px;
  font-size: 11px; font-weight: 550; line-height: 1; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge::before { width: 5px; height: 5px; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.mini { font-size: 11px; }
.email-tag { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.cost-chip { font-size: 11px; padding: 3px 8px; border-radius: 99px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 99px;
  background: var(--surface-2); color: var(--text-3); font-size: 11px;
}
.chip b { color: var(--text-2); font-weight: 600; }

/* ── Tables ──────────────────────────────────────────────────── */

.table-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: none;
  overflow: auto hidden; overscroll-behavior-x: contain;
}
table { width: 100%; border-collapse: collapse; font-size: var(--fs-ui); }
#prospects-table td:nth-child(3) { max-width: 280px; }
#prospects-table td:nth-child(3) .cell-stack span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#prospects-table td:nth-child(2), #companies-list td:nth-child(4) { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
thead th {
  padding: 11px 16px; text-align: left; white-space: nowrap;
  font-size: 10.5px; font-weight: 650; letter-spacing: 0.055em; text-transform: uppercase;
  color: var(--text-3); background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
thead th:first-child { border-top-left-radius: var(--r-lg); }
thead th:last-child { border-top-right-radius: var(--r-lg); }
td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }
tr.clickable { cursor: pointer; }
.cell-main { font-weight: 550; color: var(--text); }
.cell-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.cell-stack { display: flex; flex-direction: column; min-width: 0; }
.cell-row { display: flex; align-items: center; gap: 9px; }
.avatar {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: inline-grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11px; font-weight: 650; letter-spacing: 0.01em;
}
.table-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 2px 0; font-size: var(--fs-caption); color: var(--text-3); flex-wrap: wrap;
}
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: var(--sp-3);
}
.row-action { opacity: 0; transition: opacity 120ms ease; }
tr:hover .row-action, tr:focus-within .row-action { opacity: 1; }
@media (hover: none) { .row-action { opacity: 1; } }

/* ── Toolbar / filter pills ──────────────────────────────────── */

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: var(--sp-3); }
.search {
  position: relative; display: inline-flex; align-items: center; min-width: 220px; flex: 0 1 340px;
}
.search .icon { position: absolute; left: 11px; color: var(--text-3); width: 15px; height: 15px; pointer-events: none; }
.search .form-input { padding-left: 34px; height: 36px; min-height: 36px; }
.segmented {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  overflow-x: auto; max-width: 100%; scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: none; border-radius: 7px; background: transparent; color: var(--text-2);
  font: 550 12px/1 var(--sans); white-space: nowrap; cursor: pointer;
}
.segmented button .n { color: var(--text-3); font-weight: 550; font-variant-numeric: tabular-nums; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-border); }
.segmented button.on .n { color: var(--accent); }

/* ── Empty, skeleton, toast ──────────────────────────────────── */

.empty { text-align: center; padding: 44px 24px; }
.empty .glyph {
  width: 42px; height: 42px; margin: 0 auto 12px; border-radius: 12px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.empty .glyph .icon { width: 20px; height: 20px; }
.empty .title { font-size: var(--fs-h3); font-weight: 650; margin-bottom: 4px; }
.empty .copy { font-size: var(--fs-ui); color: var(--text-2); line-height: 1.6; max-width: 48ch; margin: 0 auto; }
.skeleton {
  display: block; border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
.skeleton-line { height: 12px; margin-bottom: 8px; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }
.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--text); color: var(--bg); font-size: var(--fs-ui); font-weight: 500;
  box-shadow: var(--shadow-pop); animation: toast-in 180ms var(--ease-out);
}
.toast.error { background: var(--bad); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ══════════════════════════════════════════════════════════════
   TODAY — KPI cards, activity chart, pipeline, attention
   ══════════════════════════════════════════════════════════════ */

.kpi-grid {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px; margin-bottom: var(--sp-4);
}
.kpi-card {
  position: relative; min-width: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  text-decoration: none; color: inherit; cursor: pointer;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}
.kpi-card:hover {
  border-color: var(--accent-line); box-shadow: var(--shadow-border-hover);
  transform: translateY(-1px);
}
.kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
}
.kpi-icon .icon { width: 17px; height: 17px; }
.kpi-icon.green { background: var(--good-bg); color: var(--good); }
.kpi-icon.amber { background: var(--wait-bg); color: var(--wait); }
.kpi-icon.red { background: var(--bad-bg); color: var(--bad); }
.kpi-icon.violet { background: var(--note-bg); color: var(--note); }
.kpi-icon.cyan { background: var(--active-bg); color: var(--active); }
.kpi-label { font-size: 12px; font-weight: 550; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-value-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; }
.kpi-value {
  font-size: clamp(1.5rem, 1.7vw, 1.875rem); font-weight: 680;
  letter-spacing: -0.035em; line-height: 1; color: var(--text);
}
.kpi-value.zero { color: var(--text-3); }
.kpi-spark { width: 58px; height: 26px; flex: none; opacity: 0.95; }
.kpi-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; color: var(--text-3); }
.trend {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 99px; font-size: 10.5px; font-weight: 650;
}
.trend.up { background: var(--good-bg); color: var(--good); }
.trend.down { background: var(--bad-bg); color: var(--bad); }
.trend.flat { background: var(--surface-2); color: var(--text-3); }
.trend .icon { width: 10px; height: 10px; }

/* Sales activity chart */
.chart-card { padding: 20px 20px 12px; }
.chart-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 4px;
}
.chart-head .ch-title { font-size: var(--fs-h3); font-weight: 650; letter-spacing: -0.015em; }
.chart-head .ch-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.chart-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range-pills {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.range-pills button {
  height: 26px; padding: 0 9px; border: none; border-radius: 6px;
  background: transparent; color: var(--text-2);
  font: 550 11.5px/1 var(--sans); cursor: pointer; white-space: nowrap;
}
.range-pills button:hover { color: var(--text); }
.range-pills button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-border); }
.chart-custom {
  display: none; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2);
}
.chart-custom.on { display: flex; }
.chart-custom label { font-size: 11px; color: var(--text-3); }
.chart-custom .form-input { height: 32px; min-height: 32px; width: 138px; font-size: 12px; padding: 5px 8px; }
.chart-legend { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 0; }
.legend-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 8px; border: none; border-radius: 7px;
  background: transparent; color: var(--text-2); cursor: pointer;
  font: 500 11.5px/1 var(--sans);
}
.legend-toggle:hover { background: var(--surface-2); }
.legend-toggle .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.legend-toggle[aria-pressed="false"] { opacity: 0.42; }
.legend-toggle[aria-pressed="false"] .dot { background: var(--line-strong) !important; }
.chart-frame { position: relative; margin-top: 6px; }
.chart-frame svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-tooltip {
  position: absolute; z-index: 5; pointer-events: none; display: none;
  min-width: 150px; padding: 9px 11px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-pop); font-size: 11.5px; color: var(--text);
}
.chart-tooltip.on { display: block; }
.chart-tooltip .ct-day { font-size: 10.5px; font-weight: 650; color: var(--text-3); margin-bottom: 5px; }
.chart-tooltip .ct-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 2px 0; }
.chart-tooltip .ct-row span { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.chart-tooltip .ct-row i { width: 7px; height: 7px; border-radius: 2px; }
.chart-tooltip .ct-row b { font-variant-numeric: tabular-nums; }
.chart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 250px; color: var(--text-3); text-align: center; font-size: var(--fs-ui); gap: 6px;
}
.chart-empty .icon { width: 26px; height: 26px; color: var(--text-3); }
.chart-summary {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3);
}
.chart-summary b { color: var(--text); font-weight: 650; }

/* Pipeline card */
.pipeline-card { padding: 20px; }
.pipeline-bar {
  display: flex; width: 100%; height: 12px; border-radius: 99px;
  overflow: hidden; background: var(--surface-3); gap: 2px; margin: 4px 0 18px;
}
.pipeline-bar span { display: block; height: 100%; min-width: 2px; transition: width 400ms var(--ease-out); }
.pipeline-list { display: flex; flex-direction: column; }
.pipeline-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 10px; padding: 9px 0;
}
.pipeline-row + .pipeline-row { border-top: 1px solid var(--line); }
.pipeline-row .pl-name { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.pipeline-row .pl-name i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.pipeline-row .pl-value { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.pipeline-row .pl-pct { width: 38px; text-align: right; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pipeline-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--text-3);
}
.pipeline-foot b { color: var(--text); }

/* Needs attention */
.attention-card { padding: 20px; }
.attention-list { display: flex; flex-direction: column; gap: 8px; }
.attention-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); transition: background-color 120ms ease, border-color 120ms ease;
}
.attention-item:hover { background: var(--surface-2); border-color: var(--line-strong); }
.attention-icon {
  width: 34px; height: 34px; border-radius: 9px; flex: none;
  display: grid; place-items: center;
}
.attention-icon .icon { width: 16px; height: 16px; }
.attention-icon.warn { background: var(--wait-bg); color: var(--wait); }
.attention-icon.bad { background: var(--bad-bg); color: var(--bad); }
.attention-icon.good { background: var(--good-bg); color: var(--good); }
.attention-body { flex: 1; min-width: 0; }
.attention-body .at-title { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.attention-body .at-detail { font-size: 11.5px; color: var(--text-3); margin-top: 2px; line-height: 1.5; }
.attention-body .btn { margin-top: 8px; }
.attention-clear {
  display: flex; gap: 10px; align-items: center;
  padding: 14px; border-radius: var(--r-md); background: var(--good-bg);
  color: var(--good); font-size: var(--fs-ui);
}
.attention-clear .icon { width: 18px; height: 18px; }

/* WhatsApp status widget */
.wa-widget { padding: 20px; }
.wa-conn-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.wa-logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center; background: #E8F8EE; color: #128C4A;
}
:root[data-theme='dark'] .wa-logo { background: #0F2B1B; color: #4ADE80; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .wa-logo { background: #0F2B1B; color: #4ADE80; }
}
.wa-logo .icon { width: 21px; height: 21px; }
.wa-conn-head .wa-title { font-size: 13px; font-weight: 650; }
.wa-conn-head .wa-sub { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.wa-conn-head .badge { margin-left: auto; }
.wa-facts { display: flex; flex-direction: column; gap: 0; }
.wa-fact {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 0; font-size: 12px;
}
.wa-fact + .wa-fact { border-top: 1px solid var(--line); }
.wa-fact .k { color: var(--text-3); }
.wa-fact .v { color: var(--text); font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.wa-widget .btn-group { margin-top: 12px; }
.wa-empty {
  padding: 8px 0 2px; font-size: 12px; color: var(--text-3); line-height: 1.55;
}

/* Activity timeline */
.timeline { display: flex; flex-direction: column; }
.tl-day {
  font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3); padding: 10px 0 6px;
}
.tl-day:first-child { padding-top: 0; }
.tl-item {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px; align-items: start; padding: 9px 0; position: relative;
}
.tl-item + .tl-item { border-top: 1px solid var(--line); }
.tl-time { display: none; }
.tl-icon {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
}
.tl-icon .icon { width: 13px; height: 13px; }
.tl-text { font-size: 12.5px; color: var(--text); line-height: 1.5; min-width: 0; overflow-wrap: anywhere; }
.tl-text::first-letter { text-transform: uppercase; }
.tl-agent { display: none; }
.tl-item .tl-when { font-size: 10.5px; color: var(--text-3); white-space: nowrap; margin-top: 2px; }
.tl-item.quiet .tl-text { color: var(--text-3); }

/* Campaign performance */
.campaign-table td { white-space: nowrap; }
.campaign-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.campaign-name .camp-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--accent);
}
.chan-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-2); }
.chan-tag .icon { width: 13px; height: 13px; color: var(--text-3); }
.perf-cell { display: inline-flex; align-items: center; gap: 7px; }
.perf-bar { width: 58px; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.perf-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* Live status / runs (kept, retuned) */
.live-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.live-now { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2); }
.setup-pct { font-size: 11px; color: var(--text-3); }
.steps { display: flex; flex-direction: column; }
.step { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; padding: 9px 0; }
.step + .step { border-top: 1px solid var(--line); }
.step-icon { width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.step-icon .icon { width: 11px; height: 11px; stroke-width: 2.5; }
.step-icon.done { background: var(--good-bg); color: var(--good); }
.step-icon.running { background: var(--accent-soft); color: var(--accent); }
.step-icon.partial { background: var(--surface-3); color: var(--text-2); }
.step-icon.waiting { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.step-label { font-size: 12.5px; font-weight: 550; }
.step-detail { font-size: 10.5px; color: var(--text-3); text-align: right; }
.step .bar { grid-column: 2 / 4; }
.live-next {
  display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px;
  border-radius: 9px; background: var(--surface-2); font-size: 12px; color: var(--text-2);
}
.live-next .icon { color: var(--accent); width: 15px; height: 15px; flex: none; }
.live-next .btn { margin-left: auto; }
.live-flag { font-size: 10.5px; color: var(--text-3); margin-top: 8px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }
@media (prefers-reduced-motion: no-preference) { .pulse { animation: pulse 1.6s ease infinite; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.fact-strip { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 2px 0; font-size: 11px; color: var(--text-3); }
.fact-strip b { color: var(--text-2); font-weight: 600; }
.runs { display: flex; flex-direction: column; }
.run { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 9px 0; align-items: center; }
.run + .run { border-top: 1px solid var(--line); }
.run .name { font-size: 12.5px; font-weight: 550; text-transform: capitalize; }
.run .when, .run .stats { font-size: 10.5px; color: var(--text-3); }
.run .stats { text-align: right; }

/* ══════════════════════════════════════════════════════════════
   OUTBOX
   ══════════════════════════════════════════════════════════════ */

.outbox-tabs { display: flex; gap: 3px; border-bottom: 1px solid var(--line); margin-bottom: var(--sp-4); }
.outbox-tab {
  position: relative; display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 14px; border: none; background: transparent;
  color: var(--text-2); font: 550 var(--fs-ui)/1 var(--sans); cursor: pointer;
}
.outbox-tab .n {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--text-3); font-size: 10.5px; font-weight: 650;
}
.outbox-tab.on { color: var(--text); }
.outbox-tab.on::after {
  content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px;
  height: 2px; border-radius: 2px 2px 0 0; background: var(--accent);
}
.outbox-tab.on .n { background: var(--accent-soft); color: var(--accent); }
.outbox-panel { display: none; }
.outbox-panel.on { display: block; }
.desk { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.desk-list {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 7px; max-height: 640px; overflow-y: auto;
}
.desk-item { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; cursor: pointer; }
.desk-item + .desk-item { margin-top: 2px; }
.desk-item:hover { background: var(--surface-2); }
.desk-item.active { background: var(--accent-soft); }
.desk-item .to { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-item .sub { font-size: 10.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk-item.active .avatar { background: var(--accent); color: #fff; }
.desk-pane {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; min-height: 420px;
}
.desk-pane .to-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.desk-pane .to-line b { color: var(--text); font-weight: 600; }
.desk-pane .subject { font-size: 1.25rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.3; margin: 22px 0 12px; }
.desk-pane .body { font-size: 14px; line-height: 1.7; white-space: pre-wrap; max-width: 68ch; color: var(--text); }
.desk-context {
  display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 7px 14px;
  padding: 14px; border-radius: var(--r-md); background: var(--surface-2);
  font-size: 11.5px; margin: 14px 0 4px;
}
.desk-context .k { color: var(--text-3); }
.desk-context .v { color: var(--text-2); overflow-wrap: anywhere; }
.desk-footer { margin-top: 16px; padding-top: 12px; border-top: 1px dashed var(--line-strong); font-size: 11px; color: var(--text-3); white-space: pre-wrap; }
.desk-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.desk-actions .btn { height: 34px; }
.desk-edit-subject, .desk-edit-body {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--text); padding: 10px 12px; font: inherit;
}
.desk-edit-subject { font-size: 1rem; font-weight: 600; margin: 18px 0 10px; }
.desk-edit-body { font-size: 13.5px; line-height: 1.65; resize: vertical; max-width: 68ch; }
.desk-edit-subject:focus, .desk-edit-body:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.desk-held { margin-bottom: 12px; }

.banner {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r-md); margin-bottom: 14px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; color: var(--text-2);
}
.banner .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.banner b { display: block; font-size: 12.5px; color: var(--text); margin-bottom: 2px; }
.banner.bad { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad); }
.banner.wait { background: var(--wait-bg); border-color: var(--wait-line); color: var(--wait); }
.banner p { color: var(--text-2); font-size: 11.5px; line-height: 1.5; }
.banner .btn { margin-left: auto; flex: none; }
.mode-banner:not(.wait) { background: var(--surface); border-color: var(--line); }

.wa-draft-list { display: flex; flex-direction: column; gap: 12px; }
.wa-draft {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 16px 18px;
}
.wa-draft-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 10px; }
.wa-draft-head .avatar { width: 36px; height: 36px; border-radius: 10px; }
.wa-draft-who { flex: 1; min-width: 0; }
.wa-draft-who b { display: block; font-size: 13px; }
.wa-draft-who span { display: block; font-size: 11px; color: var(--text-3); margin-top: 1px; }
.wa-bubble-preview {
  padding: 12px 14px; border-radius: 12px 12px 12px 4px;
  background: var(--surface-2); font-size: 13px; line-height: 1.55;
  white-space: pre-wrap; color: var(--text); max-width: 68ch;
}
.wa-draft-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wa-draft-actions .meta { font-size: 10.5px; color: var(--text-3); margin-left: auto; }
.wa-compose-edit { width: 100%; margin-top: 10px; }

/* ══════════════════════════════════════════════════════════════
   WHATSAPP INBOX — three panes
   ══════════════════════════════════════════════════════════════ */

.wa-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 300px;
  height: calc(100dvh - var(--header-h) - 116px);
  min-height: 540px;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); overflow: hidden;
}
.wa-list-pane { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; background: var(--surface); }
.wa-pane-head {
  flex: none; padding: 14px 14px 10px; border-bottom: 1px solid var(--line);
}
.wa-pane-head h2 { font-size: 14px; font-weight: 650; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.wa-pane-head h2 .count { color: var(--text-3); font-weight: 500; font-size: 11px; margin-left: auto; }
.wa-list-search { position: relative; }
.wa-list-search .icon { position: absolute; left: 10px; top: 10px; width: 14px; height: 14px; color: var(--text-3); }
.wa-list-search input { padding-left: 31px; height: 34px; min-height: 34px; font-size: 12px; }
.wa-conv-list { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.wa-conv {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 10px; border: none; border-radius: 10px; background: transparent;
  text-align: left; cursor: pointer; color: inherit;
}
.wa-conv:hover { background: var(--surface-2); }
.wa-conv.on { background: var(--accent-soft); }
.wa-conv .avatar { width: 38px; height: 38px; border-radius: 50%; }
.wa-conv-body { flex: 1; min-width: 0; }
.wa-conv-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.wa-conv-name { font-size: 12.5px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-conv-time { font-size: 10px; color: var(--text-3); white-space: nowrap; }
.wa-conv-preview { font-size: 11.5px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-conv-meta { display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.wa-unread {
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 99px;
  background: #22C55E; color: #fff; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
}
.wa-chat-pane { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.wa-chat-head {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.wa-chat-head .avatar { width: 36px; height: 36px; border-radius: 50%; }
.wa-chat-who { flex: 1; min-width: 0; }
.wa-chat-who b { display: block; font-size: 13px; }
.wa-chat-who span { font-size: 10.5px; color: var(--text-3); }
.wa-chat-head .btn-icon { display: none; }
.wa-messages {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 20px 20px 12px; display: flex; flex-direction: column; gap: 10px;
  background-image:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--line) 60%, transparent) 1px, transparent 0);
  background-size: 22px 22px;
}
.wa-msg-row { display: flex; flex-direction: column; max-width: min(78%, 560px); }
.wa-msg-row.out { align-self: flex-end; align-items: flex-end; }
.wa-msg-row.in { align-self: flex-start; align-items: flex-start; }
.wa-msg {
  padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 1px 1px rgb(16 24 40 / 0.05);
}
.wa-msg-row.in .wa-msg { background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.wa-msg-row.out .wa-msg { background: #DCF8C6; color: #0B2E13; border-bottom-right-radius: 4px; }
:root[data-theme='dark'] .wa-msg-row.out .wa-msg { background: #1F4D2E; color: #EAFBF0; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .wa-msg-row.out .wa-msg { background: #1F4D2E; color: #EAFBF0; }
}
.wa-msg-meta { display: flex; align-items: center; gap: 4px; margin-top: 3px; font-size: 9.5px; color: var(--text-3); }
.wa-msg-meta .icon { width: 11px; height: 11px; color: var(--active); }
.wa-day-sep { align-self: center; font-size: 10px; font-weight: 550; color: var(--text-3); padding: 3px 9px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; }
.wa-ai-draft {
  align-self: stretch; margin: 4px 4px 0; padding: 12px 14px;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  border-radius: var(--r-md);
}
.wa-ai-draft .ai-label { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 650; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.wa-ai-draft .ai-label .icon { width: 13px; height: 13px; }
.wa-ai-draft .ai-body { margin-top: 6px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; color: var(--text); }
.wa-ai-draft .ai-actions { display: flex; gap: 6px; margin-top: 9px; flex-wrap: wrap; }
.wa-composer {
  flex: none; padding: 10px 14px 12px; border-top: 1px solid var(--line); background: var(--surface);
}
.wa-compose-row { display: flex; align-items: flex-end; gap: 8px; }
.wa-compose-row textarea {
  flex: 1; min-height: 40px; max-height: 140px; resize: none;
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--surface); color: var(--text); font: 400 13px/1.45 var(--sans);
}
.wa-compose-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.wa-send-btn {
  width: 40px; height: 40px; border: none; border-radius: 10px; flex: none;
  display: grid; place-items: center; background: var(--accent); color: #fff; cursor: pointer;
}
.wa-send-btn:disabled { opacity: .45; cursor: not-allowed; }
.wa-compose-hint { font-size: 10px; color: var(--text-3); margin-top: 6px; display: flex; align-items: center; gap: 5px; }
.wa-detail-pane {
  border-left: 1px solid var(--line); background: var(--surface);
  overflow-y: auto; padding: 18px 16px; min-width: 0;
}
.wa-detail-head { text-align: center; padding: 8px 0 16px; border-bottom: 1px solid var(--line); }
.wa-detail-head .avatar { width: 58px; height: 58px; border-radius: 50%; font-size: 18px; margin: 0 auto 9px; }
.wa-detail-head b { display: block; font-size: 14px; }
.wa-detail-head span { display: block; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.wa-detail-section { padding: 14px 0; border-bottom: 1px solid var(--line); }
.wa-detail-section:last-child { border-bottom: none; }
.wa-detail-section h4 {
  font-size: 10.5px; font-weight: 650; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-3); margin-bottom: 8px;
}
.wa-detail-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 12px; }
.wa-detail-row .k { color: var(--text-3); flex: none; }
.wa-detail-row .v { color: var(--text); text-align: right; overflow-wrap: anywhere; }
.wa-detail-section .btn { width: 100%; margin-top: 8px; }
.wa-empty-pane {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 32px; text-align: center; color: var(--text-3); font-size: 12.5px;
}
.wa-empty-pane .glyph { width: 52px; height: 52px; border-radius: 15px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.wa-empty-pane .glyph .icon { width: 24px; height: 24px; }
.wa-empty-pane b { color: var(--text); font-size: 14px; }
.wa-mobile-back { display: none; }

/* ══════════════════════════════════════════════════════════════
   PAGE COMPONENTS (signals, discover, campaigns, conversations,
   settings, help, inboxes, controls)
   ══════════════════════════════════════════════════════════════ */

/* Signals */
.sig-summary { margin-bottom: var(--sp-4); }
.sig-group { margin-bottom: var(--sp-6); }
.sig-group-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.sig-group-head h3 { font-size: 14px; font-weight: 650; }
.sig-group-head p { font-size: 12px; color: var(--text-2); margin-top: 2px; max-width: 68ch; }
.sig-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.sig-row { display: flex; gap: 16px; align-items: flex-start; padding: 15px 18px; }
.sig-row + .sig-row { border-top: 1px solid var(--line); }
.sig-row .sig-main { flex: 1; min-width: 0; }
.sig-row .sig-label { font-size: 13px; font-weight: 600; }
.sig-row .sig-code { font-family: var(--mono); font-size: 10px; color: var(--text-3); margin-left: 8px; }
.sig-row .sig-desc { font-size: 11.5px; color: var(--text-2); margin-top: 3px; max-width: 72ch; }
.sig-row .sig-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; align-items: center; }
.sig-row .sig-decide { display: flex; gap: 6px; flex: none; }
.sig-row.rejected .sig-main { opacity: .55; }
.cohort-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.cohort-pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12px; cursor: pointer; }
.cohort-pick:hover { box-shadow: inset 0 0 0 1px var(--line-strong); }
.cohort-pick:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.cohort-pick .n { margin-left: auto; font-size: 10.5px; color: var(--text-3); }
.cohort-size { font-size: 2rem; font-weight: 680; letter-spacing: -0.03em; line-height: 1.1; }

/* Discover */
.prov-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: var(--sp-4); }
.prov-card {
  position: relative; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 16px; cursor: pointer;
  display: flex; flex-direction: column; gap: 9px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.prov-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-border-hover); }
.prov-card.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.prov-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.prov-card h3 { font-size: 13px; font-weight: 650; }
.prov-card .blurb { font-size: 11.5px; color: var(--text-2); line-height: 1.55; }
.prov-card .row { display: flex; gap: 8px; font-size: 10.5px; }
.prov-card .row .k { color: var(--text-3); min-width: 44px; flex: none; }
.prov-card .row .v { color: var(--text-2); }
.prov-card .caveat { font-size: 10.5px; color: var(--wait); background: var(--wait-bg); padding: 7px 9px; border-radius: 7px; }
.estimate-box { border-radius: var(--r-md); padding: 16px; margin-bottom: 12px; background: var(--surface-2); }
.estimate-box .amount { font-size: 1.75rem; font-weight: 680; letter-spacing: -0.03em; line-height: 1.1; }
.estimate-box .amount.free { color: var(--good); }
.estimate-box .amount.paid { color: var(--wait); }
.query-list { font-family: var(--mono); font-size: 11px; color: var(--text-3); margin-top: 12px; line-height: 1.7; max-height: 150px; overflow-y: auto; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: var(--sp-4); }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.stat-card .label { font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; }
.stat-card .value { font-size: 1.6rem; font-weight: 680; letter-spacing: -0.03em; line-height: 1.1; }
.stat-card .breakdown { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.chart-cols { display: flex; align-items: flex-end; gap: 3px; height: 140px; margin-top: 8px; }
.chart-cols .col { flex: 1; height: 100%; display: flex; align-items: flex-end; border-radius: 3px; }
.chart-cols .col i { display: block; width: 100%; min-height: 2px; border-radius: 4px 4px 1px 1px; background: var(--accent); opacity: .85; }
.chart-cols .col:hover i { opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-3); margin-top: 6px; }

/* Campaigns */
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.campaign-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden;
}
.campaign-top { padding: 18px; }
.campaign-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.campaign-title h3 { font-size: 14px; font-weight: 650; }
.campaign-card .meta { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 10.5px; color: var(--text-3); margin-top: 8px; }
.campaign-progress { margin-top: 16px; }
.campaign-progress .bar { height: 8px; gap: 2px; background: var(--surface-3); }
.campaign-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; }
.campaign-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-2); }
.campaign-legend i { width: 7px; height: 7px; border-radius: 2px; }
.campaign-legend b { color: var(--text); font-weight: 650; }
.sequence { border-top: 1px solid var(--line); padding: 8px 18px 18px; }
.email-step { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 0 12px; padding-top: 16px; }
.email-step::before { content: ''; position: absolute; left: 12px; top: 40px; bottom: -8px; width: 1px; background: var(--line); }
.email-step:last-child::before { display: none; }
.step-dot {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); font-size: 10.5px; font-weight: 700;
}
.email-step .step-num { font-size: 10px; color: var(--text-3); margin-top: 5px; text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.email-step .subject { font-size: 12.5px; font-weight: 650; margin: 3px 0 6px; }
.email-step .body {
  font-size: 11.5px; color: var(--text-2); line-height: 1.6; white-space: pre-wrap;
  max-height: 130px; overflow-y: auto; padding-right: 6px;
}
.step-actions { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.rcpt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; flex-wrap: wrap; border-radius: 7px; background: var(--surface-2); }
.rcpt + .rcpt { margin-top: 4px; }
.rcpt-who { flex: 1 1 180px; min-width: 0; font-size: 11.5px; display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; overflow-wrap: anywhere; }
.step-actions label { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-2); cursor: pointer; }

/* Conversations */
.convo-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px; margin-bottom: 12px;
}
.convo-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.convo-head h3 { font-size: 13px; font-weight: 650; }
.convo-head > div:nth-child(2) { min-width: 0; flex: 1 1 200px; }
.convo-head .sub { font-size: 10.5px; color: var(--text-3); }
.convo-head .tags { margin-left: auto; display: flex; gap: 5px; flex-wrap: wrap; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.thread-msg { max-width: min(78%, 62ch); padding: 10px 14px; border-radius: 13px; font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
.thread-msg.sent { align-self: flex-end; background: var(--accent-soft); color: var(--text); border: 1px solid var(--accent-line); border-bottom-right-radius: 4px; }
.thread-msg.received { align-self: flex-start; background: var(--surface-2); color: var(--text); border-bottom-left-radius: 4px; }
.thread-msg .sender { font-size: 10px; opacity: .7; margin-bottom: 2px; }
.thread-email { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; align-self: stretch; }
.te-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface-2); font-size: 10.5px; color: var(--text-3); }
.te-head .icon { width: 12px; height: 12px; color: var(--accent); }
.te-head b { color: var(--text); font-weight: 600; }
.te-head span:not(.te-when) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.te-when { margin-left: auto; color: var(--text-3); white-space: nowrap; }
.te-body { padding: 10px 14px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; color: var(--text-2); }
.thread-draft { align-self: stretch; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; }
.thread-draft .sender { display: flex; align-items: center; gap: 6px; font-size: 10.5px; font-weight: 650; color: var(--accent); margin-bottom: 4px; }
.thread-draft .sender .icon { width: 12px; height: 12px; }
.td-body { font-size: 12px; line-height: 1.55; white-space: pre-wrap; margin-bottom: 10px; }
.convo-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.convo-actions .muted { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; margin-right: auto; }
.convo-actions .btn-ghost { margin-left: auto; }

/* Inboxes */
.inbox-summary { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: var(--sp-4); font-size: 12px; color: var(--text-2); }
.inbox-summary b { color: var(--text); font-weight: 650; }
.inbox-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: var(--sp-5); }
.inbox-row {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto minmax(150px, 220px) auto 16px;
  align-items: center; gap: 14px; width: 100%; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  text-align: left; cursor: pointer; font: inherit; color: inherit;
}
.inbox-row:hover { background: var(--surface-2); border-color: var(--line-strong); }
.inbox-avatar { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.inbox-who .addr { font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-who .sub { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.inbox-meter .line { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-2); margin-bottom: 4px; }
.inbox-meter .progress-bar { height: 5px; }
.inbox-waiting { font-size: 10px; color: var(--text-2); text-align: right; }
.inbox-waiting b { display: block; font-size: 13px; color: var(--text); font-weight: 650; }
.inbox-row .chev { width: 15px; height: 15px; color: var(--text-3); }
.inbox-help { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.inbox-help .inset h4 { font-size: 12px; font-weight: 650; margin-bottom: 4px; }
.inbox-help .inset p { font-size: 11px; color: var(--text-2); line-height: 1.55; }

/* Settings */
.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.settings-nav {
  position: sticky; top: calc(var(--header-h) + 20px);
  display: flex; flex-direction: column; gap: 2px;
  padding: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
}
.settings-nav button {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 36px;
  padding: 0 10px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-2);
  font: 500 12.5px/1 var(--sans); text-align: left; cursor: pointer;
}
.settings-nav button .icon { width: 15px; height: 15px; color: var(--text-3); }
.settings-nav button:hover { background: var(--surface-2); color: var(--text); }
.settings-nav button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.settings-nav button.on .icon { color: var(--accent); }
.settings-panel { display: none; }
.settings-panel.on { display: block; }
.settings-title { margin-bottom: 4px; font-size: 1.05rem; font-weight: 650; }
.settings-sub { font-size: 12px; color: var(--text-2); margin-bottom: 18px; max-width: 72ch; }
.settings-row { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--sp-5); padding: var(--sp-5) 0; }
.settings-row + .settings-row { border-top: 1px solid var(--line); }
.settings-row:first-of-type { padding-top: 0; }
.settings-row:last-child { padding-bottom: 0; }
.settings-row h3 { font-size: 13px; font-weight: 650; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.settings-row .desc { font-size: 11.5px; color: var(--text-2); margin-top: 4px; line-height: 1.55; }
.settings-row .fields { max-width: 580px; }
.settings-row .fields .form-group:last-child { margin-bottom: 0; }
.settings-row .fields .form-row { margin-bottom: var(--sp-4); }
.settings-row .fields .form-row .form-group { margin-bottom: 0; }
.notice { padding: 12px 14px; border-radius: 9px; font-size: 12px; line-height: 1.55; margin-bottom: 14px; }
.notice.info { background: var(--surface-2); color: var(--text-2); }
.notice.wait { background: var(--wait-bg); color: var(--wait); }
.notice.good { background: var(--good-bg); color: var(--good); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice .setup-steps { margin: 8px 0 12px; padding-left: 1.3em; display: grid; gap: 4px; }
.notice .setup-steps a { color: inherit; text-decoration: underline; }

/* Controls */
.control-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--sp-4); align-items: start; }
.status-big { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.status-big .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-3); }
.status-big .dot.running { background: var(--good); box-shadow: 0 0 0 4px var(--good-bg); }
.status-big .label { font-size: 1.25rem; font-weight: 650; }
.status-big .label.running { color: var(--good); }
.status-meta { font-size: 12px; color: var(--text-3); min-height: 20px; }
.log-viewer {
  background: #0D1117; color: #C9D1D9; border-radius: var(--r-md);
  padding: 14px; font: 400 11px/1.65 var(--mono);
  max-height: 420px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}

/* Help */
.help-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.help-nav { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 2px; }
.help-nav a { padding: 7px 10px; border-radius: 8px; font-size: 12px; color: var(--text-2); text-decoration: none; }
.help-nav a:hover { background: var(--surface-2); color: var(--text); }
.help-section { margin-bottom: var(--sp-6); max-width: 78ch; }
.help-section h2 { font-size: 1.05rem; font-weight: 650; margin-bottom: 8px; }
.help-section p { font-size: 12.5px; color: var(--text-2); line-height: 1.65; margin-bottom: 8px; }
.help-section pre {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  padding: 12px 14px; font: 400 11.5px/1.7 var(--mono); overflow-x: auto; white-space: pre; margin: 8px 0;
}
.help-section details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; }
.help-section details summary { padding: 11px 14px; font-size: 12.5px; font-weight: 550; cursor: pointer; }
.help-section .faq-body { padding: 0 14px 14px 30px; font-size: 11.5px; color: var(--text-2); line-height: 1.65; }
.file-table { width: 100%; font-size: 11.5px; border-collapse: collapse; }
.file-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.file-table td:first-child { font-family: var(--mono); font-size: 11px; white-space: nowrap; width: 220px; color: var(--text); }
.file-table td:last-child { color: var(--text-2); }
.file-table tr:last-child td { border-bottom: none; }

/* Modals */
dialog.modal, dialog {
  border: none; padding: 0; border-radius: var(--r-lg);
  background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-pop); max-width: min(720px, calc(100vw - 32px));
  width: 100%; max-height: min(88dvh, 900px);
}
dialog::backdrop { background: rgb(15 17 21 / 0.48); backdrop-filter: blur(2px); }
.modal-content { display: flex; flex-direction: column; max-height: min(88dvh, 900px); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 12px; }
.modal-head h3 { font-size: 1rem; font-weight: 650; }
.modal-head .sub { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.modal-body { padding: 0 20px 20px; overflow-y: auto; }
.modal-foot { position: sticky; bottom: 0; display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface); }
.modal-section { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.modal-section h4 { font-size: 12px; font-weight: 650; margin-bottom: 6px; }
.modal-section p { font-size: 11.5px; color: var(--text-2); line-height: 1.55; }
.modal-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.modal-stats .inset { padding: 12px; }
.modal-stats .k { font-size: 10.5px; color: var(--text-3); }
.modal-stats .v { font-size: 15px; font-weight: 650; margin-top: 2px; }
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit .form-input { flex: 1; min-width: 0; }
.provider-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.provider-pick { display: flex; flex-direction: column; gap: 3px; padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); text-align: left; cursor: pointer; }
.provider-pick b { font-size: 12px; }
.provider-pick span { font-size: 10.5px; color: var(--text-3); line-height: 1.45; }
.provider-pick.on { border-color: var(--accent); background: var(--accent-soft); }
.cmd-copy { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.cmd-copy code { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 7px; background: var(--surface-2); font-size: 10.5px; overflow-wrap: anywhere; }

/* Global search palette */
.search-overlay {
  position: fixed; inset: 0; z-index: 250; display: none;
  align-items: flex-start; justify-content: center; padding: 12vh 16px 16px;
  background: rgb(15 17 21 / 0.42); backdrop-filter: blur(2px);
}
.search-overlay.on { display: flex; }
.search-palette {
  width: min(660px, 100%); max-height: min(70dvh, 620px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); overflow: hidden;
  animation: pop-in 160ms var(--ease-out);
}
.search-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); flex: none; }
.search-field .icon { width: 18px; height: 18px; color: var(--text-3); }
.search-field input { flex: 1; border: none; outline: none; background: transparent; color: var(--text); font: 400 15px/1.4 var(--sans); }
.search-field kbd { font-size: 10px; }
.search-results { overflow-y: auto; padding: 8px; flex: 1; }
.sr-group { margin-bottom: 4px; }
.sr-group h4 { padding: 8px 10px 4px; font-size: 10px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.sr-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: none; border-radius: 8px; background: transparent;
  text-align: left; color: var(--text); cursor: pointer; font: inherit;
}
.sr-item:hover, .sr-item.active { background: var(--surface-2); }
.sr-item .tile { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); }
.sr-item .tile .icon { width: 14px; height: 14px; }
.sr-item .sr-text { min-width: 0; flex: 1; }
.sr-item .sr-text b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-item .sr-text span { display: block; font-size: 10.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-empty { padding: 26px 16px; text-align: center; color: var(--text-3); font-size: 12px; }
.search-foot { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-top: 1px solid var(--line); font-size: 10px; color: var(--text-3); flex: none; }
.search-foot kbd { margin-right: 3px; }

/* Setup checklist + misc legacy retunes */
.setup-card { margin-bottom: var(--sp-4); }
.setup-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.setup-head h3 { font-size: 14px; font-weight: 650; }
.setup-head p { margin: 2px 0 0; font-size: 11px; color: var(--text-3); }
.check-item { display: flex; gap: 10px; padding: 9px 0; }
.check-item + .check-item { border-top: 1px solid var(--line); }
.check-icon { width: 22px; height: 22px; border-radius: 50%; flex: none; display: grid; place-items: center; }
.check-icon.done { background: var(--good-bg); color: var(--good); }
.check-icon.pending { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.check-label { font-size: 12px; font-weight: 550; }
.check-label.done { color: var(--text-3); font-weight: 400; }
.check-help { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.rename-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: var(--sp-4); }
.rename-card h3 { margin: 0 0 4px; }
.rename-card p { margin: 0; font-size: 12px; }
.rename-actions { display: flex; gap: 8px; flex-shrink: 0; }
.facts { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 2px 0; font-size: 10.5px; color: var(--text-3); }
.facts b { color: var(--text-2); font-weight: 600; }
.optout-panel { display: flex; flex-direction: column; gap: 8px; max-width: 72ch; padding: 8px 0; }
.optout-panel h4 { margin: 0; font-size: 12.5px; }
.optout-panel p { margin: 0; font-size: 12px; line-height: 1.55; }
.optout-panel .optout-meta { font-size: 10.5px; color: var(--text-2); }
.detail-row > td { white-space: normal; background: var(--surface-2); }
.toast.success { background: var(--text); color: var(--bg); }
.test-result { font-size: 12px; margin-top: 12px; padding: 9px 11px; border-radius: 8px; border: 1px solid transparent; }
.test-result.success { background: var(--good-bg); color: var(--good); border-color: var(--good-line); }
.test-result.error { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-line); }
.test-result.pending { background: var(--surface-2); color: var(--text-2); border-color: var(--line); }

/* Sidebar overlay */
.sidebar-overlay {
  position: fixed; inset: 0; z-index: 55; display: none;
  background: rgb(15 17 21 / 0.45);
}
.sidebar-overlay.on { display: block; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1380px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .wa-shell { grid-template-columns: 300px minmax(0, 1fr) 274px; }
}

@media (max-width: 1240px) {
  .dash-grid, .dash-grid-2 { grid-template-columns: minmax(0, 1fr); }
  .dash-grid-3 { grid-template-columns: minmax(0, 1fr); }
  .wa-shell { grid-template-columns: 290px minmax(0, 1fr); }
  .wa-detail-pane { display: none; }
}

@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: 180px minmax(0, 1fr); }
}

/* Tablet: sidebar becomes a drawer. */
@media (max-width: 1023px) {
  .sidebar {
    width: 276px; transform: translateX(-100%);
    box-shadow: var(--shadow-pop);
  }
  .sidebar.open { transform: none; }
  .app-main { margin-left: 0; }
  body.sidebar-collapsed .sidebar { width: 276px; }
  body.sidebar-collapsed .app-main { margin-left: 0; }
  body.sidebar-collapsed .brand-text,
  body.sidebar-collapsed .nav-label,
  body.sidebar-collapsed nav button .label,
  body.sidebar-collapsed .nav-count,
  body.sidebar-collapsed .connection-card,
  body.sidebar-collapsed .account-meta { display: revert; }
  body.sidebar-collapsed .sidebar-head { justify-content: space-between; padding: 0 16px 0 20px; }
  body.sidebar-collapsed .sidebar-collapse { display: grid; }
  body.sidebar-collapsed .nav-scroll { padding-inline: 12px; }
  body.sidebar-collapsed nav button { justify-content: flex-start; padding: 0 10px; }
  body.sidebar-collapsed .sidebar-account { justify-content: flex-start; }
  body.sidebar-collapsed .sidebar-theme { display: grid; }
  .sidebar-collapse { display: none; }
  .mobile-menu { display: grid; }
  .topbar { padding: 0 18px; }
  .content-inner { padding: 20px 18px 72px; }
  .search-trigger { width: 44px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .topbar-actions .user-btn .user-name { display: none; }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav {
    position: static; flex-direction: row; overflow-x: auto; padding: 5px;
  }
  .settings-nav button { width: auto; flex: none; height: 32px; }
  .help-layout { grid-template-columns: minmax(0, 1fr); }
  .help-nav { display: none; }
  .control-panel { grid-template-columns: minmax(0, 1fr); }
}

/* Phone */
@media (max-width: 767px) {
  :root { --header-h: 60px; }
  .topbar { padding: 0 14px; gap: 8px; }
  .breadcrumb { display: none; }
  .topbar h1 { font-size: 1rem; }
  .topbar-actions { gap: 2px; }
  .top-icon { width: 34px; height: 34px; }
  .top-icon.search-only { display: grid; }
  .search-trigger { display: none; }
  .user-btn { border: none; padding: 0 2px; }
  .user-btn .icon { display: none; }
  .content-inner { padding: 16px 14px 88px; }
  .page-tools { margin-bottom: 16px; gap: 10px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; }

  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi-card { padding: 12px; gap: 8px; border-radius: 12px; }
  .kpi-value { font-size: 1.5rem; }
  .kpi-spark { display: none; }
  .kpi-label { font-size: 11px; }
  .kpi-icon { width: 30px; height: 30px; border-radius: 9px; }
  .kpi-icon .icon { width: 15px; height: 15px; }

  .card { padding: 16px; border-radius: 14px; }
  .chart-card { padding: 16px 12px 10px; }
  .chart-head { gap: 8px; }
  .chart-controls { width: 100%; }
  .range-pills { width: 100%; justify-content: space-between; }
  .range-pills button { flex: 1; }
  .chart-summary { gap: 10px 14px; }

  .dash-grid, .dash-grid-2, .dash-grid-3 { gap: 10px; margin-bottom: 10px; }
  .subhead { margin: 20px 0 10px; }

  .desk { grid-template-columns: minmax(0, 1fr); }
  .desk-list {
    display: flex; gap: 6px; overflow-x: auto; max-height: none;
    padding: 6px; border-radius: 12px;
  }
  .desk-item { flex: 0 0 210px; }
  .desk-item + .desk-item { margin-top: 0; }
  .desk-pane { padding: 16px; border-radius: 12px; }
  .desk-pane .subject { font-size: 1.1rem; margin-top: 16px; }
  .desk-context { grid-template-columns: 96px minmax(0, 1fr); font-size: 11px; }
  .desk-actions { position: sticky; bottom: 0; background: var(--surface); padding-bottom: 4px; }

  .outbox-tabs { overflow-x: auto; }
  .outbox-tab { padding: 0 10px; }

  .table-toolbar { gap: 8px; }
  .search { flex: 1 1 100%; }
  .table-card { border-radius: 12px; }
  .table-card table { min-width: 720px; }
  thead th, td { padding: 10px 12px; }
  .table-card table.compact-mobile { min-width: 0; }
  .table-foot { flex-direction: column; align-items: flex-start; }

  .wa-shell {
    grid-template-columns: minmax(0, 1fr);
    height: calc(100dvh - var(--header-h) - 96px);
    min-height: 460px; border-radius: 14px;
  }
  .wa-list-pane { border-right: none; }
  .wa-chat-pane { display: none; }
  .wa-shell.show-chat .wa-list-pane { display: none; }
  .wa-shell.show-chat .wa-chat-pane { display: flex; }
  .wa-chat-head .btn-icon.wa-mobile-back { display: grid; }
  .wa-messages { padding: 14px 12px 8px; }
  .wa-msg-row { max-width: 88%; }
  .wa-composer { padding: 8px 10px 10px; }
  .wa-quick-filters { display: flex; gap: 4px; overflow-x: auto; padding: 0 14px 10px; }

  .campaign-grid { grid-template-columns: minmax(0, 1fr); }
  .sig-row { flex-direction: column; gap: 10px; padding: 14px; }
  .sig-row .sig-decide { width: 100%; }
  .sig-row .sig-decide .btn { flex: 1; }
  .settings-row { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 18px 0; }
  .inbox-row { grid-template-columns: 36px minmax(0, 1fr) auto 14px; gap: 10px; }
  .inbox-row .inbox-meter, .inbox-row .inbox-waiting { display: none; }
  .inbox-help { grid-template-columns: minmax(0, 1fr); }
  .modal-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .provider-picks { grid-template-columns: minmax(0, 1fr); }
  .te-head { flex-wrap: wrap; }
  .convo-head .tags { margin-left: 0; width: 100%; }
  .convo-actions .btn-ghost { margin-left: 0; }
  .rename-card { flex-direction: column; align-items: flex-start; }
  .popover { width: min(340px, calc(100vw - 20px)); right: -8px; }
  dialog.modal, dialog { max-width: calc(100vw - 16px); max-height: calc(100dvh - 32px); }
  .search-overlay { padding: 8vh 10px 10px; }
}

@media (max-width: 430px) {
  .content-inner { padding: 14px 11px 84px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-card { padding: 11px; }
  .kpi-value { font-size: 1.4rem; }
  .kpi-foot { font-size: 10px; }
  .chart-custom .form-input { width: 100%; }
  .user-btn { display: none; }
  .wa-shell { height: calc(100dvh - var(--header-h) - 82px); }
}

@media (max-width: 360px) {
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Theme picker cards (Settings → Appearance) */
.theme-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-card {
  display: flex; flex-direction: column; gap: 3px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); text-align: left; cursor: pointer; font: inherit; color: var(--text);
}
.theme-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-border); }
.theme-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-card b { font-size: 12px; font-weight: 600; margin-top: 6px; }
.theme-card > span:last-child { font-size: 10.5px; color: var(--text-3); }
.theme-preview { display: flex; gap: 3px; height: 46px; padding: 6px; border-radius: 7px; background: var(--surface-2); }
.theme-preview i { display: block; border-radius: 3px; flex: 1; background: var(--surface); }
.theme-preview i:first-child { flex: 0 0 26%; background: var(--line-strong); }
.theme-preview i:nth-child(3) { flex: 1.4; }
.theme-preview.auto { background: linear-gradient(90deg, #F6F7FB 50%, #151922 50%); }
.theme-preview.auto i { background: rgba(255,255,255,.55); }
.theme-preview.auto i:first-child { background: rgba(255,255,255,.32); }
.theme-preview.dark { background: #151922; }
.theme-preview.light { background: #F6F7FB; }
@media (max-width: 640px) { .theme-cards { grid-template-columns: minmax(0, 1fr); } }

/* WhatsApp details: a side pane on wide screens, a sheet on narrower ones */
.wa-shell { position: relative; }
.wa-chat-pane { position: relative; }
@media (max-width: 1240px) {
  .wa-shell.show-detail .wa-detail-pane {
    display: block; position: absolute; inset: 0; z-index: 6;
    border-left: none; border-radius: var(--r-lg);
    box-shadow: var(--shadow-pop); padding: 18px;
  }
  .wa-shell.show-detail .wa-chat-pane { visibility: hidden; }
}
@media (max-width: 767px) {
  .wa-detail-btn-label { display: none; }
  .wa-chat-head .btn { padding: 0 8px; }
}

/* Mobile data lists: rows become cards instead of a squeezed table */
@media (max-width: 767px) {
  .settings-layout, .settings-panels, .settings-nav { min-width: 0; max-width: 100%; }
  .settings-nav { overflow-x: auto; }

  #contact-rows .table-card,
  #companies-list > .table-card { background: transparent; border: none; overflow: visible; }
  #contact-rows table, #contact-rows tbody, #contact-rows tr, #contact-rows td,
  #companies-list table, #companies-list tbody, #companies-list tr, #companies-list td {
    display: block; width: 100%; min-width: 0;
  }
  #contact-rows thead, #companies-list > .table-card thead { display: none; }
  #contact-rows tbody tr,
  #companies-list > .table-card tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px;
    padding: 13px 14px; margin-bottom: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  }
  #contact-rows tbody tr:hover td, #companies-list > .table-card tbody tr:hover td { background: transparent; }
  #contact-rows td, #companies-list > .table-card td { padding: 0; border: none; min-width: 0; }
  #contact-rows td:nth-child(1) { grid-column: 1 / -1; }
  #contact-rows td:nth-child(2) { grid-column: 1; font-size: 11.5px; color: var(--text-2); }
  #contact-rows td:nth-child(5) { grid-column: 2; grid-row: 2; justify-self: end; }
  #contact-rows td:nth-child(3) { grid-column: 1 / -1; margin-top: 4px; }
  #contact-rows td:nth-child(4) { display: none; }
  #contact-rows td:nth-child(6), #contact-rows td:nth-child(7) { grid-column: 1; font-size: 10.5px; color: var(--text-3); }
  #contact-rows td:nth-child(8) { grid-column: 2; grid-row: 3 / span 2; justify-self: end; align-self: end; }
  #contact-rows td:nth-child(8) .cell-row { flex-direction: column; align-items: flex-end; gap: 4px; }
  #contact-rows td:nth-child(3) .cell-stack span,
  #contact-rows td:nth-child(1) .cell-main { white-space: normal; overflow: visible; }
  #contact-rows .detail-row > td { display: block; }
  #companies-list > .table-card td:nth-child(1) { grid-column: 1; grid-row: 1; }
  #companies-list > .table-card td:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; }
  #companies-list > .table-card td:nth-child(3) { grid-column: 1; grid-row: 2; font-size: 11px; color: var(--text-2); }
  #companies-list > .table-card td:nth-child(4) { grid-column: 2; grid-row: 2; justify-self: end; max-width: none; white-space: normal; }
  #companies-list > .table-card td:nth-child(5) { grid-column: 1; grid-row: 3; font-size: 10.5px; color: var(--text-3); }
  #companies-list > .table-card td:nth-child(6) { grid-column: 2; grid-row: 3; justify-self: end; font-size: 10.5px; color: var(--text-3); }
  #companies-list > .table-card td:nth-child(7) { grid-column: 1 / -1; grid-row: 4; font-size: 10.5px; color: var(--text-3); }

  #today-campaigns .table-card { overflow: visible; background: transparent; border: none; }
  #today-campaigns table, #today-campaigns tbody, #today-campaigns tr, #today-campaigns td { display: block; width: 100%; }
  #today-campaigns thead { display: none; }
  #today-campaigns tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px;
    padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
    background: var(--surface); margin-bottom: 8px;
  }
  #today-campaigns td { padding: 0; border: none; }
  #today-campaigns td:nth-child(1) { grid-column: 1 / -1; }
  #today-campaigns td:nth-child(2) { grid-column: 1; }
  #today-campaigns td:nth-child(6) { grid-column: 2; grid-row: 2; justify-self: end; }
  #today-campaigns td:nth-child(3), #today-campaigns td:nth-child(4), #today-campaigns td:nth-child(5) {
    display: inline-flex; gap: 4px; font-size: 11px; color: var(--text-3);
  }
  #today-campaigns td:nth-child(3)::before { content: 'Sent '; }
  #today-campaigns td:nth-child(4)::before { content: 'Replies '; }
  #today-campaigns td:nth-child(5)::before { content: 'Interested '; }
}

/* Dense records: fixed, proportional columns instead of auto-squeezing */
#contact-rows table { table-layout: fixed; }
#contact-rows th:nth-child(1) { width: 20%; }
#contact-rows th:nth-child(2) { width: 15%; }
#contact-rows th:nth-child(3) { width: 25%; }
#contact-rows th:nth-child(4) { width: 9%; }
#contact-rows th:nth-child(5) { width: 10%; }
#contact-rows th:nth-child(6) { width: 8%; }
#contact-rows th:nth-child(7) { width: 7%; }
#contact-rows th:nth-child(8) { width: 6%; }
#contact-rows td { overflow: hidden; }
#contact-rows .cell-main, #contact-rows .cell-sub,
#contact-rows td:nth-child(2), #contact-rows td:nth-child(6),
#contact-rows td:nth-child(7) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#contact-rows td:nth-child(3) { max-width: none; }
#contact-rows td:nth-child(3) .cell-stack span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#companies-list > .table-card table { table-layout: fixed; }
#companies-list > .table-card th:nth-child(1) { width: 26%; }
#companies-list > .table-card th:nth-child(2) { width: 12%; }
#companies-list > .table-card th:nth-child(3) { width: 18%; }
#companies-list > .table-card th:nth-child(4) { width: 14%; }
#companies-list > .table-card th:nth-child(5) { width: 15%; }
#companies-list > .table-card th:nth-child(6) { width: 8%; }
#companies-list > .table-card th:nth-child(7) { width: 7%; }
#companies-list > .table-card td { overflow: hidden; }
#companies-list > .table-card td:nth-child(2), #companies-list > .table-card td:nth-child(4) { max-width: none; }
#companies-list > .table-card td:nth-child(1) .cell-main, #companies-list > .table-card td:nth-child(1) .cell-sub,
#companies-list > .table-card td:nth-child(3), #companies-list > .table-card td:nth-child(4),
#companies-list > .table-card td:nth-child(5), #companies-list > .table-card td:nth-child(7) {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.campaign-grid { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
@media (max-width: 767px) {
  .campaign-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Contacts keeps its essential six columns until there is room for the rest */
@media (min-width: 768px) and (max-width: 1600px) {
  #contact-rows th:nth-child(6), #contact-rows td:nth-child(6),
  #contact-rows th:nth-child(7), #contact-rows td:nth-child(7) { display: none; }
  #contact-rows th:nth-child(1) { width: 23%; }
  #contact-rows th:nth-child(2) { width: 17%; }
  #contact-rows th:nth-child(3) { width: 32%; }
  #contact-rows th:nth-child(4) { width: 9%; }
  #contact-rows th:nth-child(5) { width: 12%; }
  #contact-rows th:nth-child(8) { width: 7%; }
}
#contact-rows .meter { gap: 1px; }
#contact-rows .meter i { width: 3px; }
#contact-rows td, #contact-rows th,
#companies-list td, #companies-list th { padding-left: 12px; padding-right: 12px; }

.sr-only { contain: strict; }
#today-campaigns table, #today-campaigns tbody, #today-campaigns tr, #today-campaigns td { min-width: 0; }
#today-campaigns .campaign-table { width: 100%; }

.setup-details { margin-top: 10px; }
.setup-details > summary {
  cursor: pointer; font-size: 12px; font-weight: 550; color: var(--accent);
  padding: 4px 0; width: max-content; list-style-position: inside;
}
.setup-details > summary:hover { text-decoration: underline; }
.outbox-wa-view #outbox-banner,
.outbox-wa-view #outbox-summary { display: none; }

#companies-list .card.flush table { table-layout: fixed; width: 100%; }
#companies-list .card.flush th:nth-child(1) { width: 20%; }
#companies-list .card.flush th:nth-child(2) { width: 25%; }
#companies-list .card.flush th:nth-child(3) { width: 15%; }
#companies-list .card.flush th:nth-child(4) { width: 10%; }
#companies-list .card.flush th:nth-child(5) { width: 14%; }
#companies-list .card.flush th:nth-child(6) { width: 16%; }
#companies-list .card.flush td { white-space: normal; overflow-wrap: anywhere; }
#companies-list .card.flush td:nth-child(2) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* WhatsApp Contacts: a card list on phones, proportional on desktop */
#whatsapp-contacts-table > .table-card table { table-layout: fixed; width: 100%; }
#whatsapp-contacts-table th:nth-child(1) { width: 14%; }
#whatsapp-contacts-table th:nth-child(2) { width: 16%; }
#whatsapp-contacts-table th:nth-child(3) { width: 12%; }
#whatsapp-contacts-table th:nth-child(4) { width: 10%; }
#whatsapp-contacts-table th:nth-child(5) { width: 10%; }
#whatsapp-contacts-table th:nth-child(6) { width: 10%; }
#whatsapp-contacts-table th:nth-child(7) { width: 10%; }
#whatsapp-contacts-table th:nth-child(8) { width: 8%; }
#whatsapp-contacts-table th:nth-child(9) { width: 5%; }
#whatsapp-contacts-table th:nth-child(10) { width: 5%; }
#whatsapp-contacts-table td { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

@media (max-width: 767px) {
  #whatsapp-contacts-table > .table-card { background: transparent; border: none; overflow: visible; }
  #whatsapp-contacts-table table, #whatsapp-contacts-table tbody,
  #whatsapp-contacts-table tr, #whatsapp-contacts-table td { display: block; width: 100%; min-width: 0; }
  #whatsapp-contacts-table thead { display: none; }
  #whatsapp-contacts-table tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px;
    padding: 13px 14px; margin-bottom: 8px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  }
  #whatsapp-contacts-table td { padding: 0; border: none; overflow: visible; white-space: normal; text-overflow: clip; }
  #whatsapp-contacts-table td:nth-child(1) { grid-column: 1 / -1; font-weight: 600; }
  #whatsapp-contacts-table td:nth-child(2) { grid-column: 1 / -1; }
  #whatsapp-contacts-table td:nth-child(3) { grid-column: 1; }
  #whatsapp-contacts-table td:nth-child(4) { grid-column: 2; justify-self: end; }
  #whatsapp-contacts-table td:nth-child(5) { display: none; }
  #whatsapp-contacts-table td:nth-child(6) { grid-column: 1; }
  #whatsapp-contacts-table td:nth-child(7) { grid-column: 2; justify-self: end; }
  #whatsapp-contacts-table td:nth-child(8) { grid-column: 1; }
  #whatsapp-contacts-table td:nth-child(9) { grid-column: 2; justify-self: end; }
  #whatsapp-contacts-table td:nth-child(10) { grid-column: 1 / -1; font-size: 10.5px; color: var(--text-3); }
}

@media (min-width: 768px) and (max-width: 1600px) {
  #whatsapp-contacts-table th:nth-child(5), #whatsapp-contacts-table td:nth-child(5),
  #whatsapp-contacts-table th:nth-child(9), #whatsapp-contacts-table td:nth-child(9) { display: none; }
  #whatsapp-contacts-table th:nth-child(1) { width: 14%; }
  #whatsapp-contacts-table th:nth-child(2) { width: 17%; }
  #whatsapp-contacts-table th:nth-child(3) { width: 13%; }
  #whatsapp-contacts-table th:nth-child(4) { width: 10%; }
  #whatsapp-contacts-table th:nth-child(6) { width: 12%; }
  #whatsapp-contacts-table th:nth-child(7) { width: 12%; }
  #whatsapp-contacts-table th:nth-child(8) { width: 12%; }
  #whatsapp-contacts-table th:nth-child(10) { width: 10%; }
}
@media (max-width: 767px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats-grid .stat-card { padding: 12px; border-radius: 12px; }
  .stats-grid .stat-card .value { font-size: 1.35rem; }
  .stats-grid .stat-card .breakdown { gap: 3px 6px; }
}

/* ── Custom Dropdown Components ─────────────────────────────────── */

/* Multi-select (Industry, Business Types) */
.multi-select {
  position: relative;
  width: 100%;
}
.multi-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--text);
  font: 400 var(--fs-body)/1.4 var(--sans);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.multi-select-trigger:hover { border-color: color-mix(in srgb, var(--line-strong) 70%, var(--text-3)); }
.multi-select-trigger:focus,
.multi-select-trigger.open {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.multi-select-trigger.disabled {
  background: var(--surface-2); color: var(--text-3); cursor: not-allowed;
}
.multi-select-placeholder { color: var(--text-3); }
.multi-select-selected { display: none; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.multi-select-arrow { flex: none; color: var(--text-3); width: 16px; height: 16px; transition: transform 120ms ease; }
.multi-select-trigger.open .multi-select-arrow { transform: rotate(180deg); }
.multi-select-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 100;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow-pop); overflow: hidden; max-height: 300px;
}
.multi-select-search { padding: 8px; border-bottom: 1px solid var(--line); }
.multi-select-search .form-input { height: 36px; min-height: 36px; }
.multi-select-options { max-height: 240px; overflow-y: auto; padding: 4px; }
.multi-select-option {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 6px; cursor: pointer; font-size: var(--fs-body);
  color: var(--text); transition: background 80ms ease;
}
.multi-select-option:hover,
.multi-select-option:focus { background: var(--surface-2); outline: none; }
.multi-select-option[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.multi-select-option::before {
  content: ""; width: 16px; height: 16px; flex: none;
  border: 1px solid var(--line-strong); border-radius: 4px;
  background: var(--surface);
}
.multi-select-option[aria-selected="true"]::before {
  border-color: var(--accent); background: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 12.94l6.72-6.72a.75.75 0 011.06 0z'/%3E%3C/svg%3E");
  background-size: 12px 12px; background-position: center; background-repeat: no-repeat;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 550;
}
.chip-remove {
  display: flex; align-items: center; justify-content: center; width: 16px; height: 16px;
  border: none; background: transparent; color: var(--accent); border-radius: 50%;
  font-size: 12px; line-height: 1; cursor: pointer; padding: 0;
}
.chip-remove:hover { background: var(--accent); color: white; border-radius: 50%; }

/* Search-select (Country, State, City) */
.search-select { position: relative; width: 100%; }
.search-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 42px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); color: var(--text);
  font: 400 var(--fs-body)/1.4 var(--sans); cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search-select-trigger:hover { border-color: color-mix(in srgb, var(--line-strong) 70%, var(--text-3)); }
.search-select-trigger:focus,
.search-select-trigger.open {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.search-select-trigger.disabled {
  background: var(--surface-2); color: var(--text-3); cursor: not-allowed;
}
.search-select-placeholder { color: var(--text-3); }
.search-select-text { color: var(--text); flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-select-flag { flex: none; font-size: 1.2em; }
.search-select-arrow { flex: none; color: var(--text-3); width: 16px; height: 16px; transition: transform 120ms ease; }
.search-select-trigger.open .search-select-arrow { transform: rotate(180deg); }
.search-select-dropdown {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 100;
  background: var(--surface); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: var(--shadow-pop); overflow: hidden; max-height: 300px;
}
.search-select-search { padding: 8px; border-bottom: 1px solid var(--line); }
.search-select-search .form-input { height: 36px; min-height: 36px; }
.search-select-options { max-height: 240px; overflow-y: auto; padding: 4px; }
.search-select-option {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  border-radius: 6px; cursor: pointer; font-size: var(--fs-body);
  color: var(--text); transition: background 80ms ease;
}
.search-select-option:hover,
.search-select-option:focus { background: var(--surface-2); outline: none; }
.search-select-option-flag { flex: none; font-size: 1.2em; }
.search-select-option-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Form row/grid adjustments for manual search */
#manual-search-form .form-row { align-items: flex-start; }
#manual-search-form .form-group { flex: 1; min-width: 200px; }
#manual-search-form .card { padding: 20px; }
#manual-search-form .card h2 { font-size: 14px; font-weight: 650; color: var(--text); margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
#manual-search-form .btn-group { margin-top: 16px; }
.multi-select-option-flag { flex: none; font-size: 1.2em; }
.multi-select-option-name { flex: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Tab bar for manual searched results */
.tab-bar { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 99px; background: var(--surface-2); color: var(--text-2);
  font: 550 12px/1 var(--sans); white-space: nowrap; cursor: pointer;
  transition: all 120ms ease;
}
.tab-btn:hover { background: var(--surface); color: var(--text); }
.tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
.tab-btn .badge { background: rgba(255,255,255,0.2); color: inherit; }

/* Filter bar */
.filter-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; align-items: flex-end; }

/* Selection bar */
.selection-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.selection-bar .btn { flex: 0 0 auto; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }

/* Responsive adjustments */
@media (max-width: 767px) {
  #manual-search-form .form-row { flex-direction: column; gap: 0; }
  #manual-search-form .form-group { flex: none; min-width: 0; width: 100%; }
  #manual-search-form .card { padding: 16px; }
  .filter-bar { grid-template-columns: 1fr; }
  .selection-bar { justify-content: center; }
}

/* Outbox with only WhatsApp work: don't show an empty email desk first */
.outbox-wa-only #outbox-email-panel,
.outbox-wa-only #outbox-banner,
.outbox-wa-only #outbox-summary,
.outbox-wa-only #outbox-actions { display: none !important; }
.outbox-wa-view #outbox-actions { display: none; }

/* Connected WhatsApp accounts become cards on a phone */
@media (max-width: 767px) {
  #whatsapp-accounts-list > .table-card { background: transparent; border: none; overflow: visible; }
  #whatsapp-accounts-list table, #whatsapp-accounts-list tbody,
  #whatsapp-accounts-list tr, #whatsapp-accounts-list td {
    display: block; width: 100%; min-width: 0;
  }
  #whatsapp-accounts-list thead { display: none; }
  #whatsapp-accounts-list tbody tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 10px;
    padding: 12px 14px; margin-bottom: 8px;
    border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
  }
  #whatsapp-accounts-list td { padding: 0; border: none; min-width: 0; }
  #whatsapp-accounts-list td:nth-child(1) { grid-column: 1 / -1; }
  #whatsapp-accounts-list td:nth-child(2) { grid-column: 1; grid-row: 2; }
  #whatsapp-accounts-list td:nth-child(3) { grid-column: 2; grid-row: 2; justify-self: end; }
  #whatsapp-accounts-list td:nth-child(4) { grid-column: 1; grid-row: 3; }
  #whatsapp-accounts-list td:nth-child(5) { grid-column: 2; grid-row: 3; justify-self: end; }
  #whatsapp-accounts-list td:nth-child(6) { grid-column: 1 / -1; grid-row: 4; }
  #whatsapp-accounts-list td:nth-child(4) .badge { margin-top: 2px; }
  .banner { flex-wrap: wrap; }
  .banner .btn { margin-left: 0; width: 100%; }
}
