:root {
  color-scheme: dark;
  --bg: #14161a;
  --bg-active: #1f2937;
  --fg: #e8eaed;
  --fg-dim: #9aa1ac;
  --accent: #6fae8f;
  --danger: #c4715c;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.screen {
  width: 100%;
}

#agent-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0;
}

.agent-pill {
  min-height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid #333842;
  background: #1c1f26;
  color: var(--fg-dim);
  font-size: 0.95rem;
  cursor: pointer;
}

.agent-pill.active {
  background: var(--accent);
  color: #0d1210;
  border-color: var(--accent);
  font-weight: 600;
}

#talk-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  height: 55vh;
  min-height: 320px;
  border: none;
  background: var(--bg);
  color: var(--fg);
  padding: 2rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#talk-button.recording {
  background: var(--bg-active);
}

#talk-button.speaking {
  background: #1a2a24;
}

#agent-name {
  font-size: 1.1rem;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

#status-word {
  font-size: 1.8rem;
  font-weight: 600;
}

#latency-line {
  font-size: 0.8rem;
  color: var(--fg-dim);
  min-height: 1rem;
}

#transcript-panel {
  padding: 1.25rem 1.5rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 30vh;
  overflow-y: auto;
}

#history {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.turn-you {
  color: var(--fg-dim);
  font-size: 0.95rem;
}

.turn-reply {
  color: var(--fg);
  font-size: 1rem;
  line-height: 1.4;
}

#text-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg);
  border-top: 1px solid #262a32;
}

#text-input {
  flex: 1;
  min-height: 44px;
  padding: 0 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid #333842;
  background: #1c1f26;
  color: var(--fg);
  font-size: 1rem;
  user-select: text;
}

#text-send {
  min-height: 44px;
  min-width: 44px;
  padding: 0 1rem;
  border-radius: 0.5rem;
  border: none;
  background: var(--accent);
  color: #0d1210;
  font-weight: 600;
  cursor: pointer;
}

#token-screen[hidden] {
  display: none;
}

#token-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  z-index: 10;
}

#token-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: min(320px, 85vw);
}

#token-form label {
  font-size: 0.95rem;
  color: var(--fg-dim);
}

#token-form input {
  font-size: 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.5rem;
  border: 1px solid #333842;
  background: #1c1f26;
  color: var(--fg);
}

#token-form button {
  font-size: 1rem;
  padding: 0.7rem 0.8rem;
  border-radius: 0.5rem;
  border: none;
  background: var(--accent);
  color: #0d1210;
  font-weight: 600;
  cursor: pointer;
}
