/* ==========================================================================
   PepploForum stylesheet — loaded after BaseKit's app.css, uses its tokens.
   1. Header extras   2. Forum bar   3. Board index   4. Thread lists
   5. Thread page + postbit   6. BBCode content   7. Editor   8. Polls
   9. Profiles + members   10. Private messages + alerts   11. Moderation + admin
   12. Responsive
   ========================================================================== */

/* 1. Header extras (messages, alerts, account menu) ------------------------ */
.hdr-icons { display: flex; align-items: center; gap: 4px; }
.hdr-icon { position: relative; }
.hdr-badge { position: absolute; top: 2px; right: 0; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 600; line-height: 17px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.hdr-badge[hidden] { display: none; }
.hdr-user { border: 0; background: none; padding: 2px; margin-left: 4px; border-radius: 50%; cursor: pointer; display: grid; }
.hdr-user:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.alerts-menu { width: 360px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.alerts-menu-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.alerts-menu-head strong { font-weight: 600; font-size: 14px; }
.alerts-menu-head form { margin: 0; }
.alerts-menu-body { max-height: 380px; overflow-y: auto; }
.alerts-menu-foot { display: block; padding: 10px 14px; border-top: 1px solid var(--border); text-align: center; font-size: 13.5px; font-weight: 500; text-decoration: none; }
.dropdown-menu .alerts-menu-foot { justify-content: center; border-radius: 0; }
.alerts-loading { display: grid; place-items: center; padding: 28px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--primary); font: 500 13px var(--font); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--danger); }
.dropdown-menu .link-btn { width: auto; padding: 0; display: inline; }
.dropdown-label { padding: 6px 10px 2px; font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--faint); }
.site-nav a.is-active { color: var(--primary); background: var(--primary-soft); }

/* 2. Forum bar (breadcrumbs + quick links) --------------------------------- */
.forum-site main { min-height: calc(100vh - 260px); }
.forum-bar { border-bottom: 1px solid var(--border); background: var(--surface); }
.forum-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 46px; padding: 6px 0; }
.fcrumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; min-width: 0; }
.fcrumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; }
.fcrumbs a:hover { color: var(--primary); }
.fcrumbs .sep { color: var(--border-strong); }
.fcrumbs .current { color: var(--text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46ch; }
.forum-quick { display: flex; gap: 2px; flex: none; }
.forum-quick a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); font-size: 13.5px; font-weight: 500; text-decoration: none; }
.forum-quick a:hover { background: var(--surface-2); color: var(--text); }
.forum-main { padding: 26px 0 56px; }

/* 3. Board index --------------------------------------------------------- */
.board-head, .thread-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.board-head h1 { font-size: 26px; letter-spacing: -.02em; line-height: 1.2; }
.board-head p { margin: 6px 0 0; color: var(--muted); max-width: 70ch; }
.board-head-actions, .thread-head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; flex: none; }
.board-head-actions form, .thread-head-actions form { margin: 0; }
.board-search { position: relative; display: flex; align-items: center; }
.board-search .icon { position: absolute; left: 11px; color: var(--faint); pointer-events: none; }
.board-search .input { padding-left: 34px; width: 260px; height: 36px; }
.guest-notice { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 20px; border: 1px solid var(--primary-line); background: var(--primary-soft); border-radius: var(--radius-lg); }
.guest-notice > .icon { color: var(--primary); flex: none; }
.guest-notice p { margin: 0; flex: 1; }
.guest-notice .btn-row { flex: none; }

.board-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.board-grid.has-side { grid-template-columns: minmax(0, 1fr) 300px; }
.board-cats { display: grid; gap: 20px; min-width: 0; }

.fcat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 20px; }
.board-cats .fcat { margin-bottom: 0; }
.fcat-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 18px; background: linear-gradient(180deg, var(--primary-soft), transparent 140%); border-bottom: 1px solid var(--border); }
.fcat-head h2 { font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; }
.fcat-head h2 a { color: var(--text); text-decoration: none; }
.fcat-head h2 a:hover { color: var(--primary); }
.fcat-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.fcat-head [data-collapse] .icon { transition: transform .2s; }
.fcat.is-collapsed .fcat-body { display: none; }
.fcat.is-collapsed [data-collapse] .icon { transform: rotate(180deg); }
.fcat.is-collapsed .fcat-head { border-bottom: 0; }
.frow-empty { padding: 18px; color: var(--muted); font-size: 14px; }

