:root {
  color-scheme: dark;
  --bg: #070b14;
  --panel: rgba(16, 22, 36, 0.84);
  --panel-strong: rgba(21, 30, 49, 0.96);
  --line: rgba(130, 150, 182, 0.18);
  --text: #eef3ff;
  --muted: #98a6c7;
  --accent: #7f9dff;
  --accent-strong: #a9bcff;
  --good: #66f0b0;
  --warn: #ffd166;
  --danger: #ff6d7d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
  --radius: 24px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at top, rgba(106, 132, 255, 0.18), transparent 32%), linear-gradient(180deg, #090d17 0%, #05070d 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
body.embedded-mode {
  padding-top: 0;
  background: linear-gradient(180deg, #05070d 0%, #04060b 100%);
}
button, input { font: inherit; }

.shell {
  width: min(100%, 32rem);
  margin: 0 auto;
  min-height: 100dvh;
  padding: 1rem 1rem 1.5rem;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr auto;
  gap: 1rem;
}

.topbar, .section-head, .meter-labels, .chips, .controls { display: flex; align-items: center; }
.controls { flex-wrap: wrap; }
.topbar, .section-head { justify-content: space-between; }
.eyebrow { margin: 0 0 0.18rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.72rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 7vw, 2.45rem); letter-spacing: -0.04em; }
h2 { font-size: 0.95rem; color: var(--muted); font-weight: 600; }

.hero, .meter-card, .transcript-card, .settings {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero { padding: 1.4rem 1rem 1rem; }
.halo-wrap { display: grid; place-items: center; padding: 0.4rem 0 1.2rem; }
.halo {
  width: min(72vw, 17rem);
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background: radial-gradient(circle, rgba(127, 157, 255, 0.2) 0%, rgba(127, 157, 255, 0.05) 52%, transparent 72%);
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}
.halo::before, .halo::after {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  border: 1px solid rgba(169, 188, 255, 0.22);
}
.halo::after { inset: -3%; opacity: 0.44; }
.halo-core {
  width: 56%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-align: center;
  gap: 0.25rem;
  padding: 1rem;
  background: radial-gradient(circle, rgba(18, 27, 47, 0.98), rgba(10, 15, 25, 0.98));
  border: 1px solid rgba(255,255,255,0.08);
}
.halo strong { font-size: 1.05rem; line-height: 1.15; letter-spacing: -0.02em; }
.halo span { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.12em; }
.state-connecting { box-shadow: 0 0 0 10px rgba(127, 157, 255, 0.08), 0 0 48px rgba(127, 157, 255, 0.28); animation: breathe 1.4s ease-in-out infinite; }
.state-live { box-shadow: 0 0 0 12px rgba(102, 240, 176, 0.08), 0 0 48px rgba(102, 240, 176, 0.24); }
.state-speaking-remote { transform: scale(1.03); box-shadow: 0 0 0 14px rgba(127, 157, 255, 0.11), 0 0 56px rgba(127, 157, 255, 0.36); }
.state-speaking-local { transform: scale(1.03); box-shadow: 0 0 0 14px rgba(102, 240, 176, 0.12), 0 0 56px rgba(102, 240, 176, 0.36); }
.state-blocked { box-shadow: 0 0 0 12px rgba(255, 109, 125, 0.1), 0 0 52px rgba(255, 109, 125, 0.28); }

.chips { justify-content: center; flex-wrap: wrap; gap: 0.5rem; }
.chip { padding: 0.5rem 0.72rem; border-radius: 999px; font-size: 0.78rem; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); color: var(--text); }
.chip.subtle { color: var(--muted); }

.controls { gap: 0.75rem; }
.talk-card { display: grid; gap: 0.8rem; align-items: center; }
.mode-card, .processing-card, .voice-card { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); border-radius: 18px; padding: 0.8rem; display: grid; gap: 0.7rem; }
.mode-head, .processing-head { display: grid; gap: 0.55rem; }
.mode-head h3, .processing-head h3 { margin: 0; font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.mode-hint { font-size: 0.84rem; color: var(--muted); }
.mode-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; }
.processing-head { grid-template-columns: 1fr auto; align-items: center; }
.processing-grid { display: grid; gap: 0.55rem; grid-template-columns: 1fr 1fr; }
.voice-grid { grid-template-columns: 1fr 1fr; }
.processing-grid label { display: grid; gap: 0.35rem; color: var(--muted); font-size: 0.82rem; }
.processing-grid select { min-height: 2.35rem; border-radius: 12px; padding: 0 0.6rem; background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid rgba(255,255,255,0.08); }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.seg { min-height: 2.3rem; border-radius: 12px; background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid rgba(255,255,255,0.08); font-size: 0.84rem; }
.seg.active { background: linear-gradient(180deg, rgba(169, 188, 255, 0.9), rgba(127, 157, 255, 0.9)); color: #050913; border-color: rgba(169,188,255,0.85); font-weight: 700; }
button {
  border: 0;
  border-radius: 18px;
  min-height: 3.35rem;
  padding: 0 1rem;
  cursor: pointer;
  transition: transform 120ms ease, opacity 120ms ease, background 120ms ease;
}
button:active { transform: scale(0.98); }
button:disabled { opacity: 0.45; cursor: default; }
.primary { flex: 1; color: #04070f; font-weight: 700; background: linear-gradient(180deg, var(--accent-strong), var(--accent)); }
.secondary, .ghost { background: var(--panel-strong); color: var(--text); border: 1px solid rgba(255,255,255,0.08); }
.secondary { min-width: 7.5rem; }
.ghost { min-height: 2.4rem; padding: 0 0.9rem; }
.small { min-height: 2rem; padding: 0 0.7rem; font-size: 0.82rem; }
.talk-button, .interrupt-button { width: 100%; min-height: 4.2rem; border-radius: 22px; background: var(--panel); color: var(--text); border: 1px solid rgba(255,255,255,0.08); box-shadow: var(--shadow); }
.talk-button { display: grid; place-items: center; padding: 1rem; gap: 0.18rem; min-height: 8.5rem; border: 1px solid rgba(127, 157, 255, 0.22); background: radial-gradient(circle at top, rgba(127, 157, 255, 0.18), rgba(16, 22, 36, 0.92)); }
.talk-button.active { transform: scale(0.985); box-shadow: 0 0 0 10px rgba(102, 240, 176, 0.12), 0 0 48px rgba(102, 240, 176, 0.22); border-color: rgba(102, 240, 176, 0.5); }
.talk-title { font-size: 1.1rem; font-weight: 700; }
.talk-hint { font-size: 0.83rem; color: var(--muted); }
.interrupt-button { min-height: 3.3rem; border-color: rgba(255, 109, 125, 0.28); }
.interrupt-button.live { color: #14040a; font-weight: 700; background: linear-gradient(180deg, #ff97a2, var(--danger)); }

.meter-card, .transcript-card, .settings { padding: 1rem; }
.meter-labels { justify-content: space-between; margin-bottom: 0.7rem; color: var(--muted); font-size: 0.84rem; }
.meters { display: grid; gap: 0.65rem; }
.meter { height: 0.68rem; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,0.08); }
.meter-fill { height: 100%; width: 3%; min-width: 3%; border-radius: inherit; background: linear-gradient(90deg, rgba(102, 240, 176, 0.34), rgba(102, 240, 176, 1)); transition: width 90ms linear; }
.meter-fill.remote { background: linear-gradient(90deg, rgba(127, 157, 255, 0.34), rgba(127, 157, 255, 1)); }

.transcript-card { display: grid; grid-template-rows: auto 1fr; min-height: 13rem; }
.transcript-list { list-style: none; padding: 0; margin: 0.9rem 0 0; display: grid; gap: 0.7rem; align-content: start; }
.transcript-list li { padding: 0.75rem 0.9rem; border-radius: 18px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); }
.transcript-list .placeholder { color: var(--muted); }
.transcript-meta { display: flex; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.35rem; color: var(--muted); font-size: 0.73rem; text-transform: uppercase; letter-spacing: 0.12em; }
.transcript-text { font-size: 0.94rem; line-height: 1.4; }

.settings { display: grid; gap: 0.85rem; }
.hidden { display: none !important; }
.settings label { display: grid; gap: 0.42rem; color: var(--muted); font-size: 0.88rem; }
.settings input[type="url"], .settings input[type="text"], .settings input[type="password"] { width: 100%; min-height: 3rem; border-radius: 16px; padding: 0 0.9rem; background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid rgba(255,255,255,0.08); }
.checkbox-row { grid-template-columns: auto 1fr; align-items: center; gap: 0.75rem; }
.settings-note { color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--accent-strong); }

