/* Black & red, restrained: deep crimson accent on near-black, no glow. */
:root {
  --bg: #0f0f11;
  --surface: #17171a;
  --surface-2: #1e1e22;
  --border: #2a2a2f;
  --border-strong: #3a3a40;
  --text: #ebebee;
  --muted: #94949c;
  --accent: #a8222b;        /* deep crimson */
  --accent-hover: #bd2a34;
  --accent-text: #fff;
  --accent-soft: rgba(168, 34, 43, .14);
  --accent-line: #7d1a21;
  --link: #e0626a;
  --danger: #a8222b;
  --good: #4c9a6a;
  --warn: #c49a45;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: 1.7rem; margin: 6px 0 16px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.inline { display: inline; margin: 0; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.lead { font-size: 1.12rem; color: var(--text); margin: 0 0 12px; }

/* header */
.top { background: #0b0b0d; border-bottom: 1px solid var(--border); border-top: 3px solid var(--accent);
       position: sticky; top: 0; z-index: 10; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 1.12rem; color: var(--text); letter-spacing: .01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 12px; height: 12px; background: var(--accent); transform: rotate(45deg); display: inline-block; }
.brand-logo { width: 28px; height: 28px; display: block; }
.hero-logo { width: 72px; height: 72px; display: block; margin-bottom: 14px; }
.mainnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.mainnav > a:not(.btn) { color: var(--text); opacity: .85; }
.mainnav > a:not(.btn):hover { opacity: 1; text-decoration: none; color: #fff; }
.who { color: var(--muted); font-size: .92rem; }
.who small { display: inline-block; margin-left: 4px; padding: 1px 7px; border: 1px solid var(--border-strong); border-radius: 99px; font-size: .72rem; }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--accent); color: #fff;
         font-size: .75rem; font-weight: 700; text-align: center; line-height: 20px; vertical-align: 1px; }
main { padding-top: 22px; padding-bottom: 40px; min-height: 70vh; }
.foot { border-top: 1px solid var(--border); padding-top: 16px; padding-bottom: 28px; color: var(--muted); font-size: .88rem; }

/* buttons */
.btn { display: inline-block; background: var(--accent); color: var(--accent-text); border: 1px solid var(--accent); border-radius: 8px;
       padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2; transition: background .15s; }
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { background: var(--surface-2); border-color: #55555c; }
.btn.danger { background: transparent; color: #e46d74; border-color: var(--accent-line); }
.btn.danger:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.small { padding: 6px 11px; font-size: .84rem; font-weight: 550; }
.linkbtn { background: none; border: 0; color: var(--muted); font: inherit; cursor: pointer; padding: 0; }
.linkbtn:hover { color: var(--text); }

/* flashes */
.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface);
         border-left: 3px solid var(--muted); }
.flash.error { border-left-color: var(--accent); }
.flash.ok { border-left-color: var(--good); }

/* panels & forms */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.narrow { max-width: 440px; }
.center-block { margin: 20px auto; }
.form { display: flex; flex-direction: column; gap: 14px; margin: 0 0 8px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 550; font-size: .95rem; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 450; }
.check input { width: auto; margin-top: 4px; accent-color: var(--accent); }
input, textarea, select { font: inherit; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--border-strong);
                          background: var(--bg); color: var(--text); width: 100%; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
input[type=file] { padding: 7px; }
input[type=radio] { accent-color: var(--accent); }
textarea { resize: vertical; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 12px; margin: 0; }
legend { padding: 0 6px; font-weight: 600; }

.two-col { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 820px) { .two-col { grid-template-columns: 1fr; } }

/* auth */
.auth { display: grid; grid-template-columns: 1fr minmax(0, 440px); gap: 32px; align-items: center; padding-top: 24px; }
.auth h1 { font-size: 2rem; }
.auth-intro { border-left: 3px solid var(--accent); padding-left: 20px; }
@media (max-width: 760px) { .auth { grid-template-columns: 1fr; gap: 18px; padding-top: 0; } }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { padding: 6px 13px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--text); font-size: .88rem; background: var(--surface); }
.chip:hover { border-color: #55555c; text-decoration: none; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-n { opacity: .7; margin-left: 3px; }
.page-head p { margin-top: -8px; }

/* feed */
.feed { display: flex; flex-direction: column; gap: 12px; }
.card { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
        overflow: hidden; color: var(--text); transition: border-color .15s; }
.card:hover { text-decoration: none; border-color: var(--border-strong); }
.card.pinned { border-left: 3px solid var(--accent); }
.cover { width: 200px; min-height: 140px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.card-body { padding: 14px 18px; min-width: 0; flex: 1; }
.card-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.cat { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: #d4555d; font-weight: 650; }
.card h2 { margin: 0 0 6px; font-size: 1.14rem; }
.excerpt { margin: 0 0 8px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.meta { color: var(--muted); font-size: .86rem; }
.pager { display: flex; justify-content: space-between; margin-top: 20px; }
.empty { text-align: center; padding: 40px 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); margin-bottom: 18px; }
@media (max-width: 600px) {
  .card { flex-direction: column; }
  .cover { width: 100%; height: 200px; }
}

/* post */
.back { color: var(--muted); }
.post { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; margin-bottom: 16px; }
.post h1 { margin: 0 0 6px; overflow-wrap: anywhere; }
.post .body, .hero .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 16px 0; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin: 16px 0; }
.gallery img { width: 100%; height: 210px; object-fit: cover; border-radius: 8px; display: block; background: var(--surface-2); }
.gallery.single { grid-template-columns: 1fr; }
.gallery.single img { height: auto; max-height: 560px; object-fit: contain; }
.post-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 14px; margin-top: 18px; }

.poll { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin: 18px 0; background: var(--bg); }
.poll h2 { font-size: 1.08rem; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border-strong);
       border-radius: 8px; margin-bottom: 8px; cursor: pointer; overflow: hidden; }
