:root {
  --bg: #0d0c0a;
  --panel: #16140f;
  --line: #2a261d;
  --text: #f1ece2;
  --muted: #8f877a;
  --gold: #d8bf8a;
  --gold-soft: rgba(216, 191, 138, 0.14);
  --danger: #e08a7a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font-family: Manrope, system-ui, sans-serif;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
}
header, main, footer { max-width: 640px; width: 100%; margin: 0 auto; }
header { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 8px; }
.brand { font-weight: 600; letter-spacing: 0.04em; }
.brand span { color: var(--gold); }
.dots { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.dot::before {
  content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--line); margin-right: 6px; vertical-align: middle;
}
.dot.on::before { background: var(--gold); }
#dot-voice { cursor: pointer; }
.dot.off::before { background: var(--danger); }

main { flex: 1; overflow-y: auto; padding: 16px 0; display: flex; flex-direction: column; gap: 14px; }
.empty { margin: auto; text-align: center; color: var(--muted); line-height: 1.6; }
.empty b { color: var(--text); font-weight: 500; }
.msg { max-width: 85%; line-height: 1.5; font-size: 16px; }
.msg.you { align-self: flex-end; color: var(--muted); text-align: right; }
.msg.friday { align-self: flex-start; }
.msg.friday .who { color: var(--gold); font-size: 12px; letter-spacing: 0.06em; margin-bottom: 2px; }
.msg .note { font-size: 12px; color: var(--gold); margin-top: 4px; }
.msg.err { color: var(--danger); font-size: 14px; }

footer { padding: 12px 0 20px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#state { font-size: 13px; color: var(--muted); min-height: 18px; text-align: center; }
#mic {
  width: 88px; height: 88px; border-radius: 50%; border: 1px solid var(--gold);
  background: var(--gold-soft); color: var(--gold); cursor: pointer;
  display: grid; place-items: center; transition: transform 0.2s ease, background 0.4s ease;
}
#mic:active { transform: scale(0.96); }
#mic svg { width: 34px; height: 34px; }
body.listening #mic { background: var(--gold); color: var(--bg); animation: breathe 2.4s ease-in-out infinite; }
body.speaking #mic { animation: breathe 3.2s ease-in-out infinite; }
@keyframes breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 191, 138, 0.35); }
  50% { box-shadow: 0 0 0 18px rgba(216, 191, 138, 0); }
}
.row { display: flex; gap: 8px; width: 100%; }
#text {
  flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 12px 14px; font: inherit; font-size: 15px; outline: none;
}
#text:focus { border-color: var(--gold); }
button.small {
  background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 0 14px; font: inherit; font-size: 14px; cursor: pointer;
}
#lang { min-width: 56px; }
#wake { min-width: 84px; }
button.small.on { border-color: var(--gold); color: var(--gold); }
body.waking #mic { animation: breathe 4.5s ease-in-out infinite; }
