/* Agora Forum — default theme
   Colors are variables so each forum can restyle without touching this file. */

:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface-2: #f0ece6;
  --text: #22201d;
  --text-muted: #6b655d;
  --border: #e2ddd5;
  --accent: #b5532c;
  --accent-hover: #9a4422;
  --accent-text: #ffffff;
  --accent-soft: #fdf5f1;
  --success: #2f7a4b;
  --success-soft: #e3f2e8;
  --danger: #b3261e;
  --danger-soft: #fbe5e3;
  --info-soft: #e7eef8;
  --focus: #2b6cb0;
  --radius: 10px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: var(--font);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171614;
    --surface: #211f1c;
    --surface-2: #2a2824;
    --text: #ece8e2;
    --text-muted: #a39c92;
    --border: #36332e;
    --accent: #e8875f;
    --accent-hover: #f09d79;
    --accent-text: #1b120d;
    --accent-soft: #3a2a22;
    --success: #6cc08b;
    --success-soft: #1f3327;
    --danger: #f08a82;
    --danger-soft: #3d2220;
    --info-soft: #1f2a38;
    --focus: #7fb0ec;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #171614;
  --surface: #211f1c;
  --surface-2: #2a2824;
  --text: #ece8e2;
  --text-muted: #a39c92;
  --border: #36332e;
  --accent: #e8875f;
  --accent-hover: #f09d79;
  --accent-text: #1b120d;
  --accent-soft: #3a2a22;
  --success: #6cc08b;
  --success-soft: #1f3327;
  --danger: #f08a82;
  --danger-soft: #3d2220;
  --info-soft: #1f2a38;
  --focus: #7fb0ec;
  --shadow: none;
  color-scheme: dark;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; font-family: var(--font-heading); }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--surface); padding: 8px 12px; border-radius: var(--radius); z-index: 10;
}
.skip-link:focus { left: 8px; }

.container { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header & footer ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 24px;
  min-height: 60px; flex-wrap: wrap;
}
.site-name {
  font-weight: 700; font-size: 1.15rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 50vw;
}
.site-name:hover { text-decoration: none; color: var(--accent); }

.site-nav { display: flex; gap: 4px; }
.site-nav a {
  color: var(--text-muted); padding: 6px 10px; border-radius: 8px; font-weight: 500;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-button {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.theme-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; display: none; }
:root:not([data-theme-choice]) .theme-icon--auto,
:root[data-theme-choice="auto"] .theme-icon--auto,
:root[data-theme-choice="light"] .theme-icon--light,
:root[data-theme-choice="dark"] .theme-icon--dark { display: block; }

.user-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }

.inline-form { display: inline; margin: 0; }

.site-main { flex: 1; padding-top: 28px; padding-bottom: 48px; }

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: .875rem;
  padding: 20px 0;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text);
  font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-decoration: none;
}
.button:hover { background: var(--surface-2); text-decoration: none; }
.button--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.button--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button--quiet { border-color: transparent; background: none; color: var(--text-muted); }
.button--quiet:hover { color: var(--text); background: var(--surface-2); }
.button--wide { width: 100%; }

/* ---------- Layout pieces ---------- */

.with-sidebar { display: grid; grid-template-columns: 220px 1fr; gap: 32px; align-items: start; }

.sidebar { position: sticky; top: 20px; display: grid; gap: 16px; }

.category-nav { display: grid; gap: 2px; }
.category-nav a {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 10px; border-radius: 8px; color: var(--text-muted);
}
.category-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.category-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.count { color: var(--text-muted); font-size: .85em; font-variant-numeric: tabular-nums; }

.page-header { margin-bottom: 18px; }
.lede { color: var(--text-muted); margin: 0 0 1em; }

