/* Elinom Connect — public product page + customer workspace + admin chrome */

:root {
  --cx-ink: #0b1220;
  --cx-muted: #475569;
  --cx-line: #dbe3f0;
  --cx-bg: #f4f7fb;
  --cx-card: #ffffff;
  --cx-accent: #4f46e5;
  --cx-accent-2: #0ea5e9;
  --cx-good: #059669;
  --cx-warn: #d97706;
  --cx-bad: #dc2626;
  /* Shared navy surface for desktop sidebar, mobile top bar, and slide-out drawer. */
  --cx-side-surface:
    linear-gradient(165deg, rgba(14, 165, 233, 0.2) 0%, transparent 34%),
    linear-gradient(200deg, #07111f 0%, #0b1528 55%, #0a1a2e 100%);
}

body.connect-public {
  margin: 0;
  font-family: Inter, "Segoe UI", sans-serif;
  background: var(--cx-bg);
  color: var(--cx-ink);
}

.cx-hero {
  position: relative;
  margin: 12px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(155deg, #0b1220 0%, #1e1b4b 48%, #0ea5e9 120%);
  color: #fff;
}
.cx-hero-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4.5rem 2rem 4rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.cx-hero-badge {
  display: inline-flex;
  gap: 0.45rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  padding: 0.35rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cx-hero h1 {
  font-size: 3rem;
  line-height: 1.12;
  margin: 1rem 0 1rem;
  font-weight: 900;
}
.cx-hero h1 span {
  background: linear-gradient(90deg, #7dd3fc, #c4b5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cx-hero p {
  color: #dbeafe;
  font-size: 1.08rem;
  line-height: 1.7;
  max-width: 34rem;
}
.cx-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
}
.cx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: 12px;
  padding: 0.85rem 1.4rem;
  font-weight: 700;
  text-decoration: none;
  border: 0;
  cursor: pointer;
}
.cx-btn-primary {
  background: linear-gradient(120deg, #38bdf8 0%, #6366f1 48%, #f472b6 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
}
.cx-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.cx-btn-danger {
  background: linear-gradient(135deg, #f43f5e, #f59e0b);
  color: #fff;
}
.cx-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border-radius: 0.65rem;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(248, 250, 252, 0.95);
  color: #475569;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.cx-icon-btn:hover,
.cx-icon-btn:focus-visible {
  background: #fff;
  color: #0f172a;
  border-color: rgba(100, 116, 139, 0.7);
  outline: none;
}
.cx-icon-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.cx-icon-btn-danger {
  color: #e11d48;
  border-color: rgba(244, 63, 94, 0.35);
  background: rgba(255, 241, 242, 0.95);
}
.cx-icon-btn-danger:hover,
.cx-icon-btn-danger:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #f59e0b);
  border-color: transparent;
}
.cx-table-actions {
  width: 3.25rem;
  text-align: right;
  white-space: nowrap;
}
.cx-btn-record {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(248, 113, 113, 0.55);
}
.cx-btn-record.is-recording {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25);
}
.cx-rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.45rem;
  color: #fecaca;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
}
.cx-rec-badge[hidden] {
  display: none;
}
.cx-rec-badge::before {
  content: "";
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
}
.cx-rec-player {
  width: min(220px, 100%);
  height: 32px;
}
.cx-chip-rec {
  background: #fee2e2;
  color: #991b1b;
}
.cx-settings-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0.8rem 0;
}
.cx-kpi {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}
.cx-kpi strong {
  display: block;
  font-size: 1.05rem;
}
.cx-kpi span {
  color: #bfdbfe;
  font-size: 0.82rem;
}
.cx-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 4.2rem 1.4rem;
}
.cx-kicker {
  color: #4f46e5;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.cx-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.6rem;
}
.cx-card {
  background: var(--cx-card);
  border: 1px solid var(--cx-line);
  border-radius: 16px;
  padding: 1.2rem 1.15rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.cx-card h3 {
  margin: 0.55rem 0 0.4rem;
  font-size: 1.02rem;
}
.cx-card p,
.cx-muted {
  color: var(--cx-muted);
  line-height: 1.6;
}
.cx-soon {
  display: inline-block;
  margin-top: 0.55rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #92400e;
  background: #fef3c7;
  border-radius: 99px;
  padding: 0.15rem 0.5rem;
}
.cx-footer-support {
  background: #0b1220;
  color: #dbeafe;
  padding: 2rem 1.4rem;
}
.cx-footer-support a {
  color: #93c5fd;
}

body.connect-app {
  margin: 0;
  min-height: 100vh;
  color: var(--cx-ink);
  font-family: "Geist", "Hanken Grotesk", "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse 70% 50% at 100% -10%, rgba(14, 165, 233, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 40% at -5% 100%, rgba(56, 189, 248, 0.08), transparent 50%),
    linear-gradient(180deg, #edf3f8 0%, #e7eef5 48%, #e2eaf2 100%);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.connect-app h1,
body.connect-app h2,
body.connect-app h3,
body.connect-app .cx-side-brand,
body.connect-app .cx-stat b,
body.connect-app .cx-dialler-title {
  font-family: "Sora", "Hanken Grotesk", "Segoe UI", sans-serif;
}
.cx-shell {
  display: grid;
  grid-template-columns: minmax(232px, 268px) minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}
.cx-side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.15rem 0.85rem 1rem;
  box-sizing: border-box;
  overflow: hidden;
  color: #e2e8f0;
  background: var(--cx-side-surface);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
}
.cx-side-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  flex-shrink: 0;
}
.cx-side-toggle {
  display: none;
}
.cx-side-backdrop {
  display: none;
}
.cx-side-drawer-top {
  display: none;
}
.cx-side-close {
  display: none;
}
.cx-side-menu {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  box-sizing: border-box;
}
.cx-side-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.15rem 0.45rem 0.85rem;
  padding: 0.35rem 0.4rem;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.3;
  white-space: nowrap;
  overflow: visible;
  flex-shrink: 0;
  min-width: 0;
}
.cx-side-brand-mark {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}
.cx-side-brand-text {
  background: linear-gradient(90deg, #7dd3fc 0%, #38bdf8 35%, #67e8f9 70%, #a5b4fc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cx-side-links {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.15rem 0.2rem 0.6rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}
.cx-side-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 0.55rem 0.35rem 0.15rem;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
}
.cx-sign-out {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.55rem;
  color: #fecaca;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 11px;
  padding: 0.58rem 0.72rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease;
}
.cx-sign-out:hover {
  background: rgba(248, 113, 113, 0.16);
  color: #fee2e2;
}
.cx-sign-out i {
  width: 1rem;
  text-align: center;
}
.cx-side a,
.cx-side button.cx-nav {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.55rem;
  color: #cbd5e1;
  text-decoration: none;
  background: transparent;
  border: 0;
  border-radius: 11px;
  padding: 0.58rem 0.72rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.cx-side a:hover,
.cx-side button.cx-nav:hover {
  background: rgba(148, 163, 184, 0.12);
  color: #f8fafc;
}
.cx-side button.cx-nav.active,
.cx-side a.active {
  background: linear-gradient(105deg, rgba(14, 165, 233, 0.32), rgba(56, 189, 248, 0.16));
  color: #f0f9ff;
  box-shadow: inset 3px 0 0 #38bdf8;
}
.cx-main {
  position: relative;
  padding: 1.35rem 1.55rem 2.2rem;
  min-width: 0;
  animation: cx-main-in 0.35s ease both;
}
@keyframes cx-main-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .cx-main { animation: none; }
  .cx-side a,
  .cx-side button.cx-nav { transition: none; }
}
.cx-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 26rem) minmax(0, 1fr);
  gap: 0.85rem 1rem;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}