@keyframes breathe {
  0%, 100% { transform: scale(0.995); }
  50% { transform: scale(1.02); }
}

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


a.ghost, a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.realtime-shell {
  width: min(100%, 40rem);
}

.halo-wrap.compact {
  padding: 0.2rem 0 0.8rem;
}

.realtime-hero {
  padding-top: 1rem;
}

.warning-card {
  border-color: rgba(255, 209, 102, 0.28);
  background: linear-gradient(180deg, rgba(255, 209, 102, 0.08), rgba(16, 22, 36, 0.84));
}

.realtime-log {
  max-height: 22rem;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
}

.realtime-log-entry {
  padding: 0.7rem 0.8rem;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  white-space: pre-wrap;
}

/* Compact polish pass for control density */
.topbar-actions .ghost { min-height: 2.15rem; font-size: 0.78rem; }
.mode-actions .chip { padding: 0.42rem 0.58rem; font-size: 0.72rem; }
.processing-card, .voice-card, .mode-card { box-shadow: inset 0 1px 0 rgba(255,255,255,0.035); }
.talk-button .talk-title { font-size: 1.05rem; }
.warning-card .settings-note { color: #d9def2; }
@media (max-width: 390px) {
  .topbar-actions { gap: 6px; }
  .topbar-actions .ghost { padding: 0 0.55rem; }
  .processing-grid, .voice-grid { grid-template-columns: 1fr; }
}

/* Public Realtime console polish */
.realtime-shell {
  width: min(100%, 44rem);
}

.realtime-shell .halo-core strong {
  font-size: 1rem;
  letter-spacing: 0.08em;
}

.realtime-shell .talk-card {
  grid-template-columns: 1fr 1fr;
}

.realtime-shell .talk-button {
  grid-column: 1 / -1;
  min-height: 4.1rem;
}

.realtime-shell .talk-button .talk-title {
  font-size: 1.08rem;
}

.realtime-shell .mute-button.active {
  color: #071018;
  background: linear-gradient(135deg, #ffd166, #ff8fab);
  border-color: rgba(255,255,255,0.24);
  box-shadow: 0 0 22px rgba(255, 209, 102, 0.22);
}

.realtime-processing-card {
  background: linear-gradient(180deg, rgba(68, 212, 255, 0.08), rgba(16, 22, 36, 0.84));
}

.realtime-processing-card .chip {
  color: #b7ffd8;
  border-color: rgba(80, 255, 170, 0.24);
  background: rgba(80, 255, 170, 0.08);
}

.public-transcript-card {
  min-height: 18rem;
  background:
    radial-gradient(circle at top left, rgba(68, 212, 255, 0.11), transparent 34%),
    rgba(10, 15, 26, 0.82);
}

.realtime-log {
  max-height: 25rem;
  overflow: auto;
  font-family: inherit;
  font-size: 0.95rem;
  gap: 0.85rem;
  padding-right: 0.1rem;
}

.voice-row {
  display: flex;
}

.voice-row.from-user {
  justify-content: flex-end;
}

.voice-row.from-assistant,
.voice-row.from-system {
  justify-content: flex-start;
}

.voice-bubble {
  max-width: min(82%, 31rem);
  padding: 0.82rem 0.95rem;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 12px 30px rgba(0,0,0,0.18);
}

.from-user .voice-bubble {
  border-bottom-right-radius: 8px;
  background: linear-gradient(135deg, rgba(68, 212, 255, 0.22), rgba(82, 121, 255, 0.18));
}

.from-assistant .voice-bubble {
  border-bottom-left-radius: 8px;
  background: linear-gradient(135deg, rgba(126, 255, 188, 0.16), rgba(68, 212, 255, 0.10));
}

.from-system .voice-bubble {
  max-width: 92%;
  background: rgba(255,255,255,0.045);
  color: var(--muted);
}

.voice-meta {
  margin-bottom: 0.25rem;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.voice-text {
  color: var(--text);
  line-height: 1.45;
}

.about-card {
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
}

@media (max-width: 520px) {
  .realtime-shell .talk-card { grid-template-columns: 1fr; }
  .realtime-shell .talk-button { grid-column: auto; }
  .voice-bubble { max-width: 92%; }
}

.nav-pill {
  border-radius: 999px;
  padding: 0 1rem;
  min-height: 2.45rem;
}

.realtime-shell .halo-core {
  gap: 0;
}

.realtime-shell .halo-core span {
  font-size: 0.92rem;
}

/* Production visual system pass */
:root {
  --bg: #050816;
  --panel: rgba(13, 20, 36, 0.74);
  --panel-strong: rgba(18, 29, 52, 0.92);
  --line: rgba(156, 181, 255, 0.15);
  --text: #f5f8ff;
  --muted: #9aa8c8;
  --accent: #76a7ff;
  --accent-strong: #c2d5ff;
  --cyan: #64d8ff;
  --violet: #9b8cff;
  --good: #79f2b9;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --soft-shadow: 0 14px 42px rgba(0, 0, 0, 0.28);
  --radius: 28px;
}

html, body {
  background:
    radial-gradient(circle at 18% 0%, rgba(100, 216, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 88% 12%, rgba(155, 140, 255, 0.18), transparent 28rem),
    linear-gradient(180deg, #080d1d 0%, #040713 48%, #03050b 100%);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent 70%);
}

.shell {
  width: min(100%, 38rem);
  gap: 1.05rem;
  padding: 1.05rem 1rem 1.8rem;
}

.realtime-shell { width: min(100%, 43rem); }

.topbar {
  padding: 0.25rem 0.15rem 0.1rem;
}

.eyebrow {
  color: #7f8fb6;
  font-size: 0.68rem;
  letter-spacing: 0.19em;
  font-weight: 800;
}

h1 {
  font-size: clamp(2.1rem, 7vw, 3rem);
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h2, .mode-head h3, .processing-head h3 {
  color: #d6def5;
  font-weight: 760;
  letter-spacing: -0.015em;
}

.hero, .meter-card, .transcript-card, .settings, .mode-card, .processing-card, .voice-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.075), rgba(255,255,255,0.028)),
    var(--panel);
  border: 1px solid rgba(198, 214, 255, 0.13);
  box-shadow: var(--shadow);
}

.hero {
  padding: 1.25rem 1rem 1.1rem;
  overflow: hidden;
  position: relative;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -40% -10% auto;
  height: 13rem;
  background: radial-gradient(circle, rgba(100,216,255,0.17), transparent 64%);
  pointer-events: none;
}

.halo {
  width: min(64vw, 15.8rem);
  background:
    radial-gradient(circle at 50% 42%, rgba(121, 242, 185, 0.17), rgba(118, 167, 255, 0.08) 46%, transparent 70%);
  border-color: rgba(198, 214, 255, 0.14);
}

.halo-core {
  width: 54%;
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,0.10), transparent 40%),
    linear-gradient(180deg, rgba(18, 31, 59, 0.98), rgba(7, 12, 24, 0.98));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05), 0 18px 50px rgba(0,0,0,0.30);
}

