:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --bg-canvas: #F5F5F7;
  --bg-card: #FFFFFF;
  --bg-subtle: #ECEEF2;
  --bg-topbar: rgba(255, 255, 255, 0.86);
  --bg-dock: rgba(255, 255, 255, 0.90);

  --wa-bg: #EFEAE2;
  --wa-header: #F7F7F8;
  --wa-bubble-in: #FFFFFF;
  --wa-bubble-out: #E6F4EA;
  --wa-bubble-human: #E8F0FE;

  --ink: #111318;
  --body: #525866;
  --muted: #767D8C;
  --hairline: #E4E7EC;
  --hairline-strong: #CBD5E1;

  --btn-primary-bg: #111318;
  --btn-primary-fg: #FFFFFF;
  --btn-primary-hover: #262A34;

  /* Live Halo state accent (strictly for dock, orb ring, and status indicators) */
  --state-color: #22D3EE;
  --state-rgb: 34, 211, 238;
  --amber: #D97706;

  --shadow-sm: 0 2px 10px rgba(17, 19, 24, 0.04);
  --shadow-card: 0 14px 36px rgba(17, 19, 24, 0.07);
  --shadow-dock: 0 20px 52px rgba(17, 19, 24, 0.14);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

html[data-theme="dark"] {
  --bg-canvas: #0A0B10;
  --bg-card: #131622;
  --bg-subtle: #1B1F2E;
  --bg-topbar: rgba(10, 11, 16, 0.86);
  --bg-dock: rgba(13, 16, 25, 0.92);

  --wa-bg: #0E131D;
  --wa-header: #171B29;
  --wa-bubble-in: #1B2132;
  --wa-bubble-out: #142B24;
  --wa-bubble-human: #18233A;

  --ink: #F5F5F7;
  --body: #A1A7B5;
  --muted: #7C8394;
  --hairline: rgba(255, 255, 255, 0.10);
  --hairline-strong: rgba(255, 255, 255, 0.20);

  --btn-primary-bg: #F5F5F7;
  --btn-primary-fg: #0A0B10;
  --btn-primary-hover: #E2E4E9;
  --amber: #F59E0B;

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 18px 44px rgba(0, 0, 0, 0.42);
  --shadow-dock: 0 22px 58px rgba(0, 0, 0, 0.56);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.22s ease, color 0.22s ease;
}

#abyssal-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.25rem;
  background: var(--bg-topbar);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 32px;
  padding: 0 0.72rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--bg-card);
  color: var(--body);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.back-link:hover {
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.brand img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-left: 0.2rem;
}

.scenario-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
  padding: 0.24rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--hairline);
}

.scenario-btn {
  height: 30px;
  padding: 0 0.82rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.scenario-btn:hover { color: var(--ink); }

.scenario-btn.is-active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.top-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--bg-card);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.top-btn:hover {
  background: var(--bg-subtle);
  border-color: var(--hairline-strong);
}

.top-btn.is-phone-active,
.top-btn.is-audio-on,
.top-btn[aria-expanded="true"] {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  border-color: var(--btn-primary-bg);
}

.live-dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state-color);
  flex-shrink: 0;
}

/* ============================================================
   3-STEP GUIDED TOUR BAR
   ============================================================ */
.demo-tour-bar {
  position: relative;
  z-index: 120;
  max-width: 1220px;
  margin: 0.85rem auto 0;
  padding: 0.58rem 0.95rem;
  width: calc(100% - 2rem);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.demo-tour-bar.is-hidden { display: none; }

.tour-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.tour-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--ink);
  white-space: nowrap;
}

.tour-steps {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

.tour-step-pill {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-card);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all 0.15s ease;
}

.tour-step-pill.is-active {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
}

.tour-step-pill.is-done {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--bg-subtle);
}

.tour-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
}

.tour-dismiss-btn {
  height: 30px;
  padding: 0 0.78rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: var(--bg-subtle);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.tour-dismiss-btn:hover {
  border-color: var(--hairline-strong);
  color: var(--ink);
}

.is-tour-highlight {
  box-shadow: 0 0 0 2px var(--ink), var(--shadow-card) !important;
}

/* ============================================================
   BALANCED TWO-COLUMN EDITORIAL WORKSPACE
   ============================================================ */
.workspace {
  position: relative;
  z-index: 10;
  max-width: 1220px;
  width: calc(100% - 2rem);
  margin: 1rem auto 0;
  padding-bottom: 185px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.workspace-col {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--hairline);
  background: var(--bg-card);
}

.col-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.col-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.col-kicker {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.role-badge {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  padding: 0.16rem 0.56rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--hairline);
  color: var(--body);
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.role-badge.is-nausica {
  background: var(--ink);
  color: var(--bg-card);
  border-color: var(--ink);
}

.col-meta-pill {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--hairline);
  color: var(--body);
  white-space: nowrap;
}

/* LEFT COLUMN: AUTHENTIC WHATSAPP CHAT + VOICE SHELL */
.wa-shell {
  display: flex;
  flex-direction: column;
  background: var(--wa-bg);
}

.wa-shell-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.72rem 1rem;
  background: var(--wa-header);
  border-bottom: 1px solid var(--hairline);
}

