/* R22: editorial hierarchy, compact topic rows, and continuous reading. */
.forum-index { display:grid; grid-template-columns:minmax(0,1fr); column-gap:2rem; align-items:start; }
.forum-index.has-filters { grid-template-columns:12rem minmax(0,1fr); }
.forum-toolbar { grid-column:2; grid-row:1; position:relative; top:var(--site-header-height); z-index:30; display:flex; align-items:center; gap:.75rem; padding:.65rem 0; background:var(--surface); border-bottom:1px solid var(--line); }
.forum-index:not(.has-filters) .forum-toolbar { grid-column:1; }
.sticky-measured .forum-toolbar,.sticky-measured .forum-filter { position:sticky; }
html:not(.sticky-measured) .forum-toolbar,html:not(.sticky-measured) .forum-filter { top:auto; }
.forum-search { display:flex; align-items:center; gap:.5rem; flex:1; min-width:0; }
.forum-search-field { position:relative; flex:1; min-width:0; max-width:30rem; }
.forum-search input { min-width:0; min-height:36px; padding:.4rem .65rem; font-size:.875rem; background:var(--surface-soft); }
.forum-toolbar .button { flex-shrink:0; min-height:36px; padding:.35rem .75rem; font-size:.875rem; white-space:nowrap; }
.search-history { position:absolute; z-index:35; top:calc(100% + .3rem); inset-inline:0; max-height:min(24rem,60vh); overflow:auto; padding:.5rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.search-history header { display:flex; align-items:center; justify-content:space-between; gap:.5rem; padding-inline:.5rem; color:var(--muted); font-size:.8125rem; }
.search-history ul { list-style:none; padding:0; margin:0; }
.search-history-query { display:block; width:100%; min-height:36px; padding:.4rem .5rem; border:0; border-radius:3px; background:transparent; color:var(--ink); text-align:start; overflow-wrap:anywhere; cursor:pointer; }
.search-history-query:hover,.search-history-query:focus-visible { background:var(--surface-soft); }
.search-history p { margin:0; padding:.5rem; color:var(--muted); font-size:.8125rem; }
.forum-filter { grid-column:1; grid-row:1 / span 2; position:relative; top:var(--site-header-height); min-width:0; padding:.75rem 1rem .75rem 0; border-right:1px solid var(--line); background:var(--surface); }
.forum-index-nav { display:flex; flex-direction:column; align-items:stretch; gap:.125rem; margin-bottom:.75rem; padding-bottom:.75rem; border-bottom:1px solid var(--line); }
.forum-index-nav .action-icon { width:18px; height:18px; flex:none; }
.forum-index-nav a,.topic-filter-options a { display:flex; align-items:center; gap:.5rem; min-height:36px; padding:.3rem .6rem; border-radius:var(--radius); color:var(--muted); text-decoration:none; font-size:.875rem; }
.forum-index-nav a:hover,.topic-filter-options a:hover { background:var(--surface-soft); color:var(--ink); }
.forum-index-nav a[aria-current],.topic-filter-options a[aria-current] { background:var(--brand-soft); color:var(--brand-strong); font-weight:600; }
.forum-index-nav a[aria-current] .action-icon { color:var(--school-red,var(--brand)); }
.topic-filter summary { min-height:36px; align-content:center; padding:.25rem .6rem; cursor:pointer; font-weight:600; font-size:.8125rem; color:var(--muted); }
.topic-filter-current { display:none; }
.topic-filter-options { display:flex; flex-direction:column; flex-wrap:nowrap; align-items:stretch; gap:0; max-height:calc(var(--visible-height) - var(--site-header-height) - 20rem); padding:.25rem 0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.topic-filter-options a { flex-shrink:0; }
.topic-group { flex-shrink:0; color:var(--ink); font-size:.75rem; font-weight:600; padding:.75rem .6rem .25rem; }
.forum-index-main { grid-column:2; min-width:0; }
.forum-index:not(.has-filters) .forum-index-main { grid-column:1; }
.post-index-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:.35rem .75rem; min-height:66px; padding:1rem 0 .75rem; color:var(--muted); font-size:.8125rem; }
.post-index-head h1 { display:flex; align-items:center; gap:.6rem; margin:0 auto 0 0; font-family:var(--font-editorial,inherit); font-size:1.5rem; font-weight:700; line-height:1.3; color:var(--ink); }
.post-index-head h1::before { content:""; width:.4rem; height:.4rem; flex:none; background:var(--school-red,var(--brand)); }
.post-index-head p { margin:0; }
.post-index-total { font-variant-numeric:tabular-nums; }
.post-index-head a { min-height:32px; display:inline-flex; align-items:center; }
.post-table-head,.post-row { display:grid; grid-template-columns:minmax(0,1fr) 7rem 3.5rem 6rem 2rem; gap:.75rem; align-items:center; }
.post-table-head { min-height:34px; padding:.35rem .75rem; color:var(--muted); font-size:.75rem; border-top:1px solid var(--ink); border-bottom:1px solid var(--line); }
.post-table-head > :nth-child(n+3) { text-align:right; }
.post-list,.comment-list { list-style:none; padding:0; margin:0; }
.post-list { background:var(--surface); }
.post-list > li { border-bottom:1px solid var(--line); padding:.75rem; }
.post-list > li:hover,.post-list > li:focus-within { background:var(--surface-soft); }
.post-list > .post-row-linked { cursor:pointer; }
.post-summary { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(1.5rem,auto); row-gap:.25rem; min-width:0; container:post-summary / inline-size; }
.post-summary .topic-labels { flex-wrap:nowrap; margin-top:0; }
.post-summary .search-hits { grid-row:3; }
.post-summary .topic-labels > li { min-width:0; }
.post-summary .topic-labels a { display:block; line-height:1.5rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.post-summary .topic-swatch { display:inline-block; margin-inline-end:.3rem; }
.post-summary .topic-labels > :nth-child(n+4) { display:none; }
@container post-summary (max-width:15rem) {
 .topic-labels > :nth-child(n+3) { display:none; }
}
@container post-summary (max-width:10rem) {
 .topic-labels > :nth-child(n+2) { display:none; }
}
.post-list h2 { font-size:1rem; font-weight:600; margin:0; line-height:1.55; text-wrap:wrap; overflow-wrap:anywhere; }
.post-list h2 a { color:var(--ink); text-decoration:none; }
.post-list h2 a:hover { color:var(--brand-strong); }
.post-list a { scroll-margin-top:calc(var(--site-header-height) + var(--forum-toolbar-height) + 1rem); }
.post-participants { display:flex; align-items:center; gap:.25rem; }
.post-participants .member-avatar { flex-shrink:0; }
.reply-count { color:var(--muted); text-align:right; font-size:.875rem; font-variant-numeric:tabular-nums; }
.reply-count strong { color:var(--brand-strong); font-weight:600; }
.post-activity { color:var(--muted); font-size:.8125rem; text-align:right; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.latest-reply { display:inline-flex; align-items:center; min-height:32px; color:var(--muted); text-decoration:none; }
.latest-reply:hover { color:var(--brand-strong); }
.post-row-menu { position:relative; justify-self:end; }
.post-row-menu > summary { display:flex; align-items:center; justify-content:center; width:32px; min-height:32px; padding:.25rem; color:var(--muted); list-style:none; cursor:pointer; border-radius:var(--radius); }
.post-row-menu > summary::-webkit-details-marker { display:none; }
.post-row-menu > summary:hover,.post-row-menu[open] > summary { background:var(--line); color:var(--ink); }
.post-row-actions { position:absolute; z-index:25; right:0; top:100%; min-width:12rem; max-width:calc(100vw - 3rem); display:flex; flex-wrap:wrap; gap:.5rem; padding:.75rem; background:var(--surface); border:1px solid var(--line); border-radius:var(--radius); }
.post-row-actions .dashboard-direct-action { margin:0; width:100%; }
.search-hits { margin:.4rem 0 0; padding:0; list-style:none; color:var(--muted); font-size:.8125rem; }
.search-hits li { margin-block:.2rem; overflow-wrap:anywhere; }
.search-hits a { min-height:32px; display:inline-flex; align-items:center; }
.forum-pagination { justify-content:center; gap:1.5rem; padding-block:1rem; font-size:.8125rem; font-variant-numeric:tabular-nums; }
.forum-reading { width:min(100%,58rem); margin-inline:auto; }
.thread-title { padding:.65rem 0 1.1rem; border-bottom:1px solid var(--ink); }
.thread-title h1 { margin:0 0 .65rem; color:var(--ink); font-family:var(--font-editorial,inherit); font-size:1.875rem; font-weight:700; line-height:1.45; text-wrap:pretty; overflow-wrap:anywhere; }
.thread-title h1:last-child { margin-bottom:0; }
.forum-meta { display:flex; align-items:center; flex-wrap:wrap; gap:.2rem .75rem; color:var(--muted); font-size:.8125rem; }
.forum-meta > * { min-width:0; overflow-wrap:anywhere; }
.forum-post { padding:1.1rem 0; background:var(--surface); scroll-margin-top:calc(var(--site-header-height) + 1rem); }
.floor-header { display:flex; align-items:center; gap:.35rem .75rem; min-height:36px; }
.floor-header .forum-meta { flex:1; margin:0; }
.floor-header .floor-number { order:3; }
.floor-number { display:inline-flex; align-items:center; min-height:32px; flex-shrink:0; color:var(--muted); font-size:.8125rem; text-decoration:none; font-variant-numeric:tabular-nums; white-space:nowrap; }
.floor-number:hover { color:var(--brand-strong); }
.forum-post .floor-number,.comment-list > li:target .floor-number { color:var(--school-red,var(--brand)); font-weight:600; }
.floor-author { color:var(--ink); font-weight:600; }
.floor-content { min-width:0; margin-left:2.75rem; }
.post-body { margin-top:.85rem; max-width:75ch; }
.post-actions,.comment-actions { justify-content:flex-end; gap:.25rem .5rem; margin:.75rem 0 0 2.75rem; padding-top:.35rem; font-size:.8125rem; }
.post-actions .engagement-controls,.comment-actions .engagement-controls { margin:0 auto 0 0; }
.post-actions a,.comment-actions a { min-height:32px; }
.post-actions .action-button,.comment-actions .action-button { padding:.2rem .5rem; }
.post-actions .reply-link,.comment-actions .reply-link { display:inline-flex; align-items:center; justify-content:center; min-width:36px; min-height:32px; padding:.25rem .5rem; text-decoration:none; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); color:var(--muted); }
.reply-link:hover { background:var(--surface-soft); color:var(--ink); }
.forum-replies { margin-top:0; padding:0; background:var(--surface); border-top:1px solid var(--line); }
.comments-heading { display:flex; align-items:baseline; flex-wrap:wrap; gap:.5rem; padding:.85rem 0; border-bottom:1px solid var(--line); }
.comments-heading h2 { color:var(--ink); font-size:.9375rem; font-weight:600; margin:0; }
.comment-list > li { padding:1rem 0; border-bottom:1px solid var(--line); scroll-margin-top:calc(var(--site-header-height) + 1rem); }
.comment-list .plain-text { max-width:75ch; margin-top:.5rem; }
.reply-reference { margin:.4rem 0 0; color:var(--muted); font-size:.75rem; }
.reply-reference a.action-button { min-height:28px; padding:.1rem .45rem; font-size:.75rem; }
.forum-post:target,.comment-list > li:target { outline:2px solid var(--focus); outline-offset:3px; }
.legacy-comment-anchor { display:block; scroll-margin-top:calc(var(--site-header-height) + 1rem); }
.topic-choices { display:grid; grid-template-columns:repeat(auto-fit,minmax(9rem,1fr)); gap:.375rem; }
.topic-choices label { display:flex; align-items:center; gap:.5rem; min-height:36px; margin:0; padding:.4rem .5rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); font-size:.875rem; font-weight:400; cursor:pointer; }
.topic-choices label:has(input:checked) { border-color:var(--brand); background:var(--brand-soft); }
.topic-choices input { flex-shrink:0; margin:0; }
.comment-compose { margin-top:1rem; padding:.65rem .85rem; background:var(--surface); border:1px solid var(--line); border-top-color:var(--ink); border-radius:var(--radius); scroll-margin-top:1rem; }
.compose-heading { display:flex; align-items:center; justify-content:space-between; gap:.4rem .75rem; margin-bottom:.5rem; }
.compose-heading-actions { display:flex; align-items:center; flex-shrink:0; gap:.35rem; }
.reply-status { margin:0; font-size:.8125rem; color:var(--muted); overflow-wrap:anywhere; }
.reply-cancel.action-button { font-size:.75rem; padding:.15rem .5rem; }
.compose-close.action-button { width:36px; padding:.35rem; }
.comment-compose .form-field { margin:.6rem 0 0; min-width:0; }
.comment-compose .compose-body-field { margin:0; }
.comment-compose textarea { display:block; min-height:44px; height:44px; max-height:12rem; max-height:min(12rem,35dvh); line-height:1.5; resize:vertical; overflow-y:auto; }
.comment-compose textarea[data-autosize] { resize:none; }
.compose-tools { position:relative; padding-top:44px; margin-top:.5rem; }
.compose-tools > .compose-send { position:absolute; top:0; right:0; min-height:36px; padding:.35rem 1rem; font-size:.875rem; }
.compose-attachment > summary { position:absolute; top:0; left:0; display:inline-flex; align-items:center; justify-content:center; min-width:36px; min-height:36px; padding:.35rem .5rem; list-style:none; cursor:pointer; }
.compose-attachment > summary::-webkit-details-marker { display:none; }
.compose-video > summary { left:3.25rem; }
.compose-attachment[open] > summary { background:var(--brand-soft); color:var(--brand-strong); border-color:var(--brand); }
.compose-attachment .form-field { padding:.5rem .6rem; margin:.25rem 0 0; background:var(--surface-soft); border:1px solid var(--line); border-radius:var(--radius); }
.compose-attachment label { font-size:.8125rem; }
.compose-attachment input[type=file] { max-width:100%; font-size:.8125rem; }
.compose-file-count { position:absolute; top:-.3rem; right:-.3rem; min-width:1rem; padding-inline:.15rem; border-radius:var(--radius); background:var(--brand-soft); color:var(--brand-strong); font-size:.6875rem; font-variant-numeric:tabular-nums; }
.comment-compose .image-upload-status:not(.is-error),.comment-compose .video-upload-status:not(.is-error) { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
.compose-enhanced { position:fixed; z-index:45; width:min(calc(100% - 2rem),58rem); left:50%; transform:translateX(-50%); bottom:var(--compose-bottom,0px); max-height:calc(var(--compose-viewport-height,100dvh) - 1rem); overflow-y:auto; overscroll-behavior:contain; margin:0; padding-bottom:calc(.65rem + env(safe-area-inset-bottom,0px)); border-bottom:0; border-radius:var(--radius) var(--radius) 0 0; }
.compose-enhanced .compose-heading { position:sticky; top:-.65rem; z-index:1; padding-block:.35rem; background:var(--surface); }
.reply-composer-open .forum-reading { padding-bottom:calc(var(--reply-composer-height,12rem) + 1rem); }
.compose-resume { margin-top:.75rem; }
@media (pointer:coarse) {
 .compose-attachment > summary,.compose-tools > .compose-send,.compose-close.action-button,.reply-cancel.action-button { min-width:44px; min-height:44px; }
 .reply-reference a.action-button { min-height:44px; }
 .compose-tools { padding-top:48px; }
}
@media (pointer:coarse) and (min-width:48rem) {
 .post-table-head,.post-row { grid-template-columns:minmax(0,1fr) 8.5rem 3.5rem 6rem 2.75rem; }
}
.remove-preview { border-block:1px solid var(--line); padding-block:1rem; }
.forum-editor > form { padding:1.25rem 0; background:var(--surface); }
.forum-editor > form .form-field:first-child { margin-top:0; }
.moderation-page h1 { font-size:1.25rem; margin-bottom:.6rem; }
.moderation-page > p { font-size:.8125rem; color:var(--muted); margin-bottom:.75rem; }
.moderation-page > form { padding:1rem; }
.moderation-page .form-field { margin-block:.75rem; }
.moderation-page textarea { min-height:6rem; height:6rem; }
.moderation-page > details { padding:.5rem .75rem; margin-bottom:.75rem; border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); }
.moderation-page > details > summary { min-height:36px; align-content:center; cursor:pointer; font-size:.8125rem; font-weight:600; }
.moderation-page .forum-body { max-height:12rem; overflow:auto; padding-block:.5rem; font-size:.875rem; }
/* Administrator shortcuts keep the member theme. */
.dashboard-direct-form { margin:.25rem 0 0; }
.dashboard-direct-form .button { min-height:36px; padding:.2rem .65rem; font-size:.75rem; background:var(--surface); color:var(--brand); border-color:var(--line); }
.dashboard-direct-form .button:hover { background:var(--brand-soft); border-color:var(--brand); } .dashboard-direct-form .dashboard-danger { color:var(--danger); }
.dashboard-feedback { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1rem; padding:1rem; margin-bottom:1rem; border:1px solid var(--line); background:var(--surface); border-radius:var(--radius); }
.dashboard-feedback p { margin-bottom:.25rem; } .dashboard-feedback .dashboard-state { color:var(--brand); font-size:.875rem; } .dashboard-feedback .dashboard-state-muted { color:var(--muted); }

@media (max-width:63.999rem) {
 .forum-index.has-filters { grid-template-columns:minmax(0,1fr); }
 .forum-toolbar { grid-column:1; grid-row:auto; }
 .forum-filter { grid-column:1; grid-row:auto; z-index:20; top:calc(var(--site-header-height) + var(--forum-toolbar-height)); padding:0; border:0; border-bottom:1px solid var(--line); }
 .forum-index-nav { display:none; }
 .forum-index-main { grid-column:1; }
 .topic-filter summary { padding-inline:.5rem; min-height:44px; }
 .topic-filter-current { display:inline; margin-left:.75rem; font-weight:400; }
 .topic-filter-options { position:absolute; top:100%; inset-inline:0; max-height:calc(var(--visible-height) - var(--site-header-height) - var(--forum-toolbar-height) - 4rem); padding:.5rem; border:1px solid var(--line); background:var(--surface); display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:.25rem; }
 .topic-group { grid-column:1/-1; padding-top:.35rem; }
}
@media (max-width:47.999rem) {
 .post-table-head { grid-template-columns:minmax(0,1fr) 3rem 5rem 2rem; }
 .post-table-head > :nth-child(2) { display:none; }
 .post-row { grid-template-columns:minmax(0,1fr) 3rem 5rem 2rem; gap:.5rem; }
 .post-participants { display:none; }
 .post-list h2 { font-size:1rem; }
 .post-index-head p { font-size:.75rem; }
}
@media (max-width:34rem) {
 .forum-toolbar { gap:.5rem; }
 .forum-toolbar .button { padding-inline:.6rem; }
 .forum-search { gap:.35rem; }
 .forum-search input { width:100%; font-size:16px; }
 .forum-search > .button { padding-inline:.45rem; }
 .post-table-head { display:none; }
 .post-list { border-top:1px solid var(--ink); }
 .post-list > li { padding:.75rem .25rem; }
 .post-row { grid-template-columns:minmax(0,1fr) auto 3.75rem; gap:.25rem .75rem; }
 .post-summary { grid-column:1 / 3; grid-row:1; }
 .post-row-menu { grid-column:3; grid-row:1; align-self:start; }
 .post-participants { display:flex; grid-column:1; grid-row:2; }
 .post-participants .member-avatar { width:28px; min-width:28px; height:44px; }
 .post-participants .member-avatar img { width:24px; height:24px; }
 .reply-count { grid-column:2; grid-row:2; }
 .reply-count .visually-hidden { position:static; width:auto; height:auto; clip-path:none; overflow:visible; margin:0; white-space:normal; }
 .post-activity { grid-column:3; grid-row:2; max-width:6rem; font-size:.75rem; }
 .post-index-head { padding-inline:0; }
 .post-index-head h1 { font-size:1.375rem; }
 .post-index-head p { flex-basis:100%; }
 .thread-title h1 { font-size:1.5rem; }
 .forum-post,.comment-list > li { padding-block:1rem; }
 .floor-content { margin-left:0; }
 .post-actions,.comment-actions { margin-left:0; }
 .floor-header { gap:.25rem .5rem; }
 .floor-header .forum-meta { gap:0 .5rem; }
 .floor-header time { font-size:.75rem; }
 .comment-compose { padding:.6rem .75rem; }
 .comment-compose.compose-enhanced { width:100%; border-inline:0; padding-bottom:calc(.6rem + env(safe-area-inset-bottom,0px)); }
 .comment-compose textarea { font-size:16px; }
 .compose-enhanced .compose-heading { top:-.6rem; }
 .forum-pagination { gap:1rem; }
 .topic-filter-options { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (pointer:coarse) {
 .forum-toolbar .button,.forum-search input,.topic-filter-options a,.search-history-query,.forum-index-nav a,.post-row-menu > summary,.latest-reply,.post-actions a,.comment-actions a,.dashboard-direct-form .button,.topic-choices label { min-height:44px; }
 .post-row-menu > summary { width:44px; }
 .post-participants { gap:.125rem; }
 .post-participants .member-avatar { min-width:44px; min-height:44px; }
}
