/* Forum pages, on top of /assets/common.css (tokens, panels, plank buttons, forms, badges, pager, .md).
   CSP: no inline styles anywhere; everything is a class. Mobile-first down to 360 px. */

/* Same for the stacked forms and panels of the forum (grids from common.css with an implicit auto column). */
#forum-root :is(.stack,.stack-sm),.forum-dialog .stack{grid-template-columns:minmax(0,1fr)}
/* Headings and posts receive focus after navigation (tabindex="-1"); show it only for keyboard users. */
#forum-root [tabindex="-1"]:focus:not(:focus-visible){outline:none}
#forum-root h1[tabindex="-1"]:focus-visible{outline:2px dashed var(--honey);outline-offset:4px}
.loading{padding:48px 0}

/* ---------- breadcrumbs, heads, toolbars ---------- */
.crumbs ol{list-style:none;margin:0 0 18px;padding:0;display:flex;flex-wrap:wrap;gap:2px 8px;font-size:14px;color:var(--muted)}
.crumbs li{min-width:0;max-width:100%}
.crumbs li + li::before{content:"›";margin-right:8px;color:var(--ink-2)}
.crumbs a{color:var(--muted)}
.crumbs a:hover{color:var(--honey)}
.crumbs [aria-current]{color:var(--text)}
.forum-hero,.forum-head{display:flex;flex-wrap:wrap;gap:16px 24px;align-items:flex-end;justify-content:space-between;margin-bottom:22px}
.forum-hero h1{font-size:40px}
.forum-head h1{font-size:32px}
.forum-hero .stack-sm,.forum-head .stack-sm{max-width:720px}
.head-actions{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.forum-toolbar{display:flex;flex-wrap:wrap;gap:12px 24px;align-items:center;justify-content:space-between;margin-bottom:20px}
.forum-stats{display:flex;flex-wrap:wrap;gap:6px 20px;color:var(--muted);font-size:14px}
.forum-stats b{font:400 20px/1 var(--pixel);color:var(--text);margin-right:4px;font-variant-numeric:tabular-nums}
.search-form{display:flex;gap:8px;flex:1 1 260px;max-width:440px}
.search-form .input{min-height:44px;padding:8px 12px}
.search-form .btn-sm{flex:none}
.section-title{font-size:22px;margin:0 0 14px;display:flex;align-items:center;gap:12px}
.section-title::after{content:"";flex:1;height:2px;background:var(--stone-3)}
.forum-section{margin-top:36px}
.empty-line{color:var(--muted);padding:12px 0}
.forum-banner{margin-bottom:24px}
.forum-banner .md{font-size:15px}
.forum-banner .md blockquote{color:var(--ink-2)}
.chip{font:12px/1 var(--pixel);color:var(--honey);border:2px solid var(--stone-3);padding:4px 6px;text-decoration:none;white-space:nowrap}
.chip:hover{border-color:var(--honey)}
.who{color:var(--honey);font-weight:500;text-decoration:none}
.who:hover{text-decoration:underline;color:var(--cream)}
.who + .badge{margin-left:6px}
.badge-lock{color:var(--muted)}
.tr-flags .badge,.thread-head .badge{margin-right:6px}

/* ---------- boards ---------- */
.board-list{list-style:none;margin:0;padding:0;display:grid;gap:12px}
.board-row{display:grid;grid-template-columns:60px minmax(0,1fr) 120px minmax(0,230px);gap:12px 18px;align-items:center;
  border:18px solid transparent;border-image:url(/img/ui/panel_dark.png) 24 fill / 18px stretch;padding:2px 4px}
.board-row.is-hidden{opacity:.7}
.br-icon{display:grid;place-items:center;width:60px;height:60px;background:var(--well);border:2px solid var(--stone-3)}
.board-icon{image-rendering:pixelated;max-height:46px;width:auto}
.board-icon.svg{display:block;width:34px;height:34px}
.board-icon.svg svg{width:100%;height:100%;display:block}
.br-main{display:grid;gap:4px;min-width:0}
.br-main h3{font-size:21px}
.br-main h3 a{color:var(--text);text-decoration:none}
.br-main h3 a:hover{color:var(--honey)}
.br-main p{font-size:14px;color:var(--muted)}
.br-stats{display:grid;gap:4px;font-size:13px;color:var(--muted)}
.br-stats b{font:400 18px/1 var(--pixel);color:var(--text);margin-right:4px}
.br-last{display:grid;gap:2px;font-size:13px;color:var(--muted);min-width:0}
.br-last a{color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;font-size:14px}
.br-last a:hover{color:var(--honey)}

/* ---------- thread lists ---------- */
.thread-list{list-style:none;margin:0;padding:0;border-top:2px solid var(--stone-3)}
.thread-row{display:grid;grid-template-columns:minmax(0,1fr) 150px 170px;gap:6px 16px;align-items:center;padding:14px 8px;border-bottom:1px solid var(--stone-3)}
.thread-row:hover{background:rgba(242,193,78,.04)}
.thread-row.is-pinned{background:rgba(244,154,193,.05)}
.thread-row.is-deleted{opacity:.55}
.tr-main{min-width:0}
.tr-title{font-size:17px;font-weight:500;line-height:1.45}
.tr-title a{color:var(--text);text-decoration:none}
.tr-title a:hover{color:var(--honey)}
.tr-meta{font-size:13px;color:var(--muted);margin-top:4px;display:flex;flex-wrap:wrap;gap:4px 6px;align-items:center}
.tr-meta .who{font-weight:400}
.tr-stats{display:flex;gap:14px;font-size:13px;color:var(--muted)}
.tr-stats b{color:var(--text);font:400 16px/1 var(--pixel);margin-right:3px}
.tr-last{font-size:13px;color:var(--muted);text-align:right}
.tr-last a{color:var(--muted)}

/* ---------- a thread ---------- */
.thread-head{margin-bottom:12px}
.thread-head h1{font-size:30px}
.thread-meta{display:flex;flex-wrap:wrap;gap:4px 6px;align-items:center;margin-top:10px}
.mod-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:16px 0;padding:10px 12px;background:var(--stone-2);border-left:4px solid var(--ember)}
.mod-bar .label{font:14px/1 var(--pixel);color:var(--ember);margin-right:6px}
.mod-bar.own{border-left-color:var(--stone-3)}
.posts{list-style:none;margin:16px 0;padding:0;display:grid;gap:14px}
.post{display:grid;grid-template-columns:160px minmax(0,1fr);border:22px solid transparent;border-image:url(/img/ui/panel_dark.png) 24 fill / 22px stretch;scroll-margin-top:96px}
.post.is-target{outline:3px solid var(--honey);outline-offset:2px}
.post-author{display:grid;justify-items:center;align-content:start;gap:8px;text-align:center;padding:2px 12px 2px 0;border-right:2px solid var(--stone-3);font-size:13px;min-width:0}
.pa-text{display:grid;gap:4px;justify-items:center;min-width:0;max-width:100%}
.pa-name{display:flex;flex-wrap:wrap;gap:4px;justify-content:center;align-items:center;font-size:15px}
.pa-meta{color:var(--muted);display:grid;gap:2px;justify-items:center}
/* One column that may shrink below its content: without it the auto column grows to a code block's longest line
   and every paragraph of the post with it (body{overflow-x:hidden} then cuts them off). */