.cx-top-title {
  min-width: 0;
}
.cx-top h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0b1220;
}
.cx-top .cx-muted {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
}
.cx-top-search {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
  justify-self: center;
}
.cx-top-search .us-trigger,
body.connect-app .cx-top-search #us-trigger,
body.connect-app .cx-top-search .us-trigger {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.55rem !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 26rem !important;
  height: 2.55rem !important;
  min-height: 2.55rem !important;
  max-height: 2.55rem !important;
  padding: 0 0.95rem !important;
  margin: 0 !important;
  border-radius: 999px !important;
  border: 1px solid rgba(14, 165, 233, 0.35) !important;
  background: rgba(255, 255, 255, 0.88) !important;
  background-image: none !important;
  color: #0f172a !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 8px 22px rgba(15, 23, 42, 0.06) !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.cx-top-search .us-trigger:hover,
body.connect-app .cx-top-search #us-trigger:hover,
body.connect-app .cx-top-search .us-trigger:hover {
  border-color: #0ea5e9 !important;
  background: #fff !important;
  color: #0369a1 !important;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 26px rgba(14, 165, 233, 0.12) !important;
}
.cx-top-search .us-trigger > i,
body.connect-app .cx-top-search .us-trigger > i {
  color: #0284c7 !important;
  font-size: 0.95rem !important;
  margin: 0 !important;
}
.cx-top-search .us-trigger-text,
body.connect-app .cx-top-search .us-trigger-text {
  display: inline !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  text-align: left !important;
  color: inherit !important;
  opacity: 1 !important;
  font-weight: 550 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
.cx-top-search .us-trigger-kbd,
body.connect-app .cx-top-search .us-trigger-kbd {
  display: inline-flex !important;
  align-items: center !important;
  margin-left: auto !important;
  padding: 0.12rem 0.4rem !important;
  border-radius: 6px !important;
  border: 1px solid rgba(148, 163, 184, 0.45) !important;
  background: rgba(241, 245, 249, 0.95) !important;
  color: #475569 !important;
  font-size: 0.68rem !important;
  font-weight: 650 !important;
}
/* Never leave a floating / body-level Search Elinom under the sidebar. */
body.connect-app > .us-trigger,
body.connect-app > .us-trigger-fixed {
  display: none !important;
}

/* Search palette: horizontally center on the main column; vertically anchor
   under the Connect header (not mid-page). Top-anchoring + translateX-only
   keeps the first paint stable when results load (no Y bounce from
   translate(-50%,-50%) as height grows) and keeps the palette on-screen on
   tall pages like AI Voice where .cx-main's geometric center is off-viewport. */
@media (width >= 769px) {
  body.connect-app #us-palette {
    top: var(--cx-us-top, 96px) !important;
    left: var(--cx-us-left, calc(50% + (var(--cx-side-w, 268px) / 2))) !important;
    right: auto !important;
    bottom: auto !important;
    width: min(680px, calc(100vw - var(--cx-side-w, 268px) - 48px)) !important;
    max-width: min(680px, calc(100vw - var(--cx-side-w, 268px) - 48px)) !important;
    max-height: min(70vh, calc(100vh - var(--cx-us-top, 96px) - 24px)) !important;
    /* translateX only — height growth expands downward; top edge stays put. */
    transform: translateX(-50%) scale(0.96) !important;
    transition:
      opacity 0.18s ease,
      visibility 0.18s ease,
      transform 0.18s ease !important;
    /* Above Voice agents page overlay (z-index 80) and .cx-top (90). */
    z-index: 100050 !important;
  }
  body.connect-app #us-palette.us-visible {
    transform: translateX(-50%) scale(1) !important;
  }
  body.connect-app #us-overlay {
    left: var(--cx-side-w, 268px) !important;
    width: auto !important;
    right: 0 !important;
    z-index: 100049 !important;
  }
}
@media (width <= 768px) {
  body.connect-app #us-palette {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
  }
  body.connect-app #us-overlay {
    left: 0 !important;
  }
}
.cx-top-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  justify-self: end;
}
body.connect-app .cx-btn-ghost.cx-btn-erp {
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 650;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
body.connect-app .cx-btn-ghost.cx-btn-erp:hover {
  border-color: #0ea5e9;
  color: #0369a1;
}
.cx-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}
.cx-stat {
  position: relative;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 1rem 1.05rem 0.95rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}
