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

:root {
  --bg: #111214;
  --panel: #1a1c1f;
  --text: #e8e6e1;
  --muted: #8b8f96;
  --accent: #4c9f70;
  --accent-live: #d9534f;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", system-ui, sans-serif;
  display: flex;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 480px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  gap: 20px;
}

header { text-align: center; }
h1 { font-size: 1.6rem; letter-spacing: 0.08em; }
#status { color: var(--muted); margin-top: 6px; min-height: 1.2em; }

#talk {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
#talk:active { transform: scale(0.96); }
#talk.live { background: var(--accent-live); animation: pulse 1.6s infinite; }
#talk.connecting { background: var(--muted); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 83, 79, 0.45); }
  50% { box-shadow: 0 0 0 18px rgba(217, 83, 79, 0); }
}

#hint { color: var(--muted); font-size: 0.8rem; }

#transcript {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-bottom: 12px;
}

.turn {
  background: var(--panel);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 92%;
}
.turn.otto { align-self: flex-start; background: #1e2422; }
.turn.user { align-self: flex-end; color: var(--muted); }
.turn.system { align-self: center; color: var(--muted); font-size: 0.8rem; background: none; }