.halo span {
  color: #c6d2ef;
  font-size: 0.78rem;
  font-weight: 850;
}

.chips { gap: 0.45rem; }
.chip {
  color: #dce5fb;
  background: rgba(255,255,255,0.065);
  border-color: rgba(198,214,255,0.13);
  font-weight: 650;
}
.chip.subtle { color: #aebbdd; }

.topbar-actions .ghost, .nav-pill {
  border-radius: 999px;
  min-height: 2.5rem;
  background: rgba(255,255,255,0.07);
  border-color: rgba(198,214,255,0.16);
  color: #eaf0ff;
  font-weight: 750;
}

.controls { gap: 0.6rem; }
.primary, .secondary, .ghost, .seg, select, input {
  border-radius: 16px;
}
.primary {
  background: linear-gradient(135deg, #dbe6ff, #79b7ff 54%, #8d86ff);
  box-shadow: 0 16px 42px rgba(118, 167, 255, 0.28);
}
.secondary, .ghost {
  background: rgba(255,255,255,0.06);
  border-color: rgba(198,214,255,0.14);
}

.talk-card { gap: 0.9rem; }
.mode-card, .processing-card, .voice-card {
  border-radius: 22px;
  padding: 0.95rem;
}
.mode-head, .processing-head { gap: 0.65rem; }
.processing-grid label { color: #aebbdd; font-weight: 650; }
.processing-grid select {
  min-height: 2.65rem;
  background: rgba(5, 9, 20, 0.74);
  border-color: rgba(198,214,255,0.15);
  color: #f5f8ff;
  font-weight: 650;
}

.segmented {
  padding: 0.28rem;
  border-radius: 18px;
  background: rgba(4, 8, 19, 0.48);
  border: 1px solid rgba(198,214,255,0.10);
}
.seg { border-radius: 14px; }
.seg.active {
  background: linear-gradient(135deg, #dbe6ff, #8ec6ff);
  box-shadow: 0 10px 28px rgba(118, 167, 255, 0.22);
}

.talk-button {
  min-height: 7.8rem;
  border-radius: 28px;
  border-color: rgba(118, 167, 255, 0.24);
  background:
    radial-gradient(circle at 50% 0%, rgba(100, 216, 255, 0.20), transparent 56%),
    linear-gradient(180deg, rgba(26, 42, 77, 0.82), rgba(11, 17, 32, 0.94));
}
.realtime-shell .talk-button { min-height: 4.5rem; }
.talk-title { font-size: 1.16rem; letter-spacing: -0.01em; }
.talk-hint { color: #aebbdd; }
.interrupt-button {
  border-radius: 18px;
  background: rgba(255, 109, 125, 0.08);
}

.meter-card, .transcript-card, .settings { padding: 1.05rem; }
.transcript-card { border-radius: 28px; }
.transcript-list li {
  border-radius: 18px;
  background: rgba(255,255,255,0.055);
  border-color: rgba(198,214,255,0.11);
}
.transcript-meta { color: #92a0c1; font-weight: 750; }
.transcript-text { color: #edf3ff; }

.realtime-processing-card, .public-transcript-card, .about-card {
  border-radius: 28px;
}
.public-transcript-card {
  min-height: 20rem;
}
.voice-bubble {
  border-radius: 24px;
  padding: 0.9rem 1rem;
  border-color: rgba(198,214,255,0.12);
}
.from-user .voice-bubble {
  background: linear-gradient(135deg, rgba(103, 180, 255, 0.28), rgba(128, 116, 255, 0.20));
}
.from-assistant .voice-bubble {
  background: linear-gradient(135deg, rgba(121, 242, 185, 0.18), rgba(100, 216, 255, 0.12));
}
.from-system .voice-bubble {
  background: rgba(255,255,255,0.055);
}
.voice-meta { color: #99a8ca; font-weight: 800; }
.voice-text { font-size: 0.98rem; }

.about-card .settings-note {
  color: #aebbdd;
  font-size: 0.86rem;
}


/* Final layout tuning */
.shell {
  width: min(100%, 42rem);
}
.realtime-shell {
  width: min(100%, 46rem);
}
.realtime-shell .talk-card {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.realtime-shell .talk-button {
  grid-column: 1 / -1;
}
.realtime-shell .mute-button,
.realtime-shell .stop-openclaw-button,
.realtime-shell .interrupt-button,
.realtime-shell #newRealtimeSessionButton {
  width: 100%;
  min-height: 3.1rem;
}
.transcript-card {
  max-height: 34rem;
  overflow: hidden;
}
.transcript-list {
  overflow: auto;
  padding-right: 0.2rem;
}
@media (max-width: 620px) {
  .realtime-shell .talk-card { grid-template-columns: 1fr; }
  .realtime-shell .talk-button { grid-column: auto; }
}

/* Ultra polish pass: consistent premium voice-console shell */
.shell,
.realtime-shell {
  width: min(100%, 44rem);
  padding-top: clamp(1rem, 2.4vw, 1.8rem);
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.2rem;
}

.topbar h1 {
  max-width: 12ch;
  text-wrap: balance;
}

.topbar-actions .ghost,
.nav-pill {
  min-width: 5.2rem;
  justify-content: center;
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 10px 30px rgba(0,0,0,0.22);
}

.hero {
  min-height: 12.5rem;
  display: grid;
  align-content: center;
}

.realtime-hero {
  min-height: 13.7rem;
  padding-bottom: 1.25rem;
}

.halo-wrap {
  padding: 0;
}

.halo {
  width: min(58vw, 14.4rem);
}

.halo-core {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
}

.halo-core span,
#realtimeStatus {
  display: block;
  max-width: 7.1rem;
  white-space: normal;
  overflow-wrap: normal;
  text-align: center;
  line-height: 1.12;
  letter-spacing: 0.095em;
}

.realtime-shell #realtimeStatus {
  font-size: 0.76rem;
}

.halo-core strong {
  max-width: 7.4rem;
  text-align: center;
}

.hero .chips {
  margin-top: 1rem;
}

.controls,
.realtime-shell .talk-card {
  padding: 0.1rem 0;
}

.primary,
.secondary,
.ghost,
.interrupt-button,
.realtime-shell #newRealtimeSessionButton {
  min-height: 3.25rem;
  font-weight: 760;
  letter-spacing: -0.01em;
}

.realtime-shell .talk-button {
  min-height: 4.85rem;
}

.realtime-shell .talk-button:disabled {
  opacity: 1;
  color: #061021;
  border-color: rgba(121, 242, 185, 0.42);
  background: linear-gradient(135deg, #d8ffe9, #8ceec0 48%, #7fc6ff);
  box-shadow: 0 18px 54px rgba(121, 242, 185, 0.24);
}

.mode-card,
.processing-card,
.voice-card,
.realtime-processing-card,
.public-transcript-card,
.about-card,
.meter-card {
  position: relative;
  overflow: hidden;
}

.mode-card::before,
.processing-card::before,
.voice-card::before,
.realtime-processing-card::before,
.public-transcript-card::before,
.about-card::before,
.meter-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  pointer-events: none;
}

.processing-head .chip,
.realtime-processing-card .chip {
  font-size: 0.74rem;
  padding: 0.42rem 0.68rem;
}

.mode-hint,
.settings-note,
.transcript-text,
.voice-text {
  color: #dbe4f8;
}

.mode-actions .chip,
.mode-actions .secondary.small {
  min-height: 2rem;
  font-size: 0.72rem;
}

.transcript-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(174, 187, 221, 0.28) transparent;
}

.transcript-list::-webkit-scrollbar { width: 8px; }
.transcript-list::-webkit-scrollbar-thumb {
  background: rgba(174, 187, 221, 0.24);
  border-radius: 999px;
}

.public-transcript-card {
  min-height: 19rem;
}

.voice-row + .voice-row {
  margin-top: 0.1rem;
}

.voice-bubble {
  backdrop-filter: blur(10px);
}

@media (min-width: 760px) {
  .shell,
  .realtime-shell {
    width: min(100%, 48rem);
  }
}

/* Halo typography correction */
.halo-core {
  flex-direction: column;
  gap: 0.32rem;
}
.halo-core strong {
  line-height: 1.12;
  font-size: 1rem;
}
#statusLabel,
#phaseLabel,
#realtimeStatus {
  text-align: center;
}
.realtime-shell .halo-core {
  gap: 0;
}


.stop-openclaw-button {
  border-color: rgba(255, 109, 125, 0.26);
  color: #ffd6dc;
}
.stop-openclaw-button.active:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 109, 125, 0.22), rgba(255, 209, 102, 0.12));
  border-color: rgba(255, 109, 125, 0.48);
  box-shadow: 0 14px 38px rgba(255, 109, 125, 0.16);
}


