/* ════════════════════════════════════════════════════════════════════
   KIRK FORUMS — beta styles
   Loaded after /beta.css. The rules below the token map are the original
   forum layout; the --kir-* names now point at the beta design tokens so
   forum.js markup picks up the new look without changes.
   ════════════════════════════════════════════════════════════════════ */

:root {
    --kir-accent-hot: var(--brand);
    --kir-accent-soft: rgba(229, 56, 59, 0.12);
    --kir-bg-base: var(--page);
    --kir-ease-out: var(--ease-out);
    --kir-faint: var(--faint);
    --kir-muted: var(--muted);
    --kir-radius-md: var(--radius);
    --kir-surface: var(--surface);
    --kir-surface-2: var(--surface-2);
    --kir-text: var(--text);
}

/* Buttons forum.js renders (.kir-btn …) mapped onto the beta button style */
.kir-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 18px; border-radius: var(--pill); border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background var(--fast) ease, border-color var(--fast) ease, color var(--fast) ease; white-space: nowrap; }
.kir-btn:disabled { opacity: .45; cursor: not-allowed; }
.kir-btn--primary { background: var(--brand); color: #fff; }
.kir-btn--primary:hover:not(:disabled) { background: var(--brand-hover); }
.kir-btn--ghost { background: rgba(255,255,255,.06); border-color: var(--line-strong); color: #fff; }
.kir-btn--ghost:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.kir-btn--block { width: 100%; }
.kir-btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.kir-btn-danger { background: var(--danger-bg); border-color: rgba(255,138,128,.35); color: var(--danger); }
.kir-btn-danger:hover:not(:disabled) { background: rgba(255,138,128,.14); }

/* Form controls inside the forum use the beta control style */
.compose-box input, .compose-box select, .compose-box textarea,
.reply-inline-box textarea, .edit-post-textarea, .edit-thread-box input, .edit-thread-box textarea,
.forum-modal__shell select, .forum-modal__shell textarea, .forum-search-input {
    background: var(--surface-2) !important;
    border: 1px solid var(--line-strong) !important;
    border-radius: var(--radius-sm) !important;
    color: var(--text) !important;
    font: inherit;
}
.compose-box input:focus, .compose-box select:focus, .compose-box textarea:focus,
.reply-inline-box textarea:focus, .edit-post-textarea:focus, .forum-search-input:focus {
    outline: none;
    border-color: rgba(229,56,59,.7) !important;
    box-shadow: 0 0 0 3px rgba(229,56,59,.18);
}

.forum-shell {
    width: min(920px, 94vw);
    margin: 0 auto;
    padding: clamp(40px, 6vw, 64px) 0 clamp(56px, 8vw, 96px);
}

/* ── Page header / board switcher ─────────────────────────────────── */
.forum-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.forum-head h1 {
    font-family: var(--font);
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.forum-head p {
    color: var(--kir-muted);
    margin-top: 0.35rem;
    font-size: 0.94rem;
}

.forum-boardrow {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.forum-board-pill {
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--kir-muted);
    background: var(--kir-surface);
    border: 1px solid rgba(255, 255, 255, 0.07);
    cursor: pointer;
    transition: all 0.15s ease;
}

.forum-board-pill:hover {
    color: #fff;
    border-color: var(--kir-accent-soft);
}

.forum-board-pill.active {
    color: #fff;
    background: rgba(220, 20, 60, 0.14);
    border-color: rgba(220, 20, 60, 0.4);
}

.forum-sortrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.forum-sorts {
    display: flex;
    gap: 0.35rem;
}

.forum-sort-btn {
    background: none;
    border: none;
    color: var(--kir-faint);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    cursor: pointer;
}
.forum-sort-btn:hover { color: var(--kir-text); background: var(--kir-surface); }
.forum-sort-btn.active { color: var(--kir-accent-hot); background: rgba(220, 20, 60, 0.1); }

/* ── Thread list cards ────────────────────────────────────────────── */
.thread-card {
    display: flex;
    gap: 0.9rem;
    padding: 1.1rem 1.2rem;
    border-radius: var(--kir-radius-md);
    background: var(--kir-surface);
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.7rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.thread-card:hover { border-color: var(--kir-accent-soft); transform: translateY(-1px); }

.thread-card.pinned { border-color: rgba(255, 215, 0, 0.35); background: rgba(255, 215, 0, 0.04); }

.thread-card__body { flex: 1; min-width: 0; }

.thread-card__title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.thread-card__meta {
    font-size: 0.8rem;
    color: var(--kir-faint);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.thread-card__stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-width: 54px;
    text-align: center;
    color: var(--kir-muted);
    font-size: 0.72rem;
}
.thread-card__stats strong { display: block; font-size: 1rem; color: #fff; }

/* ── Profile "recent replies" post-cards ──────────────────────────────
   .post-card reuses .thread-card as its base (flex row) but swaps the
   plain score-only stat block for a real, clickable vote widget (same
   one used on thread.html), plus an explicit action to jump to the
   comment in its thread — or say there isn't one to jump to. */
.post-card {
    align-items: center;
    text-decoration: none;
}

.post-card__actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.post-card__comment-btn {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--kir-accent-hot);
    text-decoration: none;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(220, 20, 60, 0.3);
    background: rgba(220, 20, 60, 0.08);
    transition: all 0.15s ease;
}
.post-card__comment-btn:hover {
    color: #fff;
    border-color: rgba(220, 20, 60, 0.55);
    background: rgba(220, 20, 60, 0.16);
}

.post-card__no-thread {
    font-size: 0.78rem;
    font-style: italic;
    color: var(--kir-faint);
    white-space: nowrap;
}

.pin-flag {
    font-size: 0.68rem;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lock-flag {
    font-size: 0.68rem;
    color: var(--kir-faint);
}

.board-tag {
    font-size: 0.7rem;
    color: var(--kir-accent-hot);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--kir-faint);
    font-size: 0.92rem;
}

/* ── Username + badges (the custom check/role system) ─────────────── */
.forum-user {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
    color: var(--kir-text);
    cursor: pointer;
    text-decoration: none;
}
.forum-user:hover { text-decoration: underline; }

.forum-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--kir-surface-2);
}
.forum-avatar.lg { width: 56px; height: 56px; }

.role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    flex-shrink: 0;
    color: #0a0a0a;
    /* background-color and box-shadow color set inline per-role */
}

.role-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.12rem 0.55rem 0.12rem 0.35rem;
    border-radius: 999px;
    /* color / background set inline per-role */
}

