:root { --bg:#f6f7f9; --card:#fff; --text:#1c2430; --muted:#6a7482; --line:#d9dee5; --accent:#1f6feb; --me:#dbe8ff; --them:#fff; --err:#b42318; }
@media (prefers-color-scheme: dark) { :root { --bg:#12161c; --card:#1b212a; --text:#e8ecf1; --muted:#98a2b3; --line:#2b3440; --accent:#5b9dff; --me:#1d3355; --them:#232b36; --err:#ff8a80; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }      /* a hidden panel must stay hidden even when its own rule sets display */
body { margin:0; font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif; background:var(--bg); color:var(--text); }
.card { max-width:380px; margin:12vh auto; padding:24px; background:var(--card); border:1px solid var(--line); border-radius:12px; }
h1 { margin:0 0 8px; font-size:1.3rem; }
.muted { color:var(--muted); font-size:.9rem; }
label { display:block; margin:12px 0; font-size:.9rem; }
input { width:100%; padding:10px 12px; margin-top:4px; font:inherit; color:var(--text); background:var(--bg); border:1px solid var(--line); border-radius:8px; }
button { padding:10px 16px; font:inherit; color:#fff; background:var(--accent); border:0; border-radius:8px; cursor:pointer; }
button.link { background:none; color:var(--accent); padding:0 0 0 12px; }
.error { color:var(--err); min-height:1.4em; margin:8px 0 0; }
#chat { display:flex; flex-direction:column; height:100dvh; max-width:760px; margin:0 auto; }
#chat header { padding:12px 16px; border-bottom:1px solid var(--line); background:var(--card); }
#messages { flex:1; overflow-y:auto; padding:16px; display:flex; flex-direction:column; gap:10px; }
.msg { max-width:85%; padding:10px 12px; border-radius:12px; white-space:pre-wrap; word-wrap:break-word; border:1px solid var(--line); background:var(--them); }
.msg.me { align-self:flex-end; background:var(--me); }
.msg .row { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.msg .row button { background:var(--card); color:var(--accent); border:1px solid var(--accent); padding:6px 12px; }
.msg a { color:var(--accent); }
#send-form { display:flex; gap:8px; padding:12px 16px; border-top:1px solid var(--line); background:var(--card); }
#send-form input { margin:0; }
