:root { --bg: #fff; --fg: #111; --muted: #8a8a8e; --line: #e5e5ea; --bubble: #e9e9eb; --mine: #0b84fe; --accent: #0b84fe; }
@media (prefers-color-scheme: dark) { :root { --bg: #000; --fg: #f2f2f7; --muted: #8e8e93; --line: #2c2c2e; --bubble: #26262a; } }
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 17px/1.3 -apple-system, system-ui, sans-serif; background: var(--bg); color: var(--fg); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
#app { max-width: 480px; margin: 0 auto; height: 100dvh; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 52px; }
.bar h1 { font-size: 17px; margin: 0; flex: 1; text-align: center; }
.bar .big { font-size: 28px; font-weight: 700; text-align: left; }
.link { color: var(--accent); }
.link:disabled { color: var(--muted); cursor: default; }
.scroll { flex: 1; overflow-y: auto; }
.row { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: left; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; background: #8e8e93; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 20px; }
.text { flex: 1; min-width: 0; }
.name { font-weight: 600; }
.preview, .sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
.nophones { color: #c0392b; font-size: 13px; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.empty { color: var(--muted); text-align: center; padding: 32px 16px; }
.msgs { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 4px; }
.b { max-width: 75%; padding: 8px 12px; border-radius: 18px; background: var(--bubble); align-self: flex-start; overflow-wrap: anywhere; white-space: pre-wrap; }
.b.me { background: var(--mine); color: #fff; align-self: flex-end; }
.typing { color: var(--muted); letter-spacing: 3px; }
.status { align-self: flex-end; color: var(--muted); font-size: 12px; padding-right: 4px; }
.composer { display: flex; gap: 8px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 18px; padding: 8px 14px; background: var(--bg); }
.composer button { color: var(--accent); font-weight: 600; }
.composer button:disabled { color: var(--muted); }
form.login { display: flex; flex-direction: column; gap: 12px; padding: 64px 16px; }
form.login input { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--bg); }
form.login button { background: var(--accent); color: #fff; border-radius: 10px; padding: 12px; }
.err { color: #c0392b; min-height: 1.3em; margin: 0; font-size: 14px; }