.wa-contact-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.wa-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg-card);
  font-size: 0.76rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.wa-contact-name {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.wa-contact-sub {
  font-size: 0.73rem;
  color: var(--muted);
}

.wa-live-state-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.24rem 0.64rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--hairline-strong);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.state-dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--state-color);
  flex-shrink: 0;
}

.wa-thread-area {
  padding: 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 340px;
}

.wa-bubble {
  max-width: 92%;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-size: 0.84rem;
  line-height: 1.44;
  box-shadow: var(--shadow-sm);
}

.wa-bubble.is-client {
  align-self: flex-start;
  background: var(--wa-bubble-in);
  border: 1px solid var(--hairline);
  border-top-left-radius: 4px;
  color: var(--ink);
}

.wa-bubble-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.3rem;
  margin-top: 0.28rem;
  font-size: 0.66rem;
  color: var(--muted);
}

.wa-ticks {
  color: #2563EB;
  display: inline-flex;
  align-items: center;
}

/* VOICE NOTE BOXES */
.voice-box {
  padding: 0.78rem 0.88rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
}

.voice-box.is-nausica-reply {
  border-color: var(--hairline-strong);
}

.voice-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.voice-role-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
}

.transcript-toggle-btn {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.transcript-toggle-btn:hover { color: var(--ink); }

.voice-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.play-btn .ico-pause { display: none; }
.play-btn.is-playing .ico-play { display: none; }
.play-btn.is-playing .ico-pause { display: block; }

.stop-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--bg-subtle);
  color: var(--body);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.waveform {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 2.5px;
  height: 26px;
}

.wave-bar {
  flex: 1;
  min-width: 2px;
  border-radius: 99px;
  background: var(--hairline-strong);
  transition: background 0.14s ease;
}

.wave-bar.is-lit { background: var(--ink); }

.mono-dim {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--muted);
  white-space: nowrap;
}

.seek-row { display: flex; align-items: center; }

.audio-seek {
  width: 100%;
  height: 4px;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 999px;
  background: var(--hairline);
  accent-color: var(--ink);
  cursor: pointer;
}

.transcript-box {
  font-size: 0.79rem;
  line-height: 1.44;
  color: var(--body);
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-canvas);
  border: 1px solid var(--hairline);
}

.transcript-box.is-collapsed { display: none; }

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.48rem;
  max-height: 190px;
  overflow-y: auto;
}

.chat-msg {
  padding: 0.56rem 0.76rem;
  border-radius: 12px;
  background: var(--wa-bubble-in);
  border: 1px solid var(--hairline);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink);
}

.chat-msg.is-sent {
  align-self: flex-end;
  max-width: 92%;
  background: var(--wa-bubble-out);
}

.chat-msg.is-human {
  align-self: flex-end;
  max-width: 92%;
  background: var(--wa-bubble-human);
}

.chat-msg.is-handoff-card {
  background: var(--bg-card);
  border: 1px solid var(--hairline-strong);
}

.handoff-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

/* COMPOSER AT BOTTOM OF WHATSAPP SHELL */
.wa-composer {
  padding: 0.78rem 1rem 0.92rem;
  background: var(--bg-card);
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field-lbl {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.composer-row {
  display: flex;
  gap: 0.42rem;
  align-items: center;
}

.text-input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 0.72rem;
  border-radius: 10px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  outline: none;
}

.text-input:focus { border-color: var(--ink); }

.btn-compact {
  height: 36px;
  padding: 0 0.78rem !important;
}

.btn-amber {
  height: 36px;
  padding: 0 0.78rem;
  border-radius: 10px;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.btn-amber:hover { background: rgba(245, 158, 11, 0.20); }

/* RIGHT COLUMN: QUOTE / ACTION CARD */
.quote-body {
  padding: 1rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.mode-banner {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 0.78rem;
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  border: 1px solid var(--hairline);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.handoff-banner {
  padding: 0.55rem 0.78rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--hairline-strong);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--hairline);
}

.quote-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.quote-table th,
.quote-table td {
  padding: 0.5rem 0.62rem;
  text-align: left;
  border-bottom: 1px solid var(--hairline);
}

.quote-table th {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--bg-canvas);
}

.quote-table tfoot td {
  border-bottom: 0;
  background: var(--bg-canvas);
}

.draft-section-label {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.draft-box {
  padding: 0.78rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--hairline);
  font-size: 0.83rem;
  line-height: 1.48;
  white-space: pre-line;
  color: var(--ink);
}

.draft-textarea {
  width: 100%;
  min-height: 104px;
  padding: 0.72rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--ink);
  background: var(--bg-card);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.83rem;
  line-height: 1.48;
  resize: vertical;
  outline: none;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-primary {
  height: 40px;
  padding: 0 1.15rem;
  border-radius: 999px;
  border: 0;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary:hover { background: var(--btn-primary-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-card);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary:hover { background: var(--bg-subtle); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

.auto-dispatch-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.34rem 0.74rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
}

.status-feedback {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--body);
  min-height: 1.1em;
}

/* ============================================================
   SECONDARY OVERLAY PANELS (#mod-phone & #mod-telemetry)
   ============================================================ */
.overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 230;
  background: rgba(10, 11, 16, 0.52);
  backdrop-filter: blur(6px);
  display: none;
}

.overlay-backdrop.is-open { display: block; }

.overlay-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 240;
  width: min(560px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 3rem);
  background: var(--bg-card);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-dock);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.overlay-panel.is-open { display: flex; }

