/* ==========================================================================
   NextBit Voice Agent — restyled to sit natively inside the NFT Atoms
   design system. Brand tokens below are copied verbatim from
   nft-website-official/public/assets/css/styles.css §1 (see that file for
   provenance) — do not hand-retype values, always diff against the source
   if these ever drift.

   Every class/id below is referenced by web/js/{index,call,summary}.js —
   selectors are preserved exactly; only the declarations were rewritten.
   No build step, no external fonts/CDNs — fonts are self-hosted in
   web/fonts/ (see the @font-face block).
   ========================================================================== */

/* ---------- 1. BRAND TOKENS (verbatim from NFT Atoms styles.css) ---------- */
:root {
  --blue: #2563eb;
  --blue-bright: #4d7fff;
  --blue-deep: #1a56db;
  --cyan: #2bd9f5;
  --cyan-bright: #67e8f9;
  --cyan-deep: #0891b2;

  --bg: #05070d;
  --bg-2: #0a101e;
  --bg-3: #0d1526;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.06);
  --border: rgba(160, 190, 255, 0.1);
  --border-strong: rgba(160, 190, 255, 0.18);

  --text: #e9eef8;
  --text-dim: #98a2b8;
  --text-faint: #5a6478;

  --glow-blue: 0 0 40px rgba(77, 127, 255, 0.4);
  --glow-cyan: 0 0 40px rgba(43, 217, 245, 0.35);

  /* Reserved "fusion" accent — ONLY for the live-call recording/active
     indicator (see .live-badge). Not spread anywhere else. */
  --fusion: #ff8a3d;
  --fusion-text: #ffb57d;
  --fusion-soft: rgba(255, 138, 61, 0.08);
  --fusion-line: rgba(255, 138, 61, 0.5);

  --radius: 18px;
  --radius-lg: 26px;
  --maxw: 1200px;

  --font-head: "Space Grotesk", "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* ---- supplemental local tokens (not part of the NFT root set) ----
     Smaller radius steps NFT itself uses ad hoc (.field input, .contact-points
     .ic, chips) but never promoted to a named token — and functional
     status colors for pass/fail + outcome semantics. These are deliberately
     NOT another brand accent: they're muted traffic-light colors for a
     technical HUD (validator pass/abort, call disposition), same role
     green plays in NFT's own .tag-live. See report for the full rationale. */
  --radius-sm: 12px;
  --radius-pill: 999px;
  --success: #34d399;
  --success-text: #6ee7b7;
  --danger: #fb6a6a;
  --danger-text: #ffb3b3;
  --warning: #fbbf24;
  --warning-text: #ffd98a;
}

/* Light theme override — verbatim from NFT Atoms styles.css, plus the same
   treatment extended to this file's supplemental status tokens. */
html[data-theme="light"] {
  --bg: #f5f7fc;
  --bg-2: #edf1f9;
  --bg-3: #e4eaf6;
  --surface: rgba(10, 22, 50, 0.04);
  --surface-2: rgba(10, 22, 50, 0.06);
  --border: rgba(20, 40, 90, 0.12);
  --border-strong: rgba(20, 40, 90, 0.22);
  --text: #0c1530;
  --text-dim: #44506b;
  --text-faint: #7a849c;
  /* cyan text fails contrast on light backgrounds — darken for text uses,
     same fix NFT applies site-wide. */
  --cyan-bright: #0891b2;
  --fusion: #b45309;
  --fusion-text: #9a4d10;
  --fusion-soft: rgba(186, 117, 23, 0.08);
  --fusion-line: rgba(186, 117, 23, 0.5);

  /* status tokens darkened the same way cyan-bright is, so pass/fail and
     outcome badges keep AA contrast on the porcelain ground. */
  --success: #0d9467;
  --success-text: #067a53;
  --danger: #d93636;
  --danger-text: #b91c1c;
  --warning: #b45309;
  --warning-text: #9a4d10;
}

html[data-theme="light"] .glass { box-shadow: 0 20px 50px -30px rgba(20, 40, 90, 0.4); }
html[data-theme="light"] .topbar { box-shadow: 0 10px 34px -24px rgba(20, 40, 90, 0.5); }
html[data-theme="light"] .btn--ghost { box-shadow: 0 6px 20px -12px rgba(20, 40, 90, 0.35); }

