:root {
  --bg: #f6f4ef; --fg: #1d1b18; --muted: #6b665d; --card: #ffffff; --line: #e2ddd2;
  --accent: #b4532a; --accent-fg: #fff; --mine: #fbe9dd; --olivia: #e8f0e6; --rns: #e6edf6;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #171614; --fg: #ece8e1; --muted: #a39d92; --card: #22201d; --line: #36332e;
          --accent: #e07a4a; --accent-fg: #171614; --mine: #3a2a20; --olivia: #233024; --rns: #202a36; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 8px; align-items: center; font-weight: 700; }
.brand img { width: 26px; height: 26px; }
#who { font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
#who button { font-size: 13px; padding: 4px 10px; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
h1 { font-size: 22px; margin: 8px 0 12px; }
form#loginForm { display: grid; gap: 12px; margin: 16px 0; }
label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--fg); width: 100%; }
button { font: inherit; padding: 10px 16px; border: 0; border-radius: 10px; background: var(--accent);
  color: var(--accent-fg); cursor: pointer; font-weight: 600; }
button.secondary { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.msg { min-height: 1.4em; color: var(--accent); }
.small { font-size: 14px; color: var(--muted); }
#chat { display: flex; flex-direction: column; min-height: calc(100vh - 90px); }
#messages { list-style: none; padding: 0; margin: 0 0 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
#messages li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px;
  overflow-wrap: anywhere; position: relative; }
#messages li.mine { background: var(--mine); }
#messages li.transcript, #messages li.olivia { background: var(--olivia); }
#messages li.reticulum { background: var(--rns); }
#messages .meta { font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
#messages .meta b { color: var(--fg); }
#messages .del { position: absolute; right: 6px; top: 4px; background: none; color: var(--muted); padding: 2px 6px; }
#messages li.deleted .text { font-style: italic; color: var(--muted); }
#postForm { position: sticky; bottom: 0; display: flex; gap: 8px; padding: 10px 0;
  background: var(--bg); }
code { font-size: 13px; overflow-wrap: anywhere; }
details { margin-top: 8px; }
