:root {
  --bg: #ffffff;
  --fg: #14161a;
  --muted: #8a9099;
  --line: #e7e9ee;
  --accent: #2d7ff9;
  --accent-fg: #ffffff;
  --bubble: #f4f6f9;
  --danger: #e5484d;
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --fg: #eceef2;
    --muted: #8a9099;
    --line: #232730;
    --bubble: #1a1d24;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.head {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  z-index: 5;
}
.head h1 { font-size: 17px; font-weight: 700; margin: 0; }
.count { color: var(--muted); font-size: 13px; }

.list { flex: 1; padding: 12px 16px 96px; }
.loader, .empty { color: var(--muted); text-align: center; padding: 28px 0; }

.comment { display: flex; flex-direction: column; gap: 3px; padding: 8px 0; }
.comment.reply { margin-left: 28px; }
.comment .meta { display: flex; align-items: center; gap: 8px; }
.comment .author { font-weight: 600; font-size: 14px; }
.comment .time { color: var(--muted); font-size: 12px; }
.comment .bubble {
  background: var(--bubble);
  border-radius: var(--radius);
  padding: 8px 12px;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment .actions { display: flex; gap: 14px; padding: 2px 2px 0; }
.comment .actions button {
  background: none; border: none; color: var(--muted);
  font-size: 12px; cursor: pointer; padding: 2px 0;
}
.comment .actions button:hover { color: var(--fg); }
.comment .actions .danger:hover { color: var(--danger); }

.composer {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bubble);
  color: var(--fg);
  padding: 9px 12px;
  font: inherit;
}
.composer textarea:focus { outline: none; border-color: var(--accent); }
.composer button[type="submit"] {
  border: none;
  background: var(--accent);
  color: var(--accent-fg);
  border-radius: var(--radius);
  padding: 9px 16px;
  font-weight: 600;
  cursor: pointer;
}
.composer button[disabled] { opacity: .5; cursor: default; }

.reply-bar {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--muted);
  padding: 0 4px 8px;
}
.reply-bar button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 14px; }

.banned { text-align: center; color: var(--danger); padding: 20px; }
.toast {
  position: fixed; left: 50%; bottom: 86px; transform: translateX(-50%);
  background: var(--danger); color: #fff; padding: 8px 14px; border-radius: 10px;
  font-size: 13px; z-index: 20;
}
