/* Hokage TCG forum v2. Built on app.css tokens (--bg, --surface, --hair, --text, --orange…) and its
   shared classes (.btn, .field, .seg, .tag, .toggle, .byline, .rx). Everything here is prefixed fx-. */
:root {
  --fx-solid: var(--ink, #1c0b00); --fx-on-solid: #fff; --fx-danger: #b3261e;
  --fx-ease: cubic-bezier(.23, 1, .32, 1); --fx-drawer: cubic-bezier(.32, .72, 0, 1);
  --fx-cut: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  --fx-cut-s: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%);
}
:root[data-mode="dark"] { --fx-solid: #f6f2ff; --fx-on-solid: var(--ink, #1c0b00); --fx-danger: #ff6b5e; }
html.fx-lock, html.fx-lock body { overflow: hidden; }

.fxi { width: 20px; height: 20px; flex: none; display: block; }
.fx-x { width: 28px; height: 28px; flex: none; display: grid; place-items: center; padding: 0; border: 0; background: var(--fx-solid); color: var(--fx-on-solid); clip-path: var(--fx-cut-s); }
.fx-x svg { width: 14px; height: 14px; }

/* card miniature: never drawn above its 300px thumbnail */
.fx-mini { display: block; flex: none; width: 34px; aspect-ratio: 63 / 88; border-radius: 4.2% / 3%; overflow: hidden; background: #ececf2; box-shadow: 0 0 0 1px var(--hair); }
.fx-mini img { width: 100%; height: 100%; object-fit: cover; max-width: none; }
.fx-mini.ph { display: grid; place-items: center; background: var(--fx-solid); color: var(--fx-on-solid); }
.fx-mini.ph i { font: 700 9px/1 var(--f-card); letter-spacing: .02em; }

/* ---------------------------------------------------------------- list */
.fx-head { justify-content: space-between; margin-bottom: 22px; }
.fx-new { flex: none; }
.fx-list { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 40px; align-items: start; }
.fx-rail { position: sticky; top: 92px; display: grid; gap: 26px; }
.fx-fgroup { display: grid; gap: 10px; min-width: 0; }
.fx-cats { display: grid; gap: 2px; }
.fx-cat { height: 38px; padding: 0 14px; border: 0; background: none; text-align: left; color: var(--text-2); font: 700 italic 16.5px/1 var(--f-card); letter-spacing: .04em; text-transform: uppercase; clip-path: var(--fx-cut); transition: background-color .16s ease, color .16s ease; }
.fx-cat[aria-pressed="true"] { background: var(--fx-solid); color: var(--fx-on-solid); }
.fx-flags { display: grid; gap: 2px; }
.fx-flag { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 14px; border: 0; background: none; color: var(--text-2); font: 700 italic 16.5px/1 var(--f-card); letter-spacing: .04em; text-transform: uppercase; text-align: left; transition: color .16s ease; }
.fx-flag i { width: 15px; height: 15px; flex: none; transform: skewX(-10deg); box-shadow: inset 0 0 0 2px var(--hair-2); transition: background-color .16s ease, box-shadow .16s ease; }
.fx-flag[aria-pressed="true"] { color: var(--text); }
.fx-flag[aria-pressed="true"] i { background: var(--orange); box-shadow: inset 0 0 0 2px var(--orange); }
.fx-fcard { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 5px 6px 5px 8px; background: var(--surface); border: 1px solid var(--hair-2); border-radius: 2px; color: var(--text); min-width: 0; }
.fx-fcard .fx-mini { width: 24px; }
.fx-fcard b { flex: 1; min-width: 0; font: 700 italic 15px/1.1 var(--f-card); text-transform: uppercase; letter-spacing: .03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-fcard.add { width: 100%; border-style: dashed; color: var(--text-2); text-align: left; transition: color .16s ease, border-color .16s ease; }
.fx-fcard.add svg { width: 18px; height: 18px; }

.fx-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fx-q { flex: 1 1 260px; max-width: 460px; }
.fx-q svg { width: 18px; height: 18px; color: var(--text-3); }
.fx-q input, .fx-pick-q input, .fx-linkf input { caret-color: var(--orange); }
.fx-sort { margin-left: auto; flex-wrap: nowrap; }
.fx-fbtn { display: none; align-items: center; gap: 8px; height: 44px; padding: 0 18px 0 14px; border: 0; background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--hair-2); border-radius: 2px; font: 700 italic 15.5px/1 var(--f-card); letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; }
.fx-fbtn svg { width: 18px; height: 18px; }
.fx-fbtn.on { background: var(--fx-solid); color: var(--fx-on-solid); box-shadow: none; }

.fx-rows { display: grid; }
.fx-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 86px; gap: 20px; align-items: center; padding: 17px 14px; margin: 0 -14px; border-bottom: 1px solid var(--hair); color: inherit; transition: background-color .16s ease; }
.fx-row.nomedia { grid-template-columns: minmax(0, 1fr) 86px; }
.fx-row-main { display: grid; gap: 7px; min-width: 0; justify-items: start; }
.fx-row-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; min-width: 0; max-width: 100%; }
.fx-row-meta time, .fx-op-meta time, .fx-time { font: 600 12.5px/1 var(--f-card); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.fx-row-meta > svg { width: 15px; height: 15px; color: var(--text-3); }
.fx-row-fol { color: var(--orange-text); display: inline-flex; }
.fx-row-fol svg { width: 14px; height: 14px; }
.fx-row-in { font: 700 14px/1.2 var(--f-head); letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: min(46ch, 100%); }
.fx-row-t { font: 700 17.5px/1.25 var(--f-head); letter-spacing: -.015em; max-width: 100%; text-wrap: balance; overflow-wrap: anywhere; }
.fx-dot { display: inline-block; width: 9px; height: 9px; margin-right: 9px; background: var(--orange); transform: skewX(-10deg) translateY(-1px); }
.fx-row-prev { font-size: 14px; line-height: 1.45; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 78ch; overflow-wrap: anywhere; }
.fx-row-media { display: block; }
.fx-row-img { width: 92px; height: 68px; object-fit: cover; border-radius: 2px; background: var(--surface-2); }
.fx-fan { display: flex; padding-left: 14px; }
.fx-fan .fx-mini { width: 44px; margin-left: -14px; box-shadow: 0 0 0 2px var(--bg), 0 6px 14px -8px rgba(0, 0, 0, .5); transition: transform .2s var(--fx-ease); }
.fx-fan .fx-mini:nth-child(1) { transform: rotate(-4deg); } .fx-fan.n1 .fx-mini { transform: none; }
.fx-fan .fx-mini:nth-child(3) { transform: rotate(4deg); }
.fx-row-side { display: grid; justify-items: end; gap: 6px; }
.fx-stat { display: inline-flex; align-items: baseline; gap: 6px; color: var(--text-3); font: 600 11.5px/1 var(--f-card); letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }
.fx-stat b { font: 800 italic 25px/1 var(--f-card); letter-spacing: 0; color: var(--text); }
.fx-stat.zero b { color: var(--text-3); }
.fx-stat.rx b { font-size: 16px; color: var(--text-2); }
.fx-stat.rx span { font: 900 13px/1 var(--f-jp); letter-spacing: 0; color: var(--orange-text); }
.fx-row.reply .fx-row-prev { -webkit-line-clamp: 3; }
.fx-morew { display: flex; justify-content: center; padding: 22px 0 0; }
.fx-none { display: grid; justify-items: start; gap: 12px; padding: 26px 0; }
.fx-skel { display: grid; }
.fx-skel i { display: block; height: 78px; border-bottom: 1px solid var(--hair); background: linear-gradient(90deg, var(--surface) 0 38%, transparent 38% 100%) 0 20px / 100% 14px no-repeat, linear-gradient(90deg, var(--surface) 0 72%, transparent 72% 100%) 0 44px / 100% 12px no-repeat; animation: fx-pulse 1.2s ease-in-out infinite alternate; }
.fx-skel i:nth-child(2n) { animation-delay: .15s; }
@keyframes fx-pulse { from { opacity: .45; } to { opacity: 1; } }

/* ---------------------------------------------------------------- thread */
.fx-crumb { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; margin-bottom: 18px; font: 700 italic 15.5px/1 var(--f-card); letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.fx-crumb a { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; transition: color .16s ease; }
.fx-crumb a svg { width: 18px; height: 18px; margin-left: -5px; }
.fx-crumb-c::before { content: ""; width: 2px; height: 15px; margin-right: 12px; background: var(--hair-2); transform: skewX(-14deg); }
.fx-thread { display: grid; grid-template-columns: minmax(0, 820px) 216px; gap: 56px; align-items: start; }
.fx-col { min-width: 0; }
.fx-op { padding-bottom: 18px; border-bottom: 2px solid var(--text); }
.fx-op > .fx-in { display: grid; gap: 14px; justify-items: start; min-width: 0; }
.fx-op > .fx-in > * { max-width: 100%; }
.fx-op-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.fx-op-meta a.tag { transition: filter .16s ease; }
.fx-title { margin: 0; font: 800 italic clamp(29px, 3.3vw, 44px)/1.02 var(--f-card); letter-spacing: .005em; text-transform: uppercase; text-wrap: balance; overflow-wrap: anywhere; }
.fx-edited { font: 600 italic 12.5px/1 var(--f-card); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
a.byline { transition: filter .16s ease; }
.fx-ref { display: flex; align-items: center; gap: 12px; padding: 0; border: 0; background: none; color: inherit; text-align: left; }
.fx-ref .fx-mini { width: 46px; }
.fx-ref span { display: grid; gap: 4px; }
.fx-ref b { font: 800 italic 18px/1.05 var(--f-card); text-transform: uppercase; letter-spacing: .02em; }
.fx-ref i { font-style: normal; font-size: 13px; color: var(--text-3); }
.fx-ref.news img { width: 76px; height: 50px; object-fit: cover; border-radius: 2px; }

.fx-body { font-size: 16px; line-height: 1.62; max-width: 68ch; min-width: 0; overflow-wrap: anywhere; }
.fx-body > :first-child { margin-top: 0; } .fx-body > :last-child { margin-bottom: 0; }
.fx-body p { margin: 0 0 .85em; }
.fx-body strong { font-weight: 700; }
.fx-body a { color: var(--orange-text); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.fx-body ul { margin: 0 0 .85em; padding: 0; list-style: none; display: grid; gap: 4px; }
.fx-body li { position: relative; padding-left: 22px; }
.fx-body li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 8px; height: 8px; background: var(--orange); transform: skewX(-12deg); }
.fx-body blockquote, .fx-q, .fx-ed-quote blockquote { margin: 0 0 .85em; padding: 9px 14px; border-left: 3px solid var(--orange); background: var(--surface); color: var(--text-2); font-size: 14.5px; line-height: 1.5; }
.fx-q { margin: 0 0 10px; max-width: 68ch; overflow-wrap: anywhere; }
.fx-q[data-pjump] { cursor: pointer; }
.fx-q b, .fx-ed-quote b { display: block; margin-bottom: 3px; font: 700 italic 13.5px/1 var(--f-card); letter-spacing: .06em; text-transform: uppercase; color: var(--text); }
.fx-chip { display: inline-flex; align-items: center; gap: 7px; vertical-align: -0.38em; max-width: 100%; margin: 1px 0; padding: 3px 10px 3px 4px; border: 0; border-radius: 2px; background: var(--surface-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--hair); font: 700 italic 15.5px/1 var(--f-card); letter-spacing: .03em; text-transform: uppercase; transition: color .16s ease, box-shadow .16s ease; }
.fx-chip .fx-mini { width: 19px; box-shadow: none; border-radius: 1.5px; }
.fx-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-gal { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.fx-galc { padding: 0; border: 0; background: none; transition: transform .2s var(--fx-ease); }
.fx-galc .fx-mini { width: 92px; }

.fx-imgs { display: grid; gap: 6px; max-width: 68ch; width: 100%; justify-items: start; }
.fx-imgs.n2, .fx-imgs.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fx-imgs.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fx-img { display: block; width: 100%; max-height: 600px; padding: 0; border: 0; border-radius: 2px; overflow: hidden; background: var(--surface-2); cursor: zoom-in; }
.fx-imgs:not(.n1) .fx-img { aspect-ratio: 4 / 3 !important; }
.fx-img img { width: 100%; height: 100%; object-fit: cover; }

.fx-deck { width: 100%; max-width: 68ch; background: var(--surface); border: 1px solid var(--hair-2); border-radius: 2px; }
.fx-deck-h { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.fx-deck-l { padding: 0; border: 0; background: none; }
.fx-deck-l .fx-mini, .fx-deck-h > .fx-mini { width: 38px; }
.fx-deck-n { display: grid; gap: 5px; min-width: 0; flex: 1; }
.fx-deck-n b { display: block; font: 800 italic 20px/1 var(--f-card); text-transform: uppercase; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-deck-n a { color: inherit; transition: color .16s ease; }
.fx-deck-n .num { font-size: 13.5px; color: var(--text-3); letter-spacing: .04em; }
.fx-deck-list { margin: 0; padding: 8px 12px 10px; list-style: none; columns: 2 230px; column-gap: 22px; border-top: 1px solid var(--hair); }
.fx-deck-list li { break-inside: avoid; }
.fx-deck-list button { display: flex; align-items: baseline; gap: 9px; width: 100%; min-height: 28px; padding: 3px 0; border: 0; background: none; text-align: left; font-size: 14px; line-height: 1.3; color: var(--text); transition: color .16s ease; }
.fx-deck-list i { flex: none; width: 1.2em; font: 700 15px/1 var(--f-card); font-style: normal; color: var(--orange-text); text-align: right; }
.fx-deck-list span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fx-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; }
.fx-op .fx-foot { margin-top: 2px; }
.fx-rx { margin: 0; }
.fx-rx .rx { min-width: 38px; height: 32px; justify-content: center; transition: background-color .16s ease, color .16s ease, transform .14s ease-out; }
.fx-rx .rx:active { transform: scale(.94); }
.fx-rx .rx.on { background: var(--fx-solid); color: var(--fx-on-solid); }
.fx-rx .rx.on b { color: inherit; }
.fx-rx .rx.pop b { animation: fx-pop .34s var(--fx-ease); }
@keyframes fx-pop { 0% { transform: scale(.8); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }
.fx-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 0 2px; }
.fx-act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 8px; border: 0; background: none; color: var(--text-3); font: 700 italic 14px/1 var(--f-card); letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; transition: color .16s ease, background-color .16s ease, transform .14s ease-out; }
.fx-act svg { width: 16px; height: 16px; }
.fx-act:active { transform: scale(.96); }
.fx-act.fx-follow.on { color: var(--orange-text); }
.fx-act.arm { color: #fff; background: var(--fx-danger); clip-path: var(--fx-cut-s); }
:root[data-mode="dark"] .fx-act.arm { color: #1c0b00; }

.fx-rep { margin: 30px 0 2px; }
.fx-posts { display: grid; }
.fx-post { position: relative; padding: 18px 0; border-bottom: 1px solid var(--hair); min-width: 0; }
.fx-post.d1 { margin-left: 30px; } .fx-post.d2 { margin-left: 60px; }
.fx-post.d1::before, .fx-post.d2::before { content: ""; position: absolute; left: -16px; top: 0; bottom: -1px; width: 2px; background: var(--hair-2); }
.fx-post.d2::after { content: ""; position: absolute; left: -46px; top: 0; bottom: -1px; width: 2px; background: var(--hair-2); }
.fx-post > .fx-in, .fx-post > .fx-slot { min-width: 0; }
.fx-post-h { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 10px; }
.fx-time { transition: color .16s ease; }
.fx-re { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text-3); }
.fx-re svg { width: 14px; height: 14px; }
.fx-re b { color: var(--text-2); font-weight: 600; }
.fx-post .fx-imgs, .fx-post .fx-deck { margin-top: 12px; }
.fx-post.editing > .fx-in, .fx-op.editing > .fx-in { display: none; }
.fx-slot:not(:empty) { margin-top: 14px; }
.fx-post.editing > .fx-slot, .fx-op.editing > .fx-slot { margin-top: 0; }
.fx-enter { animation: fx-in .36s var(--fx-ease) both; }
@keyframes fx-in { from { opacity: 0; transform: translateY(10px); } }
.fx-flash { animation: fx-flash 1.8s ease-out both; }
.fx-enter.fx-flash { animation: fx-in .36s var(--fx-ease) both, fx-flash 1.8s ease-out both; }
@keyframes fx-flash { from { background-color: color-mix(in srgb, var(--orange) 20%, transparent); } to { background-color: transparent; } }
.fx-root { padding-top: 22px; }

.fx-side { position: sticky; top: 92px; display: grid; gap: 26px; justify-items: start; }
.fx-side-fol { width: 100%; }
.fx-side-cards { display: grid; gap: 10px; width: 100%; }
.fx-side-cards > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.fx-side-cards button { padding: 0; border: 0; background: none; transition: transform .2s var(--fx-ease); }
.fx-side-cards .fx-mini { width: 100%; }

/* ---------------------------------------------------------------- editor */
.fx-ed { display: grid; gap: 12px; min-width: 0; max-width: 820px; }
.fx-ed-top { display: none; }
.fx-ed-scroll { display: grid; gap: 14px; min-width: 0; }
.fx-ed-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-ed-title { position: relative; }
.fx-ed-title input { width: 100%; height: 54px; padding: 0 64px 0 0; border: 0; border-bottom: 2px solid var(--hair-2); border-radius: 0; background: none; outline: none; color: var(--text); font: 700 22px/1.2 var(--f-head); letter-spacing: -.015em; caret-color: var(--orange); transition: border-color .16s ease; }
.fx-ed-title input::placeholder { color: var(--text-3); opacity: 1; }
.fx-ed-title input:focus { border-color: var(--orange); }
.fx-ed-title .num { position: absolute; right: 0; top: 50%; translate: 0 -50%; font-size: 13.5px; color: var(--text-3); }
.fx-ed-quote { position: relative; }
.fx-ed-quote blockquote { margin: 0; padding-right: 44px; max-height: 96px; overflow: hidden; }
.fx-ed-quote .fx-x { position: absolute; top: 8px; right: 8px; }
.fx-ed-box { min-width: 0; background: var(--surface); border: 1px solid var(--hair-2); border-radius: 2px; transition: border-color .16s ease, box-shadow .16s ease; }
.fx-ed-box:focus-within { border-color: var(--orange); box-shadow: inset 0 -2px 0 var(--orange); }
.fx-ed.drop .fx-ed-box { border-color: var(--orange); border-style: dashed; background: color-mix(in srgb, var(--orange) 7%, var(--surface)); }
.fx-ed-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 6px; border-bottom: 1px solid var(--hair); }
.fx-tools { display: flex; align-items: center; min-width: 0; }
.fx-tool { width: 36px; height: 36px; flex: none; display: grid; place-items: center; padding: 0; border: 0; border-radius: 2px; background: none; color: var(--text-2); transition: background-color .14s ease, color .14s ease, transform .14s ease-out; }
.fx-tool:active { transform: scale(.92); }
.fx-tool b { font: 800 19px/1 var(--f-card); }
.fx-tool i { font: 700 italic 19px/1 Georgia, "Times New Roman", serif; }
.fx-tool svg { width: 19px; height: 19px; }
.fx-sep { width: 1px; height: 20px; margin: 0 6px; background: var(--hair-2); flex: none; }
.fx-ed-mode { flex: none; flex-wrap: nowrap; padding: 2px; }
.fx-ed-mode button { height: 30px; padding: 0 11px; font-size: 13.5px; }
.fx-ed textarea { display: block; width: 100%; min-height: 120px; padding: 14px 16px; border: 0; outline: none; resize: none; background: none; color: var(--text); font: 400 16px/1.6 var(--f-ui); letter-spacing: inherit; caret-color: var(--orange); }
.fx-ed-prev { padding: 14px 16px; min-height: 120px; max-width: none; }
.fx-ed-prev .fx-imgs, .fx-ed-prev .fx-deck { margin-top: 12px; }
.fx-ed-att { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 0 12px 12px; }
.fx-ed-att[hidden] { display: none; }
.fx-ed.is-preview .fx-ed-att { display: none; }
.fx-att-i { position: relative; width: 92px; height: 92px; border-radius: 2px; overflow: hidden; background: var(--surface-2); animation: fx-att .24s var(--fx-ease) both; }
@keyframes fx-att { from { opacity: 0; transform: scale(.94); } }
.fx-att-i img { width: 100%; height: 100%; object-fit: cover; transition: opacity .2s ease; }
.fx-att-i.up img { opacity: .4; }
.fx-att-i .fx-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 24px; }
.fx-att-i.up .fx-x { display: none; }
.fx-spin, .btn.busy::after { width: 20px; height: 20px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: fx-spin .6s linear infinite; }
.fx-spin { position: absolute; inset: 0; margin: auto; color: var(--text); }
@keyframes fx-spin { to { transform: rotate(360deg); } }
.btn.busy { position: relative; color: transparent; opacity: 1; }
.btn.busy::after { content: ""; position: absolute; inset: 0; margin: auto; color: var(--on-orange); width: 16px; height: 16px; }
.fx-ed-att .fx-deck { flex: 1 1 240px; max-width: 360px; }
.fx-ed-foot { display: flex; align-items: center; gap: 10px; min-height: 36px; }
.fx-ed-err { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 600; color: var(--fx-danger); }
.fx-ed-count { font-size: 13.5px; color: var(--text-3); }
.fx-newwrap { max-width: 820px; }
.fx-ref.static { margin: 2px 0; }

/* ---------------------------------------------------------------- layers: popover, bottom sheet, lightbox */
.fx-layer { position: fixed; inset: 0; z-index: 86; pointer-events: none; }
.fx-layer > * { pointer-events: auto; }
.fx-scrim { position: absolute; inset: 0; background: rgba(4, 4, 8, .58); opacity: 0; transition: opacity .22s ease; }
.fx-layer.open .fx-scrim { opacity: 1; }
.fx-panel { color: var(--text); }
.fx-pop { position: fixed; max-width: calc(100vw - 16px); background: var(--surface); border: 1px solid var(--hair-2); border-radius: 3px; box-shadow: 0 22px 44px -18px rgba(0, 0, 0, .5), 0 2px 6px rgba(0, 0, 0, .08); opacity: 0; transform: scale(.96); transition: opacity .12s ease-out, transform .12s ease-out; }
.fx-layer.open .fx-pop { opacity: 1; transform: none; transition: opacity .14s ease-out, transform .18s var(--fx-ease); }
.fx-sheet { position: fixed; left: 0; right: 0; bottom: var(--fx-kb, 0px); max-width: 560px; margin: 0 auto; max-height: min(84dvh, calc(var(--fx-vvh, 100dvh) - 20px)); display: flex; flex-direction: column; background: var(--bg-2); border-top: 4px solid var(--orange); padding-bottom: env(safe-area-inset-bottom, 0px); transform: translateY(100%); transition: transform .22s cubic-bezier(.4, 0, 1, 1); box-shadow: 0 -24px 60px -20px rgba(0, 0, 0, .5); }
.fx-layer.open .fx-sheet { transform: none; transition: transform .36s var(--fx-drawer); }
.fx-grab { flex: none; height: 26px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.fx-grab::before { content: ""; width: 40px; height: 4px; background: var(--hair-2); transform: skewX(-14deg); }
.fx-sheet-h { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px 12px; }
.fx-sheet-h b { font: 800 italic 26px/1 var(--f-card); text-transform: uppercase; letter-spacing: .02em; }
.fx-sheet-b { overflow: auto; overscroll-behavior: contain; display: grid; gap: 22px; padding: 6px 16px 22px; }
.fx-sheet-b .fx-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.fx-sheet-b .fx-cat, .fx-sheet-b .fx-flag { height: 46px; background: var(--surface); }
.fx-sheet-b .fx-flags { gap: 6px; }
.fx-sheet-b .fx-cat[aria-pressed="true"] { background: var(--fx-solid); }

.fx-pick { display: flex; flex-direction: column; }
.fx-pop.fx-pick { width: 400px; max-height: min(460px, calc(100vh - 16px)); }
.fx-pick-q { flex: none; max-width: none; margin: 10px; }
.fx-sheet .fx-pick-q { margin-top: 0; }
.fx-pick-q svg { width: 18px; height: 18px; color: var(--text-3); }
.fx-pick-grid { overflow: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; padding: 0 6px 8px; min-height: 120px; }
.fx-pick-i, .fx-decks-i { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 56px; padding: 5px 8px; border: 0; border-radius: 2px; background: none; color: var(--text); text-align: left; transition: background-color .12s ease; }
.fx-pick-i > span, .fx-decks-i > span { display: grid; gap: 4px; min-width: 0; }
.fx-pick-i b, .fx-decks-i b { font: 700 italic 15.5px/1.05 var(--f-card); letter-spacing: .03em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-pick-i i, .fx-decks-i i { font-style: normal; font-size: 12.5px; color: var(--text-3); }
.fx-linkf { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px; }
.fx-linkf .field { flex: 1 1 250px; max-width: none; }
.fx-pop .fx-linkf { width: 420px; max-width: 100%; }
.fx-linkf .field.bad { border-color: var(--fx-danger); box-shadow: inset 0 -2px 0 var(--fx-danger); }
.fx-linkf .fx-ed-err { flex: 1 1 100%; }
.fx-linkf .fx-ed-err:empty { display: none; }
.fx-sheet .fx-linkf { padding: 0 16px 18px; }
.fx-decks { display: grid; gap: 2px; padding: 6px; overflow: auto; }
.fx-pop .fx-decks { width: 300px; max-height: 360px; }
.fx-decks.none { padding: 14px; justify-items: start; }
.fx-sheet .fx-decks { padding: 0 10px 14px; }

.fx-lb { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; background: rgba(8, 6, 5, .93); opacity: 0; transition: opacity .18s ease-out; cursor: zoom-out; }
.fx-lb.open { opacity: 1; }
.fx-lb img { width: auto; height: auto; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px); transform: scale(.97); transition: transform .24s var(--fx-ease); cursor: default; }
.fx-lb.open img { transform: none; }
.fx-lb-x, .fx-lb-n { position: absolute; width: 48px; height: 48px; display: grid; place-items: center; padding: 0; border: 0; background: rgba(255, 255, 255, .12); color: #fff; clip-path: var(--fx-cut-s); transition: background-color .16s ease; }
.fx-lb-x { top: max(12px, env(safe-area-inset-top, 0px)); right: 12px; }
.fx-lb-x svg { width: 18px; height: 18px; }
.fx-lb-n { top: 50%; translate: 0 -50%; } .fx-lb-n.prev { left: 12px; } .fx-lb-n.next { right: 12px; }
.fx-lb-c { position: absolute; bottom: max(14px, env(safe-area-inset-bottom, 0px)); left: 50%; translate: -50% 0; color: #fff; font-size: 15px; letter-spacing: .08em; }

/* ---------------------------------------------------------------- profile */
.fx-prof { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 18px 40px; padding: 2px 0 24px; margin-bottom: 18px; border-bottom: 2px solid var(--text); }
.fx-prof-n { margin: 0; max-width: 100%; padding: 9px 30px 9px 18px; background: color-mix(in srgb, var(--vc) 82%, #000); color: #fff; font: 800 italic clamp(34px, 4.6vw, 58px)/.96 var(--f-card); letter-spacing: .01em; text-transform: uppercase; clip-path: polygon(0 0, 100% 0, calc(100% - 16px) 100%, 0 100%); overflow-wrap: anywhere; }
.fx-prof-s { display: flex; flex-wrap: wrap; gap: 14px 34px; margin: 0; }
.fx-prof-s div { display: grid; gap: 7px; }
.fx-prof-s dt { font: 700 12px/1 var(--f-card); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.fx-prof-s dd { margin: 0; font: 800 italic 24px/1 var(--f-card); text-transform: uppercase; }
.fx-prof-tabs { margin-bottom: 4px; }

/* ---------------------------------------------------------------- hover (fine pointers only) */
@media (hover: hover) and (pointer: fine) {
  .fx-cat:hover, .fx-flag:hover, .fx-fcard.add:hover, .fx-crumb a:hover, .fx-act:hover, .fx-time:hover, .fx-deck-list button:hover, .fx-deck-n a:hover, .fx-chip:hover { color: var(--text); }
  .fx-cat[aria-pressed="true"]:hover { color: var(--fx-on-solid); }
  .fx-fcard.add:hover { border-color: var(--text-3); }
  .fx-row:hover { background: var(--surface); }
  .fx-row:hover .fx-fan .fx-mini:nth-child(1) { transform: rotate(-7deg) translateY(-2px); }
  .fx-row:hover .fx-fan .fx-mini:nth-child(3) { transform: rotate(7deg) translateY(-2px); }
  .fx-chip:hover, .fx-deck-list button:hover, .fx-deck-n a:hover, .fx-time:hover { color: var(--orange-text); }
  .fx-chip:hover { box-shadow: inset 0 0 0 1px var(--orange); }
  .fx-galc:hover, .fx-side-cards button:hover { transform: translateY(-3px); }
  .fx-tool:hover, .fx-pick-i:hover, .fx-decks-i:hover { background: var(--surface-2); color: var(--text); }
  .fx-act.arm:hover { color: #fff; }
  .fx-lb-x:hover, .fx-lb-n:hover { background: rgba(255, 255, 255, .24); }
  a.byline:hover, .fx-op-meta a.tag:hover { filter: brightness(1.12); }
}

/* ---------------------------------------------------------------- narrower screens */
@media (max-width: 1100px) {
  .fx-thread { grid-template-columns: minmax(0, 1fr); }
  .fx-side { display: none; }
}
@media (max-width: 900px) {
  .fx-list { grid-template-columns: minmax(0, 1fr); }
  .fx-rail { display: none; }
  .fx-fbtn { display: inline-flex; }
}
@media (max-width: 760px) {
  .fx-head { margin-bottom: 16px; }
  .fx-new { height: 44px; }
  .fx-bar { flex-wrap: wrap; gap: 8px; margin-bottom: 2px; }
  .fx-q { flex: 1 1 100%; max-width: none; height: 46px; }
  .fx-q input, .fx-pick-q input, .fx-linkf input { font-size: 16px; }
  .fx-sort { padding: 2px; }
  .fx-sort button { height: 38px; padding: 0 13px; }
  .fx-row, .fx-row.nomedia { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; padding: 16px; margin: 0 -16px; }
  .fx-row-side { grid-column: 1 / -1; display: flex; justify-items: start; gap: 16px; }
  .fx-stat b { font-size: 17px; } .fx-stat.rx b { font-size: 15px; }
  .fx-row-t { font-size: 16.5px; }
  .fx-row-img { width: 76px; height: 58px; }
  .fx-fan .fx-mini { width: 38px; }
  .fx-none .btn { height: 48px; }

  .fx-crumb a { min-height: 44px; }
  .fx-body { font-size: 16px; }
  .fx-post.d1 { margin-left: 14px; } .fx-post.d2 { margin-left: 28px; }
  .fx-post.d1::before, .fx-post.d2::before { left: -10px; }
  .fx-post.d2::after { left: -24px; }
  .fx-foot { gap: 6px 8px; }
  .fx-rx { gap: 4px; }
  .fx-rx .rx { min-width: 44px; height: 44px; }
  .fx-acts { gap: 0; }
  .fx-act { height: 44px; min-width: 44px; justify-content: center; padding: 0 10px; }
  .fx-act svg { width: 18px; height: 18px; }
  .fx-act:not([data-a="reply"]):not(.arm) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .fx-deck-list button { min-height: 40px; }
  .fx-time, .fx-re { min-height: 32px; display: inline-flex; align-items: center; }
  .fx-root .btn { width: 100%; height: 50px; }
  .fx-gal { gap: 6px; } .fx-galc .fx-mini { width: 78px; }

  /* full-screen editor */
  .fx-ed-full { position: fixed; z-index: 78; left: 0; right: 0; top: 0; height: var(--fx-vvh, 100dvh); max-width: none; display: flex; flex-direction: column; gap: 0; background: var(--bg); color: var(--text); animation: fx-up .34s var(--fx-drawer) both; }
  @keyframes fx-up { from { transform: translateY(40px); opacity: 0; } }
  .fx-ed-full .fx-ed-top { flex: none; display: flex; align-items: center; gap: 12px; padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; border-bottom: 1px solid var(--hair); background: var(--bg-2); }
  .fx-ed-full .fx-ed-top .fx-x { width: 44px; height: 44px; background: none; color: var(--text); clip-path: none; }
  .fx-ed-full .fx-ed-top .fx-x svg { width: 18px; height: 18px; }
  .fx-ed-full .fx-ed-top b { flex: 1; min-width: 0; font: 800 italic 21px/1 var(--f-card); text-transform: uppercase; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .fx-ed-full .fx-ed-top .btn { height: 44px; }
  .fx-ed-full .fx-ed-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 8px; }
  .fx-ed-full .fx-ed-scroll > * { flex: none; }
  .fx-ed-full .fx-ed-cats { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .fx-ed-full .fx-ed-cats::-webkit-scrollbar { display: none; }
  .fx-ed-full .fx-ed-cats .toggle { height: 44px; flex: none; }
  .fx-ed-full .fx-ed-box { flex: 1 0 auto; display: flex; flex-direction: column; min-height: 240px; }
  .fx-ed-full .fx-ed-bar { flex-wrap: wrap-reverse; gap: 2px 8px; padding: 2px 0; }
  .fx-ed-full .fx-tools { flex: 1 1 100%; justify-content: space-between; }
  .fx-ed-full .fx-tool { width: 44px; height: 44px; }
  .fx-ed-full .fx-sep { margin: 0; }
  .fx-ed-full .fx-ed-mode { margin: 4px 6px 2px auto; }
  .fx-ed-full .fx-ed-mode button { height: 36px; }
  .fx-ed-full textarea { flex: 1 0 auto; min-height: 150px; }
  .fx-ed-full .fx-ed-prev { flex: 1 0 auto; }
  .fx-ed-full .fx-ed-foot { flex: none; min-height: 0; padding: 6px 16px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .fx-ed-full .fx-ed-foot:has(.fx-ed-err:empty):has(.fx-ed-count:empty) { display: none; }
  .fx-ed-full .fx-ed-foot .btn { display: none; }
  .fx-att-i .fx-x { top: 0; right: 0; width: 44px; height: 44px; background: none; clip-path: none; isolation: isolate; }
  .fx-att-i .fx-x::before { content: ""; position: absolute; z-index: -1; top: 5px; right: 5px; width: 32px; height: 28px; background: var(--fx-solid); clip-path: var(--fx-cut-s); }
  .fx-att-i .fx-x svg { translate: 6px -8px; }
  .fx-ed-quote .fx-x, .fx-fcard .fx-x, .fx-deck-h .fx-x { width: 46px; height: 44px; }

  .fx-prof { gap: 16px 28px; padding-bottom: 20px; }
  .fx-prof-s { gap: 14px 26px; }
  .fx-prof-s dd { font-size: 21px; }
  .fx-prof-tabs button { height: 40px; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .fx-enter, .fx-ed-full, .fx-att-i, .fx-rx .rx.pop b { animation: none !important; }
  .fx-sheet, .fx-pop, .fx-lb img { transition: opacity .15s ease !important; transform: none !important; }
  .fx-layer:not(.open) .fx-sheet { opacity: 0; }
  .fx-skel i { animation: none; }
}

/* the app shell prints its own section title above the mount point: the forum has its own */
.page:has(> #forum-root) > :not(#forum-root) { display: none; }
