:root {
  --bg: #0c0e0d; --panel: #141716; --panel2: #1a1e1c; --line: #262b28; --text: #e7ece8;
  --muted: #8b958e; --accent: #53fc18; --accent-ink: #0a1a04; --danger: #ff5c5c;
  --warn: #ffb84d; --info: #6cb6ff; --radius: 10px;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
code { font: 13px var(--mono); background: var(--panel2); padding: 1px 6px; border-radius: 5px; overflow-wrap: anywhere; }
h1 { font-size: 24px; margin: 0; letter-spacing: -0.02em; text-wrap: balance; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin: 0 0 12px; font-weight: 600; display: flex; justify-content: space-between; }
h2.sub { margin-top: 22px; } h2 .more { text-transform: none; letter-spacing: 0; font-weight: 400; }
.muted { color: var(--muted); } .nowrap { white-space: nowrap; }
.errtext { color: var(--danger); font-size: 13px; }

.side { background: var(--panel); border-right: 1px solid var(--line); padding: 20px 12px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); padding: 0 8px 18px; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; } .brand.big { font-size: 24px; padding: 0 0 6px; }
.mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: var(--accent-ink); font: 800 16px var(--mono); }
nav { display: flex; flex-direction: column; gap: 2px; }
nav a { color: var(--muted); padding: 8px 10px; border-radius: 7px; border-left: 2px solid transparent; }
nav a:hover { color: var(--text); background: var(--panel2); text-decoration: none; }
nav a.on { color: var(--text); background: var(--panel2); border-left-color: var(--accent); }
.side-foot { margin-top: auto; padding: 8px; font-size: 13px; display: grid; gap: 8px; }
.status { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #4a524d; }
.dot.live { background: var(--accent); box-shadow: 0 0 0 4px rgba(83,252,24,.16); }

main { padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1180px; width: 100%; display: flex; flex-direction: column; gap: 18px; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; max-width: 70ch; flex-basis: 100%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.banner { padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel2); font-size: 14px; }
.banner.ok { border-color: rgba(83,252,24,.4); } .banner.err { border-color: rgba(255,92,92,.5); color: #ffc9c9; }
.banner.warn { border-color: rgba(255,184,77,.5); } .banner.info { border-color: rgba(108,182,255,.5); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 2px; }
.tile b { font: 600 30px/1.1 var(--mono); font-variant-numeric: tabular-nums; } .tile b.small { font-size: 20px; line-height: 1.65; }
.tile span { color: var(--muted); font-size: 13px; } .tile.hot b { color: var(--accent); }

.row { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; } h2 + .row { border-top: 0; padding-top: 0; }
.grow { flex: 1; min-width: 0; overflow-wrap: anywhere; } .row time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.quote { color: var(--muted); font: 13px var(--mono); overflow-wrap: anywhere; }
.tag { font: 600 11px var(--mono); text-transform: uppercase; padding: 3px 7px; border-radius: 5px; background: var(--panel2); color: var(--muted); white-space: nowrap; }
.tag.ban { background: rgba(255,92,92,.16); color: var(--danger); } .tag.timeout { background: rgba(255,184,77,.16); color: var(--warn); }
.tag.delete { background: rgba(108,182,255,.16); color: var(--info); } .tag.unban { background: rgba(83,252,24,.14); color: var(--accent); }
.tag.dry-run, .tag.would { background: rgba(108,182,255,.12); color: var(--info); }
.empty { color: var(--muted); padding: 14px 0; margin: 0; text-align: left; }

.table { overflow-x: auto; } table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 0 10px 8px; }
td { padding: 9px 10px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.off td { opacity: .45; } td.ops { white-space: nowrap; text-align: right; } td.ops form { display: inline; } td.ops > * { margin-left: 10px; }

label { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
input, select, textarea { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; min-width: 0; }
textarea { font: 13px/1.5 var(--mono); resize: vertical; width: 100%; } input[type=number] { width: 88px; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.stack { display: grid; gap: 14px; } .inline { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; }
.inline label { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.btn { font: 600 14px system-ui; color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 7px; padding: 8px 14px; cursor: pointer; display: inline-block; white-space: nowrap; }
.btn:hover { border-color: #3a423d; text-decoration: none; } .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.danger { background: var(--danger); color: #230000; border-color: var(--danger); } .btn.wide { display: block; text-align: center; margin-top: 18px; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font: inherit; cursor: pointer; } button.link:hover { color: var(--text); } button.link.danger:hover { color: var(--danger); }
.actions { display: flex; gap: 10px; justify-content: flex-end; } .actions.left { justify-content: flex-start; }
.search { display: flex; gap: 8px; } .copy { margin-top: 8px; } .kv dt { color: var(--muted); font-size: 12px; margin-top: 10px; } .kv dd { margin: 2px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.chip { font: 12px var(--mono); padding: 4px 9px; border-radius: 20px; border: 1px solid var(--line); }
.chip.yes { border-color: rgba(83,252,24,.5); } .chip.yes::before { content: "✓ "; color: var(--accent); } .chip.no { color: var(--muted); } .chip.no::before { content: "✕ "; color: var(--danger); }
.testout { font-size: 14px; min-height: 22px; overflow-wrap: anywhere; }

.chatbox { padding: 0; display: flex; flex-direction: column; height: calc(100vh - 150px); min-height: 380px; }
.chatlog { flex: 1; overflow-y: auto; padding: 8px 0; font-size: 14px; } .chatlog .empty { padding: 18px; }
.msg { display: flex; gap: 10px; padding: 4px 18px; align-items: baseline; }
.msg:hover { background: var(--panel2); } .msg time { color: var(--muted); font: 11px var(--mono); flex: none; }
.msg .who { font-weight: 600; flex: none; max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .msg .who.staff { color: var(--accent); }
.msg .text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.msg.flag { background: rgba(255,92,92,.07); box-shadow: inset 2px 0 var(--danger); } .msg.flag .text { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255,92,92,.5); }
.msg .why { font: 11px var(--mono); color: var(--danger); margin-left: 8px; text-decoration: none; display: inline-block; }
.msg .tools { display: flex; gap: 10px; flex: none; visibility: hidden; font-size: 12px; } .msg:hover .tools, .msg:focus-within .tools { visibility: visible; }
.sayform { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); } .sayform input { flex: 1; }
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; width: min(520px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.6); } dialog h2 { font-size: 17px; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0; } dialog p { margin: 0; }

body.login { display: grid; grid-template-columns: 1fr; place-items: center; padding: 20px; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 32px; width: min(440px, 100%); display: grid; gap: 10px; }
.login-card p { margin: 0; }

@media (max-width: 760px) {
  body { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; gap: 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 0 8px 0 0; } nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; } nav a { white-space: nowrap; border-left: 0; }
  .side-foot { margin: 0 0 0 auto; padding: 0; display: flex; align-items: center; gap: 12px; }
  .msg .tools { visibility: visible; } .msg { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: no-preference) { .btn, nav a { transition: background .12s, border-color .12s, color .12s; } }
