.fm { --fm-gap: 28px; }
.fm-page { padding-top: 150px; padding-bottom: 140px; }
.fm-head { display: grid; gap: 18px; justify-items: start; margin-bottom: 44px; max-width: 900px; }
.fm-head .back { margin-bottom: 26px; }
.fm-head h1 { margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .04em; font-size: clamp(24px, 4.2vw, 46px); line-height: 1.15; overflow-wrap: anywhere; }
.fm-desc { margin: 0; color: var(--muted); font-size: 16px; max-width: 60ch; }
.fm-head-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-top: 10px; }
.fm-new-btn { background: none; border-top: 0; border-left: 0; border-right: 0; padding: 0 0 8px; cursor: pointer; font: inherit; font-size: 10px; font-weight: 500; }
.fm-byline { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.fm-byline time { color: inherit; }

.fm-label { color: var(--dim); }
.fm-label::before { content: "[ "; }
.fm-label::after { content: " ]"; }

.fm-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; padding: 0; margin-bottom: 40px; }
.fm-search { position: relative; display: flex; align-items: center; gap: 12px; flex: 1 1 320px; max-width: 460px; min-width: 0; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); color: var(--dim); transition: border-color .2s; }
.fm-search:focus-within { border-color: var(--text); color: var(--text); }
.fm-search input { flex: 1; min-width: 0; height: 30px; padding: 0; background: transparent; border: 0; outline: none; color: var(--text); font: inherit; font-size: 14px; }
.fm-search input::placeholder { color: var(--dim); }
.fm-search input::-webkit-search-cancel-button { display: none; }
.fm-search-go { flex: none; background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); transition: color .2s; }
.fm-search-go:hover { color: var(--text); }
.fm-who { display: flex; align-items: center; gap: 10px 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.fm-who b { color: var(--text); font-weight: 500; }
.fm-who-link { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; color: var(--text); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.fm-section-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.fm-section-head.spaced { margin-top: 90px; }

.fm-badge { display: inline-flex; align-items: center; gap: 5px; flex: none; font-size: 9px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; line-height: 1; padding: 4px 7px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; vertical-align: middle; }
.fm-badge::before { content: "[ "; }
.fm-badge::after { content: " ]"; }
.fm-badge:has(.ic)::before, .fm-badge:has(.ic)::after { content: none; }
.fm-badge.team { color: var(--text); border-color: rgba(var(--fg), .45); }
.fm-badge.solved { color: var(--text); border-color: var(--text); }

.fm-avatar { position: relative; width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--ring); overflow: hidden; display: grid; place-items: center; font-family: var(--display); font-size: 13px; color: var(--muted); background: rgba(var(--fg), .03); }
.fm-avatar img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); transition: filter .3s; }
.fm-post:hover .fm-avatar img, .fm-thread:hover .fm-avatar img { filter: none; }
.fm-avatar.xs { width: 24px; height: 24px; font-size: 9px; }

.fm-cats, .fm-threads, .fm-posts { display: grid; border-top: 1px solid var(--line); }
.fm-cat { position: relative; display: grid; grid-template-columns: 56px minmax(0, 1fr) 150px 240px; gap: 24px; align-items: center; padding: 28px 0; border-bottom: 1px solid var(--line); text-decoration: none; transition: background .25s; }
.fm-cat::before { content: ""; position: absolute; left: 0; top: -1px; width: 28px; height: 1px; background: var(--text); }
.fm-cat:hover { background: rgba(var(--fg), .02); }
.fm-cat-main { display: grid; gap: 8px; min-width: 0; }
.fm-cat h3 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0; font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .05em; font-size: 16px; line-height: 1.35; }
.fm-cat p { margin: 0; color: var(--muted); font-size: 14.5px; }
.fm-cat-stats { display: grid; gap: 6px; letter-spacing: .18em; }
.fm-cat-stats b, .fm-thread-count b { font-family: var(--display); font-weight: 400; letter-spacing: .04em; color: var(--text); }
.fm-cat-stats b { font-size: 12px; margin-right: 2px; }
.fm-cat-stats .dim b { color: var(--muted); }
.fm-cat-last { display: grid; gap: 6px; min-width: 0; font-size: 13.5px; }
.fm-cat-last-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.fm-cat:hover .fm-cat h3 { color: var(--text); }