/* Intercom pristine pass — calm, consistent, non-technical PTT surface */
.ui-hidden { display: none !important; }

.shell:not(.realtime-shell) {
  width: min(100%, 46rem);
  gap: 0.9rem;
  padding: clamp(1rem, 2vw, 1.45rem) 1rem 1.7rem;
}

.shell:not(.realtime-shell) .topbar {
  align-items: center;
  margin-bottom: 0;
}

.shell:not(.realtime-shell) .topbar h1 {
  max-width: none;
  font-size: clamp(2.05rem, 6vw, 2.8rem);
  letter-spacing: -0.055em;
}

.shell:not(.realtime-shell) .hero {
  min-height: 10.8rem;
  padding: 1.05rem;
  grid-template-rows: 1fr auto;
}

.shell:not(.realtime-shell) .halo-wrap {
  padding: 0.15rem 0 0.35rem;
}

.shell:not(.realtime-shell) .halo {
  width: min(48vw, 11.8rem);
}

.shell:not(.realtime-shell) .halo-core {
  width: 58%;
  gap: 0.24rem;
}

.shell:not(.realtime-shell) .halo-core span {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

.shell:not(.realtime-shell) .halo-core strong {
  font-size: 0.9rem;
  line-height: 1.05;
}

.shell:not(.realtime-shell) .hero .chips {
  margin-top: 0.5rem;
}

.shell:not(.realtime-shell) .chips {
  gap: 0.4rem;
}

.shell:not(.realtime-shell) .chip {
  min-height: 1.9rem;
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.66rem;
  font-size: 0.72rem;
  letter-spacing: -0.005em;
}

.shell:not(.realtime-shell) .controls {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(7rem, 0.75fr) minmax(7rem, 0.75fr);
  gap: 0.65rem;
}

.shell:not(.realtime-shell) .controls > * {
  width: 100%;
  min-width: 0;
}

.shell:not(.realtime-shell) .talk-card {
  gap: 0.75rem;
}

.shell:not(.realtime-shell) .mode-card,
.shell:not(.realtime-shell) .processing-card,
.shell:not(.realtime-shell) .voice-card,
.shell:not(.realtime-shell) .meter-card,
.shell:not(.realtime-shell) .transcript-card {
  border-radius: 24px;
  padding: 0.95rem;
}

.shell:not(.realtime-shell) .mode-head,
.shell:not(.realtime-shell) .processing-head {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.shell:not(.realtime-shell) .mode-head h3,
.shell:not(.realtime-shell) .processing-head h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9fb0d2;
}

.shell:not(.realtime-shell) .segmented {
  justify-self: stretch;
  gap: 0.25rem;
}

.shell:not(.realtime-shell) .seg {
  min-height: 2.15rem;
  font-size: 0.78rem;
}

.shell:not(.realtime-shell) .mode-hint {
  color: #d9e4fb;
  font-size: 0.88rem;
  line-height: 1.35;
}

.shell:not(.realtime-shell) .mode-actions {
  min-height: 2rem;
}

.listen-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  width: auto;
  color: #dbe5fb;
  font-weight: 650;
  font-size: 0.82rem;
}