/* ---------- 2. SELF-HOSTED FONTS ---------- */
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}

/* ---------- 3. RESET / BASE ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(circle at 15% -10%, rgba(37, 99, 235, 0.16), transparent 45%),
    radial-gradient(circle at 85% 0%, rgba(43, 217, 245, 0.1), transparent 40%),
    linear-gradient(180deg, var(--bg), var(--bg-2) 40%, var(--bg));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
  overflow-x: clip;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.035), transparent 55%);
  z-index: 0;
}
html[data-theme="light"] body::before { display: none; }

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--font-mono); }
::selection { background: rgba(43, 217, 245, 0.3); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------------- */
/* Layout shells                                                          */
/* ---------------------------------------------------------------------- */

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 16px clamp(20px, 4vw, 48px);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  display: grid;
  place-items: center;
  box-shadow: var(--glow-blue);
  flex: none;
}
.brand__mark svg { width: 18px; height: 18px; }

.brand__name { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name b { font-weight: 700; letter-spacing: -0.01em; }
.brand__name span { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); font-weight: 500; letter-spacing: 0.06em; margin-top: 2px; }

.nav-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-dim);
  transition: border-color 0.25s, color 0.25s, transform 0.25s;
  flex: none;
}
.theme-toggle:hover { border-color: var(--cyan); color: var(--cyan-bright); transform: rotate(-15deg); }
.theme-toggle svg { width: 17px; height: 17px; }
.theme-toggle .sun { display: none; }
html[data-theme="light"] .theme-toggle .sun { display: block; }
html[data-theme="light"] .theme-toggle .moon { display: none; }

.pill-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 6px 13px 6px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
}
.pill-status__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.03);
  flex: none;
}
.pill-status.is-ready { color: var(--success-text); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.pill-status.is-ready .pill-status__dot { background: var(--success); box-shadow: 0 0 10px 1px rgba(52, 211, 153, 0.7); }
.pill-status.is-missing { color: var(--warning-text); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.pill-status.is-missing .pill-status__dot { background: var(--warning); box-shadow: 0 0 10px 1px rgba(251, 191, 36, 0.6); }
.pill-status.is-mock { color: var(--cyan-bright); border-color: rgba(43, 217, 245, 0.35); background: rgba(43, 217, 245, 0.08); }
.pill-status.is-mock .pill-status__dot { background: var(--cyan); box-shadow: 0 0 10px 1px rgba(43, 217, 245, 0.6); }

main {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(20px, 4vw, 48px) 64px;
}

/* ---------------------------------------------------------------------- */
/* Banner / toast                                                         */
/* ---------------------------------------------------------------------- */

.banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.1), rgba(251, 191, 36, 0.04));
  color: var(--warning-text);
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.banner b { color: var(--text); }
.banner a { color: var(--cyan-bright); text-decoration: underline; text-underline-offset: 2px; }
.banner.is-error {
  border-color: rgba(251, 106, 106, 0.32);
  background: linear-gradient(180deg, rgba(251, 106, 106, 0.12), rgba(251, 106, 106, 0.04));
  color: var(--danger-text);
}
.banner.is-info {
  border-color: rgba(77, 127, 255, 0.3);
  background: linear-gradient(180deg, rgba(77, 127, 255, 0.12), rgba(77, 127, 255, 0.04));
  color: #cfe0ff;
}
.banner__icon { flex-shrink: 0; opacity: 0.9; }
.banner__actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------------------------------------------------------------------- */
/* Hero                                                                    */
/* ---------------------------------------------------------------------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan-bright);
  padding: 7px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 13px; height: 13px; border-radius: 50%; flex: none;
  border: 1px solid color-mix(in srgb, var(--cyan) 60%, transparent);
  background: radial-gradient(circle, var(--cyan) 0 2.2px, transparent 2.8px);
}

.hero { padding: 28px 0 36px; }
.hero h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
  background: linear-gradient(110deg, var(--blue-bright) 0%, #8ab4ff 35%, var(--cyan-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--text-dim);
  font-size: 15.5px;
  max-width: 660px;
  line-height: 1.65;
  margin: 0;
}
.hero p code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 0.92em;
  color: var(--cyan-bright);
}
.hero-note {
  margin-top: 14px;
  color: var(--text-faint);
  font-size: 13px;
  line-height: 1.6;
  max-width: 660px;
}
.hero-note b { color: var(--text-dim); font-weight: 600; }

/* ---------------------------------------------------------------------- */
/* Glass cards                                                            */
/* ---------------------------------------------------------------------- */