.cx-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #38bdf8, #0ea5e9 55%, #6366f1);
}
.cx-stat b {
  display: block;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #0b1220;
}
.cx-stat span {
  display: block;
  margin-top: 0.2rem;
  color: var(--cx-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.cx-analytics-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1.25rem;
}
.cx-chart-panel {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  padding: 1rem 1.1rem 1.05rem;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-width: 0;
}
.cx-chart-panel__head {
  margin-bottom: 0.65rem;
}
.cx-chart-panel__head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cx-ink);
}
.cx-chart-panel__head .cx-muted {
  margin: 0.28rem 0 0;
  font-size: 0.84rem;
  line-height: 1.4;
}
.cx-chart-wrap {
  position: relative;
  width: 100%;
  height: 280px;
}
.cx-chart-wrap--donut {
  height: 260px;
  max-width: 320px;
  margin: 0 auto;
}
.cx-analytics-note {
  margin-top: 0.85rem;
}

@media (max-width: 1100px) {
  .cx-analytics-charts {
    grid-template-columns: 1fr;
  }
  .cx-chart-wrap,
  .cx-chart-wrap--donut {
    height: 240px;
    max-width: none;
  }
}
@media (max-width: 640px) {
  .cx-chart-panel {
    padding: 0.9rem 0.85rem 0.85rem;
  }
  .cx-chart-wrap,
  .cx-chart-wrap--donut {
    height: 220px;
  }
}
.cx-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}
.cx-table th,
.cx-table td {
  padding: 0.78rem 0.9rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  text-align: left;
  font-size: 0.92rem;
}
.cx-table th {
  background: rgba(241, 245, 249, 0.85);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.cx-attr-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.cx-attr-form input {
  min-width: 7rem;
  flex: 1 1 7rem;
  border: 1px solid var(--cx-line);
  border-radius: 8px;
  padding: 0.35rem 0.5rem;
  font: inherit;
}
.cx-dialler-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: min(72vh, 680px);
  padding: 1.4rem 0.6rem 2rem;
  box-sizing: border-box;
  background:
    radial-gradient(circle at 50% 42%, rgba(14, 165, 233, 0.14), transparent 42%),
    radial-gradient(circle at 62% 58%, rgba(99, 102, 241, 0.1), transparent 38%);
}
.cx-dialler-frame {
  width: min(100%, 400px);
  padding: 3px;
  border-radius: 26px;
  background: linear-gradient(120deg, #38bdf8 0%, #0ea5e9 34%, #6366f1 67%, #67e8f9 100%);
  box-shadow: 0 28px 60px rgba(14, 165, 233, 0.28);
}
.cx-dialler {
  width: 100%;
  max-width: none;
  margin: 0;
  box-sizing: border-box;
  background:
    linear-gradient(165deg, rgba(11, 18, 32, 0.96) 0%, rgba(15, 23, 42, 0.94) 52%, rgba(14, 165, 233, 0.28) 130%);
  color: #fff;
  border-radius: 24px;
  padding: 1.25rem 1.2rem 1.3rem;
}
.cx-dialler-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.cx-dialler-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  font-weight: 900;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 42%, #6366f1 78%, #67e8f9 100%);
}
.cx-dialler-kicker {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #7dd3fc, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cx-dialler-title {
  margin: 0.1rem 0 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.cx-dialler-status {
  margin-bottom: 0.75rem;
  color: #bfdbfe;
  font-size: 0.92rem;
}
.cx-dialler #cxDialInput {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-radius: 12px;
  padding: 0.8rem;
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
}
.cx-notes-row {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.75rem;
  width: 100%;
}
.cx-notes-row #cxCallNotes {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  margin: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 12px;
  padding: 0.7rem 0.8rem;
  font-size: 0.95rem;
}
.cx-notes-row #cxSaveNotes {
  flex: 0 0 auto;
  align-self: stretch;
  white-space: nowrap;
  margin: 0;
  padding: 0.7rem 0.95rem;
}
.cx-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}
.cx-keys button {
  border: 0;
  border-radius: 12px;
  padding: 0.75rem 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(15, 23, 42, 0.35));
  color: #fff;
  font-size: 1.05rem;
  cursor: pointer;
}
.cx-keys button:hover,
.cx-keys button:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 1px;
}
.cx-callbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
}
.cx-dialler .cx-btn:disabled,
.cx-dialler .cx-btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.15);
}
.cx-dial-msg {
  margin: 0 0 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: #e0f2fe;
  background: rgba(14, 165, 233, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.35);
}
.cx-dial-msg[data-kind="error"] {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.4);
}
.cx-numbers-msg,
.cx-form-msg {
  margin: 0 0 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.35;
  color: #0c4a6e;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.28);
}
.cx-numbers-msg[data-kind="error"],
.cx-form-msg[data-kind="error"] {
  color: #991b1b;
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.35);
}
.cx-btn.cx-btn-assigned,
.cx-btn.cx-btn-assigned:disabled {
  opacity: 1;
  cursor: default;
  color: #0c4a6e;
  background: rgba(14, 165, 233, 0.14);
  border: 1px solid rgba(14, 165, 233, 0.3);
  box-shadow: none;
}
.cx-dial-transport {
  margin: 0 0 0.55rem;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  color: #bfdbfe;
  background: rgba(30, 64, 175, 0.28);
  border: 1px solid rgba(147, 197, 253, 0.28);
}
.cx-dial-transport[data-kind="error"] {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.35);
}
.cx-dialler-crm {
  min-height: 1.2rem;
  margin: 0.75rem 0 0;
  color: #bfdbfe;
  text-align: center;
}
.cx-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: linear-gradient(120deg, rgba(14, 165, 233, 0.16), rgba(99, 102, 241, 0.14));
  color: #0c4a6e;
  border: 1px solid rgba(14, 165, 233, 0.28);
}
/* [hidden] must beat .cx-shell { display: grid } — otherwise the workspace
   chrome leaks behind the login modal (security + UX). */