/* ── New thread / compose ─────────────────────────────────────────── */
.compose-box {
    background: var(--kir-surface);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--kir-radius-md);
    padding: 1.1rem;
    margin-bottom: 1.5rem;
}

.compose-box input[type="text"],
.compose-box textarea,
.compose-box select {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    color: var(--kir-text);
    padding: 0.7rem 0.85rem;
    font-family: inherit;
    font-size: 0.92rem;
    margin-bottom: 0.7rem;
    resize: vertical;
}
.compose-box input:focus, .compose-box textarea:focus, .compose-box select:focus {
    outline: none;
    border-color: var(--kir-accent-soft);
}
.compose-box select option {
    background-color: #161212;
    color: #ffffff;
    padding: 0.5rem;
}

.compose-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }

/* ── Thread detail page ───────────────────────────────────────────── */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--kir-muted);
    font-size: 0.86rem;
    text-decoration: none;
    margin-bottom: 1.25rem;
}
.back-link:hover { color: #fff; }

.thread-op {
    display: flex;
    gap: 1rem;
    background: var(--kir-surface);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--kir-radius-md);
    padding: 1.4rem;
    margin-bottom: 1.75rem;
}

.thread-op__body {
    flex: 1;
    min-width: 0;
}

.thread-op__title {
    font-family: var(--font);
    font-size: clamp(1.4rem, 3vw, 1.9rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.thread-op__meta {
    font-size: 0.82rem;
    color: var(--kir-faint);
    margin-bottom: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.thread-op__content {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.98rem;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── Vote widget ───────────────────────────────────────────────────── */
.vote-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    flex-shrink: 0;
    padding-top: 0.15rem;
}

.vote-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: var(--kir-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.12s ease;
}
.vote-btn:hover { border-color: var(--kir-accent-soft); color: #fff; }
.vote-btn.up.active { background: rgba(79, 203, 122, 0.16); border-color: rgba(79, 203, 122, 0.5); color: #4fcb7a; }
.vote-btn.down.active { background: rgba(220, 20, 60, 0.16); border-color: rgba(220, 20, 60, 0.5); color: var(--kir-accent-hot); }

.vote-score {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.92rem;
    color: #fff;
    padding: 0.1rem 0;
}
.vote-score.neg { color: var(--kir-accent-hot); }
.vote-score.pos { color: #4fcb7a; }

/* ── Reply / comment tree ─────────────────────────────────────────── */
.tree-root { margin-top: 0.5rem; }

.comment {
    display: flex;
    gap: 0.85rem;
    padding: 0.9rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
    border-radius: 10px;
}

/* Flashed on a comment when the thread is opened via a #c-<id> deep link
   (e.g. "View thread" on a profile's recent replies) so it's obvious
   which reply you were sent to find. */
@keyframes commentLinkedFlash {
    0%, 100% { background: transparent; }
    25% { background: rgba(220, 20, 60, 0.16); }
}
.comment.comment--linked {
    animation: commentLinkedFlash 2.5s ease;
}

.comment__body { flex: 1; min-width: 0; }

.comment__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
}

.comment__time { color: var(--kir-faint); font-size: 0.78rem; }

.comment__content {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.93rem;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    margin-bottom: 0.4rem;
}

.comment__actions {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-size: 0.78rem;
    color: var(--kir-faint);
}
.comment__actions button {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;
}
.comment__actions button:hover { color: #fff; }

.comment__votes {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}
.comment__votes .vote-btn { width: 22px; height: 22px; border-radius: 6px; }
.comment__votes .vote-score { font-size: 0.8rem; }

.reply-children {
    margin-left: 1.5rem;
    padding-left: 1rem;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
}

.reply-inline-box { margin-top: 0.6rem; display: none; }
.reply-inline-box.open { display: block; }
.reply-inline-box textarea {
    width: 100%;
    min-height: 70px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 10px;
    color: var(--kir-text);
    padding: 0.6rem 0.75rem;
    font-family: inherit;
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
    resize: vertical;
}

.collapse-toggle {
    color: var(--kir-faint);
    font-size: 0.72rem;
    cursor: pointer;
    user-select: none;
}
.collapse-toggle:hover { color: #fff; }

.comment.collapsed .comment__content,
.comment.collapsed .comment__actions,
.comment.collapsed .reply-children,
.comment.collapsed .reply-inline-box {
    display: none;
}

/* ── Profile preview popover ──────────────────────────────────────── */
#profile-popover-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(3px);
    z-index: 998;
    display: none;
}
#profile-popover-backdrop.open { display: block; }

.profile-popover {
    position: fixed;
    z-index: 999;
    width: min(340px, 90vw);
    background: #100d0d;
    border: 1px solid rgba(220, 20, 60, 0.25);
    border-radius: var(--kir-radius-md);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    padding: 1.25rem;
    display: none;
}
.profile-popover.open { display: block; animation: popIn 0.15s var(--kir-ease-out); }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(0.98); } to { opacity: 1; transform: none; } }

.profile-popover__head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.profile-popover__name {
    font-size: 1.05rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.profile-popover__joined { font-size: 0.76rem; color: var(--kir-faint); margin-top: 0.1rem; }

.profile-popover__roles {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.profile-popover__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 0.9rem;
}
.profile-popover__stat {
    text-align: center;
    background: var(--kir-surface);
    border-radius: 10px;
    padding: 0.5rem 0.3rem;
}
.profile-popover__stat strong { display: block; font-size: 1.05rem; color: #fff; }
.profile-popover__stat span { font-size: 0.68rem; color: var(--kir-faint); text-transform: uppercase; letter-spacing: 0.05em; }

.profile-popover__close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    background: none;
    border: none;
    color: var(--kir-faint);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
}
.profile-popover__close:hover { color: #fff; }

.profile-popover__banned {
    font-size: 0.76rem;
    color: var(--kir-accent-hot);
    background: rgba(220, 20, 60, 0.12);
    border: 1px solid rgba(220, 20, 60, 0.3);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    margin-bottom: 0.8rem;
}

.profile-popover__viewall {
    display: block;
    text-align: center;
    font-size: 0.82rem;
    color: var(--kir-accent-hot);
    text-decoration: none;
    margin-top: 0.3rem;
}
.profile-popover__viewall:hover { text-decoration: underline; }

/* ── Board directory (the "All" index card grid) ──────────────────────
   Ported from index.html's homepage board-portal <style> block so
   forums.html can render the same card style — it wasn't previously
   available here since forum.css doesn't import index.css. */
.board-directory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1.5rem;
}

.kir-board-card {
    display: block;
    text-align: left;
    padding: 1.1rem 1.2rem;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.kir-board-card:hover {
    border-color: rgba(220, 20, 60, 0.45);
    transform: translateY(-2px);
}
.kir-board-card__name {
    font-family: var(--font);
    font-weight: 800;
    font-size: 1rem;
    color: #fff;
    margin-bottom: 0.3rem;
}
.kir-board-card__desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.4;
}
.kir-board-card__stats {
    display: flex;
    gap: 0.9rem;
    margin-top: 0.7rem;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}
.kir-board-card__stats strong {
    color: var(--kir-accent-hot);
    font-weight: 700;
}

/* ── Profile page header ──────────────────────────────────────────── */
.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--kir-surface);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--kir-radius-md);
    padding: 1.4rem;
    margin-bottom: 1rem;
}
.profile-header__name {
    font-family: var(--font);
    font-size: 1.3rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.profile-header__stats {
    display: flex;
    gap: 1.1rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--kir-muted);
}
.profile-header__stats strong { color: #fff; }

.profile-section-title {
    font-family: var(--font);
    font-size: 1.05rem;
    font-weight: 800;
    margin: 1.75rem 0 0.75rem;
}

/* ── Markdown styling ────────────────────────────────────────────── */
.md-codeblock {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-family: var(--mono);
    font-size: 0.85rem;
    color: #e0e0e0;
    overflow-x: auto;
    margin: 0.6rem 0;
}
.md-inline-code {
    background: rgba(220, 20, 60, 0.12);
    border: 1px solid rgba(220, 20, 60, 0.25);
    color: #ff7788;
    padding: 0.12rem 0.4rem;
    border-radius: 5px;
    font-family: var(--mono);
    font-size: 0.84rem;
}
.md-blockquote {
    border-left: 3px solid var(--kir-accent-hot);
    background: rgba(220, 20, 60, 0.05);
    margin: 0.5rem 0;
    padding: 0.5rem 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    font-style: italic;
    border-radius: 0 6px 6px 0;
}
.md-link {
    color: var(--kir-accent-hot);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.md-link:hover {
    color: #ff6677;
}
.md-list {
    margin: 0.5rem 0 0.5rem 1.25rem;
    padding: 0;
}
.md-list-item {
    margin-bottom: 0.25rem;
}

/* ── Search Input ────────────────────────────────────────────────── */
.forum-search-box {
    position: relative;
    flex: 1;
    min-width: 200px;
}
.forum-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    color: var(--kir-text);
    padding: 0.4rem 1rem 0.4rem 2.2rem;
    font-size: 0.84rem;
    transition: all 0.15s ease;
}
.forum-search-input:focus {
    outline: none;
    border-color: rgba(220, 20, 60, 0.5);
    background: rgba(0, 0, 0, 0.55);
}
.forum-search-icon {
    position: absolute;
    left: 0.8rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--kir-faint);
    font-size: 0.8rem;
    pointer-events: none;
}

/* ── Action buttons & Modals ──────────────────────────────────────── */
.kir-btn-sm {
    background: var(--kir-surface);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--kir-text);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.kir-btn-sm:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}
.kir-btn-danger {
    color: #ff5566;
    border-color: rgba(220, 20, 60, 0.3);
}
.kir-btn-danger:hover {
    background: rgba(220, 20, 60, 0.15);
    border-color: rgba(220, 20, 60, 0.6);
}

.edit-post-textarea {
    width: 100%;
    min-height: 80px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(220, 20, 60, 0.3);
    border-radius: 8px;
    color: #fff;
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.88rem;
    margin-top: 0.4rem;
    resize: vertical;
}

.forum-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.forum-modal.open {
    opacity: 1;
    pointer-events: auto;
}
.forum-modal__shell {
    width: min(440px, 90vw);
    background: #120e0e;
    border: 1px solid rgba(220, 20, 60, 0.3);
    border-radius: var(--kir-radius-md);
    padding: 1.5rem;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}
.forum-modal__shell h3 {
    font-family: var(--font);
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    color: #fff;
}
.forum-modal__shell textarea {
    width: 100%;
    min-height: 90px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--kir-text);
    padding: 0.6rem;
    font-family: inherit;
    font-size: 0.88rem;
    margin-bottom: 1rem;
    resize: vertical;
}