.post-main{padding:0 2px 0 18px;min-width:0;display:grid;grid-template-columns:minmax(0,1fr);gap:10px;align-content:start}
.post-head{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center;font-size:13px;color:var(--muted);border-bottom:1px dashed var(--stone-3);padding-bottom:8px}
.floor{font:15px/1 var(--pixel);color:var(--honey);text-decoration:none}
.floor:hover{color:var(--cream)}
.edited{font-style:italic}
.post-body{min-height:2em}
.post-actions{display:flex;flex-wrap:wrap;gap:4px 18px;font-size:14px}
.post-actions .linkish{min-height:36px;text-decoration:none}
.post-actions .linkish:hover{text-decoration:underline}
.linkish.danger{color:var(--danger)}
.post.is-deleted .post-body,.post.is-deleted .post-author{opacity:.5}
.post.is-gone{display:block;border:2px dashed var(--stone-3);padding:12px 16px}
.post-gone{color:var(--muted);font-size:14px;display:flex;gap:12px;align-items:center}
.reply-box{margin-top:28px}
.reply-box h2{font-size:22px;margin-bottom:12px}
.reply-block{margin-top:24px}
.edit-form{margin-top:2px}

/* ---------- pixel portraits ---------- */
.avatar{display:inline-grid;place-items:center;width:40px;height:40px;font:20px/1 var(--pixel);color:#fff6e2;text-shadow:0 2px 0 rgba(0,0,0,.45);
  box-shadow:inset -4px -4px 0 rgba(0,0,0,.28),inset 4px 4px 0 rgba(255,255,255,.14);flex:none;user-select:none}