.listen-toggle input {
  accent-color: #8ec6ff;
}

.shell:not(.realtime-shell) .processing-grid {
  gap: 0.7rem;
}

.shell:not(.realtime-shell) .processing-grid label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.shell:not(.realtime-shell) .processing-grid select {
  margin-top: 0.08rem;
  min-height: 2.7rem;
  font-size: 0.9rem;
  letter-spacing: 0;
  text-transform: none;
}

.shell:not(.realtime-shell) .talk-button {
  min-height: 6.8rem;
  border-radius: 26px;
}

.shell:not(.realtime-shell) .talk-title {
  font-size: 1.08rem;
}

.shell:not(.realtime-shell) .talk-hint {
  font-size: 0.8rem;
}

.shell:not(.realtime-shell) .interrupt-button {
  min-height: 3rem;
}

.shell:not(.realtime-shell) .meter-card {
  padding: 0.85rem 0.95rem;
}

.shell:not(.realtime-shell) .meter-labels {
  margin-bottom: 0.55rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.shell:not(.realtime-shell) .meters {
  gap: 0.5rem;
}

.shell:not(.realtime-shell) .meter {
  height: 0.55rem;
}

.shell:not(.realtime-shell) .transcript-card {
  min-height: 16rem;
  max-height: 30rem;
}

.shell:not(.realtime-shell) .section-head h2 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #d6def5;
}

