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

:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-light: #dbeafe;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
  --red: #ef4444;
  --green: #22c55e;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
}

.view { display: flex; flex-direction: column; min-height: 100vh; }
.hidden { display: none !important; }

/* Login */
#login-view {
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 100%);
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.logo { font-size: 56px; margin-bottom: 8px; }
.logo-sm { font-size: 24px; }

.login-card h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.subtitle {
  color: var(--gray-400);
  font-size: 14px;
  margin-bottom: 32px;
}

#login-form input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.2s;
}

#login-form input:focus {
  border-color: var(--blue);
}

#login-btn {
  width: 100%;
  padding: 12px;
  background: var(--blue);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

#login-btn:hover { background: var(--blue-dark); }
#login-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.error {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  min-height: 20px;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: white;
  border-bottom: 1px solid var(--gray-200);
  flex-wrap: wrap;
  gap: 8px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 14px;
}
.btn-text:hover { color: var(--gray-600); }
.btn-sm { font-size: 12px; }

/* Model selector */
.model-selector {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-600);
}

.model-selector select {
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  background: white;
  color: var(--gray-800);
  cursor: pointer;
  outline: none;
}

.model-selector select:focus {
  border-color: var(--blue);
}

/* Model badge */
.model-badge {
  font-size: 12px;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 4px 12px;
  border-radius: 12px;
  transition: all 0.3s;
}

.model-badge.switching {
  color: var(--blue);
  background: var(--blue-light);
}

/* Voice hint */
.voice-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 8px;
}

/* Voice UI */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
}

.voice-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.status {
  font-size: 16px;
  color: var(--gray-600);
  text-align: center;
}

.mic-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.3);
}

.mic-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 28px rgba(37, 99, 235, 0.4);
}

.mic-btn.active {
  background: var(--red);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 4px 32px rgba(239, 68, 68, 0.5); }
}

.timer {
  font-size: 14px;
  color: var(--gray-400);
  font-variant-numeric: tabular-nums;
}

/* Visualizer */
.visualizer {
  display: flex;
  gap: 4px;
  align-items: center;
  height: 40px;
}

.visualizer .bar {
  width: 4px;
  height: 8px;
  background: var(--blue);
  border-radius: 2px;
  animation: bounce 1.2s ease-in-out infinite;
}

.visualizer .bar:nth-child(1) { animation-delay: 0s; }
.visualizer .bar:nth-child(2) { animation-delay: 0.1s; }
.visualizer .bar:nth-child(3) { animation-delay: 0.2s; }
.visualizer .bar:nth-child(4) { animation-delay: 0.3s; }
.visualizer .bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 100% { height: 8px; }
  50% { height: 32px; }
}

/* Transcript */
.transcript {
  width: 100%;
  max-width: 600px;
  margin-top: 32px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: white;
  overflow: hidden;
}

.transcript-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-600);
}

.transcript-body {
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
}

.transcript-entry {
  margin-bottom: 12px;
}

.transcript-entry .speaker {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.transcript-entry .speaker.user { color: var(--blue); }
.transcript-entry .speaker.wave { color: var(--green); }

.transcript-entry.system {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  font-style: italic;
}

.transcript-entry .text {
  color: var(--gray-600);
}

/* Mobile */
@media (max-width: 480px) {
  .login-card { padding: 32px 24px; margin: 16px; }
  .mic-btn { width: 80px; height: 80px; }
  .mic-btn svg { width: 40px; height: 40px; }
  header { padding: 10px 16px; }
  .model-selector label { display: none; }
  .voice-hint { display: none; }
}
