/* Forum on phones (Gary approved the mock-ups, Nov 13). The header is the chat header's size, with the same small menu button. */
.compact-head, .forum-share-bar, .forum-more-hint { display:none; }
@media (max-width:991.98px) {
    body.compact-head-page { --compact-head:56px; }
    body.compact-head-page .site-header { min-height:0; height:calc(var(--compact-head) + env(safe-area-inset-top,0px)); padding-top:env(safe-area-inset-top,0px); background:rgba(7,7,7,.92); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); border-bottom:1px solid #1d1d1d; overflow:hidden; transition:transform .2s ease; }
    body.compact-head-page .site-header .navbar { height:var(--compact-head); padding-block:0; position:relative; z-index:4; }
    body.compact-head-page .site-header .navbar-brand, body.compact-head-page .site-header > .live-sign { display:none; }
    body.compact-head-page .site-header .navbar-toggler { margin-left:auto; width:42px; height:36px; padding:0; display:grid; place-items:center; background:rgba(0,0,0,.45); }
    body.compact-head-page .site-header .navbar-toggler-icon { width:22px; height:22px; }
    body.compact-head-page .site-header:has(.navbar-collapse.show) { overflow:visible; }
    body.compact-head-page main.page-main { padding-top:6px; }
    .compact-head { position:absolute; left:0; right:64px; top:env(safe-area-inset-top,0px); height:var(--compact-head); display:flex; align-items:center; gap:8px; padding-left:max(6px,env(safe-area-inset-left,0px)); z-index:5; } /* above the nav bar, or the back arrow can't be tapped (Gary, Nov 16) */
    .compact-back { position:relative; display:grid; place-items:center; width:34px; height:40px; color:#f2f2f2 !important; flex:none; }
    .compact-logo { font-family:Grotters,Anton,Impact,sans-serif; font-size:25px; line-height:1; color:#ff4433 !important; text-shadow:var(--neon-glow); text-decoration:none; margin:0 2px; flex:none; }
    .compact-head .forum-search { flex:1; min-width:0; margin:0; }
    .compact-head .forum-search input { height:36px; border-radius:18px; }
    .compact-banner { position:absolute; inset:0 -64px 0 0; width:calc(100% + 64px); height:100%; object-fit:cover; filter:brightness(.38) saturate(1.1); }
    .compact-icon { position:relative; width:32px; height:32px; border-radius:50%; object-fit:cover; flex:none; border:2px solid #ff3b2b; box-shadow:0 0 8px rgba(255,42,31,.55); }
    .compact-name { position:relative; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#fff; font:700 16px Arial,Helvetica,sans-serif; }
    .compact-head-board .compact-name { font:400 23px Anton,Impact,sans-serif; letter-spacing:.02em; text-transform:uppercase; color:#ff4433; text-shadow:0 0 4px rgba(255,42,31,.8),0 0 14px rgba(255,42,31,.45); }
    body.forum-mode-board .site-header { border-bottom-color:rgba(255,42,31,.5); }
    /* The tabs row, the page's own banner/crumb and the old in-page back links aren't needed under these headers. */
    body.forum-phone .cm-tabs, body.forum-phone .forum-home-back, body.forum-mode-board #forum-hero, body.forum-mode-post .forum-crumb { display:none !important; }
    body.forum-mode-post .forum-rail, body.forum-mode-board .forum-rail { display:none !important; }
    /* Boards row: a › hint that more boards wait to the right; it sticks to the top when the header steps aside. */
    body.forum-mode-home .forum-rail { position:relative; }
    body.forum-mode-home .forum-more-hint { display:grid; place-items:center; position:absolute; right:4px; top:34px; width:26px; height:26px; border-radius:50%; background:#222; border:1px solid #444; color:#fff; font:700 16px Arial,Helvetica,sans-serif; pointer-events:none; box-shadow:-14px 0 16px 6px #0a0a0a; }
    body.forum-stuck .site-header { transform:translateY(-100%); }
    body.forum-stuck .forum-rail nav { position:fixed; top:0; left:0; right:0; z-index:1030; margin:0; padding:calc(env(safe-area-inset-top,0px) + 8px) 10px 6px; background:rgba(8,8,8,.94); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); border-bottom:1px solid #2a2a2a; }
    body.forum-stuck .forum-more-hint { position:fixed; top:calc(env(safe-area-inset-top,0px) + 30px); z-index:1031; }
    /* Post page: the comment box lives at the bottom. A bar invites people in; tapping it (or Reply) opens the box as a sheet. */
    body.forum-mode-post main.page-main { padding-bottom:96px; }
    body.forum-mode-post #sg-messenger { display:none !important; }
    .forum-share-bar:not([hidden]) { display:flex; position:fixed; left:10px; right:10px; bottom:calc(10px + env(safe-area-inset-bottom,0px)); z-index:1500; align-items:center; gap:10px; padding:12px 16px; border-radius:24px; border:1px solid #333; background:#1c1c1f; color:#aaa; font:15px Arial,Helvetica,sans-serif; text-align:left; box-shadow:0 6px 24px rgba(0,0,0,.6); }
    .forum-share-bar span { color:#fff; font-size:20px; }
    body.forum-mode-post:has(.shared-comment-composer.is-open) .forum-share-bar { display:none; }
    body.forum-mode-post .shared-discussion .shared-comment-composer:not(.is-open) { display:none !important; }
    body.forum-mode-post .shared-discussion .shared-comment-composer.is-open { position:fixed; left:0; right:0; bottom:0; z-index:1600; display:block !important; margin:0 !important; padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px)); background:#161618; border-top:1px solid #333; border-radius:16px 16px 0 0; box-shadow:0 -10px 30px rgba(0,0,0,.6); }
    body.forum-mode-post .shared-comment-composer.is-open .comment-composer-avatar { display:none; }
    /* Gary, Nov 16: "Commenting on …" sat on top of "Add a comment…"; the sheet just says Add a comment, like Instagram. */
    body.forum-mode-post .shared-comment-composer.is-open textarea { font-size:16px; }
}
/* Checked live (Nov 13): the compact board header hid Create post and Follow along with the big banner. Keep those two buttons. */
@media (max-width:991.98px) {
    body.forum-mode-board #forum-hero { display:block !important; margin:0 0 6px; padding:10px 12px; border:0; background:none; box-shadow:none; }
    body.forum-mode-board #forum-hero .forum-banner, body.forum-mode-board #forum-hero .forum-board-face, body.forum-mode-board #forum-hero .forum-hero-name { display:none !important; }
    body.forum-mode-board #forum-hero .forum-hero-row { display:block; margin:0; padding:0; }
    body.forum-mode-board #forum-hero .forum-hero-actions { display:flex; gap:10px; margin:0; }
    body.forum-mode-board #forum-hero .forum-hero-actions > * { flex:1; justify-content:center; white-space:nowrap; }
}
/* Gary, Nov 13. Phones: the menu button is 15% smaller on the forum and chat pages. Board pages: the banner spans the whole
   header (behind the menu button too); no Hot / All boards and no Saved. Post pages: no board row or Saved; the header stays
   at the top, see-through, and fades into the page. */
@media (max-width:991.98px) {
    body.compact-head-page .site-header .navbar-toggler { width:36px; height:31px; }
    body.compact-head-page .site-header .navbar-toggler-icon { width:19px; height:19px; }
    body.compact-head-page .site-header > .compact-banner { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; filter:brightness(.38) saturate(1.1); z-index:0; pointer-events:none; }
    body.forum-mode-board .site-header .navbar-toggler { background:rgba(0,0,0,.35); }
    body.forum-mode-board #forum .forum-toolbar, body.forum-mode-board #forum .forum-rail > a { display:none !important; }
    body.forum-mode-post #forum .forum-rail { display:none !important; }
    body.forum-mode-post .site-header { position:sticky; top:0; background:linear-gradient(to bottom, rgba(7,7,7,.92), rgba(7,7,7,.55)); border-bottom:0; overflow:visible; }
    body.forum-mode-post .site-header::after { content:""; position:absolute; left:0; right:0; top:100%; height:22px; background:linear-gradient(to bottom, rgba(7,7,7,.55), rgba(7,7,7,0)); pointer-events:none; }
}
/* Gary, Nov 14 (approved mock-up). Phone post page: no board card, no "N Comments" or Sort, and the moderator tools live in the
   ··· menu. Comments sit right under the post, Reddit style: small round photo, name and time on one line, ⇧ score ⇩ and
   Reply, replies indented on a thread line with ⊕ to open more. */
.forum-more-items .forum-mod-only { display:none; }
@media (max-width:991.98px) {
    body.forum-mode-post .forum-more-items .forum-mod-only { display:block; }
    body.forum-mode-post .forum-more-items .forum-mod-label { margin:6px 10px 2px; font:700 11px/1.2 Arial,sans-serif; letter-spacing:.08em; text-transform:uppercase; color:#888; }
    body.forum-mode-post #forum-sidebar, body.forum-mode-post .comment-toolbar { display:none !important; }
    body.forum-mode-post .forum-mod-details:not([open]), body.forum-mode-post .comment-moderation:not([open]) { display:none !important; }
    body.forum-mode-post .shared-discussion { margin-top:4px !important; padding:0 !important; border:0 !important; background:none !important; box-shadow:none !important; }
    body.forum-mode-post .shared-discussion .content-comment { display:grid !important; grid-template-columns:28px minmax(0,1fr); gap:0 10px; padding:10px 0 0 !important; border:0 !important; background:none !important; position:relative; }
    body.forum-mode-post .shared-discussion .content-comment > .cm-avatar { width:28px !important; height:28px !important; min-width:28px; grid-row:1 / span 2; font-size:.7rem; }
    body.forum-mode-post .shared-discussion .content-comment > .cm-avatar img { width:28px; height:28px; border-radius:50%; }
    body.forum-mode-post .shared-discussion .comment-main { grid-column:2; min-width:0; }
    body.forum-mode-post .shared-discussion .comment-meta { display:flex; flex-wrap:nowrap; gap:6px; align-items:baseline; margin:0 0 2px !important; padding-right:22px; white-space:nowrap; font-size:.8rem !important; }
    body.forum-mode-post .shared-discussion .comment-meta .cm-name { min-width:0; overflow:hidden; text-overflow:ellipsis; font-weight:700; color:#eee; font-size:.82rem; }
    body.forum-mode-post .shared-discussion .comment-meta time { flex:none; color:#888; font-size:.78rem; }
    body.forum-mode-post .shared-discussion .comment-meta time::before { content:"• "; }
    body.forum-mode-post .shared-discussion .comment-body { margin:0 0 4px !important; font-size:.95rem; line-height:1.4; color:#e9e4da; }
    body.forum-mode-post .shared-discussion .comment-actions { display:flex !important; align-items:center; gap:14px; margin:0; min-height:30px; color:#9a948a; font-size:.82rem; }
    body.forum-mode-post .shared-discussion .comment-votes { display:inline-flex !important; align-items:center; gap:6px; border:0 !important; background:none !important; padding:0 !important; }
    body.forum-mode-post .shared-discussion .comment-vote { width:22px !important; height:22px !important; border:0 !important; background:none !important; padding:0 !important; color:#9a948a; display:grid; place-items:center; }
    body.forum-mode-post .shared-discussion .comment-vote[aria-pressed="true"] { color:#ff3b2b; }
    /* Gary, Nov 16: drawn arrows and a drawn reply arrow (the text arrows turned into blue emoji boxes on iPhones). */
    body.forum-mode-post .shared-discussion .comment-vote svg { display:block; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linejoin:round; }
    body.forum-mode-post .shared-discussion .comment-vote[aria-pressed="true"] svg { fill:currentColor; }
    body.forum-mode-post .shared-discussion .comment-reply { display:inline-flex !important; align-items:center; gap:5px; }
    body.forum-mode-post .shared-discussion .comment-score { min-width:8px; text-align:center; font-weight:700; color:#ccc; }
    body.forum-mode-post .shared-discussion .comment-reply { border:0 !important; background:none !important; padding:0 !important; color:#9a948a !important; font-weight:700; font-size:.82rem; }
    body.forum-mode-post .shared-discussion .comment-more-menu { position:static !important; }
    body.forum-mode-post .shared-discussion .comment-more-menu > summary { position:absolute; right:0; top:10px; color:#888; }
    body.forum-mode-post .shared-discussion .comment-thread { margin:0 !important; border:0 !important; }
    body.forum-mode-post .shared-discussion .comment-thread > summary, body.forum-mode-post .shared-discussion .comment-children > .btn:not([hidden]) { display:flex; align-items:center; gap:8px; margin:6px 0 2px; padding:0; border:0; background:none; box-shadow:none; color:#7fd4ff; font:700 .85rem/1.2 Arial,sans-serif; text-transform:none; list-style:none; cursor:pointer; min-height:0; }
    body.forum-mode-post .shared-discussion .comment-thread > summary::-webkit-details-marker { display:none; }
    body.forum-mode-post .shared-discussion .comment-thread > summary::before, body.forum-mode-post .shared-discussion .comment-children > .btn:not([hidden])::before { content:"+"; display:inline-grid; place-items:center; width:20px; height:20px; border:1.5px solid #7fd4ff; border-radius:50%; font-size:14px; line-height:1; transform:none; }
    body.forum-mode-post .shared-discussion .comment-thread[open] > summary { display:none; }
    body.forum-mode-post .shared-discussion .comment-children { position:relative; margin-left:-24px !important; padding-left:14px !important; border-left:2px solid #2b2b2b !important; }
}
/* A post opened from the homepage feed slides in from the right, like Instagram (Gary, Nov 16). */
@media (max-width:991.98px) and (prefers-reduced-motion:no-preference) {
    body.from-feed .forum-shell { animation:from-feed-in .28s cubic-bezier(.2,.8,.2,1); }
}
@keyframes from-feed-in { from { transform:translateX(36px); opacity:.2; } }
@media (max-width:991.98px) {
    body.forum-mode-post .shared-discussion .comment-vote.is-up[aria-pressed="true"] { color:#2fd35b; }
    body.forum-mode-post .shared-discussion .comment-vote.is-down[aria-pressed="true"] { color:#ff3b2b; }
}
/* Gary, Nov 16: the magnifying glass sits inside the search bar, then "Search the fringe…". */
@media (max-width:991.98px) {
    .compact-head .forum-search { display:flex; align-items:center; gap:8px; height:36px; padding:0 12px; border:1px solid #333; border-radius:18px; background:#151515; color:#9a9a9a; }
    .compact-head .forum-search:focus-within { border-color:#36c6d6; }
    .compact-head .forum-search svg { flex:none; width:16px; height:16px; }
    .compact-head .forum-search input { flex:1; min-width:0; height:34px; padding:0; border:0 !important; border-radius:0; background:transparent !important; box-shadow:none !important; color:#f2f2f2; font-size:16px; outline:none; }
    .compact-head .forum-search input::placeholder { color:#9a9a9a; }
}
/* Gary, Nov 16: the forum home header names the feed instead of SGTV; the search sits beside Saved, under the boards. */
@media (max-width:991.98px) {
    .compact-head-home .compact-name { font:400 23px Anton,Impact,sans-serif; letter-spacing:.02em; text-transform:uppercase; color:#ff4433; text-shadow:0 0 4px rgba(255,42,31,.8),0 0 14px rgba(255,42,31,.45); }
    #forum .forum-rail-tools { display:flex; align-items:center; gap:10px; padding:6px 14px 2px; }
    #forum .forum-rail-tools > a { flex:none; width:auto; min-height:36px; padding:0 14px; border:1px solid #3a3a3a; border-radius:18px; color:#eee; font-weight:700; box-shadow:none; background:transparent; }
    #forum .forum-rail-tools .forum-search { flex:1; min-width:0; display:flex; align-items:center; gap:8px; height:36px; margin:0; padding:0 12px; border:1px solid #333; border-radius:18px; background:#151515; color:#9a9a9a; order:0; }
    #forum .forum-rail-tools .forum-search[hidden] { display:none; }
    #forum .forum-rail-tools .forum-search:focus-within { border-color:#36c6d6; }
    #forum .forum-rail-tools .forum-search svg { flex:none; width:16px; height:16px; }
    #forum .forum-rail-tools .forum-search input { flex:1; min-width:0; height:34px; padding:0; border:0 !important; background:transparent !important; box-shadow:none !important; color:#f2f2f2; font-size:16px; outline:none; }
}
/* Accounts without search or Saved: no empty row. */
#forum .forum-rail-tools:not(:has(> :not([hidden]))) { display:none; }
/* Gary, Nov 16: the feed's title sits in the middle of the header. */
@media (max-width:991.98px) {
    .compact-head-home .compact-name { position:absolute; left:calc(50% + 29px); top:50%; transform:translate(-50%,-50%); max-width:calc(100% - 150px); text-align:center; }
}

/* Keyboard up (brand.js sets --kb): the post's comment box sits on top of the keyboard instead of behind it. */
@media (max-width:991.98px) {
    html.kb-open body.forum-mode-post .shared-discussion .shared-comment-composer.is-open { bottom:var(--kb,0px); padding-bottom:12px; }
}