.opt:hover { border-color: #55555c; }
.opt input { width: auto; position: relative; z-index: 1; }
.opt-text { flex: 1; position: relative; z-index: 1; }
.opt-num { color: var(--muted); font-size: .88rem; position: relative; z-index: 1; }
.opt .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); border-right: 2px solid var(--accent-line); }
.opt.mine { border-color: var(--accent); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }

/* new post hints */
.hints h3 { margin-bottom: 12px; }
.hint { padding: 8px 10px; border-radius: 8px; border-left: 2px solid transparent; margin-bottom: 4px; }
.hint ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); font-size: .9rem; }
.hint.on { background: var(--surface-2); border-left-color: var(--accent); }

/* about */
.hero { padding: 8px 0 8px 20px; border-left: 3px solid var(--accent); margin-bottom: 28px; }
.hero h1 { font-size: 2.1rem; margin-bottom: 8px; }
.section-title { margin: 28px 0 12px; font-size: 1.25rem; }
.section-title::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--accent); margin-right: 10px; transform: rotate(45deg); vertical-align: 2px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cat-grid .panel { margin: 0; }
.cat-grid h3 { color: #e07077; }
.cat-grid p { margin: 0 0 8px; font-size: .92rem; }
.cat-grid ul, .tips, .rules { margin: 0; padding-left: 20px; }
.cat-grid li { font-size: .92rem; margin-bottom: 3px; }
.tips, .rules { padding-left: 38px; }
.tips li, .rules li { margin-bottom: 6px; }
.steps { padding-left: 22px; }
.steps li { margin-bottom: 8px; }
.steps.compact li { margin-bottom: 4px; color: var(--muted); }

/* admin */
.subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.subnav a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.on { color: var(--text); border-bottom-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
a.stat:hover { border-color: var(--border-strong); text-decoration: none; }
.stat b { font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .84rem; }
.stat.alert { border-color: var(--accent); background: linear-gradient(0deg, var(--accent-soft), var(--accent-soft)), var(--surface); }
.queue { display: flex; flex-direction: column; }
.queue-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); flex-wrap: wrap; }
.queue-item:first-child { border-top: 0; padding-top: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.searchbar { display: flex; gap: 8px; margin-bottom: 12px; max-width: 520px; }

.tablewrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.grid { border-collapse: collapse; width: 100%; font-size: .92rem; }
.grid th, .grid td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.grid tbody tr:last-child td { border-bottom: 0; }
.grid th { color: var(--muted); font-weight: 600; white-space: nowrap; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
.grid tbody tr:hover { background: var(--surface-2); }
.perms td:not(:first-child), .perms th:not(:first-child) { text-align: center; }
.perms td:not(:first-child) { color: var(--muted); }

.tag { display: inline-block; font-size: .74rem; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--border-strong); color: var(--text); white-space: nowrap; }
.tag.good { color: #7cc497; border-color: #2f5a40; }
.tag.bad { color: #ee868c; border-color: var(--accent-line); background: var(--accent-soft); }
.tag.warn { color: #e0bd72; border-color: #5e4a22; }
.tag.accent { color: #fff; background: var(--accent); border-color: var(--accent); }
.tag.muted-tag { color: var(--muted); }

.user-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.user-head h1 { margin: 0; }
.tags { display: flex; gap: 6px; }
.info { display: grid; grid-template-columns: 150px 1fr; gap: 8px 12px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 500px) { .info { grid-template-columns: 1fr; } .info dt { margin-top: 6px; } }
.action-group { padding: 12px 0; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.action-group:first-of-type { border-top: 0; padding-top: 0; }
.action-group h3 { width: 100%; margin: 0 0 4px; font-size: .9rem; color: var(--muted); font-weight: 600; }
.inline-form { display: flex; gap: 6px; width: 100%; }
.inline-form input { padding: 6px 10px; font-size: .9rem; }

.log { list-style: none; margin: 0; padding: 0; }
.log li { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.log li:last-child { border-bottom: 0; }
.log-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 120px; }
@media (max-width: 560px) { .log li { flex-direction: column; gap: 0; } }
.plain-list { margin: 0; padding-left: 18px; }
.plain-list li { margin-bottom: 6px; }
