:root {
  color-scheme: light;
  --bg: #f2f4f5;
  --surface: #fff;
  --surface-2: #f7f8f8;
  --surface-3: #e9eeed;
  --text: #1c2526;
  --muted: #687476;
  --line: #d7dedd;
  --line-strong: #bdc8c6;
  --accent: #087f76;
  --accent-strong: #05645e;
  --accent-soft: #d9f0ed;
  --warm: #d65a3a;
  --warm-soft: #fbe6df;
  --danger: #b52e3b;
  --danger-soft: #fae5e7;
  --success: #237a49;
  --shadow: 0 1px 2px rgb(21 35 35 / .05), 0 8px 22px rgb(21 35 35 / .04);
  --radius: 10px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111718;
  --surface: #192122;
  --surface-2: #202a2b;
  --surface-3: #293536;
  --text: #edf2f1;
  --muted: #a1afad;
  --line: #304041;
  --line-strong: #46595a;
  --accent: #4dc7bc;
  --accent-strong: #72d9d0;
  --accent-soft: #173e3b;
  --warm: #f28a6d;
  --warm-soft: #49291f;
  --danger: #fb7d89;
  --danger-soft: #452127;
  --success: #78d49b;
  --shadow: 0 1px 2px rgb(0 0 0 / .2), 0 8px 22px rgb(0 0 0 / .15);
}

@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
    color-scheme: dark;
    --bg: #111718; --surface: #192122; --surface-2: #202a2b; --surface-3: #293536;
    --text: #edf2f1; --muted: #a1afad; --line: #304041; --line-strong: #46595a;
    --accent: #4dc7bc; --accent-strong: #72d9d0; --accent-soft: #173e3b;
    --warm: #f28a6d; --warm-soft: #49291f; --danger: #fb7d89; --danger-soft: #452127;
    --success: #78d49b; --shadow: 0 1px 2px rgb(0 0 0 / .2), 0 8px 22px rgb(0 0 0 / .15);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.48 var(--font); }
button, input, select, textarea { color: inherit; font: inherit; }
button, select { cursor: pointer; }
a { color: var(--accent-strong); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 3px; font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.18; letter-spacing: -.025em; }
h2 { margin-bottom: 5px; font-size: 1rem; line-height: 1.25; }
h3 { margin-bottom: 3px; font-size: .96rem; }
code { padding: 1px 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); font: .9em var(--mono); }
blockquote { margin: 10px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--surface-2); color: var(--muted); }
summary { cursor: pointer; }