.narrow { max-width: 560px; margin: 0 auto; }
.narrow--small { max-width: 400px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card__title { font-size: 1rem; margin: 4px 0 14px; }
.card__title:not(:first-child) { margin-top: 26px; }

/* ---------- Discussion list ---------- */

.discussion-list {
  list-style: none; margin: 0; padding: 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.discussion-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.discussion-item + .discussion-item { border-top: 1px solid var(--border); }
.discussion-item__main { flex: 1; min-width: 0; }
.discussion-item__title { color: var(--text); font-weight: 600; font-size: 1.02rem; overflow-wrap: anywhere; }
.discussion-item__title:hover { color: var(--accent); }
.meta { color: var(--text-muted); font-size: .85rem; margin-top: 2px; }
.meta a { color: inherit; }
.reply-count {
  min-width: 36px; text-align: center; font-weight: 600; font-size: .85rem;
  color: var(--text-muted); background: var(--surface-2); border-radius: 999px; padding: 2px 8px;
}

.avatar {
  flex: none; display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}
.user-chip .avatar { width: 30px; height: 30px; font-size: .85rem; }

.badge {
  display: inline-block; font-size: .75rem; font-weight: 600; padding: 0 7px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); margin-right: 4px;
}

.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; color: var(--text-muted); }

.empty-state {
  text-align: center; padding: 48px 20px;
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--text-muted);
}
.empty-state svg { width: 48px; height: 48px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; margin-bottom: 8px; }
.empty-state h2 { color: var(--text); }
.empty-state p { margin: 0; }

/* ---------- Tags ---------- */

