:root { --bg:#f4f8fd; --blue:#2b6cb0; --ink:#1a202c; --kid:#d6e8fb; --bot:#fff; --warn:#c53030; }
* { box-sizing:border-box; }
html,body { height:100%; margin:0; background:var(--bg); color:var(--ink);
  font:18px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; }
#app { height:100%; display:flex; flex-direction:column; }
[hidden] { display:none !important; }
.screen { margin:auto; padding:24px; max-width:420px; width:100%; text-align:center; }
.logo { width:96px; height:96px; border-radius:22px; }
h1 { margin:.4em 0; }
input[type=text],input[type=password] { width:100%; font:inherit; padding:14px; border:2px solid #b8c9e0;
  border-radius:14px; background:#fff; }
button { font:inherit; border:0; border-radius:14px; padding:12px 16px; background:#e2eaf5; color:var(--ink); }
button.big { background:var(--blue); color:#fff; font-weight:600; margin-top:12px; min-width:110px; }
.err { color:var(--warn); min-height:1.5em; }
#kids { display:grid; gap:14px; margin-top:20px; }
#kids button { background:var(--blue); color:#fff; font-size:1.4em; padding:22px; }
#s-chat { display:flex; flex-direction:column; height:100%; }
header { display:flex; align-items:center; gap:8px; padding:calc(8px + env(safe-area-inset-top)) 12px 8px;
  background:var(--blue); color:#fff; }
header #who { flex:1; font-weight:600; }
header button { background:rgba(255,255,255,.2); color:#fff; padding:8px 12px; }
header button[aria-pressed=false] { opacity:.5; }
#log { flex:1; overflow-y:auto; padding:12px; display:flex; flex-direction:column; gap:10px; }
.msg { max-width:85%; padding:10px 14px; border-radius:18px; white-space:pre-wrap; word-wrap:break-word; }
.msg.kid { align-self:flex-end; background:var(--kid); }
.msg.bot { align-self:flex-start; background:var(--bot); box-shadow:0 1px 3px rgba(0,0,0,.12); }
.msg.bot strong { background:#fff3b0; border-radius:4px; padding:0 2px; }
.msg.sys { align-self:center; font-size:.9em; color:#555; }
.msg.wait::after { content:" …"; }
#listening { background:var(--warn); color:#fff; padding:10px; text-align:center; font-weight:600;
  animation:pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity:.65; } }
.note { background:#fff3b0; padding:8px 12px; font-size:.9em; }
#form { display:flex; gap:8px; padding:8px 8px calc(8px + env(safe-area-inset-bottom)); background:#e8eff8; align-items:center; }
#form #text { flex:1; min-width:0; }
#form #send { margin:0; min-width:0; padding:12px 14px; }
#mic.on { background:var(--warn); color:#fff; }
.cam { background:#e2eaf5; border-radius:14px; padding:12px 14px; cursor:pointer; }