.frow { display: grid; grid-template-columns: 44px minmax(0, 1fr) 150px 240px; gap: 16px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--border); }
.fcat-body > .frow:first-child, .fcat-body > :first-child { border-top: 0; }
.frow:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.ficon { position: relative; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: var(--fc, var(--primary)); background: color-mix(in srgb, var(--fc, var(--primary)) 12%, var(--surface)); text-decoration: none; }
.frow.is-unread .ficon { color: #fff; background: var(--fc, var(--primary)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fc, var(--primary)) 22%, transparent); }
.ficon-lock { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); color: var(--muted); display: grid; place-items: center; box-shadow: 0 0 0 1px var(--border); }
.frow-title { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; line-height: 1.3; }
.frow-title a { color: var(--text); text-decoration: none; }
.frow-title a:hover { color: var(--primary); }
.frow.is-unread .frow-title a { color: var(--text); }
.frow-desc { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.frow-subs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--faint); }
.frow-subs a { color: var(--muted); }
.frow-subs a:hover { color: var(--primary); }
.frow-stats, .trow-stats { display: flex; gap: 18px; justify-content: flex-end; text-align: center; }
.frow-stats div, .trow-stats div { display: grid; min-width: 52px; }
.frow-stats strong, .trow-stats strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.frow-stats span, .trow-stats span { font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .04em; }
.frow-last { display: flex; align-items: center; gap: 10px; min-width: 0; }
.frow-last > div { min-width: 0; display: grid; }
.frow-last-title { font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.frow-last-title:hover { color: var(--primary); }
.frow-last-meta { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow-last-meta a { color: var(--muted); }
.new-pill { display: inline-flex; align-items: center; height: 19px; padding: 0 7px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 600; letter-spacing: .02em; }

.board-side { display: grid; gap: 16px; position: sticky; top: 88px; }
.side-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; box-shadow: var(--shadow); }
.side-box h3 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; margin-bottom: 12px; }
.side-box h3 .icon { color: var(--primary); }
.side-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.side-list li { display: grid; gap: 2px; min-width: 0; }
.side-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.35; text-decoration: none; overflow-wrap: anywhere; }
.side-title:hover { color: var(--primary); }
.side-meta { font-size: 12.5px; color: var(--faint); }
.side-more { display: inline-block; margin-top: 12px; font-size: 13px; font-weight: 500; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.tag:hover { color: var(--primary); border-color: var(--primary-line); background: var(--primary-soft); text-decoration: none; }
.tag small { color: var(--faint); font-size: 11px; }

.board-foot { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1px; margin-top: 28px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.bf-block { background: var(--surface); padding: 16px 18px; }
.bf-block h3 { display: flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; margin-bottom: 8px; }
.bf-block h3 a { color: var(--text); text-decoration: none; }
.bf-block h3 .icon { color: var(--primary); }
.bf-block p { margin: 0 0 8px; font-size: 13.5px; }
.bf-stats { display: flex; gap: 24px; margin-bottom: 10px; }
.bf-stats div { display: grid; }
.bf-stats strong { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.bf-stats span { font-size: 12px; color: var(--faint); }
.online-names { font-size: 13.5px; line-height: 1.8; margin-bottom: 8px; }
.online-names a { text-decoration: none; font-weight: 500; }
.forum-legend { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 18px; font-size: 12.5px; color: var(--faint); }
.forum-legend span, .forum-legend a { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.ficon-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); display: inline-block; }
.ficon-dot.is-unread { background: var(--primary); }
.username { font-weight: 500; }

/* 4. Thread lists -------------------------------------------------------- */
.forum-rules { margin-bottom: 18px; background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 25%, transparent); border-radius: var(--radius-lg); padding: 0 16px; }
.forum-rules summary { cursor: pointer; padding: 12px 0; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--warning); list-style: none; }
.forum-rules summary::-webkit-details-marker { display: none; }
.forum-rules .prose { padding-bottom: 14px; font-size: 14px; }
.tlist { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 16px; }
.tlist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); flex-wrap: wrap; }
.tlist-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.select-sm, .input-sm { height: 32px; font-size: 13.5px; padding-top: 0; padding-bottom: 0; }
.select.select-sm { width: auto; min-width: 120px; padding-right: 30px; }
.tlist-body .empty { padding: 40px 20px; }
.trow { display: grid; grid-template-columns: auto 30px minmax(0, 1fr) 150px 180px; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.trow:not(:has(.trow-check)) { grid-template-columns: 30px minmax(0, 1fr) 150px 180px; }
.tlist-body > .trow:first-child { border-top: 0; }
.trow:hover { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.trow.is-sticky { background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.trow.is-pending { background: var(--warning-soft); }
.trow.is-deleted { background: var(--danger-soft); opacity: .8; }
.trow-check, .post-check { display: grid; place-items: center; }
.trow-check input, .post-check input { width: 16px; height: 16px; accent-color: var(--primary); }
.tstate { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--faint); background: var(--surface-2); }
.trow.is-unread .tstate { color: var(--primary); background: var(--primary-soft); }
.trow-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 15px; line-height: 1.35; }
.trow-title > a { color: var(--text); font-weight: 500; text-decoration: none; overflow-wrap: anywhere; }
.trow.is-unread .trow-title > a { font-weight: 600; }
.trow-title > a:hover { color: var(--primary); }
.trow-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; font-size: 12.5px; color: var(--faint); }
.trow-meta a { color: var(--muted); }
.trow-rating { display: inline-flex; align-items: center; gap: 3px; color: #d97706; }
.tpages { display: inline-flex; gap: 3px; margin-left: 2px; }
.tpages a, .tpages span { min-width: 22px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--border); font-size: 11.5px; color: var(--muted); display: inline-grid; place-items: center; text-decoration: none; }
.tpages span { border: 0; }
.tpages a:hover { border-color: var(--primary); color: var(--primary); }
.trow-last { display: flex; align-items: center; gap: 10px; min-width: 0; justify-content: flex-end; text-align: right; }
.trow-last > div { display: grid; min-width: 0; }
.trow-last-when { font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none; white-space: nowrap; }
.trow-last-when:hover { color: var(--primary); }
.trow-last span { font-size: 12.5px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow-last .avatar { order: 2; }

.flag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; vertical-align: middle; }
.flag-sticky { background: var(--primary-soft); color: var(--primary); }
.flag-global { background: var(--info-soft); color: var(--info); }
.flag-pending { background: var(--warning-soft); color: var(--warning); }
.flag-deleted { background: var(--danger-soft); color: var(--danger); }
.flag-solved { background: var(--success-soft); color: var(--success); }
.prefix { display: inline-flex; align-items: center; height: 21px; padding: 0 8px; border-radius: 5px; background: var(--p, #475569); color: #fff; font-size: 11.5px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; vertical-align: middle; }
.prefix-lg { height: 26px; padding: 0 10px; font-size: 13px; position: relative; top: -3px; }

.inline-mod { position: sticky; bottom: 14px; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px auto 0; padding: 10px 14px; max-width: 760px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); }
.inline-mod[hidden] { display: none; }
.inline-mod > span { font-size: 14px; margin-right: auto; }

/* 5. Thread page + postbit ------------------------------------------------ */
.thread-head-main { min-width: 0; }
.thread-title { font-size: 27px; line-height: 1.22; letter-spacing: -.02em; overflow-wrap: anywhere; }
.thread-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.thread-meta > span { display: inline-flex; align-items: center; gap: 6px; }
.thread-meta .icon { color: var(--faint); }
.rating { display: inline-flex; align-items: center; gap: 1px; }
.star-form { margin: 0; display: inline-flex; }
.star { border: 0; background: none; padding: 1px; color: var(--border-strong); cursor: default; display: inline-grid; }
button.star { cursor: pointer; }
.star.is-on, .star.is-on .icon { color: #f59e0b; fill: #f59e0b; }
.star.is-mine .icon { filter: drop-shadow(0 0 1px rgba(217, 119, 6, .6)); }
.rating:has(button.star:hover) .star-form .star { color: #f59e0b; }
.rating:has(button.star:hover) .star-form:hover ~ .star-form .star { color: var(--border-strong); }
.rating:has(button.star:hover) .star .icon { fill: none; }
.rating .star-form:hover .star .icon, .rating:has(.star-form:hover) .star-form:has(~ .star-form:hover) .star .icon { fill: currentColor; }
.rating small { margin-left: 6px; font-size: 12.5px; color: var(--muted); }

.posts { display: grid; gap: 16px; margin: 16px 0; }
.post { display: grid; grid-template-columns: 200px minmax(0, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: visible; scroll-margin-top: 90px; }
.post:target { box-shadow: 0 0 0 3px var(--primary-line); }
.post.is-solved { border-color: color-mix(in srgb, var(--success) 45%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--success) 30%, transparent); }
.post.is-pending { background: color-mix(in srgb, var(--warning-soft) 50%, var(--surface)); }
.post.is-deleted { background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.post.is-deleted .post-body { opacity: .7; }
.post-author { padding: 20px 16px; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 50%, var(--surface)); text-align: center; border-radius: var(--radius-lg) 0 0 var(--radius-lg); display: grid; justify-items: center; align-content: start; gap: 10px; }
.post-avatar { position: relative; display: inline-grid; text-decoration: none; }
.post-avatar .avatar-xl { width: 88px; height: 88px; font-size: 28px; }
.online-dot { position: absolute; right: 4px; bottom: 4px; width: 14px; height: 14px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px var(--surface); }
.post-author-info { display: grid; justify-items: center; gap: 4px; width: 100%; }
.post-author-name { font-size: 15px; font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.post-author-name .username { font-weight: 600; }
.post-author-title { font-size: 12.5px; color: var(--muted); }
.stars { display: inline-flex; gap: 1px; color: #f59e0b; }
.stars .icon { fill: currentColor; }
.group-badge { display: inline-flex; align-items: center; height: 21px; padding: 0 9px; border-radius: 11px; background: color-mix(in srgb, var(--g, #64748b) 14%, var(--surface)); color: var(--g, #64748b); border: 1px solid color-mix(in srgb, var(--g, #64748b) 30%, transparent); font-size: 11.5px; font-weight: 600; }
[data-theme="dark"] .group-badge { color: color-mix(in srgb, var(--g, #64748b) 60%, #fff); }
.post-author-stats { display: grid; gap: 3px; width: 100%; margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12.5px; text-align: left; }
.post-author-stats div { display: flex; justify-content: space-between; gap: 8px; }
.post-author-stats dt { color: var(--faint); }
.post-author-stats dd { margin: 0; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.post-main { display: flex; flex-direction: column; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.post-num { margin-left: auto; color: var(--faint); font-weight: 500; text-decoration: none; }
.post-num:hover { color: var(--primary); }
.post-body { padding: 18px 20px; flex: 1; font-size: 15px; overflow-wrap: anywhere; }
.post-ignored { padding: 18px 20px; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.post-attachments { margin: 0 20px 14px; padding: 12px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.post-attachments-title { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.attach-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.attach-thumb { display: block; width: 120px; height: 90px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-item { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13.5px; color: var(--text); text-decoration: none; }
.attach-item small { color: var(--faint); }
.attach-item.is-locked { color: var(--faint); }
.post-edited { margin: 0 20px 12px; font-size: 12.5px; color: var(--faint); font-style: italic; }
.post-signature { margin: 0 20px 14px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); max-height: 160px; overflow: hidden; }
.post-signature img { max-height: 90px; }
.post-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--border); min-height: 48px; }
.post-reactions { min-width: 0; }
.reaction-summary { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px 0 6px; border: 1px solid var(--border); border-radius: 15px; background: var(--surface); color: var(--muted); font: 500 13px var(--font); cursor: pointer; }
.reaction-summary:hover { border-color: var(--primary-line); color: var(--text); }
.reaction-emojis { display: inline-flex; }
.reaction-emojis span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); box-shadow: 0 0 0 2px var(--surface); font-size: 13px; margin-left: -4px; }
.reaction-emojis span:first-child { margin-left: 0; }
.post-actions { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.post-actions form { margin: 0; }
.pa-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); font: 500 13px var(--font); cursor: pointer; }
.pa-btn:hover { background: var(--surface-2); color: var(--text); }
.pa-btn.is-active { color: var(--primary); background: var(--primary-soft); }
.pa-btn.is-picked { color: var(--success); background: var(--success-soft); }
.react-picker { position: relative; }
.react-menu { position: absolute; bottom: calc(100% + 6px); right: 0; z-index: 90; display: none; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-pop); white-space: nowrap; }
.react-picker.is-open .react-menu, .react-picker:focus-within .react-menu { display: flex; animation: pop .12s ease-out; }
@media (hover: hover) { .react-picker:hover .react-menu { display: flex; } }
.react-menu form { display: inline-flex; }
.react-menu button { width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; font-size: 21px; cursor: pointer; transition: transform .12s; display: grid; place-items: center; }
.react-menu button:hover { transform: scale(1.22); background: var(--surface-2); }
.react-menu button.is-active { background: var(--primary-soft); }
.reaction-people { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-height: 60vh; overflow-y: auto; }
.reaction-people li { display: flex; align-items: center; gap: 10px; }
.reaction-people li .muted { margin-left: auto; }
.reaction-emoji { font-size: 18px; width: 24px; text-align: center; }

.quick-reply { margin-top: 20px; scroll-margin-top: 90px; }
.quick-reply .card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.quick-reply .card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.thread-foot { display: grid; gap: 16px; margin-top: 24px; }
.thread-nav { display: flex; justify-content: space-between; gap: 16px; font-size: 14px; }
.thread-nav a { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; max-width: 48%; }

/* 6. BBCode content ------------------------------------------------------ */
.bb p { margin: 0 0 .8em; }
.bb .bb-h { font-size: 1.2em; font-weight: 600; margin: 1em 0 .4em; }
.bb .bb-center { text-align: center; } .bb .bb-right { text-align: right; } .bb .bb-left { text-align: left; } .bb .bb-justify { text-align: justify; }
.bb .bb-indent { padding-left: 2em; }
.bb .bb-list { padding-left: 1.4em; margin: .4em 0 .9em; }
.bb .bb-img { max-width: 100%; max-height: 640px; height: auto; border-radius: var(--radius); margin: .4em 0; }
.bb .smilie { height: 1.35em; width: auto; vertical-align: -.3em; margin: 0 1px; display: inline; border-radius: 0; }
.bb .mention { display: inline-flex; padding: 0 5px; border-radius: 5px; background: var(--primary-soft); font-weight: 500; text-decoration: none; }
.bb-quote { margin: .6em 0 1em; padding: 10px 14px; border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: var(--radius); background: var(--surface-2); color: var(--text); font-size: .95em; }
.bb-quote cite { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-style: normal; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.bb-quote cite .icon { color: var(--primary); }
.bb-quote-jump { display: inline-grid; color: var(--faint); }
.bb-quote-jump:hover { color: var(--primary); }
.bb-quote .bb-quote { background: var(--surface); }
.bb-quote > div > :last-child { margin-bottom: 0; }
.bb-code { margin: .6em 0 1em; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.bb-code-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 12px; border-bottom: 1px solid var(--border); font: 600 11px var(--font); letter-spacing: .05em; color: var(--faint); }
.bb-copy { border: 0; background: none; color: var(--primary); font: 500 12px var(--font); cursor: pointer; }
.bb-code pre { margin: 0; padding: 12px 14px; max-height: 480px; overflow: auto; font: 500 13px/1.6 var(--mono); tab-size: 4; white-space: pre; }
.bb-code code { font: inherit; background: none; padding: 0; }
.bb .bb-icode { font: 500 .88em var(--mono); padding: 1px 5px; border-radius: 4px; background: var(--surface-3); }
.bb-spoiler { margin: .6em 0 1em; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.bb-spoiler summary { cursor: pointer; padding: 8px 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.bb-spoiler[open] summary { border-bottom: 1px solid var(--border); }
.bb-spoiler > div { padding: 10px 12px; }
.bb-video { position: relative; width: 100%; max-width: 640px; aspect-ratio: 16 / 9; margin: .6em 0 1em; border-radius: var(--radius); overflow: hidden; background: #000; }
.bb-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.bb-table { border-collapse: collapse; margin: .6em 0 1em; font-size: .94em; display: block; overflow-x: auto; max-width: 100%; }
.bb-table td, .bb-table th { border: 1px solid var(--border); padding: 6px 10px; }
.bb-table th { background: var(--surface-2); font-weight: 600; }
.bb-attach { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: .92em; text-decoration: none; }
.bb-attach-img { display: inline-block; margin: .4em 0; max-width: 100%; }
.bb-attach-img img { display: block; max-width: 100%; max-height: 520px; height: auto; border-radius: var(--radius); margin: 0; }
.bb-attach-locked { color: var(--faint); font-size: .92em; }

/* 7. Editor -------------------------------------------------------------- */
.bbeditor { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); position: relative; }
.bbeditor:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent); }
.bbeditor.is-drop { border-style: dashed; border-color: var(--primary); background: var(--primary-soft); }
.bbeditor-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.bbeditor-tabs button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid transparent; border-bottom: 0; border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: none; color: var(--muted); font: 500 13px var(--font); cursor: pointer; margin-bottom: -1px; }
.bbeditor-tabs button.is-active { background: var(--surface); border-color: var(--border); color: var(--text); }
.bbeditor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.bbeditor-bar > button, .bb-pop > button, .bb-upload { width: 32px; height: 30px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); display: inline-grid; place-items: center; cursor: pointer; padding: 0; font: 600 12px var(--font); }
.bbeditor-bar > button:hover, .bb-pop > button:hover, .bb-upload:hover, .bb-pop.is-open > button { background: var(--surface-2); color: var(--text); }
.bbeditor-bar .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.bb-tagname { font: 600 11px var(--mono); }
.bbeditor.is-preview .bbeditor-bar { visibility: hidden; height: 0; padding: 0; border: 0; overflow: hidden; }
.bb-pop { position: relative; }
.bb-pop-menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 95; display: none; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.bb-pop.is-open .bb-pop-menu { display: grid; animation: pop .12s ease-out; }
.bb-colors { grid-template-columns: repeat(5, 24px); gap: 6px; }
.bb-colors button { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.bb-sizes { gap: 2px; min-width: 120px; }
.bb-sizes button { border: 0; background: none; padding: 6px 10px; text-align: left; border-radius: var(--radius-sm); font: 400 14px var(--font); color: var(--text); cursor: pointer; }
.bb-sizes button:hover { background: var(--surface-2); }
.bb-smilies { grid-template-columns: repeat(8, 34px); gap: 2px; max-height: 220px; overflow-y: auto; }
.bb-smilies button { width: 34px; height: 34px; border: 0; border-radius: var(--radius-sm); background: none; cursor: pointer; display: grid; place-items: center; font-size: 19px; }
.bb-smilies button:hover { background: var(--surface-2); }
.bb-smilies .smilie { height: 22px; width: auto; }
.bbeditor-write { position: relative; }
.bbeditor-input.textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 140px; resize: vertical; font-size: 14.5px; line-height: 1.6; background: transparent; }
.bbeditor-preview { padding: 14px 16px; min-height: 140px; border-bottom: 1px solid var(--border); }
.bbeditor .attach-list:empty { display: none; }
.attach-list { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; max-width: 100%; }
.attach-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }
.attach-chip small { color: var(--faint); }
.attach-chip.is-uploading { opacity: .65; }
.attach-chip.is-error { border-color: var(--danger); color: var(--danger); }
.bbeditor > .help { padding: 0 12px 10px; margin: 0; }
.bbeditor-draft { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-top: 1px solid var(--border); font-size: 13px; }
.mention-pop, .suggest-pop { position: absolute; z-index: 130; min-width: 220px; max-width: 320px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-pop); }
.mention-pop[hidden], .suggest-pop[hidden] { display: none; }
.mention-pop button, .suggest-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--text); font: 400 14px var(--font); text-align: left; cursor: pointer; }
.mention-pop button small, .suggest-pop button small { color: var(--faint); margin-left: auto; font-size: 12px; }
.mention-pop button.is-focus, .mention-pop button:hover, .suggest-pop button.is-focus, .suggest-pop button:hover { background: var(--surface-2); }
.mention-pop .avatar, .suggest-pop .avatar { width: 26px; height: 26px; font-size: 11px; }
.suggest-wrap { position: relative; }

/* 8. Polls --------------------------------------------------------------- */
.poll .card-head h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.poll .card-head p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.poll-results { display: grid; gap: 14px; }
.poll-label { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; margin-bottom: 5px; }
.poll-label > span:first-child { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.poll-label .icon { color: var(--success); }
.poll-bar { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.poll-bar span { display: block; height: 100%; border-radius: 5px; background: var(--primary); min-width: 2px; transition: width .5s ease-out; }
.poll-row.is-mine .poll-bar span { background: var(--success); }
.poll-voters { margin-top: 5px; font-size: 12.5px; color: var(--muted); }
.poll-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; }
.poll-choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.poll-choice input { width: 16px; height: 16px; accent-color: var(--primary); }
.poll-builder { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.poll-builder > summary { list-style: none; padding: 10px 14px; cursor: pointer; }
.poll-builder > summary::-webkit-details-marker { display: none; }
.poll-builder[open] > summary { border-bottom: 1px solid var(--border); }
.poll-builder-body { padding: 14px; }

/* 9. Profiles + members --------------------------------------------------- */
.profile-head { overflow: hidden; }
.profile-cover { height: 110px; background: linear-gradient(120deg, var(--g, var(--primary)), color-mix(in srgb, var(--g, var(--primary)) 45%, #0f172a)); }
.profile-id { display: flex; align-items: flex-end; gap: 18px; padding: 0 22px 18px; margin-top: -44px; flex-wrap: wrap; }
.profile-avatar .avatar-xl { width: 104px; height: 104px; font-size: 34px; box-shadow: 0 0 0 4px var(--surface); }
.profile-avatar .online-dot { right: 8px; bottom: 8px; }
.profile-id-text { flex: 1; min-width: 220px; padding-top: 50px; }
.profile-id-text h1 { font-size: 24px; letter-spacing: -.015em; overflow-wrap: anywhere; }
.profile-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; color: var(--muted); }
.profile-facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.profile-facts span { display: inline-flex; align-items: center; gap: 5px; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 4px; }
.profile-actions form { margin: 0; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border-top: 1px solid var(--border); }
.profile-stats > a, .profile-stats > div { display: grid; padding: 12px 16px; text-align: center; color: var(--text); text-decoration: none; border-right: 1px solid var(--border); }
.profile-stats > :last-child { border-right: 0; }
.profile-stats a:hover { background: var(--surface-2); }
.profile-stats strong { font-size: 18px; font-weight: 600; }
.profile-stats span { font-size: 12px; color: var(--faint); }
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.profile-post, .recent-post, .search-post { padding: 14px 18px; border-top: 1px solid var(--border); }
a.profile-post { display: grid; gap: 3px; color: var(--text); text-decoration: none; }
a.profile-post:hover { background: var(--surface-2); text-decoration: none; }
a.profile-post strong { font-weight: 600; color: var(--primary); }
a.profile-post span { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
a.profile-post small { font-size: 12.5px; }
.card-head:has(> h2 + a) { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.profile-post:first-child, .recent-post:first-child, .search-post:first-child { border-top: 0; }
.recent-post-head, .search-post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; font-size: 13px; color: var(--faint); margin-bottom: 6px; }
.search-post-title { font-size: 15px; font-weight: 600; }
.recent-posts, .search-posts { display: grid; }
.member-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 18px; }
.member-filter .input { max-width: 260px; }
.letters { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 18px; }
.letters a { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: none; }
.letters a:hover { background: var(--surface-2); color: var(--text); }
.letters a.current, .letters a.is-active { background: var(--primary); color: var(--on-primary); }
.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.member-card { display: grid; justify-items: center; gap: 6px; padding: 20px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); text-align: center; box-shadow: var(--shadow); }
.member-card .avatar-xl { width: 72px; height: 72px; font-size: 24px; }
.member-card a { text-decoration: none; font-weight: 600; }
.member-card-stats { display: flex; gap: 14px; margin-top: 6px; font-size: 12.5px; color: var(--faint); }
.member-card-stats strong { color: var(--text); font-weight: 600; }
.rep-badge { display: inline-flex; align-items: center; gap: 6px; }
.rep-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); text-align: center; gap: 8px; }
.rep-summary > div { display: grid; }
.rep-summary strong { font-size: 22px; font-weight: 600; }
.rep-summary span { font-size: 12px; color: var(--faint); }
.rep-row { display: flex; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); align-items: flex-start; }
.rep-row:first-child { border-top: 0; }
.rep-row.is-pos { box-shadow: inset 3px 0 0 var(--success); }
.rep-row.is-neg { box-shadow: inset 3px 0 0 var(--danger); }
.rep-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stat-link { color: inherit; text-decoration: none; }
.stat-link:hover { color: var(--primary); }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.search-card { margin-bottom: 18px; }
.search-main { display: flex; gap: 8px; }
.search-main .input { flex: 1; }
.search-more { margin-top: 12px; }
.toggle-grid, .check-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.input-lg { height: 46px; font-size: 16px; }
.h-sm { font-size: 15px; font-weight: 600; }
.ml-auto { margin-left: auto; }
.mb-1 { margin-bottom: 8px; } .mt-4 { margin-top: 32px; }
.meta { font-size: 13px; color: var(--faint); }

/* 10. Private messages + alerts ------------------------------------------- */
.pm-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.pm-folders { display: grid; gap: 2px; }
.pm-folders a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius); color: var(--muted); font-weight: 500; font-size: 14px; text-decoration: none; }
.pm-folders a:hover { background: var(--surface-2); color: var(--text); }
.pm-folders a.is-active { background: var(--primary-soft); color: var(--primary); }
.pm-folders a .badge { margin-left: auto; }
.pm-list { display: grid; }
.pm-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.pm-row:first-child { border-top: 0; }
.pm-row:hover { background: var(--surface-2); }
.pm-row.is-unread { background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); }
.pm-row.is-unread .pm-row-main a { font-weight: 600; }
.pm-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pm-row-main a { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-row-main a:hover { color: var(--primary); }
.pm-row-main small { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-row-when { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.pm-avatars { display: flex; }
.pm-avatars .avatar { box-shadow: 0 0 0 2px var(--surface); margin-left: -8px; }
.pm-avatars .avatar:first-child { margin-left: 0; }
.pm-thread { display: grid; gap: 14px; }
.pm-msg { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; scroll-margin-top: 90px; }
.pm-msg.is-mine { background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); border-color: var(--primary-line); }
.pm-msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--faint); }
.pm-msg-body { padding: 14px 16px; min-width: 0; overflow-wrap: anywhere; }
.pm-msg-head a { font-weight: 600; text-decoration: none; }
.alert-page { display: grid; }
.alert-item { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none; }
.alert-item:first-child { border-top: 0; }
.alert-item:hover { background: var(--surface-2); text-decoration: none; }
.alert-item.is-unread { background: color-mix(in srgb, var(--primary-soft) 60%, var(--surface)); }
.alert-item.is-unread::after { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; }
.alert-item-text { flex: 1; min-width: 0; display: grid; gap: 2px; font-size: 13.5px; line-height: 1.4; }
.alert-item-text small { color: var(--faint); font-size: 12px; }
.dropdown-menu .alert-item { border-radius: 0; padding: 11px 14px; font-size: 13.5px; align-items: flex-start; }
.alerts-menu .empty { padding: 26px 16px; font-size: 13.5px; }

/* 11. Moderation + admin --------------------------------------------------- */
.queue, .reports, .warnings, .bans, .log { display: grid; gap: 14px; }
.queue-item { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.queue-item > .grow { min-width: 0; }
.queue-item > .trow-check { padding: 12px 0 0 16px; align-items: start; background: var(--surface-2); place-items: start center; }
.card > .queue-item { border: 0; border-top: 1px solid var(--border); border-radius: 0; }
.queue-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 16px 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-size: 13px; color: var(--muted); }
.queue-head strong { color: var(--text); }
.queue-body { padding: 14px 16px; font-size: 14.5px; max-height: 320px; overflow: auto; }
.report-actions, .mod-options { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.queue-item > .grow > p, .queue-item > .grow > .report-actions { margin-left: 16px; margin-right: 16px; }
.queue-item > .grow > p:first-of-type { margin-top: 12px; }
.queue-item > .grow > .report-actions { margin-bottom: 14px; }
.report-actions .input { flex: 1 1 220px; max-width: 360px; }
.report-actions form, .mod-options form { margin: 0; }
.mod-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); }
.mod-row:first-child { border-top: 0; }
.mod-perms { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.ftree { display: grid; }
.ftree .ftree { margin-left: 34px; border-left: 2px solid var(--border); }
.ftree-item { border-top: 1px solid var(--border); }
.card > .ftree > .ftree-item:first-child { border-top: 0; }
.ftree-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--surface); }
.ftree-row.is-cat { background: var(--surface-2); }
.ftree-row.is-off { opacity: .6; }
.ftree-row .grow { display: grid; min-width: 0; }
.ftree-row .grow small { color: var(--faint); font-size: 12.5px; }
.ftree-grip { color: var(--faint); cursor: grab; display: inline-grid; }
.ftree-item.is-dragging > .ftree-row { opacity: .45; }
.ftree-item.is-drop-before > .ftree-row { box-shadow: inset 0 3px 0 var(--primary); }
.ftree-item.is-drop-after > .ftree-row { box-shadow: inset 0 -3px 0 var(--primary); }
.perm-matrix { min-width: 760px; }
.perm-matrix th.perm-col, .perm-matrix td.perm-col { text-align: center; width: 72px; }
.perm-col span { display: block; font-size: 11.5px; font-weight: 500; line-height: 1.25; white-space: normal; }
.perm-matrix input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.perm-matrix tr.is-inherit td.perm-col { opacity: .45; }
.is-static { pointer-events: none; }
.is-warning { color: var(--warning); }
.is-danger { color: var(--danger); }
.is-alert { color: var(--danger); }
.orphans { color: var(--warning); }