.cx-shell[hidden],
.cx-auth-stage[hidden],
.cx-login-gate[hidden] {
  display: none !important;
}

/* Full-page auth stage — no portal chrome until Elinom login succeeds. */
body.connect-app.connect-app--auth {
  min-height: 100vh;
  margin: 0;
  background: #0b1220;
}
body.connect-app.connect-app--auth .cx-shell {
  display: none !important;
}
.cx-auth-stage {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  box-sizing: border-box;
  color: #e2e8f0;
}
.cx-auth-stage__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 20%, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 80%, rgba(244, 114, 182, 0.18), transparent 50%),
    linear-gradient(160deg, #0b1220 0%, #1e1b4b 55%, #0f172a 100%);
  pointer-events: none;
}
.cx-auth-stage__copy {
  position: relative;
  z-index: 1;
  max-width: 28rem;
  text-align: center;
}
.cx-auth-stage__brand {
  margin: 0 0 0.75rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #38bdf8, #6366f1, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.cx-auth-stage__lead {
  margin: 0 0 1.4rem;
  color: #cbd5e1;
  line-height: 1.55;
  font-size: 0.98rem;
}
.cx-auth-stage__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
}
.cx-auth-stage__back {
  color: #93c5fd;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.cx-auth-stage__back:hover {
  text-decoration: underline;
}
/* Legacy alias kept for older selectors / tests that still target the id. */
.cx-login-gate.cx-auth-stage {
  max-width: none;
  margin: 0;
  padding: 2rem 1.25rem;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.cx-help-menu,
.cx-phone-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--cx-line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  padding: 0.45rem;
  z-index: 80;
}
.cx-help-menu a,
.cx-phone-menu a,
.cx-phone-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
  font: inherit;
}
#navHelpWrap,
#navConnectWrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
#navNotifWrap #navHelpBtn,
#navNotifWrap #navConnectBtn {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0.35rem 0.45rem;
  min-width: 2rem;
}
.cx-agent-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 12rem;
}
.cx-check-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.cx-agent-form .cx-check-row {
  flex-direction: row;
}
.cx-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.35rem 0.75rem;
  margin: 0.35rem 0 0.85rem;
}
.cx-agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}
.cx-agent-redirect {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  border: 1px dashed rgba(14, 165, 233, 0.45);
  background: rgba(14, 165, 233, 0.08);
}
.cx-agent-redirect p {
  margin: 0 0 0.35rem;
}
.cx-agent-redirect p:last-child {
  margin-bottom: 0;
}
.cx-linkish {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: #0369a1;
  font: inherit;
  font-weight: 650;
  text-decoration: underline;
  cursor: pointer;
}
.cx-stat--action {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.cx-stat--action:hover,
.cx-stat--action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(14, 165, 233, 0.55);
  box-shadow: 0 10px 22px rgba(14, 165, 233, 0.14);
  outline: none;
}
.cx-toast {
  position: fixed;
  left: 50%;
  bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
  z-index: 13000;
  max-width: min(26rem, calc(100vw - 1.5rem));
  padding: 0.75rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(14, 165, 233, 0.35);
  background: #0f172a;
  color: #e0f2fe;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.28);
  transform: translate(-50%, 120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.cx-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
.cx-toast[data-kind="success"] {
  border-color: rgba(34, 197, 94, 0.45);
  background: #052e16;
  color: #bbf7d0;
}
.cx-toast[data-kind="error"] {
  border-color: rgba(248, 113, 113, 0.45);
  background: #450a0a;
  color: #fecaca;
}
.cx-modal--wide {
  width: min(36rem, 100%);
  max-height: min(90vh, 42rem);
}
/* Page overlay for Voice agents — covers content below .cx-top; header stays visible. */
.cx-main.cx-main--overlay-open {
  overflow: hidden;
  /* Cancel entrance animation transform so position:fixed overlay is viewport-relative. */
  animation: none !important;
  transform: none !important;
}
.cx-main.cx-main--overlay-open .cx-top {
  position: relative;
  z-index: 90;
}
body.connect-app.cx-overlay-open {
  overflow: hidden;
}
.cx-page-overlay {
  position: fixed;
  /* Stretch from sidebar edge to the viewport right — avoid left+width drift that
     clipped edit/delete actions when width was under-measured. */
  top: var(--cx-page-overlay-top-fixed, 0);
  left: var(--cx-page-overlay-left, 0);
  right: 0;
  bottom: 0;
  width: auto;
  max-width: none;
  z-index: 80;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 28%, #ffffff 100%);
  border-left: 1px solid rgba(148, 163, 184, 0.22);
  color: #0f172a;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.2s ease, transform 0.22s ease;
  pointer-events: none;
}
.cx-page-overlay.is-open {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}
.cx-page-overlay__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  flex: 0 0 auto;
  padding: 1.15rem 1.25rem 0.85rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.92);
}
.cx-page-overlay__heading {
  min-width: 0;
  flex: 1 1 auto;
}
.cx-page-overlay__title {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #0b1220;
}
.cx-page-overlay__lead {
  margin: 0.4rem 0 0;
  color: #64748b;
  font-size: 0.92rem;
  line-height: 1.45;
}
.cx-page-overlay__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: -0.15rem -0.2rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
}
.cx-page-overlay__close:hover,
.cx-page-overlay__close:focus-visible {
  background: rgba(148, 163, 184, 0.18);
  color: #0f172a;
  outline: none;
}
.cx-page-overlay__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 1rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}
.cx-page-overlay__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
  padding: 0.85rem 1.25rem calc(0.95rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(248, 250, 252, 0.96);
}
.cx-page-overlay__error {
  margin: 0.15rem 0 0;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: #991b1b;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.cx-agent-overlay-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cx-agent-overlay-card {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.cx-agent-overlay-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
}
.cx-agent-overlay-card__head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}
.cx-agent-overlay-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.cx-agent-overlay-card__meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}
.cx-agent-overlay-card__actions {
  display: inline-flex;
  gap: 0.35rem;
  flex: 0 0 auto;
  flex-shrink: 0;
}
.cx-agent-overlay-card p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
body.connect-app .cx-btn.cx-btn-overlay {
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  border-radius: 10px;
}
body.connect-app .cx-btn.cx-btn-ghost.cx-btn-overlay {
  background: rgba(241, 245, 249, 0.95);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.45);
}
body.connect-app .cx-btn.cx-btn-ghost.cx-btn-overlay:hover,
body.connect-app .cx-btn.cx-btn-ghost.cx-btn-overlay:focus-visible {
  background: #fff;
  color: #0f172a;
  border-color: rgba(100, 116, 139, 0.65);
}
@media (prefers-reduced-motion: reduce) {
  .cx-page-overlay {
    transition: none;
    transform: none;
  }
}
@media (max-width: 900px) {
  .cx-page-overlay {
    border-left: 0;
    transform: translateY(10px);
  }
  .cx-page-overlay.is-open {
    transform: translateY(0);
  }
}
@media (max-width: 640px) {
  .cx-page-overlay__header,
  .cx-page-overlay__body,
  .cx-page-overlay__footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .cx-page-overlay__footer {
    flex-direction: column-reverse;
  }
  body.connect-app .cx-btn.cx-btn-overlay {
    width: 100%;
  }
  .cx-agent-overlay-card__head {
    flex-wrap: wrap;
  }
}
.cx-agent-modal-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
  max-height: min(52vh, 24rem);
  overflow: auto;
}
.cx-agent-modal-card {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #f8fafc;
}
.cx-agent-modal-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
}
.cx-agent-modal-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}
.cx-agent-modal-card__meta {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
}
.cx-agent-modal-card__actions {
  display: inline-flex;
  gap: 0.35rem;
  flex: 0 0 auto;
}
.cx-agent-modal-card p {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  line-height: 1.4;
}
.cx-session-table {
  margin-top: 1.2rem;
}
@media (max-width: 1100px) {
  .cx-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .cx-hero-inner,
  .cx-grid,
  .cx-shell {
    grid-template-columns: 1fr;
  }
  .cx-hero h1 {
    font-size: 2rem;
  }
  .cx-side {
    position: sticky;
    top: 0;
    z-index: 40;
    height: auto;
    max-height: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow: visible;
    gap: 0;
    padding: 0;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    /* Sticky mobile/tablet top bar uses the same navy surface as the drawer. */
    background: var(--cx-side-surface);
  }
  .cx-side-head {
    position: relative;
    z-index: 42;
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
    background: transparent;
  }
  /* Mobile/tablet top chrome: no refresh/reload control (Menu + brand only). */
  .cx-side-head #cxRefresh,
  .cx-side-head .cx-refresh,
  .cx-side-head button.cx-refresh,
  .cx-side-head button[data-action="refresh"],
  .cx-side-head button[aria-label*="Refresh" i],
  .cx-side-head button[aria-label*="Reload" i],
  .cx-side-head button:has(.fa-rotate, .fa-rotate-right, .fa-arrows-rotate, .fa-sync, .fa-sync-alt) {
    display: none !important;
  }
  .cx-side-brand {
    margin: 0;
    padding: 0.1rem 0;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
    flex: 1 1 auto;
    min-width: 0;
  }
  .cx-side-brand-mark {
    width: 1.85rem;
    height: 1.85rem;
  }
  .cx-side-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    order: -1;
    margin-left: 0;
    margin-right: 0;
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    min-width: 2.35rem;
    min-height: 2.35rem;
    padding: 0;
    border-radius: 0.65rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
  }
  .cx-side-toggle:hover,
  .cx-side.is-open .cx-side-toggle {
    border-color: rgba(56, 189, 248, 0.55);
    background: rgba(14, 165, 233, 0.22);
    color: #f0f9ff;
  }
  .cx-side-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(2, 8, 20, 0.52);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
  }
  .cx-side.is-open .cx-side-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
  .cx-side-menu {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: min(86vw, 20.5rem);
    /* border-box so 100dvh includes padding — content-box was ~30px taller than
       the viewport and overflow:hidden clipped Sign out at the bottom. */
    box-sizing: border-box;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    flex: none;
    flex-direction: column;
    overflow: hidden;
    padding: 0.85rem 0.7rem calc(1rem + env(safe-area-inset-bottom, 0px));
    border-top: 0;
    border-right: 1px solid rgba(148, 163, 184, 0.16);
    background: var(--cx-side-surface);
    box-shadow: 18px 0 40px rgba(2, 8, 20, 0.42);
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    visibility: hidden;
    pointer-events: none;
  }
  .cx-side.is-open .cx-side-menu {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
  }
  .cx-side-drawer-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    flex-shrink: 0;
    margin-bottom: 0.45rem;
    padding: 0.15rem 0.2rem 0.65rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  }
  .cx-side-brand--drawer {
    margin: 0;
    padding: 0;
    font-size: 0.98rem;
    flex: 1 1 auto;
    min-width: 0;
  }
  .cx-side-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2.2rem;
    height: 2.2rem;
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: 0;
    border-radius: 0.6rem;
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(148, 163, 184, 0.12);
    color: #e2e8f0;
    font: inherit;
    font-size: 1rem;
    cursor: pointer;
  }
  .cx-side-close:hover,
  .cx-side-close:focus-visible {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(248, 113, 113, 0.16);
    color: #fee2e2;
    outline: none;
  }
  .cx-side-links {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0.35rem 0.1rem 0.45rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
  }
  .cx-side-footer {
    flex-shrink: 0;
    margin-top: 0;
    /* Keep Sign out fully inside the drawer (tap target clear of the clip edge). */
    padding: 0.5rem 0.15rem 0.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.14);
  }
  .cx-sign-out {
    width: 100%;
    min-height: 2.5rem;
  }
  body.connect-app.cx-nav-open {
    overflow: hidden;
  }
  @media (prefers-reduced-motion: reduce) {
    .cx-side-menu,
    .cx-side-backdrop {
      transition: none;
    }
  }
  .cx-main {
    padding: 1rem 1rem 1.5rem;
  }
  .cx-top {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title actions"
      "search search";
    align-items: start;
    gap: 0.75rem;
  }
  .cx-top-title { grid-area: title; }
  .cx-top-search {
    grid-area: search;
    justify-content: stretch;
    max-width: none;
  }
  .cx-top-search .us-trigger,
  body.connect-app .cx-top-search #us-trigger,
  body.connect-app .cx-top-search .us-trigger {
    max-width: none !important;
  }
  .cx-top-actions {
    grid-area: actions;
    justify-content: flex-end;
    justify-self: end;
  }
  .cx-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .cx-dialler-stage {
    min-height: 62vh;
    padding: 0.8rem 0.4rem 1.4rem;
    align-items: center;
    justify-content: center;
  }
  .cx-dialler-frame {
    width: min(92%, 320px);
  }
}
@media (max-width: 420px) {
  .cx-top h1 {
    font-size: 1.35rem;
  }
  .cx-stat {
    padding: 0.85rem 0.85rem 0.8rem;
  }
  .cx-stat b {
    font-size: 1.28rem;
  }
}

