:root {
  color-scheme: dark;
  --bg: #05070d;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.11);
  --text: #f7f9ff;
  --muted: #9aa8c5;
  --line: rgba(255, 255, 255, 0.14);
  --blue: #2f7dff;
  --cyan: #36d8ff;
  --pink: #ff4fd8;
  --green: #18e0a8;
  --danger: #ff6b6b;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(47, 125, 255, 0.28), transparent 30rem),
    radial-gradient(circle at 82% 20%, rgba(255, 79, 216, 0.16), transparent 28rem),
    radial-gradient(circle at 52% 88%, rgba(24, 224, 168, 0.12), transparent 32rem),
    var(--bg);
}

button,
select {
  font: inherit;
}

.voice-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: minmax(330px, 0.95fr) minmax(320px, 1.05fr);
  gap: 22px;
  align-items: stretch;
}

.voice-stage,
.transcript-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.045));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.voice-stage {
  min-height: 720px;
  border-radius: 28px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 30px;
  font-size: clamp(2.7rem, 8vw, 5.7rem);
  line-height: 0.9;
  letter-spacing: 0;
}

.orb {
  width: min(64vw, 330px);
  aspect-ratio: 1;
  margin: 0 auto 30px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  filter: saturate(1.2);
}

.orb::before,
.orb::after {
  content: "";
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.95), transparent 0.4rem),
    radial-gradient(circle at 32% 34%, rgba(54, 216, 255, 0.95), transparent 26%),
    radial-gradient(circle at 72% 35%, rgba(255, 79, 216, 0.92), transparent 28%),
    radial-gradient(circle at 48% 72%, rgba(24, 224, 168, 0.9), transparent 34%),
    #1b2150;
  box-shadow:
    0 0 46px rgba(54, 216, 255, 0.44),
    0 0 82px rgba(255, 79, 216, 0.28),
    inset 0 0 42px rgba(255, 255, 255, 0.18);
  animation: orbPulse 2.8s ease-in-out infinite;
  z-index: -1;
}

.orb::after {
  inset: 4%;
  background:
    conic-gradient(from 110deg, var(--cyan), var(--pink), var(--green), var(--blue), var(--cyan));
  opacity: 0.25;
  filter: blur(18px);
  animation: spin 8s linear infinite;
}

.orb span {
  width: 8%;
  height: 34%;
  margin: 0 1.8%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.26);
  transform-origin: center;
  animation: idleBars 1.7s ease-in-out infinite;
}

.orb span:nth-child(2) {
  animation-delay: 120ms;
}

.orb span:nth-child(3) {
  animation-delay: 240ms;
}

.orb span:nth-child(4) {
  animation-delay: 360ms;
}

.orb.listening span,
.orb.thinking span,
.orb.speaking span {
  animation-name: activeBars;
}

.orb.thinking::before {
  animation-duration: 1.2s;
}

.orb.speaking::before {
  animation-duration: 0.9s;
}

.status-text {
  min-height: 1.4em;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 1.02rem;
}

.live-text {
  width: min(100%, 620px);
  min-height: 58px;
  margin-bottom: 24px;
  color: var(--text);
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 1.15;
}

.controls {
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: 1fr 0.62fr 0.62fr;
  gap: 10px;
}

button {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

button:not(:disabled):hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #745cff);
  box-shadow: 0 16px 34px rgba(47, 125, 255, 0.34);
}

.secondary-button {
  color: var(--text);
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.secondary-button.active {
  color: #ffffff;
  background: rgba(255, 107, 107, 0.26);
  border-color: rgba(255, 107, 107, 0.5);
}

.voice-picker {
  width: min(100%, 520px);
  margin-top: 18px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  text-align: left;
  font-weight: 800;
}

select {
  width: 100%;
  min-height: 48px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
}

.transcript-panel {
  min-height: 720px;
  border-radius: 28px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin-bottom: 0;
  font-size: 1.04rem;
}

.thinking-badge {
  color: #ffffff;
  background: rgba(47, 125, 255, 0.26);
  border: 1px solid rgba(47, 125, 255, 0.36);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 900;
}

.hidden {
  display: none;
}

.chat-log {
  flex: 1;
  min-height: 0;
  padding: 18px 2px 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.message {
  width: min(88%, 560px);
  border-radius: 18px;
  padding: 13px 15px;
  line-height: 1.45;
}

.message p {
  margin-bottom: 0;
  white-space: pre-wrap;
}

.message-label {
  display: block;
  margin-bottom: 5px;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--muted);
  text-transform: uppercase;
}

.user-message {
  align-self: flex-end;
  color: #ffffff;
  background: linear-gradient(135deg, #245fff, #735dff);
}

.user-message .message-label {
  color: rgba(255, 255, 255, 0.72);
}

.ai-message {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

.error-message {
  align-self: center;
  width: 100%;
  color: #ffd0d0;
  background: rgba(255, 107, 107, 0.12);
  border: 1px solid rgba(255, 107, 107, 0.32);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes orbPulse {
  50% {
    transform: scale(1.045);
  }
}

@keyframes idleBars {
  50% {
    transform: scaleY(0.45);
    opacity: 0.62;
  }
}

@keyframes activeBars {
  25% {
    transform: scaleY(0.36);
  }

  50% {
    transform: scaleY(1.08);
  }

  75% {
    transform: scaleY(0.58);
  }
}

@media (max-width: 860px) {
  .voice-shell {
    width: min(100% - 24px, 640px);
    min-height: auto;
    padding: 24px 0;
    grid-template-columns: 1fr;
  }

  .voice-stage,
  .transcript-panel {
    min-height: auto;
    border-radius: 24px;
  }

  .voice-stage {
    padding: 28px 22px;
  }

  .transcript-panel {
    height: 440px;
  }
}

@media (max-width: 520px) {
  .controls {
    grid-template-columns: 1fr;
  }

  .message {
    width: 96%;
  }
}