.sr-only, .skip-link:not(:focus), .trap { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.skip-link:focus { position: fixed; z-index: 100; top: 6px; left: 6px; padding: 8px 12px; background: var(--surface); border: 2px solid var(--accent); }
.muted { color: var(--muted); }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.page-shell { width: min(1180px, calc(100% - 28px)); min-height: calc(100vh - 116px); margin: 18px auto 32px; }

.site-header { position: sticky; z-index: 30; top: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; gap: 15px; width: min(1180px, calc(100% - 28px)); min-height: 52px; margin: auto; }
.brand { display: inline-flex; align-items: center; gap: 7px; flex: none; color: var(--text); font-weight: 740; letter-spacing: -.015em; }
.brand:hover { text-decoration: none; }
.brand > span { padding: 3px 5px; border-radius: 5px; background: var(--text); color: var(--surface); font-size: .75rem; letter-spacing: .04em; }
.primary-nav { display: flex; align-items: center; gap: 2px; }
.primary-nav a, .account-nav > a { padding: 6px 8px; color: var(--muted); font-size: .86rem; font-weight: 600; }
.primary-nav a:hover, .account-nav > a:hover { color: var(--text); text-decoration: none; }
.nav-toggle { display: none; }
.header-search { display: flex; flex: 1; max-width: 310px; margin-left: auto; }
.header-search input { width: 100%; min-width: 80px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-right: 0; border-radius: 7px 0 0 7px; background: var(--surface-2); }
.header-search button { width: 38px; overflow: hidden; border: 1px solid var(--line); border-radius: 0 7px 7px 0; background: var(--surface-3); color: transparent; }
.header-search button::before { content: "⌕"; color: var(--text); font-size: 1.1rem; }
.account-nav { display: flex; align-items: center; gap: 2px; flex: none; }
.icon-link { position: relative; }
.icon-link b { position: absolute; top: 0; right: 1px; min-width: 15px; padding: 0 3px; border-radius: 8px; background: var(--warm); color: #fff; font-size: .65rem; line-height: 15px; text-align: center; }
.user-menu { position: relative; }
.user-menu > summary { display: flex; align-items: center; gap: 6px; padding: 4px; list-style: none; border-radius: 7px; font-size: .84rem; font-weight: 650; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-menu[open] > summary { background: var(--surface-2); }
.user-menu > div { position: absolute; top: calc(100% + 7px); right: 0; display: grid; width: 155px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.user-menu a, .user-menu button { width: 100%; padding: 7px 8px; border: 0; border-radius: 5px; background: none; color: var(--text); text-align: left; }
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); text-decoration: none; }
.theme-toggle { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--text); font-weight: 670; line-height: 1.1; text-decoration: none; }
.button:hover { border-color: var(--accent); text-decoration: none; }
.button.primary { border-color: var(--accent-strong); background: var(--accent-strong); color: #fff; }
.button.primary:hover { filter: brightness(1.08); }
.button.compact { min-height: 30px; padding: 5px 9px; font-size: .82rem; }
.button.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button.danger { border-color: var(--danger); background: var(--danger); color: #fff; }
.button.full { width: 100%; }
.text-button, .post-actions a { padding: 3px 5px; border: 0; background: none; color: var(--muted); font-size: .8rem; }
.text-button:hover, .post-actions a:hover, .text-button.active { color: var(--accent-strong); }
.text-button span { margin-left: 2px; font-weight: 700; }

.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 0 0 13px; }
.page-intro p, .topic-header p { margin: 0; color: var(--muted); }
.compact-intro { align-items: center; }
.mini-stats, .profile-stats { display: flex; gap: 5px; }
.mini-stats span, .profile-stats span { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--muted); font-size: .75rem; }
.mini-stats b, .profile-stats b { color: var(--text); }
.action-cluster { display: flex; align-items: center; gap: 6px; }
.action-cluster form { display: contents; }
.breadcrumbs { display: flex; gap: 7px; align-items: center; margin: -4px 0 11px; color: var(--muted); font-size: .78rem; }
.breadcrumbs span:last-child { max-width: 60ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag, .role { display: inline-block; padding: 2px 5px; border-radius: 4px; background: var(--surface-3); color: var(--muted); font-size: .64rem; font-weight: 750; line-height: 1.2; text-transform: uppercase; vertical-align: middle; letter-spacing: .035em; }
.tag.announcement, .role.admin { background: var(--warm-soft); color: var(--warm); }
.tag.sticky, .role.moderator { background: var(--accent-soft); color: var(--accent-strong); }
.tag.solved { background: color-mix(in srgb, var(--success) 14%, transparent); color: var(--success); }

.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; align-items: start; }
.forum-index, .side-stack { display: grid; gap: 12px; }
.category-block { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.category-block > header { display: flex; align-items: center; min-height: 38px; padding: 7px 11px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.category-block > header h2 { margin: 0; font-size: .88rem; text-transform: uppercase; letter-spacing: .045em; }
.category-block > header p { display: inline; margin: 0 0 0 7px; color: var(--muted); font-size: .76rem; }
.category-block > header h2, .category-block > header p { display: inline; }
.forum-row { display: grid; grid-template-columns: 35px minmax(0, 1fr) 108px 215px; gap: 10px; align-items: center; min-height: 66px; padding: 9px 11px; border-bottom: 1px solid var(--line); }
.forum-row:last-child { border-bottom: 0; }
.forum-row:hover { background: color-mix(in srgb, var(--accent-soft) 25%, transparent); }
.forum-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px 4px 9px 4px; background: var(--accent-soft); color: var(--accent-strong); font-weight: 800; }
.forum-mark:hover { text-decoration: none; }
.forum-main h3 { margin: 0 0 2px; }
.forum-main h3 .tag { margin-left: 5px; }
.forum-main p { margin: 0; color: var(--muted); font-size: .8rem; }
.forum-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; color: var(--muted); font-size: .68rem; text-align: center; }
.forum-counts b { display: block; color: var(--text); font-size: .85rem; }
.forum-latest { min-width: 0; }
.forum-latest > a { display: block; overflow: hidden; color: var(--text); font-size: .8rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.forum-latest small { display: block; overflow: hidden; color: var(--muted); font-size: .69rem; text-overflow: ellipsis; white-space: nowrap; }
.forum-latest time { display: inline; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; min-height: 38px; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0; font-size: .88rem; }
.panel-heading > a, .panel-heading > span { color: var(--muted); font-size: .72rem; }
.activity-list article { display: flex; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.activity-list article:last-child { border-bottom: 0; }
.activity-list p { min-width: 0; margin: 0; }
.activity-list p > a { display: block; overflow: hidden; color: var(--text); font-size: .8rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.activity-list small { display: block; color: var(--muted); font-size: .68rem; }
.member-chips { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px; }
.member-chips a { padding: 3px 6px; border-radius: 5px; background: var(--surface-2); color: var(--text); font-size: .73rem; }

.avatar { display: inline-grid; place-items: center; width: 42px; height: 42px; flex: none; border: 1px solid color-mix(in srgb, currentColor 14%, transparent); border-radius: 11px 5px 11px 5px; color: #17403f; font-size: .78rem; font-weight: 800; letter-spacing: .02em; }
.avatar-sm { width: 27px; height: 27px; border-radius: 7px 3px 7px 3px; font-size: .62rem; }
.avatar-1 { background: #bfe8e3; }.avatar-2 { background: #f5d2be; color: #5c2918; }.avatar-3 { background: #cfd9f3; color: #26385e; }
.avatar-4 { background: #e6d0ed; color: #4d2a59; }.avatar-5 { background: #e8e1b9; color: #524916; }.avatar-6 { background: #c9e3c6; color: #264c24; }

.topic-list { overflow: hidden; }
.topic-list-head, .topic-row { display: grid; grid-template-columns: minmax(0, 1fr) 115px 165px; gap: 12px; align-items: center; }
.topic-list-head { min-height: 34px; padding: 7px 11px; border-bottom: 1px solid var(--line); background: var(--surface-2); color: var(--muted); font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.topic-row { min-height: 57px; padding: 8px 11px; border-bottom: 1px solid var(--line); }
.topic-row:last-child { border-bottom: 0; }
.topic-row:hover { background: color-mix(in srgb, var(--accent-soft) 22%, transparent); }
.topic-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.status-dot { width: 8px; height: 8px; flex: none; border: 2px solid var(--line-strong); border-radius: 50%; }
.topic-row.unread .status-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.topic-main h2 { margin: 0 0 2px; font-size: .89rem; }
.topic-main h2 > a { color: var(--text); }
.topic-main p { margin: 0; color: var(--muted); font-size: .7rem; }
.topic-counts { display: flex; gap: 10px; color: var(--muted); font-size: .67rem; }
.topic-counts b { display: block; color: var(--text); font-size: .8rem; }
.topic-latest { display: grid; color: var(--text); font-size: .73rem; }
.topic-latest small { color: var(--muted); font-size: .68rem; }
.pagination { display: flex; gap: 3px; align-items: center; justify-content: flex-end; margin: 10px 0; }
.pagination a, .pagination > span { min-width: 28px; padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--muted); font-size: .75rem; text-align: center; }
.pagination .current { border-color: var(--accent); background: var(--accent); color: #fff; }

.topic-header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.title-line { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.title-line h1 { margin: 0; }
.poll { margin: 10px 0; }
.poll form { padding: 10px; }
.poll-option { display: grid; grid-template-columns: minmax(120px, 230px) 1fr 75px; gap: 9px; align-items: center; min-height: 30px; font-size: .8rem; }
.poll-bar { height: 7px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.poll-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.poll-option small { color: var(--muted); text-align: right; }
.post-list { display: grid; gap: 9px; }
.post { display: grid; grid-template-columns: 165px minmax(0, 1fr); scroll-margin-top: 62px; overflow: hidden; }
.post-author { display: flex; flex-direction: column; gap: 8px; padding: 11px; border-right: 1px solid var(--line); background: var(--surface-2); }
.post-author > div { display: grid; gap: 2px; }
.author-name { color: var(--text); font-weight: 750; }
.post-author small { color: var(--muted); font-size: .67rem; }
.post-content { min-width: 0; }
.post-content > header { display: flex; gap: 8px; align-items: center; min-height: 34px; padding: 6px 10px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .7rem; }
.post-content > header > a { margin-left: auto; color: var(--muted); }
.post-body { min-height: 82px; padding: 12px 13px; overflow-wrap: anywhere; line-height: 1.6; }
.post-body p:last-child { margin-bottom: 0; }
.inline-code { white-space: pre-wrap; }
.signature { margin: 0 13px; padding: 8px 0; border-top: 1px dashed var(--line); color: var(--muted); font-size: .74rem; }
.post-actions { display: flex; gap: 3px; align-items: center; justify-content: flex-end; min-height: 31px; padding: 3px 8px; border-top: 1px solid var(--line); }
.post-actions form { display: contents; }
.hidden-post { opacity: .8; }
.attachments { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 13px 10px; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.attachments > strong { width: 100%; font-size: .72rem; }
.attachments a { display: flex; gap: 7px; padding: 4px 7px; border-radius: 5px; background: var(--surface); font-size: .73rem; }
.attachments small { color: var(--muted); }
.quick-reply { margin-top: 12px; padding: 11px; }
.quick-reply textarea { width: 100%; }
.sign-in-prompt { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding: 11px; }
.moderator-tools { margin-top: 10px; padding: 0; }
.moderator-tools > summary { padding: 9px 11px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.moderator-tools form { display: grid; grid-template-columns: 150px 1fr 1fr auto; gap: 8px; align-items: end; padding: 10px; border-top: 1px solid var(--line); }

input, select, textarea { max-width: 100%; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); outline: none; }
input, select { min-height: 35px; padding: 6px 8px; }
textarea { padding: 8px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
label { display: grid; gap: 4px; color: var(--text); font-size: .78rem; font-weight: 680; }
label small { color: var(--muted); font-weight: 450; }
label.check { display: flex; align-items: center; gap: 7px; }
label.check input { min-height: auto; }
.form-page { width: min(820px, 100%); margin: 0 auto; }
.form-page.narrow { width: min(600px, 100%); }
.editor-form, .stacked-form { display: grid; gap: 11px; padding: 13px; }
.form-heading { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.form-heading h1, .form-heading h2 { margin: 0; }
.form-heading p { margin: 2px 0 0; color: var(--muted); font-size: .78rem; }
.field-grid { display: grid; gap: 9px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }
.form-actions { display: flex; gap: 7px; align-items: center; }
.editor-toolbar { display: flex; align-items: center; gap: 3px; margin-bottom: -7px; }
.editor-toolbar button { min-width: 29px; min-height: 27px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); font-size: .74rem; }
.editor-toolbar span { margin-left: auto; color: var(--muted); font-size: .68rem; }
.optional-fields { border: 1px solid var(--line); border-radius: 7px; }
.optional-fields > summary { padding: 7px 9px; color: var(--muted); font-size: .76rem; }
.optional-fields > div { padding: 9px; border-top: 1px solid var(--line); }
.file-field { padding: 8px; border: 1px dashed var(--line-strong); border-radius: 7px; background: var(--surface-2); }
.file-field input { border: 0; background: transparent; }
.compact-file { display: flex; align-items: center; justify-content: space-between; }
.editor-preview { padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); }
.editor-preview > div { margin-top: 5px; }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding: 10px 12px; border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.danger-zone p { margin: 1px 0 0; color: var(--muted); font-size: .75rem; }

.auth-layout { display: grid; grid-template-columns: minmax(0, 480px) 270px; gap: 28px; align-items: center; justify-content: center; min-height: calc(100vh - 170px); }
.auth-card { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.auth-card.wide { width: 520px; max-width: 100%; }
.auth-links { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .75rem; }
.auth-aside { color: var(--muted); }
.auth-aside strong { color: var(--text); font-size: 1.1rem; }
.auth-aside ul { padding-left: 18px; }
.auth-aside li { margin: 6px 0; }
.setup-page { display: grid; min-height: 100vh; place-items: center; padding: 15px; }
.setup-page .auth-card { width: min(480px, 100%); }

.search-form { display: grid; grid-template-columns: 1fr 150px auto; gap: 7px; padding: 9px; }
.result-summary { display: flex; gap: 6px; margin: 13px 2px 7px; color: var(--muted); font-size: .8rem; }
.search-results { overflow: hidden; }
.search-results article { display: grid; grid-template-columns: 30px 1fr; gap: 9px; padding: 10px; border-bottom: 1px solid var(--line); }
.search-results article:last-child { border-bottom: 0; }
.search-results h2 { margin: 0 0 3px; }
.search-results p { margin: 0 0 3px; color: var(--muted); font-size: .78rem; }
.search-results small { color: var(--muted); font-size: .68rem; }
.inline-filter { display: flex; gap: 6px; align-items: center; }
.inline-filter input { min-width: 220px; }
.member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.member-card { display: flex; align-items: center; gap: 10px; padding: 11px; }
.member-card h2 { margin: 0; }
.member-card p, .member-card small { margin: 0; color: var(--muted); font-size: .7rem; }

.profile-head { display: flex; justify-content: space-between; align-items: center; padding: 13px; }
.profile-identity { display: flex; align-items: center; gap: 12px; }
.profile-identity > .avatar { width: 58px; height: 58px; font-size: 1rem; }
.profile-identity p, .profile-identity small { margin: 0; color: var(--muted); }
.profile-actions { display: flex; gap: 5px; align-items: center; }
.profile-actions form { display: contents; }
.profile-actions details { position: relative; }
.profile-actions details form { position: absolute; z-index: 2; top: 34px; right: 0; width: 135px; padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.profile-actions details button { padding: 6px; border: 0; background: transparent; font-size: .76rem; }
.profile-stats { margin: 8px 0; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.profile-about, .profile-posts { grid-column: span 1; }
.profile-about { grid-row: span 2; }
.profile-about > p, .profile-about > a { margin: 10px; }
.simple-list { display: grid; }
.simple-list > a { display: grid; padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--text); }
.simple-list > a:last-child { border: 0; }
.simple-list small { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.simple-list > p { padding: 10px; }

.messages-layout, .settings-layout, .admin-layout, .doc-layout { display: grid; grid-template-columns: 175px minmax(0, 1fr); gap: 10px; align-items: start; }
.subnav { display: grid; padding: 5px; position: sticky; top: 70px; }
.subnav a { display: flex; justify-content: space-between; padding: 7px 8px; border-radius: 5px; color: var(--muted); font-size: .78rem; font-weight: 650; }
.subnav a:hover, .subnav a.active { background: var(--surface-2); color: var(--text); text-decoration: none; }
.subnav b { min-width: 17px; border-radius: 8px; background: var(--warm); color: #fff; font-size: .65rem; text-align: center; }
.message-panel { min-height: 340px; overflow: hidden; }
.message-list { display: grid; }
.message-row, .notification-row { display: flex; gap: 9px; align-items: center; padding: 9px 11px; border-bottom: 1px solid var(--line); color: var(--text); }
.message-row:hover, .notification-row:hover { background: var(--surface-2); text-decoration: none; }
.message-row.unread, .notification-row.unread { border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent-soft) 30%, transparent); }
.message-row > span, .notification-row > span { display: grid; }
.message-row small, .notification-row small { color: var(--muted); font-size: .69rem; }
.message-detail header { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.message-detail h2, .message-detail p { margin: 0; }
.message-detail p { color: var(--muted); font-size: .72rem; }
.notification-list { overflow: hidden; }
.settings-content, .admin-content { display: grid; gap: 10px; min-width: 0; }
.theme-choices { display: flex; gap: 6px; padding: 10px; }
.theme-choices button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }

.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.admin-stats article { display: grid; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.admin-stats span { color: var(--muted); font-size: .7rem; }
.admin-stats b { font-size: 1.35rem; }
.admin-table > div, .audit-list > div { display: grid; grid-template-columns: 1fr auto 160px; gap: 10px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.admin-table span:first-child, .audit-list span { display: grid; }
.admin-table small, .audit-list small { color: var(--muted); font-size: .68rem; }
.edit-list > details { border-bottom: 1px solid var(--line); }
.edit-list > details > summary { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; list-style: none; }
.edit-list summary > span { display: grid; }
.edit-list summary small, .edit-list summary b { color: var(--muted); font-size: .68rem; font-weight: 500; }
.edit-list form, .user-admin-list form { display: grid; grid-template-columns: 1fr 2fr 90px auto; gap: 7px; align-items: end; padding: 9px 10px; border-top: 1px solid var(--line); background: var(--surface-2); }
.create-row > summary { color: var(--accent-strong); font-weight: 700; }
.user-admin-list { display: grid; gap: 7px; }
.user-admin-list details { overflow: hidden; }
.user-admin-list summary { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; }
.user-admin-list summary > span { display: grid; }
.user-admin-list small { color: var(--muted); font-size: .68rem; }
.report-list article { padding: 10px; border-bottom: 1px solid var(--line); }
.report-list article:last-child { border: 0; }
.report-list header { display: flex; justify-content: space-between; }
.report-list header span { display: grid; }
.report-list header small { color: var(--muted); font-size: .68rem; }
.report-list p { margin: 7px 0; color: var(--muted); }
.report-list blockquote { font-size: .75rem; }
.report-list form { display: flex; gap: 6px; }
.report-list form input { flex: 1; }
.audit-list > div { grid-template-columns: 1fr 150px; }

.document { padding: 14px 16px; }
.document section { scroll-margin-top: 70px; padding-bottom: 10px; }
.document section + section { padding-top: 10px; border-top: 1px solid var(--line); }
.document p { color: var(--muted); line-height: 1.65; }
.state-page { display: grid; place-items: center; width: min(520px,100%); margin: 12vh auto 0; padding: 25px; text-align: center; }
.state-mark { color: var(--accent); font: 800 1.2rem var(--mono); }
.empty { padding: 30px 12px; color: var(--muted); text-align: center; }
.empty.compact { padding: 12px; }
.empty h2 { margin-bottom: 3px; color: var(--text); }
.notice { margin: 0 0 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.notice.error { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: var(--danger-soft); color: var(--danger); }
.notice.info { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.notice.warning { border-color: color-mix(in srgb, var(--warm) 40%, var(--line)); background: var(--warm-soft); }
.toast { position: fixed; z-index: 50; top: 61px; left: 50%; display: flex; align-items: center; gap: 14px; max-width: calc(100% - 24px); padding: 8px 11px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 7px; background: var(--surface); box-shadow: var(--shadow); }
.toast.success { border-color: color-mix(in srgb, var(--success) 45%, var(--line)); }
.toast button { border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface); }
.site-footer > div { display: flex; gap: 16px; align-items: center; width: min(1180px,calc(100% - 28px)); min-height: 48px; margin: auto; color: var(--muted); font-size: .72rem; }
.site-footer nav { display: flex; gap: 12px; }
.site-footer small { margin-left: auto; }

@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
  .header-inner { gap: 6px; }
  .primary-nav { display: none; position: absolute; top: 52px; left: 14px; right: 14px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
  .primary-nav.open { display: flex; }
  .nav-toggle { display: block; padding: 5px 7px; border: 0; background: transparent; color: var(--muted); font-size: .75rem; }
  .header-search { max-width: none; }
  .icon-link span { display: none; }
  .user-menu > summary > span { display: none; }
  .forum-row { grid-template-columns: 35px minmax(0,1fr) 85px; }
  .forum-latest { display: none; }
  .post { grid-template-columns: 125px minmax(0,1fr); }
  .member-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 650px) {
  body { font-size: 13.5px; }
  .page-shell { width: min(100% - 16px, 1180px); margin-top: 12px; }
  .header-inner { width: calc(100% - 16px); }
  .brand { font-size: 0; }
  .brand > span { font-size: .73rem; }
  .header-search { order: 5; display: none; position: absolute; top: 53px; left: 8px; right: 8px; }
  .account-nav > a:not(.button) { padding-inline: 5px; }
  .icon-link { display: none; }
  .page-intro { align-items: start; }
  .compact-intro { display: grid; }
  .mini-stats { width: 100%; }
  .mini-stats span { flex: 1; text-align: center; }
  .side-stack { grid-template-columns: 1fr; }
  .category-block > header p { display: none; }
  .forum-row { grid-template-columns: 32px minmax(0,1fr); min-height: 60px; padding: 8px; }
  .forum-counts { display: none; }
  .topic-list-head { display: none; }
  .topic-row { grid-template-columns: 1fr auto; padding: 8px; }
  .topic-counts { display: none; }
  .topic-latest { font-size: 0; text-align: right; }
  .topic-latest small { font-size: .65rem; }
  .topic-header { display: grid; }
  .action-cluster { flex-wrap: wrap; }
  .post { display: block; }
  .post-author { flex-direction: row; align-items: center; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .post-author > a .avatar { width: 32px; height: 32px; }
  .post-author small { display: inline; margin-right: 7px; }
  .post-author small:last-child { display: none; }
  .post-body { min-height: 65px; padding: 10px; }
  .poll-option { grid-template-columns: 1fr 80px; }
  .poll-bar { grid-row: 2; grid-column: 1 / -1; }
  .moderator-tools form { grid-template-columns: 1fr 1fr; }
  .field-grid.two, .member-grid, .profile-grid { grid-template-columns: 1fr; }
  .profile-about, .profile-posts { grid-column: auto; }
  .auth-layout { display: block; min-height: auto; }
  .auth-aside { display: none; }
  .auth-card { padding: 14px; }
  .auth-links { display: grid; gap: 7px; }
  .search-form { grid-template-columns: 1fr auto; }
  .search-form label:nth-child(3) { display: none; }
  .inline-filter { flex-wrap: wrap; }
  .inline-filter input { min-width: 0; flex: 1; }
  .profile-head { align-items: start; }
  .profile-identity > .avatar { width: 45px; height: 45px; }
  .profile-actions { flex-wrap: wrap; justify-content: flex-end; }
  .profile-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .messages-layout, .settings-layout, .admin-layout, .doc-layout { display: block; }
  .subnav { position: static; display: flex; gap: 2px; overflow-x: auto; margin-bottom: 8px; white-space: nowrap; }
  .subnav a { flex: none; }
  .admin-stats { grid-template-columns: 1fr 1fr; }
  .admin-table > div { grid-template-columns: 1fr auto; }
  .admin-table > div > small { display: none; }
  .edit-list form, .user-admin-list form { grid-template-columns: 1fr 1fr; }
  .report-list form { display: grid; }
  .audit-list > div { grid-template-columns: 1fr; }
  .site-footer > div { flex-wrap: wrap; gap: 6px 12px; padding: 9px 0; }
  .site-footer small { width: 100%; margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; transition: none!important; animation: none!important; }
}