.shell:not(.realtime-shell) .transcript-list {
  gap: 0.65rem;
  margin-top: 0.85rem;
}

.shell:not(.realtime-shell) .transcript-list li {
  padding: 0.82rem 0.92rem;
  border-radius: 20px;
}

.shell:not(.realtime-shell) .transcript-meta {
  font-size: 0.66rem;
  letter-spacing: 0.13em;
}

.shell:not(.realtime-shell) .transcript-text {
  font-size: 0.95rem;
  line-height: 1.44;
}

.shell:not(.realtime-shell) .transcript-list .placeholder {
  text-align: center;
  color: #9fb0d2;
  padding: 2.1rem 1rem;
}

@media (max-width: 560px) {
  .shell:not(.realtime-shell) .controls,
  .shell:not(.realtime-shell) .processing-grid,
  .shell:not(.realtime-shell) .voice-grid {
    grid-template-columns: 1fr;
  }
  .shell:not(.realtime-shell) .mode-head {
    grid-template-columns: 1fr;
  }
  .shell:not(.realtime-shell) .halo {
    width: min(62vw, 11rem);
  }
}

/* Intercom final declutter */
.shell:not(.realtime-shell) .meter-card {
  display: none;
}

.shell:not(.realtime-shell) .interrupt-button:disabled {
  display: none;
}

.shell:not(.realtime-shell) .interrupt-button:not(:disabled) {
  display: block;
}