/* ── Toast / signed-out notice ─────────────────────────────────────── */
.forum-toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1010;
    border: 1px solid rgba(220, 20, 60, 0.3);
    color: #fff;
    padding: 0.7rem 1.2rem;
    border-radius: 999px;
    font-size: 0.85rem;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.forum-toast.show { opacity: 1; }

@media (max-width: 640px) {
    .reply-children { margin-left: 0.75rem; padding-left: 0.6rem; }
    .thread-op { flex-direction: column; }
    .vote-col { flex-direction: row; }
    .comment { gap: 0.6rem; }
}

/* ── Mobile ───────────────────────────────────────────────────────────
   forum.css previously had exactly one breakpoint (640px, thread page
   only) — everything else relied on flex-wrap/clamp() alone, which holds
   up down to ~480px but leaves board pills, the profile popover's stat
   grid, and list rows cramped/overflowing on real phone widths. */
@media (max-width: 720px) {
    .forum-shell { padding-top: clamp(5.5rem, 16vw, 6.5rem); }
    .forum-head { align-items: flex-start; }
    .forum-sortrow { align-items: flex-start; }
    .thread-card { padding: 0.9rem; gap: 0.75rem; }
    .board-directory-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.6rem; }
    .profile-header { flex-wrap: wrap; text-align: center; justify-content: center; }
    .profile-header__stats { justify-content: center; flex-wrap: wrap; }
}

@media (max-width: 460px) {
    .thread-card { flex-direction: column; align-items: flex-start; }
    .thread-card__stats { flex-direction: row; gap: 0.4rem; align-self: flex-start; }
    .profile-popover__stats { grid-template-columns: repeat(3, 1fr); gap: 0.35rem; }
    .compose-box { padding: 0.85rem; }
    .compose-actions { justify-content: stretch; }
    .compose-actions button, .compose-actions a { flex: 1; }
}