:root {
  --bg: #0b0f14;
  --surface: #111827;
  --panel: #161d2a;
  --text: #dde4ef;
  --muted: #8b9bb4;
  --accent: #3b82f6;
  --ok: #10b981;
  --err: #ef4444;
  font-family: "SF Pro Text", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  height: 100%;
}
body { display: flex; flex-direction: column; }
.hidden { display: none !important; }
.gate {
  position: fixed; inset: 0; z-index: 20; background: var(--bg);
  display: flex; flex-direction: column; justify-content: center;
  padding: 24px; gap: 12px;
}
.gate input {
  padding: 14px; border-radius: 10px; border: 1px solid #253044;
  background: var(--panel); color: var(--text); font-size: 16px;
}
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px calc(12px + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid #253044;
  position: sticky; top: 0; z-index: 5;
}
.brand { font-weight: 700; letter-spacing: -0.02em; color: inherit; text-decoration: none; }
.top-actions { display: flex; gap: 8px; }
.btn {
  border: 0; border-radius: 10px; padding: 10px 14px; font-weight: 600;
  cursor: pointer; font-size: 14px;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid #253044; }
.log {
  flex: 1; overflow-y: auto; padding: 14px 14px 100px; display: flex;
  flex-direction: column; gap: 10px;
}
.msg { max-width: 92%; padding: 10px 12px; border-radius: 14px; line-height: 1.4; font-size: 15px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: #1d4ed8; }
.msg.assistant { align-self: flex-start; background: var(--panel); }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 6px; }
.chip {
  display: inline-block; font-size: 12px; padding: 4px 8px; border-radius: 8px;
  background: #1c2537; color: var(--muted); margin: 2px 4px 2px 0;
}
.composer {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; gap: 8px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid #253044;
}
.composer textarea {
  flex: 1; resize: none; border-radius: 12px; border: 1px solid #253044;
  background: var(--panel); color: var(--text); padding: 12px; font: inherit; font-size: 16px;
  max-height: 120px;
}
.err { color: var(--err); font-size: 13px; }
.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px;
  background: var(--panel); color: var(--muted);
}
.voice-page .voice-hero {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 16px; padding: 24px; text-align: center;
}
.mic {
  width: 96px; height: 96px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; font-size: 28px;
  box-shadow: 0 0 0 0 rgba(59,130,246,0.4);
}
.mic.live {
  background: var(--err);
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.5); }
  70% { box-shadow: 0 0 0 24px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
.transcript { color: var(--text); min-height: 1.4em; }
.reply { color: var(--muted); max-width: 36rem; }
code { color: var(--accent); }
