:root {
  --ink: #1d2733;
  --muted: #5b6878;
  --line: #dfe4ea;
  --bg: #f4f6f8;
  --card: #ffffff;
  --accent: #1f5f8b;
  --accent-ink: #ffffff;
  --end: #b3261e;
  --ok: #2e7d4f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.top {
  width: 100%;
  padding: 18px 28px;
  display: flex;
  align-items: baseline;
  gap: 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 20px; letter-spacing: 0.2px; }
.tag { color: var(--muted); font-size: 14px; }

.card {
  width: min(560px, calc(100% - 32px));
  margin: 40px 0 24px;
  padding: 32px 32px 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}
h1 { margin: 0 0 8px; font-size: 24px; }
.lead { margin: 0 0 22px; color: var(--muted); }

.versions {
  display: inline-flex;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.versions legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.versions label { position: relative; cursor: pointer; }
.versions input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.versions span {
  display: block;
  padding: 7px 22px;
  font-weight: 600;
  color: var(--muted);
}
.versions input:checked + span { background: var(--accent); color: var(--accent-ink); }
.versions input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -4px; }
.versions[disabled] { opacity: 0.6; }
.versions[disabled] label, .versions[disabled] input { cursor: not-allowed; }
.hint { margin: 8px 0 0; font-size: 14px; color: var(--muted); }

.call {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.orb {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e9f1f7, #c9dceb);
  border: 1px solid var(--line);
  transition: transform 0.2s ease, background 0.2s ease;
}
.orb[data-state="connecting"],
.orb[data-state="thinking"] { animation: breathe 1.4s ease-in-out infinite; }
.orb[data-state="listening"] { background: radial-gradient(circle at 35% 35%, #e7f5ec, #bfe3cd); }
.orb[data-state="speaking"] {
  background: radial-gradient(circle at 35% 35%, #dcebf6, #8fb9d8);
  animation: speak 0.7s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: scale(0.94); opacity: 0.8; } }
@keyframes speak { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none !important; } }

.status { margin: 0; min-height: 24px; color: var(--muted); font-weight: 500; }

.btn {
  min-width: 180px;
  padding: 12px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn.end { background: var(--end); }

.error {
  margin: 20px 0 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fdecea;
  color: #7a1c15;
  font-size: 15px;
}

.foot { margin: 0 16px 28px; color: var(--muted); font-size: 13px; text-align: center; }