.cx-settings-form {
  display: grid;
  gap: 0.6rem;
  max-width: 28rem;
  margin: 1rem 0;
}
.cx-settings-form input,
.cx-settings-form select,
.cx-settings-form textarea {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--cx-line);
  border-radius: 8px;
}
.cx-market-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.8rem 0;
}
.cx-market-filters select,
.cx-market-filters input,
.cx-market-filters button {
  min-width: 9rem;
}
@media (max-width: 900px) {
  .cx-market-filters > * {
    width: 100%;
    min-width: 0;
  }

  /* A wide results table slides under the filters on a phone. Stack each
     result so Select stays on its own row. */
  #cxSearchResults .cx-table thead,
  #cxView .cx-table thead {
    display: none;
  }
  #cxSearchResults .cx-table tr,
  #cxView .cx-table tr {
    display: grid;
    gap: 0.15rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--cx-line);
  }
  #cxSearchResults .cx-table td,
  #cxView .cx-table td {
    display: block;
    width: auto;
    border: 0;
    padding: 0.1rem 0;
  }
  #cxView .cx-btn {
    scroll-margin-bottom: 5.5rem;
  }
}

/* Mobile / tablet: kill page-level horizontal scrollbars. Wide tables scroll
   inside themselves instead of stretching the whole Connect shell. */
