:root {
  --bg: #0e1117;
  --card: #171b26;
  --text: #e8eaf0;
  --muted: #9aa1b2;
  --accent: #ff7a18;
  --accent2: #ffa940;
  --ok: #3ecf6f;
  --err: #ff5f56;
  --border: #262b3a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #1d2333 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.hidden { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  width: min(640px, 100%);
  margin: 3rem 1rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

h1 { margin: 0 0 0.5rem; font-size: 1.5rem; }
p { color: var(--muted); }

#gate { text-align: center; margin-top: 10vh; }
#gate form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }

input {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #10131c;
  color: var(--text);
  font-size: 1rem;
}

button {
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #1a130a;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
button:hover { transform: translateY(-1px); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-weight: 400;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

#app { width: min(760px, 100%); margin: 0 1rem; }
#app header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 1.5rem 0 0;
}
#app header h1 { font-size: 1.25rem; }

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--muted);
}
.dot.connecting { background: var(--accent2); animation: pulse 1s infinite; }
.dot.live { background: var(--ok); }

@keyframes pulse { 50% { opacity: 0.3; } }

#call-btn { width: 100%; margin-bottom: 1.25rem; }

.transcript {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 45vh;
  overflow-y: auto;
  min-height: 4rem;
  padding-right: 0.25rem;
}

.msg {
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.4;
  white-space: pre-wrap;
}
.msg.user { align-self: flex-end; background: #2b3350; }
.msg.assistant { align-self: flex-start; background: #232a3d; border: 1px solid var(--border); }
.msg .who { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); display: block; margin-bottom: 2px; }

.error { color: var(--err); min-height: 1.2em; margin: 0.5rem 0 0; }
.hint { font-size: 0.8rem; margin-top: 1rem; }
