/* =========================================================================
   AquaDongle Community — stylesheet
   Light / dark themes via CSS variables. No external fonts or frameworks.
   ========================================================================= */

:root {
  --bg: #f5f7fb;
  --bg-2: #eef2f8;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e3e8f0;
  --border-2: #d3dae6;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --primary-soft: #e8efff;
  --accent: #06b6d4;
  --success: #059669;
  --success-soft: #e7f8f1;
  --warn: #d97706;
  --warn-soft: #fff6e6;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --code-bg: #0f172a;
  --code-tx: #e2e8f0;
  --inline-code: #eef2f7;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05);
  --shadow-lg: 0 10px 40px rgba(15, 23, 42, .14);
  --ring: 0 0 0 3px rgba(37, 99, 235, .25);
  --hero: linear-gradient(135deg, #0ea5e9 0%, #2563eb 55%, #4f46e5 100%);
  --radius: 14px;
  --radius-sm: 9px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a101d; --bg-2: #0e1626; --surface: #111a2c; --surface-2: #0f1828;
    --border: #1f2a40; --border-2: #2a3752; --text: #e6ebf5; --text-2: #c3cddd; --muted: #8b98ae;
    --primary: #4f8cff; --primary-2: #6aa0ff; --primary-soft: #16264a; --accent: #22d3ee;
    --success: #34d399; --success-soft: #0f2a22; --warn: #fbbf24; --warn-soft: #2b2210;
    --danger: #f87171; --danger-soft: #2f1517; --code-bg: #070c16; --code-tx: #dbe4f3; --inline-code: #1a2539;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
    --ring: 0 0 0 3px rgba(79, 140, 255, .35);
    --hero: linear-gradient(135deg, #0c4a6e 0%, #1e3a8a 55%, #312e81 100%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a101d; --bg-2: #0e1626; --surface: #111a2c; --surface-2: #0f1828;
  --border: #1f2a40; --border-2: #2a3752; --text: #e6ebf5; --text-2: #c3cddd; --muted: #8b98ae;
  --primary: #4f8cff; --primary-2: #6aa0ff; --primary-soft: #16264a; --accent: #22d3ee;
  --success: #34d399; --success-soft: #0f2a22; --warn: #fbbf24; --warn-soft: #2b2210;
  --danger: #f87171; --danger-soft: #2f1517; --code-bg: #070c16; --code-tx: #dbe4f3; --inline-code: #1a2539;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  --ring: 0 0 0 3px rgba(79, 140, 255, .35);
  --hero: linear-gradient(135deg, #0c4a6e 0%, #1e3a8a 55%, #312e81 100%);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { width: 100%; max-width: 1220px; margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-top: 24px; padding-bottom: 48px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
kbd { font: 11px var(--mono); border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; color: var(--muted); background: var(--surface-2); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; text-decoration: none !important; line-height: 1.2; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,.3); }
.btn-primary:hover { background: var(--primary-2); }
.btn-accent { background: #fff; color: #1e3a8a; }
.btn-accent:hover { background: #f0f6ff; }
.btn-ghost { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn-ghost:hover { background: var(--bg-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.92); }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 8px; }
.btn-block { width: 100%; }
.iconbtn { position: relative; display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text-2); }
.iconbtn:hover { background: var(--bg-2); text-decoration: none; }
.iconbtn svg, .searchbox svg, .hero-search svg, .act svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn .dot { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--surface); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .i-sun { display: none; } :root:not([data-theme="light"]) .i-moon { display: block; } }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--border); }
.topbar-inner { display: flex; align-items: center; gap: 18px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; flex-shrink: 0; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; box-shadow: 0 4px 14px rgba(37,99,235,.35); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text b { font-size: 1.02rem; letter-spacing: -.02em; }
.brand-text span { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .09em; }
.mainnav { display: flex; gap: 2px; }
.mainnav a { padding: 8px 12px; border-radius: 9px; color: var(--text-2); font-weight: 550; font-size: .92rem; text-decoration: none; }
.mainnav a:hover { background: var(--bg-2); color: var(--text); }
.mainnav a.on { color: var(--primary); background: var(--primary-soft); }
.searchbox { position: relative; flex: 1; max-width: 380px; margin-left: auto; display: flex; align-items: center; }
.searchbox > svg { position: absolute; left: 11px; width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.searchbox input { width: 100%; height: 40px; padding: 0 38px 0 36px; border-radius: 11px; border: 1px solid var(--border); background: var(--bg-2); transition: border-color .15s, background .15s; }
.searchbox input:focus { outline: none; border-color: var(--primary); background: var(--surface); box-shadow: var(--ring); }
.searchbox kbd { position: absolute; right: 10px; }
.searchbox input:focus ~ kbd { display: none; }
.actions { display: flex; align-items: center; gap: 6px; }
.navtoggle { display: none; }

.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; border-radius: 50%; display: block; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 210px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 60; animation: pop .14s ease-out; }
.usermenu .menu a, .usermenu .menu button { display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: 8px; color: var(--text); background: none; border: 0; cursor: pointer; font-size: .92rem; text-decoration: none; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--bg-2); }
.usermenu .menu form { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 4px; }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu-head small { color: var(--muted); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }

/* suggestions dropdown */
.suggest { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 70; text-align: left; }
.suggest a { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; }
.suggest a .sg-t { font-weight: 550; }
.suggest a small { color: var(--muted); font-size: .78rem; }
.suggest a:hover, .suggest a.on { background: var(--bg-2); }
.suggest .tick { float: left; }
.suggest .sg-all { color: var(--primary); font-weight: 600; font-size: .88rem; border-top: 1px solid var(--border); margin-top: 4px; border-radius: 0 0 8px 8px; }
.sg-empty { padding: 10px; color: var(--muted); font-size: .9rem; }
.tick { color: var(--success); font-weight: 800; margin-right: 4px; }

.announce { background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff; font-size: .9rem; padding: 9px 0; text-align: center; }
.announce a { color: #fff; text-decoration: underline; }

/* ---------- flash / toast ---------- */
.flash { position: relative; padding: 12px 40px 12px 16px; border-radius: 11px; margin: 0 0 16px; border: 1px solid; font-size: .93rem; }
.flash-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--success); }
.flash-error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--danger); }
.flash-info { background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 25%, transparent); color: var(--primary); }
.flash-x { position: absolute; right: 8px; top: 7px; border: 0; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: inherit; opacity: .6; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; opacity: 0; transition: .25s; z-index: 200; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.col-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-title { font-size: .95rem; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card-sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 8px; }
.block { margin-bottom: 30px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.block-head h2, .block-title { margin: 0; font-size: 1.15rem; }
.block-title { margin-bottom: 12px; }
.more { font-size: .88rem; font-weight: 600; }
.pill { display: inline-block; min-width: 22px; padding: 1px 8px; border-radius: 20px; background: var(--bg-2); color: var(--muted); font-size: .75rem; font-weight: 700; text-align: center; }
.pill-warn { background: var(--danger); color: #fff; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: .86rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.crumb-cur { color: var(--text-2); }

.pagehead { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.pagehead h1 { margin: 0; }
.pagehead p { margin: 2px 0 0; }
.pagehead-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--hero); color: #fff; border-radius: 20px; padding: 46px 40px; margin-bottom: 28px; box-shadow: var(--shadow-lg); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }
.hero::before { width: 420px; height: 420px; right: -120px; top: -180px; }
.hero::after { width: 260px; height: 260px; right: 140px; bottom: -170px; background: rgba(34,211,238,.18); }
.hero-text { position: relative; max-width: 680px; }
.hero h1 { font-size: 2.2rem; margin-bottom: 6px; letter-spacing: -.03em; }
.hero p { opacity: .9; margin: 0 0 22px; font-size: 1.05rem; }
.hero-search { position: relative; display: flex; align-items: center; background: #fff; border-radius: 14px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.hero-search > svg { width: 20px; height: 20px; margin: 0 6px 0 10px; color: #64748b; flex-shrink: 0; }
.hero-search input { flex: 1; border: 0; background: none; color: #0f172a; font-size: 1rem; padding: 10px 6px; min-width: 0; }
.hero-search input:focus { outline: none; }
.hero-search .suggest { color: var(--text); }
.hero-cta { display: flex; align-items: center; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.hero-cta .muted { color: rgba(255,255,255,.82); font-size: .9rem; }

/* ---------- news ---------- */
.news-grid { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: auto auto; gap: 14px; }
.news-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; color: var(--text); text-decoration: none !important; box-shadow: var(--shadow); transition: transform .15s, border-color .15s, box-shadow .15s; }
.news-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow-lg); }
.news-card.featured { grid-row: span 2; background: linear-gradient(160deg, var(--primary-soft), var(--surface) 60%); }
.news-card h3 { margin: 6px 0; font-size: 1.05rem; }
.news-card.featured h3 { font-size: 1.3rem; }
.news-card p { color: var(--muted); margin: 0 0 10px; font-size: .92rem; flex: 1; }
.news-date { font-size: .78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; }
.news-foot { font-size: .8rem; color: var(--muted); }

/* ---------- categories ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cat-card { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; color: var(--text); text-decoration: none !important; box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .15s, border-color .15s; }
.cat-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.cat-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--c) 60%, var(--border)); }
.cat-card h3 { margin: 0 0 2px; }
.cat-card p { margin: 0 0 8px; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.cat-body { min-width: 0; }
.cat-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .8rem; color: var(--muted); }
.cat-meta b { color: var(--text-2); }
.cat-last { width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-icon { flex-shrink: 0; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; font-size: 22px; background: color-mix(in srgb, var(--c) 15%, transparent); }
.cat-icon.lg { width: 60px; height: 60px; font-size: 30px; border-radius: 16px; }
.cat-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-top: 4px solid var(--c); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 20px; background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--text-2); text-decoration: none !important; }
.chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.chip:hover { background: color-mix(in srgb, var(--c) 22%, transparent); }

/* ---------- toolbar / segmented ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; flex-wrap: wrap; }
.seg a { padding: 5px 12px; border-radius: 8px; font-size: .86rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.mini-search input { height: 36px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }

/* ---------- topic list ---------- */
.tlist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.trow { display: grid; grid-template-columns: 40px minmax(0, 1fr) 130px 170px; gap: 14px; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background .12s; }
.trow:last-child { border-bottom: 0; }
.trow:hover { background: var(--surface-2); }
.trow.pinned { background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.trow-title { margin: 0 0 3px; font-size: 1rem; font-weight: 600; }
.trow-title a { color: var(--text); }
.trow.unread .trow-title a { font-weight: 750; }
.trow.unread .trow-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-right: 7px; vertical-align: middle; }
.trow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .82rem; }
.trow-meta a { color: inherit; font-weight: 600; }
.trow-stats { display: flex; gap: 14px; justify-content: center; text-align: center; }
.trow-stats div { display: flex; flex-direction: column; line-height: 1.2; }
.trow-stats b { font-size: .98rem; }
.trow-stats span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.trow-stats .zero b { color: var(--warn); }
.trow-last { display: flex; align-items: center; gap: 8px; font-size: .82rem; min-width: 0; }
.trow-last div { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.trow-last a:first-child { color: var(--text-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pages { font-size: .78rem; color: var(--muted); }
.pages a { margin-left: 4px; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; }

/* ---------- avatars ---------- */
.avatar { display: inline-block; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--bg-2); vertical-align: middle; }
.avatar-gen { display: inline-grid; place-items: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, hsl(var(--h) 70% 55%), hsl(calc(var(--h) + 40) 70% 45%)); user-select: none; line-height: 1; }
.avatars { display: flex; flex-wrap: wrap; gap: 6px; }
.avatars a { border-radius: 50%; transition: transform .12s; }
.avatars a:hover { transform: scale(1.1); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 3px; font-size: .72rem; font-weight: 700; padding: 1px 8px; border-radius: 20px; background: var(--bg-2); color: var(--muted); line-height: 1.6; white-space: nowrap; }
.badge-admin { background: linear-gradient(90deg, #2563eb, #06b6d4); color: #fff; }
.badge-mod { background: #7c3aed; color: #fff; }
.badge-solved { background: var(--success-soft); color: var(--success); }
.badge-pin { background: var(--primary-soft); color: var(--primary); }
.badge-lock { background: var(--danger-soft); color: var(--danger); }
.badge-hot { background: var(--warn-soft); color: var(--warn); }
.badge-op { background: var(--primary-soft); color: var(--primary); }
.rank { font-size: .76rem; font-weight: 700; }
.rank-admin { color: var(--primary); } .rank-mod { color: #8b5cf6; }
.rank-r1 { color: var(--muted); } .rank-r2 { color: #0ea5e9; } .rank-r3 { color: #10b981; } .rank-r4 { color: #f59e0b; } .rank-r5 { color: #ef4444; }

/* ---------- sidebar widgets ---------- */
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.statgrid div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 10px 12px; display: flex; flex-direction: column; }
.statgrid b { font-size: 1.3rem; letter-spacing: -.02em; }
.statgrid span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.statgrid.wide { grid-template-columns: repeat(4, 1fr); margin-bottom: 18px; }
.statgrid.wide div { background: var(--surface); box-shadow: var(--shadow); }
.linklist { list-style: none; margin: 0; padding: 0; }
.linklist li { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; }
.linklist li:last-child { border-bottom: 0; }
.linklist a { color: var(--text); font-weight: 550; font-size: .92rem; line-height: 1.35; }
.linklist a:hover { color: var(--primary); }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; }
.people a { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: .92rem; }
.card-cta { background: var(--hero); color: #fff; border: 0; }
.card-cta h3 { margin-bottom: 4px; }
.card-cta p { opacity: .85; margin: 0 0 12px; font-size: .9rem; }
.card-cta .btn-primary { background: #fff; color: #1e3a8a; }
.facts { margin: 14px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.facts div { display: flex; flex-direction: column; }
.facts dt { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.facts dd { margin: 0; font-weight: 650; }
.tips ul { margin: 0; padding-left: 18px; font-size: .9rem; }
.tips li { margin-bottom: 6px; }
.modform { display: flex; gap: 6px; margin-bottom: 8px; }
.modform select, .modform input { flex: 1; min-width: 0; height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; background: var(--surface-2); }

/* ---------- topic page ---------- */
.topic-head { margin-bottom: 18px; }
.topic-head h1 { font-size: 1.7rem; margin-bottom: 8px; word-wrap: break-word; }
.topic-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: .88rem; }
.solution-box { display: block; background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 35%, transparent); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; color: var(--text); text-decoration: none !important; }
.solution-box p { margin: 6px 0; color: var(--text-2); }
.solution-tag { background: var(--success); color: #fff; font-weight: 700; font-size: .78rem; padding: 2px 10px; border-radius: 20px; margin-right: 8px; }
.posts { display: flex; flex-direction: column; gap: 14px; }
.post { display: grid; grid-template-columns: 150px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: box-shadow .3s, border-color .3s; }
.post.by-staff { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); }
.post.is-solution { border: 2px solid var(--success); }
.post.flash-target { box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 35%, transparent); }
.post-author { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 10px; background: var(--surface-2); border-right: 1px solid var(--border); }
.post-author .name { font-weight: 700; color: var(--text); word-break: break-all; margin-top: 4px; }
.author-stats { font-size: .74rem; }
.post-main { display: flex; flex-direction: column; min-width: 0; }
.post-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 12px 18px 0; font-size: .85rem; }
.post-who { display: none; font-weight: 700; }
.post-who a { color: var(--text); }
.post-num { margin-left: auto; color: var(--muted); font-size: .8rem; }
.post-body { padding: 8px 18px 6px; flex: 1; }
.post-actions { display: flex; align-items: center; gap: 4px; padding: 8px 12px 10px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.post-actions form { display: inline; margin: 0; }
.post-actions .spacer { flex: 1; }
.act { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 8px; border: 0; background: none; color: var(--muted); font-size: .84rem; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.act:hover:not(:disabled) { background: var(--bg-2); color: var(--text); }
.act:disabled { cursor: default; opacity: .7; }
.act.danger:hover { color: var(--danger); background: var(--danger-soft); }
.act.like svg { width: 17px; height: 17px; }
.act.like.on { color: #e11d48; }
.act.like.on svg { fill: #e11d48; stroke: #e11d48; }
.act.like.pop svg { animation: heart .4s ease; }
@keyframes heart { 40% { transform: scale(1.35); } }
.act-solve { color: var(--success); }
.act-solve:hover { background: var(--success-soft) !important; color: var(--success) !important; }
.reply-box { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.reply-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.reply-head h3 { margin: 0; }
.cta-box { margin-top: 20px; text-align: center; background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 26px; }
.cta-box p { margin: 0 0 14px; }

/* ---------- markdown content ---------- */
.md { overflow-wrap: anywhere; color: var(--text-2); }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 .85em; }
.md h3, .md h4, .md h5 { color: var(--text); margin: 1.1em 0 .4em; }
.md ul, .md ol { padding-left: 1.4em; margin: 0 0 .9em; }
.md li.task { list-style: none; margin-left: -1.3em; }
.md code { font: .87em var(--mono); background: var(--inline-code); padding: .15em .4em; border-radius: 5px; }
.md pre.code, pre.code { position: relative; background: var(--code-bg); color: var(--code-tx); padding: 14px 16px; border-radius: 11px; overflow-x: auto; font: 13px/1.55 var(--mono); margin: 0 0 1em; }
pre.code code { background: none; padding: 0; color: inherit; font: inherit; }
pre.code[data-lang]::before { content: attr(data-lang); position: absolute; top: 6px; right: 10px; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: #64748b; }
.md blockquote { margin: 0 0 1em; padding: 8px 14px; border-left: 3px solid var(--primary); background: var(--surface-2); border-radius: 0 9px 9px 0; color: var(--muted); }
.md blockquote blockquote { background: var(--bg-2); }
.md img { max-height: 520px; border-radius: 10px; border: 1px solid var(--border); display: block; margin: 4px 0; }
.md .md-img { display: inline-block; }
.md hr { margin: 1em 0; }
.md a.mention { background: var(--primary-soft); padding: 0 5px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.spoiler { background: var(--text-2); color: transparent; border-radius: 4px; padding: 0 4px; cursor: pointer; transition: .2s; }
.spoiler.shown, .spoiler:focus { background: var(--bg-2); color: inherit; }
mark { background: color-mix(in srgb, #facc15 45%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }

/* ---------- composer ---------- */
.composer { position: relative; border: 1px solid var(--border-2); border-radius: 12px; background: var(--surface); overflow: visible; }
.composer:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.composer-bar { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; border-bottom: 1px solid var(--border); gap: 8px; flex-wrap: wrap; background: var(--surface-2); border-radius: 12px 12px 0 0; }
.composer .tabs { display: flex; gap: 2px; }
.composer .tabs button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-weight: 600; font-size: .85rem; color: var(--muted); cursor: pointer; }
.composer .tabs button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.composer .tools { display: flex; gap: 2px; flex-wrap: wrap; }
.composer .tools button, .composer .tools a { min-width: 32px; height: 30px; border: 0; background: none; border-radius: 7px; cursor: pointer; color: var(--text-2); font-size: .86rem; display: grid; place-items: center; text-decoration: none; padding: 0 6px; }
.composer .tools button:hover, .composer .tools a:hover { background: var(--bg-2); }
.composer textarea { display: block; width: 100%; border: 0; resize: vertical; padding: 14px; background: transparent; min-height: 140px; line-height: 1.55; font-size: .95rem; }
.composer textarea:focus { outline: none; box-shadow: none; }
.composer .preview { padding: 14px; min-height: 140px; }
.composer-foot { display: flex; justify-content: space-between; gap: 10px; font-size: .75rem; padding: 6px 12px; border-top: 1px solid var(--border); flex-wrap: wrap; }
.composer-foot code { font-size: .72rem; }
.composer.has-draft::after { content: "Draft restored"; position: absolute; top: -10px; right: 12px; background: var(--warn-soft); color: var(--warn); font-size: .7rem; font-weight: 700; padding: 1px 8px; border-radius: 20px; }
.mention-pop { position: absolute; left: 14px; bottom: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; z-index: 20; display: flex; flex-direction: column; }
.mention-pop button { border: 0; background: none; text-align: left; padding: 6px 12px; border-radius: 7px; cursor: pointer; font-weight: 600; }
.mention-pop button:hover { background: var(--bg-2); }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form h3 { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 650; font-size: .88rem; display: flex; justify-content: space-between; align-items: baseline; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=url], .field input[type=number], .field input[type=search], .field textarea, .field select,
.search-form input, .search-form select, .inline-form input, .inline-form select, .dialog textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field textarea:focus, .field select:focus, .search-form input:focus, .search-form select:focus, .inline-form input:focus, .dialog textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.field input[type=color] { width: 60px; height: 40px; padding: 2px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); }
.check, .radio { display: flex; align-items: flex-start; gap: 9px; font-size: .92rem; cursor: pointer; }
.check input, .radio input { margin-top: 4px; accent-color: var(--primary); width: 16px; height: 16px; flex-shrink: 0; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 18px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 140px; padding: 7px 10px; }
.inline-form .input-sm, .input-sm { flex: 0 0 auto; width: 120px; min-width: 0; padding: 5px 8px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--surface); }
.form-card h1 { font-size: 1.4rem; margin-bottom: 16px; }
.cat-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.cat-opt { position: relative; cursor: pointer; }
.cat-opt input { position: absolute; opacity: 0; }
.cat-opt span { display: inline-block; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--border-2); font-weight: 600; font-size: .88rem; transition: .15s; background: var(--surface); }
.cat-opt input:checked + span { border-color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 30%, transparent); }
.cat-opt input:focus-visible + span { box-shadow: var(--ring); }
.similar { background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 11px; padding: 12px 16px; }
.similar h4 { margin: 0 0 6px; font-size: .88rem; color: var(--warn); }
.similar ul { margin: 0; padding-left: 18px; font-size: .9rem; }
.strength { font-size: .78rem; font-weight: 600; }
.strength.s0, .strength.s1 { color: var(--danger); } .strength.s2 { color: var(--warn); } .strength.s3, .strength.s4, .strength.s5 { color: var(--success); }

/* ---------- auth ---------- */
.auth { display: grid; place-items: center; padding: 30px 0; }
.auth-card { width: 100%; max-width: 430px; padding: 30px; }
.auth-card h1 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-card > .muted { margin-top: 0; }
.auth-alt { text-align: center; margin: 18px 0 0; font-size: .92rem; color: var(--muted); }
.auth .empty-icon { font-size: 44px; }

/* ---------- search ---------- */
.search-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.search-form input[type=search] { flex: 1 1 260px; width: auto; }
.search-form select { width: auto; }
.results { display: flex; flex-direction: column; gap: 10px; }
.result { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; box-shadow: var(--shadow); }
.result h3 { margin: 0 0 4px; font-size: 1.02rem; }
.result h3 a { color: var(--text); }
.snippet { margin: 8px 0 0; color: var(--muted); font-size: .9rem; }

/* ---------- profile ---------- */
.profile-hero { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 18px; padding: 26px; position: relative; overflow: hidden; }
.profile-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 70px; background: var(--hero); opacity: .9; }
.profile-av { position: relative; z-index: 1; margin-top: 18px; }
.profile-av .avatar { border: 4px solid var(--surface); box-shadow: var(--shadow); }
.online-dot { position: absolute; right: 8px; bottom: 8px; width: 18px; height: 18px; border-radius: 50%; background: #22c55e; border: 3px solid var(--surface); }
.profile-info { flex: 1; min-width: 0; z-index: 1; margin-top: 70px; }
.profile-info h1 { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.profile-info .rank { margin: 2px 0 10px; }
.bio { margin-bottom: 10px; }
.profile-facts { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .88rem; }
.profile-side { z-index: 1; margin-top: 70px; display: flex; gap: 8px; }
.heat-card { margin-bottom: 18px; }
.heat { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 3px; overflow-x: auto; }
.heat i { border-radius: 3px; background: var(--bg-2); }
.heat i.h1 { background: color-mix(in srgb, var(--primary) 30%, var(--bg-2)); }
.heat i.h2 { background: color-mix(in srgb, var(--primary) 55%, var(--bg-2)); }
.heat i.h3 { background: color-mix(in srgb, var(--primary) 80%, var(--bg-2)); }
.heat i.h4 { background: var(--primary); }
.tabs-nav { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; overflow-x: auto; }
.tabs-nav a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; text-decoration: none; }
.tabs-nav a.on { color: var(--primary); border-color: var(--primary); }
.activity { display: flex; flex-direction: column; gap: 8px; }
.act-item { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 16px; }
.act-kind { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 800; }
.act-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: .9rem; }
.act-head a { color: var(--text); }
.act-item p { margin: 4px 0 0; font-size: .88rem; }

/* ---------- members ---------- */
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.member { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 18px 10px; color: var(--text); text-decoration: none !important; transition: transform .15s, border-color .15s; }
.member:hover { transform: translateY(-2px); border-color: var(--primary); }
.member b { margin-top: 6px; }
.member-grid.staff .member { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }

/* ---------- notifications ---------- */
.notif-list { padding: 6px; }
.notif { display: flex; gap: 14px; align-items: center; padding: 12px; border-radius: 10px; color: var(--text); text-decoration: none !important; }
.notif:hover { background: var(--bg-2); }
.notif.unread { background: var(--primary-soft); }
.notif-av { position: relative; flex-shrink: 0; }
.notif-ic { position: absolute; right: -4px; bottom: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-style: normal; font-weight: 800; color: #fff; background: var(--primary); border: 2px solid var(--surface); }
.notif-like { background: #e11d48; } .notif-solution { background: var(--success); } .notif-mention { background: #8b5cf6; }
.notif-text { font-size: .93rem; line-height: 1.45; }
.notif-text small { display: block; }

/* ---------- settings / admin ---------- */
.settings { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: 84px; display: flex; flex-direction: column; padding: 8px; }
.settings-nav a { padding: 9px 12px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: .92rem; text-decoration: none; }
.settings-nav a:hover { background: var(--bg-2); }
.settings-nav a.on { background: var(--primary-soft); color: var(--primary); }
.settings-body { display: flex; flex-direction: column; gap: 18px; }
.settings-body > .card h2 { font-size: 1.15rem; margin-bottom: 14px; }
.avatar-edit { display: flex; gap: 18px; align-items: center; }
.avatar-edit p { margin: 6px 0 0; }
.file-btn { cursor: pointer; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.danger-zone h2 { color: var(--danger); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.row-banned { opacity: .65; }
.usercell { display: inline-flex; align-items: center; gap: 8px; color: var(--text); }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.btnrow form { display: inline; }
.report { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.report blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--border-2); background: var(--surface-2); border-radius: 0 8px 8px 0; font-size: .9rem; }
details summary { cursor: pointer; margin: 8px 0; }

/* ---------- pagination ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin: 20px 0; }
.pager a, .pager span { min-width: 36px; height: 36px; padding: 0 10px; display: grid; place-items: center; border-radius: 9px; font-size: .88rem; font-weight: 600; }
.pager a { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); text-decoration: none; }
.pager a:hover { border-color: var(--primary); color: var(--primary); }
.pager .cur { background: var(--primary); color: #fff; }
.pager .off { color: var(--muted); opacity: .5; }
.pager .gap { color: var(--muted); }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 40px 20px; }
.empty.big { padding: 80px 20px; }
.empty-icon { font-size: 40px; margin-bottom: 6px; }
.empty p { margin: 6px 0 14px; }
.prose { max-width: 820px; margin: 0 auto; padding: 32px; }
.prose h1 { margin-bottom: 16px; }
.fmt-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.fmt-table th, .fmt-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; width: 50%; }
.fmt-table pre { margin: 4px 0 0; font: 12.5px var(--mono); white-space: pre-wrap; background: var(--surface-2); padding: 8px; border-radius: 8px; }
.dialog { border: 1px solid var(--border); border-radius: 16px; padding: 22px; background: var(--surface); color: var(--text); width: min(440px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(2, 6, 23, .55); backdrop-filter: blur(2px); }
.dialog form { display: flex; flex-direction: column; gap: 10px; }
.dialog h3 { margin: 0; }
.dialog p { margin: 0; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 28px 0; font-size: .9rem; }
.footer-inner { display: flex; gap: 28px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.footer p { margin: 2px 0 0; }
.footer-stats { display: flex; gap: 18px; color: var(--muted); }
.footer-stats b { color: var(--text); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .trow { grid-template-columns: 40px minmax(0, 1fr) 120px; }
  .trow-last { display: none; }
}
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; }
  .mainnav { display: none; position: absolute; top: 64px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; padding: 8px 12px; box-shadow: var(--shadow-lg); }
  .nav-open .mainnav { display: flex; }
  .navtoggle { display: inline-grid; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
}
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { gap: 10px; }
  .brand-text { display: none; }
  .searchbox { max-width: none; }
  .searchbox kbd { display: none; }
  .hide-sm { display: none; }
  .hero { padding: 28px 20px; border-radius: 16px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-search .btn { padding: 9px 12px; }
  .news-grid, .cat-grid { grid-template-columns: 1fr; }
  .news-card.featured { grid-row: auto; }
  .trow { grid-template-columns: 34px minmax(0, 1fr); padding: 12px 14px; gap: 10px; }
  .trow-av .avatar { width: 34px !important; height: 34px !important; }
  .trow-stats { grid-column: 2; justify-content: flex-start; gap: 16px; }
  .trow-stats div { flex-direction: row; gap: 4px; align-items: baseline; }
  .trow-stats b { font-size: .85rem; }
  .post { grid-template-columns: 1fr; }
  .post-author { display: none; }
  .post-who { display: inline; }
  .post-body { padding: 8px 14px 4px; }
  .post-head { padding: 12px 14px 0; }
  .statgrid.wide { grid-template-columns: repeat(2, 1fr); }
  .row2, .row3, .grid2 { grid-template-columns: 1fr; }
  .profile-hero { flex-direction: column; gap: 6px; }
  .profile-info, .profile-side { margin-top: 0; }
  .pagehead-actions { margin-left: 0; }
  .topic-head h1 { font-size: 1.35rem; }
  .composer-foot span:first-child { display: none; }
  .prose { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