.tag-cloud { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  display: inline-flex; gap: 6px; align-items: center;
  padding: 4px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 500;
}
.tag:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
.field__hint { margin: 0 0 6px; color: var(--text-muted); font-size: .875rem; }
/* Text-style boxes only — radio buttons, checkboxes and color pickers keep their own size */
.field input:not([type="radio"]):not([type="checkbox"]):not([type="color"]), .field textarea, .field select {
  width: 100%; min-height: 42px; padding: 8px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
.field input:focus { border-color: var(--focus); outline: 2px solid var(--focus); outline-offset: 0; }
.field--error input { border-color: var(--danger); }
.field__error { margin: 6px 0 0; color: var(--danger); font-size: .875rem; font-weight: 500; }

/* ---------- Notices ---------- */

.notice { padding: 12px 14px; border-radius: 8px; margin-bottom: 16px; background: var(--info-soft); }
.notice--success { background: var(--success-soft); color: var(--success); font-weight: 500; }
.notice--error { background: var(--danger-soft); color: var(--danger); font-weight: 500; }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checklist__item { display: flex; gap: 10px; align-items: flex-start; }
.checklist__mark {
  flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
}
.checklist__item--ok .checklist__mark { background: var(--success-soft); color: var(--success); }
.checklist__item--fail .checklist__mark { background: var(--danger-soft); color: var(--danger); }
.checklist__detail { display: block; color: var(--text-muted); font-size: .875rem; }

.message-page { text-align: center; padding-top: 40px; }
.debug {
  text-align: left; white-space: pre-wrap; overflow-wrap: anywhere;
  background: var(--surface-2); padding: 12px; border-radius: 8px; font-size: .85rem;
}

/* ---------- Accounts ---------- */

:root { --warning-soft: #fdf1d8; --warning: #7a5200; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --warning-soft: #3a2f17; --warning: #f0c56a; }
}
:root[data-theme="dark"] { --warning-soft: #3a2f17; --warning: #f0c56a; }

.notice--warning { background: var(--warning-soft); color: var(--warning); }
.notice .inline-form { margin-left: 4px; }

.link-button {
  background: none; border: 0; padding: 0; font: inherit; font-weight: 600;
  color: inherit; text-decoration: underline; cursor: pointer;
}

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.user-chip { color: var(--text); padding: 3px 8px 3px 3px; border-radius: 999px; }
.user-chip:hover { background: var(--surface-2); text-decoration: none; }

img.avatar { object-fit: cover; background: var(--surface-2); }
.avatar--large { width: 96px; height: 96px; font-size: 2.4rem; }

.optional { font-weight: 400; color: var(--text-muted); font-size: .875rem; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.label-row a { font-size: .875rem; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.field input[type="file"] { min-height: 0; padding: 8px; background: var(--surface); }
.checkbox-field label { display: flex; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.checkbox-field input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }

/* Spam trap: off-screen for people, still in the page for bots */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.profile__header { display: flex; gap: 20px; align-items: flex-start; }
.profile__info { flex: 1; min-width: 0; }
.profile__info h1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; overflow-wrap: anywhere; }
.profile__info h1 .badge { font-size: .8rem; }
.profile__bio { margin: 12px 0 0; overflow-wrap: anywhere; }
.profile__edit { flex: none; }
.profile > h2 { margin-top: 28px; }

.stats { display: flex; gap: 28px; margin: 16px 0 0; }
.stats div { display: flex; flex-direction: column-reverse; }
.stats dt { color: var(--text-muted); font-size: .85rem; }
.stats dd { margin: 0; font-weight: 700; font-size: 1.25rem; }

.excerpt { margin: 4px 0 0; color: var(--text-muted); font-size: .95rem; overflow-wrap: anywhere; }

.avatar-editor { display: flex; gap: 20px; align-items: flex-start; }
.avatar-editor__forms { flex: 1; min-width: 0; display: grid; gap: 8px; justify-items: start; }
.avatar-upload { width: 100%; }

/* ---------- Discussions ---------- */

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.icon--small { width: 14px; height: 14px; }
.reply-count { display: inline-flex; align-items: center; gap: 4px; justify-content: center; }

.badge--muted { background: var(--surface-2); color: var(--text-muted); }

.tag-list { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag--small { padding: 1px 9px; font-size: .8rem; }
button.tag { font: inherit; font-size: .8rem; cursor: pointer; }
button.tag[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.filter { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-muted); margin: 0; }
.filter__clear { font-size: .875rem; }

.breadcrumb { margin: 0 0 4px; font-size: .9rem; font-weight: 600; }
.discussion__header { margin-bottom: 20px; }
.discussion__header h1 { overflow-wrap: anywhere; margin-bottom: 4px; }

.posts { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.post {
  display: flex; gap: 14px; padding: 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.post:target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.post__main { flex: 1; min-width: 0; }
.post__header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; font-size: .9rem; }
.post__author { font-weight: 700; color: var(--text); }
.post__time, .post__edited { color: var(--text-muted); }

/* Text written by members */
.post-body { overflow-wrap: anywhere; }
.post-body > :first-child { margin-top: 0; }
.post-body > :last-child { margin-bottom: 0; }
.post-body p, .post-body ul, .post-body ol, .post-body pre, .post-body blockquote { margin: 0 0 .9em; }
.post-body h3, .post-body h4, .post-body h5 { margin: 1.2em 0 .5em; }
.post-body h3 { font-size: 1.2rem; } .post-body h4 { font-size: 1.05rem; } .post-body h5 { font-size: 1rem; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body img { max-width: 100%; height: auto; border-radius: 8px; }
.post-body blockquote {
  margin-left: 0; padding: 4px 0 4px 14px; border-left: 3px solid var(--border); color: var(--text-muted);
}
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em;
  background: var(--surface-2); padding: 1px 5px; border-radius: 4px;
}
.post-body pre { background: var(--surface-2); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.post-body pre code { background: none; padding: 0; }
.post-body hr { border: 0; border-top: 1px solid var(--border); margin: 1.4em 0; }
.post-body a { text-decoration: underline; text-underline-offset: 2px; }

.reply__form { display: flex; gap: 14px; }
.reply__fields { flex: 1; min-width: 0; }

/* Editor */
.narrow--wide { max-width: 760px; }
.editor__bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; margin-bottom: 6px; }
.editor__bar label { margin: 0; }
.editor__tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 8px; }
.editor__tabs button {
  border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 600;
  padding: 3px 12px; border-radius: 6px; color: var(--text-muted); cursor: pointer;
}
.editor__tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.editor textarea { min-height: 160px; }
.editor__preview { border: 1px dashed var(--border); border-radius: 8px; padding: 12px; background: var(--bg); }
.editor__help { margin-top: 8px; font-size: .875rem; color: var(--text-muted); }
.editor__help summary { cursor: pointer; width: max-content; }
.editor__help table { border-collapse: collapse; margin-top: 8px; }
.editor__help td { padding: 3px 14px 3px 0; vertical-align: top; }
.editor__help code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: .85rem; }

.field select { appearance: auto; }
.field-row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 16px; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.form-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Reading comfort ---------- */

.site-logo { display: block; max-height: 40px; width: auto; }

.badge--new { background: var(--accent); color: var(--accent-text); margin-left: 6px; vertical-align: 2px; }
a.badge--new:hover { text-decoration: none; background: var(--accent-hover); }
.discussion-item.is-unread .discussion-item__title { font-weight: 800; }
.discussion-item:not(.is-unread) .discussion-item__title { font-weight: 500; }

.unread-divider {
  display: flex; align-items: center; gap: 12px; color: var(--accent);
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.unread-divider::before, .unread-divider::after { content: ""; flex: 1; border-top: 2px solid var(--accent); opacity: .5; }

.post__actions { display: flex; gap: 14px; margin-top: 12px; }
.post__action { color: var(--text-muted); font-size: .85rem; font-weight: 600; }
.post__action:hover { color: var(--accent); }

.mark-read { text-align: center; margin-top: 12px; }
.button--small { min-height: 30px; padding: 0 10px; font-size: .85rem; }

.search-form, .search-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.search-form input[type="search"], .search-bar input[type="search"] { flex: 1 1 240px; }
.search-form input, .search-form select, .search-bar input, .search-bar select {
  min-height: 40px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
.search-results mark { background: var(--accent-soft); color: inherit; padding: 0 2px; border-radius: 3px; }
.breadcrumb a { color: var(--text-muted); }

/* ---------- Admin ---------- */

.sidebar__label { margin: 0; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 0 0 20px; }
.stat { margin: 0; padding: 16px; display: flex; flex-direction: column-reverse; }
.stat dt { color: var(--text-muted); font-size: .85rem; }
.stat dd { margin: 0; font-size: 1.6rem; font-weight: 700; }

.link-list { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

.radio-group { border: 0; padding: 0; display: grid; gap: 8px; }
.radio-group legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.radio-group label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.radio-group input, .color-input input[type="checkbox"] {
  flex: none; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent);
}
.color-input input[type="checkbox"] { margin: 0; }
.radio-group--inline { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; }
.radio-group--inline legend { width: 100%; }

.field-row--even { grid-template-columns: 1fr 1fr; }
.field-label { display: block; font-weight: 600; margin-bottom: 4px; }
.smtp-settings { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.test-email { margin-top: 20px; }

.button--danger { color: var(--danger); border-color: var(--danger-soft); }
.button--danger:hover { background: var(--danger-soft); }
.link-button--danger { color: var(--danger); font-size: .875rem; margin: 10px 14px 0 0; }

.admin-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; }
.admin-item { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 0; }
.admin-item > details { flex: 1; min-width: 0; }
.admin-item__summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; cursor: pointer; list-style: none; }
.admin-item__summary::-webkit-details-marker { display: none; }
.admin-item__title { font-weight: 700; }
.admin-item__edit { margin-left: auto; color: var(--accent); font-weight: 600; font-size: .9rem; }
details[open] .admin-item__edit { visibility: hidden; }
.admin-item__form { margin-top: 14px; }
.admin-item__inline, .admin-item__danger {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border);
}
.admin-item__inline select, .admin-item__danger select, .role-form select {
  min-height: 34px; padding: 4px 8px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit;
}
.admin-item__order form { display: flex; flex-direction: column; gap: 2px; }
.admin-item__order .icon-button { width: 30px; height: 26px; font-size: 1rem; }
.icon-button:disabled { opacity: .3; cursor: default; background: none; }

.tag-form { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.color-input { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.color-input input[type="color"] {
  width: 40px; height: 32px; padding: 2px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer;
}

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table th { color: var(--text-muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.admin-table tr:last-child td { border-bottom: 0; }
.member-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); white-space: nowrap; }
.member-cell .avatar { width: 28px; height: 28px; font-size: .8rem; }
.role-form { display: flex; gap: 6px; align-items: center; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.theme-card {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px;
  border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; background: var(--surface);
}
.theme-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-card input { position: absolute; top: 12px; right: 12px; accent-color: var(--accent); }
.theme-card__preview { display: flex; gap: 6px; margin-bottom: 6px; }
.theme-card__mini { width: 50%; border-radius: 6px; border: 1px solid var(--border); }
.theme-card__name { font-weight: 700; }
.theme-card__desc { font-size: .85rem; color: var(--text-muted); }
.theme-card__meta { font-size: .8rem; color: var(--text-muted); }

.color-pickers { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.color-set { border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: grid; gap: 8px; margin: 0; }
.color-set legend { font-weight: 600; padding: 0 4px; }

.logo-editor { display: grid; gap: 12px; }
.logo-editor__preview {
  display: flex; align-items: center; min-height: 64px; padding: 12px;
  background: var(--bg); border: 1px dashed var(--border); border-radius: 8px;
}
.logo-editor__preview img { max-height: 48px; width: auto; }

.guide pre { white-space: pre; }
.guide h2 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
.guide-table { border-collapse: collapse; margin-bottom: 1em; }
.guide-table td { padding: 4px 16px 4px 0; vertical-align: top; }

/* ---------- Moderation ---------- */

.nav-count {
  display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: .75rem; font-weight: 700; text-align: center;
}
.badge--danger { background: var(--danger-soft); color: var(--danger); }

.mod-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin: 12px 0 0; padding: 8px 10px; background: var(--surface-2); border-radius: 8px;
}
.mod-toolbar__label { font-size: .8rem; font-weight: 700; color: var(--text-muted); margin-right: 2px; }
.mod-toolbar__move { display: inline-flex; gap: 4px; }
.mod-toolbar select {
  min-height: 30px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); color: var(--text); font: inherit; font-size: .85rem;
}

.post__actions { align-items: center; }
.post__actions .link-button { text-decoration: none; font-weight: 600; }
.post__action--end { margin-left: auto; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs a { padding: 8px 12px; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

.mod-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.mod-item__header { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.mod-item__header .meta { display: block; }
.mod-item__body { max-height: 260px; overflow: auto; padding: 10px 12px; background: var(--bg); border-radius: 8px; }
.mod-item__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.report-notes { margin: 12px 0 0; padding-left: 1.2em; font-size: .9rem; }
.report-note { color: var(--text-muted); }
.report-quote { margin: 0 0 16px; }
.report-quote p:last-child { margin-bottom: 0; }

.ban-box { border-color: var(--danger-soft); }
.ban-box select {
  width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg); color: var(--text); font: inherit;
}
.profile__ban { margin: 10px 0 0; }

/* ---------- Phones ---------- */

@media (max-width: 720px) {
  .with-sidebar { grid-template-columns: 1fr; gap: 20px; }
  .sidebar { position: static; }
  .category-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
  .category-nav a { flex: none; border: 1px solid var(--border); background: var(--surface); }
  .category-nav .count { display: none; }
  .site-header__inner { gap: 12px; padding-top: 8px; padding-bottom: 8px; }
  .site-nav { order: 3; width: 100%; }
  .user-chip__name { display: none; }
  .discussion-item { padding: 12px; gap: 10px; }
  .discussion-item > .avatar { display: none; }
  .site-header__actions { gap: 4px; }
  .site-header__actions .button { padding: 0 10px; }
  .profile__header { flex-wrap: wrap; }
  .profile__edit { width: 100%; }
  .avatar-editor { flex-direction: column; }
  .avatar--large { width: 72px; height: 72px; font-size: 1.8rem; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .post { padding: 14px; gap: 10px; }
  .post__side .avatar { width: 30px; height: 30px; font-size: .85rem; }
  .reply__author { display: none; }
  .field-row--even, .color-pickers, .tag-form { grid-template-columns: 1fr; }
  .admin .sidebar .category-nav { flex-wrap: nowrap; }
  .site-nav { overflow-x: auto; }
}