@media (max-width: 1024px) {
  html:has(body.connect-app),
  body.connect-app {
    overflow-x: hidden;
    max-width: 100%;
  }
  body.connect-app .cx-shell,
  body.connect-app .cx-main,
  body.connect-app #cxView,
  body.connect-app .cx-top,
  body.connect-app .cx-top-search {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  body.connect-app .cx-main,
  body.connect-app #cxView {
    overflow-x: hidden;
  }
  body.connect-app .cx-table,
  body.connect-app .cx-session-table table,
  body.connect-app table.cx-table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  body.connect-app .cx-table > thead,
  body.connect-app .cx-table > tbody,
  body.connect-app .cx-session-table table > thead,
  body.connect-app .cx-session-table table > tbody {
    display: table;
    width: 100%;
    min-width: 36rem;
  }
  /* Keep row action icons reachable without horizontal scrolling. */
  body.connect-app .cx-table th.cx-table-actions,
  body.connect-app .cx-table td.cx-table-actions {
    position: sticky;
    right: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: -8px 0 12px rgba(15, 23, 42, 0.06);
  }
  body.connect-app .cx-table th.cx-table-actions {
    background: rgba(241, 245, 249, 0.98);
  }
  body.connect-app .cx-attr-form input {
    min-width: 0;
  }
  body.connect-app .cx-market-filters select,
  body.connect-app .cx-market-filters input,
  body.connect-app .cx-market-filters button {
    min-width: 0;
  }
}
.cx-onboard .is-current {
  font-weight: 800;
  color: var(--cx-accent-2);
}
.cx-grid a.cx-card {
  text-decoration: none;
  color: inherit;
}
body.connect-app .cx-card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
body.connect-app .cx-grid a.cx-card:hover {
  transform: translateY(-2px);
  border-color: rgba(14, 165, 233, 0.45);
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.12);
}
.wa-channel-chip {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
}