.fm-thread { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) 80px 190px; gap: 20px; align-items: center; padding: 22px 0; border-bottom: 1px solid var(--line); transition: background .25s; }
.fm-thread:hover { background: rgba(var(--fg), .02); }
.fm-thread.pinned::before { content: ""; position: absolute; left: 0; top: -1px; width: 28px; height: 1px; background: var(--text); }
.fm-thread-main { display: grid; gap: 8px; min-width: 0; }
.fm-thread-title { font-size: 16px; font-weight: 500; line-height: 1.4; text-decoration: none; color: var(--text); overflow-wrap: anywhere; }
.fm-thread-title:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.fm-meta { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; letter-spacing: .16em; color: var(--muted); }
.fm-meta time { letter-spacing: .16em; }
.fm-by { display: inline-flex; align-items: center; gap: 8px; }
.fm-cat-link { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.fm-cat-link:hover { border-color: var(--text); }
.fm-thread-count { display: grid; justify-items: center; gap: 4px; }
.fm-thread-count b { font-size: 16px; }
.fm-thread-last { display: grid; gap: 6px; font-size: 13px; min-width: 0; }
.fm-thread-last > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fm-pages { display: flex; align-items: center; justify-content: center; gap: 18px; flex-wrap: wrap; margin-top: 48px; letter-spacing: .18em; }
.fm-pages a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--dim); padding-bottom: 6px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.fm-pages a:hover { color: var(--text); }
.fm-pages a.on { color: var(--text); border-color: var(--text); }
.fm-page-gap { color: var(--dim); }