.avatar-lg{width:64px;height:64px;font-size:30px}
.avatar-xl{width:96px;height:96px;font-size:46px}
.av-0{background:#a2683a}.av-1{background:#4f8f48}.av-2{background:#3f7d9c}.av-3{background:#7d4b9c}
.av-4{background:#b8513a}.av-5{background:#a07c22}.av-6{background:#4a6b8a}.av-7{background:#9c4b6e}

/* ---------- composer ---------- */
.composer-bar{display:flex;flex-wrap:wrap;gap:2px;align-items:center;background:var(--stone-2);border:2px solid #4a3426;border-bottom:0;padding:4px}
.composer-bar button{min-width:40px;min-height:36px;background:none;border:2px solid transparent;color:var(--muted);font:15px/1 var(--mono);cursor:pointer;padding:0 8px}
.composer-bar button:hover{color:var(--honey);border-color:var(--stone-3)}
.composer-tabs{margin-left:auto;display:flex;gap:2px}
.composer-tabs button{font:14px/1 var(--pixel)}
.composer-tabs button[aria-pressed="true"]{color:var(--honey);border-color:var(--honey)}
.composer textarea{min-height:170px}
.composer-preview{background:var(--well);border:2px solid #4a3426;padding:12px 14px;overflow:auto}
.composer-foot{display:flex;flex-wrap:wrap;justify-content:space-between;gap:4px 12px;font-size:13px;color:var(--muted)}
.composer-foot .count{font-variant-numeric:tabular-nums;margin-left:auto}
.composer-foot .count.over{color:var(--danger)}
.new-form{max-width:900px}
.captcha{min-height:65px}

/* ---------- login / register / me / profile ---------- */
.auth-box{max-width:520px;margin:0 auto}
.auth-box h1{font-size:30px}
.auth-box .form{max-width:none}
.profile-card{display:flex;gap:24px;align-items:flex-start}
.profile-card h1{font-size:30px;display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.bio{white-space:pre-line}
.me-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,340px),1fr));gap:20px;align-items:start}
.me-grid h2{font-size:22px}
.facts{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 16px;margin:0;font-size:15px}
.facts dt{color:var(--muted)}
.facts dd{margin:0;overflow-wrap:anywhere}
.forum-dialog h2{font-size:22px}
.forum-dialog .field textarea{min-height:96px}
.soon img,.empty img{image-rendering:pixelated}
.results-count{margin-bottom:8px}

@media (max-width:900px){
  .board-row{grid-template-columns:52px minmax(0,1fr)}
  .br-icon{width:52px;height:52px}
  .br-stats,.br-last{grid-column:2}
  .br-stats{display:flex;gap:14px}
  .thread-row{grid-template-columns:minmax(0,1fr) auto}
  .tr-main{grid-column:1 / -1}
  .tr-last{text-align:right}
}
@media (max-width:700px){
  .forum-hero h1{font-size:30px}
  .forum-head h1,.thread-head h1{font-size:25px}
  .post{grid-template-columns:minmax(0,1fr);border-width:14px;border-image-width:14px}
  .post-author{grid-template-columns:auto minmax(0,1fr);justify-items:start;text-align:left;align-items:center;border-right:0;border-bottom:2px solid var(--stone-3);padding:0 0 10px;gap:10px}
  .post .avatar-lg{width:42px;height:42px;font-size:21px}
  .pa-text{justify-items:start}
  .pa-name{justify-content:flex-start}
  .pa-meta{display:flex;flex-wrap:wrap;gap:2px 10px;justify-items:start}
  .pa-joined{display:none}
  .post-main{padding:10px 0 0}
  .board-row{border-width:14px;border-image-width:14px}
  .thread-row{grid-template-columns:minmax(0,1fr);gap:4px}
  .tr-last{text-align:left}
  .search-form{max-width:none}
  .profile-card{flex-direction:column;gap:14px}
  .avatar-xl{width:72px;height:72px;font-size:34px}
}

/* Links styled as small slot buttons (common.css draws .btn-sm for <button>). */
a.btn-sm{border-style:solid;text-decoration:none;display:inline-flex;align-items:center;justify-content:center}
