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

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --text: #e0e0e0;
  --muted: #666;
  --accent: #e74c3c;
  --accent-glow: rgba(231, 76, 60, 0.3);
  --success: #2ecc71;
  --warning: #f39c12;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* Auth screen */
#auth-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100dvh;
  padding: 2rem;
  gap: 1.5rem;
}

#auth-screen h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

#auth-screen input {
  width: 100%;
  max-width: 300px;
  padding: 0.8rem 1rem;
  border: 1px solid #333;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

#auth-screen input:focus {
  border-color: var(--accent);
}

#auth-screen button {
  padding: 0.8rem 2rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

#auth-error {
  color: var(--accent);
  font-size: 0.85rem;
  display: none;
}

/* Main voice screen */
#voice-screen {
  display: none;
  flex-direction: column;
  height: 100dvh;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  font-size: 0.8rem;
  color: var(--muted);
  border-bottom: 1px solid #222;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}

.status-dot.connected { background: var(--success); }
.status-dot.connecting { background: var(--warning); animation: pulse 1s infinite; }
.status-dot.error { background: var(--accent); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Transcript area */
.transcript {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.transcript-entry {
  font-size: 0.9rem;
  line-height: 1.4;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  max-width: 85%;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.transcript-entry.assistant {
  background: var(--surface);
  align-self: flex-start;
}

.transcript-entry.status {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
  align-self: center;
  text-align: center;
}

/* Talk button area */
.talk-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: var(--surface);
  border-top: 1px solid #222;
}

.talk-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.talk-btn:active,
.talk-btn.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 30px var(--accent-glow);
  transform: scale(1.05);
}

.talk-btn:disabled {
  border-color: var(--muted);
  color: var(--muted);
  cursor: not-allowed;
}

.talk-hint {
  font-size: 0.75rem;
  color: var(--muted);
}

/* Visualizer */
.visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 24px;
}

.visualizer .bar {
  width: 3px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.05s ease;
}

/* Text input fallback */
.text-input-area {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  max-width: 400px;
}

.text-input-area input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #333;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.text-input-area button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 0.85rem;
  cursor: pointer;
}