.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.7);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 8px;
}

.profile-card {
  position: relative;
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
  overflow: hidden;
}
.profile-card::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(140deg, rgba(77, 127, 255, 0.5), transparent 40%, transparent 60%, rgba(43, 217, 245, 0.35));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.35s var(--ease);
  pointer-events: none;
}
.profile-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, 0.7), var(--glow-blue);
}
.profile-card:hover::after { opacity: 1; }

.profile-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.profile-card__avatar {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 16px;
  background: linear-gradient(150deg, rgba(77, 127, 255, 0.35), rgba(43, 217, 245, 0.22));
  color: #fff;
  border: 1px solid var(--border-strong);
  flex: none;
}
.profile-card__name { font-family: var(--font-head); font-size: 16.5px; font-weight: 650; margin: 0 0 2px; }
.profile-card__meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-dim);
  background: var(--surface-2);
  white-space: nowrap;
}
.tag.tag--ptp { color: var(--success-text); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.tag.tag--negotiation { color: var(--cyan-bright); border-color: rgba(43, 217, 245, 0.35); background: rgba(43, 217, 245, 0.08); }
.tag.tag--dispute { color: var(--danger-text); border-color: rgba(251, 106, 106, 0.35); background: rgba(251, 106, 106, 0.08); }
.tag.tag--handoff { color: var(--blue-bright); border-color: rgba(77, 127, 255, 0.35); background: rgba(77, 127, 255, 0.08); }
.tag.tag--part { color: var(--cyan-bright); border-color: rgba(37, 99, 235, 0.3); background: rgba(37, 99, 235, 0.08); }

.profile-card__hint {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
  margin: 0;
}

.profile-card__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  font-size: 12px;
  color: var(--text-dim);
  padding: 12px 0;
  border-top: 1px dashed var(--border);
}
.profile-card__facts div b { color: var(--text); font-weight: 600; }

details.json-view { margin-top: -4px; }
details.json-view > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
details.json-view > summary::-webkit-details-marker { display: none; }
details.json-view > summary::before {
  content: "▸";
  font-size: 10px;
  transition: transform 0.2s var(--ease);
  color: var(--text-faint);
}
details.json-view[open] > summary::before { transform: rotate(90deg); }
details.json-view pre {
  margin: 8px 0 0;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-dim);
  overflow-x: auto;
  max-height: 220px;
}
html[data-theme="light"] details.json-view pre { background: rgba(10, 22, 50, 0.05); }

.profile-card__cta {
  margin-top: auto;
  display: flex;
  gap: 8px;
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */

.btn {
  appearance: none;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 11px 18px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), opacity 0.2s;
  white-space: nowrap;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); border-color: var(--cyan); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn--primary {
  background: linear-gradient(120deg, var(--blue-deep), var(--blue-bright));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 30px -10px rgba(37, 99, 235, 0.7);
}
.btn--primary:hover { box-shadow: 0 16px 40px -10px rgba(37, 99, 235, 0.85), var(--glow-blue); }

.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-dim); backdrop-filter: blur(10px); }
.btn--ghost:hover { color: var(--text); background: var(--surface-2); }

.btn--danger { background: rgba(251, 106, 106, 0.12); border-color: rgba(251, 106, 106, 0.4); color: var(--danger-text); }
.btn--danger:hover { background: rgba(251, 106, 106, 0.2); border-color: rgba(251, 106, 106, 0.6); }

.btn:disabled,
.btn:disabled:hover {
  opacity: 0.4;
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text-faint);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

.btn--sm { padding: 8px 14px; font-size: 12.5px; }
.btn--icon { width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 16px; }
.btn--block { width: 100%; }

/* ---------------------------------------------------------------------- */
/* Footer note                                                            */
/* ---------------------------------------------------------------------- */
.foot-note {
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  margin-top: 40px;
}

/* ==========================================================================
   Call screen
   ========================================================================== */

