:root {
  color-scheme: light dark;
  --bg: #f6f5f2;
  --panel: #ffffff;
  --text: #1d1c1a;
  --muted: #6d6a63;
  --line: #e2dfd8;
  --accent: #2f5d50;
  --human: #fff6df;
  --human-line: #ecd9a4;
  --code: #f0eee9;
  font: 15px/1.55 system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --panel: #1f1f1d;
    --text: #ecebe7;
    --muted: #9b988f;
    --line: #34332f;
    --accent: #7fc4ad;
    --human: #2b2617;
    --human-line: #5a4c22;
    --code: #2a2a27;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
main { max-width: 860px; margin: 0 auto; padding: 32px 20px 120px; }
h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 17px; margin: 32px 0 10px; }
.lead { color: var(--muted); margin: 0 0 24px; font-size: 17px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
code, pre { font: 13px/1.5 ui-monospace, 'Cascadia Code', Menlo, monospace; }
:not(pre) > code { background: var(--code); padding: 1px 5px; border-radius: 4px; }
pre { background: var(--code); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; overflow-x: auto; margin: 8px 0; white-space: pre; }
button, input, textarea { font: inherit; color: inherit; }
button { background: var(--accent); color: var(--bg); border: 1px solid var(--accent); border-radius: 8px; padding: 7px 14px; cursor: pointer; font-weight: 600; }
button.ghost { background: transparent; color: var(--accent); }
button.danger { color: #c4473a; border-color: #c4473a; padding: 3px 10px; font-size: 13px; margin-left: auto; }
ul.muted { padding-left: 20px; }
input, textarea { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
textarea { resize: vertical; min-height: 64px; }
.muted { color: var(--muted); }
ol.steps { padding-left: 20px; margin: 0; }
ol.steps li { margin: 6px 0; }
.row { display: flex; gap: 8px; align-items: center; }
.copy { position: relative; }
.copy button { position: absolute; top: 8px; right: 8px; padding: 2px 8px; font-size: 12px; }

/* room page */
.room-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; margin-bottom: 6px; }
.room-head h1 { font-size: 22px; }
.code-tag { font: 13px ui-monospace, Menlo, monospace; color: var(--muted); }
.members { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 22px; }
.member { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 13px; background: var(--panel); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.member.waiting .dot { background: #3aa76d; }
.member.active .dot { background: #d29b2a; }
.member.left { opacity: 0.55; }
.messages { display: flex; flex-direction: column; gap: 12px; }
.msg { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.msg.human { background: var(--human); border-color: var(--human-line); }
.msg .meta { display: flex; gap: 10px; align-items: baseline; font-size: 13px; margin-bottom: 4px; }
.msg .author { font-weight: 650; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg .body pre { white-space: pre; }
.system { text-align: center; color: var(--muted); font-size: 13px; }
details.file { border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; padding: 6px 10px; }
details.file summary { cursor: pointer; font: 13px ui-monospace, Menlo, monospace; }
.compose { position: fixed; left: 0; right: 0; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); }
.compose form { max-width: 860px; margin: 0 auto; padding: 10px 20px; display: grid; grid-template-columns: 140px 1fr auto; gap: 8px; align-items: end; }
.compose textarea { min-height: 40px; height: 40px; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }
@media (max-width: 560px) {
  .compose form { grid-template-columns: 1fr auto; }
  .compose input { grid-column: 1 / -1; }
}
