:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #38bdf8;
  --idle: #64748b;
  --listening: #22c55e;
  --speaking: #f59e0b;
  --processing: #a78bfa;
  --final: #38bdf8;
  --error: #f87171;
  --reply-bg: #172554;
  --reply-border: #334155;
  --selected: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 820px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

h1 {
  margin: 0 0 8px;
  font-size: 2rem;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--muted);
  font-weight: 600;
}

.subtitle {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 1.05rem;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 14px 22px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--accent);
  color: #082f49;
}

button:hover {
  filter: brightness(1.08);
}

button.stop {
  background: #fb7185;
  color: #1f080b;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
}

.status-label {
  color: var(--muted);
}

.badge {
  display: inline-block;
  min-width: 7.5rem;
  text-align: center;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  background: var(--idle);
}

.badge.listening {
  background: var(--listening);
  color: #052e16;
}

.badge.speaking {
  background: var(--speaking);
  color: #422006;
}

.badge.processing {
  background: var(--processing);
  color: #2e1065;
}

.badge.final {
  background: var(--final);
  color: #082f49;
}

.panel {
  background: var(--card);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

.transcript {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.45;
  min-height: 2.2em;
}

.transcript.interim {
  color: #e2e8f0;
  font-style: italic;
}

.transcript.final {
  color: var(--text);
}

.conversation {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty-hint {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.pair {
  background: #0f172a;
  border-radius: 10px;
  padding: 14px 16px;
}

.lang-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}

.pair-en,
.pair-ko {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.4;
}

.pair-ko {
  margin-bottom: 0;
}

.pair-ko.translating {
  color: var(--muted);
  font-style: italic;
}

.pair-ko.error {
  color: var(--error);
}

/* E4 Reply Suggestions */

.reply-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--reply-border);
}

.reply-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.reply-status {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-style: italic;
}

.reply-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.reply-option {
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--reply-border);
  border-radius: 9px;
  background: var(--reply-bg);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 500;
}

.reply-option:hover {
  filter: brightness(1.12);
}

.reply-option.selected {
  border-color: var(--selected);
  box-shadow: 0 0 0 1px var(--selected);
}

.reply-selected {
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 0.95rem;
}

.latency p {
  margin: 0;
  font-size: 1.2rem;
}

.message {
  margin: 0 0 16px;
  color: var(--muted);
}

.message.error {
  color: var(--error);
}