.call-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: stretch;
  min-height: 66vh;
}
@media (max-width: 980px) {
  .call-layout { grid-template-columns: 1fr; gap: 16px; }
  /* orb stays the hero: it's mid-DOM (transcript, orb, state) but should
     render first on a stacked mobile layout. */
  .orb-col { order: -1; }
}

.panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.panel__title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* transcript */
.transcript {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  max-height: 58vh;
}
@media (max-width: 980px) { .transcript { max-height: 42vh; } }
.bubble {
  max-width: 92%;
  padding: 10px 13px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.5;
  animation: bubble-in 0.35s var(--ease);
  position: relative;
  word-break: break-word;
}
@keyframes bubble-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.bubble--agent {
  align-self: flex-start;
  background: linear-gradient(160deg, rgba(77, 127, 255, 0.18), rgba(77, 127, 255, 0.06));
  border: 1px solid rgba(77, 127, 255, 0.28);
  border-bottom-left-radius: 4px;
}
.bubble--customer {
  align-self: flex-end;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-bottom-right-radius: 4px;
  color: var(--text-dim);
}
.bubble--customer.is-partial { opacity: 0.55; font-style: italic; }
.bubble__meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.bubble--system {
  align-self: center;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  background: none;
  border: none;
  padding: 2px 0;
  text-align: center;
  max-width: 100%;
}

/* center orb column */
.orb-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 28px 18px;
  text-align: center;
  overflow: hidden;
}
.orb-col::before {
  content: "";
  position: absolute;
  inset: 10%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(50% 50% at 50% 50%, rgba(37, 99, 235, 0.22), rgba(43, 217, 245, 0.12) 55%, transparent 78%);
  filter: blur(50px);
  pointer-events: none;
}

/* live-call recording indicator — the one deliberate use of the fusion
   accent, reserved for exactly this "activation moment". */
.live-badge {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  color: var(--fusion-text);
  border: 1px solid var(--fusion-line);
  background: var(--fusion-soft);
}
.live-badge__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fusion);
  box-shadow: 0 0 8px var(--fusion-line);
  animation: livePulse 2s infinite;
  flex: none;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 var(--fusion-line); }
  70% { box-shadow: 0 0 0 8px rgba(255, 138, 61, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 138, 61, 0); }
}

.orb-wrap {
  position: relative;
  width: 260px;
  height: 260px;
  display: grid;
  place-items: center;
}
.orb-wrap canvas { width: 100%; height: 100%; }
@media (max-width: 520px) {
  .orb-wrap { width: 200px; height: 200px; }
}

.orb-caption {
  font-family: var(--font-head);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0.01em;
  min-height: 18px;
}
.orb-caption .dots::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}
@keyframes dots {
  0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; }
}

.live-caption {
  min-height: 46px;
  max-width: 420px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
}

.call-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
}

/* right rail: state strip — reads as a technical HUD, mono throughout */
.state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  gap: 10px;
}
.state-row:last-child { border-bottom: none; }
.state-row__label { color: var(--text-faint); letter-spacing: 0.02em; }
.state-row__value { color: var(--text); font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-dim);
}
.chip__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* conversation-stage progression: cyan (early) -> blue (mid) -> success
   (wrap-up); handoff/ended stay neutral rather than borrowing fusion. */
.chip--OPENING, .chip--IDENTITY_CHECK { color: var(--cyan-bright); border-color: rgba(43, 217, 245, 0.35); background: rgba(43, 217, 245, 0.08); }
.chip--PURPOSE_STATED, .chip--DISCUSSION { color: var(--blue-bright); border-color: rgba(77, 127, 255, 0.35); background: rgba(77, 127, 255, 0.08); }
.chip--CONFIRMATION { color: var(--cyan-deep); border-color: rgba(8, 145, 178, 0.4); background: rgba(8, 145, 178, 0.1); }
html[data-theme="light"] .chip--CONFIRMATION { color: var(--cyan-bright); }
.chip--WRAP_UP { color: var(--success-text); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.chip--HANDOFF { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.chip--ENDED { color: var(--text-faint); }

.chip--pass { color: var(--success-text); border-color: rgba(52, 211, 153, 0.35); background: rgba(52, 211, 153, 0.08); }
.chip--abort { color: var(--danger-text); border-color: rgba(251, 106, 106, 0.4); background: rgba(251, 106, 106, 0.1); }

.captured-box {
  margin-top: 6px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border);
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
  line-height: 1.7;
}
html[data-theme="light"] .captured-box { background: rgba(10, 22, 50, 0.04); }
.captured-box .k { color: var(--text-faint); }
.captured-box .v { color: var(--cyan-bright); }
.captured-box .v.is-empty { color: var(--text-faint); }

/* mic level meter */
.mic-meter {
  width: 140px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-2);
  overflow: hidden;
}
.mic-meter__fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 0.06s linear;
}