.shell:not(.realtime-shell) .talk-button:disabled {
  opacity: 0.74;
  filter: saturate(0.86);
}

.shell:not(.realtime-shell) .topbar-actions .nav-pill {
  font-size: 0.8rem;
}

.settings-form { display: grid; gap: 0.85rem; }
.settings-form label { display: grid; gap: 0.42rem; color: var(--muted); font-size: 0.88rem; }

/* Whole-console liveliness states */
body::before {
  content: "";
  position: fixed;
  inset: -22%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(127, 157, 255, 0.26), transparent 28%),
    radial-gradient(circle at 16% 72%, rgba(102, 240, 176, 0.18), transparent 26%),
    radial-gradient(circle at 84% 68%, rgba(255, 209, 102, 0.12), transparent 24%);
  filter: blur(8px) saturate(1.1);
  transition: opacity 220ms ease, transform 220ms ease;
}

.shell { position: relative; z-index: 1; }

body.voice-state-listening::before,
body.voice-state-transcribing::before,
body.voice-state-processing::before,
body.voice-state-speaking::before {
  opacity: 1;
}

body.voice-state-listening::before { animation: wholePulse 1.25s ease-in-out infinite; }
body.voice-state-transcribing::before { animation: wholePulse 0.95s ease-in-out infinite; }
body.voice-state-processing::before { animation: wholePulse 1.1s ease-in-out infinite, driftGlow 6s linear infinite; }
body.voice-state-speaking::before { animation: wholePulse 1.35s ease-in-out infinite; }

body.voice-state-listening .hero,
body.voice-state-listening .talk-card,
body.voice-state-transcribing .hero,
body.voice-state-transcribing .talk-card,
body.voice-state-processing .hero,
body.voice-state-processing .talk-card,
body.voice-state-processing .meter-card,
body.voice-state-speaking .hero {
  animation: panelPulse 1.15s ease-in-out infinite;
}

body.voice-state-transcribing .hero,
body.voice-state-processing .hero {
  border-color: rgba(169, 188, 255, 0.38);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.32), 0 0 40px rgba(127, 157, 255, 0.18);
}

body.voice-state-listening .talk-button {
  border-color: rgba(102, 240, 176, 0.58);
  box-shadow: 0 0 0 12px rgba(102, 240, 176, 0.10), 0 0 50px rgba(102, 240, 176, 0.22);
}

body.voice-state-processing .talk-button,
body.voice-state-transcribing .talk-button {
  border-color: rgba(169, 188, 255, 0.55);
  box-shadow: 0 0 0 12px rgba(127, 157, 255, 0.10), 0 0 50px rgba(127, 157, 255, 0.24);
}

.process-sound-toggle {
  min-height: 2.35rem;
  align-content: center;
}
.process-sound-note { margin-top: -0.25rem; }

@keyframes wholePulse {
  0%, 100% { transform: scale(1); filter: blur(8px) saturate(1.05); }
  50% { transform: scale(1.045); filter: blur(10px) saturate(1.3); }
}

@keyframes panelPulse {
  0%, 100% { transform: translateZ(0) scale(1); }
  50% { transform: translateZ(0) scale(1.008); }
}

@keyframes driftGlow {
  0% { background-position: 0% 0%, 20% 80%, 90% 70%; }
  100% { background-position: 100% 12%, 0% 70%, 70% 88%; }
}

@media (prefers-reduced-motion: reduce) {
  body::before,
  body.voice-state-listening .hero,
  body.voice-state-listening .talk-card,
  body.voice-state-transcribing .hero,
  body.voice-state-transcribing .talk-card,
  body.voice-state-processing .hero,
  body.voice-state-processing .talk-card,
  body.voice-state-processing .meter-card,
  body.voice-state-speaking .hero {
    animation: none !important;
  }
}

/* Realtime‑2 command console overhaul */
.realtime-shell {
  width: min(100%, 54rem);
  gap: 1rem;
}

body.embedded-mode .realtime-shell {
  width: 100%;
  min-height: 100dvh;
  padding-top: calc(env(safe-area-inset-top) + 0.25rem);
  padding-left: max(0.8rem, env(safe-area-inset-left));
  padding-right: max(0.8rem, env(safe-area-inset-right));
  padding-bottom: calc(env(safe-area-inset-bottom) + 0.8rem);
}

body.embedded-mode .topbar,
body.embedded-mode .topbar-actions {
  display: none !important;
}

body.embedded-mode .realtime-hero,
body.embedded-mode .realtime-controls-card,
body.embedded-mode .realtime-processing-card,
body.embedded-mode .openclaw-tuning-card,
body.embedded-mode .realtime-about-card {
  display: none !important;
}

body.embedded-mode .realtime-hero {
  min-height: 13rem;
}

body.embedded-mode .hero-copy p:not(.eyebrow) {
  max-width: 28rem;
}

body.embedded-mode .talk-card,
body.embedded-mode .realtime-processing-card,
body.embedded-mode .public-transcript-card {
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03)),
    rgba(9, 15, 28, 0.88);
  box-shadow: 0 12px 36px rgba(0,0,0,0.24);
}