/* Print view helpers */
@media print {
  .site-header, .site-footer, .forum-bar, .post-foot, .quick-reply, .thread-head-actions, .inline-mod { display: none !important; }
  .post { break-inside: avoid; box-shadow: none; }
}

/* PM rows are links */
a.pm-row-main { color: var(--text); text-decoration: none; }
a.pm-row-main > :first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-row.is-unread a.pm-row-main > :first-child { font-weight: 600; }
a.pm-row-main:hover > :first-child { color: var(--primary); }

/* 12. Responsive ----------------------------------------------------------- */
@media (max-width: 1100px) {
  .board-grid.has-side { grid-template-columns: minmax(0, 1fr); }
  .board-side { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .frow { grid-template-columns: 44px minmax(0, 1fr) 130px 200px; }
  .site-nav { gap: 0; }
  .site-nav a { padding: 8px 9px; font-size: 14px; }
}
@media (max-width: 900px) {
  .frow { grid-template-columns: 44px minmax(0, 1fr); }
  .frow-stats { display: none; }
  .frow-last { grid-column: 2; }
  .trow, .trow:not(:has(.trow-check)) { grid-template-columns: 30px minmax(0, 1fr) auto; }
  .trow:has(.trow-check) { grid-template-columns: auto 30px minmax(0, 1fr) auto; }
  .trow-last { display: none; }
  .profile-grid, .pm-layout { grid-template-columns: minmax(0, 1fr); }
  .pm-folders { display: flex; overflow-x: auto; }
  /* Signed in: keep messages, alerts and the account menu visible next to the menu button. */
  .site-header .site-actions:has(.hdr-icons) { display: flex; margin-left: auto; order: 2; }
  .site-header .site-actions:has(.hdr-icons) [data-theme-toggle] { display: none; }
  .site-header .site-actions:has(.hdr-icons) ~ .site-menu-toggle, .site-header:has(.hdr-icons) .site-menu-toggle { margin-left: 0; order: 3; }
  .site-header.is-open .site-actions:has(.hdr-icons) { flex-basis: auto; order: 2; }
  .site-header.is-open .site-actions .hdr-icons .btn { flex: none; }
}
@media (max-width: 760px) {
  .post { grid-template-columns: minmax(0, 1fr); }
  .post-author { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: left; border-right: 0; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 12px 14px; gap: 12px; align-items: center; }
  .post-avatar .avatar-xl { width: 48px; height: 48px; font-size: 17px; }
  .online-dot { width: 11px; height: 11px; right: 1px; bottom: 1px; }
  .post-author-info { justify-items: start; grid-template-columns: auto; gap: 2px; }
  .post-author-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; border-top: 0; padding-top: 0; margin-top: 2px; }
  .post-author-stats div { gap: 4px; }
  .post-author-stats div:nth-child(n+3) { display: none; }
  .post-head, .post-body { padding-left: 14px; padding-right: 14px; }
  .post-attachments, .post-edited, .post-signature { margin-left: 14px; margin-right: 14px; }
  .post-foot { padding: 6px 8px; flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .board-head, .thread-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .board-head-actions, .thread-head-actions { justify-content: flex-start; }
  .board-search, .board-search .input { width: 100%; }
  .board-head h1 { font-size: 22px; }
  .thread-title { font-size: 21px; }
  .fcat-head, .frow { padding-left: 14px; padding-right: 14px; }
  .frow { gap: 12px; }
  .ficon { width: 38px; height: 38px; border-radius: 10px; }
  .frow { grid-template-columns: 38px minmax(0, 1fr); }
  .trow { padding: 10px 12px; gap: 10px; }
  .trow-stats { gap: 0; }
  .trow-stats div { min-width: 44px; }
  .forum-quick a span { display: none; }
  .forum-bar-inner { gap: 8px; }
  .fcrumbs .current { max-width: 22ch; }
  .guest-notice { flex-wrap: wrap; }
  .profile-id { padding: 0 16px 16px; }
  .profile-id-text { padding-top: 0; min-width: 100%; }
  .rep-choices { grid-template-columns: minmax(0, 1fr); }
  .bb-smilies { grid-template-columns: repeat(6, 34px); }
  .inline-mod { bottom: 8px; }
  .thread-nav { flex-direction: column; }
  .thread-nav a { max-width: 100%; }
  .alerts-menu { width: calc(100vw - 24px); }
  .ftree-row { flex-wrap: wrap; padding: 10px; gap: 8px 10px; }
  .ftree-row .grow { flex: 1 1 140px; }
  .ftree-row .section-tools { flex-basis: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .ftree .ftree { margin-left: 12px; }
}
.board-intro { margin-top: 6px; color: var(--muted); max-width: 70ch; } .board-intro p:last-child { margin-bottom: 0; }

/* ==========================================================================
   13. Design refresh (v1.0.0) — hero, richer forum rows, statistics,
       compact rows on tablets / phones, classes used by the views.
   ========================================================================== */
:root { --fr-radius: 16px; --fr-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px -10px rgba(16, 24, 40, .12); }
[data-theme="dark"] { --fr-shadow: 0 0 0 1px rgba(255, 255, 255, .02), 0 10px 26px -14px rgba(0, 0, 0, .8); }

/* Board hero ------------------------------------------------------------- */
.board-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; align-items: end;
  margin-bottom: 26px; padding: 30px 32px; border-radius: 22px; color: #fff;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--brand) 55%, #a855f7) 0%, transparent 55%),
              linear-gradient(135deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 55%, #0f172a) 100%);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--brand) 70%, #000); }
.board-hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .06); pointer-events: none; }
.board-hero-kicker { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 20px; background: rgba(255, 255, 255, .14); font-size: 12.5px; font-weight: 500; letter-spacing: .01em; }
.board-hero h1 { color: #fff; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.12; letter-spacing: -.025em; margin: 12px 0 6px; }
.board-hero .board-intro, .board-hero .board-intro a { color: rgba(255, 255, 255, .86); }
.board-hero .board-intro { margin: 0 0 18px; font-size: 15px; max-width: 60ch; }
.board-hero .board-search { max-width: 520px; background: #fff; border-radius: 12px; padding: 5px 5px 5px 0; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .5); }
[data-theme="dark"] .board-hero .board-search { background: var(--surface); }
.board-hero .board-search .icon { left: 14px; color: var(--faint); }
.board-hero .board-search .input { flex: 1; width: auto; border: 0; box-shadow: none; height: 38px; padding-left: 42px; background: transparent; }
.board-hero .board-search .btn { flex: none; }
.board-hero-side { display: grid; gap: 14px; justify-items: end; position: relative; z-index: 1; }
.hero-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 420px; }
.hero-stats div { display: grid; padding: 12px 10px; border-radius: 14px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); text-align: center; backdrop-filter: blur(4px); }
.hero-stats strong { font-size: 21px; font-weight: 700; letter-spacing: -.01em; line-height: 1.1; }
.hero-stats span { font-size: 11.5px; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.hero-actions form { margin: 0; }
.btn-light { background: #fff; color: var(--brand); border-color: #fff; }
.btn-light:hover { background: #f1f5ff; color: var(--brand); }
.btn-glass { background: rgba(255, 255, 255, .12); color: #fff; border: 1px solid rgba(255, 255, 255, .3); }
.btn-glass:hover { background: rgba(255, 255, 255, .2); color: #fff; }

/* Categories -------------------------------------------------------------- */
.fcat { border-radius: var(--fr-radius); box-shadow: var(--fr-shadow); }
.fcat-head { gap: 14px; padding: 15px 18px; background: linear-gradient(90deg, color-mix(in srgb, var(--cc, var(--primary)) 10%, var(--surface)) 0%, var(--surface) 75%);
  border-bottom: 1px solid var(--border); position: relative; }
.fcat-head::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--cc, var(--primary)); }
.fcat-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: var(--cc, var(--primary)); background: color-mix(in srgb, var(--cc, var(--primary)) 14%, var(--surface)); }
.fcat-head h2 { font-size: 16px; }

/* Forum rows --------------------------------------------------------------- */
.frow { grid-template-columns: 48px minmax(0, 1fr) 170px 250px; padding: 16px 20px; transition: background .15s; }
.frow-main { min-width: 0; }
.ficon { width: 48px; height: 48px; border-radius: 14px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fc, var(--primary)) 18%, transparent); }
.frow.is-unread .ficon { background: linear-gradient(135deg, var(--fc, var(--primary)), color-mix(in srgb, var(--fc, var(--primary)) 65%, #0f172a)); }
.frow-title { font-size: 16px; }
.frow-compact { display: none; }
.frow-stats { gap: 8px; }
.frow-stats div { min-width: 66px; padding: 7px 6px; border-radius: 10px; background: var(--surface-2); }
.frow-stats strong { font-size: 15.5px; }
.frow-stats span { font-size: 10.5px; }
.frow-last { padding: 8px 10px; border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.frow-last .avatar { box-shadow: 0 0 0 2px var(--surface); }
.frow-subs { gap: 6px; margin-top: 8px; }
.frow-subs a { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 12.5px; font-weight: 500; text-decoration: none; }
.frow-subs a:hover { color: var(--primary); border-color: var(--primary-line); background: var(--primary-soft); }
.frow-subs a .icon { color: var(--faint); }

/* Side boxes and board footer --------------------------------------------- */
.side-box { border-radius: var(--fr-radius); box-shadow: var(--fr-shadow); }
.side-box h3 { padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.side-list li { padding-left: 12px; border-left: 2px solid var(--border); }
.side-list li:hover { border-left-color: var(--primary); }
.board-foot { border-radius: var(--fr-radius); box-shadow: var(--fr-shadow); }
.bf-block h3 .icon { padding: 5px; width: 26px; height: 26px; border-radius: 8px; background: var(--primary-soft); }
.bf-stats div { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }

/* Thread lists --------------------------------------------------------------- */
.tlist { border-radius: var(--fr-radius); box-shadow: var(--fr-shadow); }
.trow-main { min-width: 0; }
.trow { padding: 14px 18px; transition: background .15s; }
.tstate { width: 34px; height: 34px; border-radius: 11px; }
.trow.is-unread .tstate { background: linear-gradient(135deg, var(--primary), color-mix(in srgb, var(--primary) 60%, #0f172a)); color: #fff; }
.trow-stats div { padding: 5px 6px; border-radius: 9px; background: var(--surface-2); }

/* Thread page ---------------------------------------------------------------- */
.thread-head { padding: 22px 24px; border-radius: var(--fr-radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--fr-shadow); }
.thread-title-row { display: flex; gap: 16px; align-items: flex-start; }
.thread-title-row > .field:not(.grow) { flex: 0 0 210px; }
.thread-title-row > .grow { flex: 1; min-width: 0; }
.post { border-radius: var(--fr-radius); box-shadow: var(--fr-shadow); }
.post-author { background: linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 70%, var(--surface)) 0, var(--surface) 160px); border-radius: var(--fr-radius) 0 0 var(--fr-radius); }
.post-avatar .avatar-xl { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px color-mix(in srgb, var(--primary) 25%, transparent); }
.post-author-stats { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.quick-reply { border-radius: var(--fr-radius); box-shadow: var(--fr-shadow); }
.post.is-ignored .post-author { opacity: .6; }
.poll-form { margin: 0; }
.modal-lg .modal-box, .modal-box.modal-lg { width: min(820px, calc(100vw - 32px)); max-width: none; }
.hdr-alerts .dropdown-menu { right: -8px; }

/* Statistics ------------------------------------------------------------------ */
.stats-row .stat { border-radius: var(--fr-radius); box-shadow: var(--fr-shadow); }
.stat-boards .card { border-radius: var(--fr-radius); box-shadow: var(--fr-shadow); }
.stat-boards .card-head h2 { display: flex; align-items: center; gap: 8px; }
.stat-boards .card-head h2 .icon { color: var(--primary); }
.rank-list { list-style: none; margin: 0; padding: 6px 0; counter-reset: none; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 18px; min-width: 0; }
.rank-list li + li { border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.rank-list li:hover { background: var(--surface-2); }
.rank-pos { width: 26px; height: 26px; flex: none; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); }
.rank-pos.is-top-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-pos.is-top-2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank-pos.is-top-3 { background: linear-gradient(135deg, #f0a77a, #c2703d); color: #fff; }
.rank-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; }
.rank-name:hover { text-decoration: underline; }
.rank-value { flex: none; display: inline-flex; align-items: baseline; gap: 4px; padding: 3px 10px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; }
.rank-value small { font-weight: 500; font-size: 11px; opacity: .8; }
.member-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.member-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2); text-decoration: none; font-size: 13.5px; }
.member-chip:hover { border-color: var(--primary-line); background: var(--primary-soft); }
.member-chip .avatar { width: 26px; height: 26px; font-size: 10.5px; }

/* Tablets and phones: no nested "last post" block — a one-line summary instead. */
@media (max-width: 900px) {
  .board-hero { grid-template-columns: minmax(0, 1fr); padding: 24px 22px; gap: 18px; }
  .board-hero-side { justify-items: stretch; }
  .hero-stats { max-width: none; }
  .hero-actions { justify-content: flex-start; }
  .frow { grid-template-columns: 44px minmax(0, 1fr); align-items: start; padding: 14px 16px; }
  .frow-last, .frow-stats { display: none !important; }
  .frow-compact { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-size: 12.5px; color: var(--faint); }
  .frow-compact span { display: inline-flex; align-items: center; gap: 5px; }
  .frow .ficon { width: 44px; height: 44px; border-radius: 12px; }
  .thread-head { padding: 18px; }
  .thread-title-row { flex-direction: column; align-items: stretch; gap: 0; }
  .thread-title-row > .field:not(.grow) { flex-basis: auto; }
}
@media (max-width: 640px) {
  .board-hero { border-radius: 18px; padding: 20px 18px; margin-bottom: 18px; }
  .board-hero::after { display: none; }
  .hero-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .hero-stats div { padding: 9px 4px; border-radius: 12px; }
  .hero-stats strong { font-size: 17px; }
  .hero-stats span { font-size: 10px; }
  .board-hero .board-search .btn { display: none; }
  .fcat-head { padding: 13px 14px; }
  .frow { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; padding: 12px 14px; }
  .frow .ficon { width: 38px; height: 38px; }
  .frow-desc { font-size: 13px; }
  .rank-list li { padding: 9px 14px; gap: 10px; }
}
