:root {
  color-scheme: dark;
  --bg: #0a1020;
  --bg2: #111932;
  --card: rgba(18, 27, 53, 0.78);
  --line: rgba(180, 208, 255, 0.18);
  --text: #eef4ff;
  --muted: #9fb1d1;
  --cyan: #63d3ff;
  --blue: #648dff;
  --violet: #9a7cff;
  --green: #4be39d;
  --amber: #ffca63;
  --red: #ff6d8a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(100,141,255,.22), transparent 28%),
    radial-gradient(circle at bottom, rgba(99,211,255,.16), transparent 24%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}
.app-shell {
  max-width: 880px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 18px 36px;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 22px;
}
.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.04);
  font-size: 14px;
}
.pill::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}
.pill.idle { color: var(--muted); }
.pill.listening { color: var(--green); }
.pill.processing { color: var(--amber); }
.pill.speaking { color: var(--cyan); }
.pill.error { color: var(--red); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card {
  border: 1px solid var(--line);
  background: var(--card);
  backdrop-filter: blur(18px);
  border-radius: 22px;
  box-shadow: 0 16px 48px rgba(0,0,0,.28);
}
.orb-wrap {
  display: grid;
  place-items: center;
}
.orb {
  position: relative;
  width: min(64vw, 340px);
  height: min(64vw, 340px);
  border: none;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  touch-action: none;
}
.orb-core, .orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
}
.orb-core {
  inset: 18%;
  background: radial-gradient(circle at 30% 30%, #d7eeff, #6ab6ff 32%, #425eff 63%, #181e66 100%);
  box-shadow: 0 0 50px rgba(99,211,255,.32), inset 0 0 45px rgba(255,255,255,.18);
}
.orb-ring {
  border: 1px solid rgba(163, 204, 255, .26);
}
.orb-ring-a { animation: spin 12s linear infinite; }
.orb-ring-b {
  inset: 7%;
  animation: spin-rev 8s linear infinite;
}
.orb-label {
  position: absolute;
  inset: auto 0 12%;
  text-align: center;
  font-size: 16px;
  color: #f6fbff;
  text-shadow: 0 0 14px rgba(0,0,0,.45);
}
.orb.listening .orb-core {
  animation: pulse 1s ease-in-out infinite;
  box-shadow: 0 0 80px rgba(75,227,157,.42), inset 0 0 45px rgba(255,255,255,.2);
}
.orb.processing .orb-core {
  box-shadow: 0 0 75px rgba(255,202,99,.35), inset 0 0 45px rgba(255,255,255,.2);
}
.orb.speaking .orb-core {
  animation: speak 0.85s ease-in-out infinite;
  box-shadow: 0 0 85px rgba(99,211,255,.45), inset 0 0 45px rgba(255,255,255,.24);
}
.controls {
  padding: 18px;
}
.token-label { display:block; margin-bottom: 10px; font-size: 14px; color: var(--muted); }
.token-row { display:flex; gap: 10px; }
.token-row input, .token-row button {
  border-radius: 14px;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font: inherit;
}
.token-row input {
  flex:1;
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.token-row button {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: #06111f;
  font-weight: 700;
}
.transcript-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.transcript-card { padding: 18px; }
.transcript-card h2 { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.transcript { margin: 0; min-height: 72px; line-height: 1.5; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spin-rev { to { transform: rotate(-360deg); } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes speak { 25% { transform: scale(1.03); } 50% { transform: scale(1.08); } 100% { transform: scale(1.02); } }
