/*
 * FSS Community base theme. Every colour, font and radius is a custom property; a board overrides them with its
 * generated /<board>/theme.<hash>.css (validated tokens only, never free CSS). Defaults: FSS "Forge".
 * No inline styles exist anywhere (CSP style-src 'self').
 */
:root {
  color-scheme: dark;
  --down: #8b9cff;
  --mod: #7fdca6;
  --bg: #160b0d;
  --surface: #1f1013;
  --surface-2: #2a1216;
  --text: #f5eaea;
  --muted: #c4a9ab;
  --line: #43222a;
  --accent: #f15b42;
  --on-accent: #1a0b0d;
  --link: #ff9a85;
  --focus: #ffe2ad;
  --danger: #ff9a85;
  --success: #7fdca6;
  --warning: #ffc061;
  --font-display: "Chakra Petch", "Figtree", system-ui, sans-serif;
  --font-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 2px;
  --wrap: 960px;
  --tap: 40px;
}

@media (pointer: coarse) {
  :root { --tap: 44px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
img { max-width: 100%; height: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon--sm { width: 15px; height: 15px; vertical-align: -2px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 50; background: var(--surface); padding: 8px 12px; }

/* ---------- header and footer ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; min-width: 0; }
.brand__mark { width: 32px; height: 32px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 600 13px var(--font-display); flex: none; overflow: hidden; }
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.brand__logo { height: 34px; width: auto; }
.brand__name { font-family: var(--font-display); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { color: var(--muted); white-space: nowrap; }
.user-menu { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.user-menu form { margin: 0; }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; margin-top: 48px; }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: 6px 18px; padding-block: 16px 24px; }
.site-footer a { color: var(--muted); }
.notice-bar { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .9rem; padding: 8px 0; }

/* ---------- buttons and forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  font: 500 .9rem var(--font-body); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { filter: brightness(1.08); border-color: var(--accent); }
.btn--ghost { background: transparent; }
.btn--danger { color: var(--danger); }
.btn--sm { min-height: 32px; padding: 0 10px; font-size: .82rem; }
.btn--block { width: 100%; }
.btn[aria-pressed="true"], .btn.is-on { color: var(--accent); border-color: var(--accent); }
.icon-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 32px; min-width: 32px; padding: 0 6px;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--muted);
  font: 500 .8rem var(--font-body); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.is-on { color: var(--accent); }
@media (pointer: coarse) { .icon-btn { min-height: 44px; min-width: 44px; justify-content: center; } }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
input[type="text"], input[type="search"], input[type="url"], input[type="number"], textarea, select {
  width: 100%; min-height: var(--tap); padding: 8px 10px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: 400 .95rem var(--font-body);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input[type="color"] { width: 44px; height: 36px; padding: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.field { margin-bottom: 14px; }
.field__hint { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.field__error { font-size: .85rem; color: var(--danger); margin-top: 4px; }
.field--invalid input, .field--invalid textarea { border-color: var(--danger); }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); font-size: .9rem; }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.form-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.flash { border: 1px solid var(--line); background: var(--surface); padding: 10px 12px; border-radius: var(--radius); margin: 16px 0; }
.flash--ok { border-color: var(--success); }
.flash--error { border-color: var(--danger); }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.panel--accent { border-color: var(--accent); }
.panel--warn { border-color: var(--warning); background: var(--surface-2); }
.panel__title { font-family: var(--font-display); font-weight: 600; margin-bottom: 6px; }
.intro { margin: 16px 0 12px; }
.intro > summary { cursor: pointer; font-family: var(--font-display); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 6px; }
.intro > summary::-webkit-details-marker { display: none; }
.intro > summary::after { content: "Hide"; margin-left: auto; font: 400 .8rem var(--font-body); color: var(--muted); }
.intro:not([open]) > summary::after { content: "Show"; }
.prose { color: var(--text); }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 0 0 .75em; padding-left: 1.3em; }
.prose code { font-family: "JetBrains Mono", monospace; font-size: .88em; background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }
.prose blockquote { margin: 0 0 .75em; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.page-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 24px 0 12px; }

/* ---------- toolbar, dropdown filters ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.toolbar input[type="search"] { flex: 1; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.dd { position: relative; }
.dd > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); font-size: .85rem; white-space: nowrap;
}
.dd > summary::-webkit-details-marker { display: none; }
.dd[open] > summary { border-color: var(--accent); }
.dd__key { color: var(--muted); }
.dd__menu {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 20; min-width: 200px; max-height: 360px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px;
}
.dd__menu--right { left: auto; right: 0; }
.dd__item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 8px; border-radius: var(--radius); color: var(--text); text-decoration: none; font-size: .88rem; border: 0; background: none; cursor: pointer; text-align: left; }
.dd__item:hover { background: var(--surface-2); }
.dd__item[aria-current="true"] { color: var(--accent); }
.dd__item .count { margin-left: auto; color: var(--muted); font-size: .8rem; }
.dd__search { margin-bottom: 6px; min-height: 32px !important; padding: 4px 8px !important; font-size: .85rem !important; }
.dd__foot { display: flex; gap: 6px; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 6px; }
.dd__check { display: flex; gap: 8px; align-items: center; padding: 6px 8px; font-size: .88rem; color: var(--text); margin: 0; cursor: pointer; border-radius: var(--radius); }
.dd__check:hover { background: var(--surface-2); }
.dd__check input { accent-color: var(--accent); width: 15px; height: 15px; }
.results-count { margin-left: auto; color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .dd__key { display: none; }
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .dd__menu { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; max-height: 60vh; }
  .results-count { display: none; }
}

/* ---------- chips ---------- */
.status { display: inline-block; border: 1px solid currentColor; border-radius: 999px; padding: 0 8px; font-size: .75rem; line-height: 19px; white-space: nowrap; }
.tag { display: inline-block; background: var(--surface-2); color: var(--muted); border-radius: var(--radius); padding: 0 7px; font-size: .75rem; line-height: 19px; white-space: nowrap; text-decoration: none; }
.badge { display: inline-flex; align-items: center; gap: 3px; background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 0 7px; font-size: .7rem; line-height: 18px; font-weight: 700; vertical-align: 1px; letter-spacing: .02em; white-space: nowrap; }
.badge--team { background: var(--accent); color: var(--on-accent); }
.badge--mod { background: transparent; color: var(--mod); border: 1px solid var(--mod); line-height: 16px; }
.badge--op { background: transparent; color: var(--link); border: 1px solid var(--link); line-height: 16px; }
.badge--muted { background: transparent; color: var(--muted); border: 1px solid var(--line); font-weight: 500; line-height: 16px; }

/* ---------- suggestion cards ---------- */
.cards { display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; padding: 0; }
.card { position: relative; display: flex; gap: 12px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.card--pinned { border-color: var(--accent); }
.card__body { flex: 1; min-width: 0; }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.card__title:hover { color: var(--link); }
.card__excerpt { color: var(--muted); font-size: .9rem; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: .8rem; margin-top: 6px; }
.meta__actions { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.vote { display: flex; flex-direction: column; align-items: center; min-width: 46px; }
.vote form { margin: 0; }
.vote__btn { display: grid; place-items: center; width: 34px; height: 30px; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: var(--radius); padding: 0; }
.vote__btn:hover { background: var(--surface-2); color: var(--text); }
.vote__btn--up:hover { color: var(--accent); }
.vote__btn--down:hover { color: var(--down); }
.vote__btn.is-on { color: var(--accent); }
.vote__btn--down.is-on { color: var(--down); }
.vote__btn.is-on .icon--vote { fill: currentColor; }
.vote__btn:disabled { cursor: default; opacity: .5; }
.vote__score { font: 600 .95rem var(--font-display); }
@media (pointer: coarse) { .vote__btn { width: 44px; height: 40px; } }
.vote--big { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 0; align-self: flex-start; }
.vote--big .vote__score { font-size: 1.15rem; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 36px; min-height: 36px; display: inline-grid; place-items: center; padding: 0 8px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: .85rem; }
.pagination [aria-current="page"] { border-color: var(--accent); color: var(--accent); }

/* overflow menu (⋯) and toast */
.more { position: relative; }
.more > summary { list-style: none; }
.more > summary::-webkit-details-marker { display: none; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; background: var(--text); color: var(--bg); border-radius: var(--radius); padding: 8px 14px; font-size: .9rem; }
.toast[hidden] { display: none; }

/* ---------- detail page ---------- */
.detail { display: flex; gap: 16px; margin-top: 20px; }
.detail__main { flex: 1; min-width: 0; }
.detail__title { font-size: 1.45rem; overflow-wrap: anywhere; }
.detail__actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.status-update { margin: 16px 0; }
.status-update__head { font-size: .82rem; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.timeline { font-size: .85rem; color: var(--muted); margin: 0 0 18px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mod-bar { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .85rem; color: var(--muted); }
.mod-bar__inner { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-block: 6px; }
.mod-bar details { position: relative; }
.mod-panel { position: absolute; z-index: 25; top: calc(100% + 4px); left: 0; width: min(360px, 90vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; color: var(--text); }
.comment-hint { font-size: .85rem; color: var(--warning); margin-top: 6px; }
.comment-hint[hidden] { display: none; }
.locked { display: flex; gap: 8px; align-items: center; color: var(--muted); }

/* ---------- submit form ---------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 20px; margin-top: 20px; }
.posting-as { font-size: .88rem; color: var(--muted); margin-bottom: 12px; }
.posting-as strong { color: var(--text); font-weight: 500; }
.similar { margin: 6px 0 14px; }
.similar[hidden] { display: none; }
.similar__head { font-size: .88rem; margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.similar__item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: .9rem; }
.similar__item a { color: var(--text); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.similar__score { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.tag-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-picker label { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); cursor: pointer; font-size: .85rem; }
.tag-picker input { accent-color: var(--accent); }
.tag-picker label:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
@media (max-width: 760px) {
  .form-layout { grid-template-columns: 1fr; }
  .detail { gap: 10px; }
}

/* ---------- staff ---------- */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin: 16px 0; }
.tabs a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); font-size: .85rem; }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
.queue-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.queue-item + .queue-item { margin-top: 8px; }
.queue-item__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.queue-item__actions form { margin: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.table th, .table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-weight: 500; }
.table-scroll { overflow-x: auto; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -4px; }
.contrast-ok { color: var(--success); }
.contrast-bad { color: var(--danger); }

/* ---------- home ---------- */
.boards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; }
.board-card { --bc-accent: var(--accent); --bc-on-accent: var(--on-accent); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.board-card:hover { border-color: var(--bc-accent); transform: translateY(-2px); }
.board-card__banner { display: block; height: 84px; background-color: var(--bc-accent); background-image: linear-gradient(120deg, var(--bc-accent), color-mix(in srgb, var(--bc-accent) 30%, var(--bg))); background-size: cover; background-position: center; }
.board-card__body { display: flex; flex-direction: column; gap: 4px; padding: 0 16px 16px; }
.board-card__mark { position: relative; margin: -26px 0 4px; width: 52px; height: 52px; border-radius: 50%; border: 3px solid var(--surface); background: var(--bc-accent); color: var(--bc-on-accent); display: grid; place-items: center; font: 700 .95rem var(--font-display); overflow: hidden; }
.board-card__mark img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.board-card__name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; }
.board-card__tagline { color: var(--muted); font-size: .9rem; }
.board-card__stats { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 6px; color: var(--muted); font-size: .85rem; }
.board-card__stats strong { color: var(--text); }

/* ---------- mobile call to action ---------- */
.mobile-cta { display: none; }
@media (max-width: 640px) {
  .toolbar .btn--primary { display: none; }
  .mobile-cta { display: block; position: sticky; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 10px 16px; }
  .card { gap: 8px; padding: 9px 10px; }
  .vote { min-width: 40px; }
  .meta__actions .icon-btn__label { display: none; }
  .detail__title { font-size: 1.2rem; }
  h1 { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* inline forms inside action rows */
.meta__actions form, .detail__actions form, .mod-bar__inner > form, .row > form { margin: 0; display: inline-flex; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { padding: 0; margin-bottom: 6px; }
.more.dd > summary { border: 0; background: transparent; min-height: 32px; padding: 0 6px; }
.more.dd[open] > summary { color: var(--text); }

/* moderation queue and account messages */
.queue-item details { position: relative; }
.queue-item__form { position: absolute; z-index: 25; top: calc(100% + 4px); left: 0; width: min(340px, 86vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.report-details { margin: 4px 0 0; padding-left: 18px; }
.notices { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.notice p { margin: 4px 0; }
.notice--unread { border-color: var(--accent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-left: 4px; }

/* board management */
.manage-form .panel { margin: 0; }
.manage-item + .manage-item { margin-top: 8px; }
.manage-item > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 32px; }
.manage-item[open] > summary { margin-bottom: 10px; }
.manage-item form + form { margin-top: 10px; }
.input--narrow { width: 6em; }
.theme-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 380px); gap: 16px; align-items: start; }
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.color-grid input[type="color"] { width: 100%; height: 40px; padding: 2px; }
.contrast-list { list-style: none; padding: 0; margin: 0; font-size: .88rem; display: grid; gap: 4px; }
.theme-preview { position: sticky; top: 12px; background: var(--bg); color: var(--text); font-family: var(--font-body); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.theme-preview h3 { font-family: var(--font-display); margin: 0 0 10px; }
.theme-preview a { color: var(--link); }
.theme-preview__bar { display: flex; gap: 8px; align-items: center; padding: 10px 12px; background: var(--surface); border-bottom: 1px solid var(--line); font-family: var(--font-display); }
.theme-preview__body { padding: 12px; }
.theme-preview .card { background: var(--surface); border-color: var(--line); margin-bottom: 10px; }
.asset-preview { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.asset-preview--logo { max-height: 80px; width: auto; }
@media (max-width: 860px) { .theme-layout { grid-template-columns: 1fr; } .theme-preview { position: static; } }


/* ===== round 2: layout widths, brand, avatars, bell, account menu ===== */
.wrap--wide { max-width: 1120px; }
.wrap--narrow { max-width: 720px; }
.icon--xs { width: 12px; height: 12px; vertical-align: -1px; }
.icon--vote { width: 22px; height: 22px; stroke-width: 1.9; }
.brand__mark--fs { background: transparent; color: var(--accent); }
.fsmark { width: 28px; height: 32px; display: block; }
.fsmark--badge { width: 9px; height: 11px; display: inline-block; vertical-align: -1px; }
.avatar { display: inline-grid; place-items: center; flex: none; border-radius: 50%; color: #fff; font: 700 .68rem/1 var(--font-body); letter-spacing: .03em; user-select: none; }
.avatar--xs { width: 20px; height: 20px; font-size: .55rem; }
.avatar--sm { width: 28px; height: 28px; }
.avatar--md { width: 32px; height: 32px; font-size: .75rem; }
.av-0 { background: #b3392b; } .av-1 { background: #1d63a8; } .av-2 { background: #6b4bb8; } .av-3 { background: #1f7d4c; }
.av-4 { background: #9a4d00; } .av-5 { background: #0b6e75; } .av-6 { background: #a3326b; } .av-7 { background: #4c5a6b; }
.av-x { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.user-menu { gap: 4px; }
.account > summary, .bell > summary { list-style: none; cursor: pointer; }
.account > summary::-webkit-details-marker, .bell > summary::-webkit-details-marker { display: none; }
.account__btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.account__btn:hover .avatar, .account[open] .avatar { box-shadow: 0 0 0 2px var(--accent); }
.account__head { display: flex; gap: 10px; align-items: center; padding: 6px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; color: var(--text); }
.account .dd__menu form { margin: 0; }
.bell__btn { position: relative; width: 40px; height: 40px; justify-content: center; border-radius: 50%; }
.bell.has-unread .bell__btn { color: var(--accent); }
.bell__count { position: absolute; top: 4px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 700 .62rem/16px var(--font-body); text-align: center; }
.bell__menu { width: min(360px, calc(100vw - 24px)); padding: 0; max-height: 70vh; }
.bell__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.bell__head form { margin: 0; }
.bell__item { display: flex; gap: 10px; padding: 10px 12px; color: var(--text); text-decoration: none; font-size: .86rem; border-bottom: 1px solid var(--line); }
.bell__item:hover { background: var(--surface-2); }
.bell__item.is-unread { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.bell__item.is-unread .bell__text::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
.bell__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bell__text time { display: block; color: var(--muted); font-size: .76rem; margin-top: 2px; }
.bell__kind { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.bell__kind--status { color: var(--success); }
.bell__kind--merged { color: var(--link); }
.bell__kind--reply { color: var(--text); }
.bell__kind--moderation { color: var(--warning); }
.bell__empty { padding: 16px 12px; margin: 0; color: var(--muted); font-size: .86rem; }
.bell__all { display: block; padding: 10px 12px; text-align: center; font-size: .85rem; text-decoration: none; }
.bell__all:hover { background: var(--surface-2); }
.link-btn { border: 0; background: none; padding: 0; color: var(--link); font: 500 .8rem var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.notice-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.notice-list li + li { border-top: 1px solid var(--line); }
.notice-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--text); text-decoration: none; }
.notice-item:hover { background: var(--surface-2); }
.notice-item.is-unread { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.notice-item.is-unread .notice-item__text { font-weight: 600; }
.notice-item__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notice-item__time { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.notice-foot { margin-top: 12px; }
.dd__sep { border-top: 1px solid var(--line); margin: 6px 0; }
.dd__item--danger { color: var(--danger); }
.dd__sub > summary { list-style: none; }
.dd__sub > summary::-webkit-details-marker { display: none; }
.dd__form { padding: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.dd__form fieldset { margin-bottom: 8px; }

/* ===== flairs and spoilers ===== */
.flair { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 0 8px; font: 700 .68rem/19px var(--font-body); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.flair--spoiler { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.card__flair { margin-bottom: 4px; }
.spoiler { background: var(--text); color: transparent; border-radius: 3px; cursor: pointer; padding: 0 2px; transition: background .15s, color .15s; }
.spoiler * { color: transparent; }
.spoiler:focus, .spoiler.is-revealed { background: var(--surface-2); color: inherit; outline: none; }
.spoiler:focus *, .spoiler.is-revealed * { color: inherit; }
.spoiler-box { margin-top: 8px; }
.spoiler-box > summary { list-style: none; cursor: pointer; display: grid; place-items: center; min-height: 72px; border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, color-mix(in srgb, var(--surface-2) 70%, var(--bg)) 10px 20px); border: 1px solid var(--line); }
.spoiler-box > summary::-webkit-details-marker { display: none; }
.spoiler-box[open] > summary { display: none; }
.spoiler-box--card > summary { min-height: 52px; }

/* ===== detail page ===== */
.back-link { margin: 18px 0 0; }
.detail__byline { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: .82rem; margin-bottom: 6px; }
.detail__author { color: var(--text); font-weight: 600; }
.detail__body { margin-top: 14px; }
.vote-split { margin-left: 4px; padding: 0 6px; border: 1px dashed var(--line); border-radius: var(--radius); font-variant-numeric: tabular-nums; }
.detail__actions { margin: 14px 0 6px; }
.mod-bar__label { display: inline-flex; gap: 4px; align-items: center; margin-right: 4px; }
.review-note { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--warning); background: var(--surface-2); color: var(--text); font-size: .88rem; }
.report-panel { margin-top: 28px; }
.status-update__head .avatar { margin-left: 2px; }

/* ===== comments: composer and thread ===== */
.comments { margin-top: 28px; }
.comments > h2 { margin-bottom: 12px; }
.composer { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 6px 8px; transition: border-color .15s; }
.composer:focus-within, .composer.is-open { border-color: var(--muted); border-radius: var(--radius); }
.composer textarea { min-height: 38px; border: 0; background: transparent; resize: none; padding: 6px 8px; }
.composer textarea:focus { outline: none; }
.composer:focus-within textarea, .composer.is-open textarea { min-height: 96px; resize: vertical; }
.composer__foot { display: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 4px 2px; }
.composer:focus-within .composer__foot, .composer.is-open .composer__foot, .composer:has(textarea:not(:placeholder-shown)) .composer__foot { display: flex; }
.composer--login { color: var(--muted); text-decoration: none; padding: 10px 14px; }
.composer--login:hover { border-color: var(--muted); color: var(--text); }
.composer--reply { margin: 8px 0 4px; }
.comments > .composer { margin-bottom: 20px; }
.thread { display: flex; flex-direction: column; gap: 18px; }
.cmt { display: flex; gap: 8px; scroll-margin-top: 80px; }
.cmt__rail { position: relative; display: flex; flex-direction: column; align-items: center; flex: none; width: 28px; }
.cmt--parent > .cmt__rail::after { content: ""; position: absolute; top: 34px; bottom: 0; left: 13px; width: 2px; background: var(--line); border-radius: 1px; }
.cmt__line { position: absolute; top: 34px; bottom: 0; left: 6px; width: 16px; z-index: 1; border: 0; background: transparent; cursor: pointer; padding: 0; }
.cmt__line:hover + * , .cmt--parent > .cmt__rail:has(.cmt__line:hover)::after { background: var(--muted); }
.cmt__main { flex: 1; min-width: 0; }
.cmt__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 28px; font-size: .8rem; color: var(--muted); }
.cmt__author { color: var(--text); font-size: .85rem; }
.cmt__time { color: var(--muted); text-decoration: none; }
.cmt__time:hover { text-decoration: underline; }
.cmt__fold { display: none; }
.cmt__folded-note { display: none; font-style: italic; }
.cmt__body { margin: 2px 0 2px; overflow-wrap: anywhere; }
.cmt__actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 2px; margin-left: -6px; }
.cmt__actions > details { position: relative; }
.cmt__actions > details > summary { list-style: none; }
.cmt__actions > details > summary::-webkit-details-marker { display: none; }
.cmt__reply[open], .cmt__edit[open] { flex-basis: 100%; order: 10; margin-left: 6px; }
.cmt__reply[open] > summary, .cmt__edit[open] > summary { color: var(--text); }
.cmt__menu { min-width: 230px; }
.cmt__replies { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.cmt--hidden > .cmt__main { opacity: .6; }
.cmt--gone .cmt__head { font-style: italic; }
.cmt:target > .cmt__main > .cmt__content > .cmt__body, .cmt:target > .cmt__main > .cmt__head { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: var(--radius); }
.cmt.is-collapsed > .cmt__main > .cmt__content { display: none; }
.cmt.is-collapsed > .cmt__rail::after, .cmt.is-collapsed > .cmt__rail .cmt__line { display: none; }
.cmt.is-collapsed > .cmt__main > .cmt__head .cmt__folded-note { display: inline; }
.js .cmt--parent > .cmt__main > .cmt__head > .cmt__fold { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 50%; margin-left: -2px; }
.js .cmt__fold:hover { color: var(--text); }

/* ===== editor (rich text + Markdown) ===== */
.editor { display: block; }
.editor__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px 2px; border-top: 1px solid var(--line); }
.editor__bar .icon-btn { min-width: 30px; min-height: 30px; justify-content: center; }
.editor__bar .icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--surface-2); }
.editor__sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.editor__mode { margin-left: auto; font-size: .78rem; }
.editor__rich { min-height: 38px; padding: 8px; outline: none; overflow-wrap: anywhere; max-height: 420px; overflow-y: auto; }
.editor__rich:empty::before { content: attr(data-placeholder); color: var(--muted); opacity: .8; pointer-events: none; }
.editor__rich p { margin: 0 0 .6em; }
.editor__rich p:last-child { margin-bottom: 0; }
.editor__rich ul, .editor__rich ol { margin: 0 0 .6em; padding-left: 1.4em; }
.editor__rich blockquote { margin: 0 0 .6em; padding-left: 10px; border-left: 3px solid var(--line); color: var(--muted); }
.editor__rich pre { background: var(--surface-2); padding: 8px; border-radius: var(--radius); white-space: pre-wrap; margin: 0 0 .6em; }
.editor__rich code { font-family: "JetBrains Mono", monospace; font-size: .88em; background: var(--surface-2); padding: 1px 4px; border-radius: 3px; }
.editor__rich .spoiler { background: var(--surface-2); color: inherit; outline: 1px dashed var(--muted); }
.composer .editor__rich { min-height: 38px; }
.composer:not(.is-open) .editor__bar { display: none; }
.composer.is-open .editor__rich { min-height: 96px; }
.field .editor, .compose__form .editor { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.field .editor:focus-within { border-color: var(--muted); }
.field .editor .editor__rich { min-height: 180px; }
.field .editor textarea { border: 0; background: transparent; min-height: 180px; }
.field .editor .editor__bar { border-top: 0; border-bottom: 1px solid var(--line); }
.editor .editor__bar { order: 0; }
.editor__count { font-size: .75rem; color: var(--muted); padding: 0 6px; }
.editor__count.is-over { color: var(--danger); }

/* ===== suggest form (compose) ===== */
.compose-layout { display: grid; grid-template-columns: minmax(0, 1fr) 312px; gap: 24px; margin-top: 20px; align-items: start; }
.compose__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.compose__board { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; font-weight: 600; font-size: .88rem; }
.compose__board-mark { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 .65rem var(--font-display); overflow: hidden; }
.compose__board-mark img { width: 100%; height: 100%; object-fit: contain; }
.title-input { position: relative; }
.input--title { font-size: 1.05rem !important; font-weight: 600; min-height: 48px !important; padding-right: 64px !important; border-radius: 12px !important; }
.title-input__count { position: absolute; right: 12px; bottom: 8px; font-size: .75rem; color: var(--muted); }
.title-input__count.is-over { color: var(--danger); }
.flair-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 2px 0 14px; }
.pill-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: 600 .82rem var(--font-body); cursor: pointer; list-style: none; }
.pill-btn::-webkit-details-marker { display: none; }
.flair-picker[open] > .pill-btn, .pill-btn:hover { border-color: var(--muted); }
.flair-picker > summary { border: 1px solid var(--line); }
.flair-menu { width: min(380px, calc(100vw - 32px)); padding: 10px 12px; }
.flair-menu__head { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 8px; color: var(--text); }
.flair-menu__hint { margin: 8px 0 0; }
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pill-check { display: inline-flex; align-items: center; margin: 0; cursor: pointer; }
.pill-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill-check > span { border: 1px solid transparent; padding: 3px 10px; line-height: 20px; font-size: .8rem; border-radius: 999px; }
.pill-check input:checked + span { border-color: currentColor; box-shadow: 0 0 0 1px currentColor; }
.pill-check input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.pill-check input:disabled + span { opacity: .45; cursor: not-allowed; }
.flair-chips { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.compose__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.board-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; position: sticky; top: 12px; }
.board-panel__banner { height: 64px; background: linear-gradient(120deg, var(--accent), color-mix(in srgb, var(--accent) 35%, var(--bg))); }
.board-panel__banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.board-panel__body { position: relative; padding: 0 14px 12px; }
.board-panel__mark { position: relative; top: -22px; margin-bottom: -14px; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--surface); background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font: 700 .9rem var(--font-display); overflow: hidden; }
.board-panel__mark img { width: 100%; height: 100%; object-fit: contain; background: var(--surface); }
.board-panel__name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.board-panel__stats { display: flex; gap: 24px; margin-top: 8px; }
.board-panel__stats div { display: flex; flex-direction: column; }
.board-panel__stats span { color: var(--muted); font-size: .78rem; }
.rules { border-top: 1px solid var(--line); padding: 10px 14px 12px; }
.rules__title { font: 700 .72rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.rules__list { list-style: none; margin: 0; padding: 0; }
.rules__list details > summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-size: .88rem; }
.rules__list details > summary::-webkit-details-marker { display: none; }
.rules__n { width: 18px; color: var(--muted); text-align: right; flex: none; }
.rules__name { flex: 1; }
.rules__chev { color: var(--muted); transition: transform .15s; }
.rules__list details[open] .rules__chev { transform: rotate(180deg); }
.rules__text { padding: 0 0 8px 28px; color: var(--muted); }
.rules--extra { color: var(--muted); }
@media (max-width: 900px) {
  .compose-layout { grid-template-columns: 1fr; }
  .board-panel { position: static; }
}

/* ===== spacing fixes: manage forms, moderation ===== */
.manage-form { display: flex; flex-direction: column; gap: 20px; }
.manage-form > * + * { margin-top: 0; }
.manage-form fieldset.panel { padding: 14px 16px 16px; }
.manage-form fieldset.panel > legend { float: left; width: 100%; padding: 0 0 10px; margin: 0 0 12px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 600; }
.manage-form fieldset.panel > legend + * { clear: both; }
.manage-form fieldset.panel > * + * { margin-top: 12px; }
.manage-form .grid-2 > .field { margin-bottom: 0; }
.wrap > section + section { margin-top: 28px; }
.wrap > section > h2 { margin: 24px 0 12px; }
.queue-item { padding: 12px 14px; }
.queue-item + .queue-item { margin-top: 10px; }
.queue-item > p { margin: 6px 0; }
.editor { display: flex; flex-direction: column; }
.field .editor .editor__bar, .compose__form .editor .editor__bar { order: -1; border-top: 0; border-bottom: 1px solid var(--line); }
.editor__rich[hidden] { display: none; }
@media (max-width: 640px) {
  .site-header .icon-btn__label, .site-header .crumb { display: none; }
  .site-header__inner { gap: 6px; }
  .brand__name { max-width: 46vw; }
}
.team-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.team-list li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.team-list__who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.team-list form { margin: 0; }
.role-pick { display: flex; flex-direction: column; gap: 8px; }
.role-card { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--text); }
.role-card > span { display: flex; flex-direction: column; gap: 2px; }
.role-card input { margin-top: 3px; accent-color: var(--accent); }
.role-card:has(input:checked) { border-color: var(--accent); background: var(--surface-2); }
@media (pointer: coarse) { .cmt__actions .icon-btn { min-width: 0; padding: 0 8px; } }
@media (max-width: 640px) { .site-header .dd__menu { top: 60px; bottom: auto; max-height: calc(100vh - 80px); } }


/* ===== round 3 ===== */
.brand__mark--fs { color: #fff; }
.user-menu .dd > summary { border: 0; background: transparent; padding: 0; min-height: 0; }
.user-menu .bell__btn { width: 40px; height: 40px; }
.user-menu .bell__btn:hover { background: var(--surface-2); }
.avatar--lg { width: 64px; height: 64px; font-size: 1.3rem; }
.user-link { color: inherit; text-decoration: none; }
.user-link:hover { text-decoration: underline; color: var(--link); }
.prose a.mention { font-weight: 600; text-decoration: none; }
.prose a.mention:hover { text-decoration: underline; }
.rules--guidelines { border-top: 0; color: var(--text); }
.rules--guidelines + .rules { border-top: 1px solid var(--line); }
.compose-preview { margin: 16px 0 0; padding: 14px 16px; border: 1px dashed var(--muted); border-radius: var(--radius); background: var(--surface); }
.compose-preview__label { font: 700 .72rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.compose-preview__flairs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.compose-preview__flairs:empty { display: none; }
.profile-head { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; margin: 28px 0 18px; }
.profile-head__text { flex: 1; min-width: 200px; }
.profile-head__roles { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.profile-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.profile-item { padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.profile-item__title { display: block; margin: 2px 0; color: var(--text); font-family: var(--font-display); font-weight: 600; text-decoration: none; }
.profile-item__title:hover { color: var(--link); }
.profile-item__text { display: block; margin-top: 4px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.profile-item__text:hover { color: var(--link); }
.view-toggle { display: none; gap: 2px; }
.view-toggle .icon-btn[aria-pressed="true"] { color: var(--accent); background: var(--surface-2); }
@media (min-width: 900px) {
  .js .view-toggle { display: inline-flex; }
  .results-count + .view-toggle { margin-left: 4px; }
  .cards--compact { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cards--compact .card { padding: 8px 10px; gap: 10px; align-items: center; }
  .cards--compact .card__excerpt, .cards--compact .spoiler-box, .cards--compact .meta__actions { display: none; }
  .cards--compact .card__title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .95rem; }
  .cards--compact .meta { margin-top: 4px; gap: 4px 8px; }
  .cards--compact .vote { min-width: 38px; }
  .cards--compact .vote__btn { height: 24px; }
  .cards--compact .icon--vote { width: 18px; height: 18px; }
}