body.embedded-mode .section-head h2,
body.embedded-mode .hero-copy h2 {
  font-size: 1.15rem;
  line-height: 1.05;
  max-width: none;
}

body.embedded-mode .talk-button {
  min-height: 4rem;
}

body.embedded-mode .talk-button .talk-title {
  font-size: 1rem;
}

body.embedded-mode .talk-button .talk-hint {
  font-size: 0.82rem;
}

body.embedded-mode .realtime-controls-card {
  position: sticky;
  top: calc(env(safe-area-inset-top) + 0.4rem);
  z-index: 6;
  backdrop-filter: blur(18px);
}

body.embedded-mode .public-transcript-card {
  margin-top: 0.25rem;
}

@media (max-width: 720px) {
  body.embedded-mode .realtime-hero {
    grid-template-columns: 1fr;
  }
}

.realtime-shell .topbar h1 {
  max-width: 16ch;
}

.realtime-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(12rem, 0.8fr);
  align-items: center;
  min-height: 15rem;
  padding: 1.25rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.55rem;
}

.hero-copy h2 {
  color: #f5f8ff;
  font-size: clamp(1.45rem, 4vw, 2.25rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 13ch;
}

.hero-copy p:not(.eyebrow) {
  color: #b9c7e8;
  max-width: 34rem;
  line-height: 1.48;
}

.realtime-controls-card {
  padding: 0.08rem 0;
}

.command-card {
  background:
    radial-gradient(circle at top right, rgba(121, 242, 185, 0.10), transparent 42%),
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(11, 18, 34, 0.82);
}

.realtime-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(9rem, 0.75fr);
}

.tools-radio-field {
  border: 1px solid rgba(198,214,255,0.14);
  border-radius: 18px;
  padding: 0.72rem;
  background:
    radial-gradient(circle at top left, rgba(118,167,255,0.12), transparent 42%),
    rgba(5, 9, 20, 0.58);
  grid-row: span 2;
}

.tools-radio-field legend {
  padding: 0 0.35rem;
  color: #aebbdd;
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tools-radio-group {
  display: grid;
  gap: 0.42rem;
}

.tools-radio-group label {
  display: flex !important;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.28rem;
  padding: 0.46rem 0.55rem;
  border-radius: 14px;
  color: #dce6ff;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(198,214,255,0.10);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.tools-radio-group label:has(input:checked) {
  border-color: rgba(121,242,185,0.52);
  background: linear-gradient(135deg, rgba(121,242,185,0.14), rgba(100,216,255,0.10));
  box-shadow: 0 0 0 1px rgba(121,242,185,0.12) inset, 0 10px 30px rgba(0,0,0,0.18);
}

.tools-radio-group label:hover {
  transform: translateY(-1px);
  border-color: rgba(118,167,255,0.35);
}

.tools-radio-group input[type="radio"] {
  accent-color: #79f2b9;
}

.bridge-chip {
  max-width: 100%;
  color: #cffff0;
  border-color: rgba(121, 242, 185, 0.24);
  background: rgba(121, 242, 185, 0.08);
  white-space: normal;
  text-align: right;
}

.toggle-row {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 2.65rem;
  padding: 0.62rem 0.72rem;
  border-radius: 16px;
  background: rgba(5, 9, 20, 0.58);
  border: 1px solid rgba(198,214,255,0.14);
}

.toggle-row span {
  display: grid;
  gap: 0.12rem;
  color: #f5f8ff;
  text-transform: none;
  letter-spacing: 0;
}

.toggle-row small {
  color: #9fb0d2;
  font-size: 0.72rem;
  line-height: 1.2;
}

.toggle-row input[type="checkbox"] {
  width: 2.95rem;
  height: 1.55rem;
  appearance: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(198,214,255,0.18);
  position: relative;
  flex: 0 0 auto;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.toggle-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  width: 1.15rem;
  height: 1.15rem;
  top: 0.15rem;
  left: 0.16rem;
  border-radius: 50%;
  background: #dce6ff;
  transition: transform 140ms ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.32);
}

.toggle-row input[type="checkbox"]:checked {
  background: linear-gradient(135deg, rgba(121,242,185,0.85), rgba(100,216,255,0.85));
  border-color: rgba(121,242,185,0.62);
}

.toggle-row input[type="checkbox"]:checked::after {
  transform: translateX(1.38rem);
  background: #061021;
}

.openclaw-tuning-card[aria-disabled="true"],
body.realtime-direct-mode .openclaw-tuning-card {
  opacity: 0.62;
}

.realtime-about-card {
  background: rgba(255,255,255,0.04);
}

@media (max-width: 720px) {
  .realtime-hero {
    grid-template-columns: 1fr;
    text-align: left;
  }
  .realtime-hero .halo-wrap {
    order: -1;
  }
  .realtime-grid,
  .realtime-shell .processing-grid {
    grid-template-columns: 1fr;
  }
  .bridge-chip { text-align: left; }
}


.rd-title-badge {
  color: #ff3b4f;
  text-shadow: 0 0 18px rgba(255, 59, 79, 0.38);
  white-space: nowrap;
}