.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--hairline);
}

.overlay-close-btn {
  height: 32px;
  padding: 0 0.82rem;
  border-radius: 999px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-subtle);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.overlay-body {
  padding: 1rem 1.15rem 1.15rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.sim-disclaimer {
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  background: var(--bg-canvas);
  border: 1px dashed var(--hairline-strong);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
}

.contextual-note {
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--bg-subtle);
  border: 1px solid var(--hairline-strong);
  font-size: 0.78rem;
  color: var(--ink);
}

.call-status-card {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--hairline);
}

.call-status-card.is-active-call {
  border-color: var(--ink);
}

.call-status-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.call-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--state-color);
  flex-shrink: 0;
}

.call-status-sub {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--body);
}

.call-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 300px;
  overflow-y: auto;
}

.turn-card {
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.turn-card.is-playing {
  border-color: var(--ink);
  background: var(--bg-subtle);
}

.turn-card.is-done { opacity: 0.82; }

.turn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.turn-meta { display: flex; align-items: center; gap: 0.45rem; }

.turn-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--muted);
}

.speaker-badge {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  padding: 0.12rem 0.48rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  color: var(--ink);
}

.turn-time {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--muted);
}

.turn-text {
  font-size: 0.79rem;
  line-height: 1.42;
  color: var(--body);
}

.turn-player-row {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.turn-mini-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--hairline-strong);
  background: var(--bg-card);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}

.turn-mini-btn .ico-pause { display: none; }
.turn-mini-btn.is-playing .ico-play { display: none; }
.turn-mini-btn.is-playing .ico-pause { display: block; }

/* TELEMETRY & PRIVACY */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.telemetry-stat {
  padding: 0.7rem 0.82rem;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.telemetry-val {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--ink);
}

.credits-card, .pii-card {
  padding: 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  border: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.credits-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.credits-numbers {
  font-size: 1.05rem;
  font-weight: 700;
}

.credits-bar-track {
  height: 7px;
  border-radius: 999px;
  background: var(--hairline);
  overflow: hidden;
}

.credits-bar-fill {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
  transition: width 0.25s ease;
}

.rule-summary {
  font-size: 0.78rem;
  color: var(--body);
}

.pii-output {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.45;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  color: var(--body);
}

.pii-token {
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--ink);
  font-weight: 700;
}

/* TOAST */
.halo-toast {
  position: fixed;
  top: 76px;
  right: 18px;
  z-index: 280;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-dock);
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.halo-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================
   FIXED BOTTOM SIGNATURE HALO DOCK WITH WEBGL PORTRAIT
   ============================================================ */
.halo-dock {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  width: min(860px, calc(100vw - 24px));
  height: 76px;
  padding: 0 1rem;
  border-radius: 22px;
  background: var(--bg-dock);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid rgba(var(--state-rgb), 0.36);
  box-shadow: var(--shadow-dock);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.85rem;
}

.dock-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  min-width: 0;
}

.dock-mode-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  height: 52px;
  padding: 0 0.82rem;
  border-radius: 14px;
  border: 1px solid var(--hairline);
  background: var(--bg-subtle);
  color: var(--body);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  transition: all 0.18s ease;
}

.dock-mode-btn:hover { border-color: var(--hairline-strong); color: var(--ink); }

.dock-mode-btn.is-active {
  background: rgba(var(--btn-rgb), 0.14);
  border-color: rgb(var(--btn-rgb));
  color: var(--ink);
  box-shadow: 0 0 0 1px rgba(var(--btn-rgb), 0.25);
}

