* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
  min-height: 100vh;
  color: #e4e4e7;
}

.container {
  max-width: 420px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.25rem 0;
  letter-spacing: -0.02em;
}

.subtitle {
  font-size: 0.875rem;
  color: #71717a;
  margin: 0;
}

.transcript {
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.transcript-turn {
  margin-bottom: 0.75rem;
}

.transcript-turn:last-child {
  margin-bottom: 0;
}

.transcript-you,
.transcript-bot {
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 0.35rem;
}

.transcript-you .label,
.transcript-bot .label {
  font-weight: 600;
  color: #a78bfa;
}

.transcript-you .label { color: #67e8f9; }
.transcript-bot .label { color: #a78bfa; }

.card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  padding: 1.5rem;
}

.hint {
  font-size: 0.8125rem;
  color: #a1a1aa;
  margin: 0 0 1rem 0;
  line-height: 1.4;
}

.voice-level-box {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.voice-level-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.8125rem;
}

.voice-level-label .state-silence { color: #94a3b8; }
.voice-level-label .state-noise { color: #fbbf24; }
.voice-level-label .state-speech { color: #4ade80; }

.voice-level-value {
  font-variant-numeric: tabular-nums;
  color: #71717a;
  font-size: 0.75rem;
}

.voice-level-track {
  position: relative;
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
}

.voice-level-bar {
  height: 100%;
  width: 0%;
  border-radius: 6px;
  transition: width 0.05s ease-out;
}

.voice-level-bar[data-state="silence"] {
  background: linear-gradient(90deg, #475569 0%, #64748b 100%);
}

.voice-level-bar[data-state="noise"] {
  background: linear-gradient(90deg, #d97706 0%, #fbbf24 100%);
}

.voice-level-bar[data-state="speech"] {
  background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
}

.voice-level-markers {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: #71717a;
}

.voice-level-markers .marker.silence { color: #94a3b8; }
.voice-level-markers .marker.noise { color: #fbbf24; }
.voice-level-markers .marker.speech { color: #4ade80; }

.record-btn {
  display: block;
  width: 100%;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: #3b82f6;
  border: none;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.record-btn:hover {
  background: #2563eb;
}

.record-btn:active {
  transform: scale(0.98);
}

.record-btn.recording {
  background: #dc2626;
  animation: pulse 1.5s ease-in-out infinite;
}

.record-btn.recording::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 8px;
  background: #fff;
  border-radius: 50%;
  animation: listen-blink 1s ease-in-out infinite;
  vertical-align: middle;
}


@keyframes pulse {
  50% { opacity: 0.92; }
}

@keyframes listen-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status {
  margin: 1rem 0 0 0;
  font-size: 0.8125rem;
  color: #71717a;
  min-height: 1.25em;
}

.status.error {
  color: #f87171;
}

.status.success {
  color: #4ade80;
}