/* ==========================================================================
   Summary screen
   ========================================================================== */

.summary-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 26px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.summary-hero__badge {
  width: 64px; height: 64px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  font-size: 26px;
  flex-shrink: 0;
  background: linear-gradient(150deg, rgba(77, 127, 255, 0.3), rgba(43, 217, 245, 0.18));
  border: 1px solid var(--border-strong);
}
.summary-hero__body h2 { margin: 0 0 4px; font-size: 21px; font-weight: 700; }
.summary-hero__body p { margin: 0; color: var(--text-dim); font-size: 13.5px; }
.summary-hero__actions { margin-left: auto; display: flex; gap: 10px; }

.disposition {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 8px;
}
/* positive outcomes: success green. neutral: blue/cyan. negative /
   needs-attention: danger red — a standard traffic-light read for a
   collections-call outcome, not a second brand accent. */
.disposition--promise_to_pay, .disposition--part_payment { color: #08241a; background: linear-gradient(120deg, #34d399, #2bd9f5); }
.disposition--callback { color: #04263a; background: linear-gradient(120deg, #67e8f9, #4d7fff); }
.disposition--dispute { color: #3a1414; background: linear-gradient(120deg, #fb6a6a, #ff9d9d); }
.disposition--human_handoff { color: #ffffff; background: linear-gradient(120deg, var(--blue-deep), var(--blue-bright)); }
.disposition--refusal { color: #3a1414; background: linear-gradient(120deg, #fbbf24, #fb6a6a); }
.disposition--distress { color: #3a1414; background: linear-gradient(120deg, #fbbf24, #fb7ab0); }
.disposition--wrong_number { color: #12141c; background: linear-gradient(120deg, #8b93a8, #c7cde6); }
.disposition--none { color: #12141c; background: linear-gradient(120deg, #6b7186, #9aa1b8); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card { padding: 16px 18px; }
.stat-card__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 8px;
  font-weight: 500;
}
.stat-card__value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.stat-card__value small { font-size: 13px; color: var(--text-dim); font-weight: 500; }

.next-action-card {
  padding: 20px 22px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.next-action-card__icon {
  width: 42px; height: 42px; border-radius: var(--radius-sm); flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #06222b;
  font-weight: 700;
}
.next-action-card h3 { margin: 0 0 3px; font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; }
.next-action-card p { margin: 0; font-size: 15.5px; font-weight: 550; color: var(--text); }

.section-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 14px;
}

.turn-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.turn-item { padding: 14px 16px; }
.turn-item__head {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.turn-item__idx {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-faint);
  width: 26px;
  flex: none;
}
.turn-item__text { flex: 1; min-width: 0; font-size: 13.5px; }
.turn-item__customer { color: var(--text-dim); }
.turn-item__agent { color: var(--text); }
.turn-item__json {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-dim);
  overflow-x: auto;
  white-space: pre;
}
html[data-theme="light"] .turn-item__json { background: rgba(10, 22, 50, 0.05); }
.turn-item.is-open .turn-item__json { display: block; }
.turn-item.is-open .turn-item__chevron { transform: rotate(90deg); }
.turn-item__chevron { color: var(--text-faint); transition: transform 0.2s var(--ease); font-size: 11px; flex: none; }

.loading-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  color: var(--text-dim);
  font-size: 14px;
  gap: 10px;
}
.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  border-top-color: var(--cyan);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 700px) {
  .topbar { padding: 14px 18px; }
  .brand__name span { display: none; }
  main { padding: 16px 16px 48px; }
  .summary-hero { padding: 20px; }
  .summary-hero__actions { margin-left: 0; width: 100%; }
  .summary-hero__actions .btn { flex: 1; }
  .profile-card__facts { grid-template-columns: 1fr; }
}

/* ---------- ACCESSIBILITY ---------- */
@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;
  }
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; border-radius: 4px; }
