* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0f172a;
  --card: #1e293b;
  --surface: #273449;
  --primary: #6366f1;
  --accent: #22d3ee;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.08);
  --danger: #ef4444;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 20% 10%, #1e1b4b, #0f172a 65%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: var(--text);
}

.container {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 2.5rem;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}

h1 {
  text-align: center;
  font-size: 2rem;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0.4rem 0 2rem;
}

.mic-box {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.mic-ring {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s ease;
}

.mic-core {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  transition: all 0.3s ease;
}

.mic-ring.listening {
  border-color: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}

.mic-core.listening {
  animation: glow 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.4);
  }
  50% {
    box-shadow: 0 0 0 24px rgba(34, 211, 238, 0);
  }
}

@keyframes glow {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.4);
  }
}

.status {
  text-align: center;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 1.5rem;
  min-height: 1.5em;
}

.status.active {
  color: var(--accent);
}

.status.error {
  color: var(--danger);
}

.controls {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.btn {
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.8rem 1.6rem;
  border-radius: 12px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  box-shadow: 0 10px 25px rgba(99, 102, 241, 0.35);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--danger);
  color: var(--danger);
}

.btn-ghost {
  background: var(--surface);
  color: var(--muted);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.live-box,
.results-box {
  background: var(--surface);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.live-box h2,
.results-box h2 {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  padding: 0.85rem;
  resize: vertical;
}

textarea::placeholder {
  color: var(--muted);
}

.results-list {
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
}

.results-list li {
  background: var(--card);
  border-radius: 10px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
  line-height: 1.5;
  border-left: 4px solid var(--accent);
}

.empty {
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 0.5rem;
}

@media (max-width: 480px) {
  .container {
    padding: 1.5rem;
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
  }
}