/* Lightweight Connect dialog (rename number, etc.) — desktop + mobile parity. */
.cx-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.cx-modal {
  width: min(26rem, 100%);
  max-height: min(90vh, 36rem);
  overflow: auto;
  margin: 0;
  padding: 1.25rem 1.35rem 1.35rem;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: #fff;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
  color: #0f172a;
  box-sizing: border-box;
}
.cx-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.35rem;
}
.cx-modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: #0f172a;
}
.cx-modal__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: -0.25rem -0.35rem 0 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #64748b;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}
.cx-modal__close:hover,
.cx-modal__close:focus-visible {
  background: rgba(148, 163, 184, 0.18);
  color: #0f172a;
  outline: none;
}
.cx-modal__lead {
  margin: 0 0 1rem;
  color: #64748b;
  font-size: 0.9rem;
  line-height: 1.45;
}
.cx-modal__lead .cx-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: #334155;
  word-break: break-all;
}
.cx-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.cx-modal__label {
  font-size: 0.82rem;
  font-weight: 650;
  color: #334155;
}
.cx-modal__form input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.55);
  background: #f8fafc;
  color: #0f172a;
  font: inherit;
  font-size: 0.95rem;
}
.cx-modal__form input[type="text"]:focus {
  outline: none;
  border-color: #0ea5e9;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}
.cx-modal__form input[aria-invalid="true"] {
  border-color: #f43f5e;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.15);
}
.cx-modal__error {
  margin: 0.15rem 0 0;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.35;
  color: #991b1b;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.35);
}
.cx-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 0.85rem;
}
body.connect-app .cx-btn.cx-btn-modal {
  padding: 0.65rem 1.15rem;
  font-size: 0.9rem;
  border-radius: 10px;
}
body.connect-app .cx-btn.cx-btn-ghost.cx-btn-modal {
  background: rgba(241, 245, 249, 0.95);
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.45);
}
body.connect-app .cx-btn.cx-btn-ghost.cx-btn-modal:hover,
body.connect-app .cx-btn.cx-btn-ghost.cx-btn-modal:focus-visible {
  background: #fff;
  color: #0f172a;
  border-color: rgba(100, 116, 139, 0.65);
}
@media (max-width: 640px) {
  .cx-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .cx-modal {
    width: 100%;
    max-height: min(92vh, 100%);
    border-radius: 18px 18px 0 0;
    padding: 1.15rem 1.1rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
  }
  .cx-modal__actions {
    flex-direction: column-reverse;
  }
  body.connect-app .cx-btn.cx-btn-modal {
    width: 100%;
  }
}
