:root {
  color-scheme: dark;
  --bg: #0b1220;
  --panel: #131c2e;
  --text: #e5e7eb;
  --muted: #94a3b8;
  --fr: #3b82f6;
  --es: #f97316;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
}

.home:not([hidden]) {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.home-card {
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.home-card h1 {
  font-size: 20px;
  margin: 0 0 20px;
}

.home-pair {
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 16px;
}

.home-caption {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 4px;
}

.home-phrase {
  font-size: 28px;
  font-weight: 600;
  color: var(--es);
  margin: 0 0 32px;
}

.session-screen:not([hidden]) {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #1f2a3d;
}

header h1 {
  font-size: 18px;
  margin: 0;
}

.status {
  font-size: 13px;
  color: var(--muted);
}

.status.connected { color: #22c55e; }
.status.error { color: var(--danger); }

main {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.transcript {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 640px;
  margin: 0 auto;
}

.bubble {
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.4;
  max-width: 85%;
}

.bubble.user {
  align-self: flex-end;
  background: #1f2a3d;
}

.bubble.tutor {
  align-self: flex-start;
  background: var(--panel);
}

.bubble .lang-es {
  color: var(--es);
}

.bubble .lang-fr {
  color: var(--text);
}

footer {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border-top: 1px solid #1f2a3d;
}

.talk-btn {
  width: 100%;
  max-width: 320px;
  padding: 18px;
  border-radius: 999px;
  border: none;
  background: var(--fr);
  color: white;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}

.talk-btn.recording {
  background: var(--danger);
}

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

.hint {
  font-size: 12px;
  color: var(--muted);
}
