:root {
  --bg: #0b1220;
  --panel: #121c30;
  --ink: #eaf0fb;
  --muted: #93a3bd;
  --cyan: #35d0e0;
  --navy: #1b2b47;
  --me: #22406e;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(env(safe-area-inset-top), 14px) 18px 12px;
  border-bottom: 1px solid #1e2b45;
}
header h1 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: .2px; }
#limpar {
  background: none; border: 1px solid #2a3a5c;
  color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: 12px;
}
main {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bolha {
  max-width: 82%;
  padding: 11px 14px;
  border-radius: 16px;
  line-height: 1.45;
  font-size: 15.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.bolha.assistente { align-self: flex-start; background: var(--panel); border-bottom-left-radius: 5px; }
.bolha.eu { align-self: flex-end; background: var(--me); border-bottom-right-radius: 5px; }
.vazio { color: var(--muted); text-align: center; margin: auto; max-width: 260px; line-height: 1.5; }
footer {
  padding: 12px 18px max(env(safe-area-inset-bottom), 18px);
  border-top: 1px solid #1e2b45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.status { margin: 0; color: var(--muted); font-size: 13px; min-height: 18px; text-align: center; }
.mic {
  width: 76px; height: 76px; border-radius: 50%;
  border: none; color: #04121a;
  background: var(--cyan);
  display: grid; place-items: center;
  box-shadow: 0 8px 26px rgba(53, 208, 224, .35);
  transition: transform .12s ease, background .2s ease, box-shadow .2s ease;
}
.mic:active { transform: scale(.94); }
.mic.ouvindo { background: #ff5d73; box-shadow: 0 0 0 8px rgba(255, 93, 115, .18); animation: pulse 1.3s infinite; }
.mic.pensando { background: var(--muted); }
.mic:disabled { opacity: .5; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 6px rgba(255, 93, 115, .22); }
  70% { box-shadow: 0 0 0 18px rgba(255, 93, 115, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 93, 115, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .mic.ouvindo { animation: none; }
}
