:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #0e7c66;
  --accent-text: #ffffff;
  --live: #16a34a;
  --warn: #d97706;
  --bad: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --card: #111827;
    --text: #f1f5f9;
    --muted: #94a3b8;
    --accent: #14b8a6;
    --accent-text: #042f2e;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  display: grid;
  place-items: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(15, 23, 42, .08);
}
.brand { font-weight: 700; letter-spacing: .02em; color: var(--accent); font-size: 15px; }
.label { margin: 24px 0 0; color: var(--muted); font-size: 14px; }
h1 { margin: 2px 0 24px; font-size: 28px; line-height: 1.2; word-break: break-word; }
.pulse {
  width: 112px; height: 112px; margin: 0 auto 20px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transition: transform .2s, box-shadow .2s;
}
body[data-mode="speaking"] .pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent); }
  50% { box-shadow: 0 0 0 18px color-mix(in srgb, var(--accent) 0%, transparent); transform: scale(1.04); }
}
.status { min-height: 1.5em; margin: 0 0 20px; font-weight: 600; display: flex; gap: 8px; justify-content: center; align-items: center; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--live); }
body[data-mode="muted"] .dot, body[data-mode="away"] .dot, body[data-mode="reconnecting"] .dot { background: var(--warn); }
body[data-mode="error"] .status { color: var(--bad); }
button {
  width: 100%;
  min-height: 56px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 700;
  font-size: 19px;
  cursor: pointer;
}
button:disabled { opacity: .5; }
.hint { color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.code-input {
  width: 100%;
  min-height: 56px;
  font: inherit;
  font-size: 28px;
  letter-spacing: .3em;
  text-align: center;
  border-radius: 16px;
  border: 2px solid color-mix(in srgb, var(--muted) 40%, transparent);
  background: transparent;
  color: var(--text);
  margin-bottom: 16px;
}
