:root {
  --bg-0: #06050c;
  --fg-0: #f7f5ff;
  --fg-mute: #8e88a9;
  --fg-dim: #5b5577;
  --rim: #fda4af;
  --bg-gradient:
    radial-gradient(85% 60% at 50% -10%, #1a1138 0%, transparent 70%),
    radial-gradient(60% 50% at 90% 100%, #2a1138 0%, transparent 70%),
    radial-gradient(50% 40% at 10% 90%, #142036 0%, transparent 70%);
}

/* Light mode — default. Toggled via `data-theme="dark"` on <html>. Variables
 * cover anything the landing / Eva chat consume; the dashboard already lives
 * inside `.db-root` which is opinionated about its own palette. */
:root[data-theme="light"], :root:not([data-theme]) {
  --bg-0: #f7f8fa;
  --fg-0: #0f172a;
  --fg-mute: #6a6f7e;
  --fg-dim: #9aa0ad;
  --rim: #6366f1;
  --bg-gradient:
    radial-gradient(80% 60% at 50% -10%, rgba(196, 181, 253, 0.20) 0%, transparent 60%),
    radial-gradient(50% 50% at 100% 100%, rgba(125, 211, 252, 0.16) 0%, transparent 65%),
    radial-gradient(50% 40% at 0% 90%, rgba(244, 114, 182, 0.10) 0%, transparent 70%);
  /* Build 223 — unified border palette. The dashboard's many panels
   * used to mix #e6e7ec / #ececf2 / #d8dbe4 / #eef0f4; sweep them
   * onto these variables so the entire app shares one card-border
   * tone. Existing literals stay until the next theme refresh. */
  --db-border:        #e6e7ec;   /* panel outlines */
  --db-border-soft:   #eef0f4;   /* row dividers, sub-grid */
  --db-border-strong: #d8dbe4;   /* form-control outline */
}
:root[data-theme="dark"] {
  --db-border:        #2a2f3e;
  --db-border-soft:   #1f2433;
  --db-border-strong: #353b4d;
}

* { box-sizing: border-box; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Respect prefers-reduced-motion — collapse all animations and transitions to
 * near-instant. The VoiceBlob has a JS-driven render loop; that's gated in
 * voice-blob.js separately. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
html, body, #root { margin: 0; padding: 0; height: 100%; overflow: hidden; }

body {
  background: var(--bg-gradient), var(--bg-0);
  color: var(--fg-0);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
  letter-spacing: -0.012em;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

button { border: 0; background: transparent; cursor: pointer; padding: 0; color: inherit; font: inherit; }

/* ── Material Symbols (build 230) ──────────────────────────────────────────
 * Single base rule for every Material Symbol the app renders. Loaded as a
 * Google Fonts variable font in index.html. Variation axes pinned here so
 * every icon picks up the same outlined, 400-weight, optical-size-20 look
 * regardless of which sidebar / page renders it.
 *
 * `font-variation-settings` is the modern way to drive Material Symbols —
 * the four axes are FILL (0=outline, 1=filled), wght (300-700 stroke),
 * GRAD (-50..200 emphasis), opsz (20..48 optical size). We pick a clean
 * outlined 400/0/20 default and let component-level overrides tune.
 * `user-select:none` so the icon ligature text never appears in a copy. */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined';
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'liga';
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
  user-select: none;
  -webkit-user-select: none;
  vertical-align: middle;
}
/* The wrapper component sets font-size inline; this guards width
 * from a stretched cap-height in flex layouts. */
.sxai-micon { flex-shrink: 0; }

/* ── stage ─────────────────────────────────────────────────────────────── */

.stage {
  /* Only mounted in call view now. Landing renders the orb inside .lp. */
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
}

/* the blob is the only interactive surface */
.blob-tap {
  appearance: none;
  background: transparent; border: 0;
  cursor: pointer;
  border-radius: 999px;
  position: relative;
  outline: none;
  transition: transform 0.5s cubic-bezier(.2, .9, .3, 1), filter 0.4s ease;
}
.blob-tap:active { transform: scale(0.985); }
.blob-tap:focus-visible::after {
  content: "";
  position: absolute; inset: -12px;
  border: 1px solid rgba(244, 114, 182, 0.4);
  border-radius: 999px;
}

/* ── voice blob component ──────────────────────────────────────────────── */

.vb-wrap {
  position: relative;
  display: block;
}
.vb-halo {
  position: absolute; inset: 0;
  border-radius: 50%;
  filter: blur(36px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.vb-svg, .vb-spark, .vb-waves {
  position: absolute; inset: 0;
  pointer-events: none;
}
.vb-spark { mix-blend-mode: screen; }
/* Light theme: screen-blend makes the violet motes wash into the cream bg.
 * Multiply lets the same canvas TINT the page underneath — sparks become
 * brand-violet pinpricks instead of vanishing. */
:root[data-theme="light"] .vb-spark,
:root:not([data-theme]) .vb-spark { mix-blend-mode: multiply; }
.vb-waves {
  /* The rings extend BEYOND the wrap's bounding box; we need overflow:visible
   * on the SVG itself (inline) AND no clipping on the container. Screen-blend
   * keeps them feeling like glowing light rather than opaque ink. */
  overflow: visible;
  mix-blend-mode: screen;
  /* A soft glow on the strokes themselves — feels like the rings are made
   * of light rather than lines drawn on glass. */
  filter: drop-shadow(0 0 6px rgba(244, 114, 182, 0.35));
}

/* ── brand splash (first-load only) ───────────────────────────────────── */

.brandsplash {
  position: fixed;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-0);
  z-index: 100;
  opacity: 1;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.brandsplash.gone { opacity: 0; }
.brandsplash .brandmark {
  /* Real SVG logo — white wordmark + red X. Aspect ratio ~5.5:1, so we set
   * height and let width auto-scale. Subtle glow makes it feel embedded in
   * the dark gradient rather than pasted on top. 2x'd to 60px — the splash
   * is a one-second moment that should land confidently before the orb
   * takes over the landing surface. */
  height: 60px; width: auto;
  display: block;
  opacity: 0;
  animation: bsfade 1.6s ease forwards;
  filter: drop-shadow(0 0 24px rgba(244, 114, 182, 0.22));
}
@keyframes bsfade {
  0%   { opacity: 0; transform: translateY(2px); }
  35%  { opacity: 1; transform: translateY(0); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(-2px); }
}

/* ── landing page — Apple-styled hero + CTA ───────────────────────────────
 *
 * The landing is a 3-row flex column that fills the viewport so the hero /
 * orb / CTA share the screen with predictable spacing at any aspect ratio.
 * Earlier we used absolute positioning for hero (top:14%) + cta (bottom:11%)
 * with the orb floating in the middle — at tall viewports the hero would
 * overflow into the orb and the bottom would stay empty. The flex layout
 * fixes that: each row gets its share, the orb sits in the middle row, and
 * the rows can't visually collide.
 */
.lp {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  /* Centred column with explicit gaps. The orb now lives INSIDE this flex
   * flow as a sibling between hero and cta — so it can never crash into
   * either. Used to be `space-between` with the orb absolutely positioned;
   * that left them touching on short / tall viewports depending on padding. */
  justify-content: center;
  align-items: center;
  gap: clamp(20px, 3.5vh, 40px);
  padding: clamp(48px, 7vh, 96px) 24px clamp(40px, 6vh, 80px);
  pointer-events: none;
  overflow: hidden;
}
.lp-orb {
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
  opacity: 0;
  animation: lpfadein 0.9s ease 0.3s forwards;
}

/* ─── Landing prompt composer ─────────────────────────────────────────────
 * The textarea + Submit/Mic row that replaced the voice-only orb hero.
 * Designed to look like an inviting first message — soft border, comfy
 * height, primary submit on the right, secondary mic on the left.
 * Width caps at 640px so the textarea doesn't sprawl on wide monitors. */
.lp-composer {
  pointer-events: auto;
  width: min(640px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e5e7ec;
  border-radius: 16px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 8px 24px rgba(15, 23, 42, 0.06);
  overflow: hidden;
  opacity: 0;
  animation: lpfadein 0.7s ease 0.18s forwards;
  transition: border-color 0.15s ease, box-shadow 0.18s ease;
}
.lp-composer:focus-within {
  border-color: #c2c7d4;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.05),
    0 10px 28px rgba(15, 23, 42, 0.10);
}
.lp-composer-input {
  width: 100%;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.5;
  color: #1a1a1a;
  padding: 16px 18px 6px;
  min-height: 96px;
}
.lp-composer-input::placeholder {
  color: #a3a8b8;
}
.lp-composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px 10px 14px;
  gap: 12px;
}
/* The Mic-instead button — secondary affordance, lives on the left.
   Subtle by default so it doesn't compete with Submit; activates a soft
   warm glow on hover so the path is still discoverable. */
.lp-composer-mic {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #5a606e;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px 6px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lp-composer-mic:hover {
  background: #fff4e0;
  border-color: #f3d88a;
  color: #9a5b00;
}
.lp-composer-mic svg { opacity: 0.9; }
/* Primary submit. Brand-coloured pill — clearly the "go" affordance. */
.lp-composer-submit {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: #ffffff;
  background: linear-gradient(135deg, #1f2937, #374151);
  border: 0;
  padding: 9px 16px 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.lp-composer-submit:hover {
  background: linear-gradient(135deg, #111827, #1f2937);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
}
.lp-composer-submit:active { transform: translateY(1px); }
.lp-composer-submit:disabled {
  background: #cdd1db;
  color: #ffffff;
  cursor: not-allowed;
  box-shadow: none;
}

/* ─── Starter-prompt chips ───────────────────────────────────────────────
 * Quick-pick suggestions under the composer. Click → opens the chat
 * surface with the prompt pre-filled as turn 1. Designed to look like
 * gentle "or try one of these" cards — not so loud they steal focus
 * from the composer above. */
/* ─── Industry preset selector ────────────────────────────────────────────
 * A compact "I'm building for [Any industry ▾]" row above the composer.
 * Picking an industry reskins the hero + presets the build's industry
 * context. Styled as an inline pill so it reads like a sentence, not a form. */
.lp-industry {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: -6px;
  opacity: 0;
  animation: lpfadein 0.7s ease 0.14s forwards;
}
.lp-industry-label {
  font-size: 13.5px;
  font-weight: 500;
  color: #6b7280;
  letter-spacing: 0.01em;
}
.lp-industry-field {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #e5e7ec;
  border-radius: 999px;
  padding: 5px 30px 5px 11px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.lp-industry-field:hover { border-color: #c2c7d4; }
.lp-industry-field:focus-within {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}
.lp-industry-emoji { font-size: 15px; line-height: 1; }
.lp-industry-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: #1f2937;
  background: transparent;
  border: 0;
  outline: none;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.lp-industry-chev {
  position: absolute;
  right: 11px;
  color: #9aa0ad;
  pointer-events: none;
}
:root[data-theme="dark"] .lp-industry-label { color: #9aa0ad; }
:root[data-theme="dark"] .lp-industry-field {
  background: #131722;
  border-color: #262b3a;
}
:root[data-theme="dark"] .lp-industry-field:hover { border-color: #3a4054; }
:root[data-theme="dark"] .lp-industry-select { color: #e7e9ee; }
:root[data-theme="dark"] .lp-industry-select option {
  background: #131722;
  color: #e7e9ee;
}

.lp-starters {
  pointer-events: auto;
  width: min(640px, calc(100vw - 48px));
  margin-top: -4px;
  opacity: 0;
  animation: lpfadein 0.7s ease 0.25s forwards;
}
.lp-starters-label {
  font-size: 12.5px;
  color: #8a8e9c;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}
.lp-starters-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.lp-starter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #e5e7ec;
  border-radius: 999px;
  padding: 6px 12px 6px 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
              transform 0.12s ease, box-shadow 0.15s ease;
}
.lp-starter-chip:hover {
  background: #f4f5f8;
  border-color: #c2c7d4;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.lp-starter-chip:active { transform: scale(0.97); }
.lp-starter-emoji {
  font-size: 14px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

:root[data-theme="dark"] .lp-starters-label { color: #8a8e9c; }
:root[data-theme="dark"] .lp-starter-chip {
  background: #131722;
  color: #e7e9ee;
  border-color: #262b3a;
}
:root[data-theme="dark"] .lp-starter-chip:hover {
  background: #1c2030;
  border-color: #3a4054;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* "Open your agents" tertiary link below the composer (returning users). */
.lp-altrow {
  pointer-events: auto;
  display: flex; justify-content: center;
  opacity: 0;
  animation: lpfadein 0.7s ease 0.32s forwards;
}
.lp-alt {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #4a5063;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.lp-alt:hover { color: #1a1a1a; background: rgba(15, 23, 42, 0.04); }

/* Dark-theme overrides for the composer + alt link. */
:root[data-theme="dark"] .lp-composer {
  background: #131722;
  border-color: #262b3a;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.5),
    0 10px 28px rgba(0, 0, 0, 0.35);
}
:root[data-theme="dark"] .lp-composer:focus-within {
  border-color: #404656;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.55),
    0 14px 36px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] .lp-composer-input { color: #e7e9ee; }
:root[data-theme="dark"] .lp-composer-input::placeholder { color: #6a6f7e; }
:root[data-theme="dark"] .lp-composer-mic { color: #b3b8c5; }
:root[data-theme="dark"] .lp-composer-mic:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f5c97a;
}
:root[data-theme="dark"] .lp-composer-submit {
  background: linear-gradient(135deg, #4a5063, #5b6173);
  color: #ffffff;
}
:root[data-theme="dark"] .lp-composer-submit:hover {
  background: linear-gradient(135deg, #5b6173, #6c7387);
}
:root[data-theme="dark"] .lp-composer-submit:disabled {
  background: #2a2e44; color: #6a6f7e;
}
:root[data-theme="dark"] .lp-alt { color: #b3b8c5; }
:root[data-theme="dark"] .lp-alt:hover { color: #f5f7fb; background: rgba(255, 255, 255, 0.04); }

/* ─── Landing chat view ──────────────────────────────────────────────────
 * Text-first build surface (LandingChatView). Mounts when the operator
 * submits a prompt on the landing composer. Looks and feels like a
 * modern AI chat product — header strip with connection state + voice
 * toggle, scrollable thread, composer pinned at the bottom. */
.lp-chat {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  /* Transparent so the home ambient art (LandingArt, rendered behind at
     z:1) + the page gradient show through around the centred chat card —
     the chat with Eva gets the exact same backdrop as the landing page.
     The card stack (head / thread / qcard / composer) stays opaque, so
     readability is unaffected; the art only fills the margins. */
  background: transparent;
  padding: clamp(48px, 7vh, 88px) 16px 16px;
  align-items: center;
  pointer-events: auto;
  animation: lp-chat-in 0.32s cubic-bezier(.2,.9,.3,1);
}
@keyframes lp-chat-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lp-chat-head {
  width: min(720px, calc(100vw - 32px));
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  background: #ffffff;
  border: 1px solid #e5e7ec;
  border-radius: 14px 14px 0 0;
  border-bottom: 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.lp-chat-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lp-chat-head-right { display: flex; align-items: center; gap: 6px; }
.lp-chat-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #c5c8d4;
  flex: 0 0 8px;
}
.lp-chat-dot-connecting { background: #f5b342; animation: lp-chat-pulse 1.2s ease infinite; }
.lp-chat-dot-ready      { background: #16a34a; }
.lp-chat-dot-error      { background: #dc2626; }
.lp-chat-dot-ended      { background: #c5c8d4; }
@keyframes lp-chat-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.lp-chat-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.005em;
}
.lp-chat-state {
  font-size: 12.5px;
  color: #7a7e88;
  margin-left: 4px;
}
.lp-chat-eta {
  font-size: 12px;
  color: #2563eb;
  margin-left: 4px;
  font-weight: 500;
}

/* Thin progress bar slotted between the header and the thread.
   Fills as the operator answers template questions. */
.lp-chat-progress {
  width: min(720px, calc(100vw - 32px));
  height: 3px;
  background: #e5e7ec;
  border-left: 1px solid #e5e7ec;
  border-right: 1px solid #e5e7ec;
  overflow: hidden;
}
.lp-chat-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #2563eb);
  border-radius: 0 2px 2px 0;
  transition: width 0.45s cubic-bezier(.2,.9,.3,1);
}
:root[data-theme="dark"] .lp-chat-progress {
  background: #1c2030; border-color: #262b3a;
}
:root[data-theme="dark"] .lp-chat-eta { color: #93c5fd; }

/* Confetti — pure-CSS sprites that drop from the top with a soft
   tumble. Mounted only when celebrate=true (~900ms), then unmounted
   along with the chat surface as the reveal animation kicks in. */
.lp-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
}
.lp-confetti-piece {
  position: absolute;
  top: -16px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.92;
  animation-name: lp-confetti-fall;
  animation-timing-function: cubic-bezier(.2,.7,.5,1);
  animation-fill-mode: forwards;
  transform-origin: center;
}
.lp-confetti-c0 { background: #f59e0b; }
.lp-confetti-c1 { background: #ef4444; }
.lp-confetti-c2 { background: #6366f1; }
.lp-confetti-c3 { background: #10b981; }
.lp-confetti-c4 { background: #ec4899; }
@keyframes lp-confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg);   opacity: 0; }
  10%  { opacity: 0.95; }
  100% { transform: translateY(72vh) rotate(540deg);  opacity: 0; }
}
.lp-chat-mic, .lp-chat-close {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: #5a606e;
  background: transparent;
  border: 1px solid transparent;
  padding: 6px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lp-chat-mic:hover {
  background: #fff4e0;
  border-color: #f3d88a;
  color: #9a5b00;
}
.lp-chat-close { padding: 6px 8px; }
.lp-chat-close:hover { background: rgba(15, 23, 42, 0.06); color: #1a1a1a; }

.lp-chat-thread {
  width: min(720px, calc(100vw - 32px));
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px;
  background: #ffffff;
  border-left: 1px solid #e5e7ec;
  border-right: 1px solid #e5e7ec;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.lp-chat-msg {
  display: flex;
  gap: 10px;
  max-width: 100%;
}
.lp-chat-msg-eva { justify-content: flex-start; }
.lp-chat-msg-user { justify-content: flex-end; }
.lp-chat-msg-system { justify-content: center; }
.lp-chat-avatar {
  width: 28px; height: 28px;
  flex: 0 0 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8a3d, #ff5b8a);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: 0;
  margin-top: 2px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}
.lp-chat-bubble {
  font-size: 14.5px;
  line-height: 1.55;
  padding: 10px 14px;
  border-radius: 14px;
  max-width: 540px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.lp-chat-msg-eva .lp-chat-bubble {
  background: #f4f5f8;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
}
.lp-chat-msg-user .lp-chat-bubble {
  background: linear-gradient(135deg, #1f2937, #374151);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.lp-chat-msg-system .lp-chat-bubble {
  background: #fff4f4;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 13px;
  max-width: 480px;
}
.lp-chat-caret {
  display: inline-block;
  margin-left: 2px;
  color: rgba(15, 23, 42, 0.45);
  animation: lp-chat-caret-blink 1s steps(2) infinite;
}
@keyframes lp-chat-caret-blink {
  to { opacity: 0; }
}

/* "Eva is thinking…" typing indicator — three pulsing dots. */
.lp-chat-msg-typing .lp-chat-bubble {
  background: #f4f5f8;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lp-chat-typing-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #9aa0ad;
  animation: lp-chat-typing 1.2s ease infinite;
}
.lp-chat-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.lp-chat-typing-dot:nth-child(3) { animation-delay: 0.30s; }
@keyframes lp-chat-typing {
  0%, 60%, 100% { transform: scale(1);   opacity: 0.45; }
  30%          { transform: scale(1.4); opacity: 1;    }
}

/* ─── Question card (template-driven, structured) ────────────────────────
 * Surfaces above the composer whenever a template_question event is
 * pending. Matches the screenshot reference: blue-tinted banner row,
 * white card body with progress + prompt + chips, soft outline. */
.lp-chat-qcard {
  width: min(720px, calc(100vw - 32px));
  background: #ffffff;
  border: 1px solid #c8dbff;
  border-left-width: 2px;
  border-right-width: 2px;
  border-top: 0;
  margin-top: -1px;        /* tuck under the thread's bottom border */
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}
.lp-chat-qcard-banner {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: #eef4ff;
  color: #1e4ed8;
  font-size: 13.5px;
  font-weight: 600;
  border-bottom: 1px solid #d6e3ff;
}
.lp-chat-qcard-banner-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #ffffff;
  color: #2563eb;
  border-radius: 50%;
  border: 1px solid #c8dbff;
  flex: 0 0 22px;
}
.lp-chat-qcard-body {
  padding: 14px 18px 16px;
  background: #f7f8fa;
}
.lp-chat-qcard-progress {
  font-size: 13.5px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.lp-chat-qcard-prompt {
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
}
.lp-chat-qcard-hint {
  margin-top: 4px;
  font-size: 12.5px;
  color: #6a6f7e;
  line-height: 1.45;
}
.lp-chat-qcard-chips {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}
.lp-chat-qcard-chip {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #d6dae3;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
              box-shadow 0.15s ease, transform 0.12s ease;
}
.lp-chat-qcard-chip:hover {
  background: #eef4ff;
  border-color: #2563eb;
  color: #1e4ed8;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.12);
}
.lp-chat-qcard-chip:active { transform: scale(0.96); }
/* Locked state — after the operator clicks one chip, all chips dim
   so subsequent clicks are visibly inert. Cursor stays default (not
   not-allowed) to avoid a jarring red ⊘ for what's just a brief
   in-flight pause. */
.lp-chat-qcard-chip:disabled,
.lp-chat-qcard-chip-locked {
  background: #f4f5f8;
  color: #a3a8b8;
  border-color: #e5e7ec;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}
/* Primary chip — the seeded suggestion (e.g. agent_name PROPOSE NAME).
   Reads as "this is the recommended pick" without being a hard CTA. */
.lp-chat-qcard-chip-primary {
  background: #1f2937;
  color: #ffffff;
  border-color: #1f2937;
}
.lp-chat-qcard-chip-primary:hover {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
}

/* Waiting indicator strip — when QuestionCard renders showWaiting=true
   it appears inside the card footer, not as a separate element.
   Standalone class kept for backwards-compat. */
.lp-chat-waiting,
.lp-chat-qcard-waiting {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: #eef4ff;
  border-top: 1px solid #c8dbff;
  font-size: 12.5px;
  font-weight: 500;
  color: #1e4ed8;
}
.lp-chat-waiting {
  width: min(720px, calc(100vw - 32px));
  border: 1px solid #c8dbff;
  border-top: 0;
}
.lp-chat-waiting-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2563eb;
  animation: lp-chat-pulse 1.2s ease infinite;
}

/* Validation error banner — sits inside the card body, between the
   prompt/hint and the chip row. Soft red so it reads as "try again"
   rather than "fatal", with a small icon for at-a-glance recognition. */
.lp-chat-qcard-error {
  display: flex; align-items: center; gap: 6px;
  margin-top: 10px;
  padding: 8px 12px;
  background: #fff4f4;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 12.5px;
  line-height: 1.45;
  animation: lp-chat-qcard-shake 0.32s cubic-bezier(.36,.07,.19,.97);
}
.lp-chat-qcard-error svg { flex: 0 0 13px; }
@keyframes lp-chat-qcard-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-3px); }
  40%, 60% { transform: translateX(3px); }
}

/* Skip row — pinned below the chips on optional questions. Ghost
   link styling so it doesn't compete with the primary chips for
   attention, but still clearly clickable. */
.lp-chat-qcard-skiprow {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}
.lp-chat-qcard-skip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: #6a6f7e;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.lp-chat-qcard-skip:hover { color: #1a1a1a; background: rgba(15, 23, 42, 0.05); }

/* Compact variant — used when the card overlays inside the call
   view (between captions and the type rail). Tighter padding,
   smaller fonts, fixed max-width centred over the call chrome. */
.lp-chat-qcard-compact {
  width: min(560px, calc(100vw - 32px));
  border-radius: 14px;
  border: 1px solid #c8dbff;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.14);
}
.lp-chat-qcard-compact .lp-chat-qcard-banner {
  padding: 8px 14px;
  font-size: 12.5px;
}
.lp-chat-qcard-compact .lp-chat-qcard-body { padding: 12px 14px 14px; }
.lp-chat-qcard-compact .lp-chat-qcard-progress { font-size: 12px; }
.lp-chat-qcard-compact .lp-chat-qcard-prompt { font-size: 14px; }
.lp-chat-qcard-compact .lp-chat-qcard-hint { font-size: 11.5px; }
.lp-chat-qcard-compact .lp-chat-qcard-chip { padding: 5px 10px; font-size: 12.5px; }

/* Call-view overlay positioner. Centres the compact card horizontally
   above the type rail, semi-transparent backdrop so the orb behind it
   stays visible. */
.callchrome-qcard {
  position: fixed;
  left: 50%;
  bottom: 140px;
  transform: translateX(-50%);
  z-index: 7;
  pointer-events: auto;
  animation: lp-chat-in 0.28s cubic-bezier(.2,.9,.3,1);
}

:root[data-theme="dark"] .lp-chat-qcard-error {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(220, 38, 38, 0.35);
  color: #fca5a5;
}
:root[data-theme="dark"] .lp-chat-qcard-skip { color: #b3b8c5; }
:root[data-theme="dark"] .lp-chat-qcard-skip:hover { color: #f5f7fb; background: rgba(255, 255, 255, 0.06); }
:root[data-theme="dark"] .lp-chat-qcard-compact { border-color: rgba(96, 165, 250, 0.30); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45); }
:root[data-theme="dark"] .lp-chat-waiting,
:root[data-theme="dark"] .lp-chat-qcard-waiting {
  background: rgba(59, 130, 246, 0.10);
  border-top-color: rgba(96, 165, 250, 0.30);
  color: #93c5fd;
}

/* Dark-theme card. */
:root[data-theme="dark"] .lp-chat-qcard {
  background: #131722;
  border-color: rgba(96, 165, 250, 0.35);
}
:root[data-theme="dark"] .lp-chat-qcard-banner {
  background: rgba(59, 130, 246, 0.12);
  color: #93c5fd;
  border-bottom-color: rgba(96, 165, 250, 0.30);
}
:root[data-theme="dark"] .lp-chat-qcard-banner-icon {
  background: #131722;
  color: #60a5fa;
  border-color: rgba(96, 165, 250, 0.35);
}
:root[data-theme="dark"] .lp-chat-qcard-body { background: #1a1f2e; }
:root[data-theme="dark"] .lp-chat-qcard-progress { color: #e7e9ee; }
:root[data-theme="dark"] .lp-chat-qcard-prompt { color: #e7e9ee; }
:root[data-theme="dark"] .lp-chat-qcard-hint { color: #8a8e9c; }
:root[data-theme="dark"] .lp-chat-qcard-chip {
  background: #1c2030;
  color: #e7e9ee;
  border-color: #2c3349;
}
:root[data-theme="dark"] .lp-chat-qcard-chip:hover {
  background: rgba(59, 130, 246, 0.18);
  border-color: #60a5fa;
  color: #dbeafe;
  box-shadow: none;
}
:root[data-theme="dark"] .lp-chat-qcard-chip-primary {
  background: #e7e9ee;
  color: #131722;
  border-color: #e7e9ee;
}
:root[data-theme="dark"] .lp-chat-qcard-chip-primary:hover {
  background: #ffffff;
  color: #0b0d14;
  border-color: #ffffff;
}
:root[data-theme="dark"] .lp-chat-waiting {
  background: rgba(59, 130, 246, 0.10);
  border-color: rgba(96, 165, 250, 0.30);
  color: #93c5fd;
}
:root[data-theme="dark"] .lp-chat-waiting-dot { background: #60a5fa; }

.lp-chat-composer {
  width: min(720px, calc(100vw - 32px));
  display: flex; align-items: flex-end; gap: 8px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #e5e7ec;
  border-top: 0;
  border-radius: 0 0 14px 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px rgba(15, 23, 42, 0.06);
}
.lp-chat-composer-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: #1a1a1a;
  max-height: 180px;
  padding: 6px 4px;
}
.lp-chat-composer-input::placeholder { color: #a3a8b8; }
.lp-chat-composer-input:disabled { color: #a3a8b8; }
.lp-chat-composer-submit {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1f2937, #374151);
  color: #ffffff;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease;
  flex: 0 0 40px;
}
.lp-chat-composer-submit:hover { background: linear-gradient(135deg, #111827, #1f2937); }
.lp-chat-composer-submit:active { transform: scale(0.95); }
.lp-chat-composer-submit:disabled {
  background: #cdd1db; cursor: not-allowed; transform: none;
}

/* Dark-theme chat surface. */
:root[data-theme="dark"] .lp-chat-head,
:root[data-theme="dark"] .lp-chat-thread,
:root[data-theme="dark"] .lp-chat-composer {
  background: #131722;
  border-color: #262b3a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.45), 0 10px 28px rgba(0,0,0,0.35);
}
:root[data-theme="dark"] .lp-chat-title { color: #e7e9ee; }
:root[data-theme="dark"] .lp-chat-state { color: #8a8e9c; }
:root[data-theme="dark"] .lp-chat-mic,
:root[data-theme="dark"] .lp-chat-close { color: #b3b8c5; }
:root[data-theme="dark"] .lp-chat-mic:hover {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.35);
  color: #f5c97a;
}
:root[data-theme="dark"] .lp-chat-close:hover {
  background: rgba(255, 255, 255, 0.06); color: #f5f7fb;
}
:root[data-theme="dark"] .lp-chat-msg-eva .lp-chat-bubble {
  background: #1c2030; color: #e7e9ee;
}
:root[data-theme="dark"] .lp-chat-msg-user .lp-chat-bubble {
  background: linear-gradient(135deg, #4a5063, #5b6173);
}
:root[data-theme="dark"] .lp-chat-msg-system .lp-chat-bubble {
  background: rgba(220, 38, 38, 0.12); color: #fca5a5; border-color: rgba(220, 38, 38, 0.35);
}
:root[data-theme="dark"] .lp-chat-composer-input { color: #e7e9ee; }
:root[data-theme="dark"] .lp-chat-composer-input::placeholder { color: #6a6f7e; }
:root[data-theme="dark"] .lp-chat-composer-submit:disabled { background: #2a2e44; color: #6a6f7e; }

/* ─────────────────────────────────────────────────────────────────────────
 * EmbedView — the minimal call surface served at /embed/<slug>, loaded
 * inside an iframe via /static/embed.js. No brandbar, no nav, no landing
 * art — just orb + agent name + CTA + tiny "powered by" footer. The frame
 * background matches the host site's surrounding chrome from the iframe
 * (#0f1119 default, with the orb being the visual centerpiece).
 * ───────────────────────────────────────────────────────────────────────── */
.embed-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 22px 18px;
  background:
    radial-gradient(75% 60% at 50% 30%, rgba(196, 181, 253, 0.16) 0%, transparent 65%),
    var(--bg-0);
  text-align: center;
  overflow: hidden;
}
.embed-orb {
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.embed-meta { display: flex; flex-direction: column; gap: 4px; }
.embed-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--fg-0);
}
.embed-sub {
  font-size: 13px;
  color: var(--fg-mute);
  max-width: 280px;
  line-height: 1.45;
}
.embed-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(168, 85, 247, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}
.embed-cta:hover { transform: translateY(-1px); filter: brightness(1.05); }
.embed-cta:active { transform: translateY(0.5px); }
.embed-brand {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--fg-dim);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.embed-brand:hover { color: var(--fg-mute); }
.embed-loading,
.embed-err {
  position: fixed;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  color: var(--fg-mute);
  background: var(--bg-0);
}
.embed-err { color: #fb7185; }

/* ─────────────────────────────────────────────────────────────────────────
 * Go-live page — side-by-side channels (embed left, phone number right).
 * Both panels are equal-height so the preview iframe lines up with the
 * phone-number form. Stacks on narrow viewports.
 * ───────────────────────────────────────────────────────────────────────── */
.db-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 820px) { .db-channels { grid-template-columns: 1fr; } }
.db-panel-tall {
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Grid children default to min-content sizing — let them shrink so 1fr
   * columns can actually be equal, snippet block respects overflow-x. */
  min-width: 0;
}
.db-channel-head {
  display: flex; align-items: flex-start; gap: 12px;
}
.db-channel-head svg { color: #6366f1; flex: 0 0 22px; margin-top: 2px; }
.db-channel-head .db-panel-title { margin: 0; }
.db-channel-head .db-panel-sub { margin: 4px 0 0; }

/* ─── Singular Phone-number flow (build 253) ──────────────────────────────
 * Two-mode picker → selected-mode content. No parallel panels. The picker
 * tiles are stacked vertically (one decision per row); the back-link in
 * the header is the only way to return to the picker once a mode is
 * chosen — operator's explicit click is needed to switch, page state
 * doesn't reset on auto-refetch. */
.golive-mode-back {
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: #6366f1; background: transparent;
  border: 1px solid transparent; border-radius: 8px;
  padding: 4px 10px; cursor: pointer;
  align-self: center;
  white-space: nowrap;
}
.golive-mode-back:hover { background: #eef2ff; border-color: #c7d2fe; }

.golive-mode-picker {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 14px;
}
.golive-mode-option {
  display: flex; align-items: center; gap: 14px;
  width: 100%;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.06s ease;
}
.golive-mode-option:hover {
  border-color: #a5b4fc;
  background: #f8faff;
}
.golive-mode-option:active { transform: translateY(1px); }
.golive-mode-icon {
  flex: 0 0 44px;
  width: 44px; height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
  color: #6366f1;
  display: inline-flex; align-items: center; justify-content: center;
}
.golive-mode-body { flex: 1; min-width: 0; }
.golive-mode-title {
  font-size: 14.5px; font-weight: 650; color: #1f2230;
  margin-bottom: 2px;
}
.golive-mode-sub {
  font-size: 12.5px; line-height: 1.45; color: #6a6f7d;
}
.golive-mode-go {
  flex: 0 0 24px; color: #9ca3af;
  font-size: 18px; font-weight: 400;
}
.golive-mode-option:hover .golive-mode-go { color: #6366f1; }

/* Selected-mode body — drops the inner card chrome since the outer
 * phoneCard already owns the box. Just give it some breathing room
 * from the header. */
.golive-mode-content { margin-top: 18px; display: flex; flex-direction: column; gap: 18px; }
.golive-mode-content > .db-panel,
.golive-mode-content > .tel-card,
.golive-mode-content > .sip-card,
.golive-mode-content > .managed-fallback {
  border: 1px solid #eef0f4;
  box-shadow: none;
}

/* Dark mode */
:root[data-theme="dark"] .golive-mode-option {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.10);
}
:root[data-theme="dark"] .golive-mode-option:hover {
  background: rgba(99,102,241,0.10);
  border-color: rgba(165,180,252,0.40);
}
:root[data-theme="dark"] .golive-mode-icon {
  background: linear-gradient(135deg, rgba(99,102,241,0.15) 0%, rgba(168,85,247,0.10) 100%);
  color: #a5b4fc;
}
:root[data-theme="dark"] .golive-mode-title { color: #e8e9ef; }
:root[data-theme="dark"] .golive-mode-sub { color: #a4a8b8; }
:root[data-theme="dark"] .golive-mode-back:hover { background: rgba(99,102,241,0.15); border-color: rgba(165,180,252,0.40); }

.db-embed-preview-wrap {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.db-embed-preview {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  background: #0f1119;
  border: 1px solid #e6e7ec;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
.db-embed-iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
.db-embed-caption {
  font-size: 11.5px;
  color: #6a6a6a;
}

.db-embed-snippet {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f6f8;
  border: 1px solid #e6e7ec;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 11.5px;
  color: #1a1a1a;
  overflow-x: auto;
  white-space: nowrap;
}
.db-embed-snippet code { background: transparent; padding: 0; }

/* ── Embed customisation controls ── */
.db-embed-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 18px;
  padding: 14px 16px;
  background: #fafbfd;
  border: 1px solid #e6e8ef;
  border-radius: 10px;
}
.db-embed-control { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.db-embed-control-label {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7080;
}
.db-embed-segment {
  display: inline-flex;
  background: #fff;
  border: 1px solid #d8dbe4;
  border-radius: 8px;
  padding: 2px;
}
.db-embed-seg-btn {
  flex: 1;
  background: transparent;
  border: 0;
  font: inherit; font-size: 12.5px;
  color: #4b5263;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.db-embed-seg-btn:hover { color: #1a1d2b; }
.db-embed-seg-btn.active { background: #1a1d2b; color: #fff; font-weight: 600; }

.db-embed-input {
  width: 100%;
  background: #fff;
  border: 1px solid #d8dbe4;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit; font-size: 13px;
  color: #1a1d2b;
  box-sizing: border-box;
}
.db-embed-input:focus { outline: 0; border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18); }

.db-embed-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.db-embed-swatch {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px #d8dbe4;
  cursor: pointer;
  padding: 0;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
}
.db-embed-swatch:hover { transform: scale(1.08); }
.db-embed-swatch.active { box-shadow: 0 0 0 2px #1a1d2b; }
.db-embed-swatch-custom {
  position: relative;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 1px dashed #aab1c0;
  background: #fff;
  color: #6b7080;
  font-size: 14px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  overflow: hidden;
}
.db-embed-swatch-custom input[type="color"] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
  border: 0; padding: 0;
}

:root[data-theme="dark"] .db-embed-controls { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-embed-control-label { color: #8a91a4; }
:root[data-theme="dark"] .db-embed-segment { background: #1b1f33; border-color: #2a2e44; }
:root[data-theme="dark"] .db-embed-seg-btn { color: #b4b9c7; }
:root[data-theme="dark"] .db-embed-seg-btn:hover { color: #e7e9ee; }
:root[data-theme="dark"] .db-embed-seg-btn.active { background: #e7e9ee; color: #15182a; }
:root[data-theme="dark"] .db-embed-input { background: #1b1f33; border-color: #2a2e44; color: #e7e9ee; }
:root[data-theme="dark"] .db-embed-swatch { border-color: #15182a; box-shadow: 0 0 0 1px #2a2e44; }
:root[data-theme="dark"] .db-embed-swatch.active { box-shadow: 0 0 0 2px #e7e9ee; }
:root[data-theme="dark"] .db-embed-swatch-custom { background: #1b1f33; border-color: #3a3f52; color: #8a91a4; }

/* ── Business profile accordions ── */
.db-profile-accords {
  display: flex; flex-direction: column;
  gap: 10px;
}
.db-accord {
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  overflow: hidden;
}
.db-accord-head {
  list-style: none;
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px;
  cursor: pointer;
  user-select: none;
}
.db-accord-head::-webkit-details-marker { display: none; }
.db-accord-title {
  font-size: 14.5px; font-weight: 600;
  color: #1a1d2b;
  flex: 1; min-width: 0;
  letter-spacing: -0.005em;
}
.db-accord-pill {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em;
  color: #6b7080;
  background: #f3f4f8;
  border: 1px solid #e6e8ef;
  padding: 2px 8px;
  border-radius: 99px;
  white-space: nowrap;
}
.db-accord-chev {
  color: #6b7080;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
.db-accord[open] > .db-accord-head .db-accord-chev { transform: rotate(180deg); }
.db-accord[open] > .db-accord-head { border-bottom: 1px solid #eef0f5; }
.db-accord-body { padding: 16px 18px 20px; }
.db-accord-sub {
  font-size: 13px;
  color: #6b7080;
  line-height: 1.5;
  margin: 0 0 14px;
}
.db-accord-sub .db-link-btn,
.db-link-btn {
  font: inherit; background: transparent; border: 0; padding: 0;
  color: #1a1d2b; text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.db-link-btn:hover { color: #000; }

.db-accord:hover { border-color: #d8dbe4; }
.db-accord[open] { border-color: #d8dbe4; }

:root[data-theme="dark"] .db-accord { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-accord:hover { border-color: #3a3f52; }
:root[data-theme="dark"] .db-accord[open] { border-color: #3a3f52; }
:root[data-theme="dark"] .db-accord-title { color: #e7e9ee; }
:root[data-theme="dark"] .db-accord-pill { background: #1b1f33; border-color: #2a2e44; color: #8a91a4; }
:root[data-theme="dark"] .db-accord-chev { color: #8a91a4; }
:root[data-theme="dark"] .db-accord[open] > .db-accord-head { border-bottom-color: #2a2e44; }
:root[data-theme="dark"] .db-accord-sub { color: #8a91a4; }
:root[data-theme="dark"] .db-link-btn { color: #e7e9ee; }

/* ── Beta tag — used on shipped-but-not-promised features so users don't
 * judge quality unfairly. Warm amber to read as "early access". ── */
.db-beta-tag {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  padding: 1px 7px;
  border-radius: 99px;
}
:root[data-theme="dark"] .db-beta-tag {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(252, 211, 77, 0.30);
}
.db-btn-primary.is-copied {
  background: #10b981;
}

/* Dark-mode tuning for the channel panels */
:root[data-theme="dark"] .db-channel-head svg { color: #a78bfa; }
:root[data-theme="dark"] .db-embed-preview {
  border-color: #1f2230;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}
:root[data-theme="dark"] .db-embed-caption { color: #8a8a8a; }
:root[data-theme="dark"] .db-embed-snippet {
  background: #14171f;
  border-color: #2a2d3c;
  color: #cbd5e1;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Billing — plan cards grid, toast, current-plan progress.
 * ───────────────────────────────────────────────────────────────────────── */
.billing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.billing-card {
  position: relative;
  display: flex; flex-direction: column;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 14px;
  padding: 22px 20px 20px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.billing-card:hover {
  border-color: #c5c8d4;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}
.billing-card-featured {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1 inset, 0 12px 28px rgba(99, 102, 241, 0.10);
}
.billing-card-current { border-color: #10b981; box-shadow: 0 0 0 1px #10b981 inset; }
.billing-card-flag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #ffffff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.billing-card-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6a6f7e;
  margin-bottom: 8px;
}
.billing-card-price { display: flex; align-items: baseline; gap: 4px; }
.billing-card-amount {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: #1a1a1a;
}
.billing-card-period { font-size: 13px; color: #6a6f7e; }
.billing-card-tagline {
  font-size: 13px;
  color: #4a4a4a;
  margin: 12px 0 14px;
  min-height: 36px;
  line-height: 1.5;
}
.billing-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 18px;
  display: flex; flex-direction: column;
  gap: 7px;
  flex: 1;
}
.billing-card-features li {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px;
  color: #2a2a2a;
  line-height: 1.45;
}
.billing-card-tick {
  flex: 0 0 16px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #047857;
  font-size: 10px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.billing-card-cta {
  width: 100%;
  justify-content: center;
  margin-top: auto;
}
.billing-card-cta-current {
  background: #ecfdf5 !important;
  color: #047857 !important;
  box-shadow: none !important;
  cursor: default !important;
}

.billing-toast {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}
.billing-toast-ok  { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.billing-toast-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

/* Dark-mode plan cards */
:root[data-theme="dark"] .billing-card {
  background: #14171f;
  border-color: #1f2230;
}
:root[data-theme="dark"] .billing-card:hover {
  border-color: #3a3f52;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}
:root[data-theme="dark"] .billing-card-featured {
  border-color: #6366f1;
  box-shadow: 0 0 0 1px #6366f1 inset, 0 12px 28px rgba(99, 102, 241, 0.22);
}
:root[data-theme="dark"] .billing-card-current { border-color: #10b981; box-shadow: 0 0 0 1px #10b981 inset; }
:root[data-theme="dark"] .billing-card-label { color: #9aa0ad; }
:root[data-theme="dark"] .billing-card-amount { color: #f5f7fb; }
:root[data-theme="dark"] .billing-card-period { color: #9aa0ad; }
:root[data-theme="dark"] .billing-card-tagline { color: #b4b9c7; }
:root[data-theme="dark"] .billing-card-features li { color: #cbd5e1; }
:root[data-theme="dark"] .billing-card-tick {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}
:root[data-theme="dark"] .billing-card-cta-current {
  background: rgba(16, 185, 129, 0.18) !important;
  color: #6ee7b7 !important;
}
:root[data-theme="dark"] .billing-toast-ok  { background: rgba(16, 185, 129, 0.14); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.3); }
:root[data-theme="dark"] .billing-toast-err { background: rgba(248, 113, 113, 0.14); color: #fca5a5; border-color: rgba(248, 113, 113, 0.3); }

/* ─────────────────────────────────────────────────────────────────────────
 * Onboarding banner — appears on the overview when an agent is <24h old
 * and has zero calls. Subtle glow card with three numbered steps + dismiss.
 * Stored per-agent in localStorage as `sxai.onboarded.<id>`.
 * ───────────────────────────────────────────────────────────────────────── */
.db-onboard {
  position: relative;
  display: flex; gap: 14px;
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.07), rgba(236, 72, 153, 0.05));
  border: 1px solid rgba(99, 102, 241, 0.22);
  overflow: hidden;
}
.db-onboard-glow {
  position: absolute;
  inset: -40px;
  background: radial-gradient(40% 60% at 0% 50%, rgba(168, 85, 247, 0.18), transparent 70%);
  pointer-events: none;
  filter: blur(20px);
}
.db-onboard-body {
  position: relative;
  display: flex; flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.db-onboard-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6366f1;
}
.db-onboard-spark { font-size: 12px; }
.db-onboard-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: #1a1a1a;
}
.db-onboard-steps {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex; flex-direction: column;
  gap: 8px;
}
.db-onboard-steps li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(4px);
}
.db-onboard-num {
  flex: 0 0 26px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1a1a1a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 999px;
}
.db-onboard-steps li > div { flex: 1; min-width: 0; }
.db-onboard-step-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.005em;
}
.db-onboard-step-sub {
  font-size: 12.5px;
  color: #6a6f7e;
  margin-top: 2px;
  line-height: 1.4;
}
.db-onboard-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: #6a6f7e;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  z-index: 1;
}
.db-onboard-close:hover { background: rgba(15, 23, 42, 0.06); color: #1a1a1a; }

/* "New" badge on freshly-built agent cards (< 1h old) */
.db-card-fresh {
  display: inline-flex; align-items: center;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #10b981, #06b6d4);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: 2px;
}

/* Dark-mode tuning */
:root[data-theme="dark"] .db-onboard {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(236, 72, 153, 0.08));
  border-color: rgba(99, 102, 241, 0.35);
}
:root[data-theme="dark"] .db-onboard-eyebrow { color: #a5b4fc; }
:root[data-theme="dark"] .db-onboard-title { color: #f5f7fb; }
:root[data-theme="dark"] .db-onboard-steps li {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .db-onboard-num { background: #ffffff; color: #1a1a1a; }
:root[data-theme="dark"] .db-onboard-step-title { color: #f5f7fb; }
:root[data-theme="dark"] .db-onboard-step-sub { color: #9aa0ad; }
:root[data-theme="dark"] .db-onboard-close { color: #b4b9c7; }
:root[data-theme="dark"] .db-onboard-close:hover { background: rgba(255, 255, 255, 0.07); color: #f5f7fb; }

/* ─────────────────────────────────────────────────────────────────────────
 * Recent activity preview on the overview — slim 3-row list, links to the
 * full call log. Empty state nudges to the test call.
 * ───────────────────────────────────────────────────────────────────────── */
.db-recent-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column;
  gap: 6px;
}
.db-recent-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fafbfd;
  border: 1px solid #f0f0f3;
}
.db-recent-summary {
  font-size: 13px;
  color: #1a1a1a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.db-recent-meta {
  font-size: 12px;
  color: #6a6f7e;
  font-variant-numeric: tabular-nums;
}
.db-recent-empty {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  background: #fafbfd;
  border: 1px dashed #d8dae3;
  border-radius: 10px;
  flex-wrap: wrap;
}
.db-recent-empty-sub { font-size: 13px; color: #4a4a4a; flex: 1; min-width: 0; }

:root[data-theme="dark"] .db-recent-item {
  background: #0f1119;
  border-color: #1f2230;
}
:root[data-theme="dark"] .db-recent-summary { color: #e7e9ee; }
:root[data-theme="dark"] .db-recent-meta { color: #9aa0ad; }
:root[data-theme="dark"] .db-recent-empty {
  background: #0f1119;
  border-color: #2a2d3c;
}
:root[data-theme="dark"] .db-recent-empty-sub { color: #b4b9c7; }

/* ─────────────────────────────────────────────────────────────────────────
 * Guardrails — rule rows with on/off toggles. Three sections share styling:
 * always-on defaults (shield icon + "Locked" tag), do's, don'ts.
 * ───────────────────────────────────────────────────────────────────────── */
.db-guardrails-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.db-guardrails-cols > .db-panel { margin: 0; }
@media (max-width: 1080px) {
  .db-guardrails-cols { grid-template-columns: 1fr; }
}

.db-rules {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex; flex-direction: column;
  gap: 6px;
}
.db-rules li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fafbfd;
  border: 1px solid #f0f0f3;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.db-rules li.is-on {
  background: #eff6ff;
  border-color: #dbeafe;
}
.db-rules-locked li {
  background: rgba(16, 185, 129, 0.06);
  border-color: rgba(16, 185, 129, 0.18);
}
.db-rule-body { min-width: 0; }
.db-rule-label {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a1a1a;
  letter-spacing: -0.005em;
}
.db-rule-help {
  font-size: 12.5px;
  color: #6a6f7e;
  margin-top: 3px;
  line-height: 1.45;
}
.db-rule-tick {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.16);
  font-size: 16px;
}
.db-rule-locked {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #047857;
  background: rgba(16, 185, 129, 0.16);
  padding: 4px 9px;
  border-radius: 999px;
  align-self: center;
}

/* iOS-style toggle */
.db-rule-toggle {
  width: 40px; height: 24px;
  border-radius: 999px;
  background: #d8dae3;
  border: 0;
  cursor: pointer;
  padding: 0;
  position: relative;
  transition: background 0.18s ease;
  flex: 0 0 40px;
  align-self: center;
}
.db-rule-toggle .db-rule-toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease;
}
.db-rules li.is-on .db-rule-toggle { background: #3b82f6; }
.db-rules li.is-on .db-rule-toggle .db-rule-toggle-thumb { transform: translateX(16px); }
.db-rule-toggle:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.55);
  outline-offset: 3px;
}

/* Dark-mode guardrails */
:root[data-theme="dark"] .db-rules li {
  background: #0f1119;
  border-color: #1f2230;
}
:root[data-theme="dark"] .db-rules li.is-on {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.30);
}
:root[data-theme="dark"] .db-rules-locked li {
  background: rgba(16, 185, 129, 0.10);
  border-color: rgba(16, 185, 129, 0.30);
}
:root[data-theme="dark"] .db-rule-label { color: #f5f7fb; }
:root[data-theme="dark"] .db-rule-help { color: #9aa0ad; }
:root[data-theme="dark"] .db-rule-tick {
  background: rgba(16, 185, 129, 0.22);
}
:root[data-theme="dark"] .db-rule-locked {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.20);
}
:root[data-theme="dark"] .db-rule-toggle { background: #2a2d3c; }
:root[data-theme="dark"] .db-rule-toggle .db-rule-toggle-thumb { background: #cbd5e1; }
:root[data-theme="dark"] .db-rules li.is-on .db-rule-toggle { background: #4d83ff; }
:root[data-theme="dark"] .db-rules li.is-on .db-rule-toggle .db-rule-toggle-thumb { background: #ffffff; }

/* ─────────────────────────────────────────────────────────────────────────
 * CookieNotice — landing-only consent banner. Region-aware copy keyed off
 * the detected locale.country. Renders fixed bottom-centre, slides up on
 * mount, persists choice in localStorage so it never reappears in-session.
 * ───────────────────────────────────────────────────────────────────────── */
.cookie-notice {
  position: fixed;
  left: 50%;
  bottom: 0;                       /* flush-anchored to the screen bottom */
  transform: translateX(-50%);
  z-index: 8;
  display: flex; align-items: center; gap: 14px;
  width: min(680px, 100vw);
  padding: 8px 10px 8px 16px;
  border-radius: 12px 12px 0 0;    /* rounded top only — it sits on the edge */
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #e6e7ec;
  border-bottom: 0;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.07);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: inherit;
  animation: cookie-rise 0.4s cubic-bezier(.2,.9,.3,1) 0.6s both;
}
@keyframes cookie-rise {
  from { opacity: 0; transform: translateX(-50%) translateY(100%); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.cookie-body {
  flex: 1; min-width: 0;
  /* Title + text read as one compact line; text truncates to 2 lines so
     the bar stays slim even with the longer region copy. */
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px;
}
.cookie-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: -0.005em;
  color: #0f172a;
}
.cookie-text {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: #5b6070;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cookie-lawnote {
  flex-basis: 100%;
  margin-top: 1px;
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #9aa0ad;
}
.cookie-actions {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.cookie-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 0;
  transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.cookie-btn-primary {
  background: #1e1b4b;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(30, 27, 75, 0.18);
}
.cookie-btn-primary:hover { background: #312e81; }
.cookie-btn-primary:active { transform: translateY(0.5px); }
.cookie-btn-secondary {
  background: transparent;
  color: #1a1a1a;
  border: 1px solid #d8dae3;
}
.cookie-btn-secondary:hover { background: #f5f6f8; border-color: #1a1a1a; }
.cookie-btn:focus-visible { outline: 2px solid #3b82f6; outline-offset: 2px; }
@media (max-width: 640px) {
  .cookie-notice { flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 14px; }
  .cookie-actions { justify-content: flex-end; }
}

/* Dark-mode banner */
:root[data-theme="dark"] .cookie-notice {
  background: rgba(20, 23, 31, 0.96);
  border-color: #2a2d3c;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.40), 0 4px 12px rgba(0, 0, 0, 0.20);
}
:root[data-theme="dark"] .cookie-title { color: #f5f7fb; }
:root[data-theme="dark"] .cookie-text { color: #b4b9c7; }
:root[data-theme="dark"] .cookie-lawnote { color: #6a6f7e; }
:root[data-theme="dark"] .cookie-btn-primary {
  background: linear-gradient(135deg, #6366f1, #818cf8);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.28);
}
:root[data-theme="dark"] .cookie-btn-primary:hover { filter: brightness(1.08); }
:root[data-theme="dark"] .cookie-btn-secondary {
  background: transparent;
  color: #cbd5e1;
  border-color: #2a2d3c;
}
:root[data-theme="dark"] .cookie-btn-secondary:hover { background: #1a1e2b; border-color: #3a3f52; }

/* ─────────────────────────────────────────────────────────────────────────
 * WizardView — the DEFAULT build surface. A two-column card (left rail =
 * persona + marketing + step progress; right = the form) floating over the
 * landing art. Mirrors the reference UI.
 * ───────────────────────────────────────────────────────────────────────── */
.wiz {
  position: fixed; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vh, 48px) 16px;
  pointer-events: auto;
  overflow-y: auto;
  animation: lp-chat-in 0.32s cubic-bezier(.2,.9,.3,1);
}
.wiz-shell {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e6e7ec;
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.16), 0 6px 18px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
  min-height: min(620px, 86vh);
}

/* Left rail */
.wiz-rail {
  position: relative;
  padding: 34px 30px;
  display: flex; flex-direction: column; gap: 22px;
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(196, 181, 253, 0.28), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, rgba(125, 211, 252, 0.22), transparent 62%),
    linear-gradient(160deg, #faf7ff, #eef4ff);
  border-right: 1px solid #ececf2;
}
.wiz-persona {
  display: inline-flex; align-items: center; gap: 12px;
  background: #ffffff;
  border: 1px solid #eceef4;
  border-radius: 16px;
  padding: 10px 16px 10px 10px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  align-self: flex-start;
}
.wiz-persona-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #ff8a3d, #ff5b8a 55%, #9b5bff);
  color: #fff; font-weight: 800; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.wiz-persona-name { font-size: 17px; font-weight: 750; color: #0f172a; letter-spacing: -0.01em; }
.wiz-persona-role { font-size: 12.5px; color: #6a6f7e; margin-top: 1px; }
.wiz-rail-headline {
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 6px 0 0;
}
.wiz-rail-headline em {
  font-style: normal;
  background: linear-gradient(110deg, #7c3aed, #db2777 55%, #2563eb);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wiz-rail-sub { font-size: 14px; line-height: 1.55; color: #565b6b; margin: 0; max-width: 36ch; }
.wiz-rail-steps { margin-top: auto; }
.wiz-rail-steplabel { font-size: 12px; font-weight: 600; color: #6a6f7e; margin-bottom: 8px; }
.wiz-rail-dots { display: flex; gap: 7px; align-items: center; }
.wiz-dot { width: 22px; height: 6px; border-radius: 999px; background: #d8dbe6; transition: background 0.2s ease, width 0.2s ease; }
.wiz-dot-on { width: 34px; background: linear-gradient(90deg, #6366f1, #818cf8); }
.wiz-dot-done { background: #a5b4fc; }

/* Right panel */
.wiz-main {
  padding: 26px clamp(24px, 3vw, 40px) 30px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.wiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.wiz-pill {
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  color: #4338ca; background: #eef2ff;
  border: 1px solid #e0e7ff; border-radius: 999px;
  padding: 4px 12px;
}
.wiz-head-alts { display: flex; align-items: center; gap: 6px; }
.wiz-head-altlabel { font-size: 12px; color: #9aa0ad; margin-right: 2px; }
.wiz-altbtn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; color: #475569;
  background: #f6f7fa; border: 1px solid #e6e7ec; border-radius: 999px;
  padding: 5px 11px; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.wiz-altbtn:hover { background: #eef0f5; border-color: #c8cdda; color: #1f2937; }
.wiz-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 8px; color: #6a6f7e; cursor: pointer;
  background: transparent; border: 0;
}
.wiz-close:hover { background: rgba(15, 23, 42, 0.06); color: #1a1a1a; }
.wiz-title { font-size: clamp(20px, 2.2vw, 27px); font-weight: 800; letter-spacing: -0.02em; color: #0f172a; margin: 0 0 6px; }
.wiz-intro { font-size: 14px; color: #6a6f7e; margin: 0 0 18px; line-height: 1.5; }
.wiz-fields { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }
.wiz-field { display: flex; flex-direction: column; gap: 6px; }
.wiz-label { font-size: 13.5px; font-weight: 650; color: #0f172a; }
.wiz-req { color: #ef4444; }
.wiz-prompt { font-size: 12.5px; color: #8a8f9e; margin-top: -2px; }
.wiz-input {
  width: 100%; font: inherit; font-size: 15px; color: #0f172a;
  background: #fff; border: 1px solid #d8dae3; border-radius: 12px;
  padding: 12px 14px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wiz-input::placeholder { color: #aeb3c0; }
.wiz-input:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.wiz-input-err { border-color: #ef4444; }
.wiz-input-err:focus { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15); }
.wiz-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wiz-chip {
  font: inherit; font-size: 13.5px; font-weight: 600; color: #374151;
  background: #fff; border: 1px solid #d8dae3; border-radius: 999px;
  padding: 8px 16px; cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.wiz-chip:hover { border-color: #b9bed0; background: #f7f8fb; }
.wiz-chip-on {
  background: #1e1b4b; color: #fff; border-color: #1e1b4b;
  box-shadow: 0 3px 10px rgba(30, 27, 75, 0.22);
}
.wiz-suggests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.wiz-suggest {
  font: inherit; font-size: 12px; font-weight: 600; color: #6366f1;
  background: #eef2ff; border: 1px solid #e0e7ff; border-radius: 999px;
  padding: 4px 10px; cursor: pointer; transition: background 0.14s ease;
}
.wiz-suggest:hover { background: #e0e7ff; }
.wiz-suggest-on { background: #6366f1; color: #fff; border-color: #6366f1; }
.wiz-field-err { font-size: 12px; color: #dc2626; }
.wiz-prefill-badge {
  margin-left: 8px; font-size: 10.5px; font-weight: 600;
  color: #7c3aed; background: #f5f0ff; border: 1px solid #ece2ff;
  border-radius: 999px; padding: 1px 8px; vertical-align: middle;
}
.wiz-input-prefilled { border-color: #c4b5fd; background: #fbf9ff; }
.wiz-input-prefilled:focus { border-color: #6366f1; background: #fff; }
/* URL pull / knowledge preview card on wizard step 1 */
.wiz-knowledge {
  display: flex; flex-direction: column; gap: 10px;
  margin: 8px 0 16px;
  padding: 14px 14px 12px;
  background: linear-gradient(180deg, #f7f5ff 0%, #fbfaff 100%);
  border: 1px solid #ece2ff;
  border-radius: 14px;
}
.wiz-knowledge-head { display: flex; align-items: flex-start; gap: 10px; }
.wiz-knowledge-emoji { font-size: 18px; line-height: 1.2; margin-top: 2px; }
.wiz-knowledge-meta { flex: 1; min-width: 0; }
.wiz-knowledge-title { font-size: 13.5px; font-weight: 650; color: #0f172a; }
.wiz-knowledge-sub { font-size: 12.5px; line-height: 1.45; color: #6a6f7e; margin-top: 2px; }
.wiz-knowledge-link { color: #6366f1; text-decoration: none; font-weight: 600; }
.wiz-knowledge-link:hover { text-decoration: underline; }
.wiz-knowledge-discard {
  font: inherit; font-size: 12px; font-weight: 600; color: #b91c1c;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 4px 10px; cursor: pointer;
}
.wiz-knowledge-discard:hover { background: #fff1f1; border-color: #fecdd3; }
.wiz-knowledge-row { display: flex; gap: 8px; align-items: stretch; }
.wiz-knowledge-input { flex: 1; }
.wiz-knowledge-go {
  white-space: nowrap; padding: 0 16px; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.wiz-knowledge-err {
  font-size: 12.5px; color: #b91c1c;
  background: #fff4f4; border: 1px solid #fecaca; border-radius: 10px;
  padding: 7px 10px;
}
.wiz-knowledge-foot { font-size: 11.5px; color: #8a8f9e; }
/* Build 248 — loading variant. Slim banner over the URL panel that
   reads as a background task; the form below stays fully interactive
   so the operator can keep filling while the scrape resolves. */
.wiz-knowledge-loading {
  background: linear-gradient(180deg, #eef2ff 0%, #f5f7ff 100%);
  border-color: #c7d2fe;
}
.wiz-knowledge-spin {
  margin-top: 4px;
}
/* Discreet text-button "view source data" — sits inline under the
   success header, NOT a big blocky toggle that fights the form for
   the operator's eye. */
.wiz-knowledge-srclink {
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: #6366f1; background: transparent; border: 0; padding: 0;
  cursor: pointer; line-height: 1.45;
}
.wiz-knowledge-srclink:hover { text-decoration: underline; }
:root[data-theme="dark"] .wiz-knowledge-loading {
  background: linear-gradient(180deg, #1a1f3a 0%, #1a1a2e 100%);
  border-color: #3b4275;
}
.wiz-knowledge-yaml {
  width: 100%; box-sizing: border-box; font: 12.5px/1.55 ui-monospace, SF Mono, Menlo, monospace;
  color: #1f2937;
  background: #ffffff; border: 1px solid #d8dae3; border-radius: 10px;
  padding: 10px 12px; outline: none; resize: vertical;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.wiz-knowledge-yaml:focus { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
:root[data-theme="dark"] .wiz-knowledge {
  background: linear-gradient(180deg, #1a1730 0%, #15171f 100%);
  border-color: #2e2842;
}
:root[data-theme="dark"] .wiz-knowledge-title { color: #f1f3f8; }
:root[data-theme="dark"] .wiz-knowledge-sub,
:root[data-theme="dark"] .wiz-knowledge-foot { color: #9aa0ad; }
:root[data-theme="dark"] .wiz-knowledge-yaml { background: #14171f; border-color: #2a2f3e; color: #f1f3f8; }
:root[data-theme="dark"] .wiz-knowledge-discard:hover { background: #2a1a1f; border-color: #6b2a36; }
:root[data-theme="dark"] .wiz-knowledge-err { background: #2a1a1f; border-color: #6b2a36; color: #fca5a5; }

/* "Picking up where you left off" strip — shows the original prompt the
   visitor typed before login so they know what triggered the wizard. */
.wiz-resume {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 4px 0 16px; padding: 12px 14px;
  background: linear-gradient(180deg, #f0f8ff 0%, #f7fbff 100%);
  border: 1px solid #d5e7fb; border-radius: 12px;
}
.wiz-resume-emoji {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  background: #4f46e5; color: #fff; display: inline-flex;
  align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
  margin-top: 1px;
}
.wiz-resume-body { flex: 1; min-width: 0; }
.wiz-resume-title { font-size: 12px; font-weight: 700; color: #4f46e5;
  text-transform: uppercase; letter-spacing: 0.04em; }
.wiz-resume-quote {
  margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: #1f2937;
  font-style: italic;
  overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3;
}
.wiz-resume-dismiss {
  flex: 0 0 auto; font: inherit; font-size: 14px; line-height: 1;
  color: #6a6f7e; background: transparent; border: 0; cursor: pointer;
  padding: 4px 6px; border-radius: 6px;
}
.wiz-resume-dismiss:hover { background: rgba(15, 23, 42, 0.06); color: #1f2937; }
:root[data-theme="dark"] .wiz-resume {
  background: linear-gradient(180deg, #1c2030 0%, #181b26 100%);
  border-color: #2a3550;
}
:root[data-theme="dark"] .wiz-resume-title { color: #c4b5fd; }
:root[data-theme="dark"] .wiz-resume-quote { color: #e7e9ee; }
:root[data-theme="dark"] .wiz-resume-dismiss:hover { background: rgba(255,255,255,0.06); color: #f1f3f8; }

/* Collapsed knowledge card after a successful pull — emphasises the
   "Filled N fields" pill, hides raw YAML behind a toggle. */
.wiz-knowledge-filled { background: linear-gradient(180deg, #f0fdf4 0%, #f7fbf9 100%); border-color: #c5ead5; }
:root[data-theme="dark"] .wiz-knowledge-filled {
  background: linear-gradient(180deg, #14241c 0%, #131a16 100%); border-color: #2a4a3a;
}
.wiz-knowledge-toggle {
  align-self: flex-start;
  font: inherit; font-size: 12px; font-weight: 600; color: #4f46e5;
  background: transparent; border: 0; border-radius: 6px;
  padding: 2px 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.wiz-knowledge-toggle:hover { color: #312e81; background: rgba(99, 102, 241, 0.08); }
.wiz-knowledge-toggle-caret { transition: transform 0.15s ease; display: inline-block; }
.wiz-knowledge-toggle-caret.open { transform: rotate(180deg); }
:root[data-theme="dark"] .wiz-knowledge-toggle { color: #a5b4fc; }
:root[data-theme="dark"] .wiz-knowledge-toggle:hover { color: #c7d2fe; background: rgba(165, 180, 252, 0.1); }

.wiz-knowledge-err { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.wiz-knowledge-skip {
  font: inherit; font-size: 12px; font-weight: 600; color: #4f46e5;
  background: transparent; border: 0; border-radius: 6px; padding: 4px 8px; cursor: pointer;
  white-space: nowrap;
}
.wiz-knowledge-skip:hover { background: rgba(99, 102, 241, 0.08); }
:root[data-theme="dark"] .wiz-knowledge-skip { color: #a5b4fc; }

/* "from website" badge — emerald, distinct from the violet "from your prompt"
   badge so the operator can see at a glance which source filled each field. */
.wiz-prefill-badge-url { color: #047857; background: #ecfdf5; border-color: #b9ead5; }
:root[data-theme="dark"] .wiz-prefill-badge-url { color: #6ee7b7; background: #11281f; border-color: #1c3d2d; }
.wiz-input-prefilled.wiz-input-prefilled-url,
.wiz-input.wiz-input-prefilled.wiz-input-prefilled-url { border-color: #6ee7b7; background: #f6fdf9; }

.wiz-prefilling {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #7c3aed; font-weight: 600;
  background: #f5f0ff; border: 1px solid #ece2ff; border-radius: 999px;
  padding: 5px 12px; margin: 0 0 14px;
}
.wiz-spinner-sm {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid #d8c9ff; border-top-color: #7c3aed;
  animation: wiz-spin 0.8s linear infinite;
}
.wiz-submit-err {
  margin-top: 16px; font-size: 13px; color: #b91c1c;
  background: #fff4f4; border: 1px solid #fecaca; border-radius: 10px; padding: 9px 12px;
}
.wiz-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 26px; }
.wiz-btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 14.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  border: 0; border-radius: 11px; padding: 12px 22px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.28);
  transition: filter 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
  margin-left: auto;
}
.wiz-btn-primary:hover { filter: brightness(1.06); }
.wiz-btn-primary:active { transform: translateY(0.5px); }
.wiz-btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.wiz-btn-secondary {
  font: inherit; font-size: 14px; font-weight: 600; color: #475569;
  background: #fff; border: 1px solid #d8dae3; border-radius: 11px; padding: 11px 18px; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.wiz-btn-secondary:hover { background: #f5f6f8; border-color: #b9bed0; }
.wiz-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 280px; }
.wiz-state-err { color: #b91c1c; font-size: 14px; text-align: center; }
.wiz-state-msg { color: #6b5bd0; font-size: 14px; font-weight: 600; text-align: center; max-width: 30ch; }
:root[data-theme="dark"] .wiz-state-msg { color: #c4b5fd; }
.wiz-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #e5e7ec; border-top-color: #6366f1;
  animation: wiz-spin 0.8s linear infinite;
}
@keyframes wiz-spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .wiz-shell { grid-template-columns: 1fr; min-height: 0; }
  .wiz-rail { border-right: 0; border-bottom: 1px solid #ececf2; padding: 24px 22px; gap: 16px; }
  .wiz-rail-headline { font-size: 22px; }
  .wiz-rail-sub { display: none; }
  .wiz-head-altlabel { display: none; }
}

/* Wizard — dark mode */
:root[data-theme="dark"] .wiz-shell {
  background: rgba(17, 20, 28, 0.97); border-color: #262b3a;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .wiz-rail {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(99, 102, 241, 0.18), transparent 60%),
    radial-gradient(120% 90% at 100% 100%, rgba(56, 189, 248, 0.12), transparent 62%),
    linear-gradient(160deg, #15171f, #11151d);
  border-right-color: #242838;
}
:root[data-theme="dark"] .wiz-persona { background: #1a1e29; border-color: #2a2f3e; }
:root[data-theme="dark"] .wiz-persona-name { color: #f1f3f8; }
:root[data-theme="dark"] .wiz-persona-role { color: #9aa0ad; }
:root[data-theme="dark"] .wiz-rail-headline { color: #f1f3f8; }
:root[data-theme="dark"] .wiz-rail-sub { color: #aab0c0; }
:root[data-theme="dark"] .wiz-rail-steplabel { color: #9aa0ad; }
:root[data-theme="dark"] .wiz-dot { background: #2f3445; }
:root[data-theme="dark"] .wiz-dot-done { background: #4f46e5; }
:root[data-theme="dark"] .wiz-pill { color: #c7d2fe; background: #1e2233; border-color: #2f3550; }
:root[data-theme="dark"] .wiz-altbtn { background: #1a1e29; border-color: #2a2f3e; color: #cbd5e1; }
:root[data-theme="dark"] .wiz-altbtn:hover { background: #222736; border-color: #3a4054; color: #f1f3f8; }
:root[data-theme="dark"] .wiz-close:hover { background: rgba(255,255,255,0.06); color: #f1f3f8; }
:root[data-theme="dark"] .wiz-title { color: #f1f3f8; }
:root[data-theme="dark"] .wiz-intro, :root[data-theme="dark"] .wiz-prompt { color: #9aa0ad; }
:root[data-theme="dark"] .wiz-label { color: #e7e9ee; }
:root[data-theme="dark"] .wiz-input { background: #14171f; border-color: #2a2f3e; color: #f1f3f8; }
:root[data-theme="dark"] .wiz-input::placeholder { color: #5f6577; }
:root[data-theme="dark"] .wiz-chip { background: #14171f; border-color: #2a2f3e; color: #cbd5e1; }
:root[data-theme="dark"] .wiz-chip:hover { background: #1c2030; border-color: #3a4054; }
:root[data-theme="dark"] .wiz-chip-on { background: linear-gradient(135deg, #6366f1, #818cf8); border-color: #6366f1; color: #fff; }
:root[data-theme="dark"] .wiz-suggest { background: #1e2233; border-color: #2f3550; color: #c7d2fe; }
:root[data-theme="dark"] .wiz-btn-secondary { background: #14171f; border-color: #2a2f3e; color: #cbd5e1; }
:root[data-theme="dark"] .wiz-btn-secondary:hover { background: #1c2030; border-color: #3a4054; }
:root[data-theme="dark"] .wiz-prefill-badge { color: #c4b5fd; background: #221b3a; border-color: #332b52; }
:root[data-theme="dark"] .wiz-prefilling { color: #c4b5fd; background: #221b3a; border-color: #332b52; }
:root[data-theme="dark"] .wiz-input-prefilled { border-color: #6d5bd0; background: #1a1730; }
:root[data-theme="dark"] .wiz-input-prefilled:focus { background: #14171f; }

/* ─────────────────────────────────────────────────────────────────────────
 * LandingArt — ambient AI-art layer behind the landing. Pure CSS:
 *   - 3 drifting aural discs (radial gradients, heavy blur)
 *   - Pinpoint grid that fades at the edges (Linear/Vercel-style)
 *   - Aurora streak across the top
 *   - Faint SVG noise overlay for analog texture
 * Sits between body bg (z:0) and .lp (z:4). pointer-events: none.
 * Drift animations gated by prefers-reduced-motion (global media query).
 * ───────────────────────────────────────────────────────────────────────── */

.lp-art {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  animation: lpfadein 1.2s ease 0.1s forwards;
}

.lp-art-aurora {
  position: absolute;
  top: -30%;
  left: -10%;
  right: -10%;
  height: 80%;
  background:
    radial-gradient(60% 50% at 30% 50%, rgba(196, 181, 253, 0.30), transparent 70%),
    radial-gradient(50% 50% at 75% 40%, rgba(125, 211, 252, 0.20), transparent 75%);
  filter: blur(40px);
}

.lp-art-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(15, 23, 42, 0.10) 1px, transparent 1.4px);
  background-size: 28px 28px;
  background-position: center center;
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 35%, transparent 85%);
  mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 35%, transparent 85%);
}

.lp-art-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.lp-art-blob-1 {
  width: 520px; height: 520px;
  top: -12%; left: -10%;
  background: radial-gradient(circle, rgba(192, 132, 252, 0.55) 0%, transparent 65%);
  animation: lp-drift-1 26s ease-in-out infinite alternate;
}
.lp-art-blob-2 {
  width: 460px; height: 460px;
  top: 25%; right: -12%;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.45) 0%, transparent 65%);
  animation: lp-drift-2 32s ease-in-out infinite alternate;
}
.lp-art-blob-3 {
  width: 620px; height: 620px;
  bottom: -22%; left: 32%;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.40) 0%, transparent 65%);
  animation: lp-drift-3 38s ease-in-out infinite alternate;
}

@keyframes lp-drift-1 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, 80px, 0) scale(1.08); }
}
@keyframes lp-drift-2 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-90px, 50px, 0) scale(1.06); }
}
@keyframes lp-drift-3 {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(40px, -70px, 0) scale(1.05); }
}

/* Faint film-grain noise — keeps the cream from feeling flat / digital.
 * Generated SVG so no extra asset to load. */
.lp-art-noise {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.4 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.06;
  mix-blend-mode: multiply;
}

/* Dark-theme tuning — discs glow more saturated against deep navy; grid
 * dots are white-on-black; noise blend lifts to overlay so it adds glitter
 * rather than darkens. */
:root[data-theme="dark"] .lp-art-aurora {
  background:
    radial-gradient(60% 50% at 30% 50%, rgba(124, 58, 237, 0.32), transparent 70%),
    radial-gradient(50% 50% at 75% 40%, rgba(56, 189, 248, 0.22), transparent 75%);
}
:root[data-theme="dark"] .lp-art-grid {
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.07) 1px, transparent 1.4px);
}
:root[data-theme="dark"] .lp-art-blob-1 {
  background: radial-gradient(circle, rgba(168, 85, 247, 0.40) 0%, transparent 65%);
}
:root[data-theme="dark"] .lp-art-blob-2 {
  background: radial-gradient(circle, rgba(236, 72, 153, 0.32) 0%, transparent 65%);
}
:root[data-theme="dark"] .lp-art-blob-3 {
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28) 0%, transparent 65%);
}
:root[data-theme="dark"] .lp-art-noise {
  opacity: 0.04;
  mix-blend-mode: overlay;
}
.lp-locale-wrap {
  position: relative;
  pointer-events: auto;
  opacity: 0;
  animation: lpfadein 0.7s ease 0.05s forwards;
  margin-bottom: 6px;
  /* The headline's gradient `em` uses a filter which creates a stacking
   * context — without our own z-index here the dropdown would be painted
   * BEHIND the headline. Bump the wrap into its own context above the hero. */
  z-index: 30;
}
.lp-locale {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.86);
  font: inherit;
  font-size: 12.5px;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.lp-locale:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.20);
}
.lp-locale:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.6);
  outline-offset: 3px;
}
.lp-locale-flag { font-size: 14px; line-height: 1; }
.lp-locale-text { font-weight: 500; }
.lp-locale-chev { opacity: 0.7; }

.lp-locale-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  list-style: none;
  padding: 6px;
  margin: 0;
  min-width: 240px;
  border-radius: 12px;
  background: rgba(20, 20, 30, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(10px);
  z-index: 10;
}
.lp-locale-menu li { margin: 0; }
.lp-locale-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
}
.lp-locale-item:hover { background: rgba(255, 255, 255, 0.06); }
.lp-locale-item.active { background: rgba(125, 211, 252, 0.10); }
.lp-locale-item-label { flex: 1; min-width: 0; font-weight: 500; }
.lp-locale-item-lang { font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.lp-locale-item-tick { color: #7dd3fc; margin-left: 4px; }

/* Light-mode locale chip + popover */
:root[data-theme="light"] .lp-locale,
:root:not([data-theme]) .lp-locale {
  background: rgba(255, 255, 255, 0.85);
  border-color: #d8dae3;
  color: #0f172a;
  backdrop-filter: blur(4px);
}
:root[data-theme="light"] .lp-locale:hover,
:root:not([data-theme]) .lp-locale:hover {
  background: #ffffff;
  border-color: #9aa0ad;
}
:root[data-theme="light"] .lp-locale-menu,
:root:not([data-theme]) .lp-locale-menu {
  background: #ffffff;
  border-color: #e6e7ec;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  backdrop-filter: none;
}
:root[data-theme="light"] .lp-locale-item,
:root:not([data-theme]) .lp-locale-item {
  color: #1a1a1a;
}
:root[data-theme="light"] .lp-locale-item:hover,
:root:not([data-theme]) .lp-locale-item:hover {
  background: #f5f6f8;
}
:root[data-theme="light"] .lp-locale-item.active,
:root:not([data-theme]) .lp-locale-item.active {
  background: #eff6ff;
}
:root[data-theme="light"] .lp-locale-item-lang,
:root:not([data-theme]) .lp-locale-item-lang {
  color: #6a6f7e;
}
:root[data-theme="light"] .lp-locale-item-tick,
:root:not([data-theme]) .lp-locale-item-tick {
  color: #2563eb;
}

/* Trust microcopy beneath the CTA */
.lp-trustrow {
  /* No top margin — the parent `.lp-cta-row` already supplies a 10px gap. */
  display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
  letter-spacing: 0.005em;
  pointer-events: auto;
}
.lp-trust {
  display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.lp-trust-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.6);
}
.lp-trust-sep { color: rgba(255, 255, 255, 0.30); }
:root[data-theme="light"] .lp-trustrow,
:root:not([data-theme]) .lp-trustrow { color: #4a5063; }
:root[data-theme="light"] .lp-trust-sep,
:root:not([data-theme]) .lp-trust-sep { color: #c5c8d4; }

.lp-hero {
  /* Wider hero so a 14"+ MacBook doesn't feel zoomed-out. Caps at 720px so
   * ultrawide doesn't sprawl, floors at 100% so phone wraps cleanly. */
  max-width: 720px;
  width: 100%;
  text-align: center;
  opacity: 0;
  animation: lpfadein 0.9s ease 0.2s forwards;
}
.lp-title {
  margin: 0 0 14px;
  /* Scales with viewport: 32px floor on phones (punchy), 4.6vw fluid, 60px
   * cap so a 27" iMac doesn't get a billboard. Bumped from prior 44px cap
   * which read as undersized on MacBook screens. */
  font-size: clamp(32px, 4.6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 600;
  color: var(--fg-0);
  background: linear-gradient(180deg, #ffffff 0%, #d8d4f5 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* "Phone AI" — the product moniker — gets the brand-iridescent treatment so
 * the eye lands on it. Italic stripped, kept as a chromatic accent. */
.lp-title em {
  font-style: normal;
  background: linear-gradient(135deg, #fbcfe8 0%, #c4b5fd 45%, #a5f3fc 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  /* A whisper of the orb's glow underneath, so the words feel lit-from-within
   * rather than just coloured. */
  filter: drop-shadow(0 0 14px rgba(244, 114, 182, 0.22));
}
.lp-sub {
  margin: 0 auto;
  max-width: 440px;
  font-size: clamp(13px, 1.2vw, 14.5px);
  line-height: 1.55;
  letter-spacing: -0.005em;
  color: var(--fg-mute);
}

/* ── Light-mode overrides for the landing surface ───────────────────────
 * The dark landing was designed for glow-on-black: white gradient headline,
 * iridescent CTA, ghost secondary on transparent purple. In light mode we
 * keep the orb's own color but switch the chrome to ink-on-paper, with
 * AA-passing contrast (panel review: pastel-on-cream measured 1.4:1). */
:root[data-theme="light"] .lp-title,
:root:not([data-theme]) .lp-title {
  background: linear-gradient(180deg, #0f172a 0%, #1e1b4b 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* `Phone AI` accent — deeper, saturated gradient. Dropped the white drop-
 * shadow glow (built for black; halos on cream). */
:root[data-theme="light"] .lp-title em,
:root:not([data-theme]) .lp-title em {
  background: linear-gradient(135deg, #7c3aed 0%, #db2777 55%, #0891b2 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: none;
}
:root[data-theme="light"] .lp-sub,
:root:not([data-theme]) .lp-sub {
  color: #374151;
  font-size: clamp(14px, 1.2vw, 15px);   /* floor 14 for AA-at-distance */
}
/* CTA in light mode — ink fill, white label. The dark-mode CTA is iridescent
 * because it glows on black; on cream that pastel cloud reads decorative.
 * Make the primary action unambiguous. */
:root[data-theme="light"] .lp-cta,
:root:not([data-theme]) .lp-cta {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  box-shadow:
    0 10px 28px rgba(30, 27, 75, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}
:root[data-theme="light"] .lp-cta:hover,
:root:not([data-theme]) .lp-cta:hover {
  filter: brightness(1.08);
  box-shadow:
    0 14px 36px rgba(30, 27, 75, 0.36),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
}
:root[data-theme="light"] .lp-cta-arrow,
:root:not([data-theme]) .lp-cta-arrow,
:root[data-theme="light"] .lp-cta-spark,
:root:not([data-theme]) .lp-cta-spark {
  color: #ffffff;
}
:root[data-theme="light"] .lp-locale,
:root:not([data-theme]) .lp-locale {
  background: rgba(255, 255, 255, 0.7);
  border-color: #e6e7ec;
  color: #4a5063;
  backdrop-filter: blur(4px);
}
:root[data-theme="light"] .lp-secondary,
:root:not([data-theme]) .lp-secondary {
  color: #4a5063;
}
:root[data-theme="light"] .lp-secondary:hover,
:root:not([data-theme]) .lp-secondary:hover {
  color: #0f172a;
}
/* Brandsplash + brandbar — swap the white logo for the dark one in light. */
:root[data-theme="light"] .brandsplash .brandmark,
:root:not([data-theme]) .brandsplash .brandmark,
:root[data-theme="light"] .brandbar img,
:root:not([data-theme]) .brandbar img {
  filter: none;
}
:root[data-theme="dark"] .brandsplash .brandmark,
:root[data-theme="dark"] .brandbar img {
  /* The SVG is already brand-coloured; in dark mode it sits on near-black
   * so leave as is. */
  filter: none;
}
.lp-cta-row {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  opacity: 0;
  animation: lpfadein 0.9s ease 0.4s forwards;
}
.lp-cta {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 10px;
  height: 56px;
  padding: 0 26px 0 22px;
  font-size: 15.5px;
  font-weight: 550;
  letter-spacing: -0.01em;
  color: #1a0f2e;
  background: linear-gradient(135deg, #fbcfe8 0%, #ddd6fe 50%, #bae6fd 100%);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  box-shadow:
    0 12px 40px rgba(244, 114, 182, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset,
    0 -1px 0 rgba(0, 0, 0, 0.05) inset;
  transition: transform 0.18s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.lp-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow:
    0 16px 50px rgba(244, 114, 182, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset;
}
.lp-cta:active { transform: translateY(0.5px); }
.lp-cta-spark {
  font-size: 16px;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.65));
}
.lp-cta-arrow {
  width: 18px; height: 18px;
  margin-left: 2px;
  color: #1a0f2e;
  transition: transform 0.2s ease;
}
.lp-cta:hover .lp-cta-arrow { transform: translateX(2px); }

.lp-secondary {
  pointer-events: auto;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  color: var(--fg-mute);
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 8px;
  transition: color 0.2s ease;
}
.lp-secondary:hover { color: var(--fg-0); }

@keyframes lpfadein {
  /* Vertical fade-in only — earlier this used translate(-50%, …) to pair
   * with the absolute-positioned `left: 50%` centring trick. Now the flex
   * layout handles centring; if we keep the X transform, the hero / CTA
   * shift 50% of their own width off-screen to the left. Just translateY. */
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (max-width: 540px) {
  .lp-hero { top: 11%; }
  .lp-cta-row { bottom: 7%; }
  .lp-cta { height: 52px; font-size: 15px; padding: 0 22px 0 18px; }
}

/* ── brand bar (top-left, persistent) ─────────────────────────────────────
 *
 * The logo lives in the top-left corner of every screen — landing, call,
 * reveal — as a quiet anchor. Mirrors the dots menu on the right so the
 * frame feels balanced. Dimmed by default so it never competes with the
 * orb, brightens on hover to signal "click to go home".
 */
.brandbar {
  position: fixed;
  top: 22px; left: 22px;
  /* 88 → 66 → 59 → 53 → 48. Approaching half the original; corner anchor
   * is now restrained to the level of a favicon-with-wordmark, not a
   * brand statement. */
  height: 48px;
  display: inline-flex; align-items: center;
  opacity: 0;
  animation: bbfade 0.7s ease 0.2s forwards;
  z-index: 9;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}
/* Brandbar carries the inline <SpiderXLogo> SVG. The wordmark inside uses
 * `currentColor`, so we set `color: var(--fg-0)` on the parent — light theme
 * gets a dark wordmark, dark theme gets a white one. Red X stays #df3739. */
.brandbar { color: var(--fg-0); }
.brandbar svg {
  height: 100%; width: auto;
  display: block;
  transition: transform 0.2s ease;
}
.brandbar:hover svg,
.brandbar:focus-visible svg {
  transform: translateY(-0.5px);
}
@keyframes bbfade { to { opacity: 0.78; } }
.brandbar:hover, .brandbar:focus-visible { opacity: 1; }
@media (max-width: 520px) {
  /* Mobile mirrors the desktop step ratio: 56 → 42 → 38 → 34 → 31. */
  .brandbar { top: 16px; left: 16px; height: 31px; }
  .brandbar-wordmark { font-size: 28px; }
  .brandsplash .brandmark { height: 56px; }
}

/* ── progress hint (tiny, only when needed) ───────────────────────────── */

.hint {
  position: fixed;
  bottom: 110px; left: 0; right: 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--fg-mute);
  letter-spacing: 0.02em;
  pointer-events: none;
  animation: rise 0.45s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── tweaks affordance + drawer ──────────────────────────────────────── */

.tweaks-toggle {
  position: fixed;
  top: 22px; right: 22px;
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.45);
  opacity: 0;
  animation: cmfade 0.8s ease 1.8s forwards;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
  z-index: 7;
}
.tweaks-toggle:hover { background: rgba(255, 255, 255, 0.1); color: var(--fg-0); border-color: rgba(255, 255, 255, 0.18); }
.tweaks-toggle:active { transform: scale(0.95); }
.tweaks-toggle svg { width: 16px; height: 16px; stroke-width: 1.6; }

.tweaks-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  z-index: 18;
}
.tweaks-scrim.open { opacity: 1; pointer-events: auto; }

.tweaks-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(760px, 100%);
  background: linear-gradient(180deg, rgba(10, 7, 22, 0.96), rgba(10, 7, 22, 0.98));
  backdrop-filter: blur(28px) saturate(140%);
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  transform: translateX(100%);
  transition: transform 0.34s cubic-bezier(.2, .9, .3, 1);
  z-index: 19;
  display: flex; flex-direction: column;
}
.tweaks-drawer .body { padding: 18px 32px 40px; }
.tweaks-drawer.open { transform: translateX(0); }

.tweaks-drawer header {
  padding: 22px 24px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.tweaks-drawer header h2 {
  margin: 0; font-size: 17px; font-weight: 500;
  letter-spacing: -0.015em;
}
.tweaks-drawer header .x {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg-mute);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.tweaks-drawer header .x:hover { background: rgba(255, 255, 255, 0.08); color: var(--fg-0); }

.tweaks-drawer .tabs {
  display: flex; gap: 4px; padding: 4px 20px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tweaks-drawer .tab {
  flex: 1; height: 32px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--fg-mute);
  letter-spacing: 0.005em;
  transition: background 0.14s ease, color 0.14s ease;
}
.tweaks-drawer .tab.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--fg-0);
}

.tweaks-drawer .body {
  padding: 18px 24px 32px;
  overflow-y: auto;
  flex: 1;
}

.tw-section-title {
  font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--fg-dim);
  margin: 22px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
.tw-section-title:first-child { margin-top: 6px; }
.tw-section-pill {
  font-size: 10px; letter-spacing: 0.04em; text-transform: none;
  background: rgba(167, 139, 250, 0.18);
  color: #a78bfa;
  padding: 1px 7px; border-radius: 99px;
  font-weight: 600;
}
.tw-help-top {
  font-size: 12px; color: var(--fg-mute);
  line-height: 1.5; margin-bottom: 8px;
}
.tw-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px;
}
.tw-grid-2 .tw-field { border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.tw-grid-2 .tw-field:nth-last-child(-n+2) { border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.tw-grid-2 .tw-field:last-child { border-bottom: 0; }
.tw-grid-2 .tw-field:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
.tw-field.tw-field-empty .name { color: var(--fg-mute); }
.tw-field-tick {
  color: #6ee7b7; font-size: 12px; font-weight: 600;
}
@media (max-width: 720px) {
  .tw-grid-2 { grid-template-columns: 1fr; }
}

.tw-field {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.tw-field:last-child { border-bottom: 0; }
.tw-field .label-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.tw-field .name {
  font-size: 13.5px; color: var(--fg-0);
  font-weight: 500;
}
.tw-field .val {
  font-size: 12.5px; color: var(--fg-1);
  font-variant-numeric: tabular-nums;
}
.tw-field .help {
  font-size: 12px; color: var(--fg-mute);
  line-height: 1.45;
  margin-bottom: 8px;
}

.tw-select, .tw-range {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 9px 11px;
  outline: 0;
  font-size: 13px;
}
.tw-select { appearance: none; -webkit-appearance: none; cursor: pointer; }
.tw-select:focus, .tw-range:focus { border-color: rgba(192, 132, 252, 0.55); }
.tw-range {
  -webkit-appearance: none; appearance: none;
  height: 28px; padding: 0;
  background: transparent;
  border: 0;
}
.tw-range::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.tw-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(180deg, #fde7f3, #c4b5fd);
  border: 0; margin-top: -6px;
  box-shadow: 0 4px 14px rgba(192, 132, 252, 0.5);
  cursor: pointer;
}

/* iOS-style toggle */
.tw-toggle {
  position: relative;
  width: 38px; height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  transition: background 0.18s ease;
  cursor: pointer;
  flex-shrink: 0;
}
.tw-toggle::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  transition: transform 0.2s cubic-bezier(.2, .9, .3, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.tw-toggle.on { background: linear-gradient(135deg, #c4b5fd, #f0abfc); }
.tw-toggle.on::after { transform: translateX(16px); }

.tw-callout {
  background: rgba(192, 132, 252, 0.06);
  border: 1px solid rgba(192, 132, 252, 0.18);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 12.5px;
  color: var(--fg-1);
  line-height: 1.5;
  margin: 12px 0 6px;
}

/* agent cards in tweaks */
.tw-agent {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  margin-bottom: 8px;
}
.tw-agent .thumb {
  width: 38px; height: 38px; border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fde7f3, #a78bfa 55%, #fb7185 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 6px 14px -6px rgba(244, 114, 182, 0.5);
  flex-shrink: 0;
}
.tw-agent .meta { flex: 1; min-width: 0; }
.tw-agent .meta .name { font-weight: 500; font-size: 14px; }
.tw-agent .meta .sub { font-size: 11.5px; color: var(--fg-mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-agent .call {
  height: 30px; padding: 0 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f0abfc, #c4b5fd);
  color: #1a0f2e;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: -0.005em;
}
.tw-agent .call:hover { filter: brightness(1.06); }
.tw-agent .del {
  width: 30px; height: 30px; border-radius: 999px;
  background: rgba(244, 63, 94, 0.1);
  color: #fda4af;
  font-size: 16px; line-height: 1;
  border: 1px solid rgba(244, 63, 94, 0.25);
  margin-left: 6px;
}
.tw-agent .del:hover { background: rgba(244, 63, 94, 0.18); }

.tw-empty {
  font-size: 12.5px; color: var(--fg-mute);
  padding: 18px 14px; border: 1px dashed rgba(255, 255, 255, 0.08);
  border-radius: 12px; text-align: center;
}

.tw-snapshot {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 6px;
}
.tw-snapshot dl { margin: 0; }
.tw-snapshot dt {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-dim);
  margin-top: 8px;
}
.tw-snapshot dt:first-child { margin-top: 0; }
.tw-snapshot dd {
  margin: 2px 0 0 0;
  font-size: 13px; color: var(--fg-0);
}

/* agent edit view */
.tw-editor {
  display: flex; flex-direction: column;
  gap: 0;
}
.tw-editor .back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--fg-mute);
  padding: 6px 0 14px;
  cursor: pointer;
  background: transparent; border: 0;
}
.tw-editor .back:hover { color: var(--fg-0); }
.tw-editor .back svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.tw-editor .heading {
  display: flex; align-items: center; gap: 14px;
  padding-bottom: 14px; margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.tw-editor .heading .thumb {
  width: 44px; height: 44px; border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #fde7f3, #a78bfa 55%, #fb7185 100%);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2), 0 6px 14px -6px rgba(244, 114, 182, 0.5);
}
.tw-editor .heading .name {
  font-size: 17px; font-weight: 500; letter-spacing: -0.015em;
}
.tw-editor .heading .sub {
  font-size: 12px; color: var(--fg-mute); margin-top: 2px;
}

.tw-input, .tw-textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 10px 12px;
  outline: 0;
  font-size: 13.5px;
  color: var(--fg-0);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tw-input:focus, .tw-textarea:focus {
  border-color: rgba(192, 132, 252, 0.55);
  background: rgba(255, 255, 255, 0.06);
}
.tw-textarea { min-height: 96px; resize: vertical; line-height: 1.5; }

.tw-actions {
  display: flex; gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}
.tw-actions .save {
  flex: 1; height: 40px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f0abfc, #c4b5fd 50%, #a5f3fc);
  color: #1a0f2e;
  font-weight: 600;
  font-size: 13.5px;
  box-shadow: 0 12px 32px -12px rgba(192, 132, 252, 0.55);
  transition: filter 0.18s ease, transform 0.15s ease;
}
.tw-actions .save:hover { filter: brightness(1.06); }
.tw-actions .save:active { transform: translateY(1px); }
.tw-actions .save:disabled { opacity: 0.45; cursor: not-allowed; }
.tw-actions .cancel {
  height: 40px; padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--fg-0);
  font-size: 13px;
}
.tw-actions .cancel:hover { background: rgba(255, 255, 255, 0.08); }

.tw-savehint {
  font-size: 12px;
  color: var(--fg-mute);
  margin-top: 8px;
  text-align: center;
}
.tw-savehint.ok { color: #86efac; }
.tw-savehint.err { color: #fda4af; }

/* ── Edit drawer: hint banner + collapsible Advanced section ── */
.tw-jump {
  font-size: 12.5px; line-height: 1.5;
  color: var(--fg-mute);
  background: rgba(167, 139, 250, 0.10);
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  margin: 6px 0 14px;
}
/* ── Light-theme overrides for the Edit drawer ── */
:root[data-theme="light"] .tweaks-scrim,
:root:not([data-theme]) .tweaks-scrim {
  background: rgba(15, 17, 28, 0.32);
}
:root[data-theme="light"] .tweaks-drawer,
:root:not([data-theme]) .tweaks-drawer {
  background: linear-gradient(180deg, #ffffff 0%, #f7f8fc 100%);
  border-left: 1px solid #e6e8ef;
  color: #1a1d2b;
}
:root[data-theme="light"] .tweaks-drawer header h2,
:root:not([data-theme]) .tweaks-drawer header h2 { color: #1a1d2b; }
:root[data-theme="light"] .tweaks-drawer header .x,
:root:not([data-theme]) .tweaks-drawer header .x {
  background: #f3f4f8; color: #6b7080; border-color: #e6e8ef;
}
:root[data-theme="light"] .tweaks-drawer header .x:hover,
:root:not([data-theme]) .tweaks-drawer header .x:hover {
  background: #ecedf3; color: #1a1d2b;
}
:root[data-theme="light"] .tw-editor .heading .name,
:root:not([data-theme]) .tw-editor .heading .name { color: #1a1d2b; }
:root[data-theme="light"] .tw-editor .heading .sub,
:root:not([data-theme]) .tw-editor .heading .sub { color: #6b7080; }
:root[data-theme="light"] .tw-editor .back,
:root:not([data-theme]) .tw-editor .back { color: #6b7080; }
:root[data-theme="light"] .tw-editor .back:hover,
:root:not([data-theme]) .tw-editor .back:hover { color: #1a1d2b; }

:root[data-theme="light"] .tw-section-title,
:root:not([data-theme]) .tw-section-title { color: #6b7080; }
:root[data-theme="light"] .tw-help-top,
:root:not([data-theme]) .tw-help-top { color: #6b7080; }
:root[data-theme="light"] .tw-field .name,
:root:not([data-theme]) .tw-field .name { color: #1a1d2b; }
:root[data-theme="light"] .tw-field.tw-field-empty .name,
:root:not([data-theme]) .tw-field.tw-field-empty .name { color: #8a91a4; }
:root[data-theme="light"] .tw-field .help,
:root:not([data-theme]) .tw-field .help { color: #6b7080; }
:root[data-theme="light"] .tw-field .val,
:root:not([data-theme]) .tw-field .val { color: #1a1d2b; }
:root[data-theme="light"] .tw-grid-2 .tw-field,
:root:not([data-theme]) .tw-grid-2 .tw-field { border-bottom-color: #eef0f5; }
:root[data-theme="light"] .tw-field,
:root:not([data-theme]) .tw-field { border-bottom-color: #eef0f5; }

:root[data-theme="light"] .tw-input,
:root[data-theme="light"] .tw-textarea,
:root[data-theme="light"] .tw-select,
:root:not([data-theme]) .tw-input,
:root:not([data-theme]) .tw-textarea,
:root:not([data-theme]) .tw-select {
  background: #ffffff;
  border-color: #d8dbe4;
  color: #1a1d2b;
}
:root[data-theme="light"] .tw-input:focus,
:root[data-theme="light"] .tw-textarea:focus,
:root[data-theme="light"] .tw-select:focus,
:root:not([data-theme]) .tw-input:focus,
:root:not([data-theme]) .tw-textarea:focus,
:root:not([data-theme]) .tw-select:focus {
  background: #ffffff;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}
:root[data-theme="light"] .tw-input::placeholder,
:root[data-theme="light"] .tw-textarea::placeholder,
:root:not([data-theme]) .tw-input::placeholder,
:root:not([data-theme]) .tw-textarea::placeholder { color: #aab1c0; }

:root[data-theme="light"] .tw-range::-webkit-slider-runnable-track,
:root:not([data-theme]) .tw-range::-webkit-slider-runnable-track {
  background: #d8dbe4;
}
:root[data-theme="light"] .tw-actions,
:root:not([data-theme]) .tw-actions {
  border-top-color: #eef0f5;
}
:root[data-theme="light"] .tw-actions .cancel,
:root:not([data-theme]) .tw-actions .cancel {
  background: #fff; border-color: #d8dbe4; color: #1a1d2b;
}
:root[data-theme="light"] .tw-actions .cancel:hover,
:root:not([data-theme]) .tw-actions .cancel:hover {
  background: #f3f4f8;
}
:root[data-theme="light"] .tw-savehint,
:root:not([data-theme]) .tw-savehint { color: #6b7080; }
:root[data-theme="light"] .tw-savehint.ok,
:root:not([data-theme]) .tw-savehint.ok { color: #047857; }
:root[data-theme="light"] .tw-savehint.err,
:root:not([data-theme]) .tw-savehint.err { color: #b91c1c; }
:root[data-theme="light"] .tw-field-tick,
:root:not([data-theme]) .tw-field-tick { color: #047857; }

:root[data-theme="light"] .tw-jump,
:root:not([data-theme]) .tw-jump {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #4338ca;
}
:root[data-theme="light"] .tw-editor .heading .thumb,
:root:not([data-theme]) .tw-editor .heading .thumb { box-shadow: 0 8px 20px -8px rgba(167, 139, 250, 0.4); }

/* ── call chrome ─────────────────────────────────────────────────────── */

.callchrome-top {
  position: fixed;
  top: 28px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: -0.005em;
  color: var(--fg-0);
  animation: rise 0.4s ease;
  z-index: 8;
}
.callchrome-top .pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.7);
  animation: pulsedot 1.4s ease-in-out infinite;
}
.callchrome-top .pulse.calling {
  background: #fbbf24; box-shadow: 0 0 12px rgba(251, 191, 36, 0.7);
}
.callchrome-top .pulse.ending {
  background: #fb7185; box-shadow: 0 0 12px rgba(251, 113, 133, 0.7);
}
@keyframes pulsedot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.7); }
}
.callchrome-top .who {
  font-weight: 500;
}
.callchrome-top .state {
  color: var(--fg-mute);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}
.callchrome-top .timer {
  font-variant-numeric: tabular-nums;
  color: var(--fg-mute);
  font-size: 12.5px;
  letter-spacing: 0.02em;
  padding-left: 10px;
  margin-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.callchrome-bottom {
  position: fixed;
  bottom: 40px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px;
  align-items: center;
  z-index: 8;
  animation: rise 0.45s ease;
}
.callchrome-bottom .pill {
  height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg-0);
  backdrop-filter: blur(12px);
  transition: background 0.18s ease, transform 0.15s ease, border-color 0.18s ease;
}
.callchrome-bottom .pill:hover { background: rgba(255, 255, 255, 0.1); }
.callchrome-bottom .pill:active { transform: translateY(1px); }
.callchrome-bottom .pill svg { width: 16px; height: 16px; stroke-width: 1.7; fill: none; stroke: currentColor; }
.callchrome-bottom .pill.muted {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.3);
  color: #ddd6fe;
}
.callchrome-bottom .pill.hangup {
  background: rgba(244, 63, 94, 0.18);
  border-color: rgba(244, 63, 94, 0.5);
  color: #fecaca;
  padding: 0 22px;
}
.callchrome-bottom .pill.hangup:hover { background: rgba(244, 63, 94, 0.28); }

/* Light theme — the moody glass pills disappear against a white landing
 * surface (especially End call, where pink text on a pink-tint background
 * has near-zero contrast). Re-skin all three pill variants with proper
 * light-mode chrome: solid surfaces for the destructive action, subtle
 * neutral surfaces for the rest. */
:root[data-theme="light"] .callchrome-bottom .pill,
:root:not([data-theme]) .callchrome-bottom .pill {
  background: #ffffff;
  border-color: #d8dbe4;
  color: #1a1d2b;
  box-shadow: 0 2px 12px rgba(15, 17, 28, 0.08);
}
:root[data-theme="light"] .callchrome-bottom .pill:hover,
:root:not([data-theme]) .callchrome-bottom .pill:hover {
  background: #f3f4f8;
}
:root[data-theme="light"] .callchrome-bottom .pill.muted,
:root:not([data-theme]) .callchrome-bottom .pill.muted {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #5b21b6;
}
:root[data-theme="light"] .callchrome-bottom .pill.hangup,
:root:not([data-theme]) .callchrome-bottom .pill.hangup {
  background: #ef4444;
  border-color: #dc2626;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.30);
}
:root[data-theme="light"] .callchrome-bottom .pill.hangup:hover,
:root:not([data-theme]) .callchrome-bottom .pill.hangup:hover {
  background: #dc2626;
  border-color: #b91c1c;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.38);
}

/* ── live captions ───────────────────────────────────────────────────────
 *
 * Two-line caption rail that sits between the blob and the type-rail. The
 * blob remains the centre of gravity; captions exist to *clarify* what was
 * just said (acting subtitles), not to lead the eye. Hence the soft glass
 * pill backgrounds, the small/dim user line, the slightly larger agent line,
 * and the gentle ascender animation when a new line arrives.
 */
.captions {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  bottom: 172px;
  width: min(640px, calc(100% - 32px));
  display: flex; flex-direction: column; align-items: center;
  gap: 6px;
  z-index: 5;
  pointer-events: none;
}
.cap {
  display: inline-flex; align-items: flex-start; gap: 10px;
  max-width: 100%;
  padding: 8px 16px 9px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  animation: caprise 0.32s cubic-bezier(.2,.9,.3,1);
}
.cap-tag {
  flex-shrink: 0;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 2px;
}
.cap-text {
  font-size: 14px;
  letter-spacing: -0.005em;
  line-height: 1.45;
  color: var(--fg-0);
  word-break: break-word;
  /* Cap any single utterance to ~3 lines so the rail never towers; longer
   * lines get truncated with a fade so the focus stays on the blob. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* The user's own line: smaller and dimmer — it's "what the orb heard". */
.cap-user .cap-text { font-size: 13px; color: rgba(255, 255, 255, 0.72); }
.cap-user .cap-tag  { color: rgba(125, 211, 252, 0.7); }
/* The agent's line: clean, brighter — what they're saying. */
.cap-agent .cap-tag { color: rgba(244, 114, 182, 0.85); }
.cap-agent .cap-text { font-weight: 450; }
@keyframes caprise {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
@media (max-width: 520px) {
  .captions { bottom: 156px; gap: 5px; }
  .cap { padding: 7px 13px 8px; border-radius: 18px; }
  .cap-tag { font-size: 10px; }
  .cap-text { font-size: 13px; }
  .cap-user .cap-text { font-size: 12px; }
}

/* ── "View full chat" affordance (sits above the caption stack) ──────── */
.cap-history-btn {
  pointer-events: auto;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px 5px 10px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: rgba(244, 114, 182, 0.85);
  background: rgba(244, 114, 182, 0.08);
  border: 1px solid rgba(244, 114, 182, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.15s ease;
  margin-bottom: 2px;
}
.cap-history-btn svg { width: 13px; height: 13px; stroke-width: 1.7; flex-shrink: 0; }
.cap-history-btn:hover {
  background: rgba(244, 114, 182, 0.16);
  border-color: rgba(244, 114, 182, 0.4);
  color: #fbcfe8;
}
.cap-history-btn:active { transform: translateY(0.5px); }

/* ── full conversation panel ─────────────────────────────────────────────
 *
 * Half-height glass card rising from the bottom. The blob still breathes
 * above it (intentional — you can see Eva "thinking" while reading back).
 * Auto-scrolls to latest turn.
 */
.chatpanel-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(2px);
  z-index: 14;
  animation: scrimfade 0.25s ease;
}
@keyframes scrimfade { from { opacity: 0; } to { opacity: 1; } }
.chatpanel {
  position: fixed;
  left: 50%; bottom: 0;
  transform: translateX(-50%);
  width: min(680px, 100%);
  max-height: 62vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(20, 14, 38, 0.82), rgba(14, 10, 26, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 0;
  border-radius: 22px 22px 0 0;
  backdrop-filter: blur(24px) saturate(140%);
  z-index: 15;
  animation: chatpanelrise 0.32s cubic-bezier(.2,.9,.3,1);
  box-shadow: 0 -18px 60px rgba(0, 0, 0, 0.55);
}
@keyframes chatpanelrise {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}
.chatpanel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.chatpanel-head .title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-0);
  letter-spacing: -0.005em;
}
.chatpanel-head .title svg { width: 16px; height: 16px; color: rgba(244, 114, 182, 0.85); }
.chatpanel-head .count {
  margin-left: 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  font-weight: 400;
}
.chatpanel-head .x {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--fg-mute);
  transition: background 0.18s ease, color 0.18s ease;
}
.chatpanel-head .x:hover { background: rgba(255, 255, 255, 0.08); color: var(--fg-0); }
.chatpanel-head .x svg { width: 16px; height: 16px; }

.chatpanel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 18px;
  /* Subtle gradient masks at top/bottom so messages fade as they scroll
   * under the header rather than cutting off harshly. */
  mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 8px), transparent 100%);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 14px, #000 calc(100% - 8px), transparent 100%);
}
.chatpanel-empty {
  text-align: center;
  color: var(--fg-mute);
  font-size: 13px;
  padding: 32px 12px;
}

.chatmsg {
  display: flex; flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
  max-width: 86%;
}
.chatmsg .who {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
}
.chatmsg .who .role {
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.chatmsg .who .ts {
  font-variant-numeric: tabular-nums;
  color: var(--fg-dim);
}
.chatmsg .text {
  padding: 9px 14px 10px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-0);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  letter-spacing: -0.005em;
  word-break: break-word;
}
/* User turns: right-aligned, cyan-tinted (matches caption palette) */
.chatmsg-user { align-self: flex-end; align-items: flex-end; }
.chatmsg-user .who .role { color: rgba(125, 211, 252, 0.85); }
.chatmsg-user .text {
  background: rgba(56, 189, 248, 0.10);
  border-color: rgba(56, 189, 248, 0.22);
}
/* Agent turns: left-aligned, magenta-tinted */
.chatmsg-agent { align-self: flex-start; align-items: flex-start; }
.chatmsg-agent .who .role { color: rgba(244, 114, 182, 0.85); }
.chatmsg-agent .text {
  background: rgba(244, 114, 182, 0.07);
  border-color: rgba(244, 114, 182, 0.18);
}
@media (max-width: 520px) {
  .chatpanel { width: 100%; border-radius: 18px 18px 0 0; max-height: 68vh; }
  .chatmsg { max-width: 92%; }
  .chatmsg .text { font-size: 13px; }
}

/* Light-mode overrides: the call view stays "moody" (the blob is the star),
 * but the conversation panel needs to look at home in light mode too — the
 * dark glass surface clashes with a bright landing. */
:root[data-theme="light"] .chatpanel-scrim,
:root:not([data-theme]) .chatpanel-scrim {
  background: rgba(15, 17, 28, 0.10);
}
:root[data-theme="light"] .chatpanel,
:root:not([data-theme]) .chatpanel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 249, 252, 0.98));
  border-color: rgba(15, 17, 28, 0.08);
  box-shadow: 0 -18px 60px rgba(15, 17, 28, 0.12);
}
:root[data-theme="light"] .chatpanel-head,
:root:not([data-theme]) .chatpanel-head {
  border-bottom-color: rgba(15, 17, 28, 0.06);
}
:root[data-theme="light"] .chatpanel-head .title,
:root:not([data-theme]) .chatpanel-head .title { color: #1a1d2b; }
:root[data-theme="light"] .chatpanel-head .title svg,
:root:not([data-theme]) .chatpanel-head .title svg { color: #a78bfa; }
:root[data-theme="light"] .chatpanel-head .count,
:root:not([data-theme]) .chatpanel-head .count { color: #6b7080; }
:root[data-theme="light"] .chatpanel-head .x,
:root:not([data-theme]) .chatpanel-head .x { color: #6b7080; }
:root[data-theme="light"] .chatpanel-head .x:hover,
:root:not([data-theme]) .chatpanel-head .x:hover {
  background: rgba(15, 17, 28, 0.06); color: #1a1d2b;
}
:root[data-theme="light"] .chatpanel-empty,
:root:not([data-theme]) .chatpanel-empty { color: #6b7080; }
:root[data-theme="light"] .chatmsg .who,
:root:not([data-theme]) .chatmsg .who { color: #6b7080; }
:root[data-theme="light"] .chatmsg .who .ts,
:root:not([data-theme]) .chatmsg .who .ts { color: #9aa0ad; }
:root[data-theme="light"] .chatmsg .text,
:root:not([data-theme]) .chatmsg .text {
  color: #1a1d2b;
  background: #f3f4f8;
  border-color: #e6e8ef;
}
:root[data-theme="light"] .chatmsg-user .who .role,
:root:not([data-theme]) .chatmsg-user .who .role { color: #0284c7; }
:root[data-theme="light"] .chatmsg-user .text,
:root:not([data-theme]) .chatmsg-user .text {
  background: rgba(56, 189, 248, 0.10);
  border-color: rgba(56, 189, 248, 0.28);
}
:root[data-theme="light"] .chatmsg-agent .who .role,
:root:not([data-theme]) .chatmsg-agent .who .role { color: #be185d; }
:root[data-theme="light"] .chatmsg-agent .text,
:root:not([data-theme]) .chatmsg-agent .text {
  background: rgba(244, 114, 182, 0.08);
  border-color: rgba(244, 114, 182, 0.28);
}

/* Call chrome top pill (the "Eva · on the line · 00:27" badge) also needs
 * a light-mode read. Same idea: the rest of the scene stays moody, this
 * little widget catches the eye. */
:root[data-theme="light"] .callchrome-top,
:root:not([data-theme]) .callchrome-top {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 17, 28, 0.08);
  box-shadow: 0 6px 22px rgba(15, 17, 28, 0.10);
  color: #1a1d2b;
}
:root[data-theme="light"] .callchrome-top .who,
:root:not([data-theme]) .callchrome-top .who { color: #1a1d2b; }
:root[data-theme="light"] .callchrome-top .state,
:root:not([data-theme]) .callchrome-top .state { color: #6b7080; }
:root[data-theme="light"] .callchrome-top .timer,
:root:not([data-theme]) .callchrome-top .timer { color: #6b7080; }

/* type-to-Eva fallback input (always visible during a call) */
.type-rail {
  position: fixed;
  bottom: 110px;
  left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  z-index: 6;
  animation: rise 0.45s ease;
}
.type-rail form {
  display: flex; gap: 8px; align-items: center;
}
.type-rail input {
  flex: 1; height: 44px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 0 18px;
  color: var(--fg-0);
  font-size: 14px;
  letter-spacing: -0.005em;
  backdrop-filter: blur(14px);
  outline: 0;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.type-rail input::placeholder { color: rgba(196, 181, 253, 0.5); }
.type-rail input:focus {
  border-color: rgba(192, 132, 252, 0.55);
  background: rgba(0, 0, 0, 0.6);
}
.type-rail button {
  height: 44px; padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f0abfc, #c4b5fd);
  color: #1a0f2e;
  font-weight: 600;
  font-size: 13.5px;
  border: 0;
  cursor: pointer;
}
.type-rail button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── agent cockpit (post-build) ───────────────────────────────────────────
 *
 * What the user sees the moment Eva hands off. Multi-card dashboard that
 * sets up the next step (test / go live) and surfaces the bells-and-whistles
 * for ops/team handoff. The shell is a fixed full-screen overlay with a
 * scrim; the inner shell sits in the centre and scrolls if content overflows.
 */
.cockpit {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 24px 48px;
  overflow-y: auto;
  animation: cockpitfade 0.5s cubic-bezier(.2,.9,.3,1);
}
.cockpit-bg {
  position: fixed;
  inset: 0;
  /* Single deep-tinted scrim — no backdrop-filter on the cockpit's inner
   * cards because stacking many of them tanks headless Chrome's renderer.
   * The orb behind is already kept calm (audio-reactive only) so a solid
   * scrim is enough to focus attention on the cockpit content. */
  background: linear-gradient(180deg, rgba(8, 5, 18, 0.92) 0%, rgba(2, 1, 8, 0.96) 100%);
  z-index: -1;
}
.cockpit-shell {
  width: min(900px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}
@keyframes cockpitfade {
  0%   { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── cockpit: head — identity block ──────────────────────────────────── */
.cockpit-head {
  position: relative;
  background: linear-gradient(180deg, rgba(28, 19, 52, 0.92), rgba(18, 13, 32, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 26px 28px 22px;
}
.cockpit-eyebrow {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 12px;
}
.cockpit-id {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.cockpit-thumb {
  width: 60px; height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(circle at 35% 28%, #fde7f3 0%, #c4b5fd 40%, #a5f3fc 75%, #0e0a1a 100%);
  box-shadow: 0 6px 24px rgba(244, 114, 182, 0.28),
              inset -3px -4px 8px rgba(0, 0, 0, 0.28);
  position: relative;
}
.cockpit-thumb::after {
  content: "";
  position: absolute;
  top: 12%; left: 22%;
  width: 36%; height: 22%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  filter: blur(4px);
}
.cockpit-name {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 4px;
}
.cockpit-tagline {
  font-size: 14px;
  color: var(--fg-mute);
  margin: 0 0 12px;
}
.cockpit-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.cockpit-pills .pill {
  display: inline-flex; align-items: center;
  padding: 4px 10px;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--fg-0);
}
.cockpit-pills .pill.accent {
  background: rgba(244, 114, 182, 0.12);
  border-color: rgba(244, 114, 182, 0.32);
  color: #fbcfe8;
}
.cockpit-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--fg-mute);
  transition: background 0.2s ease, color 0.2s ease;
}
.cockpit-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--fg-0); }
.cockpit-close svg { width: 16px; height: 16px; }

/* ── cockpit: hero CTAs ──────────────────────────────────────────────── */
.cockpit-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.ck-cta {
  /* Cockpit-namespaced — `.cta` is already taken by the landing CTA, which
   * is `position: fixed; bottom: 56px; ...`. Reusing the class name would
   * make these buttons render as fixed-position floaters over the cards. */
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(28, 19, 52, 0.85);
  color: var(--fg-0);
}
.ck-cta:hover { transform: translateY(-1px); }
.ck-cta:active { transform: translateY(0.5px); }
.ck-cta svg { width: 22px; height: 22px; flex-shrink: 0; }
.ck-cta-body { display: flex; flex-direction: column; min-width: 0; }
.ck-cta-title { font-size: 15.5px; font-weight: 550; letter-spacing: -0.01em; }
.ck-cta-sub   { font-size: 12.5px; color: var(--fg-mute); margin-top: 2px; }
.ck-cta-primary {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.22), rgba(192, 132, 252, 0.18));
  border-color: rgba(244, 114, 182, 0.45);
  box-shadow: 0 8px 28px rgba(244, 114, 182, 0.18);
}
.ck-cta-primary .ck-cta-title { color: #fbcfe8; }
.ck-cta-primary svg { color: #fbcfe8; }
.ck-cta-primary:hover {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.3), rgba(192, 132, 252, 0.24));
  border-color: rgba(244, 114, 182, 0.6);
}
.ck-cta-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.16);
}
@media (max-width: 540px) {
  .cockpit-hero { grid-template-columns: 1fr; }
}

/* ── cockpit: context grid ───────────────────────────────────────────── */
.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
@media (max-width: 880px) {
  .cockpit-grid { grid-template-columns: 1fr; }
}
.ck-card {
  background: rgba(28, 19, 52, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ck-card header h3 {
  font-size: 13px;
  font-weight: 550;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin: 0;
}
.ck-row { display: flex; flex-direction: column; gap: 6px; }
.ck-row-thin { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.ck-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.ck-quote {
  margin: 0;
  padding: 10px 12px;
  background: rgba(244, 114, 182, 0.06);
  border-left: 2px solid rgba(244, 114, 182, 0.4);
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--fg-0);
  font-style: italic;
}
.ck-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.ck-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(125, 211, 252, 0.10);
  border: 1px solid rgba(125, 211, 252, 0.22);
  color: rgba(186, 230, 253, 0.95);
  text-transform: capitalize;
}
.ck-mini {
  font-size: 11px;
  color: var(--fg-mute);
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ck-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 8px;
}
.ck-list li {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px;
  color: var(--fg-0);
}
.ck-list svg { width: 13px; height: 13px; color: rgba(110, 231, 183, 0.9); flex-shrink: 0; }
.ck-list-aux { color: var(--fg-mute) !important; font-size: 12px !important; }
.ck-list-aux code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}
.ck-empty {
  font-size: 12.5px;
  color: var(--fg-mute);
  margin: 0;
}
.ck-lede {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--fg-mute);
  margin: 0;
}
.ck-handoffs {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}
.ck-handoff {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 11px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 11px;
}
.ck-handoff-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px;
  color: var(--fg-0);
}
.ck-handoff-title svg { width: 13px; height: 13px; color: var(--fg-mute); }
.ck-handoff-status { font-size: 11px; }
.ck-handoff-status .ok { color: #86efac; }
.ck-handoff-status .muted { color: var(--fg-dim); }
.ck-handoff-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12.5px;
  color: var(--fg-0);
  align-self: flex-start;
  transition: background 0.18s ease;
}
.ck-handoff-btn:hover { background: rgba(255, 255, 255, 0.08); }
.ck-handoff-btn svg { width: 13px; height: 13px; }

/* ── cockpit: footer ─────────────────────────────────────────────────── */
.cockpit-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
}
.cockpit-link {
  font-size: 12.5px;
  color: var(--fg-mute);
  letter-spacing: 0.01em;
  transition: color 0.18s ease;
}
.cockpit-link:hover { color: var(--fg-0); }
.cockpit-foot-id {
  font-size: 11px;
  color: var(--fg-dim);
  letter-spacing: 0.04em;
}

/* ── /agents — full-page agent list ────────────────────────────────────
 *
 * Replaces the old tweaks-drawer "Your agents" tab. A real page reachable at
 * /agents, opened from the top-right dots menu or the landing's secondary
 * link. Grid of agent cards; click → /agent/<slug>; "Build new" → /build.
 */
.agents-page {
  position: fixed;
  inset: 0;
  z-index: 11;
  overflow-y: auto;
  padding: 80px 36px 56px;
  background: linear-gradient(180deg, rgba(8, 5, 18, 0.96), rgba(2, 1, 8, 0.99));
  animation: agentsfade 0.4s cubic-bezier(.2,.9,.3,1);
}
@keyframes agentsfade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.agents-head {
  max-width: 1080px;
  margin: 0 auto 28px;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.agents-eyebrow {
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 8px;
}
.agents-title {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 38px);
  font-weight: 600;
  letter-spacing: -0.022em;
  background: linear-gradient(180deg, #ffffff, #d8d4f5);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.agents-actions { display: flex; align-items: center; gap: 10px; }
.agents-search {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--fg-0);
  font: inherit;
  font-size: 13px;
  width: 240px;
  outline: 0;
}
.agents-search::placeholder { color: var(--fg-dim); }
.agents-search:focus { border-color: rgba(244, 114, 182, 0.4); }
.agents-new {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbcfe8, #ddd6fe 50%, #bae6fd);
  color: #1a0f2e;
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: -0.005em;
  border: 0;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(244, 114, 182, 0.2);
  transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}
.agents-new:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 10px 26px rgba(244, 114, 182, 0.28); }
.agents-new-spark { filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6)); }

.agents-grid {
  max-width: 1080px;
  margin: 0 auto;
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.agent-card {
  position: relative;
  background: rgba(28, 19, 52, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}
.agent-card:hover {
  transform: translateY(-2px);
  border-color: rgba(244, 114, 182, 0.32);
  background: rgba(36, 24, 64, 0.82);
}
.agent-card-tap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 18px 18px 16px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.agent-card-thumb {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde7f3 0%, #c4b5fd 45%, #a5f3fc 80%, #0e0a1a 100%);
  box-shadow: 0 4px 16px rgba(244, 114, 182, 0.22),
              inset -2px -3px 6px rgba(0, 0, 0, 0.25);
}
.agent-card-meta { display: flex; flex-direction: column; gap: 4px; }
.agent-card-name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--fg-0);
}
.agent-card-sub {
  font-size: 12px;
  letter-spacing: 0.005em;
  color: var(--fg-mute);
}
.agent-card-greet {
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.62);
  font-style: italic;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.agent-card-del {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: var(--fg-dim);
  opacity: 0;
  transition: background 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}
.agent-card:hover .agent-card-del { opacity: 1; }
.agent-card-del:hover { background: rgba(244, 63, 94, 0.16); color: #fda4af; }
.agent-card-del svg { width: 14px; height: 14px; }

.agents-empty {
  max-width: 520px;
  margin: 48px auto 0;
  text-align: center;
  padding: 36px 28px;
}
.agents-empty-orb {
  width: 92px; height: 92px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde7f3, #c4b5fd 50%, #a5f3fc 88%, #0e0a1a);
  box-shadow: 0 10px 40px rgba(244, 114, 182, 0.2),
              inset -3px -4px 8px rgba(0, 0, 0, 0.28);
  opacity: 0.86;
}
.agents-empty-title {
  font-size: 18px;
  font-weight: 550;
  letter-spacing: -0.012em;
  margin-bottom: 6px;
}
.agents-empty-sub {
  font-size: 13.5px;
  color: var(--fg-mute);
  line-height: 1.55;
  margin-bottom: 18px;
}
.agents-empty-cta {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbcfe8, #ddd6fe 50%, #bae6fd);
  color: #1a0f2e;
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  border: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(244, 114, 182, 0.22);
}

/* ── theatrical unveal ──────────────────────────────────────────────────
 *
 * Three-second curtain between Eva's "she's all set" and the cockpit. Beats:
 *   0.0–0.6s   Curtain darkens, a soft spotlight glows in the centre.
 *   0.6–1.4s   "— meet —" eyebrow fades up.
 *   1.0+ +0.06s per letter   Agent name flips in letter-by-letter with a
 *                              chromatic shimmer (iridescent gradient).
 *   ~2.0s      Sector / locale / voice tagline settles in below.
 *   3.3s       onDone() — cockpit takes over.
 */
.unveal {
  position: fixed;
  inset: 0;
  z-index: 16;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px;
  background: rgba(2, 1, 8, 0.85);
  overflow: hidden;
  animation: unveal-fade 0.6s ease;
}
@keyframes unveal-fade { from { opacity: 0; } to { opacity: 1; } }
.unveal-curtain {
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 50% at 50% 45%, rgba(244, 114, 182, 0.18) 0%, rgba(0, 0, 0, 0) 60%);
  pointer-events: none;
  opacity: 0;
  animation: unveal-curtain-in 1.2s cubic-bezier(.2,.9,.3,1) 0.2s forwards;
}
.unveal-spot {
  position: absolute;
  left: 50%; top: 45%;
  width: 320px; height: 320px;
  margin: -160px 0 0 -160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.32), rgba(192, 132, 252, 0.18) 45%, rgba(0, 0, 0, 0) 75%);
  filter: blur(30px);
  pointer-events: none;
  opacity: 0;
  animation: unveal-spot-pulse 2.4s cubic-bezier(.2,.9,.3,1) 0.3s forwards;
}
@keyframes unveal-curtain-in { to { opacity: 1; } }
@keyframes unveal-spot-pulse {
  0%   { opacity: 0; transform: scale(0.7); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 0.78; transform: scale(1); }
}
/* Light SpiderX logo pinned near the top of the dark reveal canvas.
   The SVG wordmark is `currentColor`, so forcing color:#fff here makes
   it read as the light/white variant against the near-black bg; the
   red X accent (hardcoded fill) stays as the brand pop. */
.unveal-brand {
  position: absolute;
  top: clamp(28px, 6vh, 64px);
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  opacity: 0;
  animation: unveal-fadein 0.8s ease 0.15s forwards;
  pointer-events: none;
}
.unveal-eyebrow {
  position: relative;
  font-size: 11px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: rgba(244, 114, 182, 0.85);
  opacity: 0;
  animation: unveal-fadein 0.7s ease 0.7s forwards;
}
.unveal-name {
  position: relative;
  margin: 6px 0 4px;
  font-size: clamp(48px, 8.2vw, 96px);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  display: inline-flex;
  gap: 0;
}
.unveal-ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  background: linear-gradient(135deg, #fbcfe8 0%, #c4b5fd 50%, #a5f3fc 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 0 18px rgba(244, 114, 182, 0.28));
  animation: unveal-letter 0.55s cubic-bezier(.2,.9,.3,1) forwards;
}
@keyframes unveal-letter {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes unveal-fadein { to { opacity: 1; } }
.unveal-tagline {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.6);
  opacity: 0;
  animation: unveal-fadein 0.7s ease 2.0s forwards;
}
.unveal-tagline .dot { color: var(--fg-dim); }
.unveal-skip {
  position: absolute;
  right: 22px; bottom: 22px;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--fg-mute);
  background: transparent;
  border: 0; cursor: pointer;
  padding: 6px 12px;
  opacity: 0;
  animation: unveal-fadein 0.6s ease 1.8s forwards;
  transition: color 0.18s ease;
}
.unveal-skip:hover { color: var(--fg-0); }

/* ── cockpit additions: step rail + step card + plan badge ─────────────── */

.cockpit-eyebrow {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-dim);
}
.cockpit-plan {
  display: inline-flex; align-items: center; gap: 6px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-size: 11.5px;
  color: rgba(125, 211, 252, 0.85);
  padding: 4px 10px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 999px;
}
.cockpit-plan svg { width: 12px; height: 12px; }

.cockpit-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 4px;
  background: rgba(28, 19, 52, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 14px;
}
.rail-step {
  flex: 1;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  background: transparent;
  border: 0;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.01em;
  color: var(--fg-mute);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
  justify-content: center;
}
.rail-step:hover { background: rgba(255, 255, 255, 0.04); color: var(--fg-0); }
.rail-step.active {
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(192, 132, 252, 0.14));
  color: var(--fg-0);
}
.rail-step.done { color: rgba(110, 231, 183, 0.85); }
.rail-dot {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0;
  flex-shrink: 0;
}
.rail-step.active .rail-dot {
  background: linear-gradient(135deg, #fbcfe8, #c4b5fd);
  color: #1a0f2e;
}
.rail-step.done .rail-dot {
  background: rgba(110, 231, 183, 0.18);
  color: rgba(110, 231, 183, 0.95);
}
@media (max-width: 720px) {
  .rail-step .rail-label { display: none; }
  .rail-step { padding: 8px; }
}

.cockpit-step {
  background: rgba(28, 19, 52, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 18px;
  padding: 22px 24px 24px;
  display: flex; flex-direction: column;
  gap: 18px;
  min-height: 280px;
}
.step-head h2 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.018em;
}
.step-head p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg-mute);
  max-width: 60ch;
}
.step-options { display: flex; flex-direction: column; gap: 12px; }
.step-body { display: flex; flex-direction: column; gap: 12px; }
.step-tools {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 8px;
}
.step-tools li {
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px;
  color: var(--fg-0);
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.step-tools li code {
  font-size: 12px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}
.tool-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  font-size: 11px;
  background: rgba(110, 231, 183, 0.16);
  color: rgba(110, 231, 183, 0.95);
  flex-shrink: 0;
}
.step-skip {
  align-self: flex-start;
  padding: 8px 14px;
  font-size: 12.5px;
  letter-spacing: 0.005em;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: var(--fg-0);
  cursor: pointer;
  transition: background 0.18s ease;
}
.step-skip:hover { background: rgba(255, 255, 255, 0.08); }

.step-dropzone {
  display: flex; align-items: center; gap: 14px;
  padding: 22px;
  border-radius: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.02);
}
.step-dropzone svg { width: 28px; height: 28px; color: var(--fg-mute); flex-shrink: 0; }
.dz-title { font-size: 14px; color: var(--fg-0); margin-bottom: 2px; }
.dz-sub { font-size: 12px; color: var(--fg-mute); }

/* ── phone-test mini-form ─────────────────────────────────────────────── */
.phone-test {
  display: flex; flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
}
.phone-test-head { display: flex; align-items: center; gap: 12px; }
.phone-test-head svg { width: 22px; height: 22px; color: rgba(125, 211, 252, 0.9); flex-shrink: 0; }
.pt-title { font-size: 14px; color: var(--fg-0); font-weight: 500; }
.pt-sub   { font-size: 12px; color: var(--fg-mute); margin-top: 2px; }
.phone-test-row { display: flex; gap: 8px; }
.pt-input {
  flex: 1;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg-0);
  font: inherit;
  font-size: 13.5px;
  outline: 0;
  transition: border-color 0.18s ease;
}
.pt-input::placeholder { color: rgba(255, 255, 255, 0.32); }
.pt-input:focus { border-color: rgba(125, 211, 252, 0.5); }
.pt-go {
  height: 40px; padding: 0 18px;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.16);
  border: 1px solid rgba(125, 211, 252, 0.32);
  color: #bae6fd;
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  transition: background 0.18s ease;
}
.pt-go:hover:not(:disabled) { background: rgba(125, 211, 252, 0.24); }
.pt-go:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── go-live cards (region-aware + embed) ─────────────────────────────── */
.live-card {
  padding: 18px 20px 20px;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.08), rgba(192, 132, 252, 0.06));
  border: 1px solid rgba(244, 114, 182, 0.22);
  border-radius: 16px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.live-card-secondary {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
.live-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 4px;
}
.live-tag {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(244, 114, 182, 0.9);
  padding: 3px 8px;
  background: rgba(244, 114, 182, 0.1);
  border: 1px solid rgba(244, 114, 182, 0.3);
  border-radius: 6px;
}
.live-provider {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  text-transform: uppercase;
}
.live-card-title {
  font-size: 17px;
  font-weight: 550;
  letter-spacing: -0.012em;
  color: var(--fg-0);
}
.live-card-sub {
  font-size: 13px;
  color: var(--fg-mute);
  margin-bottom: 6px;
}
.live-card-cta {
  align-self: flex-start;
  margin-top: 4px;
  padding: 0 18px;
  height: 44px;
}
.live-alts {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--fg-dim);
}
.live-alt {
  font-size: 12px;
  color: var(--fg-mute);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.live-alt:hover { background: rgba(255, 255, 255, 0.06); color: var(--fg-0); }

.live-safety {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-top: 4px;
  background: rgba(125, 211, 252, 0.04);
  border: 1px solid rgba(125, 211, 252, 0.10);
  border-radius: 12px;
}
.live-safety-icon {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  color: rgb(125, 211, 252);
  margin-top: 2px;
}
.live-safety-icon svg { width: 100%; height: 100%; }
.live-safety-body { min-width: 0; }
.live-safety-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-0);
  margin-bottom: 2px;
}
.live-safety-rules {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--fg-dim);
}
.live-safety-link {
  font-size: 12px;
  color: var(--fg-mute);
  background: none;
  border: none;
  padding: 0;
  margin-left: 4px;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.18);
  text-underline-offset: 2px;
}
.live-safety-link:hover { color: var(--fg-0); }

/* ── performance step (call log + outcome tiles) ──────────────────────── */
.perf-outcomes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}
.perf-outcome {
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.06), rgba(244, 114, 182, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  text-align: center;
}
.perf-outcome-count {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--fg-0);
}
.perf-outcome-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: capitalize;
  color: var(--fg-mute);
  margin-top: 2px;
}
.perf-empty {
  padding: 28px 22px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  text-align: center;
}
.perf-empty-title { font-size: 14px; color: var(--fg-0); margin-bottom: 6px; }
.perf-empty-sub { font-size: 12.5px; color: var(--fg-mute); line-height: 1.55; }
.perf-empty-sub b { color: rgba(244, 114, 182, 0.85); font-weight: 500; }

.call-log {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
  gap: 6px;
}
.call-row {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}
.call-row-head {
  display: flex; align-items: center; gap: 10px;
  font-size: 11.5px;
}
.call-outcome {
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: capitalize;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--fg-mute);
}
.call-outcome-booked,
.call-outcome-resolved,
.call-outcome-qualified,
.call-outcome-intake_complete {
  background: rgba(110, 231, 183, 0.14);
  color: rgba(110, 231, 183, 0.95);
}
.call-outcome-callback_requested,
.call-outcome-rescheduled,
.call-outcome-info_only {
  background: rgba(125, 211, 252, 0.14);
  color: rgba(125, 211, 252, 0.95);
}
.call-outcome-not_interested,
.call-outcome-wrong_number,
.call-outcome-voicemail {
  background: rgba(244, 114, 182, 0.1);
  color: rgba(244, 114, 182, 0.85);
}
.call-time { color: var(--fg-dim); font-variant-numeric: tabular-nums; }
.call-dur  { margin-left: auto; color: var(--fg-mute); }
.call-summary {
  font-size: 13px;
  color: var(--fg-0);
  margin-top: 6px;
  line-height: 1.45;
}

/* ── cockpit footer (Back / Next nav row) ─────────────────────────────── */
.cockpit-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px;
  gap: 12px;
}
.cockpit-next {
  padding: 8px 18px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(244, 114, 182, 0.18), rgba(192, 132, 252, 0.14));
  border: 1px solid rgba(244, 114, 182, 0.32);
  color: #fbcfe8;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease;
}
.cockpit-next:hover { background: linear-gradient(135deg, rgba(244, 114, 182, 0.26), rgba(192, 132, 252, 0.22)); }

/* ── agent reveal (post-build) — legacy, kept for the type-rail style ─ */

.reveal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12;
  padding: 32px 24px;
  animation: revealfade 0.55s cubic-bezier(.2, .9, .3, 1);
}
@keyframes revealfade {
  0%   { opacity: 0; transform: translateY(8px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.reveal-card {
  width: min(560px, 100%);
  background: linear-gradient(180deg, rgba(20, 14, 38, 0.7), rgba(14, 10, 26, 0.78));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 28px;
  backdrop-filter: blur(28px) saturate(140%);
  box-shadow:
    0 40px 80px -20px rgba(192, 132, 252, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 36px 36px 28px;
  text-align: center;
}

.reveal-eyebrow {
  font-size: 10.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 18px;
}

.reveal-thumb {
  width: 96px; height: 96px;
  border-radius: 999px;
  margin: 0 auto 22px;
  background: radial-gradient(circle at 35% 30%, #fde7f3, #a78bfa 50%, #fb7185 100%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 18px 48px -18px rgba(244, 114, 182, 0.65);
  position: relative;
  animation: reveal-pop 0.7s cubic-bezier(.2, .9, .3, 1);
}
@keyframes reveal-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.04); }
  100% { transform: scale(1); opacity: 1; }
}
.reveal-thumb::after {
  content: "";
  position: absolute;
  top: 18%; left: 22%;
  width: 18px; height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  filter: blur(3px);
}

.reveal-name {
  font-size: clamp(28px, 4.5vw, 36px);
  font-weight: 500;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff 30%, #d0c8f0 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 8px;
}

.reveal-tagline {
  font-size: 14px;
  color: var(--fg-mute);
  letter-spacing: -0.005em;
  margin: 0 0 18px;
}

.reveal-pills {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px;
  margin-bottom: 22px;
}
.reveal-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--fg-1);
  letter-spacing: -0.005em;
}
.reveal-pill.accent {
  background: rgba(192, 132, 252, 0.12);
  border-color: rgba(192, 132, 252, 0.32);
  color: #e9d5ff;
}

.reveal-greeting {
  font-size: 15px;
  font-style: italic;
  color: var(--fg-0);
  line-height: 1.55;
  letter-spacing: -0.005em;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.05);
  margin: 0 0 22px;
}
.reveal-greeting::before { content: "\201C"; color: var(--accent-2); margin-right: 4px; }
.reveal-greeting::after  { content: "\201D"; color: var(--accent-2); margin-left: 4px; }

.reveal-section-label {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--fg-dim);
  margin-bottom: 8px;
}

.reveal-connectors {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 6px;
  margin-bottom: 26px;
}
.reveal-cx {
  display: inline-flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 9px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  font-size: 11.5px;
  letter-spacing: -0.005em;
}

.reveal-actions {
  display: flex; gap: 10px;
  margin-top: 8px;
}
.reveal-actions .a {
  flex: 1; height: 48px;
  border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: filter 0.18s ease, transform 0.15s ease, background 0.18s ease;
}
.reveal-actions .a.secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg-0);
}
.reveal-actions .a.secondary:hover { background: rgba(255, 255, 255, 0.09); }
.reveal-actions .a.primary {
  background: linear-gradient(135deg, #f0abfc, #c4b5fd 50%, #a5f3fc);
  color: #1a0f2e;
  font-weight: 600;
  box-shadow: 0 18px 40px -16px rgba(192, 132, 252, 0.6);
}
.reveal-actions .a.primary:hover { filter: brightness(1.06); }
.reveal-actions .a.primary:active { transform: translateY(1px); }
.reveal-actions .a svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.7; }

.reveal-skip {
  display: block;
  margin: 18px auto 0;
  font-size: 12px;
  color: var(--fg-dim);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s ease;
}
.reveal-skip:hover { color: var(--fg-mute); }

/* go-live modal */
.golive-modal {
  position: fixed; inset: 0;
  z-index: 25;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  animation: revealfade 0.3s ease;
}
.golive-card {
  width: min(540px, calc(100% - 32px));
  background: linear-gradient(180deg, rgba(20, 14, 38, 0.95), rgba(14, 10, 26, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 22px;
  padding: 28px 30px;
}
.golive-card h2 {
  margin: 0 0 4px;
  font-size: 20px; font-weight: 500;
  letter-spacing: -0.015em;
}
.golive-card .lede {
  color: var(--fg-mute); font-size: 14px; margin: 0 0 18px;
}
.golive-step {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.golive-step .num {
  font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--fg-dim); margin-bottom: 4px;
}
.golive-step .text { font-size: 13.5px; color: var(--fg-0); line-height: 1.5; }
.golive-step .text code {
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 12px; user-select: all;
  display: inline-block;
  word-break: break-all;
}
.golive-actions { display: flex; gap: 10px; margin-top: 22px; }
.golive-actions button { flex: 1; height: 42px; border-radius: 999px; font-size: 13.5px; }
.golive-actions .close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--fg-0);
}
.golive-actions .copy {
  background: linear-gradient(135deg, #f0abfc, #c4b5fd);
  color: #1a0f2e; font-weight: 600;
}
.golive-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.golive-actions-compact { margin-top: 14px; }
.golive-actions-compact button { flex: 0 0 auto; padding: 0 18px; }

/* Phase 1: friendly number-request form */
.golive-form {
  display: flex; flex-direction: column;
  gap: 14px;
  margin-top: 18px;
}
.golive-field {
  display: flex; flex-direction: column;
  gap: 6px;
}
.golive-label {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--fg-dim);
}
.golive-label .golive-opt {
  font-weight: 400;
  color: var(--fg-mute);
  margin-left: 4px;
}
.golive-input,
.golive-select {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: var(--fg-0);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.golive-input:focus,
.golive-select:focus {
  border-color: rgba(192, 132, 252, 0.55);
  background: rgba(255, 255, 255, 0.06);
}
.golive-select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='1.7'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}
.golive-select option { background: #1a1023; color: var(--fg-0); }
.golive-help {
  font-size: 12px;
  color: var(--fg-mute);
}
.golive-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.10);
  border: 1px solid rgba(248, 113, 113, 0.30);
  color: #fecaca;
  font-size: 13px;
}

.golive-manual-toggle {
  margin-top: 16px;
  background: none;
  border: none;
  padding: 0;
  font-size: 12.5px;
  color: var(--fg-mute);
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.18);
  text-underline-offset: 2px;
}
.golive-manual-toggle:hover { color: var(--fg-0); }
.golive-manual {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.10);
}
.golive-manual .golive-step { margin-bottom: 14px; }
.golive-manual .golive-step:last-of-type { margin-bottom: 0; }

.golive-success {
  display: flex; flex-direction: column;
  gap: 10px;
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(125, 211, 252, 0.05);
  border: 1px solid rgba(125, 211, 252, 0.14);
}
.golive-success-row {
  display: flex; align-items: flex-start;
  gap: 10px;
  font-size: 13.5px;
  color: var(--fg-0);
  line-height: 1.5;
}
.golive-success-icon {
  flex: 0 0 18px;
  color: rgb(125, 211, 252);
  font-size: 14px;
  line-height: 1.4;
}
.golive-link {
  color: rgb(196, 181, 253);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.golive-link:hover { color: #fff; }

/* ─────────────────────────────────────────────────────────────────────────
 * Dashboard shell — white-theme page chrome for /agents, /agent/<slug>/...
 * The landing splash, /build, and the dark cockpit modal keep the original
 * dark theme. This scope only applies under <div class="db-root">.
 * ───────────────────────────────────────────────────────────────────────── */

.db-root {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: flex;
  flex-direction: column;
  background: #f7f8fa;
  color: #1a1a1a;
  /* Build 230 — body settles at iOS HIG default 17 px / 1.6 (was
   * 16.5 / 1.6). Sits well above the 16 px accessibility floor and
   * matches the modern consumer-grade dashboard density. Pills +
   * chips + status badges keep their own smaller sizes via their
   * own rules (e.g. .db-status-pill is 11.5px on purpose). */
  font: 17px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
  letter-spacing: -0.005em;
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
  animation: dbfade 0.3s cubic-bezier(.2,.9,.3,1);
}
@keyframes dbfade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Top bar — brand + global context + account */
.db-topbar {
  flex: 0 0 56px;
  display: flex; align-items: center;
  padding: 0 20px;
  background: #ffffff;
  border-bottom: 1px solid #e6e7ec;
  gap: 12px;
  z-index: 3;
}
.db-topbar-brand {
  display: flex; align-items: center;
  gap: 14px;
  /* The brand block now also carries the agent-switcher (which lived in
   * the centre before). Lift the flex constraint so it can size to its
   * own contents — the switcher's max-width keeps the row reasonable. */
  flex: 0 1 auto;
  padding-right: 16px;
  min-width: 0;
}
/* SVG logo lock-up. The brand is now the inline <SpiderXLogo> SVG (matches
 * the landing brandbar). currentColor on the wordmark glyph flips with
 * theme; the red X is hard-coded inside the SVG path. */
.db-topbar-logo {
  display: inline-flex; align-items: center;
  color: var(--fg-0);
  line-height: 0;
}
.db-topbar-logo svg { display: block; }
.db-topbar-brand-link {
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}
.db-topbar-brand-link:hover { opacity: 0.78; }

/* ─── Pinned Dashboard nav item (build 234) ────────────────────────────
   Sits between the agent switcher and the first section group. Same
   base shape as a .db-nav-item but with a touch more weight and a
   bottom divider so it reads as a top-level pin rather than a
   misplaced group child. */
.db-nav-pinned {
  margin: 6px 0 8px;
  font-weight: 600;
}
.db-nav-pinned + .db-nav-group { border-top: 1px solid var(--db-border-soft, #eef0f4); padding-top: 6px; }
:root[data-theme="dark"] .db-nav-pinned + .db-nav-group { border-top-color: #1f2433; }

/* ─── WorkspaceSelector (build 222) ───────────────────────────────────
   Soft pill in the topbar with the active workspace name + member
   count. Click to open a popover that lists every org the user
   belongs to. Single-workspace users just see the static chip. */
.db-topbar-ws { position: relative; flex: 0 0 auto; }
.db-topbar-ws-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px 6px 12px;
  background: #f5f6fa;
  border: 1px solid #e6e7ec;
  border-radius: 999px;
  font: inherit; cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  max-width: 240px;
}
.db-topbar-ws-pill:hover { background: #eef0f5; border-color: #d8dbe4; }
.db-topbar-ws-pill.has-many::after { content: ""; }
.db-topbar-ws-name {
  font-size: 13px; font-weight: 600; color: #1f2230;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
.db-topbar-ws-meta {
  font-size: 11px; color: #6a6f7d;
  padding-left: 8px; border-left: 1px solid #d8dbe4;
  white-space: nowrap;
}
.db-topbar-ws-chev { color: #6a6f7d; }
.db-topbar-ws-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 280px;
  background: #ffffff; border: 1px solid #e6e7ec; border-radius: 12px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
  padding: 8px 0; z-index: 50;
}
.db-topbar-ws-menu-head {
  padding: 6px 14px 8px; font-size: 11px; font-weight: 600;
  color: #6a6f7d; text-transform: uppercase; letter-spacing: 0.06em;
}
.db-topbar-ws-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 10px 14px;
  background: transparent; border: 0;
  text-align: left; cursor: pointer;
  font: inherit;
}
.db-topbar-ws-item:hover { background: #f4f5f9; }
.db-topbar-ws-item.is-current { background: #eef0ff; }
.db-topbar-ws-item-name {
  font-size: 13.5px; font-weight: 600; color: #1f2230;
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-topbar-ws-item-meta {
  font-size: 11.5px; color: #6a6f7d;
}
.db-topbar-ws-menu-foot {
  border-top: 1px solid #e6e7ec; margin-top: 6px; padding: 6px;
}
.db-topbar-ws-foot-btn {
  width: 100%; padding: 8px 10px;
  background: transparent; border: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 500;
  color: #4338ca; text-align: left;
}
.db-topbar-ws-foot-btn:hover { background: #f4f5f9; border-radius: 6px; }
:root[data-theme="dark"] .db-topbar-ws-pill { background: #1f2433; border-color: #2a2f3e; }
:root[data-theme="dark"] .db-topbar-ws-pill:hover { background: #262c3e; }
:root[data-theme="dark"] .db-topbar-ws-name { color: #f1f3f8; }
:root[data-theme="dark"] .db-topbar-ws-meta { color: #9aa0ad; border-left-color: #2a2f3e; }
:root[data-theme="dark"] .db-topbar-ws-menu { background: #14171f; border-color: #2a2f3e; box-shadow: 0 12px 36px rgba(0,0,0,0.5); }
:root[data-theme="dark"] .db-topbar-ws-item:hover { background: #1f2433; }
:root[data-theme="dark"] .db-topbar-ws-item.is-current { background: #1e2233; }
:root[data-theme="dark"] .db-topbar-ws-item-name { color: #f1f3f8; }
:root[data-theme="dark"] .db-topbar-ws-item-meta,
:root[data-theme="dark"] .db-topbar-ws-menu-head { color: #9aa0ad; }
:root[data-theme="dark"] .db-topbar-ws-menu-foot { border-top-color: #2a2f3e; }

/* ─── Breadcrumb (build 222) ─────────────────────────────────────────────
   Lightweight text crumb between the workspace pill and the right cluster.
   Hidden on narrow widths so the topbar stays usable on small screens. */
.db-topbar-crumb {
  display: flex; align-items: center; gap: 6px;
  flex: 1; min-width: 0;
  font-size: 12.5px;
  color: #6a6f7d;
  margin-left: 4px;
}
.db-topbar-crumb-sep { color: #c8ccd6; user-select: none; }
.db-topbar-crumb-link {
  background: transparent; border: 0; padding: 2px 4px;
  font: inherit; font-size: 12.5px;
  color: #6a6f7d; cursor: pointer; border-radius: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 160px;
}
.db-topbar-crumb-link:hover { background: #f4f5f9; color: #1f2230; }
.db-topbar-crumb-now {
  color: #1f2230; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 200px;
}
:root[data-theme="dark"] .db-topbar-crumb { color: #9aa0ad; }
:root[data-theme="dark"] .db-topbar-crumb-sep { color: #4b4f5e; }
:root[data-theme="dark"] .db-topbar-crumb-link:hover { background: #1f2433; color: #f1f3f8; }
:root[data-theme="dark"] .db-topbar-crumb-now { color: #f1f3f8; }
@media (max-width: 820px) {
  .db-topbar-crumb { display: none; }
  .db-topbar-ws-meta { display: none; }
}
/* Legacy text-wordmark styles kept as fallback (unused in the topbar; the
 * landing splash still references them). */
.db-topbar-wordmark {
  display: inline-flex; align-items: baseline;
  font-size: 25.5px;
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1;
  color: var(--fg-0);
}
.db-topbar-wordmark .db-topbar-wm-spider { color: inherit; }
.db-topbar-wordmark .db-topbar-wm-x { color: #df3739; }
.db-topbar-wordmark .db-topbar-wm-ai { color: inherit; }
.db-topbar-tag {
  font-size: 11.5px;
  font-weight: 500;
  color: #6a6a6a;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f0eef9;
}

/* Thin vertical separator between the brand block and the switcher. */
.db-topbar-switcher-sep {
  width: 1px; height: 22px;
  background: #d8dbe4;
  flex-shrink: 0;
}

/* Agent switcher — now lives next to the wordmark, not in the centre.
 * Styled as a pill containing icon + native select + custom chevron, so
 * it looks bespoke without giving up the OS-rendered popup list. */
.db-topbar-switcher {
  position: relative;
  display: inline-flex; align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 12px;
  background: linear-gradient(180deg, #f7f8fc 0%, #eef0f5 100%);
  border: 1px solid #d8dbe4;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(15, 17, 28, 0.02) inset;
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 0;
}
.db-topbar-switcher:hover { background: #ffffff; border-color: #c4b5fd; }
.db-topbar-switcher:focus-within { background: #ffffff; border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18); }
.db-topbar-switcher-icon { color: #6b7080; flex-shrink: 0; }
.db-topbar-switcher-chev { color: #6b7080; flex-shrink: 0; pointer-events: none; }
.db-topbar-switcher .db-topbar-select {
  /* The native select sits flush inside the styled shell — strip its own
   * borders and chevron-bg; the wrapper carries those. */
  height: 36px;
  min-width: 180px;
  max-width: 280px;
  padding: 0 4px;
  border-radius: 0;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #1a1d2b;
  cursor: pointer;
  appearance: none;
  background-image: none;
  text-overflow: ellipsis;
  outline: 0;
}
.db-topbar-switcher .db-topbar-select option {
  background: #ffffff;
  color: #1a1d2b;
}

:root[data-theme="dark"] .db-topbar-switcher-sep { background: #2a2e44; }
:root[data-theme="dark"] .db-topbar-switcher {
  background: linear-gradient(180deg, #1b1f33 0%, #15182a 100%);
  border-color: #2a2e44;
}
:root[data-theme="dark"] .db-topbar-switcher:hover { background: #1b1f33; border-color: rgba(167,139,250,0.45); }
:root[data-theme="dark"] .db-topbar-switcher:focus-within { background: #1b1f33; border-color: rgba(167,139,250,0.55); }
:root[data-theme="dark"] .db-topbar-switcher-icon,
:root[data-theme="dark"] .db-topbar-switcher-chev { color: #8a91a4; }
:root[data-theme="dark"] .db-topbar-switcher .db-topbar-select { color: #e7e9ee; }
:root[data-theme="dark"] .db-topbar-switcher .db-topbar-select option { background: #15182a; color: #e7e9ee; }

/* Legacy .db-topbar-center is no longer rendered — block kept harmless if any
 * page still emits it temporarily during dev. */
.db-topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

/* Plain .db-topbar-select fallback (outside the switcher shell) — kept
 * intact for any other surface that uses the native dropdown directly. */
.db-topbar-select:not(.db-topbar-switcher *) {
  height: 36px;
  min-width: 280px;
  max-width: 420px;
  padding: 0 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d8dae3;
  font: inherit;
  font-size: 13.5px;
  color: #1a1a1a;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='1.7'><path d='M6 9l6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px;
  padding-right: 36px;
}
.db-topbar-right {
  display: flex; align-items: center;
  gap: 12px;
  /* Push the right cluster (support · minutes · theme · avatar) all the way
   * to the far right of the topbar. Without this they sit flush against the
   * brand block because we removed the centre flex spacer when we moved the
   * switcher into the sidebar. */
  margin-left: auto;
}
.db-topbar-support {
  font-size: 13px;
  font-weight: 500;
  color: #2563eb;
  background: #ffffff;
  border: 1px solid #cfddff;
  padding: 7px 14px;
  border-radius: 8px;
  cursor: pointer;
}
.db-topbar-support:hover { background: #f0f5ff; }
.db-topbar-minutes {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px;
  color: #2a2a2a;
  background: #eef5ff;
  padding: 7px 12px;
  border-radius: 999px;
}
.db-topbar-minutes::before {
  content: ""; width: 7px; height: 7px;
  border-radius: 50%;
  background: #3b82f6;
}
.db-topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c4b5fd, #f0abfc);
  color: #1a0f2e;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}

.db-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.db-nav {
  /* Build 225 — widened from 232 → 264 to match the Vani reference's
   * roomier sidebar. Group labels + nav items breathe instead of
   * truncating; "Voice & behaviour" no longer brushes the right edge. */
  flex: 0 0 264px;
  background: #ffffff;
  border-right: 1px solid var(--db-border, #e6e7ec);
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  overflow-y: auto;
}
.db-nav-primary {
  /* Build 242 — toned down. Was a saturated blue→indigo gradient with
     a heavy box-shadow that competed with the actual active nav item
     (pink/purple gradient on the page you're on). The agent picker
     is a SELECTOR, not the loudest thing on the sidebar — quiet it
     down to a neutral surface so the eye finds the active page first
     and uses this only when it's looking to switch agents. */
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: #f4f5f9;
  color: #1f2230;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid #e3e5ec;
  cursor: pointer;
  margin-bottom: 14px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.db-nav-primary:hover { background: #eceef4; border-color: #d8dbe4; }
.db-nav-primary svg { width: 16px; height: 16px; flex: 0 0 16px; color: #6a6f7d; }
:root[data-theme="dark"] .db-nav-primary {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.1);
  color: #e8e9ef;
}
:root[data-theme="dark"] .db-nav-primary:hover { background: rgba(255,255,255,0.07); }
:root[data-theme="dark"] .db-nav-primary svg { color: #a4a8b8; }

/* AgentSwitcher — custom dropdown component. The trigger looks identical
 * to the old big-blue primary tile (we reuse .db-nav-primary). The menu
 * below has a scrollable agent list + a sticky footer with "All agents"
 * and "Build new" buttons that stay visible regardless of scroll. */
.db-switcher-root { position: relative; margin-bottom: 14px; }
.db-switcher-trigger {
  margin-bottom: 0;   /* root handles spacing */
  display: flex; align-items: center; gap: 9px;
}
.db-switcher-label {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: left;
}
.db-switcher-chev {
  width: 14px; height: 14px;
  opacity: 0.85;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
.db-switcher-root.is-open .db-switcher-chev { transform: rotate(180deg); }

/* Pop-out menu — anchored under the trigger, full width of the sidebar
 * column. The list-area scrolls internally; the footer is sticky. */
.db-switcher-menu {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  display: flex; flex-direction: column;
  max-height: 420px;
  background: #ffffff;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(15, 17, 28, 0.18);
  overflow: hidden;
  animation: switcherIn 0.14s cubic-bezier(.2,.9,.3,1);
}
@keyframes switcherIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.db-switcher-current {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px;
  background: #ede9fe;
  border-bottom: 1px solid #e6e8ef;
  flex-shrink: 0;
}
.db-switcher-current-tag {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #5b21b6;
  background: #fff;
  border: 1px solid #c4b5fd;
  padding: 1px 6px;
  border-radius: 99px;
}
.db-switcher-current-name {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 600;
  color: #1a1d2b;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-switcher-tick { color: #5b21b6; flex-shrink: 0; }

.db-switcher-header {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6b7080;
  padding: 10px 14px 6px;
  flex-shrink: 0;
}

.db-switcher-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 2px 6px 6px;
  /* Custom scrollbar — restrained, only when scrolling */
  scrollbar-width: thin;
  scrollbar-color: #d8dbe4 transparent;
}
.db-switcher-list::-webkit-scrollbar { width: 8px; }
.db-switcher-list::-webkit-scrollbar-thumb { background: #d8dbe4; border-radius: 4px; }
.db-switcher-list::-webkit-scrollbar-track { background: transparent; }

.db-switcher-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  text-align: left;
  color: #1a1d2b;
  transition: background 0.12s ease;
}
.db-switcher-item:hover { background: #f3f4f8; }
.db-switcher-item-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #d8dbe4;
  flex-shrink: 0;
}
.db-switcher-item-name {
  flex: 1; min-width: 0;
  font-size: 13.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-switcher-item-pill {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em;
  padding: 1px 7px;
  border-radius: 99px;
  flex-shrink: 0;
}
.db-switcher-item-pill.is-live { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }
.db-switcher-item-pill.is-draft { background: #f3f4f8; color: #6b7080; border: 1px solid #e6e8ef; }

.db-switcher-empty {
  padding: 14px;
  font-size: 12.5px; color: #6b7080;
  text-align: center;
  font-style: italic;
}

/* Sticky footer — stacked vertically so each label fits on one line at the
 * sidebar's narrow width. Primary action ("Build new") goes on top, the
 * secondary "All agents" sits below — a clean, scannable CTA pair. */
.db-switcher-footer {
  flex-shrink: 0;
  display: flex; flex-direction: column; gap: 6px;
  padding: 8px;
  background: #fafbfd;
  border-top: 1px solid #eef0f5;
}
.db-switcher-foot-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 12px;
  background: #fff;
  border: 1px solid #d8dbe4;
  border-radius: 8px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: #1a1d2b;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease, filter 0.15s ease;
}
.db-switcher-foot-btn:hover { background: #f3f4f8; }
.db-switcher-foot-btn.is-primary {
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}
.db-switcher-foot-btn.is-primary:hover { filter: brightness(1.05); }

/* Dark theme */
:root[data-theme="dark"] .db-switcher-menu {
  background: #15182a;
  border-color: #2a2e44;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
:root[data-theme="dark"] .db-switcher-current {
  background: rgba(167,139,250,0.10);
  border-bottom-color: #2a2e44;
}
:root[data-theme="dark"] .db-switcher-current-tag {
  background: #15182a;
  border-color: rgba(167,139,250,0.40);
  color: #c4b5fd;
}
:root[data-theme="dark"] .db-switcher-current-name { color: #e7e9ee; }
:root[data-theme="dark"] .db-switcher-tick { color: #c4b5fd; }
:root[data-theme="dark"] .db-switcher-header { color: #8a91a4; }
:root[data-theme="dark"] .db-switcher-item { color: #e7e9ee; }
:root[data-theme="dark"] .db-switcher-item:hover { background: #1b1f33; }
:root[data-theme="dark"] .db-switcher-item-dot { background: #3a3f52; }
:root[data-theme="dark"] .db-switcher-item-pill.is-live {
  background: rgba(16,185,129,0.10); color: #6ee7b7; border-color: rgba(110,231,183,0.30);
}
:root[data-theme="dark"] .db-switcher-item-pill.is-draft { background: #1b1f33; color: #8a91a4; border-color: #2a2e44; }
:root[data-theme="dark"] .db-switcher-empty { color: #8a91a4; }
:root[data-theme="dark"] .db-switcher-footer { background: #1b1f33; border-top-color: #2a2e44; }
:root[data-theme="dark"] .db-switcher-foot-btn {
  background: #15182a; border-color: #2a2e44; color: #e7e9ee;
}
:root[data-theme="dark"] .db-switcher-foot-btn:hover { background: #1b1f33; }
:root[data-theme="dark"] .db-switcher-list { scrollbar-color: #3a3f52 transparent; }
:root[data-theme="dark"] .db-switcher-list::-webkit-scrollbar-thumb { background: #3a3f52; }

.db-nav-group {
  margin-bottom: 4px;
}
.db-nav-group-head {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  /* Build 231 — group heads now read as filled pills (reference design).
   * Subtle grey background + generous padding + rounded corners
   * make the group anchor a deliberate "section marker" rather than
   * a stray uppercase label. Each group gets visible breathing room
   * via margin-top instead of giant padding-top. */
  padding: 11px 14px;
  margin-top: 10px;
  background: #f3f4f7;
  border: 0;
  color: #4b5563;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border-radius: 10px;
  text-align: left;
}
.db-nav-group:first-child .db-nav-group-head { margin-top: 0; }
.db-nav-group-head:hover { background: #ecedf2; color: #1f2230; }
:root[data-theme="dark"] .db-nav-group-head { background: #1f2433; color: #c8ccd9; }
:root[data-theme="dark"] .db-nav-group-head:hover { background: #262c3e; color: #f1f3f8; }
/* Build 230 — group icons are now Material Symbols spans (not SVGs).
   Same target dimensions; selectors cover both for back-compat. */
.db-nav-group-head .db-nav-group-icon { flex: 0 0 18px; color: #4a4a4a; line-height: 1; }
.db-nav-group-head svg.db-nav-group-icon { width: 17px; height: 17px; flex: 0 0 17px; color: #4a4a4a; stroke-width: 1.7; }
.db-nav-group-head .db-nav-group-chev {
  margin-left: auto;
  color: #8a8a8a;
  transition: transform 0.2s ease;
}
.db-nav-group-head svg.db-nav-group-chev {
  width: 12px; height: 12px;
  margin-left: auto;
  color: #8a8a8a;
  transition: transform 0.18s ease;
}
.db-nav-group.open .db-nav-group-head .db-nav-group-chev,
.db-nav-group.open .db-nav-group-head svg.db-nav-group-chev {
  transform: rotate(180deg);
}
.db-nav-group-items {
  display: flex; flex-direction: column;
  /* Build 230 — items now carry their own Material Symbol icon, so
     drop the left-rail indent that previously substituted for one.
     The icon column establishes its own visual hierarchy. */
  padding: 2px 4px 6px 4px;
  gap: 2px;
  position: relative;
}
/* No more left guide-line — the icon column already groups items. */
.db-nav-item {
  display: flex; align-items: center; gap: 10px;
  /* Slightly taller hit-target + larger label — 13px was too dense for
     a top-level navigation that's used dozens of times per session. */
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.35;
  color: #4a4a4a;
  cursor: pointer;
  background: transparent;
  border: 0;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: background 0.15s ease, color 0.15s ease;
  position: relative;
}
.db-nav-item:hover { background: #f5f6f8; color: #1a1a1a; }
/* Build 230 — match the admin shell's pink → purple gradient on active.
   Same visual language as /admin so the operator's eye learns ONE active
   state across both sidebars. Icon + label go to white via currentColor. */
.db-nav-item.active {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}
.db-nav-item.active:hover { background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%); color: #ffffff; }
.db-nav-item.active .db-nav-item-icon { color: #ffffff; }
.db-nav-item-icon {
  flex: 0 0 18px;
  color: #6a6f7d;
  line-height: 1;
}
.db-nav-item-label { flex: 1; min-width: 0; }
/* "Go live" gets a green treatment so it pops in the menu as the
   money-moment action — green text + a small pulsing dot, deeper green
   tint when it's the active page. */
.db-nav-item-golive {
  color: #16a34a;
  font-weight: 600;
}
.db-nav-item-golive:hover { background: #e9f9ef; color: #15803d; }
.db-nav-item-golive.active { background: #dcfce7; color: #15803d; }
.db-nav-golive-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #16a34a;
  flex: 0 0 7px;
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.5);
  animation: db-golive-pulse 2s ease-in-out infinite;
}
@keyframes db-golive-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}
:root[data-theme="dark"] .db-nav-item-golive { color: #4ade80; }
:root[data-theme="dark"] .db-nav-item-golive:hover { background: rgba(34,197,94,0.12); color: #6ee7a0; }
:root[data-theme="dark"] .db-nav-item-golive.active { background: rgba(34,197,94,0.18); color: #86efac; }
.db-nav-item-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  border-radius: 999px;
}
.db-nav-item-badge.is-live { background: #16a34a; color: #ffffff; }
.db-nav-item-badge.is-draft { background: #e6e8ef; color: #6b7080; }
:root[data-theme="dark"] .db-nav-item-badge.is-draft { background: #2a2e44; color: #8a91a4; }
.db-nav-foot {
  margin-top: auto;
  /* Build 243 — make the plan footer ALWAYS VISIBLE inside the
     sidebar's scroll. `position: sticky; bottom: 0;` pins the row
     to the bottom of the visible viewport regardless of how many
     nav groups are expanded above. The negative horizontal margin
     + matching padding bleed the footer's background out to the
     sidebar's edges so a scrolling nav item can't peek through the
     gap between footer and aside border. A solid bg + top border
     keep the boundary visible when content scrolls underneath. */
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: #ffffff;
  margin-left: -14px;   /* cancels .db-nav padding-left */
  margin-right: -14px;  /* cancels .db-nav padding-right */
  padding: 12px 24px 10px;  /* 10 base + 14 to replace what we cancelled */
  border-top: 1px solid #eaebef;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* Slightly larger label to keep proportion with the bumped nav-item
     font size (14px). 11.5px felt orphaned. */
  font-size: 12.5px;
  color: #7a7e88;
  letter-spacing: 0.005em;
}
.db-nav-upgrade {
  /* Tone the call-out from a saturated billboard into a soft accent.
     The old gradient (#fde68a → #fbbf24) had two problems against the
     muted-gray sidebar: (1) the high-saturation amber clashed with
     the rest of the nav's whisper-quiet palette, and (2) the heavy
     fill made the pill the visual centre of the entire sidebar — a
     status badge shouldn't outweigh the actual menu items.
     Solution: a barely-there cream wash + thin warm border. Reads
     as "premium" without yelling. The lightning icon does the
     persuasion work; the colour just supports it. */
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: #fef6e0;
  color: #9a5b00;
  border: 1px solid #f3d88a;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.db-nav-upgrade:hover {
  background: #fdedc7;
  border-color: #e7c46c;
  box-shadow: 0 1px 2px rgba(163, 95, 0, 0.08);
}
.db-nav-upgrade svg {
  width: 10px; height: 10px;
  opacity: 0.85;
}

/* Build 237 — the paid-plan variant. No saturated wash; quiet text
   link that says "Manage" so the operator can reach billing without
   the visual nag the gold pill carried. */
.db-nav-foot-plan {
  /* Stretch so the Manage link drifts to the right via margin-left:auto
     in the parent flex — matches the old "label + pill" rhythm. */
  flex: 1; min-width: 0;
}
.db-nav-foot-link {
  font: inherit;
  font-size: 11.5px;
  font-weight: 500;
  color: #7a7e88;
  background: transparent;
  border: 0;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.db-nav-foot-link:hover { background: #f0f1f4; color: #1f2230; }
:root[data-theme="dark"] .db-nav-foot-link { color: #a4a8b8; }
:root[data-theme="dark"] .db-nav-foot-link:hover { background: rgba(255,255,255,0.06); color: #e8e9ef; }

.db-main {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  /* Build 232 — stabilize the scrollbar gutter so navigating between
     pages of different heights doesn't snap the content sideways by
     ~15 px (the scrollbar width) when the scrollbar appears or
     disappears. `stable` reserves space for the scrollbar ALWAYS, even
     on short pages; nothing visually present until needed. */
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  background: #f7f8fa;
}
.db-main-wide .db-pageheader,
.db-main-wide .db-content {
  max-width: 1200px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.db-pageheader {
  padding: 24px 32px 16px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.db-pageheader-title {
  margin: 0;
  /* Build 230 — bumped to 24 (was 23). iOS HIG Title-1 territory. */
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #1a1a1a;
}
.db-pageheader-sub {
  margin: 4px 0 0;
  /* Build 230 — bumped to 15 (was 14). Matches iOS Subhead. */
  font-size: 15px;
  color: #6a6a6a;
}
.db-pageheader-actions {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
}

.db-content {
  padding: 8px 32px 40px;
  flex: 1;
}

.db-search {
  height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d8dae3;
  font: inherit;
  font-size: 13px;
  color: #1a1a1a;
  outline: 0;
  width: 240px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.db-search::placeholder { color: #9a9a9a; }
.db-search:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); }

.db-btn-primary {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  background: #2563eb;
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.20);
}
.db-btn-primary:hover { background: #1d4fd7; box-shadow: 0 4px 10px rgba(37, 99, 235, 0.30); }
.db-btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  background: #ffffff;
  color: #2a2a2a;
  font: inherit;
  font-size: 13px;
  border: 1px solid #d8dae3;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.db-btn-ghost:hover { background: #f5f6f8; border-color: #bcc0ce; }

.db-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.db-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 10px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.db-card:hover {
  border-color: #c5c8d4;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
.db-card-tap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.db-card-row { display: flex; align-items: flex-start; gap: 12px; }
.db-card-thumb {
  width: 38px; height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde7f3 0%, #c4b5fd 45%, #a5f3fc 80%, #1a1a1a 100%);
  margin-top: 2px;
}
.db-card-headblock { flex: 1; min-width: 0; }
.db-card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #1a1a1a;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  line-height: 1.25;
}
.db-card-agent-name { color: #1a1d2b; }
.db-card-name-sep { color: #c5c8d4; font-weight: 400; }
.db-card-business {
  font-weight: 500;
  color: #4b5263;
  font-size: 14px;
  letter-spacing: 0;
}
.db-card-sub {
  font-size: 12px;
  color: #6b7080;
  margin-top: 3px;
}
.db-card-pills {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.db-card-pill {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
}
.db-card-pill.is-live { background: #ecfdf5; color: #047857; border: 1px solid #6ee7b7; }
.db-card-pill.is-draft { background: #f3f4f8; color: #6b7080; border: 1px solid #e6e8ef; }
.db-card-pill.is-fresh {
  background: #ede9fe; color: #5b21b6; border: 1px solid #c4b5fd;
}
.db-card-greet {
  font-size: 12.5px;
  line-height: 1.45;
  color: #4b5263;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.db-card-foot {
  display: flex; align-items: center; gap: 12px;
  padding-top: 10px;
  border-top: 1px solid #eef0f5;
  font-size: 12px; color: #6b7080;
}
.db-card-stat {
  display: inline-flex; align-items: center; gap: 5px;
  color: #4b5263;
}
.db-card-stat svg { color: #6b7080; }
.db-card-stat.db-card-stat-quiet { color: #9aa0ad; font-style: italic; }
.db-card-foot-spacer { flex: 1; }
.db-card-open {
  font-weight: 600;
  color: #1a1d2b;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.db-card:hover .db-card-open { opacity: 1; }

:root[data-theme="dark"] .db-card-agent-name { color: #e7e9ee; }
:root[data-theme="dark"] .db-card-name-sep { color: #3a3f52; }
:root[data-theme="dark"] .db-card-business { color: #b4b9c7; }
:root[data-theme="dark"] .db-card-sub { color: #8a91a4; }
:root[data-theme="dark"] .db-card-greet { color: #b4b9c7; }
:root[data-theme="dark"] .db-card-foot { border-top-color: #2a2e44; color: #8a91a4; }
:root[data-theme="dark"] .db-card-stat { color: #b4b9c7; }
:root[data-theme="dark"] .db-card-stat svg { color: #8a91a4; }
:root[data-theme="dark"] .db-card-stat.db-card-stat-quiet { color: #6b7080; }
:root[data-theme="dark"] .db-card-open { color: #e7e9ee; }
:root[data-theme="dark"] .db-card-pill.is-live { background: rgba(16,185,129,0.10); color: #6ee7b7; border-color: rgba(110,231,183,0.30); }
:root[data-theme="dark"] .db-card-pill.is-draft { background: #1b1f33; color: #8a91a4; border-color: #2a2e44; }
:root[data-theme="dark"] .db-card-pill.is-fresh { background: rgba(167,139,250,0.16); color: #c4b5fd; border-color: rgba(167,139,250,0.30); }
.db-card-del {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  color: #9a9a9a;
  opacity: 0;
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.db-card:hover .db-card-del { opacity: 1; }
.db-card-del:hover { background: #fee2e2; color: #b91c1c; }
.db-card-del svg { width: 13px; height: 13px; }

.db-overview {
  display: flex; flex-direction: column;
  gap: 16px;
}

.db-hero {
  display: flex; gap: 20px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
  padding: 20px 22px;
}
.db-hero-thumb {
  flex: 0 0 60px;
  width: 60px; height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde7f3 0%, #c4b5fd 45%, #a5f3fc 80%, #1a1a1a 100%);
  box-shadow: 0 4px 14px rgba(196, 181, 253, 0.32);
}
.db-hero-body { flex: 1; min-width: 0; }
.db-hero-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6a6a6a;
  margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.db-hero-mode {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: none;
  background: rgba(110, 231, 183, 0.16);
  color: #047857;
  border: 1px solid rgba(110, 231, 183, 0.40);
  padding: 2px 8px;
  border-radius: 999px;
}
:root[data-theme="dark"] .db-hero-mode {
  background: rgba(110, 231, 183, 0.10);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.28);
}
.db-hero-name {
  margin: 0;
  /* Build 230 — bumped to 24 to match the page title. */
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #1a1a1a;
}
.db-hero-tagline {
  margin: 4px 0 10px;
  /* Build 230 — bumped to 15. */
  font-size: 15px;
  color: #4a4a4a;
  line-height: 1.5;
}
.db-hero-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 10px;
}
.db-pill {
  display: inline-flex; align-items: center;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f3f4f8;
  color: #2a2a2a;
}
.db-pill-accent {
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
  color: #5b21b6;
}
.db-hero-greeting {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid #d8dae3;
  background: #f7f8fa;
  border-radius: 0 8px 8px 0;
  font-size: 13px;
  font-style: italic;
  color: #4a4a4a;
}

.db-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.db-stat {
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 10px;
  padding: 14px 16px;
}
.db-stat-blue   { background: #eff6ff; border-color: #dbeafe; }
.db-stat-green  { background: #ecfdf5; border-color: #d1fae5; }
.db-stat-pink   { background: #fdf2f8; border-color: #fce7f3; }
.db-stat-yellow { background: #fefce8; border-color: #fef3c7; }
.db-stat-purple { background: #faf5ff; border-color: #ede9fe; }
.db-stat-value-sm { font-size: 18px; line-height: 1.2; }
.db-stat-sub { font-size: 11.5px; color: #6a6f7e; margin-top: 4px; }
.db-stats-5 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
/* Clickable Overview stat tiles (drill into Call logs / outcomes) */
button.db-stat {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  display: block; width: 100%;
  transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
button.db-stat:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07); border-color: #c2c7d4; }
button.db-stat:active { transform: translateY(0); }
button.db-stat:disabled { cursor: default; opacity: 0.7; }
:root[data-theme="dark"] .db-stat-sub { color: #9aa0ad; }
/* Overview headline — one warm, status-aware sentence above the stat tiles. */
.db-headline {
  margin: 8px 0 14px;
  padding: 16px 18px;
  background: linear-gradient(180deg, #fafbff 0%, #f7f7fd 100%);
  border: 1px solid #ececf2;
  border-radius: 12px;
}
.db-headline-text {
  /* Build 230 — bumped to 19 to keep matching the .db-panel-title
   * benchmark. */
  margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -0.01em;
  color: #0f172a; line-height: 1.3;
}
.db-headline-sub {
  margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: #6a6f7e;
}
:root[data-theme="dark"] .db-headline {
  background: linear-gradient(180deg, #14171f 0%, #11141b 100%);
  border-color: #2a2f3e;
}
:root[data-theme="dark"] .db-headline-text { color: #f1f3f8; }
:root[data-theme="dark"] .db-headline-sub { color: #9aa0ad; }

.db-table-wrap {
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
  overflow: hidden;
}
.db-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.db-table thead th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6a6a6a;
  background: #eff4fb;
  padding: 12px 16px;
  border-bottom: 1px solid #dde3ec;
}
.db-table-th-right, .db-table-td-right { text-align: right; }
.db-table tbody td {
  padding: 14px 16px;
  border-top: 1px solid #f0f0f3;
  color: #1a1a1a;
  vertical-align: middle;
}
.db-table tbody tr:first-child td { border-top: 0; }
.db-table tbody tr:hover { background: #f9fafc; }
.db-table-summary {
  color: #4a4a4a;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.db-tag {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.01em;
}
.db-tag-green  { background: #d1fae5; color: #065f46; }
.db-tag-blue   { background: #dbeafe; color: #1e40af; }
.db-tag-purple { background: #ede9fe; color: #5b21b6; }
.db-tag-grey   { background: #f1f3f6; color: #5a5a5a; }
.db-tag-red    { background: #fee2e2; color: #991b1b; }
.db-tag-yellow { background: #fef3c7; color: #92400e; }
.db-tag-amber  { background: #fef3c7; color: #92400e; }

.db-btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* Per-agent focused page primitives — forms, voice picker, save pill */
.db-form { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.db-form-field { display: flex; flex-direction: column; gap: 6px; }
.db-form-label {
  /* Build 230 — bumped to 14. */
  font-size: 14px;
  font-weight: 500;
  color: #4a4a4a;
}
.db-form-label .db-form-opt {
  font-weight: 400;
  color: #8a8a8a;
  margin-left: 4px;
}
/* Build 230 — bumped to 13.5. Help text stays the muted tier
 * BELOW labels — readable but visually subordinate. */
.db-form-help { font-size: 13.5px; color: #6a6a6a; }
.db-input,
.db-textarea {
  width: 100%;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d8dae3;
  color: #1a1a1a;
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 9px 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.db-input { height: 38px; }
.db-textarea { line-height: 1.5; resize: vertical; min-height: 60px; }
/* Master-prompt editor — slightly larger line-height + a monospace-ish
   stack so multi-paragraph instructions are comfortable to read/scan,
   and a roomy min-height so the operator sees plenty of context. */
.db-textarea-prompt {
  min-height: 320px;
  line-height: 1.6;
  font-size: 13.5px;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* "Where things live" mini-legend — disambiguates the four
   teach-the-agent surfaces (Business profile / Core purpose / Additional
   info / Knowledge base) so a new operator knows where to put what. */
.db-whatgoeswhere {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  align-items: baseline;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: #f7f8fa;
  border: 1px solid #eceef3;
  border-radius: 10px;
  font-size: 12.5px;
  color: #6a6f7e;
  line-height: 1.5;
}
.db-whatgoeswhere-label { font-weight: 600; color: #4a4f5e; }
.db-whatgoeswhere b { color: #1a1a1a; font-weight: 600; }
:root[data-theme="dark"] .db-whatgoeswhere { background: #131722; border-color: #262b3a; color: #9aa0ad; }
:root[data-theme="dark"] .db-whatgoeswhere-label { color: #c7ccd6; }
:root[data-theme="dark"] .db-whatgoeswhere b { color: #e7e9ee; }

/* ─── Additional Info accordion (industry-adaptive field groups) ─────────── */
.db-info-groups { display: flex; flex-direction: column; gap: 10px; }
.db-info-group {
  background: #ffffff;
  border: 1px solid #e5e7ec;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.db-info-group.is-open { border-color: #c2c7d4; box-shadow: 0 1px 3px rgba(15,23,42,0.06); }
.db-info-group-head {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font: inherit;
}
.db-info-group-head:hover { background: #fafbfc; }
.db-info-group-icon {
  width: 34px; height: 34px;
  flex: 0 0 34px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f1f3f7;
  border-radius: 9px;
  font-size: 17px;
  margin-top: 1px;
}
.db-info-group-meta { flex: 1; min-width: 0; }
.db-info-group-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  display: flex; align-items: center; gap: 7px;
}
.db-info-group-count {
  font-size: 13px;
  font-weight: 600;
  color: #a3a8b8;
}
.db-info-group-count.is-filled {
  color: #16a34a;
}
.db-info-group-desc {
  font-size: 13px;
  color: #6a6f7e;
  margin-top: 2px;
  line-height: 1.45;
}
.db-info-group-note {
  font-size: 12px;
  color: #a3a8b8;
  margin-top: 3px;
  font-style: italic;
}
.db-info-group-chev {
  color: #9aa0ad;
  margin-top: 8px;
  flex: 0 0 16px;
  transition: transform 0.18s ease;
}
.db-info-group.is-open .db-info-group-chev { transform: rotate(180deg); }
.db-info-group-body { padding: 0 16px 16px 62px; }
.db-info-progress {
  font-size: 12.5px;
  color: #7a7e88;
  margin-right: 10px;
  align-self: center;
}

:root[data-theme="dark"] .db-info-group { background: #131722; border-color: #262b3a; }
:root[data-theme="dark"] .db-info-group.is-open { border-color: #3a4054; }
:root[data-theme="dark"] .db-info-group-head:hover { background: #1a1f2e; }
:root[data-theme="dark"] .db-info-group-icon { background: #1c2030; }
:root[data-theme="dark"] .db-info-group-title { color: #e7e9ee; }
:root[data-theme="dark"] .db-info-group-desc { color: #9aa0ad; }
:root[data-theme="dark"] .db-info-group-note { color: #6a6f7e; }
:root[data-theme="dark"] .db-info-progress { color: #8a8e9c; }
/* Native <select> styled to match .db-input — custom chevron, room on
   the right for it, pointer cursor. */
.db-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8e9c' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
/* Provider selector on the Go-live SIP card — give it a faint accent
   tint so it reads as the primary decision on the card. */
.sip-provider-select .db-select {
  border-color: #c8dbff;
  background-color: #f7faff;
}
:root[data-theme="dark"] .sip-provider-select .db-select {
  border-color: rgba(96,165,250,0.35);
  background-color: rgba(59,130,246,0.08);
}
.db-input:focus, .db-textarea:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}
.db-range {
  width: 100%;
  accent-color: #3b82f6;
  height: 4px;
}

.db-voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.db-voice-card {
  display: flex; flex-direction: column;
  padding: 12px 14px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  text-align: left;
  font-family: inherit;
}
.db-voice-card:hover { border-color: #c5c8d4; }
.db-voice-card.active {
  background: #eff6ff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px #3b82f6 inset;
}
.db-voice-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}
.db-voice-sub {
  font-size: 12px;
  color: #6a6a6a;
  margin-top: 2px;
}
.db-voice-langs {
  font-size: 10.5px; font-weight: 500;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: 99px;
  padding: 2px 8px;
  margin-top: 8px;
  align-self: flex-start;
}
:root[data-theme="dark"] .db-voice-langs {
  background: rgba(110, 231, 183, 0.10);
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.30);
}

/* Grouped supported-language display under the Language panel */
.db-lang-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.db-lang-group {
  padding: 12px;
  background: #f8f9fc;
  border: 1px solid #eef0f5;
  border-radius: 10px;
}
.db-lang-group-head {
  font-size: 12px; font-weight: 600;
  color: #1a1d2b;
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 8px;
}
.db-lang-group-count {
  font-size: 10.5px;
  color: #6b7080;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 99px;
  padding: 1px 7px;
}
.db-lang-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.db-lang-chip {
  font-size: 11.5px;
  color: #1a1d2b;
  background: #fff;
  border: 1px solid #d8dbe4;
  border-radius: 99px;
  padding: 2px 9px;
}
.db-lang-chip.active {
  background: #ede9fe;
  color: #5b21b6;
  border-color: #c4b5fd;
  font-weight: 600;
}
.db-lang-footnote {
  font-size: 12px;
  color: #6b7080;
  margin: 14px 0 0;
  line-height: 1.45;
}

:root[data-theme="dark"] .db-lang-group { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-lang-group-head { color: #e7e9ee; }
:root[data-theme="dark"] .db-lang-group-count { background: #1b1f33; border-color: #2a2e44; color: #8a91a4; }
:root[data-theme="dark"] .db-lang-chip { background: #1b1f33; border-color: #2a2e44; color: #e7e9ee; }
:root[data-theme="dark"] .db-lang-chip.active { background: rgba(167,139,250,0.18); border-color: rgba(167,139,250,0.40); color: #c4b5fd; }
:root[data-theme="dark"] .db-lang-footnote { color: #8a91a4; }

/* ── Voice settings — restrained, monochrome by design.
 * Background is flat. Accent is a single thin grey rule. The only colour on
 * the page is the AudioMark icon when a voice is actively playing — that's
 * the one place where motion + tint earn the user's attention. ── */
.db-voice-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 24px;
  align-items: center;
  background: #ffffff;
  border-color: #e6e8ef;
}
.db-voice-hero-left { min-width: 0; }
.db-voice-hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6b7080;
}
.db-voice-hero-tone {
  font-size: 22px; font-weight: 600;
  color: #1a1d2b;
  margin: 8px 0 6px;
  letter-spacing: -0.01em;
}
.db-voice-hero-vibe {
  font-size: 13.5px; color: #4b5263;
  line-height: 1.5;
  margin: 0 0 14px;
  max-width: 56ch;
}
.db-voice-hero-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.db-voice-hero-actions .db-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px;
}
.db-voice-hero-warn {
  margin-top: 10px;
  font-size: 12.5px; color: #6b7080;
  background: #f8f9fc; border: 1px solid #e6e8ef;
  border-radius: 8px; padding: 8px 11px;
}

/* AudioMark — five bars, monochrome. Animates only when `is-playing`. */
.db-audio-mark { width: 44px; height: 44px; color: #6b7080; }
.db-audio-mark rect { transform-origin: center; transform-box: fill-box; }
.db-audio-mark.is-playing { color: #1a1d2b; }
.db-audio-mark.is-playing rect:nth-child(1) { animation: bar 0.9s ease-in-out -0.1s infinite; }
.db-audio-mark.is-playing rect:nth-child(2) { animation: bar 0.9s ease-in-out -0.3s infinite; }
.db-audio-mark.is-playing rect:nth-child(3) { animation: bar 0.9s ease-in-out 0s    infinite; }
.db-audio-mark.is-playing rect:nth-child(4) { animation: bar 0.9s ease-in-out -0.25s infinite; }
.db-audio-mark.is-playing rect:nth-child(5) { animation: bar 0.9s ease-in-out -0.05s infinite; }
@keyframes bar {
  0%, 100% { transform: scaleY(0.4); }
  50%      { transform: scaleY(1); }
}
.db-tone-card .db-audio-mark { width: 22px; height: 22px; }

@media (max-width: 720px) {
  .db-voice-hero { grid-template-columns: 1fr; }
}

/* ── Tone explorer grid: uniform white cards, single accent on active ── */
.db-tone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.db-tone-card {
  display: flex; flex-direction: column;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.db-tone-card.active {
  border-color: #1a1d2b;
}
.db-tone-card.playing { border-color: #1a1d2b; background: #fafbfd; }
.db-tone-body { min-width: 0; }
.db-tone-headline {
  font-size: 14px; font-weight: 600;
  color: #1a1d2b;
  line-height: 1.25;
}
.db-tone-voice {
  font-size: 10.5px; color: #6b7080;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  margin-top: 4px;
}
.db-tone-vibe {
  font-size: 12.5px; color: #6b7080;
  margin-top: 8px;
  line-height: 1.45;
}
.db-tone-actions {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef0f5;
}
.db-tone-listen {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent; color: #1a1d2b;
  border: 1px solid #d8dbe4;
  cursor: pointer;
  transition: background 0.15s ease;
}
.db-tone-listen:hover { background: #f3f4f8; }
.db-tone-card.playing .db-tone-listen { background: #1a1d2b; color: #fff; border-color: #1a1d2b; }
.db-tone-pick {
  flex: 1;
  font: inherit; font-size: 12.5px; font-weight: 500;
  background: transparent; color: #1a1d2b;
  border: 1px solid #d8dbe4;
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.db-tone-pick:hover { background: #f3f4f8; }
.db-tone-pick.active {
  background: #1a1d2b; color: #fff; border-color: #1a1d2b;
}

.db-voice-hint {
  margin: 14px 0 0; font-size: 12.5px; color: #6b7080;
}
.db-voice-hint .db-link {
  font: inherit; background: transparent; border: 0;
  color: #1a1d2b; cursor: pointer; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
}
.db-voice-hint .db-link:hover { color: #000; }

/* Advanced (conversation feel) collapsible — quiet */
.db-voice-advanced { padding: 0; }
.db-voice-advanced > summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  font-size: 14px; font-weight: 500; color: #1a1d2b;
}
.db-voice-advanced > summary::-webkit-details-marker { display: none; }
.db-voice-advanced > summary svg { color: #6b7080; transition: transform 0.18s ease; }
.db-voice-advanced[open] > summary svg { transform: rotate(180deg); }
.db-voice-advanced[open] { padding-bottom: 18px; }
.db-voice-advanced > .db-panel-sub { padding: 0 18px; }
.db-voice-advanced .db-form { padding: 0 18px; }

/* ── Dark theme — same restraint, inverted neutral palette ── */
:root[data-theme="dark"] .db-voice-hero {
  background: #15182a;
  border-color: #2a2e44;
}
:root[data-theme="dark"] .db-voice-hero-tone { color: #e7e9ee; }
:root[data-theme="dark"] .db-voice-hero-vibe { color: #b4b9c7; }
:root[data-theme="dark"] .db-voice-hero-eyebrow { color: #8a91a4; }
:root[data-theme="dark"] .db-voice-hero-warn {
  background: #1b1f33;
  color: #8a91a4;
  border-color: #2a2e44;
}
:root[data-theme="dark"] .db-audio-mark { color: #8a91a4; }
:root[data-theme="dark"] .db-audio-mark.is-playing { color: #e7e9ee; }
:root[data-theme="dark"] .db-tone-card { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-tone-card.active { border-color: #e7e9ee; }
:root[data-theme="dark"] .db-tone-card.playing { border-color: #e7e9ee; background: #1b1f33; }
:root[data-theme="dark"] .db-tone-headline { color: #e7e9ee; }
:root[data-theme="dark"] .db-tone-voice { color: #8a91a4; }
:root[data-theme="dark"] .db-tone-vibe { color: #8a91a4; }
:root[data-theme="dark"] .db-tone-actions { border-top-color: #2a2e44; }
:root[data-theme="dark"] .db-tone-listen { background: transparent; border-color: #3a3f52; color: #e7e9ee; }
:root[data-theme="dark"] .db-tone-listen:hover { background: #232636; }
:root[data-theme="dark"] .db-tone-card.playing .db-tone-listen { background: #e7e9ee; color: #15182a; border-color: #e7e9ee; }
:root[data-theme="dark"] .db-tone-pick { background: transparent; border-color: #3a3f52; color: #e7e9ee; }
:root[data-theme="dark"] .db-tone-pick:hover { background: #232636; }
:root[data-theme="dark"] .db-tone-pick.active { background: #e7e9ee; color: #15182a; border-color: #e7e9ee; }
:root[data-theme="dark"] .db-voice-hint { color: #8a91a4; }
:root[data-theme="dark"] .db-voice-hint .db-link { color: #e7e9ee; }
:root[data-theme="dark"] .db-voice-advanced > summary { color: #e7e9ee; }
:root[data-theme="dark"] .db-voice-advanced > summary svg { color: #8a91a4; }

.db-save-pill {
  font-size: 12.5px;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 500;
}
.db-save-ok { background: #d1fae5; color: #065f46; }
.db-save-err { background: #fee2e2; color: #991b1b; }
.db-save-dim { background: #f1f3f6; color: #4a4a4a; }

.db-panel-pill {
  display: inline-flex; align-items: center;
  margin-left: 8px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 999px;
  background: #f3f4f8;
  color: #6a6a6a;
}
.db-dropzone {
  margin-top: 12px;
  display: flex; align-items: center; gap: 12px;
  padding: 18px 18px;
  border: 1.5px dashed #d0d3dd;
  border-radius: 10px;
  background: #fafbfd;
  color: #6a6a6a;
  font-size: 13px;
}
.db-dropzone svg { color: #8a8a8a; }
.db-dropzone.is-clickable {
  width: 100%; box-sizing: border-box; cursor: pointer;
  font-family: inherit; text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.db-dropzone.is-clickable:hover { border-color: #a78bfa; background: #f8f5ff; color: #4338ca; }
.db-dropzone.is-clickable:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
/* Knowledge-base extras (import button row, sources list, modal wide variant) */
.db-kb-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.db-kb-sources-pill {
  font-size: 11.5px; font-weight: 600; color: #4338ca;
  background: #eef2ff; border: 1px solid #e0e7ff; border-radius: 999px;
  padding: 3px 10px;
}
.db-kb-sources { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.db-kb-source {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid #ececf2; border-radius: 10px;
  background: #fbfbfd;
}
.db-kb-source-icon { font-size: 16px; line-height: 1; }
.db-kb-source-meta { flex: 1; min-width: 0; }
.db-kb-source-label { font-size: 13px; font-weight: 600; color: #1a1d2b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-kb-source-label a { color: #6366f1; text-decoration: none; }
.db-kb-source-label a:hover { text-decoration: underline; }
.db-kb-source-when { font-size: 11.5px; color: #8a8f9e; margin-top: 1px; }
.db-kb-loading { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: #6b5bd0; font-weight: 600; }
/* Wider modal for the import preview (the YAML editor needs room) */
.db-modal.db-modal-wide { width: min(720px, calc(100vw - 32px)); }
/* Knowledge-base source-type tab strip */
.kb-tabs {
  display: inline-flex; align-items: stretch; gap: 4px;
  margin: 16px 0 4px;
  padding: 4px;
  background: #f3f4f8;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
}
.kb-tab {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13.5px; font-weight: 600; color: #5b6173;
  background: transparent; border: 0;
  border-radius: 9px; padding: 7px 14px; cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.kb-tab:hover { color: #1a1d2b; background: #eceef4; }
.kb-tab.is-active {
  background: #ffffff; color: #1a1d2b;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 1px #d8dbe4;
}
.kb-tab-icon { font-size: 14.5px; line-height: 1; }
.kb-tab-count {
  font-size: 11px; font-weight: 700;
  color: #4338ca; background: #eef2ff; border: 1px solid #e0e7ff;
  border-radius: 999px; padding: 1px 7px;
  margin-left: 2px;
}
.kb-tab.is-active .kb-tab-count { background: #ffffff; border-color: #c7d2fe; }
.db-kb-empty {
  margin: 4px 0 0; padding: 14px 16px;
  font-size: 13px; color: #6a6f7e; line-height: 1.5;
  background: #fafbfd; border: 1px dashed #d8dbe4; border-radius: 10px;
}
.db-kb-source-view {
  font: inherit; font-size: 12px; font-weight: 600; color: #4338ca;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  padding: 4px 10px; cursor: pointer; white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.db-kb-source-view:hover { background: #eef2ff; border-color: #e0e7ff; }
:root[data-theme="dark"] .kb-tabs { background: #14171f; border-color: #262b3a; }
:root[data-theme="dark"] .kb-tab { color: #aab0c0; }
:root[data-theme="dark"] .kb-tab:hover { color: #f1f3f8; background: #1c2030; }
:root[data-theme="dark"] .kb-tab.is-active { background: #1f2433; color: #f1f3f8; box-shadow: 0 0 0 1px #2f3550; }
:root[data-theme="dark"] .kb-tab-count { color: #c7d2fe; background: #1e2233; border-color: #2f3550; }
:root[data-theme="dark"] .kb-tab.is-active .kb-tab-count { background: #14171f; border-color: #3a4054; }
:root[data-theme="dark"] .db-kb-empty { background: #14171f; border-color: #2a2f3e; color: #aab0c0; }
:root[data-theme="dark"] .db-kb-source-view { color: #c7d2fe; }
:root[data-theme="dark"] .db-kb-source-view:hover { background: #1c2030; border-color: #2f3550; }
/* Phone AI conventions panel (read-only, collapsible) */
.db-conv-head {
  display: flex; align-items: flex-start; gap: 12px;
  width: 100%; text-align: left;
  background: transparent; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: inherit;
}
.db-conv-head svg { color: #6366f1; flex: 0 0 22px; margin-top: 2px; }
.db-conv-head-meta { flex: 1; min-width: 0; }
.db-conv-toggle { color: #6366f1; font-weight: 600; margin-left: 6px; }
.db-conv-body { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.db-conv-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}
.db-conv-card {
  background: #fbfbfd; border: 1px solid #ececf2; border-radius: 12px;
  padding: 14px 16px;
}
.db-conv-card-wide { grid-column: 1 / -1; }
.db-conv-card-title { font-size: 13.5px; font-weight: 650; color: #0f172a; margin-bottom: 6px; display: inline-flex; align-items: center; gap: 8px; }
.db-conv-meta, .db-conv-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.db-conv-meta li, .db-conv-list li { font-size: 13px; line-height: 1.55; color: #3a3f52; }
.db-conv-meta li b { color: #1a1d2b; }
.db-conv-list li::before { content: "•"; display: inline-block; width: 1em; margin-left: -1em; color: #6366f1; font-weight: 700; }
.db-conv-list li { padding-left: 1em; }
.db-conv-foot { margin: 0; font-size: 12px; color: #6a6f7e; }
:root[data-theme="dark"] .db-conv-card { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .db-conv-card-title { color: #f1f3f8; }
:root[data-theme="dark"] .db-conv-meta li, :root[data-theme="dark"] .db-conv-list li { color: #c2c7d6; }
:root[data-theme="dark"] .db-conv-meta li b { color: #f1f3f8; }
:root[data-theme="dark"] .db-conv-foot { color: #9aa0ad; }
:root[data-theme="dark"] .db-conv-toggle { color: #c4b5fd; }
/* Call outcomes page */
.oc-kpis {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 12px;
}
.oc-kpi {
  background: #ffffff; border: 1px solid #ececf2; border-radius: 12px;
  padding: 14px 16px;
}
.oc-kpi-label { font-size: 11.5px; font-weight: 600; color: #6a6f7e; text-transform: uppercase; letter-spacing: 0.05em; }
.oc-kpi-value { font-size: 24px; font-weight: 800; color: #0f172a; margin-top: 4px; letter-spacing: -0.01em; }
.oc-kpi-value.oc-kpi-success { color: #16a34a; }
.oc-kpi-value.oc-kpi-best { font-size: 16px; font-weight: 650; line-height: 1.25; }
.oc-kpi-sub { font-size: 11.5px; color: #8a8f9e; margin-top: 2px; }
.oc-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.oc-range { display: inline-flex; gap: 4px; padding: 4px; background: #f3f4f8; border: 1px solid #e6e7ec; border-radius: 10px; }
.oc-range-btn {
  font: inherit; font-size: 12.5px; font-weight: 600; color: #5b6173;
  background: transparent; border: 0; border-radius: 7px; padding: 5px 11px; cursor: pointer;
}
.oc-range-btn:hover { background: #eceef4; color: #1a1d2b; }
.oc-range-btn.is-active { background: #fff; color: #1a1d2b; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.oc-kindgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.oc-kind {
  padding: 14px 16px; border-radius: 12px;
  background: #fbfbfd; border: 1px solid #ececf2;
}
.oc-kind-success { border-color: #d1fadf; background: #f0fdf4; }
.oc-kind-qualified { border-color: #e0e7ff; background: #eef2ff; }
.oc-kind-info { border-color: #e6e8ee; background: #f8fafc; }
.oc-kind-failure { border-color: #fecaca; background: #fff4f4; }
.oc-kind-head { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.04em; }
.oc-kind-icon { font-size: 14px; line-height: 1; }
.oc-kind-count { font-size: 26px; font-weight: 800; color: #0f172a; letter-spacing: -0.01em; margin-top: 6px; }
.oc-kind-bar { height: 6px; background: rgba(15,23,42,0.06); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.oc-kind-bar-fill { height: 100%; transition: width 0.4s ease; }
.oc-kind-share { font-size: 11.5px; color: #6a6f7e; margin-top: 6px; }
.oc-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.oc-row {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 8px 18px;
  padding: 11px 14px; background: #fbfbfd; border: 1px solid #ececf2; border-radius: 10px;
  position: relative; overflow: hidden;
}
.oc-row-bar { position: absolute; left: 0; bottom: 0; right: 0; height: 3px; background: transparent; }
.oc-row-bar-fill { height: 100%; transition: width 0.4s ease; opacity: 0.85; }
.oc-row-label { display: inline-flex; align-items: center; gap: 8px; }
.oc-row-name { font-size: 13.5px; font-weight: 650; color: #0f172a; }
.oc-row-desc { font-size: 12px; color: #6a6f7e; margin-top: 3px; line-height: 1.4; }
.oc-row-num { text-align: right; min-width: 64px; }
.oc-row-count { font-size: 17px; font-weight: 800; color: #0f172a; line-height: 1.1; }
.oc-row-share { font-size: 11.5px; color: #6a6f7e; }
.oc-pill {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 9px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 4px;
}
.oc-pill-success { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.oc-pill-qualified { color: #4338ca; background: #eef2ff; border-color: #e0e7ff; }
.oc-pill-info { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
.oc-pill-failure { color: #991b1b; background: #fef2f2; border-color: #fecaca; }
.oc-spark { display: flex; align-items: flex-end; gap: 4px; height: 96px; padding: 8px 4px 4px; }
.oc-spark-bar { flex: 1 1 0; display: flex; align-items: flex-end; min-width: 6px; }
.oc-spark-fill { width: 100%; background: linear-gradient(180deg, #6366f1, #818cf8); border-radius: 4px 4px 0 0; min-height: 2px; }
.oc-orphan { margin-top: 14px; padding-top: 14px; border-top: 1px dashed #ececf2; }
.oc-orphan-head { font-size: 12.5px; font-weight: 700; color: #b45309; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 4px; }
.oc-row-orphan { background: #fffbeb; border-color: #fde68a; }
.oc-catalogue-head { background: transparent; border: 0; padding: 0; cursor: pointer; display: flex; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit; }
.oc-catalogue-head svg { color: #6366f1; flex: 0 0 22px; margin-top: 2px; }
.oc-catalogue-meta { flex: 1; min-width: 0; }
.oc-catalogue-list { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.oc-catalogue-row {
  display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start;
  padding: 9px 12px; background: #fbfbfd; border: 1px solid #ececf2; border-radius: 10px;
}
.oc-catalogue-label { font-size: 13px; color: #0f172a; font-weight: 600; }
.oc-catalogue-label code { font-size: 11.5px; background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-weight: 600; color: #475569; margin-right: 6px; }
.oc-catalogue-desc { font-size: 12px; color: #6a6f7e; margin-top: 2px; line-height: 1.4; }

/* ─── OutcomeCatalogueEditor (build 213) ──────────────────────────────────
   The "Customise outcomes" panel. Per-row card with editable label +
   kind, plus a hide / restore / remove affordance. Sticky save/discard
   footer when dirty. */
.oc-edit-panel { padding: 18px 22px 16px; }
.oc-edit-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.oc-edit-row {
  padding: 12px 14px;
  background: #fbfbfd;
  border: 1px solid #ececf2;
  border-radius: 10px;
  transition: opacity 0.12s ease;
}
.oc-edit-row.is-hidden { opacity: 0.55; background: #f4f5f9; }
.oc-edit-row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.oc-edit-id { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; flex-wrap: wrap; }
.oc-edit-id code {
  font-size: 11.5px; background: #f1f5f9; padding: 2px 7px;
  border-radius: 5px; font-weight: 600; color: #475569;
}
.oc-edit-badge {
  display: inline-block; font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px;
}
.oc-edit-badge-custom  { background: linear-gradient(135deg,#fce7f3 0%,#ede9fe 100%); color: #a21caf; border: 1px solid #f5d0fe; }
.oc-edit-badge-edited  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.oc-edit-badge-hidden  { background: #e5e7eb; color: #4b5563; border: 1px solid #d1d5db; }
.oc-edit-actions { display: flex; gap: 6px; }
.oc-edit-hide, .oc-edit-restore, .oc-edit-trash {
  font: inherit; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 6px; cursor: pointer;
  background: #ffffff; border: 1px solid #d8dbe4; color: #1f2230;
}
.oc-edit-hide:hover    { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.oc-edit-restore:hover { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.oc-edit-trash         { color: #b91c1c; }
.oc-edit-trash:hover   { background: #fef2f2; border-color: #fecaca; }
.oc-edit-fields { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.oc-edit-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.oc-edit-flabel { font-size: 11px; font-weight: 600; color: #6a6f7e; text-transform: uppercase; letter-spacing: 0.04em; }
.oc-edit-field .db-input { font-size: 13.5px; }
.oc-edit-field textarea.db-input { resize: vertical; min-height: 48px; font-family: inherit; }

.oc-edit-addrow { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
/* Build 209 — relocated capsules to right under the page description.
   No top margin so they sit tight against the panel sub-text; bottom
   margin separates them from the outcomes list below. */
.oc-edit-addrow-top { margin-top: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.oc-edit-add { color: #6366f1; }
.oc-edit-reset { margin-left: auto; color: #6a6f7e; }

/* Build 209 — custom-kinds panel. Between the action row and the
   outcomes list when the operator has any custom kinds OR is mid-add. */
.oc-kinds-panel {
  background: #f7f8fc;
  border: 1px solid #e6e7ec;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.oc-kinds-list {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.oc-kind-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #ffffff;
  border: 1px solid #d8dbe4;
  border-radius: 999px;
  padding: 4px 4px 4px 10px;
  font-size: 12.5px;
  color: #1f2230;
}
.oc-kind-chip-emoji { font-size: 13px; }
.oc-kind-chip-label { font-weight: 600; }
.oc-kind-chip-alias { color: #9095a3; font-size: 11.5px; }
.oc-kind-chip-x {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  border-radius: 50%;
  font-size: 14px; line-height: 1;
  color: #9095a3; cursor: pointer;
  padding: 0;
}
.oc-kind-chip-x:hover { background: #f5f6fa; color: #1f2230; }

.oc-kind-add {
  display: grid;
  grid-template-columns: 70px 1fr 200px auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #e6e7ec;
}
.oc-kind-add-field { display: flex; flex-direction: column; gap: 4px; }
.oc-kind-add-field .db-input { font-size: 13px; padding: 6px 10px; }
.oc-kind-add-actions { padding-bottom: 1px; }
@media (max-width: 640px) {
  .oc-kind-add { grid-template-columns: 1fr; }
  .oc-kind-add-actions { justify-self: end; }
}
:root[data-theme="dark"] .oc-kinds-panel { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .oc-kind-chip { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); color: #e8e9ef; }
:root[data-theme="dark"] .oc-kind-chip-x:hover { background: rgba(255,255,255,0.06); color: #e8e9ef; }

.oc-edit-addcard {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f8faff;
  border: 2px dashed #c7d2fe;
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.oc-edit-addcard-title { font-size: 13px; font-weight: 600; color: #4338ca; }
.oc-edit-addcard-actions { display: flex; gap: 8px; margin-top: 4px; }

.oc-edit-footer {
  position: sticky; bottom: 0;
  margin-top: 16px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.6) 0%, #ffffff 60%);
  border-top: 1px solid #e6e7ec;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom-left-radius: 14px; border-bottom-right-radius: 14px;
}
.oc-edit-msg { font-size: 12.5px; }
.oc-edit-msg.is-ok  { color: #166534; }
.oc-edit-msg.is-err { color: #b91c1c; }
.oc-edit-footer button + button { margin-left: 6px; }

@media (max-width: 640px) {
  .oc-edit-fields { grid-template-columns: 1fr; }
  .oc-edit-footer { flex-direction: column; align-items: stretch; }
}

:root[data-theme="dark"] .oc-edit-row { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-edit-row.is-hidden { background: #0e1015; }
:root[data-theme="dark"] .oc-edit-id code { background: #1f2433; color: #c8ccd9; }
:root[data-theme="dark"] .oc-edit-flabel { color: #9aa0ad; }
:root[data-theme="dark"] .oc-edit-hide, :root[data-theme="dark"] .oc-edit-restore, :root[data-theme="dark"] .oc-edit-trash { background: #1f2433; border-color: #2a2f3e; color: #c8ccd9; }
:root[data-theme="dark"] .oc-edit-trash { color: #fca5a5; }
:root[data-theme="dark"] .oc-edit-addcard { background: #14182a; border-color: #3730a3; }
:root[data-theme="dark"] .oc-edit-addcard-title { color: #a5b4fc; }
:root[data-theme="dark"] .oc-edit-footer { background: linear-gradient(180deg, rgba(20,23,31,0.6) 0%, #14171f 60%); border-top-color: #2a2f3e; }

/* Top-of-page "Email schedule" CTA (build 215b) — pink-purple
   gradient button in the page actions row that scrolls the operator
   to the schedule card at the bottom. Hard to miss; shows the current
   schedule inline as a pill so a quick glance answers "is it on?". */
.oc-actions-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.oc-schedule-cta {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13px; font-weight: 600;
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(168, 85, 247, 0.25);
  white-space: nowrap;
  transition: filter 0.12s ease, transform 0.06s ease;
}
.oc-schedule-cta:hover  { filter: brightness(1.06); }
.oc-schedule-cta:active { transform: translateY(1px); }
.oc-schedule-cta-icon { font-size: 14px; line-height: 1; }
.oc-schedule-cta-text { letter-spacing: -0.005em; }
.oc-schedule-cta-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  letter-spacing: 0.02em;
}
.oc-schedule-cta-pill-off { background: rgba(255, 255, 255, 0.16); opacity: 0.85; }

/* Pulse animation — when the CTA scrolls the user to the schedule
   card, briefly highlight the card so the eye lands on it. */
@keyframes oc-card-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
  20%  { box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.35); }
  100% { box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}
.oc-digest-card.is-pulsing {
  animation: oc-card-pulse 1.6s ease-out;
  border-color: #a855f7;
}

/* Email digest schedule card (build 214) */
.oc-digest-card { padding: 18px 22px 16px; margin-top: 16px; }
.oc-digest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0 14px;
}
.oc-digest-field { display: flex; flex-direction: column; gap: 4px; }
.oc-digest-preview {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #f0f7ff;
  border: 1px solid #cfe3ff;
  border-radius: 8px;
  font-size: 13px;
  color: #1e40af;
  font-weight: 500;
}
.oc-digest-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e6e7ec;
}
.oc-digest-footer button + button { margin-left: 6px; }
@media (max-width: 640px) {
  .oc-digest-footer { flex-direction: column; align-items: stretch; }
}
:root[data-theme="dark"] .oc-digest-preview { background: #14182a; border-color: #2f3550; color: #93c5fd; }
:root[data-theme="dark"] .oc-digest-footer { border-top-color: #2a2f3e; }

/* DigestPreviewModal (build 215) — server-rendered email inside a
   sandboxed iframe so the operator sees byte-for-byte what owners
   will receive. */
.db-digest-preview-modal {
  max-width: 760px;
  width: 92%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}
.db-digest-preview-modal .db-modal-head h2 { margin: 0 0 4px; font-size: 18px; }
.db-digest-preview-sub {
  font-size: 12px;
  color: #6a6f7d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.db-digest-not-today { color: #b45309; font-weight: 600; }
.db-digest-preview-meta {
  padding: 10px 22px;
  background: #f7f8fc;
  border-bottom: 1px solid #e6e7ec;
  font-size: 13px;
}
.db-digest-preview-meta-row { display: flex; gap: 10px; }
.db-digest-preview-meta-label {
  font-weight: 600;
  color: #6a6f7d;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  align-self: center;
  min-width: 60px;
}
.db-digest-preview-meta-value { font-weight: 500; color: #1f2230; word-break: break-word; }
.db-digest-preview-frame-wrap {
  flex: 1;
  min-height: 320px;
  overflow: hidden;
  background: #eef0f4;
}
.db-digest-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 480px;
  border: 0;
  background: #eef0f4;
}
:root[data-theme="dark"] .db-digest-preview-sub { color: #9095a3; }
:root[data-theme="dark"] .db-digest-preview-meta { background: #14171f; border-bottom-color: #2a2f3e; }
:root[data-theme="dark"] .db-digest-preview-meta-label { color: #9095a3; }
:root[data-theme="dark"] .db-digest-preview-meta-value { color: #e8e9ef; }

:root[data-theme="dark"] .oc-kpi, :root[data-theme="dark"] .oc-row, :root[data-theme="dark"] .oc-catalogue-row { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-kpi-value, :root[data-theme="dark"] .oc-row-name, :root[data-theme="dark"] .oc-row-count, :root[data-theme="dark"] .oc-catalogue-label { color: #f1f3f8; }
:root[data-theme="dark"] .oc-kpi-label, :root[data-theme="dark"] .oc-kpi-sub, :root[data-theme="dark"] .oc-row-desc, :root[data-theme="dark"] .oc-row-share, :root[data-theme="dark"] .oc-catalogue-desc { color: #9aa0ad; }
:root[data-theme="dark"] .oc-kind { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-kind-success { background: #0f1a13; border-color: #1f3d2a; }
:root[data-theme="dark"] .oc-kind-qualified { background: #14182a; border-color: #2f3550; }
:root[data-theme="dark"] .oc-kind-info { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-kind-failure { background: #1f1414; border-color: #4b2026; }
:root[data-theme="dark"] .oc-kind-head { color: #aab0c0; }
:root[data-theme="dark"] .oc-kind-count, :root[data-theme="dark"] .oc-kind-share { color: #f1f3f8; }
:root[data-theme="dark"] .oc-range { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-range-btn { color: #aab0c0; }
:root[data-theme="dark"] .oc-range-btn.is-active { background: #1f2433; color: #f1f3f8; }
:root[data-theme="dark"] .oc-pill-success { color: #86efac; background: #052e16; border-color: #14532d; }
:root[data-theme="dark"] .oc-pill-qualified { color: #c7d2fe; background: #1e2233; border-color: #2f3550; }
:root[data-theme="dark"] .oc-pill-info { color: #cbd5e1; background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-pill-failure { color: #fca5a5; background: #1f1414; border-color: #6b2a36; }
:root[data-theme="dark"] .oc-row-orphan { background: #2a1f0a; border-color: #6b4f12; }
:root[data-theme="dark"] .oc-orphan-head { color: #fbbf24; }
:root[data-theme="dark"] .oc-catalogue-label code { background: #1a1f2c; color: #cbd5e1; }
/* Clickable tiles + rows → drill into Call log filtered */
.oc-clickable { cursor: pointer; transition: transform 0.12s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.oc-clickable:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08); border-color: #c2c7d4; }
.oc-clickable:active { transform: translateY(0); }
button.oc-kpi { font: inherit; color: inherit; text-align: left; }
button.oc-kpi:disabled { cursor: default; opacity: 0.6; }
.oc-kpi-click { display: block; }
button.oc-kind { font: inherit; color: inherit; text-align: left; width: 100%; }
button.oc-kind:disabled { cursor: default; }
/* Active-filter banner on the Call log page */
.db-filter-banner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 14px; padding: 9px 13px;
  background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 10px;
  font-size: 13px; color: #3730a3;
}
.db-filter-banner b { color: #1e1b4b; }
.db-filter-banner-icon { font-size: 14px; }
.db-filter-clear {
  margin-left: auto; font: inherit; font-size: 12px; font-weight: 600; color: #4338ca;
  background: transparent; border: 1px solid #c7d2fe; border-radius: 999px; padding: 3px 11px; cursor: pointer;
}
.db-filter-clear:hover { background: #c7d2fe; color: #1e1b4b; }
:root[data-theme="dark"] .db-filter-banner { background: #1a1f2c; border-color: #2f3550; color: #c7d2fe; }
:root[data-theme="dark"] .db-filter-banner b { color: #e0e7ff; }
:root[data-theme="dark"] .db-filter-clear { color: #c7d2fe; border-color: #2f3550; }
:root[data-theme="dark"] .db-filter-clear:hover { background: #2f3550; color: #e0e7ff; }
/* Operator-editable success weights */
.oc-weights-head { background: transparent; border: 0; padding: 0; cursor: pointer; display: flex; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit; }
.oc-weights-head svg { color: #6366f1; flex: 0 0 22px; margin-top: 2px; }
.oc-weights-meta { flex: 1; min-width: 0; }
.oc-weights-body { margin-top: 14px; }
.oc-weights-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.oc-weight-card { padding: 12px 14px; background: #fbfbfd; border: 1px solid #ececf2; border-radius: 10px; }
.oc-weight-head { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 650; color: #0f172a; }
.oc-weight-label { letter-spacing: 0.01em; }
.oc-weight-controls { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.oc-weight-slider { flex: 1; accent-color: #6366f1; }
.oc-weight-num {
  width: 64px; font: inherit; font-size: 13px; color: #0f172a;
  background: #fff; border: 1px solid #d8dae3; border-radius: 8px; padding: 5px 8px;
  text-align: center;
}
.oc-weight-num:focus { outline: 0; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.oc-weight-default { font-size: 11.5px; color: #6a6f7e; }
.oc-weight-default b { color: #3a3f52; }
.oc-weights-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.oc-weights-help { font-size: 12px; color: #6a6f7e; max-width: 380px; }
.oc-weights-help code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; font-size: 11.5px; }
.oc-weights-actions { display: inline-flex; align-items: center; gap: 8px; }
.oc-weights-msg { font-size: 12.5px; font-weight: 600; color: #16a34a; }
:root[data-theme="dark"] .oc-weight-card { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-weight-head, :root[data-theme="dark"] .oc-weight-num { color: #f1f3f8; }
:root[data-theme="dark"] .oc-weight-num { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-weight-default, :root[data-theme="dark"] .oc-weights-help { color: #9aa0ad; }
:root[data-theme="dark"] .oc-weight-default b { color: #cbd5e1; }
:root[data-theme="dark"] .oc-weights-help code { background: #14171f; color: #cbd5e1; }

/* ─── Cleaned-up Call outcomes layout ──────────────────────────────────── */
/* Hero row: weighted success (big) + by-kind list */
.oc-hero {
  display: grid; gap: 12px;
  grid-template-columns: 1.2fr 1fr;
  margin-bottom: 14px;
}
@media (max-width: 720px) { .oc-hero { grid-template-columns: 1fr; } }
.oc-hero-card {
  background: #ffffff; border: 1px solid #ececf2; border-radius: 14px;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 12px;
  font: inherit; color: inherit; text-align: left;
}
.oc-hero-success { cursor: pointer; }
.oc-hero-success:disabled { cursor: default; opacity: 0.85; }
.oc-hero-label { font-size: 11.5px; font-weight: 700; color: #6a6f7e; text-transform: uppercase; letter-spacing: 0.06em; }
.oc-hero-value {
  font-size: 56px; font-weight: 800; color: #0f172a;
  line-height: 1; letter-spacing: -0.025em;
  margin-top: -2px;
}
.oc-hero-unit { font-size: 22px; font-weight: 700; color: #6a6f7e; margin-left: 4px; }
.oc-hero-bar {
  display: flex; height: 8px; width: 100%; gap: 1px;
  background: rgba(15, 23, 42, 0.05); border-radius: 999px; overflow: hidden;
}
.oc-hero-bar > span { display: block; height: 100%; transition: width 0.4s ease; }
.oc-hero-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12.5px; color: #6a6f7e;
}
.oc-hero-weights {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: #4338ca; background: #eef2ff; border: 1px solid #e0e7ff;
  border-radius: 999px; padding: 2px 9px;
}
/* By-kind list inside the hero card */
.oc-hero-kinds .oc-kind-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.oc-kind-line {
  display: grid; grid-template-columns: 14px 1fr auto auto; gap: 10px;
  align-items: center; width: 100%;
  background: transparent; border: 0; border-radius: 8px;
  font: inherit; color: inherit; text-align: left;
  padding: 8px 8px;
  cursor: pointer;
  transition: background 0.14s ease;
}
.oc-kind-line:hover { background: #f3f4f8; }
.oc-kind-line:disabled { cursor: default; opacity: 0.55; }
.oc-kind-line:disabled:hover { background: transparent; }
.oc-kind-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.oc-kind-name { font-size: 13.5px; font-weight: 600; color: #1a1d2b; }
.oc-kind-line-count { font-size: 14px; font-weight: 700; color: #0f172a; min-width: 28px; text-align: right; font-variant-numeric: tabular-nums; }
.oc-kind-line-share { font-size: 12px; color: #6a6f7e; min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }

/* Grouped outcomes — single section, four sub-headers, light rows */
.oc-grouped { padding: 6px 10px 14px; }
.oc-group { padding: 12px 6px 4px; border-bottom: 1px solid #f1f2f6; }
.oc-group:last-child { border-bottom: 0; }
.oc-group-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.oc-group-name { font-size: 13px; font-weight: 700; color: #1a1d2b; letter-spacing: 0.01em; text-transform: uppercase; }
.oc-group-meta { font-size: 12px; color: #6a6f7e; margin-left: auto; }
.oc-group-meta-quiet { font-style: italic; }
.oc-group-empty { font-size: 12.5px; color: #8a8f9e; padding: 4px 4px 8px; }
.oc-rows-clean { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.oc-row-clean {
  display: grid; grid-template-columns: 1fr 120px 44px 44px;
  gap: 10px; align-items: center;
  padding: 7px 8px;
  border-radius: 7px;
  font-size: 13.5px;
  color: #1a1d2b;
  transition: background 0.12s ease;
}
.oc-row-clean.oc-clickable { cursor: pointer; }
.oc-row-clean.oc-clickable:hover { background: #f5f6f9; }
.oc-row-clean.is-empty { color: #9aa0ad; }
.oc-row-clean .oc-row-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-row-meter {
  height: 5px; background: rgba(15, 23, 42, 0.05); border-radius: 4px; overflow: hidden;
}
.oc-row-meter-fill { display: block; height: 100%; transition: width 0.4s ease; }
.oc-row-clean .oc-row-count { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.oc-row-clean .oc-row-share { color: #6a6f7e; font-variant-numeric: tabular-nums; text-align: right; font-size: 12.5px; }
.oc-group-more {
  font: inherit; font-size: 12px; font-weight: 600; color: #6366f1;
  background: transparent; border: 0; border-radius: 6px;
  padding: 6px 4px; margin-top: 2px; cursor: pointer;
}
.oc-group-more:hover { color: #4338ca; text-decoration: underline; }

/* Tools row — quiet bottom strip */
.oc-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.oc-tool {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 12.5px; font-weight: 600; color: #475569;
  background: #f6f7fa; border: 1px solid #e6e7ec; border-radius: 999px;
  padding: 6px 13px; cursor: pointer; position: relative;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.oc-tool:hover { background: #eef0f5; border-color: #c8cdda; color: #1f2937; }
.oc-tool.is-open { background: #1e1b4b; color: #fff; border-color: #1e1b4b; }
.oc-tool-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #ef4444; display: inline-block;
  margin-left: 2px;
}
.oc-drawer { margin-top: 8px; }
.oc-drawer-head { margin-bottom: 10px; }

/* Tighten the existing weights grid */
.oc-weight-card .oc-weight-default { font-size: 11px; }
.oc-weights-foot { margin-top: 10px; }

/* Dark mode for the new bits */
:root[data-theme="dark"] .oc-hero-card { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .oc-hero-value { color: #f1f3f8; }
:root[data-theme="dark"] .oc-hero-unit, :root[data-theme="dark"] .oc-hero-foot { color: #9aa0ad; }
:root[data-theme="dark"] .oc-hero-bar { background: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .oc-hero-weights { color: #c7d2fe; background: #1e2233; border-color: #2f3550; }
:root[data-theme="dark"] .oc-kind-line:hover { background: #1c2030; }
:root[data-theme="dark"] .oc-kind-name, :root[data-theme="dark"] .oc-kind-line-count, :root[data-theme="dark"] .oc-row-clean { color: #f1f3f8; }
:root[data-theme="dark"] .oc-kind-line-share, :root[data-theme="dark"] .oc-row-clean .oc-row-share, :root[data-theme="dark"] .oc-group-meta, :root[data-theme="dark"] .oc-group-empty { color: #9aa0ad; }
:root[data-theme="dark"] .oc-group { border-bottom-color: #2a2f3e; }
:root[data-theme="dark"] .oc-group-name { color: #f1f3f8; }
:root[data-theme="dark"] .oc-row-clean.oc-clickable:hover { background: #1c2030; }
:root[data-theme="dark"] .oc-row-meter { background: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .oc-tool { background: #14171f; border-color: #2a2f3e; color: #cbd5e1; }
:root[data-theme="dark"] .oc-tool:hover { background: #1c2030; border-color: #3a4054; color: #f1f3f8; }
:root[data-theme="dark"] .oc-tool.is-open { background: linear-gradient(135deg, #6366f1, #818cf8); color: #fff; border-color: #6366f1; }
:root[data-theme="dark"] .oc-row-clean.is-empty { color: #5f6577; }

/* Purpose alignment panel — joins Core purpose to outcomes */
.oc-purpose {
  background: linear-gradient(180deg, #fffbeb 0%, #fffef6 100%);
  border: 1px solid #fde68a;
  padding: 14px 16px;
}
.oc-purpose-head {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px;
  align-items: center;
}
.oc-purpose-star { font-size: 22px; line-height: 1; }
.oc-purpose-meta { min-width: 0; }
.oc-purpose-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em;
  color: #92400e; text-transform: uppercase;
}
.oc-purpose-summary {
  margin: 2px 0 0; font-size: 14px; line-height: 1.45; color: #1a1d2b;
  font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.oc-purpose-conv {
  background: #ffffff; border: 1px solid #fde68a; border-radius: 12px;
  padding: 10px 16px; font: inherit; color: inherit; text-align: right;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.oc-purpose-conv:hover { transform: translateY(-1px); border-color: #f59e0b; box-shadow: 0 6px 18px rgba(245, 158, 11, 0.18); }
.oc-purpose-conv:disabled { cursor: default; opacity: 0.7; transform: none; }
.oc-purpose-conv-num {
  font-size: 28px; font-weight: 800; color: #92400e; line-height: 1; letter-spacing: -0.02em;
}
.oc-purpose-conv-num span { font-size: 14px; font-weight: 700; color: #b45309; margin-left: 2px; }
.oc-purpose-conv-sub { font-size: 11px; color: #92400e; margin-top: 3px; }
.oc-purpose-chips {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px dashed #fde68a;
}
.oc-purpose-chip-label { font-size: 11.5px; color: #92400e; font-weight: 600; margin-right: 4px; }
.oc-purpose-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 12.5px; font-weight: 600; color: #1a1d2b;
  background: #ffffff; border: 1px solid #fde68a; border-radius: 999px;
  padding: 5px 11px; cursor: pointer;
  transition: background 0.14s ease, border-color 0.14s ease;
}
.oc-purpose-chip:hover { background: #fef3c7; border-color: #f59e0b; }
.oc-purpose-chip:disabled { opacity: 0.55; cursor: default; }
.oc-purpose-chip:disabled:hover { background: #fff; border-color: #fde68a; }
.oc-purpose-chip-count {
  font-weight: 800; font-variant-numeric: tabular-nums; color: #92400e;
  background: #fef3c7; border-radius: 999px; padding: 0 7px; min-width: 22px; text-align: center;
}
.oc-purpose-empty {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0 14px; padding: 10px 14px;
  background: #fff7ed; border: 1px dashed #fdba74; border-radius: 10px;
  font-size: 13px; color: #7c2d12;
}
.oc-purpose-empty a { color: #b45309; font-weight: 600; text-decoration: underline; }

/* Primary-outcome row decoration in the grouped section */
.oc-row-clean.is-primary { background: rgba(254, 243, 199, 0.45); }
.oc-row-clean.is-primary:hover { background: rgba(253, 230, 138, 0.6); }
.oc-row-star { display: inline-block; margin-right: 4px; font-size: 13px; }

:root[data-theme="dark"] .oc-purpose {
  background: linear-gradient(180deg, #2a1f0a 0%, #1f1810 100%);
  border-color: #6b4f12;
}
:root[data-theme="dark"] .oc-purpose-title, :root[data-theme="dark"] .oc-purpose-conv-num,
:root[data-theme="dark"] .oc-purpose-conv-sub, :root[data-theme="dark"] .oc-purpose-chip-label { color: #fbbf24; }
:root[data-theme="dark"] .oc-purpose-summary { color: #f1f3f8; }
:root[data-theme="dark"] .oc-purpose-conv { background: #1a1612; border-color: #6b4f12; }
:root[data-theme="dark"] .oc-purpose-conv-num span { color: #fde68a; }
:root[data-theme="dark"] .oc-purpose-chip { background: #1a1612; border-color: #6b4f12; color: #fef3c7; }
:root[data-theme="dark"] .oc-purpose-chip:hover { background: #2a1f0a; border-color: #f59e0b; }
:root[data-theme="dark"] .oc-purpose-chip-count { background: #2a1f0a; color: #fde68a; }
:root[data-theme="dark"] .oc-purpose-chips { border-top-color: #6b4f12; }
:root[data-theme="dark"] .oc-purpose-empty { background: #2a1f0a; border-color: #6b4f12; color: #fde68a; }
:root[data-theme="dark"] .oc-purpose-empty a { color: #fbbf24; }
:root[data-theme="dark"] .oc-row-clean.is-primary { background: rgba(120, 85, 30, 0.22); }
:root[data-theme="dark"] .oc-row-clean.is-primary:hover { background: rgba(160, 116, 40, 0.35); }

/* The old big-tile / KPI / 4-up grid styles aren't used by the new layout
   anymore, but we leave them in place — they don't render unless a future
   variant of this page re-mounts them. */
:root[data-theme="dark"] .db-kb-source { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .db-kb-source-label { color: #f1f3f8; }
:root[data-theme="dark"] .db-kb-source-when { color: #9aa0ad; }
:root[data-theme="dark"] .db-kb-sources-pill { color: #c7d2fe; background: #1e2233; border-color: #2f3550; }
:root[data-theme="dark"] .db-dropzone.is-clickable:hover { background: #1a1730; border-color: #6d5bd0; color: #c7d2fe; }

/* User menu in the top bar — avatar button + dropdown */
.db-user { position: relative; }
.db-topbar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #c4b5fd, #f0abfc);
  color: #1a0f2e;
  font-size: 13px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border: 0;
  font-family: inherit;
  transition: transform 0.15s ease;
}
.db-topbar-avatar:hover { transform: scale(1.04); }
.db-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.10);
  padding: 8px;
  z-index: 20;
}
.db-user-id {
  padding: 8px 10px 10px;
}
.db-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}
.db-user-email {
  font-size: 12px;
  color: #6a6a6a;
  margin-top: 2px;
}
.db-user-sep {
  height: 1px;
  background: #f0f0f3;
  margin: 4px 0;
}
.db-user-item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #1a1a1a;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.db-user-item:hover { background: #f5f6f8; }

/* ─── Split-layout auth page (build 236) ────────────────────────────────
   Left: dark starry panel with the white SpiderX logo + showcase + trust
   strip. Right: white card with the email → OTP → Google form. */
/* Build 239 — single full-page surface. Video covers the whole viewport;
 * a centred rounded card floats on top. Old `.sx-auth-split` 2-column
 * grid + `.sx-auth-left` panel rules kept (unused) so any backed-up
 * cache returning the previous markup still degrades gracefully. */
.sx-auth-full {
  position: fixed; inset: 0;
  overflow: hidden;
  z-index: 50;
  background: #06050c;
  color: #f7f5ff;
  /* No split, no grid — the children stack absolutely via position
   * and the card centres in the remaining flex space. */
  display: flex; flex-direction: column;
}
.sx-auth-split {
  position: fixed; inset: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #06050c;
  color: #f7f5ff;
  overflow: hidden;
  z-index: 50;
}
.sx-auth-left {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 25% 15%, rgba(99, 102, 241, 0.18), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(168, 85, 247, 0.16), transparent 55%),
    radial-gradient(circle at 60% 35%, rgba(59, 130, 246, 0.10), transparent 70%),
    linear-gradient(180deg, #0a0617 0%, #06050c 60%, #1a0d33 100%);
}
/* Build 237 — background video covers the left panel; object-fit:cover
 * keeps it filling regardless of viewport aspect ratio. The veil is a
 * dark overlay (radial spotlight on the centre) so foreground text +
 * showcase stay legible without dimming the video into mud. */
.sx-auth-bgvideo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
  /* Prevent any flash of system controls on Safari. */
  background: transparent;
}
.sx-auth-veil {
  position: absolute; inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(60% 50% at 50% 50%, rgba(6, 5, 12, 0.18) 0%, rgba(6, 5, 12, 0.55) 100%),
    linear-gradient(180deg, rgba(6, 5, 12, 0.35) 0%, rgba(6, 5, 12, 0.55) 100%);
}
/* Lift the inner content above the video + veil. */
.sx-auth-left-inner { position: relative; z-index: 2; }
/* Star field — CSS-only, no image, no animation cost. Uses a stacked
 * radial-gradient pattern of tiny white dots to simulate stars. */
.sx-auth-stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(1px 1px at 27% 62%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 44% 9%,  rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 65% 40%,  rgba(255,255,255,0.65), transparent 60%),
    radial-gradient(1px 1px at 80% 75%,  rgba(255,255,255,0.4),  transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 25%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 33% 88%,  rgba(255,255,255,0.5),  transparent 60%),
    radial-gradient(1px 1px at 55% 78%,  rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 18% 72%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 92% 58%,  rgba(255,255,255,0.5),  transparent 60%),
    radial-gradient(1px 1px at 7% 45%,   rgba(255,255,255,0.45), transparent 60%);
  background-repeat: no-repeat;
  pointer-events: none;
}
.sx-auth-left-inner {
  position: relative;
  height: 100%;
  display: flex; flex-direction: column;
  padding: 56px 64px;
  gap: 48px;
}
.sx-auth-logo {
  display: inline-flex; align-items: center;
  line-height: 0;
}
.sx-auth-logo img { height: 40px; width: auto; }
.sx-auth-showcase {
  display: flex; flex-direction: column; gap: 22px;
  margin: auto 0;
  align-items: center; text-align: center;
}
.sx-auth-showcase-eyebrow {
  font-size: 14px; color: rgba(255,255,255,0.6);
  letter-spacing: 0.01em;
}
.sx-auth-showcase-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 22px 14px 14px;
  background: rgba(255,255,255,0.94);
  border-radius: 999px;
  color: #1a1a1a;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
  min-width: 320px;
}
.sx-auth-showcase-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899, #a855f7);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700;
  flex: 0 0 48px;
}
.sx-auth-showcase-avatar svg { display: block; }
.sx-auth-showcase-meta { flex: 1; text-align: left; }
.sx-auth-showcase-name { font-size: 18px; font-weight: 700; letter-spacing: -0.005em; }
.sx-auth-showcase-role { font-size: 12.5px; color: #6a6f7d; margin-top: 2px; }
.sx-auth-showcase-switch {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #3b82f6, #6366f1);
  border: 0; border-radius: 50%;
  color: #fff; cursor: pointer;
}
.sx-auth-pills {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: center;
  max-width: 520px;
}
.sx-auth-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  font-size: 13px; color: #e7e9ee;
  font-weight: 500;
}
.sx-auth-pill svg { color: #34d399; }
.sx-auth-trust {
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
  text-align: center;
  letter-spacing: 0.01em;
}

/* Right panel — soft canvas behind the actual login card.
 * Build 238 — was solid white with the form floating raw on it; user
 * asked for the form to read as a rounded card. So the PANEL goes
 * soft grey + the CARD goes white-on-white with a border, rounded
 * corners and a subtle elevation. Build 239: this only applies in
 * the legacy split layout; the full-page layout has its own override
 * below (transparent canvas, card floats on video). */
.sx-auth-right {
  display: flex; align-items: center; justify-content: center;
  background: #f5f6fa;
  padding: 40px 32px;
}
.sx-auth-card {
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; gap: 16px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 20px;
  padding: 36px 36px 32px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 32px rgba(15, 23, 42, 0.06);
}
:root[data-theme="dark"] .sx-auth-right { background: #0b0d14; }
:root[data-theme="dark"] .sx-auth-card {
  background: #14171f;
  border-color: rgba(255,255,255,0.08);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.4),
    0 12px 32px rgba(0, 0, 0, 0.45);
}

/* ─── Full-page layout (build 241) ─────────────────────────────────────
 * Video covers the entire viewport. The original two-column content
 * layout sits ON TOP of it — left column with logo + showcase + pills
 * + trust strip; right column with the rounded login card. Both
 * columns are transparent over the shared video, so there's no visible
 * panel divider between them anymore. */
.sx-auth-cols {
  position: relative; z-index: 2;
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.sx-auth-leftcol {
  position: relative;
  display: flex; flex-direction: column;
  padding: 48px 56px;
  gap: 36px;
  color: #f7f5ff;
}
.sx-auth-rightcol {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 48px;
}
/* Force the logo's white wordmark + keep the red X. The SpiderXLogo
 * SVG uses currentColor for the letters; the X is hardcoded #df3739
 * inline. Drop-shadow lifts the mark off bright frames of the video. */
.sx-auth-leftcol .sx-auth-logo,
.sx-auth-logo-corner {
  color: #ffffff !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  text-decoration: none;
}
.sx-auth-leftcol .sx-auth-logo svg path[fill="currentColor"],
.sx-auth-logo-corner svg path[fill="currentColor"] { fill: #ffffff; }

/* Card sits on top of the video — needs the stronger shadow it used
 * to get from a solid white right panel. */
.sx-auth-full .sx-auth-card {
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.35),
    0 24px 60px rgba(0, 0, 0, 0.45);
  padding: 36px 36px 32px;
  width: 100%; max-width: 440px;
}

@media (max-width: 900px) {
  /* Stack on tablet / phone — left content collapses above the form
   * so it stays available without crowding the input field. */
  .sx-auth-cols { grid-template-columns: 1fr; }
  .sx-auth-leftcol { padding: 28px 24px 8px; gap: 20px; }
  .sx-auth-rightcol { padding: 16px 18px 28px; }
  .sx-auth-full .sx-auth-card { padding: 28px 22px 24px; border-radius: 18px; }
}
.sx-auth-title {
  margin: 0;
  font-size: 30px; font-weight: 700;
  letter-spacing: -0.015em;
  color: #1a1a1a;
  line-height: 1.2;
}
.sx-auth-sub {
  margin: 0;
  font-size: 14.5px; color: #6a6f7d;
  line-height: 1.5;
}
.sx-auth-form {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 8px;
}
.sx-auth-input {
  width: 100%;
  padding: 14px 16px;
  font: inherit; font-size: 15px;
  background: #f7f8fa;
  border: 1px solid #e6e7ec;
  border-radius: 10px;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.sx-auth-input::placeholder { color: #9aa0ad; }
.sx-auth-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
  background: #ffffff;
}
.sx-auth-input-otp {
  text-align: center;
  letter-spacing: 0.6em;
  font-size: 22px; font-weight: 600;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.sx-auth-error {
  font-size: 13px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 12px;
}
.sx-auth-cta {
  margin-top: 6px;
  padding: 14px 18px;
  font: inherit; font-size: 15px; font-weight: 600;
  background: #2563eb;
  color: #ffffff;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: filter 0.12s ease, transform 0.06s ease;
}
.sx-auth-cta:hover:not(:disabled) { filter: brightness(1.06); }
.sx-auth-cta:active:not(:disabled) { transform: translateY(1px); }
.sx-auth-cta:disabled { opacity: 0.55; cursor: not-allowed; }
.sx-auth-switch {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13.5px; color: #6a6f7d;
  margin-top: 2px;
}
.sx-auth-switch button {
  background: transparent; border: 0; padding: 0;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: #2563eb; cursor: pointer;
}
.sx-auth-switch button:hover:not(:disabled) { text-decoration: underline; }
.sx-auth-switch button:disabled { color: #9aa0ad; cursor: not-allowed; }
.sx-auth-or {
  position: relative;
  text-align: center;
  margin: 8px 0;
  color: #9aa0ad;
  font-size: 12.5px;
}
.sx-auth-or::before, .sx-auth-or::after {
  content: ""; position: absolute; top: 50%;
  width: calc(50% - 60px); height: 1px;
  background: #e6e7ec;
}
.sx-auth-or::before { left: 0; }
.sx-auth-or::after { right: 0; }
.sx-auth-google {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 16px;
  font: inherit; font-size: 14.5px; font-weight: 500;
  background: #ffffff;
  color: #1a1a1a;
  border: 1px solid #e6e7ec;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.sx-auth-google:hover:not(:disabled) { background: #f7f8fa; border-color: #d8dbe4; }
.sx-auth-google:disabled { opacity: 0.55; cursor: not-allowed; }

@media (max-width: 900px) {
  .sx-auth-split { grid-template-columns: 1fr; }
  .sx-auth-left { display: none; }
  .sx-auth-right { padding: 24px 18px; }
}

/* Old auth (kept as fallback, not used by the new AuthPage) ─────────── */
/* Auth pages — centred card, light theme */
.db-auth {
  position: fixed;
  inset: 0;
  z-index: 12;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(196, 181, 253, 0.16) 0%, transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(125, 211, 252, 0.12) 0%, transparent 60%),
    #f7f8fa;
  padding: 32px 18px;
  overflow-y: auto;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
  color: #1a1a1a;
  animation: dbfade 0.3s cubic-bezier(.2,.9,.3,1);
}
.db-auth-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.04);
}
.db-auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
}
.db-auth-brand img { display: none; }
.db-auth-wordmark {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #1a1a1a;
  display: flex; align-items: center; gap: 8px;
}
.db-auth-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.db-auth-sub {
  margin: 0 0 14px;
  font-size: 13.5px;
  color: #6a6a6a;
  line-height: 1.5;
}
.db-auth-cta {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}
.db-auth-google {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  height: 40px;
  margin-top: 12px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #d8dae3;
  color: #1a1a1a;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.db-auth-google:hover:not(:disabled) { background: #f5f6f8; }
.db-auth-google:disabled { opacity: 0.55; cursor: not-allowed; }
.db-auth-switch {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: #6a6a6a;
}
.db-auth-switch button {
  background: transparent;
  border: 0;
  color: #2563eb;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0 4px;
  text-decoration: underline;
}

/* Call surfaces in light mode — pills + input were designed for dark glass.
 * Flip them to ink-on-paper translucents so the call view reads well on the
 * cream background. */
:root[data-theme="light"] .callchrome-top,
:root:not([data-theme]) .callchrome-top {
  background: rgba(255, 255, 255, 0.78);
  border-color: #e6e7ec;
  color: #0f172a;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}
:root[data-theme="light"] .callchrome-top .state,
:root:not([data-theme]) .callchrome-top .state,
:root[data-theme="light"] .callchrome-top .timer,
:root:not([data-theme]) .callchrome-top .timer {
  color: #6a6f7e;
}
:root[data-theme="light"] .callchrome-top .timer,
:root:not([data-theme]) .callchrome-top .timer {
  border-left-color: #e6e7ec;
}
:root[data-theme="light"] .type-rail input,
:root:not([data-theme]) .type-rail input {
  background: rgba(255, 255, 255, 0.82);
  border-color: #d8dae3;
  color: #0f172a;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}
:root[data-theme="light"] .type-rail input::placeholder,
:root:not([data-theme]) .type-rail input::placeholder {
  color: #9aa0ad;
}
:root[data-theme="light"] .type-rail input:focus,
:root:not([data-theme]) .type-rail input:focus {
  border-color: #3b82f6;
  background: #ffffff;
}
:root[data-theme="light"] .cap-text,
:root:not([data-theme]) .cap-text {
  color: #1a1a1a;
}
:root[data-theme="light"] .cap-user .cap-text,
:root:not([data-theme]) .cap-user .cap-text {
  color: #4a5063;
}
:root[data-theme="light"] .cap-history-btn,
:root:not([data-theme]) .cap-history-btn {
  background: rgba(255, 255, 255, 0.78);
  border-color: #e6e7ec;
  color: #4a5063;
}

/* Theme toggle — same shape in top bar and on landing. Inherits color from
 * its container so dark/light styling falls out naturally. */
.theme-toggle {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.theme-toggle svg { width: 18px; height: 18px; }
.db-topbar .theme-toggle {
  color: #4a4a4a;
  border-color: #e6e7ec;
}
.db-topbar .theme-toggle:hover { background: #f5f6f8; border-color: #c8cbd6; }

/* Landing variant — fixed top-right opposite the brandbar */
.landing-theme {
  position: fixed;
  top: clamp(16px, 2.4vh, 28px);
  right: clamp(16px, 2.4vw, 28px);
  z-index: 5;
  pointer-events: auto;
  animation: lpfadein 0.7s ease 0.05s both;
}

/* ─── Landing topbar nav (build 247) ───────────────────────────────────
 * Sits between the brandbar (top-left) and the theme toggle (top-right).
 * Two affordances: a quiet "Pricing" link and a primary pill that says
 * "Login" (logged-out) or "Dashboard" (logged-in). The pill is the
 * visual anchor — its colour matches the SpiderX accent so the
 * returning operator's eye lands on Dashboard the moment the page
 * settles. */
.lp-topbar-nav {
  position: fixed;
  /* Anchored to the same top as the theme toggle, then offset just to
   * its LEFT so the two never overlap. The exact gap is tuned to the
   * theme-toggle's ~36 px width plus a comfortable 12 px breathing room. */
  top: clamp(16px, 2.4vh, 28px);
  right: clamp(64px, calc(2.4vw + 52px), 76px);
  z-index: 5;
  display: inline-flex; align-items: center; gap: 10px;
  pointer-events: auto;
  animation: lpfadein 0.7s ease 0.05s both;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.lp-topbar-link {
  display: inline-flex; align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.78);
  transition: color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.lp-topbar-link:hover,
.lp-topbar-link:focus-visible {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.lp-topbar-cta {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.lp-topbar-cta:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.36);
}
.lp-topbar-cta:active { transform: scale(0.97); }
.lp-topbar-cta:focus-visible {
  outline: 2px solid rgba(167, 139, 250, 0.65);
  outline-offset: 2px;
}

/* Light theme — the landing background is light, so the nav inverts. */
:root[data-theme="light"] .lp-topbar-link,
:root:not([data-theme]) .lp-topbar-link { color: rgba(31, 34, 48, 0.72); }
:root[data-theme="light"] .lp-topbar-link:hover,
:root:not([data-theme]) .lp-topbar-link:hover {
  color: #1f2230;
  background: rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .lp-topbar-cta,
:root:not([data-theme]) .lp-topbar-cta {
  background: #1f2230;
  border-color: #1f2230;
  color: #ffffff;
}
:root[data-theme="light"] .lp-topbar-cta:hover,
:root:not([data-theme]) .lp-topbar-cta:hover {
  background: #0f172a;
  border-color: #0f172a;
}

/* Build 249 — UserMenu lives inside the homepage topbar nav. Lift the
 * avatar above the video-overlay z-index so the dropdown that opens
 * below it isn't clipped by adjacent fixed elements (theme toggle,
 * landing video veil). The avatar bubble itself already styles fine
 * against either light or dark backgrounds — the pastel gradient
 * holds contrast on both. The dropdown is a white card, so we leave
 * its own styling alone. */
.lp-topbar-nav .db-user { display: inline-flex; }
.lp-topbar-nav .db-topbar-avatar {
  /* Subtle ring so the avatar reads as an interactive control on the
   * busy video bg — the bare gradient circle was easy to miss. */
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35), 0 2px 8px rgba(0,0,0,0.25);
}
:root[data-theme="light"] .lp-topbar-nav .db-topbar-avatar,
:root:not([data-theme]) .lp-topbar-nav .db-topbar-avatar {
  box-shadow: 0 0 0 1px rgba(15,23,42,0.10), 0 2px 8px rgba(15,23,42,0.08);
}
.lp-topbar-nav .db-user-menu {
  /* Dropdown opens DOWN-LEFT from the avatar, positioned by the
   * existing `right: 0` in the base rule. Bump z-index so it floats
   * above the theme toggle + landing-art layers. */
  z-index: 30;
}

/* Mobile — drop the Pricing link below ~520 px to keep just the CTA
 * pill next to the brandbar; the full pricing surface is still one
 * tap away from the user menu after sign-in. */
@media (max-width: 520px) {
  .lp-topbar-nav { right: clamp(60px, calc(2.4vw + 50px), 70px); gap: 6px; }
  .lp-topbar-link { display: none; }
  .lp-topbar-cta { padding: 7px 14px; font-size: 13.5px; }
}
/* Landing toggle — dark theme variant (glass on near-black) */
.landing-theme .theme-toggle {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.86);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.landing-theme .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.26);
  transform: scale(1.05);
}
.landing-theme .theme-toggle:active { transform: scale(0.94); }
.landing-theme .theme-toggle:focus-visible {
  outline: 2px solid rgba(125, 211, 252, 0.6);
  outline-offset: 3px;
}

/* Landing toggle — light theme variant (solid white with stronger affordance) */
:root[data-theme="light"] .landing-theme .theme-toggle,
:root:not([data-theme]) .landing-theme .theme-toggle {
  background: #ffffff;
  border-color: #d8dae3;
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  backdrop-filter: none;
}
:root[data-theme="light"] .landing-theme .theme-toggle:hover,
:root:not([data-theme]) .landing-theme .theme-toggle:hover {
  background: #f5f6f8;
  border-color: #1a1a1a;
  transform: scale(1.05);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.10);
}
:root[data-theme="light"] .landing-theme .theme-toggle:focus-visible,
:root:not([data-theme]) .landing-theme .theme-toggle:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 3px;
}
@media (max-width: 560px) {
  .landing-theme { top: 12px; right: 12px; }
}
.db-stat-label {
  /* Build 230 — bumped to 14. */
  font-size: 14px;
  color: #5a5a5a;
  margin-bottom: 6px;
}
.db-stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #1a1a1a;
}

.db-panel {
  background: #ffffff;
  /* Build 223 — onto the unified border var so the whole app shares
   * one card-edge tone. Old #e6e7ec literal still appears elsewhere
   * (legacy rules, admin shell); they'll migrate in the next theme
   * refresh. Setting it here covers every .db-panel on the dashboard. */
  border: 1px solid var(--db-border, #e6e7ec);
  border-radius: 12px;
  padding: 18px 20px;
}
:root[data-theme="dark"] .db-panel { background: #14171f; border-color: var(--db-border); }
.db-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}
.db-panel-title {
  margin: 0;
  /* Build 230 — bumped to 19 (was 18). Section title benchmark used
   * across every per-agent page; test-call + headline-text follow. */
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1a1a1a;
  line-height: 1.3;
}
.db-panel-sub {
  margin: 4px 0 0;
  /* Build 230 — bumped to 15 (was 14). */
  font-size: 15px;
  color: #6a6f7d;
  line-height: 1.5;
}
:root[data-theme="dark"] .db-panel-title { color: #f1f3f8; }
:root[data-theme="dark"] .db-panel-sub { color: #9aa0ad; }

.db-progress {
  flex: 0 0 160px;
  height: 6px;
  background: #f0f0f3;
  border-radius: 999px;
  overflow: hidden;
}
.db-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #6366f1);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.db-checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex; flex-direction: column;
  gap: 4px;
}
.db-checklist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #4a4a4a;
}
.db-checklist-item.done {
  color: #1a1a1a;
}
.db-checklist-icon {
  width: 20px; height: 20px;
  flex: 0 0 20px;
  border-radius: 50%;
  background: #f0f0f3;
  color: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.db-checklist-item.done .db-checklist-icon {
  background: #10b981;
  color: #ffffff;
}

.db-twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 880px) {
  .db-twocol { grid-template-columns: 1fr; }
}
.db-actions-row {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 12px;
}
.db-safety {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: #f7f8fa;
  border: 1px solid #e6e7ec;
  border-radius: 8px;
  font-size: 12.5px;
  color: #4a4a4a;
  line-height: 1.55;
}
.db-safety svg { flex: 0 0 16px; margin-top: 2px; color: #6366f1; }

.db-empty {
  max-width: 520px;
  margin: 60px auto 0;
  text-align: center;
  padding: 32px 24px;
}
.db-empty-icon {
  width: 48px; height: 48px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde7f3, #c4b5fd 55%, #a5f3fc 90%);
  opacity: 0.85;
}
.db-empty-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.db-empty-sub {
  font-size: 13px;
  color: #6a6a6a;
  line-height: 1.55;
  margin-bottom: 18px;
}

/* ─────────────────────────────────────────────────────────────────────────
 * Dark-mode overrides for the dashboard surfaces (.db-*). The light theme
 * is the canonical design; dark mirrors it with inverted surfaces, kept-the-
 * same brand accents (blue primary, violet/pink gradients), and dimmed but
 * still-vibrant pastel stat tiles.
 *
 * Convention: only override what differs from light. Anything left untouched
 * (gradients, blue primary, accents) reads well on both bgs by design.
 * ───────────────────────────────────────────────────────────────────────── */

:root[data-theme="dark"] .db-root {
  background: #0b0d14;
  color: #e7e9ee;
}

/* Top bar */
:root[data-theme="dark"] .db-topbar {
  background: #0f1119;
  border-bottom-color: #1f2230;
}
:root[data-theme="dark"] .db-topbar-wordmark { color: #e7e9ee; }
:root[data-theme="dark"] .db-topbar-tag {
  background: #1d1f2b;
  color: #a1a4b3;
}
:root[data-theme="dark"] .db-topbar-select {
  /* Set background-COLOR only — the shorthand would reset background-repeat /
   * position / size from the base rule, causing the chevron SVG to tile. */
  background-color: #161823;
  border-color: #2a2d3c;
  color: #e7e9ee;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a1a4b3' stroke-width='1.7'><path d='M6 9l6 6 6-6'/></svg>");
}
:root[data-theme="dark"] .db-topbar-support {
  background: #161823;
  border-color: #2a3c66;
  color: #93b5ff;
}
:root[data-theme="dark"] .db-topbar-support:hover {
  background: #1a2440;
}
:root[data-theme="dark"] .db-topbar-minutes {
  background: #15233e;
  color: #cbd5e1;
}

/* Left nav */
:root[data-theme="dark"] .db-nav {
  background: #0f1119;
  border-right-color: #1f2230;
}
:root[data-theme="dark"] .db-nav-primary {
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.28);
}
:root[data-theme="dark"] .db-nav-group-head { color: #e7e9ee; }
:root[data-theme="dark"] .db-nav-group-head:hover { background: #15182a; }
:root[data-theme="dark"] .db-nav-group-head .db-nav-group-icon { color: #a1a4b3; }
:root[data-theme="dark"] .db-nav-group-head .db-nav-group-chev { color: #5b5f70; }
:root[data-theme="dark"] .db-nav-group-items::before { background: #1f2230; }
:root[data-theme="dark"] .db-nav-item { color: #a1a4b3; }
:root[data-theme="dark"] .db-nav-item:hover { background: #15182a; color: #e7e9ee; }
:root[data-theme="dark"] .db-nav-item.active {
  background: #1d2233;
  color: #ffffff;
}
:root[data-theme="dark"] .db-nav-foot {
  /* Build 243 — match the sidebar's dark background (#0f1119, see
     :root[data-theme="dark"] .db-nav above) so the sticky footer
     doesn't show a brighter strip behind itself when content scrolls
     underneath. */
  background: #0f1119;
  border-top-color: #1f2230;
  color: #8a8e9c;
}
:root[data-theme="dark"] .db-nav-upgrade {
  /* Dark mode: very dim amber on a near-black warm tint. Still reads
     as "amber" without burning a hole in the dark canvas. */
  background: rgba(245, 158, 11, 0.10);
  color: #f5c97a;
  border-color: rgba(245, 158, 11, 0.35);
}
:root[data-theme="dark"] .db-nav-upgrade:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.55);
  box-shadow: none;
}

/* Main canvas */
:root[data-theme="dark"] .db-main { background: #0b0d14; }
:root[data-theme="dark"] .db-pageheader-title { color: #f5f7fb; }
:root[data-theme="dark"] .db-pageheader-sub { color: #9aa0ad; }

/* Inputs / search / ghost button */
:root[data-theme="dark"] .db-search,
:root[data-theme="dark"] .db-input,
:root[data-theme="dark"] .db-textarea {
  background: #14171f;
  border-color: #2a2d3c;
  color: #e7e9ee;
}
:root[data-theme="dark"] .db-search::placeholder,
:root[data-theme="dark"] .db-input::placeholder,
:root[data-theme="dark"] .db-textarea::placeholder { color: #5b5f70; }
:root[data-theme="dark"] .db-search:focus,
:root[data-theme="dark"] .db-input:focus,
:root[data-theme="dark"] .db-textarea:focus {
  border-color: #4d83ff;
  box-shadow: 0 0 0 3px rgba(77, 131, 255, 0.18);
}
:root[data-theme="dark"] .db-btn-ghost {
  background: #14171f;
  border-color: #2a2d3c;
  color: #cbd5e1;
}
:root[data-theme="dark"] .db-btn-ghost:hover { background: #1a1e2b; border-color: #3a3f52; }

/* Cards (agents grid) */
:root[data-theme="dark"] .db-card {
  background: #14171f;
  border-color: #1f2230;
}
:root[data-theme="dark"] .db-card:hover {
  border-color: #3a3f52;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.40);
}
:root[data-theme="dark"] .db-card-name { color: #e7e9ee; }
:root[data-theme="dark"] .db-card-sub { color: #9aa0ad; }
:root[data-theme="dark"] .db-card-greet {
  color: #b4b9c7;
  border-top-color: #1f2230;
}
:root[data-theme="dark"] .db-card-del { color: #5b5f70; }
:root[data-theme="dark"] .db-card-del:hover { background: rgba(248, 113, 113, 0.18); color: #fda4af; }

/* Panels + hero on per-agent pages */
:root[data-theme="dark"] .db-hero,
:root[data-theme="dark"] .db-panel,
:root[data-theme="dark"] .db-table-wrap {
  background: #14171f;
  border-color: #1f2230;
}
:root[data-theme="dark"] .db-hero-eyebrow { color: #9aa0ad; }
:root[data-theme="dark"] .db-hero-name { color: #f5f7fb; }
:root[data-theme="dark"] .db-hero-tagline { color: #b4b9c7; }
:root[data-theme="dark"] .db-hero-greeting {
  background: #0f1119;
  border-left-color: #2a2d3c;
  color: #cbd5e1;
}
:root[data-theme="dark"] .db-pill {
  background: #1d2030;
  color: #cbd5e1;
}
:root[data-theme="dark"] .db-pill-accent {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(236, 72, 153, 0.18));
  color: #ddd6fe;
}
:root[data-theme="dark"] .db-panel-title { color: #f5f7fb; }
:root[data-theme="dark"] .db-panel-sub { color: #9aa0ad; }
:root[data-theme="dark"] .db-form-label { color: #b4b9c7; }
:root[data-theme="dark"] .db-form-label .db-form-opt,
:root[data-theme="dark"] .db-form-help { color: #6a6f7e; }
:root[data-theme="dark"] .db-panel-pill { background: #1d2030; color: #9aa0ad; }
:root[data-theme="dark"] .db-dropzone {
  background: #0f1119;
  border-color: #2a2d3c;
  color: #9aa0ad;
}

/* Stat tiles — dim but keep their color identity */
:root[data-theme="dark"] .db-stat { background: #14171f; border-color: #1f2230; }
:root[data-theme="dark"] .db-stat-blue   { background: rgba(59, 130, 246, 0.10);  border-color: rgba(59, 130, 246, 0.25); }
:root[data-theme="dark"] .db-stat-green  { background: rgba(16, 185, 129, 0.10);  border-color: rgba(16, 185, 129, 0.25); }
:root[data-theme="dark"] .db-stat-pink   { background: rgba(236, 72, 153, 0.08);  border-color: rgba(236, 72, 153, 0.25); }
:root[data-theme="dark"] .db-stat-yellow { background: rgba(251, 191, 36, 0.10);  border-color: rgba(251, 191, 36, 0.25); }
:root[data-theme="dark"] .db-stat-purple { background: rgba(139, 92, 246, 0.10);  border-color: rgba(139, 92, 246, 0.25); }
:root[data-theme="dark"] .db-stat-label { color: #9aa0ad; }
:root[data-theme="dark"] .db-stat-value { color: #f5f7fb; }

/* Setup checklist */
:root[data-theme="dark"] .db-progress { background: #1f2230; }
:root[data-theme="dark"] .db-checklist-item { color: #b4b9c7; }
:root[data-theme="dark"] .db-checklist-item.done { color: #f5f7fb; }
:root[data-theme="dark"] .db-checklist-icon { background: #1f2230; }
:root[data-theme="dark"] .db-checklist-item.done .db-checklist-icon { background: #10b981; color: #ffffff; }

/* Safety strip on the overview */
:root[data-theme="dark"] .db-safety {
  background: #0f1119;
  border-color: #1f2230;
  color: #b4b9c7;
}
:root[data-theme="dark"] .db-safety svg { color: #8b8ff5; }

/* Empty states */
:root[data-theme="dark"] .db-empty-title { color: #f5f7fb; }
:root[data-theme="dark"] .db-empty-sub { color: #9aa0ad; }

/* Voice picker */
:root[data-theme="dark"] .db-voice-card {
  background: #14171f;
  border-color: #1f2230;
}
:root[data-theme="dark"] .db-voice-card:hover { border-color: #3a3f52; }
:root[data-theme="dark"] .db-voice-card.active {
  background: rgba(59, 130, 246, 0.14);
  border-color: #4d83ff;
  box-shadow: 0 0 0 1px #4d83ff inset;
}
:root[data-theme="dark"] .db-voice-name { color: #f5f7fb; }
:root[data-theme="dark"] .db-voice-sub { color: #9aa0ad; }

/* Save state pills */
:root[data-theme="dark"] .db-save-ok { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
:root[data-theme="dark"] .db-save-err { background: rgba(248, 113, 113, 0.18); color: #fca5a5; }
:root[data-theme="dark"] .db-save-dim { background: #1f2230; color: #b4b9c7; }

/* Tables */
:root[data-theme="dark"] .db-table thead th {
  background: #161a26;
  border-bottom-color: #1f2230;
  color: #9aa0ad;
}
:root[data-theme="dark"] .db-table tbody td {
  border-top-color: #1f2230;
  color: #e7e9ee;
}
:root[data-theme="dark"] .db-table tbody tr:hover { background: #15182a; }
:root[data-theme="dark"] .db-table-summary { color: #b4b9c7; }

/* Outcome tags — keep semantic color, dim background */
:root[data-theme="dark"] .db-tag-green  { background: rgba(16, 185, 129, 0.18);  color: #6ee7b7; }
:root[data-theme="dark"] .db-tag-blue   { background: rgba(59, 130, 246, 0.18);  color: #93c5fd; }
:root[data-theme="dark"] .db-tag-purple { background: rgba(139, 92, 246, 0.18);  color: #c4b5fd; }
:root[data-theme="dark"] .db-tag-grey   { background: #1f2230;                   color: #b4b9c7; }
:root[data-theme="dark"] .db-tag-red    { background: rgba(248, 113, 113, 0.18); color: #fca5a5; }
:root[data-theme="dark"] .db-tag-yellow { background: rgba(251, 191, 36, 0.18);  color: #fde68a; }

/* User menu in top bar */
:root[data-theme="dark"] .db-user-menu {
  background: #14171f;
  border-color: #1f2230;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.40);
}
:root[data-theme="dark"] .db-user-name { color: #f5f7fb; }
:root[data-theme="dark"] .db-user-email { color: #9aa0ad; }
:root[data-theme="dark"] .db-user-sep { background: #1f2230; }
:root[data-theme="dark"] .db-user-item { color: #e7e9ee; }
:root[data-theme="dark"] .db-user-item:hover { background: #15182a; }

/* Auth pages */
:root[data-theme="dark"] .db-auth {
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(99, 102, 241, 0.22) 0%, transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(125, 211, 252, 0.14) 0%, transparent 60%),
    #0b0d14;
  color: #e7e9ee;
}
:root[data-theme="dark"] .db-auth-card {
  background: #14171f;
  border-color: #1f2230;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
:root[data-theme="dark"] .db-auth-wordmark { color: #f5f7fb; }
:root[data-theme="dark"] .db-auth-title { color: #f5f7fb; }
:root[data-theme="dark"] .db-auth-sub { color: #9aa0ad; }
:root[data-theme="dark"] .db-auth-google {
  background: #14171f;
  border-color: #2a2d3c;
  color: #e7e9ee;
}
:root[data-theme="dark"] .db-auth-google:hover:not(:disabled) { background: #1a1e2b; }
:root[data-theme="dark"] .db-auth-switch { color: #9aa0ad; }
:root[data-theme="dark"] .db-auth-switch button { color: #93c5fd; }

/* Theme toggle in top bar — readable on dark */
:root[data-theme="dark"] .db-topbar .theme-toggle {
  color: #cbd5e1;
  border-color: #2a2d3c;
}
:root[data-theme="dark"] .db-topbar .theme-toggle:hover {
  background: #15182a;
  border-color: #3a3f52;
}

/* Go-live error banner (was hardcoded in golive-* block) */
:root[data-theme="dark"] .golive-success {
  background: rgba(125, 211, 252, 0.08);
  border-color: rgba(125, 211, 252, 0.18);
}
:root[data-theme="dark"] .golive-success-row { color: #e7e9ee; }
:root[data-theme="dark"] .golive-link { color: #c4b5fd; }
:root[data-theme="dark"] .golive-error {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.30);
  color: #fca5a5;
}

/* ----- Support-ticket modal ----- */
.db-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 17, 28, 0.42);
  display: flex; align-items: center; justify-content: center;
  z-index: 90;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.db-modal {
  width: 100%; max-width: 480px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 17, 28, 0.24);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.db-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eef0f5;
}
.db-modal-head h2 { font-size: 16px; margin: 0; color: #1a1d2b; }
.db-modal-close {
  background: transparent; border: 0; font-size: 22px;
  color: #6b7080; cursor: pointer; line-height: 1; padding: 4px 8px;
  border-radius: 8px;
}
.db-modal-close:hover { background: #f3f4f8; color: #1a1d2b; }
.db-modal-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.db-modal-row { display: flex; flex-direction: column; gap: 6px; }
.db-modal-label { font-size: 12px; color: #6b7080; font-weight: 500; }
.db-modal-input {
  width: 100%;
  font: inherit; color: #1a1d2b;
  background: #fff;
  border: 1px solid #d8dbe4; border-radius: 8px;
  padding: 9px 11px;
  box-sizing: border-box;
}
.db-modal-input:focus { outline: 0; border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18); }
textarea.db-modal-input { resize: vertical; min-height: 96px; font-family: inherit; }
.db-modal-err {
  background: #fff1f1; border: 1px solid #fecdd3; color: #b91c1c;
  border-radius: 8px; padding: 8px 11px; font-size: 13px;
}
.db-modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  margin-top: 4px;
}
.db-modal-btn {
  font: inherit; font-weight: 600; font-size: 13px;
  border-radius: 8px; padding: 8px 14px; cursor: pointer;
  border: 1px solid transparent;
}
.db-modal-btn.ghost { background: transparent; color: #1a1d2b; border-color: #d8dbe4; }
.db-modal-btn.ghost:hover { background: #f3f4f8; }
.db-modal-btn.primary { background: #a78bfa; color: #fff; }
.db-modal-btn.primary:hover { background: #8b6cf2; }
.db-modal-btn.primary:disabled { background: #c8bff0; cursor: not-allowed; }
.db-modal-success { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
/* Impact confirmation list (Redesign sections popup) */
.db-modal-lead { margin: 0; font-size: 13.5px; line-height: 1.55; color: #3a3f52; }
.db-impact-list { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.db-impact-list li { display: flex; gap: 9px; font-size: 13px; line-height: 1.5; color: #3a3f52; }
.db-impact-ic { flex: 0 0 auto; font-size: 14px; line-height: 1.45; }
:root[data-theme="dark"] .db-modal-lead, :root[data-theme="dark"] .db-impact-list li { color: #c2c7d6; }
.db-modal-success strong { font-size: 15px; color: #1a1d2b; }
.db-modal-success p { color: #6b7080; font-size: 13px; margin: 0; }
.db-modal-success code { background: #f3f4f8; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.db-modal-success .db-modal-btn { margin-top: 6px; }

:root[data-theme="dark"] .db-modal-backdrop { background: rgba(0, 0, 0, 0.55); }
:root[data-theme="dark"] .db-modal { background: #1a1d2e; border-color: #2a2e44; box-shadow: 0 24px 60px rgba(0,0,0,0.5); }
:root[data-theme="dark"] .db-modal-head { border-bottom-color: #2a2e44; }
:root[data-theme="dark"] .db-modal-head h2 { color: #e7e9ee; }
:root[data-theme="dark"] .db-modal-close { color: #8a91a4; }
:root[data-theme="dark"] .db-modal-close:hover { background: #232636; color: #e7e9ee; }
:root[data-theme="dark"] .db-modal-label { color: #8a91a4; }
:root[data-theme="dark"] .db-modal-input { background: #15182a; border-color: #2a2e44; color: #e7e9ee; }
:root[data-theme="dark"] .db-modal-input:focus { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167,139,250,0.22); }
:root[data-theme="dark"] .db-modal-err { background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.30); color: #fca5a5; }
:root[data-theme="dark"] .db-modal-btn.ghost { color: #e7e9ee; border-color: #2a2e44; }
:root[data-theme="dark"] .db-modal-btn.ghost:hover { background: #232636; }
:root[data-theme="dark"] .db-modal-success strong { color: #e7e9ee; }
:root[data-theme="dark"] .db-modal-success p { color: #8a91a4; }
:root[data-theme="dark"] .db-modal-success code { background: #232636; color: #e7e9ee; }

/* ----- Danger zone (delete agent on Persona page) ----- */
.db-panel.db-danger {
  border-color: #fecdd3;
  background: linear-gradient(0deg, rgba(254, 205, 211, 0.10), rgba(254, 205, 211, 0.10)), #fff;
}
.db-panel.db-danger .db-panel-title { color: #b91c1c; }
.db-danger-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.db-danger-input { flex: 1; min-width: 240px; }
.db-btn-danger {
  font: inherit; font-weight: 600; font-size: 13px;
  background: #ef4444; color: #fff;
  border: 1px solid #dc2626; border-radius: 8px;
  padding: 9px 14px; cursor: pointer;
}
.db-btn-danger:hover { background: #dc2626; }
.db-btn-danger:disabled { background: #fca5a5; border-color: #fca5a5; cursor: not-allowed; }

:root[data-theme="dark"] .db-panel.db-danger {
  border-color: rgba(248, 113, 113, 0.30);
  background: rgba(248, 113, 113, 0.06);
}
:root[data-theme="dark"] .db-panel.db-danger .db-panel-title { color: #fca5a5; }
:root[data-theme="dark"] .db-btn-danger { background: #b91c1c; border-color: #991b1b; }
:root[data-theme="dark"] .db-btn-danger:hover { background: #dc2626; }
:root[data-theme="dark"] .db-btn-danger:disabled { background: #5a1f1f; border-color: #5a1f1f; }

/* ----- Integrations catalogue ----- */
.db-integrations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.db-integration-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  position: relative;
}
.db-integration-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.db-integration-name { font-weight: 600; font-size: 14px; color: #1a1d2b; }
.db-integration-desc { font-size: 12.5px; color: #6b7080; line-height: 1.45; flex: 1; }
.db-integration-card .db-btn-ghost.db-btn-sm { align-self: flex-start; margin-top: 4px; }

:root[data-theme="dark"] .db-integration-card { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-integration-name { color: #e7e9ee; }
:root[data-theme="dark"] .db-integration-desc { color: #8a91a4; }

/* ----- Overview top row: hero on the left, right rail on the right ----- */
.db-overview-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 440px);
  gap: 16px;
  align-items: stretch;
}
.db-overview-top > .db-hero { margin: 0; height: 100%; }
/* Right rail (build 221) — stacks Next steps + Cost Breakdown */
.db-overview-rail { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 980px) {
  .db-overview-top { grid-template-columns: minmax(0, 1fr); }
}

/* ─── Hero status row (build 221) ────────────────────────────────────────
   Status pills with a small leading dot sit under the agent name on the
   Overview hero so "is this live?" is answerable in one glance. */
.db-hero-status-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 8px;
}
.db-status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.db-status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  /* Subtle outer glow gives the dot weight without a halo ring */
  box-shadow: 0 0 0 2px rgba(255,255,255,0.45);
}
.db-status-pill-active   { background: #dcfce7; color: #166534; }
.db-status-pill-draft    { background: #f3f4f6; color: #4b5563; }
.db-status-pill-preview  { background: #fef3c7; color: #92400e; }
:root[data-theme="dark"] .db-status-pill-active   { background: #052e16; color: #86efac; }
:root[data-theme="dark"] .db-status-pill-draft    { background: #1f2433; color: #c8ccd9; }
:root[data-theme="dark"] .db-status-pill-preview  { background: #2a1c08; color: #fbbf24; }

/* ─── Cost Breakdown card (build 221) ────────────────────────────────────
   Itemised per-minute line items, ending in a bold total. Inspired by
   the Vani-style cost card pattern — operator no longer has to dig
   into the admin LLM ledger to know what they pay per minute. */
.db-cost-card { padding: 20px 22px 18px; }
.db-cost-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #1f2230;
  letter-spacing: -0.005em;
}
.db-cost-table { width: 100%; border-collapse: collapse; }
.db-cost-row td {
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f9;
  vertical-align: top;
}
.db-cost-row:last-child td { border-bottom: 0; }
.db-cost-cell-label { padding-right: 8px; }
.db-cost-cell-name {
  font-size: 13px; font-weight: 600; color: #1f2230;
}
.db-cost-cell-vendor {
  font-size: 11.5px; color: #6a6f7d; margin-top: 2px;
}
.db-cost-cell-status { text-align: right; white-space: nowrap; }
.db-cost-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.db-cost-badge-included    { background: #dcfce7; color: #166534; }
.db-cost-badge-passthrough { background: #fef3c7; color: #92400e; }
.db-cost-row-pass_through .db-cost-cell-name { color: #92400e; }
.db-cost-total {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px solid #1f2230;
}
.db-cost-total-label {
  font-size: 13px; font-weight: 700; color: #1f2230;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.db-cost-total-value {
  font-size: 22px; font-weight: 700; color: #1f2230;
  letter-spacing: -0.01em;
}
.db-cost-total-value span {
  font-size: 13px; font-weight: 500; color: #6a6f7d; margin-left: 3px;
}
.db-cost-foot {
  margin-top: 10px;
  font-size: 11.5px; color: #6a6f7d; line-height: 1.5;
}
.db-cost-foot-pass { margin-top: 4px; color: #92400e; }
:root[data-theme="dark"] .db-cost-card { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .db-cost-title { color: #f1f3f8; }
:root[data-theme="dark"] .db-cost-row td { border-bottom-color: #1f2433; }
:root[data-theme="dark"] .db-cost-cell-name,
:root[data-theme="dark"] .db-cost-total-label,
:root[data-theme="dark"] .db-cost-total-value { color: #f1f3f8; }
:root[data-theme="dark"] .db-cost-cell-vendor,
:root[data-theme="dark"] .db-cost-foot { color: #9aa0ad; }
:root[data-theme="dark"] .db-cost-total { border-top-color: #f1f3f8; }
:root[data-theme="dark"] .db-cost-badge-included    { background: #052e16; color: #86efac; }
:root[data-theme="dark"] .db-cost-badge-passthrough { background: #2a1c08; color: #fbbf24; }
.db-hero-cta {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}
.db-hero-test {
  padding: 10px 16px;
  font-size: 13.5px;
}
.db-hero-cta-hint {
  font-size: 12px; color: #6b7080;
}
:root[data-theme="dark"] .db-hero-cta-hint { color: #8a91a4; }

.db-next-steps {
  background: linear-gradient(180deg, #f5f3ff 0%, #fff 80%);
  border: 1px solid #ddd6fe;
  border-radius: 14px;
  padding: 16px 18px;
  display: flex; flex-direction: column;
  min-width: 0;
  position: relative;
  box-shadow: 0 2px 14px rgba(167, 139, 250, 0.12), 0 0 0 4px rgba(167, 139, 250, 0.05);
}
.db-next-steps::before {
  content: ""; position: absolute; inset: 0;
  border-radius: 14px; pointer-events: none;
  background: linear-gradient(180deg, rgba(167,139,250,0.20) 0%, transparent 30%);
  opacity: 0.6;
}
.db-next-steps > * { position: relative; z-index: 1; }
.db-next-steps-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.db-next-steps-title { font-size: 14px; margin: 0; color: #1a1d2b; font-weight: 600; }
.db-next-steps-fresh {
  font-size: 11px; font-weight: 600;
  background: linear-gradient(90deg, #f5f3ff, #eef2ff);
  color: #6d28d9;
  padding: 2px 8px; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 4px;
}

.db-next-steps-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.db-next-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 11px;
  background: #f8f9fc;
  border: 1px solid #ecedf2;
  border-radius: 10px;
}
.db-next-step.done { background: #f4fbf6; border-color: #d6ecdd; }
.db-next-step-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 12px;
  background: #fff; border: 1px solid #d8dbe4; color: #1a1d2b;
}
.db-next-step.done .db-next-step-num {
  background: #10b981; border-color: #10b981; color: #fff;
}
.db-next-step-body { min-width: 0; }
.db-next-step-title { font-size: 13px; font-weight: 600; color: #1a1d2b; line-height: 1.3; }
.db-next-step.done .db-next-step-title { color: #047857; }
.db-next-step-sub { font-size: 11.5px; color: #6b7080; margin-top: 2px; line-height: 1.4; }
.db-next-step .db-btn-sm { white-space: nowrap; }

@media (max-width: 1080px) {
  .db-overview-top { grid-template-columns: 1fr; }
}

:root[data-theme="dark"] .db-next-steps {
  background: linear-gradient(180deg, rgba(167,139,250,0.10), #15182a 70%);
  border-color: rgba(167,139,250,0.30);
  box-shadow: 0 2px 14px rgba(167, 139, 250, 0.18), 0 0 0 4px rgba(167, 139, 250, 0.08);
}
:root[data-theme="dark"] .db-next-steps::before {
  background: linear-gradient(180deg, rgba(167,139,250,0.18) 0%, transparent 30%);
}
:root[data-theme="dark"] .db-next-steps-title { color: #e7e9ee; }
:root[data-theme="dark"] .db-next-steps-fresh { background: linear-gradient(90deg, rgba(167,139,250,0.14), rgba(99,102,241,0.14)); color: #c4b5fd; }
:root[data-theme="dark"] .db-next-step { background: #1b1f33; border-color: #2a2e44; }
:root[data-theme="dark"] .db-next-step.done { background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.30); }
:root[data-theme="dark"] .db-next-step-num { background: #232636; border-color: #3a3f52; color: #e7e9ee; }
:root[data-theme="dark"] .db-next-step.done .db-next-step-num { background: #10b981; border-color: #10b981; color: #fff; }
:root[data-theme="dark"] .db-next-step-title { color: #e7e9ee; }
:root[data-theme="dark"] .db-next-step.done .db-next-step-title { color: #6ee7b7; }
:root[data-theme="dark"] .db-next-step-sub { color: #8a91a4; }

/* ── Business profile form: 2-col grid + span-2 modifier for textareas ── */
.db-form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.db-form-grid-2 .db-form-field { margin: 0; }
.db-form-grid-2 .db-form-span-2 { grid-column: 1 / -1; }
@media (max-width: 720px) {
  .db-form-grid-2 { grid-template-columns: 1fr; }
}

/* ── Per-day hours editor ── */
.db-hours-grid {
  display: flex; flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.db-hours-row {
  display: grid;
  grid-template-columns: 56px 90px 1fr 14px 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  background: #f8f9fc;
  border: 1px solid #eef0f5;
  border-radius: 10px;
}
.db-hours-day { font-weight: 600; font-size: 13px; color: #1a1d2b; }
.db-hours-closed {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: #6b7080;
  cursor: pointer;
}
.db-hours-closed input { accent-color: #a78bfa; cursor: pointer; }
.db-hours-time {
  padding: 7px 9px; font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.db-hours-time:disabled { opacity: 0.5; cursor: not-allowed; }
.db-hours-sep { text-align: center; color: #9aa0ad; }

:root[data-theme="dark"] .db-hours-row { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-hours-day { color: #e7e9ee; }
:root[data-theme="dark"] .db-hours-closed { color: #8a91a4; }
:root[data-theme="dark"] .db-hours-sep { color: #6b7080; }

/* ── Integrations filter bar ── */
.db-filters {
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.db-filter-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.db-filter-label {
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: #6b7080; font-weight: 600;
  min-width: 70px;
}
.db-filter-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.db-filter-pill {
  font: inherit; font-size: 12.5px;
  padding: 5px 12px; border-radius: 999px;
  border: 1px solid #d8dbe4;
  background: #fff; color: #1a1d2b;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.db-filter-pill:hover { background: #f3f4f8; }
.db-filter-pill.active {
  background: #ede9fe; color: #5b21b6;
  border-color: #c4b5fd;
  font-weight: 600;
}
/* Flag glyph used in filter pills + country tags on integration cards.
 * Apple-Color-Emoji at slightly larger size than the surrounding text so
 * the flag reads at a glance without overpowering the label. */
.db-flag {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: 14px;
  line-height: 1;
  display: inline-flex; align-items: center;
}
.db-tag.db-tag-flag {
  display: inline-flex; align-items: center; gap: 4px;
}
.db-tag.db-tag-flag .db-flag { font-size: 12px; }

:root[data-theme="dark"] .db-filters { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-filter-label { color: #8a91a4; }
:root[data-theme="dark"] .db-filter-pill { background: #1b1f33; border-color: #2a2e44; color: #e7e9ee; }
:root[data-theme="dark"] .db-filter-pill:hover { background: #232636; }
:root[data-theme="dark"] .db-filter-pill.active { background: rgba(167,139,250,0.18); border-color: rgba(167,139,250,0.40); color: #c4b5fd; }

/* ── Country / industry tags on integration cards ── */
.db-integration-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 2px;
}
.db-integration-tags .db-tag { font-size: 10.5px; padding: 2px 7px; }

/* ── Number-request provider catalogue ────────────────────────────────
 * Reuses the .db-panel surface. Cards are flat by default, the preferred
 * partner gets a single ink-on-ink accent so the eye lands on it without
 * the page turning into a palette. */
.db-providers {
  list-style: none; margin: 14px 0 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.db-provider {
  padding: 14px 16px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.db-provider.is-partner {
  border-color: #1a1d2b;
  box-shadow: 0 0 0 1px #1a1d2b inset;
}
.db-provider-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.db-provider-name { font-size: 14px; font-weight: 600; color: #1a1d2b; line-height: 1.25; }
.db-provider-pill {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.04em;
  background: #1a1d2b; color: #fff;
  padding: 2px 8px; border-radius: 99px;
  white-space: nowrap;
}
.db-provider-desc { font-size: 12.5px; color: #4b5263; line-height: 1.45; }
.db-provider-coverage {
  font-size: 11px; color: #6b7080;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

:root[data-theme="dark"] .db-provider { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-provider.is-partner { border-color: #e7e9ee; box-shadow: 0 0 0 1px #e7e9ee inset; }
:root[data-theme="dark"] .db-provider-name { color: #e7e9ee; }
:root[data-theme="dark"] .db-provider-pill { background: #e7e9ee; color: #15182a; }
:root[data-theme="dark"] .db-provider-desc { color: #b4b9c7; }
:root[data-theme="dark"] .db-provider-coverage { color: #8a91a4; }

/* ── Test-call page: two-up layout with an "or" divider between halves ── */
/* Build 227 — the page used to "breakdance" as elements reflowed on
 * load (cards expanding as the icon + copy + bullets arrived in
 * stages). Stable min-height on every card + CSS containment on the
 * container + a 200 ms entry fade make the layout settle invisibly. */
.db-testcall {
  display: grid;
  /* Build 227 — agent strip spans the full grid before the 2-col cards */
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  contain: layout;
  animation: db-testcall-fade-in 200ms ease-out both;
}
.db-testcall-agent-strip {
  grid-column: 1 / -1;
  margin: 0 0 18px;
}
.db-testcall-agent-name {
  font-size: 26px; font-weight: 700;
  color: #1a1d2b;
  letter-spacing: -0.018em;
  line-height: 1.2;
  margin: 0;
}
.db-testcall-agent-sub {
  font-size: 13.5px; color: #6a6f7d;
  margin-top: 4px;
}
:root[data-theme="dark"] .db-testcall-agent-name { color: #f1f3f8; }
:root[data-theme="dark"] .db-testcall-agent-sub  { color: #9aa0ad; }
@keyframes db-testcall-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.db-testcall-card {
  background: #fff;
  border: 1px solid var(--db-border, #e6e8ef);
  border-radius: 16px;
  padding: 28px;
  display: flex; flex-direction: column;
  gap: 14px;
  /* Build 227 — explicit min-height reserves space so icon + copy +
   * bullets + button don't shift cards as content arrives. */
  min-height: 340px;
  contain: layout style;
}
.db-testcall-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.db-testcall-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #f3f4f8;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  color: #1a1d2b;
}
.db-testcall-tag {
  font-size: 10.5px; font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6b7080;
  background: #f3f4f8;
  border: 1px solid #e6e8ef;
  padding: 3px 9px;
  border-radius: 99px;
}
.db-testcall-title {
  /* Build 230 — bumped to 19 to keep matching the .db-panel-title
   * benchmark. */
  font-size: 19px; font-weight: 700;
  color: #1a1d2b;
  margin: 4px 0 0;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.db-testcall-sub {
  /* Build 227 — bumped down 13.5 → 12.5px so the blurb sits one tier
   * below the title visually. Title carries the "what", sub carries
   * the supporting one-liner. */
  font-size: 12.5px; color: #6a6f7d;
  line-height: 1.5;
  margin: 0;
  max-width: 42ch;
}
.db-testcall-bullets {
  list-style: none; padding: 0; margin: 4px 0 0;
  display: flex; flex-direction: column; gap: 6px;
}
.db-testcall-bullets li {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #4b5263;
}
.db-testcall-bullet-tick {
  width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: #047857;
  background: #ecfdf5;
  border-radius: 50%;
  flex-shrink: 0;
}
.db-testcall-cta,
.db-testcall-form {
  margin-top: auto;
  padding-top: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.db-testcall-form .db-form-field { margin: 0; }
.db-testcall-cta .db-btn-primary,
.db-testcall-form .db-btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px;
  align-self: stretch;
}
.db-testcall-hint {
  font-size: 11.5px; color: #6b7080;
  line-height: 1.5;
}

.db-testcall-divider {
  display: flex; align-items: center; justify-content: center;
  position: relative;
  padding: 0 22px;
  align-self: stretch;
}
.db-testcall-divider::before {
  content: "";
  position: absolute;
  top: 12px; bottom: 12px;
  left: 50%; transform: translateX(-50%);
  width: 1px; background: #e6e8ef;
}
.db-testcall-divider span {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7080;
  z-index: 1;
}

@media (max-width: 880px) {
  .db-testcall { grid-template-columns: 1fr; }
  .db-testcall-divider { padding: 18px 0; }
  .db-testcall-divider::before {
    top: 50%; bottom: auto;
    left: 12px; right: 12px;
    width: auto; height: 1px;
    transform: none;
  }
}

/* ── Dark theme ── */
:root[data-theme="dark"] .db-testcall-card { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-testcall-icon { background: #1b1f33; border-color: #2a2e44; color: #e7e9ee; }
:root[data-theme="dark"] .db-testcall-tag { background: #1b1f33; border-color: #2a2e44; color: #8a91a4; }
:root[data-theme="dark"] .db-testcall-title { color: #e7e9ee; }
:root[data-theme="dark"] .db-testcall-sub { color: #b4b9c7; }
:root[data-theme="dark"] .db-testcall-bullets li { color: #b4b9c7; }
:root[data-theme="dark"] .db-testcall-bullet-tick {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}
:root[data-theme="dark"] .db-testcall-hint { color: #8a91a4; }
:root[data-theme="dark"] .db-testcall-divider::before { background: #2a2e44; }
:root[data-theme="dark"] .db-testcall-divider span { background: #15182a; border-color: #2a2e44; color: #8a91a4; }

/* ── Go-live publish banner ───────────────────────────────────────────── */
.db-publish-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 14px;
}
.db-publish-banner.is-live { border-color: #6ee7b7; background: linear-gradient(180deg, #ecfdf5 0%, #ffffff 70%); }
.db-publish-banner.is-gated { border-color: #fcd34d; background: linear-gradient(180deg, #fffbeb 0%, #ffffff 70%); }
.db-publish-left {
  display: flex; align-items: center; gap: 14px;
  min-width: 0; flex: 1;
}
.db-publish-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
  background: #9aa0ad;
}
.db-publish-dot.is-live {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
  animation: pulseLive 2.4s ease-in-out infinite;
}
@keyframes pulseLive {
  0%, 100% { box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18); }
  50%      { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0.10); }
}
.db-publish-status {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: #6b7080;
}
.db-publish-banner.is-live .db-publish-status { color: #047857; }
.db-publish-banner.is-gated .db-publish-status { color: #b45309; }
.db-publish-dot.is-gated { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.db-publish-copy {
  font-size: 13px;
  color: #4b5263;
  line-height: 1.5;
  margin-top: 2px;
  max-width: 70ch;
}
.db-publish-actions {
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.db-publish-error {
  font-size: 12px; color: #b91c1c;
}
@media (max-width: 720px) {
  .db-publish-banner { flex-direction: column; align-items: stretch; }
  .db-publish-actions { justify-content: flex-end; }
}

:root[data-theme="dark"] .db-publish-banner { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-publish-banner.is-live {
  background: linear-gradient(180deg, rgba(22,163,74,0.10) 0%, #15182a 70%);
  border-color: rgba(110, 231, 183, 0.30);
}
:root[data-theme="dark"] .db-publish-banner.is-gated {
  background: linear-gradient(180deg, rgba(245,158,11,0.10) 0%, #15182a 70%);
  border-color: rgba(252, 211, 77, 0.30);
}
:root[data-theme="dark"] .db-publish-status { color: #8a91a4; }
:root[data-theme="dark"] .db-publish-banner.is-live .db-publish-status { color: #6ee7b7; }
:root[data-theme="dark"] .db-publish-banner.is-gated .db-publish-status { color: #fbbf24; }
:root[data-theme="dark"] .db-publish-copy { color: #b4b9c7; }
:root[data-theme="dark"] .db-publish-error { color: #fca5a5; }

/* ── Faux browser frame for the embed preview ─────────────────────────── */
.db-faux-browser {
  position: relative;
  border: 1px solid #e6e8ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fafbfd;
  margin-top: 8px;
}
.db-faux-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  background: #f3f4f8;
  border-bottom: 1px solid #e6e8ef;
}
.db-faux-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #d8dbe4;
}
.db-faux-dot:nth-child(1) { background: #fca5a5; }
.db-faux-dot:nth-child(2) { background: #fcd34d; }
.db-faux-dot:nth-child(3) { background: #86efac; }
.db-faux-url {
  flex: 1;
  background: #fff;
  border: 1px solid #e6e8ef;
  border-radius: 6px;
  padding: 4px 10px;
  margin-left: 10px;
  font-size: 11.5px;
  color: #6b7080;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-faux-body {
  position: relative;
  /* Tall enough to fit the popover preview (now 340px) anchored to the
     bottom-right without the top getting clipped by overflow:hidden on
     the parent. Bumped from 320px when the Go-live layout went 2-col
     and the web-widget column got narrower. */
  min-height: 380px;
  padding: 24px 26px;
  background: #ffffff;
}
.db-faux-page { max-width: 480px; }
.db-faux-h1 {
  font-size: 20px; font-weight: 600;
  color: #1a1d2b;
  margin-bottom: 14px;
}
.db-faux-line {
  height: 10px;
  background: #eef0f5;
  border-radius: 4px;
  margin-bottom: 10px;
}
.db-faux-line.short { width: 70%; }
.db-faux-line.shorter { width: 45%; }

:root[data-theme="dark"] .db-faux-browser { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-faux-chrome { background: #1b1f33; border-bottom-color: #2a2e44; }
:root[data-theme="dark"] .db-faux-url { background: #232636; border-color: #2a2e44; color: #b4b9c7; }
:root[data-theme="dark"] .db-faux-body { background: #15182a; }
:root[data-theme="dark"] .db-faux-h1 { color: #e7e9ee; }
:root[data-theme="dark"] .db-faux-line { background: #232636; }

/* ── Embed bubble — visually mirrors /static/embed.js so the preview is
 * exactly what visitors get. We re-declare here instead of injecting embed.js
 * because embed.js mounts at position:fixed/z:2147483646 on the viewport;
 * inside our preview frame we want it absolutely positioned to the frame. */
.sxai-preview {
  position: absolute;
  right: 14px; bottom: 14px;
  /* Bubble + popover sized for the narrower 2-col layout. Real
     production widget (embed.js) renders at 60×60 bubble / 360×420
     popover at fixed viewport position; the preview here scales
     down to fit inside the faux-browser column without bleeding to
     the edges. Same visual semantics, just thumbnail-sized. */
  width: 48px; height: 48px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Helvetica Neue", sans-serif;
}
.sxai-preview[data-pos='bottom-left'] { left: 14px; right: auto; }
.sxai-preview[data-pos='bottom-left'] .sxai-tip { left: 0; right: auto; }
.sxai-preview[data-pos='bottom-left'] .sxai-panel { left: 0; right: auto; transform-origin: bottom left; }
/* Fullscreen mode — in production this fills the visitor's whole viewport.
 * In the contained preview here it stretches to a noticeably larger panel
 * so the user can see the difference at a glance. */
.sxai-preview[data-mode='fullscreen'] .sxai-panel {
  width: 360px;
  height: 360px;
  border-radius: 18px;
}
.sxai-preview .sxai-fab {
  width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  box-shadow: 0 8px 24px rgba(99,102,241,0.35), 0 2px 6px rgba(0,0,0,0.18);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: transform .15s ease, box-shadow .15s ease;
}
.sxai-preview .sxai-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 12px 32px rgba(99,102,241,0.42), 0 4px 10px rgba(0,0,0,0.22);
}
.sxai-preview .sxai-fab svg { width: 22px; height: 22px; }
.sxai-preview .sxai-tip {
  position: absolute;
  bottom: 100%; right: 0; margin-bottom: 10px;
  padding: 7px 12px; border-radius: 8px;
  background: #0f1119; color: #fff;
  font-size: 12.5px; white-space: nowrap;
  opacity: 0; transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.22);
}
.sxai-preview .sxai-fab:hover + .sxai-tip { opacity: 1; transform: translateY(0); }
.sxai-preview .sxai-panel {
  position: absolute;
  bottom: 60px; right: 0;
  width: 280px;
  height: 340px;
  border-radius: 14px;
  overflow: hidden;
  background: #0f1119;
  box-shadow: 0 18px 40px rgba(0,0,0,0.28), 0 3px 10px rgba(0,0,0,0.16);
  transform-origin: bottom right;
  transform: scale(0.95) translateY(8px);
  opacity: 0; pointer-events: none;
  transition: transform .22s cubic-bezier(.2,.9,.3,1), opacity .18s ease;
}
.sxai-preview .sxai-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1; pointer-events: auto;
}
/* Hide the FAB visually but keep its layout box so the .sxai-panel anchors
 * correctly to its bottom-right (matches real embed.js spatial behaviour). */
.sxai-preview.is-open .sxai-fab { visibility: hidden; }
.sxai-preview .sxai-frame {
  width: 100%; height: 100%;
  border: 0; display: block;
  background: #0f1119;
}
.sxai-preview .sxai-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.10);
  color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
}
.sxai-preview .sxai-close:hover { background: rgba(255,255,255,0.18); }
.sxai-preview .sxai-close svg { width: 14px; height: 14px; }

/* ── Developer page (Webhooks & data) — self-serve building blocks ── */

/* Key/value reference block (Agent ID + curl, top of page) */
.db-dev-kv { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.db-dev-kv-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f8f9fc;
  border: 1px solid #eef0f5;
  border-radius: 8px;
}
.db-dev-kv-key { font-size: 12px; font-weight: 600; color: #6b7080; letter-spacing: 0.02em; }
.db-dev-kv-val {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12.5px; color: #1a1d2b;
  background: transparent; padding: 0;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.db-dev-kv-mono { font-size: 12px; }
.db-dev-kv-copy {
  font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 4px 9px;
  background: #fff; border: 1px solid #d8dbe4; border-radius: 6px;
  color: #4b5263; cursor: pointer;
  flex-shrink: 0;
}
.db-dev-kv-copy:hover { background: #f3f4f8; color: #1a1d2b; }

/* Chip editor — outcomes typed-as-you-go */
.db-chip-editor {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px;
  background: #fff;
  border: 1px solid #d8dbe4;
  border-radius: 8px;
  min-height: 44px;
  align-items: center;
  margin-top: 6px;
}
.db-chip-editor:focus-within { border-color: #a78bfa; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18); }

/* Per-industry call-log chips (build 217) — colour set inline via the
   chipsForCall category map, so the rule here just owns layout +
   typography. Wraps to two lines when the row holds 5+ chips. */
.db-table-tags { padding-top: 8px; padding-bottom: 8px; max-width: 540px; }
.db-chip-row {
  display: flex; flex-wrap: wrap; gap: 4px 6px;
}
.db-log-chip {
  display: inline-flex; align-items: center;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  line-height: 1.4;
}
:root[data-theme="dark"] .db-log-chip { filter: brightness(0.92) saturate(1.1); }

.db-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 4px 3px 9px;
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #c4b5fd;
  border-radius: 99px;
  font-size: 12px; font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
}
.db-chip-x {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0;
  color: #5b21b6; font-size: 14px; line-height: 1;
  border-radius: 50%; cursor: pointer;
}
.db-chip-x:hover { background: rgba(91, 33, 182, 0.12); }
.db-chip-input {
  flex: 1; min-width: 140px;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 13px;
  color: #1a1d2b;
  padding: 4px 6px;
}

/* Row editor — header/variable rows (key field, value field, remove btn) */
.db-dev-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 32px;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.db-dev-row-key, .db-dev-row-val {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12.5px;
  padding: 8px 11px;
}
.db-dev-row-x {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid #e6e8ef;
  border-radius: 8px;
  color: #6b7080; font-size: 16px; line-height: 1;
  cursor: pointer;
}
.db-dev-row-x:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
.db-dev-add {
  font: inherit; font-size: 12.5px; font-weight: 600;
  background: transparent; border: 1px dashed #c5c8d4; border-radius: 8px;
  color: #4b5263; cursor: pointer;
  padding: 8px 12px;
  margin-top: 8px;
  align-self: flex-start;
}
.db-dev-add:hover { background: #f3f4f8; border-color: #a78bfa; color: #5b21b6; }
.db-dev-empty {
  font-size: 12.5px; color: #9aa0ad;
  padding: 12px;
  text-align: center;
  background: #fafbfd;
  border: 1px dashed #e6e8ef;
  border-radius: 8px;
  margin-top: 6px;
  font-style: italic;
}

/* Header section helpers */
.db-dev-headers-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  margin-bottom: 4px;
}
.db-dev-auth-presets {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.db-dev-auth-btn {
  font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 4px 9px;
  background: #fff; border: 1px solid #d8dbe4; border-radius: 99px;
  color: #4b5263; cursor: pointer;
}
.db-dev-auth-btn:hover { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }

/* Sample payload block + test action */
.db-dev-payload {
  background: #0f1119;
  color: #d8dbe4;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 6px 0 0;
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  line-height: 1.5;
  overflow-x: auto;
  max-height: 240px;
  overflow-y: auto;
}
.db-dev-payload code { background: transparent; padding: 0; color: inherit; }
.db-dev-test-row {
  display: flex; gap: 8px; align-items: center;
  margin-top: 10px; flex-wrap: wrap;
}
.db-dev-test-result {
  margin-top: 12px;
  border-radius: 10px;
  border: 1px solid #e6e8ef;
  overflow: hidden;
}
.db-dev-test-result.is-ok { border-color: #6ee7b7; background: #f0fdf4; }
.db-dev-test-result.is-err { border-color: #fca5a5; background: #fef2f2; }
.db-dev-test-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
}
.db-dev-test-icon {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  flex-shrink: 0;
}
.db-dev-test-result.is-ok .db-dev-test-icon { background: #10b981; color: #fff; }
.db-dev-test-result.is-err .db-dev-test-icon { background: #ef4444; color: #fff; }
.db-dev-test-title { flex: 1; font-size: 13px; font-weight: 600; color: #1a1d2b; }
.db-dev-test-close {
  background: transparent; border: 0;
  font-size: 18px; line-height: 1;
  color: #6b7080; cursor: pointer;
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.db-dev-test-close:hover { background: rgba(0,0,0,0.06); color: #1a1d2b; }
.db-dev-test-body {
  margin: 0;
  padding: 10px 12px 12px;
  background: rgba(15, 17, 28, 0.04);
  border-top: 1px solid rgba(15, 17, 28, 0.06);
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  color: #1a1d2b;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

/* Dark theme */
:root[data-theme="dark"] .db-dev-kv-row { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-dev-kv-key { color: #8a91a4; }
:root[data-theme="dark"] .db-dev-kv-val { color: #e7e9ee; }
:root[data-theme="dark"] .db-dev-kv-copy { background: #1b1f33; border-color: #2a2e44; color: #b4b9c7; }
:root[data-theme="dark"] .db-dev-kv-copy:hover { background: #232636; color: #e7e9ee; }
:root[data-theme="dark"] .db-chip-editor { background: #1b1f33; border-color: #2a2e44; }
:root[data-theme="dark"] .db-chip { background: rgba(167,139,250,0.16); color: #c4b5fd; border-color: rgba(167,139,250,0.40); }
:root[data-theme="dark"] .db-chip-x { color: #c4b5fd; }
:root[data-theme="dark"] .db-chip-input { color: #e7e9ee; }
:root[data-theme="dark"] .db-dev-row-x { background: #1b1f33; border-color: #2a2e44; color: #8a91a4; }
:root[data-theme="dark"] .db-dev-row-x:hover { background: rgba(248,113,113,0.12); color: #fca5a5; border-color: rgba(248,113,113,0.32); }
:root[data-theme="dark"] .db-dev-add { background: transparent; border-color: #3a3f52; color: #b4b9c7; }
:root[data-theme="dark"] .db-dev-add:hover { background: rgba(167,139,250,0.10); border-color: rgba(167,139,250,0.40); color: #c4b5fd; }
:root[data-theme="dark"] .db-dev-empty { background: #15182a; border-color: #2a2e44; color: #6b7080; }
:root[data-theme="dark"] .db-dev-auth-btn { background: #1b1f33; border-color: #2a2e44; color: #b4b9c7; }
:root[data-theme="dark"] .db-dev-auth-btn:hover { background: rgba(167,139,250,0.16); color: #c4b5fd; border-color: rgba(167,139,250,0.40); }
:root[data-theme="dark"] .db-dev-payload { background: #0a0c14; color: #b4b9c7; }
:root[data-theme="dark"] .db-dev-test-result.is-ok { background: rgba(16,185,129,0.08); border-color: rgba(110,231,183,0.30); }
:root[data-theme="dark"] .db-dev-test-result.is-err { background: rgba(248,113,113,0.08); border-color: rgba(248,113,113,0.30); }
:root[data-theme="dark"] .db-dev-test-title { color: #e7e9ee; }
:root[data-theme="dark"] .db-dev-test-body { background: rgba(255,255,255,0.03); border-top-color: rgba(255,255,255,0.06); color: #e7e9ee; }

/* ───────────────────────── Phase 2 — Team page ─────────────────────────
 * Shared with future admin / settings pages. Tables, role tags, and a
 * generic modal pattern. Light + dark variants are at the bottom of each
 * block — keep them together so we don't fall out of sync.
 */

.db-page { padding: 32px clamp(20px, 4vw, 48px); max-width: 1120px; margin: 0 auto; }
.db-page-header { margin-bottom: 32px; }
.db-page-header h1 { font-size: 28px; margin: 0 0 8px 0; font-weight: 600; }
.db-page-header .db-muted { font-size: 14px; max-width: 720px; line-height: 1.55; }

.db-card { background: var(--db-card-bg, #ffffff); border: 1px solid var(--db-card-border, #e5e7eb);
           border-radius: 14px; margin-bottom: 24px; overflow: hidden; }
.db-card-head { display: flex; align-items: center; justify-content: space-between;
                padding: 18px 24px; border-bottom: 1px solid var(--db-card-border, #e5e7eb); }
.db-card-head h2 { font-size: 16px; margin: 0; font-weight: 600; display: flex; align-items: center; gap: 10px; }

.db-pad { padding: 18px 24px; }

.db-pill-soft { background: var(--db-pill-bg, #f3f4f6); color: var(--db-muted, #6b7280);
                font-size: 12px; padding: 2px 10px; border-radius: 999px; font-weight: 500; }
.db-pill-tiny { font-size: 10px; padding: 1px 8px; border-radius: 999px; margin-left: 8px;
                background: rgba(167,139,250,0.18); color: #7c3aed; font-weight: 600;
                text-transform: uppercase; letter-spacing: 0.05em; }

.db-table { width: 100%; border-collapse: collapse; }
.db-table th, .db-table td { padding: 14px 24px; text-align: left; font-size: 14px; vertical-align: middle; }
.db-table th { background: var(--db-th-bg, #f9fafb); color: var(--db-muted, #6b7280);
               font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em;
               border-bottom: 1px solid var(--db-card-border, #e5e7eb); }
.db-table tbody tr { border-bottom: 1px solid var(--db-row-border, #f3f4f6); }
.db-table tbody tr:last-child { border-bottom: none; }

.db-member-name { font-weight: 500; display: flex; align-items: center; }
.db-row-actions { text-align: right; }
.db-muted { color: var(--db-muted, #6b7280); }

/* Role tags — color-coded by hierarchy. */
.db-role-tag { font-size: 11px; padding: 3px 10px; border-radius: 999px;
               font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.db-role-owner { background: rgba(167,139,250,0.18); color: #7c3aed; }
.db-role-admin { background: rgba(59,130,246,0.16); color: #2563eb; }
.db-role-member { background: rgba(107,114,128,0.16); color: #4b5563; }

.db-select-inline { background: transparent; border: 1px solid var(--db-card-border, #e5e7eb);
                    border-radius: 8px; padding: 6px 10px; font-size: 13px;
                    color: inherit; cursor: pointer; }
.db-select-inline:focus { outline: 2px solid rgba(167,139,250,0.40); outline-offset: 1px; }

.db-btn-ghost-danger { background: transparent; border: 1px solid transparent;
                       color: #ef4444; padding: 6px 12px; border-radius: 8px;
                       font-size: 13px; cursor: pointer; font-weight: 500; }
.db-btn-ghost-danger:hover { background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.30); }

.db-error { background: rgba(248,113,113,0.10); border: 1px solid rgba(248,113,113,0.30);
            color: #b91c1c; padding: 12px 16px; border-radius: 10px; margin: 16px 0;
            font-size: 14px; }
.db-loading { padding: 48px 24px; text-align: center; color: var(--db-muted, #6b7280); }

/* Modal — backdrop covers full viewport; the card pops to ~480px wide. */
.db-modal-backdrop { position: fixed; inset: 0; background: rgba(15,17,28,0.55);
                     z-index: 100; display: flex; align-items: center; justify-content: center;
                     padding: 20px; }
.db-modal { background: var(--db-card-bg, #ffffff); border-radius: 16px;
            width: 100%; max-width: 480px; max-height: 90vh; overflow: auto;
            box-shadow: 0 24px 60px rgba(0,0,0,0.30); }
.db-modal-head { display: flex; align-items: center; justify-content: space-between;
                 padding: 20px 24px 12px; }
.db-modal-head h2 { margin: 0; font-size: 18px; font-weight: 600; }
.db-modal-close { background: transparent; border: none; font-size: 24px;
                  cursor: pointer; color: var(--db-muted, #6b7280); line-height: 1;
                  width: 32px; height: 32px; border-radius: 8px; }
.db-modal-close:hover { background: var(--db-pill-bg, #f3f4f6); }
.db-modal-body { padding: 8px 24px 24px; }
.db-modal-body label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 14px;
                       color: var(--db-muted, #6b7280); }
.db-modal-body label .db-input { margin-top: 6px; }
.db-modal-body p { font-size: 14px; line-height: 1.55; margin: 0 0 16px; }
.db-modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

.db-input { width: 100%; padding: 10px 14px; border: 1px solid var(--db-card-border, #e5e7eb);
            border-radius: 10px; font-size: 14px; box-sizing: border-box;
            background: var(--db-input-bg, #ffffff); color: inherit; }
.db-input:focus { outline: 2px solid rgba(167,139,250,0.40); outline-offset: 1px;
                  border-color: rgba(167,139,250,0.50); }
.db-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }

/* Accept-invite landing — full viewport, centered card. */
.sxai-invite-shell { min-height: 100vh; display: flex; align-items: center;
                     justify-content: center; padding: 40px 20px;
                     background: linear-gradient(135deg, #fbfaff 0%, #f3f0ff 100%); }
.sxai-invite-card { background: white; border-radius: 20px; padding: 48px 40px;
                     max-width: 460px; width: 100%; text-align: center;
                     box-shadow: 0 8px 40px rgba(167,139,250,0.15); }
.sxai-invite-card h1 { font-size: 18px; color: #a78bfa; margin: 0 0 32px;
                       font-weight: 600; letter-spacing: 0.02em; }
.sxai-invite-card h2 { font-size: 28px; margin: 12px 0 8px; font-weight: 700; }
.sxai-invite-card p { font-size: 15px; line-height: 1.5; margin: 8px 0; }
.sxai-invite-card .db-modal-actions { margin-top: 32px; justify-content: center; }

/* Dark theme overrides */
:root[data-theme="dark"] {
  --db-card-bg: #15182a;
  --db-card-border: #2a2e44;
  --db-row-border: #1f2235;
  --db-th-bg: #1b1f33;
  --db-muted: #8a91a4;
  --db-pill-bg: #1b1f33;
  --db-input-bg: #1b1f33;
}
:root[data-theme="dark"] .db-role-owner { background: rgba(167,139,250,0.20); color: #c4b5fd; }
:root[data-theme="dark"] .db-role-admin { background: rgba(59,130,246,0.22); color: #93c5fd; }
:root[data-theme="dark"] .db-role-member { background: rgba(148,163,184,0.18); color: #cbd5e1; }
:root[data-theme="dark"] .db-error { background: rgba(248,113,113,0.10); color: #fca5a5; border-color: rgba(248,113,113,0.32); }
:root[data-theme="dark"] .sxai-invite-shell { background: linear-gradient(135deg, #15182a 0%, #1b1f33 100%); }
:root[data-theme="dark"] .sxai-invite-card { background: #1b1f33; color: #e7e9ee;
                                              box-shadow: 0 8px 40px rgba(0,0,0,0.40); }

/* ───────────────────────── Phase 3 — Admin shell ─────────────────────────
 * A dedicated chrome (NOT the dashboard shell) — the admin is a different
 * mode of operation with platform-wide visibility, so it gets a different
 * skin. Topbar makes it visually obvious you're in admin space.
 */
.db-admin-shell { min-height: 100vh; background: var(--db-admin-bg, #f7f9fc); display: flex; flex-direction: column; }
.db-admin-topbar { display: flex; align-items: center; justify-content: space-between;
                   padding: 14px 32px; background: #0f111c; color: #fff;
                   border-bottom: 1px solid rgba(255,255,255,0.06); }
.db-admin-brand { display: flex; align-items: center; gap: 14px; font-size: 15px; }
.db-admin-brand strong { font-weight: 600; }
/* The pink alone says "you are somewhere serious" — letter-spaced uppercase
 * on top of that is 2018-Datadog screaming. Sentence-case, tight, calm. */
.db-admin-badge { background: rgba(244,114,182,0.18); color: #f9a8d4; font-size: 11px;
                  padding: 3px 10px; border-radius: 999px;
                  letter-spacing: 0; font-weight: 600; }
.db-admin-topbar .db-btn-ghost { background: transparent; color: #fff;
                                  border-color: rgba(255,255,255,0.22); }
.db-admin-topbar .db-btn-ghost:hover { background: rgba(255,255,255,0.08); }

.db-admin-tabs { display: flex; gap: 4px; padding: 0 32px;
                 background: #fff; border-bottom: 1px solid var(--db-card-border, #e5e7eb); }
.db-admin-tab { background: transparent; border: none; padding: 14px 18px;
                font-size: 13px; font-weight: 500; cursor: pointer;
                color: var(--db-muted, #6b7280); border-bottom: 2px solid transparent;
                margin-bottom: -1px; }
.db-admin-tab:hover { color: inherit; }
.db-admin-tab.is-active { color: #a78bfa; border-bottom-color: #a78bfa; }

.db-admin-main { padding: 32px clamp(20px, 4vw, 48px); max-width: 1280px; width: 100%; margin: 0 auto; box-sizing: border-box; }
.db-admin-main h1 { font-size: 22px; margin: 0 0 24px; font-weight: 600; display: flex; align-items: center; gap: 12px; }

/* Summary tile grid */
.db-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.db-admin-tile { background: #fff; border: 1px solid var(--db-card-border, #e5e7eb);
                 border-radius: 14px; padding: 18px 20px; }
.db-admin-tile-label { color: var(--db-muted, #6b7280); font-size: 12px; text-transform: uppercase;
                       letter-spacing: 0.05em; font-weight: 500; margin-bottom: 8px; }
.db-admin-tile-value { font-size: 26px; font-weight: 600; }

.db-admin-search { max-width: 360px; margin-bottom: 20px; }

/* Dark theme */
:root[data-theme="dark"] {
  --db-admin-bg: #0a0c14;
}
:root[data-theme="dark"] .db-admin-topbar { background: #06080f; border-bottom-color: #1a1d2a; }
:root[data-theme="dark"] .db-admin-tabs { background: #15182a; border-bottom-color: #2a2e44; }
:root[data-theme="dark"] .db-admin-tile { background: #15182a; }

/* User-menu admin link emphasis */
.db-user-item-admin { color: #a78bfa; font-weight: 500; }
.db-user-item-admin:hover { background: rgba(167,139,250,0.10); }

.db-admin-grant-card { margin-top: 24px; }
.db-admin-grant-row { display: flex; gap: 10px; align-items: center; }
.db-admin-grant-row .db-input { flex: 1; }

/* Admin settings panel */
.db-admin-settings-blurb { margin-bottom: 24px; max-width: 720px; line-height: 1.55; }
.db-admin-settings-blurb code { background: rgba(167,139,250,0.12); padding: 1px 6px;
                                 border-radius: 4px; font-size: 12px; }
.db-admin-settings-group { margin-bottom: 24px; }
.db-admin-settings-group h2 { text-transform: capitalize; }
.db-admin-setting-key { font-size: 11px; margin-top: 2px; }
.db-admin-setting-value { max-width: 320px; white-space: nowrap;
                          overflow: hidden; text-overflow: ellipsis; }
.db-admin-json-edit { width: 100%; font-family: ui-monospace, "SF Mono", Menlo, monospace;
                      font-size: 12px; box-sizing: border-box; line-height: 1.4; }

:root[data-theme="dark"] .db-admin-settings-blurb code { background: rgba(167,139,250,0.18); color: #c4b5fd; }

/* Phase 5 — Analytics surface */
.db-sparkline { display: block; }
.db-admin-tile-spark { margin-top: 8px; opacity: 0.95; }
.db-admin-range-spacer { flex: 1; }
.db-admin-range-btn { background: transparent; border: 1px solid var(--db-card-border, #e5e7eb);
                      color: var(--db-muted, #6b7280); padding: 5px 12px;
                      border-radius: 8px; font-size: 12px; font-weight: 500;
                      cursor: pointer; margin-left: 6px; }
.db-admin-range-btn:hover { color: inherit; border-color: rgba(167,139,250,0.40); }
.db-admin-range-btn.is-active { background: rgba(167,139,250,0.14); color: #7c3aed;
                                 border-color: rgba(167,139,250,0.40); }
.db-admin-by-org { margin-top: 24px; }
.db-admin-main h1 { flex-wrap: wrap; }

/* LLM ledger — kind discriminator pills */
.db-llm-kind-builder { background: rgba(59,130,246,0.16);  color: #2563eb; }
.db-llm-kind-agent   { background: rgba(167,139,250,0.18); color: #7c3aed; }
.db-llm-kind-tts     { background: rgba(244,114,182,0.18); color: #be185d; }
.db-admin-tile-cpm .db-admin-tile-value { color: #2563eb; }
:root[data-theme="dark"] .db-llm-kind-builder { background: rgba(59,130,246,0.22);  color: #93c5fd; }
:root[data-theme="dark"] .db-llm-kind-agent   { background: rgba(167,139,250,0.20); color: #c4b5fd; }
:root[data-theme="dark"] .db-llm-kind-tts     { background: rgba(244,114,182,0.20); color: #f9a8d4; }

/* ─── Phase 8: Core purpose box + call-log quality columns ─── */

.db-purpose {
  margin: 20px 0;
  padding: 20px 24px;
  background: var(--db-card-bg, #ffffff);
  border: 1px solid var(--db-card-border, #e5e7eb);
  border-radius: 14px;
}
.db-purpose-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px;
}
.db-purpose-head h3 {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.005em;
}
.db-purpose-help { font-size: 12px; }
.db-purpose-summary {
  margin: 0 0 16px; font-size: 15px; line-height: 1.55; font-weight: 500;
}
.db-purpose-group { margin-top: 14px; }
.db-purpose-group-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--db-muted, #6b7280); font-weight: 500; margin-bottom: 8px;
}
.db-purpose-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.db-purpose-actions-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.db-purpose-actions-list li {
  display: flex; gap: 10px; align-items: baseline; font-size: 13px;
}
.db-purpose-action-label { font-weight: 500; }

.db-chip-soft {
  background: rgba(167,139,250,0.10); color: #7c3aed;
  border: 1px solid rgba(167,139,250,0.25);
}
.db-chip-disabled {
  background: rgba(0,0,0,0.04); color: var(--db-muted, #6b7280);
  border: 1px solid var(--db-card-border, #e5e7eb);
}

/* Empty state for the purpose box */
.db-purpose-empty p { font-size: 14px; line-height: 1.5; margin-bottom: 14px; }

/* Edit mode */
.db-purpose-edit { padding-bottom: 18px; }
.db-purpose-field {
  display: block; margin-bottom: 14px;
  font-size: 12px; font-weight: 500; color: var(--db-muted, #6b7280);
}
.db-purpose-field > span { display: block; margin-bottom: 6px; }
.db-purpose-field em { font-style: normal; }
.db-purpose-actions, .db-purpose-postcall {
  border: none; padding: 0; margin: 14px 0 0;
}
.db-purpose-actions legend, .db-purpose-postcall legend {
  font-size: 12px; font-weight: 500; color: var(--db-muted, #6b7280);
  padding: 0; margin-bottom: 10px;
}
.db-purpose-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
@media (max-width: 720px) {
  .db-purpose-actions { grid-template-columns: 1fr; }
}
.db-action-card {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--db-card-border, #e5e7eb);
  border-radius: 10px;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.15s, background 0.15s;
}
.db-action-card:hover { border-color: rgba(167,139,250,0.40); }
.db-action-card.is-on {
  border-color: #a78bfa;
  background: rgba(167,139,250,0.06);
}
.db-action-card input { margin-top: 3px; accent-color: #a78bfa; }
.db-action-label { font-size: 13px; font-weight: 500; }
.db-action-hint { font-size: 12px; margin-top: 2px; }

.db-purpose-postcall {
  display: flex; flex-direction: column; gap: 8px;
}
.db-purpose-postcall label {
  display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer;
}
.db-purpose-postcall input { accent-color: #a78bfa; }

.db-purpose-actions-row {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px;
}

/* Lead-quality + sentiment pills in the call log */
.db-lead, .db-mood {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.05em;
}
/* Build 223 — borders dropped on lead/mood pills (Vani-style soft bg
 * pills). Background tone alone carries the semantic distinction; the
 * outline only added visual noise at small sizes. Same colour pairs
 * as the cost-breakdown badges in build 221 for consistency. */
.db-lead-hot   { background: #fee2e2; color: #991b1b; }
.db-lead-warm  { background: #fef3c7; color: #92400e; }
.db-lead-cold  { background: #dbeafe; color: #1e3a8a; }
.db-lead-na    { background: #f3f4f6; color: #374151; }
.db-mood-positive { background: #dcfce7; color: #166534; }
.db-mood-neutral  { background: #f3f4f6; color: #374151; }
.db-mood-negative { background: #fee2e2; color: #991b1b; }
.db-mood-mixed    { background: #ede9fe; color: #5b21b6; }

/* Dark theme */
:root[data-theme="dark"] .db-purpose { background: #15182a; border-color: #2a2e44; }
:root[data-theme="dark"] .db-action-card { border-color: #2a2e44; }
:root[data-theme="dark"] .db-action-card.is-on { background: rgba(167,139,250,0.10); border-color: #a78bfa; }
:root[data-theme="dark"] .db-lead-hot   { color: #fca5a5; }
:root[data-theme="dark"] .db-lead-warm  { color: #fcd34d; }
:root[data-theme="dark"] .db-lead-cold  { color: #93c5fd; }
:root[data-theme="dark"] .db-lead-na    { color: #cbd5e1; }
:root[data-theme="dark"] .db-mood-positive { color: #6ee7b7; }
:root[data-theme="dark"] .db-mood-neutral  { color: #cbd5e1; }
:root[data-theme="dark"] .db-mood-negative { color: #fca5a5; }
:root[data-theme="dark"] .db-mood-mixed    { color: #c4b5fd; }

/* ───────────── F.2 · Info-icon affordance ─────────────
 * Small (i) glyph that opens a 1-2 sentence popover. Used on dashboard
 * column headers + admin tiles where the metric needs one-line context.
 * Never used on the build orb (doctrine).
 */
.db-infodot-wrap {
  display: inline-flex; align-items: center; position: relative;
  margin-left: 6px;
}
.db-infodot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--db-pill-bg, #f3f4f6);
  color: var(--db-muted, #6b7280);
  border: 1px solid var(--db-card-border, #e5e7eb);
  font: 600 9px/1 ui-sans-serif, system-ui, sans-serif;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.db-infodot:hover, .db-infodot.is-open {
  background: rgba(167,139,250,0.16);
  color: #7c3aed;
  border-color: rgba(167,139,250,0.40);
}
.db-infodot-pop {
  position: absolute;
  z-index: 20;
  min-width: 220px; max-width: 320px;
  padding: 10px 12px;
  background: var(--db-card-bg, #fff);
  border: 1px solid var(--db-card-border, #e5e7eb);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(15,17,28,0.10);
  font: 400 12px/1.45 ui-sans-serif, system-ui, sans-serif;
  color: inherit;
  text-transform: none;       /* don't inherit table-header uppercase */
  letter-spacing: 0;
  font-weight: 400;
}
.db-infodot-pop strong { font-weight: 600; }
.db-infodot-pop-bottom { top: calc(100% + 8px); left: 0; }
.db-infodot-pop-top    { bottom: calc(100% + 8px); left: 0; }
.db-infodot-pop-right  { top: 50%; transform: translateY(-50%); left: calc(100% + 8px); }

:root[data-theme="dark"] .db-infodot {
  background: #1b1f33; color: #8a91a4; border-color: #2a2e44;
}
:root[data-theme="dark"] .db-infodot:hover,
:root[data-theme="dark"] .db-infodot.is-open {
  background: rgba(167,139,250,0.16); color: #c4b5fd;
}
:root[data-theme="dark"] .db-infodot-pop {
  background: #15182a; border-color: #2a2e44;
  box-shadow: 0 8px 24px rgba(0,0,0,0.40);
}

/* ───────────── F.3 · Destructive confirm modal ─────────────
 * Replaces native confirm() for the four destructive paths (delete
 * agent, remove member, revoke invite, revoke super-admin). For hard
 * deletes the user must type the target's name — GitHub-style.
 */
.db-modal-destructive .db-modal-head h2 { color: #b91c1c; }
.db-destructive-body { font-size: 14px; line-height: 1.55; margin: 0 0 14px; }
.db-destructive-body strong { font-weight: 600; }
.db-destructive-confirm-label {
  display: block; font-size: 12px; color: var(--db-muted, #6b7280);
  margin-bottom: 14px; font-weight: 500;
}
.db-destructive-confirm-label > span { display: block; margin-bottom: 6px; }
.db-destructive-confirm-label strong { color: inherit; font-weight: 600; }
.db-btn-destructive {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 14px;
  border-radius: 8px;
  background: #ef4444; color: #fff;
  font-size: 13px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s;
}
.db-btn-destructive:hover:not(:disabled) { background: #dc2626; }
.db-btn-destructive:disabled {
  background: #fca5a5; color: #fff; cursor: not-allowed; opacity: 0.7;
}
:root[data-theme="dark"] .db-modal-destructive .db-modal-head h2 { color: #fca5a5; }
:root[data-theme="dark"] .db-btn-destructive { background: #b91c1c; }
:root[data-theme="dark"] .db-btn-destructive:hover:not(:disabled) { background: #991b1b; }
:root[data-theme="dark"] .db-btn-destructive:disabled { background: #7f1d1d; opacity: 0.8; }


/* ───────────── FloatingEva — persistent helper widget ─────────────────
 * Bottom-right helper Eva. Two visual states:
 *   .feva-bubble     idle pill — small audio-reactive blob + label
 *   .feva-card       expanded — blob + caption rail + text input + close
 * The blob inside is the same <VoiceBlob/> used everywhere else, just
 * sized down. The whole widget is fixed-position so dashboard scrolling
 * doesn't disturb it.
 */
.feva-root {
  position: fixed; right: 20px; bottom: 20px; z-index: 60;
  font-family: inherit;
}
@media (max-width: 600px) {
  .feva-root { right: 14px; bottom: 14px; }
}

/* Idle bubble — a soft pill that whispers "tap me". */
.feva-bubble {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 8px;
  background: var(--card-bg, #ffffff);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.feva-bubble:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12), 0 3px 6px rgba(15, 23, 42, 0.06);
  border-color: rgba(148, 163, 184, 0.4);
}
.feva-bubble:active { transform: translateY(0); }
.feva-bubble-blob { width: 36px; height: 36px; flex-shrink: 0; }
.feva-bubble-label {
  font-size: 13px; font-weight: 500; color: var(--text-color, #0f172a);
  line-height: 1.2; letter-spacing: -0.01em;
}

/* Expanded card — the conversation surface. */
.feva-card {
  width: 340px; max-width: calc(100vw - 28px);
  background: var(--card-bg, #ffffff);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 18px;
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.16), 0 6px 14px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: feva-card-in 0.22s cubic-bezier(0.18, 1.2, 0.4, 1);
}
@keyframes feva-card-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.feva-card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 12px 8px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}
.feva-card-blob { width: 44px; height: 44px; flex-shrink: 0; }
.feva-card-head-text { flex: 1; min-width: 0; }
.feva-card-title {
  font-size: 14px; font-weight: 600; color: var(--text-color, #0f172a);
  line-height: 1.2;
}
.feva-card-state {
  font-size: 11px; color: var(--db-muted, #6b7280);
  margin-top: 2px;
}
.feva-card-state.is-error { color: #b91c1c; }
.feva-card-close {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--db-muted, #6b7280);
  cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 16px;
  transition: background 0.15s, color 0.15s;
}
.feva-card-close:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-color, #0f172a);
}
.feva-card-actions { display: inline-flex; align-items: center; gap: 6px; }
.feva-card-endcall {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 12.5px; font-weight: 600; color: #ffffff;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.10);
  transition: filter 0.14s ease, transform 0.12s ease;
}
.feva-card-endcall:hover { filter: brightness(1.06); }
.feva-card-endcall:active { transform: translateY(0.5px); }
.feva-card-endcall svg { opacity: 0.95; }
:root[data-theme="dark"] .feva-card-endcall { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }

/* Context chip — a tiny pill showing what Eva can see right now. */
.feva-context {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  font-size: 11px; color: var(--db-muted, #6b7280);
  background: rgba(148, 163, 184, 0.08);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
.feva-context-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

/* Caption rail — Eva's last reply + last user line, fade as new ones arrive. */
.feva-captions {
  padding: 10px 14px; min-height: 60px; max-height: 140px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; line-height: 1.45;
}
.feva-cap { color: var(--text-color, #0f172a); }
.feva-cap-user { color: var(--db-muted, #6b7280); font-style: italic; }
.feva-cap-empty {
  color: var(--db-muted, #6b7280); font-size: 12px;
  text-align: center; padding: 12px 0;
}

/* Text rail — bottom of card. */
.feva-input-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
}
.feva-input {
  flex: 1; min-width: 0;
  height: 36px; padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: var(--card-bg, #ffffff);
  color: var(--text-color, #0f172a);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.feva-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.feva-mic-btn,
.feva-send-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: var(--card-bg, #ffffff);
  color: var(--text-color, #0f172a);
  cursor: pointer; display: inline-flex;
  align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  flex-shrink: 0;
}
.feva-mic-btn:hover,
.feva-send-btn:hover {
  border-color: rgba(148, 163, 184, 0.5);
}
.feva-mic-btn.is-muted {
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.4);
}
.feva-mic-btn.is-listening {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}
.feva-send-btn:disabled {
  opacity: 0.45; cursor: not-allowed;
}

/* Dark-theme tweaks — keep parity with the existing dashboard. */
:root[data-theme="dark"] .feva-bubble,
:root[data-theme="dark"] .feva-card,
:root[data-theme="dark"] .feva-input,
:root[data-theme="dark"] .feva-mic-btn,
:root[data-theme="dark"] .feva-send-btn {
  background: #111827;
  border-color: rgba(148, 163, 184, 0.22);
  color: #e5e7eb;
}
:root[data-theme="dark"] .feva-bubble-label,
:root[data-theme="dark"] .feva-card-title,
:root[data-theme="dark"] .feva-cap { color: #e5e7eb; }
:root[data-theme="dark"] .feva-card-state,
:root[data-theme="dark"] .feva-context,
:root[data-theme="dark"] .feva-cap-user,
:root[data-theme="dark"] .feva-cap-empty { color: #9ca3af; }
:root[data-theme="dark"] .feva-context { background: rgba(148, 163, 184, 0.08); }
:root[data-theme="dark"] .feva-mic-btn.is-listening { background: #3b82f6; border-color: #3b82f6; color: #fff; }


/* ──────────── BuildRecovery — "your work is safe" panel ──────────────
 * Shown on landing when a build session's voice call ended without a
 * proper `agent_saved`. Keeps the operator's invested time alive: the
 * server has already auto-committed (or we offer a button that does).
 * Sits center-screen, soft amber tone, never hides if the user keeps
 * scrolling. Dismiss = abandon the in-progress session deliberately.
 */
.br-card {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  background: var(--card-bg, #ffffff);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 18px;
  box-shadow: 0 24px 56px rgba(15, 23, 42, 0.18), 0 6px 16px rgba(15, 23, 42, 0.09);
  z-index: 80;
  overflow: hidden;
  animation: br-in 0.24s cubic-bezier(0.18, 1.2, 0.4, 1);
}
@keyframes br-in {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.br-head {
  padding: 18px 20px 4px;
  display: flex; align-items: center; gap: 10px;
}
.br-icon {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700;
}
.br-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-color, #0f172a);
  line-height: 1.3;
}
.br-body {
  padding: 4px 20px 8px;
  font-size: 13.5px; line-height: 1.55;
  color: var(--text-color, #0f172a);
}
.br-summary {
  padding: 10px 20px;
  margin: 8px 20px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.08);
  font-size: 12.5px; line-height: 1.5;
  color: var(--db-muted, #6b7280);
}
.br-summary strong { color: var(--text-color, #0f172a); font-weight: 600; }
.br-summary-row { display: flex; gap: 8px; margin-bottom: 4px; }
.br-summary-row:last-child { margin-bottom: 0; }
.br-summary-label { width: 88px; flex-shrink: 0; font-weight: 500; }
.br-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 8px 20px 20px;
}
.br-btn-primary,
.br-btn-secondary {
  padding: 0 16px; height: 38px;
  border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.br-btn-primary {
  background: #2563eb; color: #fff; border-color: #2563eb;
}
.br-btn-primary:hover { background: #1d4fd7; }
.br-btn-primary:disabled { background: #93c5fd; cursor: not-allowed; }
.br-btn-secondary {
  background: transparent;
  color: var(--db-muted, #6b7280);
  border-color: rgba(148, 163, 184, 0.36);
}
.br-btn-secondary:hover {
  color: var(--text-color, #0f172a);
  border-color: rgba(148, 163, 184, 0.55);
}

/* Soft backdrop dim so the card pulls focus. */
.br-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(2px);
  z-index: 79;
  animation: br-bd-in 0.22s ease;
}
@keyframes br-bd-in { from { opacity: 0; } to { opacity: 1; } }

:root[data-theme="dark"] .br-card {
  background: #0f172a;
  border-color: rgba(245, 158, 11, 0.45);
  color: #e5e7eb;
}
:root[data-theme="dark"] .br-title,
:root[data-theme="dark"] .br-body,
:root[data-theme="dark"] .br-summary strong { color: #f1f5f9; }
:root[data-theme="dark"] .br-summary { background: rgba(245, 158, 11, 0.12); color: #cbd5e1; }
:root[data-theme="dark"] .br-btn-secondary { color: #94a3b8; border-color: rgba(148, 163, 184, 0.26); }
:root[data-theme="dark"] .br-btn-secondary:hover { color: #e5e7eb; }


/* ──────────── SIP-card (Voniz self-service connect) ────────────────────
 * Two-column card on the Go-live page. Left column: credentials form.
 * Right column: numbered setup checklist + copyable inbound SIP URI.
 * Status pill in the header reflects whether config has been saved.
 */
.sip-card .db-panel-title { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sip-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  letter-spacing: 0.02em;
}
.sip-status-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 500;
  margin-left: 6px;
}
.sip-grid {
  display: grid;
  /* When the SIP card sits in the 2-col go-live grid it's narrow —
     stack form + steps vertically. The card is wide enough for the
     side-by-side internal layout only on very large viewports OR when
     the card is full-width (e.g. operator collapsed the embed panel). */
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 12px;
}
@media (min-width: 1500px) {
  /* Big screens with both cards visible: still stack inside the SIP
     card. The OUTER go-live grid is what's 2-column, not the inner
     card. Going side-by-side inside the card too made the form and
     steps both feel cramped in real testing. */
  .sip-grid { grid-template-columns: 1fr; }
}
.sip-col { display: flex; flex-direction: column; gap: 12px; }
.sip-col-steps {
  padding-left: 12px;
  border-left: 1px solid rgba(148, 163, 184, 0.18);
}
@media (max-width: 900px) {
  .sip-col-steps { padding-left: 0; border-left: none; padding-top: 8px; border-top: 1px solid rgba(148, 163, 184, 0.18); }
}

.sip-step {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 6px 0;
}
.sip-step.is-pending { opacity: 0.62; }
.sip-step-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: #2563eb; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600;
  flex-shrink: 0;
}
.sip-step.is-pending .sip-step-num { background: rgba(148, 163, 184, 0.5); }
.sip-step-body { flex: 1; min-width: 0; }
.sip-step-title { font-size: 13.5px; font-weight: 600; color: var(--text-color, #0f172a); line-height: 1.3; }
.sip-step-sub { font-size: 12.5px; color: var(--db-muted, #6b7280); line-height: 1.5; margin-top: 3px; }
.sip-step-sub code {
  padding: 1px 5px; border-radius: 4px;
  background: rgba(148, 163, 184, 0.14);
  font-size: 12px;
}

.sip-uri-row {
  display: flex; align-items: stretch; gap: 6px;
  margin-top: 8px; margin-bottom: 6px;
}
.sip-uri-code {
  flex: 1; min-width: 0;
  display: inline-flex; align-items: center;
  padding: 7px 10px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-color, #0f172a);
  overflow: auto; white-space: nowrap;
}
.sip-uri-copy {
  padding: 0 12px; height: auto;
  border-radius: 6px;
  border: 1px solid rgba(37, 99, 235, 0.4);
  background: #fff;
  color: #2563eb;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  flex-shrink: 0;
}
.sip-uri-copy:hover:not(:disabled) { background: rgba(37, 99, 235, 0.06); }
.sip-uri-copy:disabled { opacity: 0.45; cursor: not-allowed; }

.sip-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 500;
}
.sip-link:hover { text-decoration: underline; }

.sip-betatag {
  display: inline-flex;
  padding: 1px 6px; border-radius: 4px;
  background: rgba(245, 158, 11, 0.16);
  color: #b45309;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 4px;
  vertical-align: middle;
}

.sip-error {
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(220, 38, 38, 0.08);
  color: #b91c1c;
  font-size: 12.5px;
}
.sip-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  margin-top: 4px;
}

/* Dark-theme polish */
:root[data-theme="dark"] .sip-col-steps { border-left-color: rgba(148, 163, 184, 0.22); }
:root[data-theme="dark"] .sip-step-title { color: #f1f5f9; }
:root[data-theme="dark"] .sip-step-sub { color: #94a3b8; }
:root[data-theme="dark"] .sip-uri-code {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.32);
  color: #e5e7eb;
}
:root[data-theme="dark"] .sip-uri-copy {
  background: transparent;
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
}
:root[data-theme="dark"] .sip-step-sub code { background: rgba(148, 163, 184, 0.18); color: #e5e7eb; }
:root[data-theme="dark"] .sip-betatag { background: rgba(245, 158, 11, 0.22); color: #fcd34d; }
:root[data-theme="dark"] .sip-error { background: rgba(220, 38, 38, 0.18); color: #fca5a5; }

/* Live-number callout — shown above the form once the operator has
 * saved a DID. Big, friendly, "yes this is the number your callers
 * will dial". Answers the operator's obvious "which number is live?"
 * question without making them parse the form fields.
 */
.sip-live-number-card {
  padding: 14px 18px;
  margin: 4px 0 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(59, 130, 246, 0.04));
  border: 1px solid rgba(37, 99, 235, 0.22);
}
.sip-live-number-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2563eb;
}
.sip-live-number-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-color, #0f172a);
  letter-spacing: -0.01em;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.sip-live-number-sub {
  font-size: 12.5px;
  color: var(--db-muted, #6b7280);
  margin-top: 4px;
}
:root[data-theme="dark"] .sip-live-number-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.16), rgba(59, 130, 246, 0.06));
  border-color: rgba(59, 130, 246, 0.32);
}
:root[data-theme="dark"] .sip-live-number-label { color: #93c5fd; }
:root[data-theme="dark"] .sip-live-number-value { color: #f1f5f9; }
:root[data-theme="dark"] .sip-live-number-sub { color: #94a3b8; }


/* ──────── Managed-number fallback (secondary phone option) ──────────
 * Voniz self-service is the primary path. This is the white-glove
 * "we provision a number for you" fallback, folded behind a one-line
 * teaser so it doesn't visually compete with the Voniz card.
 */
.managed-fallback { padding: 0; overflow: hidden; }
.managed-fallback-teaser {
  width: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font: inherit; color: inherit;
  transition: background 0.15s;
}
.managed-fallback-teaser:hover {
  background: rgba(148, 163, 184, 0.06);
}
.managed-fallback-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.14);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  color: var(--db-muted, #6b7280);
  flex-shrink: 0;
}
.managed-fallback-copy {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.managed-fallback-copy strong {
  font-size: 13.5px; font-weight: 600;
  color: var(--text-color, #0f172a);
}
.managed-fallback-sub {
  font-size: 12.5px;
  color: var(--db-muted, #6b7280);
  line-height: 1.4;
}
.managed-fallback-arrow {
  font-size: 18px;
  color: var(--db-muted, #6b7280);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.managed-fallback-teaser:hover .managed-fallback-arrow {
  transform: translateX(2px);
  color: var(--text-color, #0f172a);
}

.managed-fallback-head {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 18px 18px 8px;
}
.managed-fallback-head h3 { margin: 0; }
.managed-fallback-collapse {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 16px;
  color: var(--db-muted, #6b7280);
  flex-shrink: 0;
  transition: background 0.15s;
}
.managed-fallback-collapse:hover {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-color, #0f172a);
}
.managed-fallback > section { padding: 0 18px 18px; }

:root[data-theme="dark"] .managed-fallback-teaser:hover { background: rgba(148, 163, 184, 0.08); }
:root[data-theme="dark"] .managed-fallback-icon { background: rgba(148, 163, 184, 0.16); color: #94a3b8; }
:root[data-theme="dark"] .managed-fallback-copy strong { color: #f1f5f9; }
:root[data-theme="dark"] .managed-fallback-sub { color: #94a3b8; }


/* ──────────── Go-live 2-column channel grid ────────────────────────
 * Two cards side-by-side: Web widget (left, default fast path) and
 * SIP / phone (right). Equal weight. Stacks on narrower viewports.
 * The card faces share a common `.golive-channel-card` class so both
 * get the same min-height / vertical rhythm regardless of which has
 * more internal content.
 */
.golive-channels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}
@media (max-width: 1100px) {
  .golive-channels { grid-template-columns: 1fr; }
}
.golive-channel-card {
  display: flex; flex-direction: column;
  min-height: 420px;
}
.golive-channel-card > .db-channel-head { margin-bottom: 4px; }

.golive-channel-pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: middle;
  margin-left: 6px;
}
.golive-channel-pill-default {
  background: linear-gradient(135deg, #10b981, #047857);
  color: #fff;
}
:root[data-theme="dark"] .golive-channel-pill-default {
  background: linear-gradient(135deg, #34d399, #059669);
}

/* ═══════════════════════════════════════════════════════════════════════════
 * MOBILE RESPONSIVENESS LAYER (build 177)
 *
 * The pre-177 stylesheet was tablet-aware (most breakpoints at 720–880 px)
 * but had no story for actual phones — the dashboard sidebar held a fixed
 * 232 px column and the topbar packed a Support pill + Minutes pill + agent
 * switcher into the right cluster regardless of viewport, so anything under
 * ~600 px clipped or overflowed.
 *
 * This block fixes five things together rather than scattering small
 * patches through 24 existing media queries:
 *   1. Hamburger + off-canvas sidebar drawer below 900 px
 *   2. Topbar slim-down + hide Help/Minutes pills below 600 px
 *   3. Touch-target floor of 44×44 px on coarse pointers
 *   4. Tight-grid reflow (hours row, KB tabs, info-group indent)
 *   5. Unified <480 px tweaks for page padding + hero numbers
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ─── (1) Sidebar drawer scaffolding (always present, only visible <900px) ── */
.db-topbar-hamburger {
  display: none;
  width: 40px; height: 40px;
  align-items: center; justify-content: center;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--fg-0, #1f2230);
  cursor: pointer;
  margin-right: 4px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.db-topbar-hamburger:hover { background: #f3f4f9; }
.db-topbar-hamburger:focus-visible {
  outline: none;
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}
.db-topbar-hamburger svg { display: block; }

.db-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 28, 0.42);
  border: 0;
  padding: 0;
  z-index: 24;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}
.db-nav-overlay.is-visible {
  display: block;
  opacity: 1;
}

@media (max-width: 900px) {
  .db-topbar-hamburger { display: inline-flex; }

  /* Take the sidebar out of normal flow on small screens. It stays
   * mounted (so React state is preserved between open/close) but slides
   * off-canvas to the left. The drawer covers the full height beneath
   * the topbar and a comfortable 80% of the viewport width, capped at
   * 320 px so it doesn't dwarf small tablets. */
  .db-nav {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: min(320px, 84vw);
    flex: 0 0 auto;
    border-right: 1px solid #e6e7ec;
    box-shadow: 6px 0 24px rgba(15, 17, 28, 0.12);
    z-index: 25;
    transform: translateX(-105%);
    transition: transform 0.24s cubic-bezier(.2,.9,.3,1);
  }
  .db-nav.is-mobile-open { transform: translateX(0); }
  /* Main content takes the full row when the sidebar is drawer-mode. */
  .db-main { width: 100%; }
}

:root[data-theme="dark"] .db-topbar-hamburger { color: var(--fg-0, #e8e9ef); }
:root[data-theme="dark"] .db-topbar-hamburger:hover { background: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .db-nav {
  /* dark-theme drawer shadow tuned for low-contrast canvas */
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.42);
}

/* ─── (2) Topbar slim-down + Help/Minutes hide ─────────────────────────── */
@media (max-width: 600px) {
  .db-topbar {
    padding: 0 12px;
    gap: 8px;
  }
  .db-topbar-brand { gap: 8px; padding-right: 4px; }
  /* The "AI Agent Builder" tag and the standalone Help/Minutes pills are
   * the first to go on phones — the Help action still lives inside the
   * sidebar drawer's UserMenu, and Minutes is one click away from the
   * Upgrade tile in the drawer footer. */
  .db-topbar-tag,
  .db-topbar-support,
  .db-topbar-minutes,
  .db-topbar-switcher-sep { display: none; }
  .db-topbar-right { gap: 6px; }
  .db-topbar-avatar {
    width: 36px; height: 36px;
  }
  /* Logo retains its 29 px height but the wordmark+icon already use
   * inline SVG sizing — nothing further to do. */
}

/* ─── (3) Touch-target floor on coarse pointers ───────────────────────── */
/* Anything that's tappable should be ≥ 44×44. We apply this only to
 * `pointer: coarse` so cursor-driven UIs (desktop) keep their compact
 * sizing — phones and tablets get bumped widgets without affecting the
 * dashboard's information density on a 27-inch monitor. */
@media (pointer: coarse) {
  .feva-card-close,
  .db-modal-close,
  .db-topbar-avatar,
  .tweaks-toggle,
  .feva-mic-btn,
  .feva-send-btn,
  .kb-tab,
  .oc-range-btn,
  .db-topbar-hamburger {
    min-width: 44px;
    min-height: 44px;
  }
  /* Slider thumb already drags well on touch, but the inline numeric
   * input was 64×~28 — bump it so a thumb can target it. */
  .oc-weight-num { min-height: 44px; }
}

/* ─── (4) Tight-grid reflow ───────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Knowledge-base tabs go horizontally scrollable instead of clipping —
   * the operator can swipe through them. We also kill the inline-flex
   * width so the tab strip fills the row before scrolling. */
  .kb-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    width: 100%;
    margin-right: -16px;     /* let the strip bleed to the page edge */
    padding-right: 16px;
  }
  .kb-tab { flex-shrink: 0; }

  /* The 62 px left indent on `.db-info-group-body` exists to align the
   * body with the section's icon column on desktop; on a 375 px screen
   * it leaves less than 300 px for content, which crushes form fields.
   * Pull the indent back to the page gutter. */
  .db-info-group-body { padding-left: 16px; }

  /* The hours grid is a 5-column row (day · closed · open · separator · close)
   * that worked at desktop widths but won't fit on a phone. Stack the
   * row into 2 logical lines: [Day | Closed?] on top, [Open – Close]
   * underneath. */
  .db-hours-row {
    grid-template-columns: 1fr auto;
    grid-row-gap: 6px;
  }
  .db-hours-row > *:nth-child(3),
  .db-hours-row > *:nth-child(4),
  .db-hours-row > *:nth-child(5) {
    grid-column: span 2;
  }
  .db-hours-row > *:nth-child(3) { grid-column: 1 / 2; }
  .db-hours-row > *:nth-child(4) { grid-column: 1 / 3; justify-self: center; padding: 4px 0; }
  .db-hours-row > *:nth-child(5) { grid-column: 1 / 3; }

  /* Outcome rows: the label + count layout (1fr auto) is already
   * reasonable, but the 18 px column gap eats space. Tighten it. */
  .oc-row, .oc-row-clean { column-gap: 8px; }

  /* Modal padding around the backdrop is generous; reclaim 8 px so the
   * dialog itself has more room. */
  .db-modal-backdrop { padding: 16px; }
}

/* ─── (5) Unified small-screen polish (< 480 px) ──────────────────────── */
@media (max-width: 480px) {
  /* Page chrome — pre-177 paddings were tuned for desktop. Trim them so
   * content reaches more of the canvas. */
  .db-pageheader { padding: 14px 16px; }
  .db-pageheader-title { font-size: 18px; }
  .db-pageheader-sub { font-size: 12.5px; }
  .db-content { padding: 8px 14px 28px; }

  /* Hero numbers (Call outcomes' big "weighted success" tile) were 56 px
   * which clips at 375 px. Bring the type stack down a tier. */
  .oc-hero-value { font-size: 40px; }
  .oc-hero-label { font-size: 12px; }

  /* Landing CTA already shrinks at 540 px; nothing more needed here. */

  /* Cockpit step cards: 280 px min-height + 22×24 padding looks empty
   * inside on a phone. Soften both. */
  .cockpit-step { min-height: 220px; padding: 18px 16px 20px; }

  /* Floating Eva: the 340 px fixed width already caps with
   * `calc(100vw - 28px)`, but the head-row's "End call" button + close
   * × can crowd the title. Stack the title onto its own row when both
   * action buttons are visible. */
  .feva-card-head { flex-wrap: wrap; row-gap: 6px; }
  .feva-card-title { flex-basis: 100%; order: 3; }

  /* Forms — search input was a fixed 240 px width; let it stretch. */
  .db-search { width: 100%; max-width: 100%; }

  /* Faux-browser preview blocks set fixed widths (360 / 280) that don't
   * fit a 375 px screen. Let them scale. */
  .db-faux-browser { width: 100%; max-width: 100%; }
}

/* ─── Dark-theme parity for the new hamburger + drawer overlay ────────── */
:root[data-theme="dark"] .db-nav-overlay { background: rgba(0, 0, 0, 0.52); }

/* ═══════════════════════════════════════════════════════════════════════════
 * MARKDOWN EDITOR (build 180 — EasyMDE-backed)
 *
 * Replaces the build-178 custom textarea+toolbar editor with a CodeMirror-
 * powered EasyMDE instance. EasyMDE renders bold/italic/headings/lists
 * visually inline as the operator types (the markdown markers like ** and
 * ## stay visible but de-emphasised; the surrounding text is styled). The
 * result is a "looks like a word processor" feel without abandoning the
 * markdown source that Gemini Live consumes.
 *
 * EasyMDE's own stylesheet is loaded in index.html BEFORE this file, so
 * everything below is an override: we recolour the toolbar to match the
 * dashboard, swap CodeMirror's serif preview for the dashboard's sans
 * stack, and add a dark theme.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* The .md-editor wrapper supplies the focus ring + outer border so the
 * editor sits inside the same chrome as the dashboard's other inputs. */
.md-editor {
  display: block;
  border: 1px solid #d8dbe4;
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.md-editor:focus-within {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

/* Host textarea fallback: EasyMDE hides this itself once it mounts
 * (it sets style="display:none" inline). If EasyMDE fails to load
 * — CDN blocked, ad-blocker, offline — we WANT the raw textarea to
 * remain visible so the operator can still edit. So we don't add
 * our own display:none here. EasyMDE wraps the textarea inside
 * `.EasyMDEContainer` post-mount, so our chrome on .md-editor still
 * surrounds it consistently. */
.md-editor > textarea {
  display: block;
  width: 100%;
  border: 0;
  outline: none;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  line-height: 1.55;
  background: transparent;
  resize: vertical;
  min-height: 80px;
  color: var(--fg-0, #1f2230);
}

/* EasyMDE's container — strip the default purple border (we own that on
 * the wrapper) and let our radius win. */
.md-editor .EasyMDEContainer { background: transparent; }
.md-editor .EasyMDEContainer .editor-toolbar {
  background: #f7f8fc;
  border: 0;
  border-bottom: 1px solid #e6e7ec;
  border-radius: 0;
  padding: 6px 8px;
  opacity: 1;
}
.md-editor .EasyMDEContainer .editor-toolbar.fullscreen { background: #f7f8fc; }
.md-editor .EasyMDEContainer .editor-toolbar::before,
.md-editor .EasyMDEContainer .editor-toolbar::after { display: none; }
.md-editor .EasyMDEContainer .editor-toolbar button {
  color: #4a4f5e;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 30px; height: 30px;
  line-height: 28px;
  margin: 0 1px;
  background: transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.md-editor .EasyMDEContainer .editor-toolbar button:hover {
  background: #ffffff;
  border-color: #d8dbe4;
  color: #1f2230;
}
.md-editor .EasyMDEContainer .editor-toolbar button.active,
.md-editor .EasyMDEContainer .editor-toolbar button:active {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #6d28d9;
}
.md-editor .EasyMDEContainer .editor-toolbar i.separator {
  border-left: 1px solid #d8dbe4;
  margin: 0 6px;
}

/* CodeMirror — the actual edit surface. Use the dashboard's font stack
 * and a comfortable line-height so bold/italic/heading styles read
 * inline as the operator types. */
.md-editor .EasyMDEContainer .CodeMirror {
  border: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--fg-0, #1f2230);
  background: #ffffff;
  padding: 4px 0;
}
.md-editor .EasyMDEContainer .CodeMirror-scroll {
  min-height: 140px;
}
.md-editor .EasyMDEContainer .CodeMirror-cursor {
  border-left-color: #6d28d9;
  border-left-width: 2px;
}
.md-editor .EasyMDEContainer .CodeMirror-placeholder { color: #9095a3 !important; }

/* CodeMirror tokens — this is what makes the in-source WYSIWYG work.
 * Bold text becomes 600-weight, italic becomes italic, headings get
 * progressively larger; the markdown markers (** _ ## > >) become
 * smaller and lower-contrast so the EYE skips over them. */
.md-editor .CodeMirror .cm-strong { font-weight: 700; color: #1f2230; }
.md-editor .CodeMirror .cm-em     { font-style: italic; color: #1f2230; }
.md-editor .CodeMirror .cm-header  { font-weight: 700; color: #1f2230; line-height: 1.35; }
.md-editor .CodeMirror .cm-header-1 { font-size: 1.55em; }
.md-editor .CodeMirror .cm-header-2 { font-size: 1.32em; }
.md-editor .CodeMirror .cm-header-3 { font-size: 1.18em; }
.md-editor .CodeMirror .cm-header-4,
.md-editor .CodeMirror .cm-header-5,
.md-editor .CodeMirror .cm-header-6 { font-size: 1.06em; }
.md-editor .CodeMirror .cm-link    { color: #6d28d9; }
.md-editor .CodeMirror .cm-url     { color: #9095a3; text-decoration: none; }
.md-editor .CodeMirror .cm-comment,
.md-editor .CodeMirror .cm-formatting-code,
.md-editor .CodeMirror .cm-string,
.md-editor .CodeMirror .cm-string-2 {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: #f0eef9;
  color: #4a4f5e;
  padding: 0 3px;
  border-radius: 4px;
}
.md-editor .CodeMirror .cm-quote   { color: #6a6f7d; font-style: italic; }
.md-editor .CodeMirror .cm-hr      { color: #c4b5fd; }
.md-editor .CodeMirror .cm-tag     { color: #6d28d9; }
.md-editor .CodeMirror .cm-formatting {
  /* The asterisks, underscores, # signs, > marks — make them visible
   * but secondary so the styled content reads first. */
  color: #c1c4ce;
  font-weight: 400;
}
/* When a heading is active the `#` markers are part of the same line —
 * keep them small/quiet so the line still feels heading-sized but the
 * markers don't shout. */
.md-editor .CodeMirror .cm-formatting-header {
  color: #c1c4ce;
  font-weight: 400;
}

/* Selection colour — match the dashboard's purple accent. */
.md-editor .CodeMirror .CodeMirror-selected,
.md-editor .CodeMirror .CodeMirror-line ::selection {
  background: rgba(167, 139, 250, 0.22) !important;
}

/* Side-by-side mode — EasyMDE puts the preview in its own pane on the
 * right. Style that pane to match the dashboard's panel look. */
.md-editor .EasyMDEContainer .editor-preview-side {
  background: #fafbff;
  border-left: 1px solid #e6e7ec;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg-0, #1f2230);
}
.md-editor .EasyMDEContainer .editor-preview-side > *:first-child { margin-top: 0; }
.md-editor .EasyMDEContainer .editor-preview-side > *:last-child  { margin-bottom: 0; }
.md-editor .EasyMDEContainer .editor-preview-side h1,
.md-editor .EasyMDEContainer .editor-preview-side h2,
.md-editor .EasyMDEContainer .editor-preview-side h3,
.md-editor .EasyMDEContainer .editor-preview-side h4 {
  margin: 14px 0 6px;
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.3;
  color: #1f2230;
}
.md-editor .EasyMDEContainer .editor-preview-side h1 { font-size: 19px; }
.md-editor .EasyMDEContainer .editor-preview-side h2 { font-size: 16px; }
.md-editor .EasyMDEContainer .editor-preview-side h3 { font-size: 14.5px; }
.md-editor .EasyMDEContainer .editor-preview-side p  { margin: 6px 0; }
.md-editor .EasyMDEContainer .editor-preview-side ul,
.md-editor .EasyMDEContainer .editor-preview-side ol { padding-left: 22px; margin: 6px 0; }
.md-editor .EasyMDEContainer .editor-preview-side li { margin: 2px 0; }
.md-editor .EasyMDEContainer .editor-preview-side a  { color: #6d28d9; text-decoration: underline; text-underline-offset: 2px; }
.md-editor .EasyMDEContainer .editor-preview-side code {
  background: #f0eef9;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}
.md-editor .EasyMDEContainer .editor-preview-side pre {
  background: #f4f4f8;
  border: 1px solid #e6e7ec;
  padding: 10px 12px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
}
.md-editor .EasyMDEContainer .editor-preview-side blockquote {
  border-left: 3px solid #c4b5fd;
  margin: 8px 0;
  padding: 2px 12px;
  color: #4a4f5e;
}

/* Fullscreen — EasyMDE swaps to a fixed-position cover. Keep the
 * dashboard chrome visible underneath isn't possible, but at least
 * style the fullscreen container to match. */
.md-editor .EasyMDEContainer .CodeMirror-fullscreen,
.md-editor .EasyMDEContainer .editor-preview-side.editor-preview-active-side {
  background: #ffffff;
}

/* Compact editors — shrink the toolbar height a touch and tighten the
 * editor's min-height. The compact API hides preview/side-by-side
 * buttons by construction (see the JS toolbar list). */
.md-easy-compact .EasyMDEContainer .editor-toolbar { padding: 4px 6px; }
.md-easy-compact .EasyMDEContainer .editor-toolbar button {
  width: 28px; height: 28px; line-height: 26px;
}
.md-easy-compact .EasyMDEContainer .CodeMirror { font-size: 14px; }
.md-easy-compact .EasyMDEContainer .CodeMirror-scroll { min-height: 80px; }

/* Monospace editors — used for fields where the operator types
 * structured text (none of the prompt editors today, but the prop is
 * supported for future YAML/JSON fields). */
.md-easy-mono .EasyMDEContainer .CodeMirror {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
}

/* The big-prompt variant (system_prompt / Knowledge Notes) gets extra
 * breathing room — both the source and the side-by-side preview are
 * substantial. */
.md-editor-prompt .EasyMDEContainer .CodeMirror-scroll { min-height: 280px; }
.md-editor-prompt .EasyMDEContainer .editor-preview-side { min-height: 280px; }

/* ─── Phone reflow ────────────────────────────────────────────────────── */
@media (max-width: 720px) {
  /* Side-by-side mode is too cramped on phones — EasyMDE handles the
   * stacked layout reasonably well, but we still want to compact the
   * toolbar buttons so they don't wrap. */
  .md-editor .EasyMDEContainer .editor-toolbar { padding: 4px 4px; }
  .md-editor .EasyMDEContainer .editor-toolbar button { margin: 0; }
}
@media (max-width: 480px) {
  .md-editor .EasyMDEContainer .editor-toolbar button { width: 30px; height: 30px; }
}

/* ─── Dark theme ──────────────────────────────────────────────────────── */
:root[data-theme="dark"] .md-editor {
  background: #1a1c25;
  border-color: rgba(255, 255, 255, 0.09);
}
:root[data-theme="dark"] .md-editor:focus-within {
  border-color: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.22);
}
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-toolbar {
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-toolbar button { color: #c8ccd9; }
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-toolbar button:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-toolbar button.active,
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-toolbar button:active {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.32);
  color: #ddd6fe;
}
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-toolbar i.separator {
  border-left-color: rgba(255, 255, 255, 0.12);
}
:root[data-theme="dark"] .md-editor .EasyMDEContainer .CodeMirror {
  background: #1a1c25;
  color: #e8e9ef;
}
:root[data-theme="dark"] .md-editor .CodeMirror .cm-strong { color: #ffffff; }
:root[data-theme="dark"] .md-editor .CodeMirror .cm-em { color: #ffffff; }
:root[data-theme="dark"] .md-editor .CodeMirror .cm-header { color: #ffffff; }
:root[data-theme="dark"] .md-editor .CodeMirror .cm-link { color: #c4b5fd; }
:root[data-theme="dark"] .md-editor .CodeMirror .cm-url { color: #6a6f7d; }
:root[data-theme="dark"] .md-editor .CodeMirror .cm-formatting,
:root[data-theme="dark"] .md-editor .CodeMirror .cm-formatting-header { color: #4a4f5e; }
:root[data-theme="dark"] .md-editor .CodeMirror .cm-comment,
:root[data-theme="dark"] .md-editor .CodeMirror .cm-formatting-code,
:root[data-theme="dark"] .md-editor .CodeMirror .cm-string,
:root[data-theme="dark"] .md-editor .CodeMirror .cm-string-2 {
  background: rgba(167, 139, 250, 0.18);
  color: #ddd6fe;
}
:root[data-theme="dark"] .md-editor .CodeMirror .cm-quote { color: #a4a8b8; }
:root[data-theme="dark"] .md-editor .CodeMirror .CodeMirror-cursor { border-left-color: #c4b5fd; }
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-preview-side {
  background: rgba(255, 255, 255, 0.025);
  border-left-color: rgba(255, 255, 255, 0.08);
  color: #e8e9ef;
}
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-preview-side a { color: #c4b5fd; }
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-preview-side code {
  background: rgba(167, 139, 250, 0.18);
  color: #ddd6fe;
}
:root[data-theme="dark"] .md-editor .EasyMDEContainer .editor-preview-side blockquote {
  border-left-color: #a78bfa;
  color: #c8ccd9;
}

/* ═══════════════════════════════════════════════════════════════════════════
 * CALL OUTCOMES — Advanced (build 186)
 *
 * The "Customize weights" button used to live in the primary tools row,
 * which trained operators to think the success rate was driven by a
 * tunable formula. For most operators "weights" is jargon. We moved the
 * control to a discreet "Advanced" link at the foot of the page so
 * non-power users see only the four kind groups (Success / Qualified /
 * Info-only / Failure), and power users still find the override.
 * ═══════════════════════════════════════════════════════════════════════════ */
.oc-advanced-foot {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed #e6e7ec;
  display: flex;
  justify-content: center;
}
.oc-advanced-link {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  color: #6a6f7d;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.oc-advanced-link:hover {
  background: #f3f4f9;
  color: #1f2230;
}
:root[data-theme="dark"] .oc-advanced-foot { border-top-color: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .oc-advanced-link { color: #a4a8b8; }
:root[data-theme="dark"] .oc-advanced-link:hover { background: rgba(255,255,255,0.05); color: #e8e9ef; }

/* ═══════════════════════════════════════════════════════════════════════════
 * ADMIN — sidebar variant (build 198)
 *
 * Replaces the build-3 horizontal tab bar with a grouped left sidebar.
 * The original .db-admin-tabs CSS still exists (unused now) so we can
 * roll back without a deploy. Targeted classes:
 *   .db-admin-shell-vsplit   — wrapper that switches to row layout below topbar
 *   .db-admin-body           — flex row container (sidebar + main)
 *   .db-admin-side           — the sidebar itself, ~220px wide
 *   .db-admin-main-vsplit    — main pane (no longer max-width centred — sidebar
 *                              takes the left space)
 * ═══════════════════════════════════════════════════════════════════════════ */
.db-admin-shell-vsplit { display: flex; flex-direction: column; }
.db-admin-body {
  flex: 1; min-height: 0;
  display: flex;
}
.db-admin-side {
  flex: 0 0 220px;
  background: #ffffff;
  border-right: 1px solid #e6e7ec;
  padding: 14px 10px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 2px;
}
.db-admin-main-vsplit {
  flex: 1; min-width: 0;
  max-width: 1280px;
  padding: 32px clamp(20px, 4vw, 48px);
}
@media (max-width: 768px) {
  .db-admin-body { flex-direction: column; }
  .db-admin-side { flex: 0 0 auto; width: 100%; border-right: 0; border-bottom: 1px solid #e6e7ec; }
}
:root[data-theme="dark"] .db-admin-side {
  background: rgba(255, 255, 255, 0.03);
  border-right-color: rgba(255, 255, 255, 0.07);
}

/* ═══════════════════════════════════════════════════════════════════════════
 * OBSERVABILITY page (build 198)
 *
 * Lives on /admin/observability. KPI tiles row up top → tabs (Live feed /
 * Schedulers) → filter row → event feed list with severity-coloured rows.
 * ═══════════════════════════════════════════════════════════════════════════ */
.db-obs-tiles {
  grid-template-columns: repeat(5, 1fr);
  margin-bottom: 18px;
}
@media (max-width: 980px) {
  .db-obs-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .db-obs-tiles { grid-template-columns: 1fr 1fr; }
}

.db-obs-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid #e6e7ec;
  margin-bottom: 16px;
}
.db-obs-tab {
  padding: 10px 18px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #6a6f7d;
  cursor: pointer;
  margin-bottom: -1px;
}
.db-obs-tab:hover { color: #1f2230; }
.db-obs-tab.is-active {
  color: #6d28d9;
  border-bottom-color: #6d28d9;
  font-weight: 600;
}

.db-obs-filter-row {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  margin-bottom: 14px;
}
.db-obs-filter {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: #4a4f5e;
}
.db-obs-filter select {
  font: inherit; font-size: 13px;
  padding: 5px 10px;
  border: 1px solid #d8dbe4;
  border-radius: 6px;
  background: #ffffff;
}

.db-obs-feed {
  display: flex; flex-direction: column;
  gap: 8px;
}
.db-obs-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 10px;
  transition: opacity 0.2s ease;
}
.db-obs-row.obs-sev-warning  { border-left: 3px solid #f59e0b; }
.db-obs-row.obs-sev-error    { border-left: 3px solid #ef4444; }
.db-obs-row.obs-sev-critical { border-left: 3px solid #dc2626; background: #fef2f2; }
.db-obs-row.is-resolved { opacity: 0.55; }

.db-obs-dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 4px;
}
.db-obs-row-body { min-width: 0; }
.db-obs-row-head {
  display: flex; gap: 8px; align-items: center;
  font-size: 11.5px; color: #6a6f7d;
  margin-bottom: 4px;
}
.db-obs-kind {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: #f3f4f9;
  padding: 1px 6px;
  border-radius: 4px;
  color: #4a4f5e;
}
.db-obs-sev-tag {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  font-size: 10.5px;
}
.obs-sev-info     .db-obs-sev-tag { color: #6a6f7d; }
.obs-sev-warning  .db-obs-sev-tag { color: #b45309; }
.obs-sev-error    .db-obs-sev-tag { color: #b91c1c; }
.obs-sev-critical .db-obs-sev-tag { color: #991b1b; }
.db-obs-ago { color: #9095a3; margin-left: auto; }
.db-obs-title {
  font-size: 14px; color: #1f2230;
  font-weight: 500; line-height: 1.4;
}
.db-obs-message {
  margin-top: 4px;
  font-size: 12.5px; color: #6a6f7d;
  line-height: 1.5;
}
.db-obs-payload {
  margin-top: 8px;
  font-size: 11.5px;
}
.db-obs-payload summary {
  cursor: pointer; color: #6d28d9;
  user-select: none;
}
.db-obs-payload pre {
  margin-top: 6px;
  padding: 8px 10px;
  background: #f7f8fc;
  border: 1px solid #e6e7ec;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.4;
  color: #4a4f5e;
}
.db-obs-resolve { white-space: nowrap; }
.db-obs-resolved {
  align-self: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9095a3;
}

.db-obs-schedulers { margin-top: 8px; }

:root[data-theme="dark"] .db-obs-row {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.07);
}
:root[data-theme="dark"] .db-obs-row.obs-sev-critical { background: rgba(220, 38, 38, 0.10); }
:root[data-theme="dark"] .db-obs-kind { background: rgba(255, 255, 255, 0.06); color: #c8ccd9; }
:root[data-theme="dark"] .db-obs-title { color: #e8e9ef; }
:root[data-theme="dark"] .db-obs-message { color: #a4a8b8; }
:root[data-theme="dark"] .db-obs-payload pre { background: rgba(255, 255, 255, 0.03); border-color: rgba(255, 255, 255, 0.07); color: #a4a8b8; }
:root[data-theme="dark"] .db-obs-tab.is-active { color: #c4b5fd; border-bottom-color: #a78bfa; }

/* ═══════════════════════════════════════════════════════════════════════════
 * PRICING TAB (build 199) — currently-in-force rates + drift indicators
 * Build 203: header row with manual "Check rates now" trigger.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* Header row above the pricing table: blurb left, last-checked +
   trigger button right. Wraps on narrow widths so the table stays
   the focal point on mobile. */
.ax-pricing-head {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  margin: 4px 0 14px;
}
.ax-pricing-check {
  display: flex; gap: 12px; align-items: center;
  flex-shrink: 0;
}
.ax-pricing-check-meta {
  font-size: 12px;
  color: #6a6f7d;
  white-space: nowrap;
}
.ax-pricing-check-meta b { color: #1f2230; font-weight: 600; }
.ax-pricing-check-cron { color: #9095a3; }
.ax-pricing-check-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  transition: filter 0.12s ease;
}
.ax-pricing-check-btn:hover:not(:disabled) { filter: brightness(1.06); }
.ax-pricing-check-btn:active:not(:disabled) { transform: translateY(1px); }
.ax-pricing-check-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
/* Small inline spinner — pure CSS rotation, no extra DOM. */
.ax-pricing-spin {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: ax-spin 0.85s linear infinite;
}
@keyframes ax-spin { to { transform: rotate(360deg); } }

:root[data-theme="dark"] .ax-pricing-check-meta { color: #a1a4ad; }
:root[data-theme="dark"] .ax-pricing-check-meta b { color: #e8e9ef; }
:root[data-theme="dark"] .ax-pricing-check-cron { color: #6a6f7d; }

.db-pricing-table tr.row-warning  td { background: rgba(245, 158, 11, 0.06); }
.db-pricing-table tr.row-critical td { background: rgba(220, 38, 38, 0.08); }
.db-pricing-provider {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #f3f4f9;
  color: #4a4f5e;
}
.db-pricing-provider-gemini { background: #e0f2fe; color: #075985; }
.db-pricing-provider-twilio { background: #fee2e2; color: #991b1b; }
.db-pricing-provider-plivo  { background: #dcfce7; color: #166534; }
.db-pricing-drift {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px; color: #6a6f7d;
}
.db-pricing-drift.is-drifty { color: #b45309; font-weight: 600; }
:root[data-theme="dark"] .db-pricing-table tr.row-warning  td { background: rgba(245, 158, 11, 0.10); }
:root[data-theme="dark"] .db-pricing-table tr.row-critical td { background: rgba(220, 38, 38, 0.14); }

/* ═══════════════════════════════════════════════════════════════════════════
 * AGENT P&L (build 199) — per-agent COGS roll-up on /admin/agent-pnl
 * ═══════════════════════════════════════════════════════════════════════════ */
.db-pnl-range {
  display: flex; gap: 6px; align-items: center;
  margin: 4px 0 16px;
  font-size: 13px;
  color: #6a6f7d;
}
.db-pnl-range-btn {
  background: transparent;
  border: 1px solid #d8dbe4;
  padding: 4px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 12.5px;
  color: #4a4f5e;
  cursor: pointer;
}
.db-pnl-range-btn.is-active {
  background: #ede9fe;
  border-color: #c4b5fd;
  color: #6d28d9;
  font-weight: 600;
}
.db-pnl-totals { grid-template-columns: repeat(6, 1fr); margin-bottom: 18px; }
@media (max-width: 980px) {
  .db-pnl-totals { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 560px) {
  .db-pnl-totals { grid-template-columns: 1fr 1fr; }
}
.db-pnl-table .db-table-td-right,
.db-pnl-table .db-table-th-right { text-align: right; }
.db-pnl-table td b { color: #1f2230; }
:root[data-theme="dark"] .db-pnl-range-btn { color: #c8ccd9; border-color: rgba(255,255,255,0.12); }
:root[data-theme="dark"] .db-pnl-range-btn.is-active { background: rgba(167,139,250,0.18); color: #c4b5fd; }
:root[data-theme="dark"] .db-pnl-table td b { color: #e8e9ef; }

/* ═══════════════════════════════════════════════════════════════════════════
 * ADMIN SHELL — reference adaptation (build 200, `ax-*` namespace)
 *
 * Dark topbar with brand + INTERNAL pill, sectioned left sidebar with
 * icons and a pink/purple gradient highlight on the active item, light
 * main canvas. Independent class namespace (`ax-*`) so we can iterate
 * without disturbing the per-agent dashboard's `db-*` styles.
 * ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Topbar ────────────────────────────────────────────────────────── */
.ax-shell { background: #f5f6f8; }
.ax-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  height: 56px;
  background: #0a0a0c;
  color: #f8fafc;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex: 0 0 56px;
}
.ax-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  letter-spacing: -0.01em;
  padding: 0 2px;
}
.ax-brand-mark { display: inline-flex; color: #a78bfa; }
.ax-brand-word { font-size: 18px; }
/* Build 203b: when the brand swatch is the full inline SpiderX wordmark
   logo (SpiderXLogo SVG), the `<a>` carries the `.ax-brand-logo` class
   instead of the dot+text composite. The dark topbar is near-black so
   currentColor on the SVG resolves to white via the parent `<a>` colour,
   while the red X stays brand-true (it's hardcoded #df3739 inside the
   path). Add a touch of right-padding so the next item ("Platform admin"
   label) doesn't crowd the wordmark's trailing ".ai". */
.ax-brand-logo { color: #f8fafc; gap: 0; padding-right: 6px; }
.ax-brand-logo svg { display: block; }
.ax-topbar-label {
  font-size: 13px;
  font-weight: 500;
  color: #a4a8b8;
  margin-left: 4px;
}
.ax-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
}
.ax-pill-internal {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.ax-pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.ax-topbar-spacer { flex: 1; }
.ax-exit {
  background: transparent;
  border: 0;
  color: #c8ccd9;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 6px 4px;
  letter-spacing: 0.005em;
}
.ax-exit:hover { color: #ffffff; }

/* ─── Body / Sidebar / Main ─────────────────────────────────────────── */
.ax-body {
  flex: 1; min-height: 0;
  display: flex;
}
.ax-side {
  flex: 0 0 240px;
  background: #ffffff;
  border-right: 1px solid #e6e7ec;
  display: flex;
  flex-direction: column;
}
.ax-side-scroll {
  flex: 1; min-height: 0;
  overflow-y: auto;
  padding: 18px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ax-pinned { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.ax-group { display: flex; flex-direction: column; }
.ax-group-head {
  display: flex; align-items: center;
  justify-content: space-between;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 10px 10px 6px;
  cursor: pointer;
  font: inherit;
  color: #9095a3;
}
.ax-group-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.ax-group-chev {
  width: 12px; height: 12px;
  color: #c1c4ce;
  transition: transform 0.18s ease;
}
.ax-group.is-open .ax-group-chev { transform: rotate(180deg); }
.ax-group-items {
  display: flex; flex-direction: column;
  gap: 1px;
  padding-bottom: 6px;
}

.ax-nav-item {
  display: flex; align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  color: #4a4f5e;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
}
.ax-nav-item:hover { background: #f3f4f9; color: #1f2230; }
.ax-nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  color: #6a6f7d;
  flex-shrink: 0;
}
.ax-nav-item:hover .ax-nav-icon { color: #1f2230; }
.ax-nav-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Active item — pink/purple gradient pill matching the reference.
 * The `is-active` state also dims the icon to white for contrast on
 * the gradient. */
.ax-nav-item.is-active {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 6px 16px -6px rgba(168, 85, 247, 0.5);
}
.ax-nav-item.is-active .ax-nav-icon { color: #ffffff; }
.ax-nav-item.is-active:hover { color: #ffffff; }

/* Sidebar footer — access status + user email */
.ax-side-foot {
  border-top: 1px solid #eef0f4;
  padding: 12px 18px 14px;
  font-size: 12px;
  color: #6a6f7d;
}
.ax-access {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #1f2230;
}
.ax-access-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.55);
}
.ax-side-user {
  margin-top: 4px;
  color: #6a6f7d;
  font-size: 12px;
  word-break: break-all;
}

/* ─── Main canvas ───────────────────────────────────────────────────── */
.ax-main {
  flex: 1; min-width: 0;
  padding: 32px clamp(20px, 4vw, 48px) 48px;
  max-width: 1380px;
  background: #f5f6f8;
  /* Build 232 — own the scroll + reserve the scrollbar gutter so
     navigating between admin pages of different heights doesn't snap
     the content sideways. Same reasoning as `.db-main`. */
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.ax-main h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.012em;
  margin: 0 0 4px;
  color: #0f172a;
}

/* ─── Phone reflow ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .ax-body { flex-direction: column; }
  .ax-side { flex: 0 0 auto; width: 100%; border-right: 0; border-bottom: 1px solid #e6e7ec; }
  .ax-side-scroll { padding: 12px 12px 4px; }
  .ax-topbar { padding: 0 14px; gap: 8px; }
  .ax-topbar-label { display: none; }
}

/* ─── Dark theme — keep topbar dark (it's already dark); flip sidebar */
:root[data-theme="dark"] .ax-shell { background: #0f1115; }
:root[data-theme="dark"] .ax-side {
  background: #16181f;
  border-right-color: rgba(255, 255, 255, 0.07);
}
:root[data-theme="dark"] .ax-nav-item { color: #c8ccd9; }
:root[data-theme="dark"] .ax-nav-item:hover { background: rgba(255,255,255,0.05); color: #ffffff; }
:root[data-theme="dark"] .ax-nav-icon { color: #a4a8b8; }
:root[data-theme="dark"] .ax-group-head { color: #6a6f7d; }
:root[data-theme="dark"] .ax-side-foot { border-top-color: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .ax-access { color: #e8e9ef; }
:root[data-theme="dark"] .ax-main { background: #0f1115; }
:root[data-theme="dark"] .ax-main h1 { color: #f8fafc; }

/* ─── Observability page (build 200 redesign) ──────────────────────── */
.ax-sub {
  font-size: 13.5px; color: #6a6f7d;
  line-height: 1.55;
  margin: 0 0 18px;
  max-width: 880px;
}

/* ───── Health-checks settings page (build 231) ──────────────────────────
 * /admin/healthcheck — settings cards for the three monitoring tiers
 * plus the per-agent status table. Visual rhythm matches the other admin
 * pages (Observability, Pricing): white card on light grey background,
 * 14 px section heads, dense form rows. */
.hc-card {
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
  margin-bottom: 18px;
  overflow: hidden;
}
.hc-card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid #eef0f4;
}
.hc-card-head h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #1f2230;
}
.hc-card-meta {
  font-size: 12px; color: #6a6f7d;
  white-space: nowrap;
}
.hc-card-future { opacity: 0.94; border-style: dashed; }
.hc-future-note {
  padding: 10px 18px 14px;
  font-size: 12px; color: #6a6f7d;
  border-top: 1px dashed #eef0f4;
  margin: 0;
}

/* Form row — label/desc on the left, control on the right. Matches the
 * AdminFilterBar's 11px-uppercase-label rhythm. */
.hc-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid #f3f4f8;
}
.hc-row:last-child { border-bottom: 0; }
.hc-row-text { flex: 1; min-width: 0; }
.hc-row-label {
  font-size: 13px; font-weight: 600; color: #1f2230;
  margin-bottom: 2px;
}
.hc-row-desc {
  font-size: 12px; color: #6a6f7d;
  line-height: 1.45;
}
.hc-input { max-width: 320px; }

/* iOS-style toggle. Pure CSS, no JS — works with a <label><input/>+<span>. */
.hc-toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.hc-toggle input { opacity: 0; width: 0; height: 0; }
.hc-toggle-slider {
  position: absolute; cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  transition: background 0.16s ease;
}
.hc-toggle-slider::before {
  content: ""; position: absolute;
  height: 18px; width: 18px;
  left: 2px; top: 2px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.16s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.18);
}
.hc-toggle input:checked + .hc-toggle-slider {
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
}
.hc-toggle input:checked + .hc-toggle-slider::before {
  transform: translateX(16px);
}

/* Status dots for the agent list. */
.hc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.hc-dot-up        { background: #10b981; }
.hc-dot-degraded  { background: #f59e0b; }
.hc-dot-down      { background: #ef4444; }
.hc-dot-never     { background: #9ca3af; }
.hc-dot-unknown   { background: #9ca3af; }

.hc-status-table { margin: 0; }
.hc-status-table th { font-size: 11px; }

.hc-msg {
  font-size: 12.5px;
  padding: 8px 14px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 8px;
  color: #312e81;
  margin-bottom: 14px;
}

:root[data-theme="dark"] .hc-card { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .hc-card-head { border-bottom-color: rgba(255,255,255,0.06); }
:root[data-theme="dark"] .hc-card-head h2 { color: #e8e9ef; }
:root[data-theme="dark"] .hc-row { border-bottom-color: rgba(255,255,255,0.05); }
:root[data-theme="dark"] .hc-row-label { color: #e8e9ef; }
:root[data-theme="dark"] .hc-toggle-slider { background: rgba(255,255,255,0.18); }
:root[data-theme="dark"] .hc-msg { background: rgba(99, 102, 241, 0.12); border-color: rgba(99, 102, 241, 0.3); color: #c7d2fe; }

/* Status pill row — reference-style */
.ax-statusrow {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.ax-stat-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: #1f2230;
}
.ax-stat-pill.ax-stat-total {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  font-weight: 700;
}
.ax-stat-dot { width: 7px; height: 7px; border-radius: 50%; }
.ax-stat-dot.stat-sent    { background: #10b981; }
.ax-stat-dot.stat-deduped { background: #9095a3; }
.ax-stat-dot.stat-failed  { background: #ef4444; }

/* Toolbar — search + 2 dropdowns + count */
.ax-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.ax-search {
  flex: 1; min-width: 200px;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  padding: 8px 4px;
  outline: none;
  color: #1f2230;
}
.ax-search::placeholder { color: #9095a3; }
.ax-select {
  font: inherit;
  font-size: 13px;
  padding: 7px 28px 7px 12px;
  background: #ffffff;
  border: 1px solid #d8dbe4;
  border-radius: 8px;
  color: #1f2230;
  cursor: pointer;
}
.ax-toolbar-count {
  font-size: 12.5px; color: #6a6f7d;
  white-space: nowrap;
  padding-left: 4px;
}

/* ─── AdminFilterBar (build 202) ───────────────────────────────────────
   Unified filter row on every super-admin page. Visually echoes the
   `.ax-toolbar` chip-and-pill aesthetic but with paired label + control
   "fields" so the operator can scan org / agent / phone / range at a
   glance without reading microcopy.

   Layout: horizontal flex that wraps at narrow widths — each field
   keeps its label + control together. Apply / Reset live in a small
   action group on the right.
   ──────────────────────────────────────────────────────────────────── */
.ax-filterbar {
  display: flex; gap: 12px; align-items: end; flex-wrap: wrap;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.ax-fb-field {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 140px;
}
.ax-fb-field-grow { flex: 1; min-width: 220px; }
.ax-fb-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6a6f7d;
}
.ax-fb-select, .ax-fb-input {
  font: inherit;
  font-size: 13.5px;
  padding: 7px 12px;
  background: #ffffff;
  border: 1px solid #d8dbe4;
  border-radius: 8px;
  color: #1f2230;
  outline: none;
  height: 36px;
  box-sizing: border-box;
}
.ax-fb-select { padding-right: 28px; cursor: pointer; }
.ax-fb-input:focus, .ax-fb-select:focus {
  border-color: #a855f7;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.16);
}
.ax-fb-input-date { min-width: 140px; }

.ax-fb-actions {
  display: flex; gap: 8px; align-items: center;
  margin-left: auto;  /* push to the right edge */
  padding-bottom: 1px;  /* baseline-align with input bottoms */
}
.ax-fb-apply {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}
.ax-fb-apply:hover { filter: brightness(1.05); }
.ax-fb-apply:active { transform: translateY(1px); }
.ax-fb-reset {
  font: inherit;
  font-size: 13px;
  padding: 8px 14px;
  border: 1px solid #d8dbe4;
  border-radius: 8px;
  background: #ffffff;
  color: #1f2230;
  cursor: pointer;
}
.ax-fb-reset:hover { background: #f4f5f9; }
.ax-fb-badge {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(168, 85, 247, 0.12));
  color: #a21caf;
  border: 1px solid rgba(168, 85, 247, 0.28);
}

/* Dark-theme overrides — match the existing .ax-toolbar dark rules */
:root[data-theme="dark"] .ax-filterbar {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .ax-fb-select,
:root[data-theme="dark"] .ax-fb-input {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e8e9ef;
}
:root[data-theme="dark"] .ax-fb-label { color: #a1a4ad; }
:root[data-theme="dark"] .ax-fb-reset {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.14);
  color: #e8e9ef;
}
:root[data-theme="dark"] .ax-fb-reset:hover { background: rgba(255, 255, 255, 0.08); }

@media (max-width: 700px) {
  .ax-filterbar { flex-direction: column; align-items: stretch; }
  .ax-fb-field { min-width: 0; }
  .ax-fb-actions { margin-left: 0; justify-content: flex-end; }
}

/* Sub-tabs — Live feed / Schedulers / Pricing */
.ax-subtabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid #e6e7ec;
  margin-bottom: 18px;
}
.ax-subtab {
  padding: 9px 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-size: 13px; font-weight: 500;
  color: #6a6f7d;
  cursor: pointer;
  margin-bottom: -1px;
}
.ax-subtab:hover { color: #1f2230; }
.ax-subtab.is-active {
  color: #1f2230;
  border-bottom-color: #1f2230;
  font-weight: 600;
}

/* Data table — reference aesthetic */
.ax-table-wrap {
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
  overflow: hidden;
}
.ax-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.ax-table thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #6a6f7d;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0f4;
  background: #fafbff;
}
.ax-th-right { text-align: right !important; }
.ax-table tbody td {
  padding: 14px 16px;
  border-top: 1px solid #eef0f4;
  vertical-align: middle;
  color: #1f2230;
}
.ax-table tbody tr.ax-row { cursor: pointer; transition: background 0.1s ease; }
.ax-table tbody tr.ax-row:hover { background: #fafbff; }
/* Left-edge severity rail — sits on the first td via box-shadow inset */
.ax-table tbody tr.ax-row-warning   td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
.ax-table tbody tr.ax-row-error     td:first-child { box-shadow: inset 3px 0 0 #ef4444; }
.ax-table tbody tr.ax-row-critical  td:first-child { box-shadow: inset 3px 0 0 #dc2626; }
.ax-table tbody tr.ax-row.is-resolved td { opacity: 0.55; }
.ax-cell-when { color: #1f2230; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ax-cell-title { color: #1f2230; }
.ax-empty-cell { text-align: center; color: #9095a3; padding: 36px 16px !important; }

/* Kind chip — reference's coloured pill, prefix-based palette */
.ax-kind-chip {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 500;
  background: #f3f4f9;
  color: #4a4f5e;
  white-space: nowrap;
}
.ax-kind-chip.ax-kind-agent    { background: #ede9fe; color: #6d28d9; }
.ax-kind-chip.ax-kind-call     { background: #dbeafe; color: #1d4ed8; }
.ax-kind-chip.ax-kind-cost     { background: #fef3c7; color: #92400e; }
.ax-kind-chip.ax-kind-pricing  { background: #fce7f3; color: #9d174d; }
.ax-kind-chip.ax-kind-notify   { background: #dcfce7; color: #166534; }
.ax-kind-chip.ax-kind-quality  { background: #cffafe; color: #155e75; }
.ax-kind-chip.ax-kind-system   { background: #fee2e2; color: #991b1b; }

/* Status pill — SENT / FAILED / RESOLVED */
.ax-status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.ax-status-pill.ax-status-sent     { background: #dcfce7; color: #166534; }
.ax-status-pill.ax-status-failed   { background: #fee2e2; color: #991b1b; }
.ax-status-pill.ax-status-resolved { background: #e5e7eb; color: #4b5563; }

.ax-view {
  background: transparent;
  border: 0;
  color: #6d28d9;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 6px;
}
.ax-view:hover { color: #4c1d95; text-decoration: underline; }

/* ─── Event detail drawer ─────────────────────────────────────────── */
.ax-drawer-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 17, 28, 0.4);
  z-index: 80;
  display: flex; justify-content: flex-end;
  animation: axfade 0.18s ease;
}
@keyframes axfade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.ax-drawer {
  width: min(540px, 100vw);
  background: #ffffff;
  height: 100%;
  display: flex; flex-direction: column;
  box-shadow: -16px 0 48px rgba(15, 17, 28, 0.18);
  animation: axslide 0.22s cubic-bezier(.2,.9,.3,1);
}
@keyframes axslide {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.ax-drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e6e7ec;
  background: #fafbff;
}
.ax-drawer-eyebrow {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: #6a6f7d; font-weight: 600;
}
.ax-drawer-title {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
}
.ax-drawer-close {
  background: transparent; border: 0;
  font-size: 22px; line-height: 1;
  cursor: pointer;
  color: #9095a3;
  padding: 0 4px;
}
.ax-drawer-close:hover { color: #1f2230; }
.ax-drawer-body {
  flex: 1; min-height: 0;
  padding: 18px 22px;
  overflow-y: auto;
}
.ax-kv {
  display: grid;
  grid-template-columns: 100px 1fr;
  row-gap: 8px;
  column-gap: 14px;
  margin: 0 0 18px;
  font-size: 13px;
}
.ax-kv dt { color: #6a6f7d; font-weight: 500; }
.ax-kv dd { color: #1f2230; margin: 0; }
.ax-kv code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  background: #f3f4f9;
  padding: 2px 6px;
  border-radius: 4px;
}
.ax-drawer-section { margin-bottom: 16px; }
.ax-drawer-label {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: #6a6f7d; font-weight: 700;
  margin-bottom: 6px;
}
.ax-drawer-msg {
  font-size: 13px;
  background: #f5f6fa;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e6e7ec;
  color: #1f2230;
  line-height: 1.5;
}
.ax-drawer-json {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: #f5f6fa;
  border: 1px solid #e6e7ec;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  line-height: 1.5;
  color: #1f2230;
}
.ax-drawer-foot {
  border-top: 1px solid #e6e7ec;
  padding: 14px 22px;
  background: #fafbff;
  display: flex; gap: 8px; justify-content: flex-end;
}
@media (max-width: 600px) {
  .ax-drawer { width: 100vw; }
  .ax-kv { grid-template-columns: 1fr; row-gap: 4px; }
  .ax-kv dt { margin-top: 6px; font-size: 11px; }
}

/* Dark-theme parity */
:root[data-theme="dark"] .ax-stat-pill { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); color: #e8e9ef; }
:root[data-theme="dark"] .ax-stat-pill.ax-stat-total { background: #f8fafc; color: #0f172a; border-color: #f8fafc; }
:root[data-theme="dark"] .ax-toolbar { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .ax-search { color: #e8e9ef; }
:root[data-theme="dark"] .ax-select { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.12); color: #e8e9ef; }
:root[data-theme="dark"] .ax-subtab.is-active { color: #e8e9ef; border-bottom-color: #e8e9ef; }
:root[data-theme="dark"] .ax-table-wrap { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .ax-table thead th { background: rgba(255,255,255,0.04); color: #a4a8b8; border-bottom-color: rgba(255,255,255,0.07); }
:root[data-theme="dark"] .ax-table tbody td { color: #e8e9ef; border-top-color: rgba(255,255,255,0.07); }
:root[data-theme="dark"] .ax-table tbody tr.ax-row:hover { background: rgba(255,255,255,0.04); }
:root[data-theme="dark"] .ax-drawer { background: #16181f; }
:root[data-theme="dark"] .ax-drawer-head { background: rgba(255,255,255,0.03); border-bottom-color: rgba(255,255,255,0.07); }
:root[data-theme="dark"] .ax-drawer-title { color: #f8fafc; }
:root[data-theme="dark"] .ax-drawer-msg, :root[data-theme="dark"] .ax-drawer-json { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.07); color: #e8e9ef; }
:root[data-theme="dark"] .ax-drawer-foot { background: rgba(255,255,255,0.03); border-top-color: rgba(255,255,255,0.07); }

/* ═══════════════════════════════════════════════════════════════════════════
 * CALL DETAILS MODAL (build 188)
 *
 * Opened from any row's "Details" button on the Call log page. Layout mirrors
 * the reference design: metadata 4-up grid (Date/Phone/Duration/Recording),
 * summary block, extracted-entity chips, then a chat-style transcript with
 * agent bubbles right-aligned (green) and caller bubbles left-aligned (blue).
 * Audio playback is currently disabled with a "coming soon" note — the
 * column + button shape are in place so wiring real recordings is a
 * data-only swap once capture lands.
 * ═══════════════════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════════════════
 * VOICE SETTINGS — reference adaptation (build 195)
 *
 * Replaces the old hero + 8-card grid with a cleaner CEO-approved layout:
 * two dropdowns up top (language / voice), a single voice preview card
 * with avatar + tags + Play Sample, then the greeting textarea with a
 * character counter. The 8-card explorer still exists, folded into a
 * <details> below for operators who want to compare side-by-side.
 * ═══════════════════════════════════════════════════════════════════════════ */
.vs-panel { padding: 18px 20px; }
.vs-twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.vs-select { width: 100%; }

.vs-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  background: #ffffff;
  border: 1px solid #e6e7ec;
  border-radius: 14px;
}
.vs-card-left {
  display: flex; align-items: center; gap: 14px;
  min-width: 0;
}
.vs-avatar {
  width: 52px; height: 52px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #ffffff;
  font-size: 22px; font-weight: 700;
  flex: 0 0 52px;
  letter-spacing: -0.01em;
}
.vs-info {
  display: flex; flex-direction: column; gap: 4px;
  min-width: 0;
}
.vs-name {
  font-size: 18px; font-weight: 700; color: #1f2230;
  letter-spacing: -0.005em;
}
.vs-meta {
  font-size: 13px; color: #6a6f7d;
}
.vs-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 4px;
}
.vs-tag {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: #e0e7ff;
  color: #1e3a8a;
}
.vs-vibe {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: #6a6f7d;
  font-style: italic;
}
.vs-play {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  flex-shrink: 0;
}
.vs-warn {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 12.5px;
}
.vs-reset { margin-top: 10px; }

.vs-greeting-field { margin-top: 16px; }
.vs-greeting {
  resize: vertical;
  min-height: 80px;
  font-size: 14px;
  line-height: 1.5;
  padding: 12px 14px;
}
.vs-counter {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: #9095a3;
}

.vs-explore { padding: 14px 18px; }
.vs-explore > summary {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  color: #1f2230;
  padding: 4px 0;
  list-style: none;
}
.vs-explore > summary::-webkit-details-marker { display: none; }
.vs-explore > summary svg { transition: transform 0.18s ease; }
.vs-explore[open] > summary svg { transform: rotate(180deg); }

/* Phone reflow — stack the two dropdowns + collapse the card. */
@media (max-width: 720px) {
  .vs-twocol { grid-template-columns: 1fr; gap: 10px; }
  .vs-card { flex-direction: column; align-items: stretch; }
  .vs-play { width: 100%; justify-content: center; }
}

/* Dark theme */
:root[data-theme="dark"] .vs-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
:root[data-theme="dark"] .vs-name { color: #e8e9ef; }
:root[data-theme="dark"] .vs-meta { color: #a4a8b8; }
:root[data-theme="dark"] .vs-tag {
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
}
:root[data-theme="dark"] .vs-vibe { color: #a4a8b8; }
:root[data-theme="dark"] .vs-warn {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.32);
  color: #fde68a;
}
:root[data-theme="dark"] .vs-counter { color: #6a6f7d; }
:root[data-theme="dark"] .vs-explore > summary { color: #e8e9ef; }

/* Specificity bump: the base .db-modal.db-modal-wide pair (which the
 * JSX still applies for theme/spacing inheritance) caps width at 720px.
 * Compound selector outscores it so build-191's 1040px target wins. */
.db-modal.db-modal-wide.call-detail-modal {
  width: min(1040px, calc(100vw - 32px));
  max-width: min(1040px, calc(100vw - 32px));
  padding: 0;
  overflow: hidden;
}
.call-detail-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid #e6e7ec;
  background: #fafbff;
}
.call-detail-title { margin: 0; font-size: 18px; font-weight: 700; color: #1f2230; letter-spacing: -0.005em; }
.call-detail-body { padding: 18px 22px 8px; max-height: calc(90vh - 140px); overflow-y: auto; }
.call-detail-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin-bottom: 18px;
}
.call-detail-meta-cell { display: flex; flex-direction: column; gap: 4px; }
.call-detail-meta-label { font-size: 12px; color: #6a6f7d; letter-spacing: 0.01em; }
.call-detail-meta-value { font-size: 14.5px; color: #1f2230; font-weight: 500; }
.call-detail-rec-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 22px;
  font-size: 14.5px;
  font-weight: 600;
  width: max-content;
  border-radius: 8px;
}
.call-detail-rec-btn:disabled { cursor: not-allowed; opacity: 0.55; }
.call-detail-rec-btn > span:first-child { font-size: 11px; }
.call-detail-audio { width: 100%; max-width: 320px; }
/* Build 208 — single stereo playback. Caller mixed onto the LEFT
   channel, agent on the RIGHT — the operator gets one <audio> tag
   with a single seek bar instead of the two-row layout from build 206.
   Wide audio variant is used here so the seek bar has enough room
   to scrub a 60-300s call comfortably. */
.call-detail-audio-wide { max-width: 100%; width: 100%; height: 36px; }
.call-detail-rec-meta {
  margin-top: 6px;
  font-size: 11px;
  color: #6a6f7d;
  line-height: 1.4;
}
.call-detail-rec-meta b { color: #1f2230; font-weight: 600; }
.call-detail-rec-meta-purged { color: #b91c1c; }
:root[data-theme="dark"] .call-detail-rec-meta { color: #9095a3; }
:root[data-theme="dark"] .call-detail-rec-meta b { color: #e8e9ef; }

.call-detail-section { margin: 16px 0; }
.call-detail-section-label { font-size: 13px; font-weight: 600; color: #1f2230; margin-bottom: 8px; }
.call-detail-summary {
  background: #f7f8fc;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #e6e7ec;
  font-size: 14px;
  line-height: 1.5;
  color: #1f2230;
}
.call-detail-chips { display: flex; flex-wrap: wrap; gap: 8px; }
/* Per-chip palette is assigned inline from JS (CHIP_PALETTE hash on the
 * extracted key) so every chip is its own pastel — same effect as the
 * reference design where date/time/count/location all read distinct. */
.call-detail-chip {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
  border: 1px solid transparent;
  /* Defaults — overridden inline. Kept as a graceful fallback for any
   * future use that doesn't supply a colour. */
  background: #ede9fe;
  color: #6d28d9;
}

.call-detail-mood { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.call-detail-signals { font-size: 12.5px; color: #6a6f7d; font-style: italic; }

.call-detail-tx {
  background: #f5f6fa;
  border: 1px solid #e6e7ec;
  border-radius: 12px;
  padding: 18px 16px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 360px;
  overflow-y: auto;
}
.call-detail-tx-marker {
  align-self: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #6a6f7d;
  margin-bottom: 2px;
}
.call-detail-tx-row { display: flex; }
.call-detail-tx-row.is-agent { justify-content: flex-end; }
.call-detail-tx-row.is-user  { justify-content: flex-start; }
.call-detail-tx-bubble {
  max-width: 76%;
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 1px 2px rgba(15, 17, 28, 0.05);
}
.call-detail-tx-row.is-agent .call-detail-tx-bubble {
  background: #dcfce7;
  color: #14532d;
}
.call-detail-tx-row.is-user .call-detail-tx-bubble {
  background: #e0e7ff;
  color: #1e3a8a;
}
.call-detail-tx-who {
  font-weight: 700;
  margin-right: 6px;
}
.call-detail-tx-empty {
  background: #f7f8fc;
  padding: 18px 16px;
  border-radius: 8px;
  border: 1px dashed #d8dbe4;
  color: #6a6f7d;
  font-size: 13px;
  text-align: center;
}

.call-detail-foot {
  display: flex; justify-content: flex-end;
  padding: 12px 22px;
  border-top: 1px solid #e6e7ec;
  background: #fafbff;
}

@media (max-width: 600px) {
  .call-detail-meta-grid { grid-template-columns: 1fr; gap: 10px; }
  .call-detail-tx-bubble { max-width: 88%; font-size: 13px; }
}

/* Dark theme */
:root[data-theme="dark"] .call-detail-head,
:root[data-theme="dark"] .call-detail-foot { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }
:root[data-theme="dark"] .call-detail-title { color: #e8e9ef; }
:root[data-theme="dark"] .call-detail-meta-label { color: #a4a8b8; }
:root[data-theme="dark"] .call-detail-meta-value,
:root[data-theme="dark"] .call-detail-section-label,
:root[data-theme="dark"] .call-detail-summary { color: #e8e9ef; }
:root[data-theme="dark"] .call-detail-summary { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.07); }
:root[data-theme="dark"] .call-detail-tx { background: rgba(255,255,255,0.025); border-color: rgba(255,255,255,0.07); }
:root[data-theme="dark"] .call-detail-tx-row.is-agent .call-detail-tx-bubble { background: rgba(34, 197, 94, 0.18); color: #bbf7d0; }
:root[data-theme="dark"] .call-detail-tx-row.is-user  .call-detail-tx-bubble { background: rgba(59, 130, 246, 0.20); color: #bfdbfe; }
:root[data-theme="dark"] .call-detail-tx-empty { background: rgba(255,255,255,0.025); border-color: rgba(255,255,255,0.10); color: #a4a8b8; }
:root[data-theme="dark"] .call-detail-tx-marker { background: rgba(167, 139, 250, 0.16); color: #c4b5fd; }
:root[data-theme="dark"] .call-detail-rec-note { color: #6a6f7d; }
:root[data-theme="dark"] .call-detail-chip { background: rgba(167, 139, 250, 0.20); color: #ddd6fe; border-color: rgba(167, 139, 250, 0.32); }

/* ─────────────────────────────────────────────────────────────────────
 * TelephonyPanel (Build 251) — Phone Number tab with auto-setup +
 * copy-paste fallback for Plivo / Twilio / Exotel.
 * ───────────────────────────────────────────────────────────────────── */
.tel-panel { margin-top: 18px; }
.tel-provider-row { margin-bottom: 14px; }
.tel-provider-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tel-provider-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 13.5px; font-weight: 600;
  background: #fff; color: #1f2937;
  border: 1.5px solid #d8dae3; border-radius: 999px;
  padding: 6px 14px 6px 6px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.tel-provider-chip:hover { border-color: #818cf8; background: #f8f7ff; }
.tel-provider-chip-on { border-color: #4f46e5; background: #eef0ff; color: #312e81; }
/* Build 256 — brand-mark badge inside the chip. Round 24×24 holder so
   the inline SVG (a brand-coloured rounded square) sits neatly against
   the chip's pill outline. Logo intrinsics handle their own colour. */
.tel-provider-logo {
  width: 24px; height: 24px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
}
.tel-provider-logo svg { display: block; }
.tel-provider-chip-name { line-height: 1; }
.tel-chip-tag {
  font-size: 10.5px; font-weight: 700;
  color: #047857; background: #ecfdf5; border-radius: 999px;
  padding: 2px 7px; letter-spacing: 0.02em;
}

/* Auto-setup card */
.tel-auto {
  margin-top: 8px; padding: 16px 16px 14px;
  background: linear-gradient(180deg, #f7f5ff 0%, #fbfaff 100%);
  border: 1px solid #ece2ff; border-radius: 14px;
}
.tel-auto-head { display: flex; align-items: center; gap: 8px; }
.tel-recom {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff; background: #4f46e5; border-radius: 999px; padding: 3px 8px;
}
.tel-auto-title { font-size: 14.5px; font-weight: 700; color: #0f172a; }
.tel-auto-sub { font-size: 12.5px; color: #6a6f7e; margin: 4px 0 12px; line-height: 1.45; }
.tel-auto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .tel-auto-grid { grid-template-columns: 1fr; } }
.tel-token-wrap { position: relative; }
.tel-token-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: transparent; border: 0; font-size: 14px; cursor: pointer; padding: 4px;
}
.tel-auto-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.tel-test-ok { font-size: 12.5px; font-weight: 600; color: #047857; }
.tel-err {
  margin-top: 10px; padding: 8px 12px;
  font-size: 12.5px; color: #b91c1c;
  background: #fff4f4; border: 1px solid #fecaca; border-radius: 10px;
}

/* Numbers list */
.tel-numbers { margin-top: 14px; }
.tel-numbers-head { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 8px; }
.tel-numbers-empty {
  font-size: 12.5px; color: #6a6f7e;
  padding: 10px 12px; background: #fff; border: 1px dashed #d8dae3; border-radius: 10px;
}
.tel-numbers-list { display: flex; flex-direction: column; gap: 6px; }
.tel-number-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; background: #fff;
  border: 1.5px solid #d8dae3; border-radius: 10px; cursor: pointer;
  font-size: 13px;
}
.tel-number-row:hover { border-color: #818cf8; }
.tel-number-row-on { border-color: #4f46e5; background: #f8f7ff; }
.tel-number-num { font-weight: 700; color: #0f172a; font-family: ui-monospace, SF Mono, Menlo, monospace; }
.tel-number-meta { color: #6a6f7e; font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tel-number-warn {
  font-size: 10.5px; font-weight: 700; color: #b45309; background: #fef3c7;
  border-radius: 999px; padding: 2px 8px; letter-spacing: 0.02em;
}
.tel-provision { margin-top: 12px; padding: 12px; background: #fff; border-radius: 10px; border: 1px solid #ece2ff; }
.tel-provision-note { font-size: 12.5px; color: #4b5563; margin: 0 0 10px; line-height: 1.5; }

/* Manual fallback */
.tel-manual { margin-top: 18px; }
.tel-manual-toggle {
  font: inherit; font-size: 13px; font-weight: 600; color: #4f46e5;
  background: transparent; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 6px;
}
.tel-manual-toggle:hover { background: rgba(79, 70, 229, 0.08); }
.tel-manual-caret { transition: transform 0.15s; display: inline-block; }
.tel-manual-caret.open { transform: rotate(180deg); }
.tel-manual-body {
  margin-top: 12px; padding: 14px 16px;
  background: #fff; border: 1px solid #e5e7ec; border-radius: 14px;
}
.tel-manual-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 14px; font-size: 13px; line-height: 1.55; }
.tel-copyrow {
  display: flex; gap: 6px; align-items: center;
  margin-top: 6px; flex-wrap: wrap;
}
.tel-copyrow-key {
  font-size: 11.5px; font-weight: 700; color: #4f46e5; min-width: 92px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tel-copy-input { flex: 1; min-width: 220px; font-family: ui-monospace, SF Mono, Menlo, monospace; font-size: 12.5px; }
.tel-warn {
  margin-top: 14px; padding: 10px 12px;
  font-size: 12.5px; color: #92400e;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
}

/* Current-binding view (post-provision) */
.tel-current {
  margin-top: 12px; padding: 14px 16px;
  background: linear-gradient(180deg, #f0fdf4 0%, #f7fbf9 100%);
  border: 1px solid #c5ead5; border-radius: 14px;
}
.tel-current-row { display: flex; gap: 12px; font-size: 13px; padding: 4px 0; }
.tel-current-key { color: #4b5563; min-width: 110px; font-weight: 600; }
.tel-current-val { color: #0f172a; font-weight: 600; word-break: break-all; }
.tel-mono { font-family: ui-monospace, SF Mono, Menlo, monospace; font-size: 12px; }
.tel-current-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.tel-btn-danger { color: #b91c1c; }
.tel-btn-danger:hover { background: #fff1f1; }
.tel-verify {
  margin-top: 10px; padding: 8px 12px;
  font-size: 12.5px; font-weight: 600;
  border-radius: 10px;
}
.tel-verify-ok { color: #047857; background: #ecfdf5; border: 1px solid #b9ead5; }
.tel-verify-drift { color: #b91c1c; background: #fff4f4; border: 1px solid #fecaca; }
.tel-manual-only {
  margin-top: 8px; padding: 12px 14px;
  font-size: 13px; color: #4b5563;
  background: #f8fafc; border: 1px dashed #d8dae3; border-radius: 12px;
}

/* Dark mode */
:root[data-theme="dark"] .tel-provider-chip { background: #14171f; border-color: #2a2f3e; color: #cbd5e1; }
:root[data-theme="dark"] .tel-provider-chip:hover { border-color: #6366f1; background: #1c2030; }
:root[data-theme="dark"] .tel-provider-chip-on { background: #1e2233; border-color: #6366f1; color: #c7d2fe; }
:root[data-theme="dark"] .tel-chip-tag { color: #6ee7b7; background: #11281f; }
:root[data-theme="dark"] .tel-auto { background: linear-gradient(180deg, #1a1730 0%, #15171f 100%); border-color: #2e2842; }
:root[data-theme="dark"] .tel-auto-title { color: #f1f3f8; }
:root[data-theme="dark"] .tel-auto-sub { color: #9aa0ad; }
:root[data-theme="dark"] .tel-test-ok { color: #6ee7b7; }
:root[data-theme="dark"] .tel-err { background: #2a1a1f; border-color: #6b2a36; color: #fca5a5; }
:root[data-theme="dark"] .tel-numbers-head { color: #f1f3f8; }
:root[data-theme="dark"] .tel-numbers-empty { background: #14171f; border-color: #2a2f3e; color: #aab0c0; }
:root[data-theme="dark"] .tel-number-row { background: #14171f; border-color: #2a2f3e; color: #e7e9ee; }
:root[data-theme="dark"] .tel-number-row:hover { border-color: #6366f1; }
:root[data-theme="dark"] .tel-number-row-on { background: #1e2233; border-color: #6366f1; }
:root[data-theme="dark"] .tel-number-num { color: #f1f3f8; }
:root[data-theme="dark"] .tel-number-meta { color: #9aa0ad; }
:root[data-theme="dark"] .tel-number-warn { color: #fbbf24; background: #3b2a14; }
:root[data-theme="dark"] .tel-provision { background: #14171f; border-color: #2e2842; }
:root[data-theme="dark"] .tel-provision-note { color: #cbd5e1; }
:root[data-theme="dark"] .tel-manual-toggle { color: #a5b4fc; }
:root[data-theme="dark"] .tel-manual-toggle:hover { background: rgba(165, 180, 252, 0.1); }
:root[data-theme="dark"] .tel-manual-body { background: #14171f; border-color: #2a2f3e; }
:root[data-theme="dark"] .tel-copyrow-key { color: #a5b4fc; }
:root[data-theme="dark"] .tel-warn { background: #2a1a0f; border-color: #6b3a14; color: #fbbf24; }
:root[data-theme="dark"] .tel-current { background: linear-gradient(180deg, #14241c 0%, #131a16 100%); border-color: #2a4a3a; }
:root[data-theme="dark"] .tel-current-key { color: #9aa0ad; }
:root[data-theme="dark"] .tel-current-val { color: #f1f3f8; }
:root[data-theme="dark"] .tel-verify-ok { background: #11281f; border-color: #1c3d2d; color: #6ee7b7; }
:root[data-theme="dark"] .tel-verify-drift { background: #2a1a1f; border-color: #6b2a36; color: #fca5a5; }
:root[data-theme="dark"] .tel-manual-only { background: #14171f; border-color: #2a2f3e; color: #aab0c0; }