.dock-btn-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-dot { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--btn-rgb)); flex-shrink: 0; }
.dock-btn-sub { font-size: 0.68rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.halo-orb-slot {
  position: relative;
  width: 228px;
  height: 76px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.halo-orb-housing {
  position: relative;
  width: 228px;
  height: 228px;
  margin-bottom: -4px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #0B1626 0%, #050B14 72%, #02050A 100%);
  border: 1.5px solid rgba(var(--state-rgb), 0.55);
  box-shadow:
    0 -8px 36px rgba(var(--state-rgb), 0.22),
    0 18px 42px rgba(2, 6, 14, 0.42),
    inset 0 0 26px rgba(var(--state-rgb), 0.14);
  display: grid;
  place-items: center;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.halo-orb-housing.is-speaking {
  box-shadow:
    0 -10px 44px rgba(var(--state-rgb), 0.45),
    0 18px 46px rgba(2, 6, 14, 0.48),
    inset 0 0 32px rgba(var(--state-rgb), 0.28);
}

#halo-wave-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

.halo-inner-aperture {
  position: relative;
  z-index: 2;
  width: 158px;
  height: 158px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 44%, #091524 0%, #040912 68%, #020408 100%);
  border: 1px solid rgba(var(--state-rgb), 0.44);
  overflow: hidden;
  pointer-events: none;
}

.halo-avatar-mount {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--state-color);
}

.halo-avatar-mount canvas { width: 100%; height: 100%; display: block; }
.halo-emblem-wrap { display: grid; place-items: center; color: var(--state-color); }

.halo-arc-pill {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 0.36rem;
  padding: 0.22rem 0.7rem;
  border-radius: 999px;
  background: rgba(6, 12, 22, 0.92);
  border: 1px solid rgba(var(--state-rgb), 0.62);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--state-color);
  white-space: nowrap;
  pointer-events: none;
}

.halo-arc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--state-color); }

.halo-dock-caption {
  position: fixed;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 145;
  font-size: 0.7rem;
  color: var(--muted);
  white-space: nowrap;
  pointer-events: none;
  max-width: 92vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1020px) {
  .workspace {
    grid-template-columns: 1fr;
    padding-bottom: 220px;
  }
  .brand-tag { display: none; }
  .halo-dock {
    width: calc(100vw - 20px);
    max-width: 680px;
    bottom: 14px;
    height: 68px;
    padding: 0 0.65rem;
    gap: 0.45rem;
  }
  .halo-orb-slot { width: 170px; height: 68px; }
  .halo-orb-housing { width: 170px; height: 170px; margin-bottom: -6px; }
  .halo-inner-aperture { width: 118px; height: 118px; }
  .dock-mode-btn { height: 46px; padding: 0 0.55rem; border-radius: 11px; }
  .dock-btn-top { font-size: 0.74rem; gap: 0.28rem; }
  .dock-btn-sub { display: none; }
  .halo-dock-caption { display: none; }
}

@media (max-width: 640px) {
  .topbar { padding: 0.55rem 0.75rem; gap: 0.5rem; }
  .scenario-tabs {
    width: 100%;
    border-radius: 14px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scenario-btn {
    text-align: center;
    padding: 0 0.4rem;
    font-size: 0.72rem;
    border-radius: 10px;
  }
  .topbar-actions { width: 100%; flex-wrap: wrap; gap: 0.36rem; }
  .top-btn { height: 31px; padding: 0 0.62rem; font-size: 0.73rem; }
  .demo-tour-bar { width: calc(100% - 1.2rem); margin: 0.65rem auto 0; padding: 0.55rem 0.75rem; }
  .workspace { width: calc(100% - 1.2rem); }
  .composer-row { flex-wrap: wrap; }
  .composer-row .text-input { flex: 1 1 100%; }
  .composer-row .btn-secondary,
  .composer-row .btn-amber { flex: 1 1 auto; }
  .halo-dock {
    width: calc(100vw - 14px);
    bottom: 10px;
    height: 70px;
    padding: 0 0.4rem;
    gap: 0.3rem;
    border-radius: 16px;
  }
  .dock-side {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.24rem;
    min-width: 0;
  }
  .dock-mode-btn {
    height: 26px;
    padding: 0 0.48rem;
    border-radius: 8px;
  }
  .dock-btn-top { font-size: 0.69rem; gap: 0.25rem; }
  .halo-orb-slot { width: 112px; height: 70px; }
  .halo-orb-housing { width: 112px; height: 112px; margin-bottom: -4px; }
  .halo-inner-aperture { width: 78px; height: 78px; }
  .halo-arc-pill { font-size: 0.54rem; padding: 0.14rem 0.42rem; bottom: 4px; }
}
