* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0a0a0a; color: #e0e0e0; min-height: 100vh;
}
a { color: #f59e0b; text-decoration: none; }
a:hover { text-decoration: underline; }
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.container { max-width: 600px; width: 100%; padding: 2rem; }
.container.wide { max-width: 1100px; }
h1 { font-size: 2.5rem; margin-bottom: 0.25rem; text-align: center; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1rem; }
.subtitle { text-align: center; color: #888; margin-bottom: 2rem; font-size: 1.1rem; }
.form-group { margin-bottom: 1.25rem; }
.form-group label, .text-fallback label { display: block; margin-bottom: 0.4rem; color: #aaa; font-size: 0.9rem; }
.form-group input, textarea {
  width: 100%; padding: 0.75rem 1rem; background: #1a1a1a; border: 1px solid #333;
  border-radius: 8px; color: #fff; font-size: 1rem;
}
.form-group input:focus, textarea:focus { outline: none; border-color: #666; }
.loading { color: #666; padding: 1rem; text-align: center; }

/* Podcaster selector */
select {
  width: 100%; padding: 0.75rem 1rem; background: #1a1a1a; border: 1px solid #333;
  border-radius: 8px; color: #fff; font-size: 1rem; cursor: pointer;
}
select:focus { outline: none; border-color: #666; }
select option { background: #1a1a1a; color: #fff; padding: 0.5rem; }

/* Buttons */
button {
  width: 100%; padding: 0.9rem; background: #fff; color: #000; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
button:hover { opacity: 0.9; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Header */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.header-left { display: flex; align-items: center; gap: 0.75rem; }
.host-avatar { width: 36px; height: 36px; border-radius: 50%; }
.header button, .small-btn {
  width: auto; padding: 0.5rem 1rem; background: #333; color: #fff; font-size: 0.85rem;
}

/* Layout */
.layout { display: grid; grid-template-columns: 380px 1fr; gap: 1rem; align-items: start; }
.card { background: #111; border-radius: 12px; padding: 1rem; border: 1px solid #222; }
.transcript-panel { min-height: 70vh; }
.transcript-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.75rem; }
.transcript { min-height: 300px; max-height: 65vh; overflow-y: auto; }
.transcript-entry { margin-bottom: 1rem; line-height: 1.5; }
.transcript-entry .speaker { font-weight: 700; margin-bottom: 0.2rem; }
.speaker-host { color: #f59e0b; }
.speaker-user { color: #60a5fa; }
.transcript-entry .text { color: #ccc; white-space: pre-wrap; }

/* Text-only toggle */
.toggle-row { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.toggle-label { color: #888; font-size: 0.85rem; }
.toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #333; border-radius: 22px; transition: 0.2s;
}
.toggle-slider::before {
  content: ''; position: absolute; width: 16px; height: 16px;
  left: 3px; bottom: 3px; background: #888; border-radius: 50%; transition: 0.2s;
}
.toggle input:checked + .toggle-slider { background: #f59e0b; }
.toggle input:checked + .toggle-slider::before { transform: translateX(18px); background: #fff; }

/* Controls */
.controls { text-align: center; }
.status { color: #888; font-size: 0.9rem; margin-bottom: 1rem; min-height: 1.4rem; }
.status.listening { color: #ef4444; }
.status.thinking { color: #f59e0b; }
.status.speaking { color: #22c55e; }
.talk-button {
  width: 160px; height: 160px; border-radius: 50%; background: #1a1a1a; border: 3px solid #333;
  color: #fff; font-size: 1.1rem; display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.2s; user-select: none; -webkit-user-select: none; touch-action: none;
}
.talk-button:not(:disabled):hover { border-color: #555; }
.talk-button.recording { background: #7f1d1d; border-color: #ef4444; transform: scale(1.05); animation: pulse-recording 1.5s ease-in-out infinite; }
@keyframes pulse-recording {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
}
.recording-time {
  color: #ef4444; font-size: 1.2rem; font-weight: 700; font-family: monospace;
  min-height: 1.6rem; margin-top: 0.5rem;
}
.audio-visualizer {
  display: none; margin: 0.5rem auto 0; border-radius: 8px;
}
.text-fallback { margin-top: 1.25rem; text-align: left; }
.text-row { display: grid; grid-template-columns: 1fr 100px; gap: 0.75rem; align-items: end; }
.send-btn { height: 100%; min-height: 84px; }
.latency { margin-top: 0.75rem; color: #555; font-size: 0.75rem; font-family: monospace; }
#summary {
  background: #111; border-radius: 12px; padding: 1.25rem; margin: 1.5rem 0;
  white-space: pre-wrap; line-height: 1.6; max-height: 60vh; overflow-y: auto;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ─── Auth ───────────────────────────────────────────────────────── */

.auth-card {
  background: #111; border-radius: 12px; padding: 1.5rem; border: 1px solid #222;
  margin-top: 1rem;
}
.auth-card h3 { margin-bottom: 1.25rem; text-align: center; color: #fff; font-size: 1.2rem; }
.auth-error { color: #ef4444; font-size: 0.85rem; margin-bottom: 0.75rem; min-height: 1.2rem; }
.auth-success { color: #22c55e; font-size: 0.85rem; margin-bottom: 0.75rem; min-height: 1.2rem; }
.auth-switch { text-align: center; margin-top: 1rem; color: #888; font-size: 0.9rem; }

.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  width: 100%; padding: 0.8rem; background: #fff; color: #333; border: none;
  border-radius: 10px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.google-btn:hover { opacity: 0.9; }

.divider {
  display: flex; align-items: center; margin: 1.25rem 0; gap: 0.75rem;
}
.divider::before, .divider::after {
  content: ''; flex: 1; height: 1px; background: #333;
}
.divider span { color: #666; font-size: 0.85rem; }

/* ─── Dashboard ──────────────────────────────────────────────────── */

#dashboard-screen { align-items: flex-start; padding-top: 2rem; }

.dash-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.5rem;
}
.dash-header-left { display: flex; align-items: center; gap: 0.75rem; }
.dash-header-right { display: flex; align-items: center; gap: 0.75rem; }
.user-info { color: #aaa; font-size: 0.9rem; }

.new-interview-btn {
  width: auto; padding: 0.75rem 1.5rem; background: #f59e0b; color: #000;
  border: none; border-radius: 10px; font-size: 1rem; font-weight: 600;
  cursor: pointer; margin-bottom: 1.5rem;
}
.new-interview-btn:hover { opacity: 0.9; }

.section-title { color: #888; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 1rem; }

.sessions-list { display: flex; flex-direction: column; gap: 0.75rem; }

.session-card {
  display: flex; justify-content: space-between; align-items: center;
  background: #111; border: 1px solid #222; border-radius: 12px; padding: 1rem 1.25rem;
  transition: border-color 0.2s;
}
.session-card:hover { border-color: #444; }
.session-card-left { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.session-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.session-avatar-placeholder {
  width: 40px; height: 40px; border-radius: 50%; background: #222;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.2rem;
}
.session-card-info { min-width: 0; }
.session-card-title { font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-card-topic { color: #888; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-card-meta { color: #555; font-size: 0.8rem; margin-top: 0.2rem; }
.session-card-right { display: flex; align-items: center; gap: 0.75rem; flex-shrink: 0; }
.session-card-actions { display: flex; gap: 0.5rem; }

.status-badge {
  font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.status-active { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.status-ended { background: rgba(107, 114, 128, 0.15); color: #6b7280; }

.small-btn.accent { background: #f59e0b; color: #000; }
.small-btn.danger { background: #7f1d1d; color: #ef4444; }
.small-btn.danger:hover { background: #991b1b; }

.empty-state {
  text-align: center; color: #666; padding: 3rem 1rem;
  background: #111; border-radius: 12px; border: 1px dashed #333;
}

.back-nav { margin-bottom: 1rem; }
.back-nav a { color: #888; font-size: 0.9rem; }
.back-nav a:hover { color: #fff; }

/* ─── Transcript View ────────────────────────────────────────────── */

#transcript-view-screen { align-items: flex-start; padding-top: 2rem; }
.transcript-meta { color: #888; font-size: 0.9rem; margin-bottom: 1.5rem; }
.transcript-view-content {
  background: #111; border-radius: 12px; padding: 1.5rem; border: 1px solid #222;
  max-height: 70vh; overflow-y: auto;
}

/* ─── Responsive ─────────────────────────────────────────────────── */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .transcript-panel { min-height: auto; }
  .talk-button { width: 130px; height: 130px; }
  .session-card { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .session-card-right { width: 100%; justify-content: space-between; }
}
