:root {
  --bg-a: #0b0f1a;
  --bg-b: #131a2b;
  --fg: #f4f6fb;
  --muted: rgba(244, 246, 251, 0.55);
  --glass: rgba(255, 255, 255, 0.06);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --accent: #7ee0c3;
  --accent-strong: #2fd6a8;
  --danger: #ff7a7a;
  --dot: rgba(255, 255, 255, 0.45); /* transparent white, per request */
  --dot-active: rgba(255, 255, 255, 0.9);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100svh;
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background:
    radial-gradient(60vmax 60vmax at 20% 10%, rgba(126, 224, 195, 0.18), transparent 70%),
    radial-gradient(50vmax 50vmax at 80% 90%, rgba(94, 132, 255, 0.18), transparent 70%),
    linear-gradient(160deg, var(--bg-a), var(--bg-b));
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

.shell {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px 32px;
  gap: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: lowercase;
  color: var(--fg);
}

.status {
  font-size: 13px;
  color: var(--muted);
}

.overlay {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  padding: 28px 20px;
  border-radius: 24px;
  background: var(--glass);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-strong);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
}

.dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  height: 36px;
}

.dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dot);
  box-shadow: 0 0 18px rgba(255, 255, 255, 0.15);
  transform: scale(0.6);
  opacity: 0.35;
  transition: background 0.2s, opacity 0.2s;
}

/* Idle: a subtle slow breathe so users know the overlay is alive. */
body.idle .dot {
  animation: dot-breathe 2.6s ease-in-out infinite;
}
body.idle .dot:nth-child(1) { animation-delay: 0s; }
body.idle .dot:nth-child(2) { animation-delay: 0.18s; }
body.idle .dot:nth-child(3) { animation-delay: 0.36s; }
body.idle .dot:nth-child(4) { animation-delay: 0.54s; }
body.idle .dot:nth-child(5) { animation-delay: 0.72s; }

/* Listening: faster, taller bounce — still transparent white. */
body.listening .dot {
  background: var(--dot-active);
  animation: dot-bounce 0.95s ease-in-out infinite;
  opacity: 0.95;
}
body.listening .dot:nth-child(1) { animation-delay: 0s; }
body.listening .dot:nth-child(2) { animation-delay: 0.08s; }
body.listening .dot:nth-child(3) { animation-delay: 0.16s; }
body.listening .dot:nth-child(4) { animation-delay: 0.24s; }
body.listening .dot:nth-child(5) { animation-delay: 0.32s; }

/* Thinking: waiting on Claude — gentle pulse. */
body.thinking .dot {
  animation: dot-breathe 1.1s ease-in-out infinite;
}

@keyframes dot-bounce {
  0%, 100% { transform: scale(0.6); opacity: 0.45; }
  50%      { transform: scale(1.15); opacity: 0.95; }
}

@keyframes dot-breathe {
  0%, 100% { transform: scale(0.7); opacity: 0.35; }
  50%      { transform: scale(1);   opacity: 0.75; }
}

.transcript-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(126, 224, 195, 0.14);
  color: var(--accent);
  border: 1px solid rgba(126, 224, 195, 0.35);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.transcript {
  width: 100%;
  min-height: 72px;
  font-size: 20px;
  line-height: 1.35;
  color: var(--fg);
  word-wrap: break-word;
}

.transcript .interim {
  color: var(--muted);
  font-style: italic;
}

.transcript .final {
  color: var(--fg);
}

.transcript .placeholder {
  color: var(--muted);
  font-size: 16px;
}

.reply-card {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(126, 224, 195, 0.08);
  border: 1px solid rgba(126, 224, 195, 0.25);
}

.reply-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.reply-label { color: var(--accent); }
.reply-model { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }

.reply-text {
  font-size: 16px;
  line-height: 1.45;
  color: var(--fg);
}

.action-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-list a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(94, 132, 255, 0.16);
  color: #a8bfff;
  text-decoration: none;
  font-size: 13px;
  border: 1px solid rgba(94, 132, 255, 0.35);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.lang-select {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.lang-select select {
  background: var(--glass);
  border: 1px solid var(--glass-strong);
  color: var(--fg);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.mic {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 50% 40%, var(--accent), var(--accent-strong));
  color: #0b0f1a;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 10px 28px rgba(126, 224, 195, 0.35);
  transition: transform 0.12s ease, box-shadow 0.2s;
}

.mic:active { transform: scale(0.96); }

body.listening .mic {
  background: radial-gradient(circle at 50% 40%, #ff9999, var(--danger));
  box-shadow: 0 10px 28px rgba(255, 122, 122, 0.45);
}

.mic-icon { font-size: 16px; line-height: 1; }

.unsupported {
  color: var(--danger);
  font-size: 14px;
  text-align: center;
  padding: 12px;
}