.fm-mod { display: grid; gap: 14px; padding: 20px 0 24px; margin-bottom: 8px; }
.fm-mod-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-mod-btn { gap: 8px; }
.fm-mod-btn.fm-danger { color: var(--aff8a80); }
.fm-mod-btn.fm-danger:hover, .fm-mod-btn.armed { border-color: var(--aff8a80); }
.fm-move { display: inline-flex; align-items: center; gap: 10px; margin: 0 6px; }
.fm-select { height: 34px; padding: 0 30px 0 12px; border: 1px solid var(--line-2); border-radius: 0; background-color: var(--k050505); color: var(--text); font: inherit; font-size: 12.5px; outline: none; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: right 15px center, right 10px center; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.fm-select:focus { border-color: var(--text); }

.fm-post { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 20px; padding: 32px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 100px; }
.fm-post .fm-avatar { width: 44px; height: 44px; font-size: 14px; }
.fm-post.op { position: relative; }
.fm-post.op::before { content: ""; position: absolute; left: 0; top: -1px; width: 28px; height: 1px; background: var(--text); }
.fm-post:target { background: rgba(var(--fg), .025); }
.fm-post-main { display: grid; gap: 14px; min-width: 0; }
.fm-post-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.fm-name { font-weight: 500; font-size: 15px; overflow-wrap: anywhere; }
.fm-when { text-decoration: none; }
.fm-when:hover { color: var(--text); }
.fm-edited { letter-spacing: .2em; }
.fm-post-body { display: grid; gap: 16px; min-width: 0; }
.fm-deleted { margin: 0; }
.fm-actions { display: flex; align-items: center; gap: 6px 20px; flex-wrap: wrap; }
.fm-act { display: inline-flex; align-items: center; gap: 7px; padding: 4px 0; background: none; border: 0; cursor: pointer; color: var(--dim); font: inherit; font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; transition: color .2s; }
.fm-act:hover { color: var(--text); }
.fm-act.danger:hover, .fm-act.armed { color: var(--aff8a80); }
.fm-act:disabled { opacity: .5; cursor: default; }

.fm-prose { font-size: 15.5px; line-height: 1.75; color: var(--kcfcfd3); overflow-wrap: anywhere; }
.fm-prose > :first-child { margin-top: 0; }
.fm-prose > :last-child { margin-bottom: 0; }
.fm-prose p { margin: 0 0 14px; }
.fm-prose ul, .fm-prose ol { margin: 0 0 14px; padding-left: 22px; }
.fm-prose li { margin: 4px 0; }
.fm-prose a { color: var(--text); text-underline-offset: 4px; }
.fm-prose strong { font-weight: 600; color: var(--text); }
.fm-prose code { background: var(--panel); border: 1px solid var(--line); padding: 1px 6px; font-size: .86em; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.fm-prose pre { margin: 0 0 14px; background: var(--panel); border: 1px solid var(--line); padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; max-width: 100%; }
.fm-prose pre code { background: none; border: 0; padding: 0; font-size: inherit; white-space: pre; overflow-wrap: normal; }
.fm-prose blockquote { margin: 0 0 14px; padding-left: 18px; border-left: 1px solid var(--line-2); color: var(--muted); }

.fm-imgs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 720px; }
.fm-imgs.n1 { grid-template-columns: minmax(0, 1fr); max-width: 560px; }
.fm-img { display: block; border: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.fm-img img { width: 100%; height: 100%; max-height: 420px; object-fit: cover; transition: transform .5s var(--ease-out); }
.fm-imgs:not(.n1) .fm-img img { aspect-ratio: 16 / 10; }
.fm-imgs.n1 .fm-img img { object-fit: contain; height: auto; }
.fm-img:hover img { transform: scale(1.02); }

.fm-new-slot:not(:empty) { margin-bottom: 44px; }
.fm-reply-slot { margin-top: 48px; }
.fm-note { display: flex; align-items: center; gap: 10px; margin: 0; padding: 18px 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.fm-box, .fm-signin { position: relative; display: grid; gap: 14px; padding: 22px 24px 20px; border: 1px solid var(--line-2); background-color: var(--panel); clip-path: var(--hud-clip); background-image: var(--hud-img); background-size: var(--hud-size); background-position: var(--hud-pos); background-repeat: no-repeat; background-origin: border-box; }
.fm-box.drop { border-color: var(--text); }
.fm-title-input, .fm-box textarea { width: 100%; box-sizing: border-box; padding: 11px 13px; background: var(--k050505); border: 1px solid var(--line); border-radius: 0; color: var(--text); font: inherit; font-size: 14.5px; outline: none; transition: border-color .15s; }
.fm-title-input { font-size: 16px; font-weight: 500; }
.fm-box textarea { resize: vertical; min-height: 110px; line-height: 1.6; }
.fm-title-input:focus, .fm-box textarea:focus { border-color: var(--text); }
.fm-tabs { display: flex; align-items: end; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: -6px; }
.fm-tab { position: relative; padding: 8px 14px 10px; background: none; border: 0; color: var(--dim); font: inherit; font-size: 10px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; cursor: pointer; transition: color .2s; }
.fm-tab:first-child { padding-left: 0; }
.fm-tab:hover { color: var(--muted); }
.fm-tab.on { color: var(--text); }
.fm-tab.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--text); }
.fm-tab:first-child.on::after { left: 0; right: 14px; }
.fm-tabs-fill { flex: 1; }
.fm-count { padding-bottom: 10px; font-size: 10px; letter-spacing: .08em; color: var(--dim); }
.fm-preview { min-height: 110px; padding: 12px 14px; border: 1px dashed var(--line-2); }
.fm-hint { margin: 0; font-size: 12px; color: var(--dim); line-height: 1.6; overflow-wrap: anywhere; }
.fm-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.fm-thumb { position: relative; width: 88px; height: 88px; border: 1px solid var(--line-2); background: var(--k050505); overflow: hidden; display: grid; place-items: center; }
.fm-thumb img { width: 100%; height: 100%; object-fit: cover; }
.fm-thumb.loading { border-style: dashed; }
.fm-thumb-x { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line-2); background: var(--k050505); color: var(--text); cursor: pointer; }
.fm-thumb-x:hover { border-color: var(--text); }
.fm-box-actions { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.fm-grow { flex: 1; }
.fm-attach { gap: 8px; }
.fm-submit { min-width: 140px; }
.fm-trap { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.fm-err { margin: 0; color: var(--aff8a80); font-size: 13px; }
.fm-err.flash { flex-basis: 100%; }
.fm-signin p { margin: 0; color: var(--muted); font-size: 14px; }
.fm-signin .fm-discord { justify-self: start; height: 40px; padding: 0 20px; }
.fm-signin .fm-discord::before { content: ""; width: 7px; height: 7px; margin-right: 10px; background: currentColor; transform: rotate(45deg); }

.fm button:focus-visible, .fm a:focus-visible, .fm select:focus-visible { outline: 1px solid var(--text); outline-offset: 3px; }

@media (max-width: 960px) {
  .fm-cat { grid-template-columns: 40px minmax(0, 1fr) 130px; }
  .fm-cat-last { display: none; }
  .fm-thread { grid-template-columns: 40px minmax(0, 1fr) 70px; }
  .fm-thread-last { display: none; }
}
@media (max-width: 760px) {
  .fm-page { padding-top: 110px; }
  .fm-cat { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 24px 0; }
  .fm-num { display: none; }
  .fm-cat-stats { display: flex; gap: 16px; }
  .fm-thread { grid-template-columns: 32px minmax(0, 1fr); gap: 14px; align-items: start; }
  .fm-thread .fm-avatar { width: 32px; height: 32px; font-size: 11px; }
  .fm-thread-count { display: none; }
  .fm-post { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 26px 0; }
  .fm-post > .fm-avatar { display: none; }
  .fm-box, .fm-signin { padding: 18px 16px; }
  .fm-search { max-width: none; flex-basis: 100%; }
  .fm-box-actions .fm-grow { display: none; }
  .fm-submit { flex: 1 1 100%; order: 5; }
  .fm-imgs { grid-template-columns: minmax(0, 1fr); }
  .fm-section-head.spaced { margin-top: 64px; }
}

html[data-style="neu"] :is(.fm-box, .fm-signin) { clip-path: none !important; background-image: none !important; border-color: transparent !important; background-color: var(--n-bg) !important; border-radius: 22px !important; box-shadow: var(--n-layer) !important; }
html[data-style="neu"] :is(.fm-cats, .fm-threads, .fm-posts) { border-top-color: transparent; gap: 16px; }
html[data-style="neu"] :is(.fm-cat, .fm-thread, .fm-post) { border-bottom: 0; border-radius: 22px; padding: 22px 24px; box-shadow: var(--n-raise); background: var(--n-bg); }
html[data-style="neu"] .fm-post.op { box-shadow: var(--n-layer); }
html[data-style="neu"] :is(.fm-cat, .fm-thread, .fm-post)::before { display: none; }
html[data-style="neu"] :is(.fm-cat, .fm-thread):hover { box-shadow: var(--n-raise-sm); }
html[data-style="neu"] .fm-post:target { box-shadow: var(--n-inset-sm); }
html[data-style="neu"] .fm-bar { border-bottom-color: transparent; }
html[data-style="neu"] .fm-search { border: 0; padding: 0; }
html[data-style="neu"] .fm-search input { height: 40px; padding: 0 16px; border-radius: 999px !important; }
html[data-style="neu"] .fm-badge { border-color: transparent; border-radius: 999px; padding: 5px 10px; box-shadow: var(--n-inset-sm); }
html[data-style="neu"] .fm-avatar { border-color: transparent; box-shadow: var(--n-rim-sm); }
html[data-style="neu"] .fm-prose :is(pre, code) { border-color: transparent; border-radius: 12px; box-shadow: var(--n-inset-sm); background: var(--n-bg); }
html[data-style="neu"] .fm-prose pre code { box-shadow: none; }
html[data-style="neu"] :is(.fm-img, .fm-thumb) { border-color: transparent; border-radius: 16px; box-shadow: var(--n-inset-sm); padding: 6px; background: var(--n-bg); }
html[data-style="neu"] :is(.fm-img, .fm-thumb) img { border-radius: 11px; }
html[data-style="neu"] .fm-thumb-x { border-color: transparent; border-radius: 50%; box-shadow: var(--n-raise-sm); background: var(--n-bg); }
html[data-style="neu"] .fm-preview { border-color: transparent; border-radius: 14px; box-shadow: var(--n-inset-sm); }
html[data-style="neu"] .fm-tabs { border-bottom-color: transparent; }
html[data-style="neu"] .fm-note { border-color: transparent; }
html[data-style="neu"] .fm-pages a.on { border-color: transparent; padding: 6px 12px; border-radius: 12px; box-shadow: var(--n-inset-sm); }
html[data-style="neu"] .fm-select { border-radius: 999px !important; padding-left: 16px; }
html[data-style="neu"] .fm-new-btn { padding: 12px 20px !important; }
html.reduce-motion .fm-img img { transition: none; }
