/* ---- accessibility ---- */
/* skip link: hidden until a keyboard user tabs to it, then it slides into view */
.skip-link { position: absolute; left: 8px; top: -48px; z-index: 200; background: var(--accent); color: #fff;
    padding: 8px 14px; border-radius: 0 0 8px 8px; text-decoration: none; transition: top .15s ease; }
.skip-link:focus { top: 0; }
/* a visible focus ring for keyboard users (not on mouse clicks) */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
        transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

:root {
    --bg: #f5f6f8;
    --panel: #ffffff;
    --border: #e2e5ea;
    --text: #1f2733;
    --muted: #7a8597;
    --accent: #3a7ca5;
    --danger: #b85450;
    --radius: 10px;
    color-scheme: light;
}

html[data-theme="dark"] {
    --bg: #14171c;
    --panel: #1e232b;
    --border: #2c333d;
    --text: #e6e9ee;
    --muted: #8b95a3;
    --accent: #4a90c2;
    --danger: #e07a76;
    color-scheme: dark;
}
/* keep colour inputs / number spinners readable in dark mode */
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #2a313b; }

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.spacer { flex: 1; }

/* ---------------- layout ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 300px;
    flex: 0 0 300px;
    background: var(--panel);
    border-right: 1px solid var(--border);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;   /* the category tree scrolls on its own; the bottom bar (ad + key links) stays pinned */
}
/* only the topic tree scrolls, so the ad + Dashboard/Community/Help stay visible no matter how many categories */
.sidebar nav.topics { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.sidebar .nav-tree { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 17px; }
/* the theme toggle sits at the far right of the brand row (margin-left:auto now works with flex) */
.brand .brand-home { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* only the leading Home icon carries the divider; the Search icon that follows it does not double it up */
.search-top { border-right: none; padding-right: 0; margin-right: 0; }

.me { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.me-name { font-weight: 600; }
.logout { margin-left: auto; display: inline-flex; }
.logout button { background: none; border: none; cursor: pointer; line-height: 0; padding: 0; color: var(--muted); display: inline-flex; align-items: center; }
.logout button:hover { color: var(--text); }
.me .bell .icon, .me .logout .icon { width: 19px; height: 19px; }
/* Home: isolated leading icon in the brand row, set off by a divider; shared by guests + signed-in. */
.home-top { display: inline-flex; align-items: center; line-height: 0; color: var(--muted);
    text-decoration: none; flex: 0 0 auto; padding-right: 8px; margin-right: 2px;
    border-right: 1px solid var(--border); }
.home-top:hover { color: var(--text); }
.home-top .icon { width: 20px; height: 20px; }

.topics-head { display: flex; align-items: center; gap: 2px; color: var(--muted); margin-bottom: 6px; }
.topics-head .th-icon { display: inline-flex; align-items: center; }
.topics-head .icon { width: 16px; height: 16px; }
.topics-head .icon-btn { padding: 4px; color: var(--muted); }
.topics { display: flex; flex-direction: column; gap: 2px; }
.topic-link {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
    color: var(--text); font-size: 14px;
}
.topic-link:hover { background: var(--bg); text-decoration: none; }
.topic-link.active { background: var(--accent); color: #fff; }
.topic-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }

/* domain header grouping curated categories (Sports, Entertainment, Tech, Lifestyle) */
.domain-head { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); opacity: .65; padding: 8px 6px 2px; margin-top: 4px; overflow-wrap: break-word; }
.nav-tree > .domain-head:first-child { margin-top: 0; }

/* category / subcategory grouping */
.cat { margin-bottom: 8px; }
/* right padding keeps a wrapped (longer-locale) category name clear of the absolute hide button */
.cat-name { font-size: 14px; font-weight: 700; color: var(--muted); padding: 5px 24px 5px 6px; cursor: pointer; overflow-wrap: break-word; }
.cat-name::-webkit-details-marker, .cat-name::marker { color: var(--muted); }
.sub { margin-left: 4px; }
.sub-name { font-size: 14px; color: var(--muted); padding: 4px 8px; cursor: pointer; }
.sub-topics .loading { display: block; padding: 4px 12px; font-size: 12px; color: var(--muted); opacity: .7; }
/* follower count shown on the right of each topic link (only when > 0) */
.topic-followers { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); opacity: .7; font-variant-numeric: tabular-nums; }
.topic-link.active .topic-followers { color: #fff; opacity: .85; }

/* per-user "hide this category" button (appears on hover over the category) */
.nav-tree details.cat { position: relative; }
.cat-name .cat-hide { position: absolute; right: 4px; top: 4px; background: none; border: none;
    color: var(--muted); cursor: pointer; line-height: 0; padding: 2px 4px; border-radius: 6px; opacity: 0; }
.cat-name .cat-hide .icon { width: 15px; height: 15px; }
.nav-tree details.cat:hover .cat-hide { opacity: .55; }
.cat-name .cat-hide:hover { opacity: 1; color: var(--danger); background: var(--bg); }
/* User Groups discovery list: member-count badge per group */
.member-count { margin-left: auto; font-size: 10px; color: var(--muted); background: var(--bg);
    border: 1px solid var(--border); border-radius: 999px; padding: 0 6px; }
.hidden-cats-link .nav-ico { width: 16px; height: 16px; opacity: .8; }
/* hidden-categories management page */
.hidden-cat-list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.hidden-cat-list li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.hidden-cat-list .hc-name { font-weight: 600; }
/* admin taxonomy: hidden badge */
.tax-hidden-badge { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--danger);
    border: 1px solid var(--danger); border-radius: 6px; padding: 0 5px; }

.new-topic { margin-top: auto; }
.new-topic summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.new-topic form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.new-topic input[type=text], .new-topic input:not([type]) { width: 100%; }
.new-topic .colors { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.new-topic input[type=color] { width: 34px; height: 26px; padding: 0; border: 1px solid var(--border); }

.main { flex: 1; display: flex; gap: 18px; padding: 20px; align-items: flex-start; min-width: 0; }
.topic-content { flex: 1; min-width: 0; max-width: 860px; }
.empty { flex: 1; text-align: center; color: var(--muted); margin-top: 60px; }

/* ---------------- topic header / toolbar (themed) ---------------- */
.topic-header {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px;
    background: var(--topic-primary, var(--accent)); color: #fff;
    padding: 12px 16px; border-radius: var(--radius);
    border-bottom: 4px solid var(--topic-secondary, transparent);
}
.topic-header h1 { color: #fff; }
.topic-header h1 { font-size: 22px; margin: 0; flex: 1; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; min-width: 0; justify-content: flex-end; }
.toolbar input, .toolbar select { padding: 6px 9px; }
.toolbar .search { min-width: 0; max-width: 220px; }

input, select, textarea, button {
    font: inherit; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px;
    background: #fff; color: var(--text);
}
textarea { width: 100%; resize: vertical; }
button { cursor: pointer; background: var(--accent); color: #fff; border: none; }
button:hover { filter: brightness(1.05); }
button:disabled { opacity: .5; cursor: not-allowed; }
.link-btn { background: none; color: var(--muted); padding: 2px 6px; }
.link-btn:hover { color: var(--text); }
.link-btn.danger:hover { color: var(--danger); }

/* ---------------- composer / editor ---------------- */
.composer { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; margin-bottom: 18px; }
.composer-actions { display: flex; gap: 8px; margin-top: 8px; }
.editor { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.md-toolbar { display: flex; align-items: center; gap: 4px; padding: 4px 6px; background: var(--bg); border-bottom: 1px solid var(--border); }
.md-toolbar button, .img-btn { background: none; border: none; color: var(--text); padding: 4px 8px; border-radius: 6px; cursor: pointer; }
.md-toolbar button:hover, .img-btn:hover { background: #e7eaef; }
.img-btn { display: inline-flex; }
.md-toolbar .md-code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; font-weight: 700; }
.md-toolbar .md-formula { font-size: 14px; line-height: 1; }
.md-toolbar .code-lang { font-size: 11px; padding: 2px 4px; border: 1px solid var(--border); border-radius: 6px;
    background: var(--panel); color: var(--text); }
.md-hint { margin-left: auto; font-size: 11px; color: var(--muted); }
.editor textarea { border: none; border-radius: 0; }

/* ---------------- threads / posts ---------------- */
.threads { display: flex; flex-direction: column; gap: 18px; }
.thread { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.comments { margin-left: 28px; border-left: 2px solid var(--border); padding-left: 14px; margin-top: 10px; display: flex; flex-direction: column; gap: 10px; }
.show-earlier { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin: 2px 0; padding: 5px 12px;
    font-size: 12px; font-weight: 600; color: var(--accent); background: none; border: 1px dashed var(--border);
    border-radius: 14px; cursor: pointer; }
.show-earlier::before { content: "\2191"; font-weight: 700; }
.show-earlier:hover { background: var(--bg); border-color: var(--accent); }
.show-earlier.htmx-request { opacity: .55; cursor: progress; }
.post-time { color: inherit; text-decoration: none; cursor: pointer; position: relative; }
.post-time:hover { text-decoration: underline; }
.post-time.copied::after { content: "link copied"; position: absolute; left: 50%; bottom: calc(100% + 4px);
    transform: translateX(-50%); background: #111; color: #fff; font-size: 10px; padding: 2px 7px;
    border-radius: 6px; white-space: nowrap; z-index: 5; }

/* optimistic like pop */
@keyframes like-pop { 0% { transform: scale(1); } 40% { transform: scale(1.32); } 100% { transform: scale(1); } }
.like.liked-pulse svg { animation: like-pop .32s ease; }

/* read-more fold for long post bodies */
.post .body.clamped { max-height: 380px; overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 74%, transparent); mask-image: linear-gradient(180deg, #000 74%, transparent); }
.read-more { display: inline-flex; margin-top: 4px; padding: 3px 12px; font-size: 12px; font-weight: 600;
    color: var(--accent); background: none; border: 1px dashed var(--border); border-radius: 14px; cursor: pointer; }
.read-more:hover { background: var(--bg); border-color: var(--accent); }

.post.root > .post-inner > .post-head .username { font-weight: 700; }
.post { padding: 4px 0; }
.post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.avatar {
    width: 30px; height: 30px; border-radius: 50%; color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 600; flex: 0 0 auto;
    /* keep the initial readable over patterned (two-colour) avatars */
    text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.username { font-weight: 600; }
a.username { color: inherit; text-decoration: none; }
a.username:hover { text-decoration: underline; }
.role-badge { font-size: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 1px 5px; color: var(--muted); }
.tag.friend { font-size: 11px; color: #b8860b; }
.relation { display: inline-flex; gap: 2px; }
time { color: var(--muted); font-size: 12px; }
.edited { font-size: 12px; color: var(--muted); }

.quote { border-left: 3px solid var(--accent); background: var(--bg); padding: 6px 10px; margin: 8px 0; border-radius: 0 6px 6px 0; font-size: 13px; }
.quote-author { font-weight: 600; display: block; color: var(--muted); }

.body { margin: 8px 0; line-height: 1.6; word-wrap: break-word; overflow-wrap: anywhere; }
.body p { margin: 6px 0; }
.body p:first-child { margin-top: 0; }
.body p:last-child { margin-bottom: 0; }
/* root posts read as the headline of a thread — a touch larger for comfort */
.post.root > .post-inner > .body { font-size: 15px; }
/* Every posted image renders in the same fixed box so the feed stays uniform for all users.
   The original is one click away (opens full-size in a new tab). */
.body img { display: block; width: 320px; height: 240px; max-width: 100%; object-fit: cover;
    border-radius: 8px; border: 1px solid var(--border); background: var(--bg);
    margin: 8px 0; cursor: zoom-in; }
@media (max-width: 760px) { .body img { width: 100%; height: 200px; } }
/* fenced code blocks: dark, syntax-highlighted (highlight.js github-dark theme) */
.body pre { background: #0d1117; color: #c9d1d9; border-radius: 8px; overflow: auto; margin: 8px 0; padding: 11px 13px; }
.body pre code, .body pre code.hljs { background: #0d1117; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 12.5px; line-height: 1.55; }
/* inline code (not a fenced block) */
.body :not(pre) > code { background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
    padding: 1px 5px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.body blockquote { border-left: 3px solid var(--border); margin: 6px 0; padding-left: 10px; color: var(--muted); }
/* a user link that tripped the safety heuristic — warn the reader, keep it clickable */
.body a.link-warn { color: #c0392b; text-decoration: underline; text-decoration-style: wavy; }
.body a.link-warn:hover { color: #a93226; }
.deleted { color: var(--muted); }

.actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; }

/* ignored users */
.post.ignored .post-inner { display: none; }
.post.ignored.reveal .post-inner { display: block; }
.post.ignored.reveal .ignored-note { display: none; }
.ignored-note { font-size: 13px; color: var(--muted); font-style: italic; }

/* reply / edit history */
.reply { margin: 10px 0 4px 28px; }
.sentinel { text-align: center; color: var(--muted); padding: 10px; font-size: 13px; }
.empty-posts { text-align: center; color: var(--muted); padding: 30px; }
.edit-history { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin: 8px 0; font-size: 13px; }
.eh-head { font-weight: 600; display: flex; justify-content: space-between; margin-bottom: 6px; }
.eh-item { padding: 6px 0; border-top: 1px dashed var(--border); }

/* ---------------- auth ---------------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-layout { display: flex; gap: 28px; align-items: stretch; flex-wrap: wrap; justify-content: center; max-width: 820px; width: 100%; }
.auth-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px; width: 320px; max-width: 100%; }
.auth-card form { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.hint { font-size: 11px; color: var(--muted); }

/* two-factor setup / recovery */
.twofa-qr { display: flex; justify-content: center; margin: 14px 0 8px; }
.twofa-qr svg { width: 180px; height: 180px; background: #fff; padding: 6px; border-radius: 8px; }
.twofa-secret { display: block; text-align: center; letter-spacing: 2px; font-size: 14px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px; margin: 4px 0 14px; word-break: break-all; }
.twofa-codes { list-style: none; margin: 14px 0; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    background: var(--bg); border: 1px solid var(--border); border-radius: 8px; font-family: monospace; font-size: 15px; text-align: center; }

/* "Why TalkScrolls" agenda panel beside the login card (stacks on mobile) */
.auth-agenda { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 26px; width: 400px; max-width: 100%; }
.auth-agenda h2 { margin: 0 0 10px; font-size: 19px; }
.auth-agenda .agenda-lead { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }
.auth-agenda .agenda-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.auth-agenda .agenda-list li { font-size: 13px; line-height: 1.45; padding-left: 18px; position: relative; }
.auth-agenda .agenda-list li::before { content: "›"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.auth-agenda .agenda-story { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.auth-agenda .agenda-story em { color: var(--text); font-style: italic; }
.auth-agenda .agenda-sign { margin: 8px 0 0; font-size: 12px; color: var(--muted); font-style: italic; }

/* ---------------- themed accents (per topic colors) ---------------- */
.composer-actions button.icon-submit { background: var(--topic-primary, var(--accent)); }
.quote { border-left-color: var(--topic-primary, var(--accent)); }

/* icon submit button (Post / Comment / Save shown as a send/check icon) */
.icon-submit { display: inline-flex; align-items: center; justify-content: center;
    border: none; color: #fff; border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.icon-submit .icon { width: 18px; height: 18px; }
.icon-submit:hover { filter: brightness(1.08); }
/* the cancel (×) sits next to it as a plain muted icon button */
.composer-actions .icon-btn { color: var(--muted); }
.composer-actions .icon-btn:hover { color: var(--text); background: var(--bg); }
/* a touch more breathing room around the composer editor + actions */
.composer-actions { padding-top: 2px; }
.reply > form, .tl-comment-form { border-top: 1px solid var(--border); padding-top: 10px; }

/* the ▹ leaf marker keeps non-collapsible sidebar links aligned with <details> rows */
.sub-link .leaf-marker { color: var(--muted); font-size: 11px; opacity: .8; }

/* ---------------- presence (online users) panel ---------------- */
.presence {
    flex: 0 0 220px; width: 220px; position: sticky; top: 20px;
    background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.presence-head {
    background: var(--topic-primary, var(--accent)); color: #fff;
    font-weight: 600; font-size: 13px; padding: 8px 12px;
}
.online { display: flex; flex-direction: column; }
.online .small { padding: 12px; }
/* one consistent, fixed-height scroller for every roster (Viewing now / Friends online / Members) so the
   panels never balloon, regardless of how many users there are */
.roster { display: flex; flex-direction: column; max-height: 232px; overflow-y: auto; }
.online-user { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.online-user:last-child { border-bottom: none; }
.online-user.is-me { background: var(--bg); }
.avatar.small { width: 24px; height: 24px; font-size: 11px; flex: 0 0 auto; }
/* clickable name → profile (consistent across all three lists) */
.on-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    color: inherit; text-decoration: none; }
.on-name:hover { color: var(--accent); text-decoration: underline; }
.online-user .tag { font-size: 10px; color: var(--muted); }
/* "+N more" (live lists) and the "View more" pager (members) sit just under a roster */
.roster-more { padding: 6px 12px; }
.roster-more-btn { display: block; width: 100%; text-align: center; padding: 7px 12px;
    border: none; border-top: 1px solid var(--border); background: none; color: var(--accent);
    font-size: 12px; font-weight: 600; cursor: pointer; }
.roster-more-btn:hover { background: var(--bg); }
.chat-open { font-size: 14px; }
.online-section-head { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); padding: 8px 12px 4px; }
.online-section-head.friends { border-top: 1px solid var(--border); margin-top: 4px; }
.online-guest { padding: 4px 12px 10px; }
.online-guest p { margin: 2px 0 10px; }
.online-guest .cta-primary { display: inline-block; }

/* ---------------- chat dock ---------------- */
#chat-dock { position: fixed; right: 16px; bottom: 0; display: flex; gap: 12px; align-items: flex-end; z-index: 50; }
.chat-box {
    width: 240px; height: 320px; display: flex; flex-direction: column;
    background: var(--panel); border: 1px solid var(--border); border-radius: 10px 10px 0 0;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; background: var(--accent); color: #fff; border-radius: 10px 10px 0 0; }
.chat-name { font-weight: 600; font-size: 13px; }
.chat-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 13px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 8px; display: flex; flex-direction: column; gap: 5px; }
.chat-msg { max-width: 80%; padding: 5px 9px; border-radius: 12px; font-size: 13px; word-wrap: break-word; }
.chat-msg.in { align-self: flex-start; background: var(--bg); }
.chat-msg.out { align-self: flex-end; background: var(--accent); color: #fff; }
.chat-msg.sys { align-self: center; font-size: 11px; color: var(--muted); font-style: italic; }
.chat-form { display: flex; border-top: 1px solid var(--border); }
.chat-input { flex: 1; border: none; border-radius: 0; }

/* ---------------- brand / logo ---------------- */
.brand { display: flex; align-items: center; gap: 8px; }
.brand-logo { width: 24px; height: 24px; color: #b8860b; flex: 0 0 auto; }
.auth-card .brand { justify-content: center; margin-bottom: 8px; }

/* ---------------- icons & icon buttons (consistent sizing) ---------------- */
.icon { width: 18px; height: 18px; display: block; }
.icon-btn {
    display: inline-flex; align-items: center; gap: 5px; line-height: 0;
    background: none; border: none; color: var(--muted); padding: 5px; border-radius: 8px; cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn:disabled { opacity: .45; cursor: not-allowed; }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn.report.done { color: var(--danger); }
.icon-btn.on { color: var(--topic-primary, var(--accent)); }
.like.icon-btn span { font-size: 12px; line-height: 1; }
/* liked = filled, coloured thumb + visible count, no background fill */
.like.icon-btn.on { color: var(--topic-primary, var(--accent)); }
.like.icon-btn.on .icon { fill: currentColor; }
.like.icon-btn.on:hover { color: var(--topic-primary, var(--accent)); }
.user-actions { display: inline-flex; gap: 2px; }
.user-actions .icon { width: 16px; height: 16px; }
.user-actions .icon-btn { padding: 4px; }

/* ---------------- centred, wider post column + right user rail ---------------- */
.main { max-width: 1180px; margin: 0 auto; }
.topic-content { max-width: none; }
.presence { flex: 0 0 240px; width: 240px; }

/* ---------------- post id / "new" / hidden badges ---------------- */
.badge-id { font-size: 11px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; }
.new-badge { font-size: 10px; font-weight: 700; color: #fff; background: #2e9e5b; border-radius: 8px; padding: 1px 6px; text-transform: uppercase; letter-spacing: .03em; }
.pin-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700; color: #b26a00; background: #fff4e0; border: 1px solid #f0c887; border-radius: 8px; padding: 1px 7px; text-transform: uppercase; letter-spacing: .03em; }
.pin-badge .icon { width: 12px; height: 12px; }
[data-theme="dark"] .pin-badge { color: #ffcf80; background: #3a2c12; border-color: #6b5220; }
.post.root.pinned-thread, .thread .post.root:has(.pin-badge) { }
.pin-btn.on { color: #b26a00; }
[data-theme="dark"] .pin-btn.on { color: #ffcf80; }
.pin-preview { margin: 0 0 14px; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--bg); color: var(--muted); border-radius: 0 8px 8px 0; font-style: italic; }

/* --- quiz game --- */
.quiz-page { max-width: 760px; }
.quiz-head { display: flex; align-items: center; gap: 10px; }
.quiz-head h1 { margin: 0; }
.quiz-meta { margin: 4px 0 16px; }
.q-status { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 8px; padding: 2px 8px; color: #fff; }
.q-status.q-draft { background: #8a93a6; }
.q-status.q-open { background: #2e9e5b; }
.q-status.q-closed { background: #b25656; }
.q-diff { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; border-radius: 8px; padding: 1px 7px; border: 1px solid var(--border); color: var(--muted); }
.q-diff.d-easy { color: #2e9e5b; border-color: #a9d9bd; }
.q-diff.d-medium { color: #b8860b; border-color: #e6cf88; }
.q-diff.d-hard { color: #b25656; border-color: #e0a5a5; }
.quiz-qlist { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-direction: column; gap: 8px; }
.quiz-q { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.quiz-q-main { flex: 1; min-width: 0; }
.quiz-q-prompt { font-weight: 600; }
.quiz-q-answer { font-size: 13px; color: var(--muted); margin-top: 2px; }
.quiz-add { display: flex; flex-direction: column; gap: 10px; padding: 14px; margin-bottom: 18px; }
.quiz-add label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.quiz-add textarea, .quiz-add input, .quiz-add select { font: inherit; }
.quiz-add-row { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.quiz-add-row label { flex: 0 0 auto; }
.quiz-add-row button { margin-left: auto; }
.quiz-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 8px 0 18px; }
.quiz-play-card { padding: 14px 16px; }
.danger-text { background: none; border: none; color: #b25656; cursor: pointer; font: inherit; padding: 0; }
[data-theme="dark"] .q-diff.d-easy { color: #7fd8a4; }
[data-theme="dark"] .q-diff.d-medium { color: #e6c766; }
[data-theme="dark"] .q-diff.d-hard { color: #e59a9a; }
/* quiz play */
.quiz-timer { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 10px 0 20px; }
.quiz-timer-bar { height: 100%; width: 100%; background: var(--accent); transition: width .08s linear; }
.quiz-step { padding: 6px 0 4px; }
.quiz-step-prompt { font-size: 20px; font-weight: 600; margin: 8px 0 14px; }
.quiz-answer-input { width: 100%; font: inherit; font-size: 18px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); color: var(--text); }
.quiz-play-actions { display: flex; align-items: center; gap: 14px; margin-top: 16px; }
/* quiz results */
.quiz-score { font-size: 26px; font-weight: 700; margin: 2px 0 12px; }
.quiz-answer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.quiz-answer-list li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-radius: 8px; border-left: 3px solid transparent; }
.quiz-answer-list li.ans-ok { border-left-color: #2e9e5b; background: rgba(46,158,91,.06); }
.quiz-answer-list li.ans-no { border-left-color: #b25656; background: rgba(178,86,86,.06); }
.quiz-a-mark { font-weight: 700; }
.ans-ok .quiz-a-mark { color: #2e9e5b; }
.ans-no .quiz-a-mark { color: #b25656; }
.quiz-a-prompt { font-weight: 600; }
.quiz-a-given, .quiz-a-correct { color: var(--muted); font-size: 14px; }
.quiz-standings { width: 100%; border-collapse: collapse; }
.quiz-standings td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.quiz-standings .qs-rank { width: 32px; color: var(--muted); font-weight: 700; }
.quiz-standings .qs-score { text-align: right; font-weight: 700; }
.quiz-review-user { padding: 10px 0; border-top: 1px solid var(--border); }
.qr-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.quiz-deadline-form { display: inline-flex; align-items: center; gap: 8px; }
.btn, .btn-primary { display: inline-block; font: inherit; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.quiz-note { font-size: 15px; color: var(--text); }
.quiz-public-opt { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.quiz-back { margin-top: 18px; }
.quiz-back a { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--muted); text-decoration: none; }
.quiz-back a:hover { color: var(--accent); }
.quiz-back .icon { width: 16px; height: 16px; }
.hidden-note { color: var(--muted); font-style: italic; }
.post.hidden > .post-inner { opacity: .75; }
.hidden-flag { font-size: 11px; color: var(--danger); }

/* Narrow / landscape-phone / tablet: stop cramming a 3rd column — the "Online" rail stacks
   full-width BELOW the posts (compact, scrollable), so the content reads first. */
@media (max-width: 1024px) {
    .main { flex-direction: column; }
    .topic-content { max-width: none; }
    .presence { width: 100%; flex: none; position: static; }
    .presence .online { max-height: 200px; overflow-y: auto; }
}

/* ---------------- mobile: sidebar becomes an off-canvas drawer ---------------- */
/* a fixed hamburger + dimming backdrop are injected by app.js only when the app shell is present;
   hidden on desktop, shown ≤720px. */
.nav-burger { display: none; position: fixed; top: calc(8px + env(safe-area-inset-top, 0px)); left: 10px;
    z-index: 60; width: 40px; height: 40px; align-items: center; justify-content: center;
    background: var(--panel); color: var(--text); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.22); cursor: pointer; }
.nav-backdrop { display: none; position: fixed; inset: 0; z-index: 55; background: rgba(0,0,0,.45); }

@media (max-width: 760px) {
    .nav-burger { display: inline-flex; }
    body.nav-open .nav-backdrop { display: block; }
    /* the sidebar slides in from the left instead of stacking above the content */
    .sidebar { position: fixed; top: 0; left: 0; bottom: 0; z-index: 58;
        width: 82%; max-width: 320px; height: 100vh; height: 100dvh; overflow-y: auto;
        box-shadow: 2px 0 16px rgba(0,0,0,.35);
        transform: translateX(-100%); transition: transform .25s ease; }
    body.nav-open .sidebar { transform: translateX(0); }
    /* Domain topic-landing: the sidebar (topic list + feature links) is the whole screen, so entering a
       domain shows the list right away instead of an empty "pick a topic" prompt behind a hidden drawer.
       Tapping a topic navigates to its detail page (where the off-canvas drawer + burger take over). */
    .app-landing .sidebar { position: static; transform: none; flex: none; width: 100%; max-width: none;
        height: auto; min-height: 100dvh; overflow: visible; box-shadow: none; z-index: auto; }
    .app-landing .main { display: none; }
    .main { flex-direction: column; padding: 14px 12px; padding-top: 52px; }   /* clear the floating burger */
    .topic-content { max-width: none; }
    .presence { width: 100%; flex: none; position: static; }
    .comments { margin-left: 10px; padding-left: 8px; }
    .reply { margin-left: 10px; }
    /* bigger tap targets + 16px fields (stops iOS auto-zoom on focus) */
    .icon-btn { min-width: 36px; min-height: 36px; }
    .pool-item .add, .tok .x, .tier-add-btn { min-width: 30px; min-height: 30px; }   /* game/tier touch targets */
    input, select, textarea { font-size: 16px; }
    #chat-dock { right: 0; left: 0; justify-content: center; }
    .chat-box { width: 100%; max-width: 360px; }
}

/* ---------------- theme toggle / profile link / cookie banner ---------------- */
.theme-toggle { margin-left: auto; background: none; border: none; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px; }
.theme-toggle.float { position: fixed; bottom: 16px; left: 16px; z-index: 40; background: var(--panel); border: 1px solid var(--border);
    border-radius: 50%; width: 38px; height: 38px; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.avatar-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; min-width: 0; }
.avatar-link:hover { text-decoration: none; opacity: .85; }
.avatar-link .me-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cookie-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center;
    justify-content: center; gap: 12px; padding: 12px 16px; background: var(--panel); border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0,0,0,.12); font-size: 13px; }
.cookie-actions { display: flex; gap: 8px; }

/* ---------------- profile page ---------------- */
.profile { max-width: 680px; width: 100%; margin: 0 auto; }
.profile .card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.profile .card h2 { font-size: 15px; margin: 0 0 12px; }
.profile form { display: flex; flex-direction: column; gap: 10px; }
.profile label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.profile .ok { color: #2e9e5b; font-size: 13px; }
.avatar-preview { width: 48px; height: 48px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
/* avatar editor: preview + pattern/colour controls side by side */
.av-edit { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.av-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.av-row { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.av-row select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--text); }
.av-row input[type=color] { width: 40px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); cursor: pointer; }
.av-random { align-self: flex-end; font-size: 13px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.swatch.sel { border-color: var(--text); }

/* ---------------- registration anti-bot ---------------- */
.captcha-box { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.captcha-input { width: 64px; }
/* terms acceptance checkbox at register */
.terms-box { flex-direction: row !important; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--muted); }
.terms-box input { margin-top: 2px; }
.terms-box a { color: var(--accent); }

/* standalone legal pages (Terms / Privacy) */
.legal-wrap { min-height: 100vh; display: flex; justify-content: center; padding: 32px 20px; }
.legal-page { width: 100%; max-width: 720px; }
.legal-page h1 { margin: 6px 0 4px; }
.legal-page h2 { font-size: 16px; margin: 22px 0 6px; }
.legal-page p, .legal-page li { line-height: 1.6; color: var(--text); }
.legal-back { display: inline-block; margin-bottom: 12px; color: var(--accent); font-size: 13px; }
.legal-updated { color: var(--muted); font-size: 12px; }
.legal-draft { background: rgba(216,155,0,.12); border: 1px solid rgba(216,155,0,.5); border-radius: 8px;
    padding: 8px 12px; font-size: 13px; }
.legal-links { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--border); }
.agenda-links { margin-top: 18px; font-size: 13px; color: var(--muted); }
.agenda-links a { color: var(--accent); }
.help-link { color: var(--muted); }
/* honeypot: visually hidden, off-screen, not focusable */
.hp { position: absolute !important; left: -9999px; top: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------------- content language filter ---------------- */
.topics-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.topics-head .lang-all-toggle { font-size: 10px; padding: 0; white-space: nowrap; }
.topic-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-chip { font-size: 9px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 0 3px; flex: 0 0 auto; }
.lang-checks { display: flex; flex-wrap: wrap; gap: 12px; }
.lang-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }

/* ---------------- games under sport categories ---------------- */
.game-link { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; font-size: 13px; color: var(--text); }
.game-link:hover { background: var(--bg); text-decoration: none; }

/* ---------------- topic search / follow ---------------- */
/* Following filter toggle: highlighted (accent + filled bookmark) while you're viewing only your follows. */
.nav-mode-toggle.active { color: var(--topic-primary, var(--accent)); }
.nav-mode-toggle.active .icon { fill: currentColor; }
.topic-search { width: 100%; margin: 4px 0; padding: 6px 9px; }
.lang-row { margin: 2px 0 6px; }
.search-results { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.search-results:empty { display: none; }
.search-item { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 7px; }
.search-item:hover { background: var(--bg); }
.si-main { flex: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); }
.si-main:hover { text-decoration: none; }
.si-title { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-path { font-size: 10px; color: var(--muted); }
.search-empty { padding: 6px; }

.follow-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 12px; padding: 2px 9px; font-size: 11px; cursor: pointer; white-space: nowrap; }
.follow-btn:hover { color: var(--text); }
.follow-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.topic-header .follow-btn { border-color: rgba(255,255,255,.65); color: #fff; }
.topic-header .follow-btn.on { background: #fff; color: var(--topic-primary, var(--accent)); border-color: #fff; }

.nav-tree details.sub { margin-left: 2px; }
.nav-tree details.sub > summary.sub-name { cursor: pointer; }
.nav-tree details.sub > summary::-webkit-details-marker, .nav-tree details.sub > summary::marker { color: var(--muted); }

/* per-topic moderator management (admin) */
.topic-mods { margin: 6px 0 10px; font-size: 14px; }
.topic-mods > summary { cursor: pointer; color: var(--muted); }
.topic-mods .mod-list { list-style: none; padding: 0; margin: 8px 0; }
.topic-mods .mod-list li { display: flex; align-items: center; gap: 10px; padding: 3px 0; }
.topic-mods .mod-list form { margin: 0; }
.topic-mods .mod-name { font-weight: 600; }
.topic-mods .mod-empty { color: var(--muted); }
.topic-mods .link-btn { background: none; border: none; color: #c0392b; cursor: pointer; padding: 0; font-size: 13px; }
.topic-mods .mod-add { display: flex; gap: 8px; margin-top: 6px; }

/* per-thread language: filter chips + badge + composer picker */
.lang-filter { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 10px; }
.lang-filter .lf-label { color: var(--muted); font-size: 13px; }
.lang-chip { background: var(--surface-2, #f0f0f0); border: 1px solid var(--border, #ccc);
    color: var(--text, #222); border-radius: 999px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.lang-chip:hover { border-color: var(--accent); }
.lang-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lang-badge { font-size: 11px; font-weight: 700; letter-spacing: .03em; color: var(--muted);
    border: 1px solid var(--border, #ccc); border-radius: 4px; padding: 0 4px; }
.composer-actions .lang-pick { display: inline-flex; align-items: center; gap: 6px; margin-right: auto;
    color: var(--muted); font-size: 13px; }
.composer-actions { display: flex; align-items: center; gap: 10px; }

/* "beta" tag for Predict/Manager (still rough; data needs reliable APIs) */
.beta-tag { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; vertical-align: super; margin-left: 4px; padding: 1px 5px;
    border-radius: 999px; background: var(--accent); color: #fff; opacity: .85; }
.game-link .beta-tag { vertical-align: middle; }
.season-badge { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
    vertical-align: middle; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
    background: var(--panel-2, rgba(127,127,127,.15)); color: var(--muted); }

/* ---------------- premium & ads ---------------- */
.premium-card { border-color: var(--accent); }
.premium-card .premium-on { font-weight: 600; color: var(--accent); }
.premium-perks { list-style: none; margin: 8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.premium-perks li { font-size: 13px; padding-left: 18px; position: relative; }
.premium-perks li::before { content: "✓"; position: absolute; left: 2px; color: var(--accent); font-weight: 700; }
.lang-check input:disabled + span { opacity: .45; }

/* ---------------- billing / checkout ---------------- */
.billing-page { max-width: 520px; margin: 0 auto; padding: 8px 4px 44px; }
.billing-card { border-color: var(--accent); }
.billing-why { font-size: 13.5px; line-height: 1.5; color: var(--text); margin: 0 0 12px; }
.billing-price { display: flex; align-items: baseline; gap: 6px; margin: 4px 0 10px; }
.billing-price .bp-amount { font-size: 34px; font-weight: 800; }
.billing-price .bp-period { color: var(--muted); }
/* plan tiers: monthly / annual / lifetime — radio cards, selected one gets the accent ring */
.plan-choices { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 4px; }
.plan-choice { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer;
    border: 1px solid var(--border); border-radius: 12px; }
.plan-choice input { accent-color: var(--accent); }
.plan-choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.plan-choice .pc-body { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; flex: 1; }
.plan-choice .pc-name { font-weight: 700; }
.plan-choice .pc-price { font-weight: 700; }
.plan-choice .pc-price small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.plan-choice .pc-tag { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--accent);
    background: var(--bg); border-radius: 999px; padding: 1px 8px; }
/* admin sponsor inventory */
.sponsor-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.sponsor-form label { display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.sponsor-table { width: 100%; border-collapse: collapse; }
.sponsor-table td { padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.sponsor-table .sp-scope { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--muted);
    background: var(--bg); border-radius: 999px; padding: 1px 8px; }
.sponsor-table .sp-status { color: var(--muted); font-size: 12px; white-space: nowrap; }
.sponsor-table tr.sp-off { opacity: .55; }
.sponsor-table .sp-actions { text-align: right; white-space: nowrap; }
.sponsor-table .sp-actions .link-btn { margin-left: 10px; }
/* payment history + printable receipt */
.receipt-table { width: 100%; border-collapse: collapse; }
.receipt-table td { padding: 7px 6px; border-bottom: 1px solid var(--border); font-size: 13px; }
.receipt-table .rt-action { text-align: right; }
.receipt-card { max-width: 480px; }
.receipt-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px;
    padding-bottom: 10px; border-bottom: 2px solid var(--accent); }
.receipt-brand { font-weight: 800; font-size: 18px; }
.receipt-title { color: var(--muted); }
.receipt-detail { width: 100%; border-collapse: collapse; }
.receipt-detail th { text-align: left; color: var(--muted); font-weight: 600; padding: 7px 12px 7px 0; white-space: nowrap; vertical-align: top; }
.receipt-detail td { padding: 7px 0; word-break: break-all; }
.receipt-actions { display: flex; gap: 10px; margin-top: 14px; }
.premium-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.billing-methods { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 8px; }
.pay-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 100%;
    padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer;
    font-size: 15px; font-weight: 700; }
.pay-btn .pay-wallets { font-size: 11px; font-weight: 500; opacity: .8; }
.pay-card { background: var(--accent); color: #fff; border-color: var(--accent); }
.pay-paypal { background: #ffc439; color: #112; border-color: #e0a800; }
.pay-btn:hover { filter: brightness(1.05); }
.billing-secure { margin-top: 10px; }
.billing-demo { color: var(--danger); }

.ad-slot { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px dashed var(--border);
    border-radius: 8px; background: var(--bg); color: var(--muted); text-align: center; }
.ad-slot:hover { text-decoration: none; border-color: var(--accent); }
.ad-slot .ad-label { font-size: 9px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.ad-slot .ad-text { font-size: 11px; }
/* rotating ad: only one .ad-item is shown at a time (app.js cycles them) */
.ad-slot .ad-item { display: none; font-size: 11px; color: var(--muted); text-decoration: none; }
.ad-slot .ad-item.show { display: block; }
.ad-slot .ad-item:hover { color: var(--accent); }

/* ---------------- suggestions ---------------- */
.sidebar-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.sidebar-bottom .new-topic { margin-top: 0; }
.suggest-link { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px;
    font-size: 14px; font-weight: 700; color: var(--muted); }
.suggest-link:hover { background: var(--bg); text-decoration: none; }
.count-badge { margin-left: auto; min-width: 18px; text-align: center; font-size: 11px; font-weight: 700;
    background: var(--danger); color: #fff; border-radius: 999px; padding: 1px 6px; }
.new-topic textarea { width: 100%; }
.suggestion { display: flex; flex-direction: column; gap: 8px; }
.suggestion .sug-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.suggestion .sug-note { font-size: 13px; background: var(--bg); padding: 6px 10px; border-radius: 6px; }
.suggestion .sug-approve { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.suggestion .sug-approve label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }

/* ---------------- restricted topics / groups ---------------- */
.my-groups { margin: 4px 0 6px; }
.my-groups .mg-head { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); opacity: .65; padding: 8px 6px 2px; }
.my-groups .topic-link .lock, .grp-section .topic-link .lock { margin-left: auto; font-size: 11px; opacity: .7; }
/* Community hub: My Groups + public Groups (with their own cross-domain search) nested under Community. */
.grp-section { margin: 4px 0; }
.grp-section .grp-head { font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); opacity: .65; padding: 8px 6px 2px; }
.grp-search { width: 100%; margin: 2px 0 4px; padding: 5px 9px; }
/* Guests see Community pinned at the bottom of the tree, with a separating rule above it.
   Signed-in users get Community pinned in the sidebar-bottom instead (see below). */
.nav-tree .cat.community-cat { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
/* Play is the last item in the signed-in tree, under the separator; sized to match topic names. */
.nav-tree .play-nav { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; font-size: 14px; }
/* Signed-in: Community pinned at the bottom of the sidebar, just above the create forms. */
.sidebar-bottom .cat.community-cat { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 8px; }
.access-badge { font-size: 11px; font-weight: 600; background: rgba(255,255,255,.22); color: #fff;
    border-radius: 6px; padding: 2px 8px; }
.archived-badge { background: #8a6d1b; }   /* amber — stands out from the access badge */
.group-danger { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.leave-group { display: inline-flex; margin: 0; }
/* Leave = an icon-only twin of Follow/Unfollow: it inherits .follow-btn (white-on-header, theme-aware) */
.leave-btn { display: inline-flex; align-items: center; padding: 3px 7px; }
.leave-btn .icon { width: 15px; height: 15px; }
.group-danger .icon-btn { padding: 6px; }

/* ---- topic activity strip (followers · threads · posts · last active) ---- */
.topic-stats { display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
    margin: -6px 2px 14px; color: var(--muted); font-size: 12px; }
.topic-stats .stat { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.topic-stats .stat b { color: var(--text); font-weight: 700; }
.topic-stats .icon { width: 14px; height: 14px; color: var(--muted); }

/* ---- group info in the right rail (About + member roster, theme-aware) ---- */
.group-about { border-bottom: 1px solid var(--border); }
.group-about .about-summary { display: flex; align-items: center; gap: 6px; cursor: pointer;
    list-style: none; padding: 8px 12px; }
.group-about .about-summary::-webkit-details-marker { display: none; }
.group-about .about-summary .icon { width: 14px; height: 14px; }
.group-about .group-meta { list-style: none; margin: 0; padding: 0 12px 10px; display: flex;
    flex-direction: column; gap: 4px; font-size: 12px; }
.group-about .group-meta > li > span:first-child { color: var(--muted); margin-right: 4px; }
.member-since { font-variant-numeric: tabular-nums; }
/* manager's remove-member icon on a roster row (sits where "member since" would) */
.roster-remove { display: inline-flex; margin: 0; }
.online-user .roster-remove .icon-btn { padding: 2px; }
.online-user .roster-remove .icon { width: 15px; height: 15px; }
/* group management toggles: an icon next to the label instead of a bare word */
.icon-summary { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-size: 14px; }
.icon-summary .icon { width: 16px; height: 16px; color: var(--muted); flex: 0 0 auto; }
.members-only { background: var(--bg); border: 1px dashed var(--border); color: var(--muted);
    border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; font-size: 13px; }

/* premium badge in the sidebar identity row */
.role-badge.premium-badge { background: linear-gradient(90deg,#f6c453,#e0a417); color: #3a2c00;
    border-color: #e0a417; font-weight: 700; }

/* premium author flair (crown) next to a username on posts/comments */
.premium-flair { font-size: 12px; line-height: 1; margin-left: 1px; cursor: default;
    filter: saturate(1.1); }
/* "featured" podcast marker: a gold star badge + the pill toggle the owner uses to set it */
.featured-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 700;
    color: #b8860b; }
.pill-btn { font-size: 12px; font-weight: 600; border: 1px solid var(--border); border-radius: 999px;
    padding: 2px 10px; background: var(--bg); color: var(--muted); cursor: pointer; }
.pill-btn:hover { color: var(--text); }
.pill-btn.active { background: linear-gradient(90deg,#f6c453,#e0a417); color: #3a2c00; border-color: #e0a417; }
.pod-quota { margin-top: 2px; }
.pod-quota a { margin-left: 4px; }

/* ---------------- moderation ---------------- */
.icon-btn.danger.done { opacity: .5; }
.ban-tag { font-size: 12px; font-weight: 600; background: var(--danger); color: #fff;
    border-radius: 6px; padding: 1px 8px; }

/* per-league game title context */
.game-league { font-size: 14px; font-weight: 600; color: var(--muted); }

/* ---------------- mobile / responsive ---------------- */
/* the mobile "‹ Topics" back button only exists in the mobile master–detail view */
.mobile-back { display: none; }

@media (max-width: 760px) {
    /* mobile is now a single paradigm: the off-canvas drawer (see the ≤760 block above). The old
       master–detail full-width "Topics" sidebar was removed — it overlapped the burger + content. */
    .topic-content { max-width: 100%; }
    .presence .online { max-height: 150px; }     /* keep the Online rail compact on phones */
    .topic-header { padding: 10px 12px; }
    .topic-header h1 { font-size: 18px; }
    .comments { margin-left: 12px; padding-left: 10px; }
    .games-page { flex-direction: column; }
    .games-main, .games-side { overflow-x: auto; }
    .auth { padding: 12px; }
    .auth-layout { gap: 16px; }
    .profile .card { padding: 14px; }
}

/* ---------------- notifications ---------------- */
.me .bell { position: relative; text-decoration: none; line-height: 0; color: var(--muted); display: inline-flex; align-items: center; }
.me .bell:hover { color: var(--text); }
/* unread notification badge: a small blue circle that reads in both themes */
.me .bell .count-badge { position: absolute; top: -7px; right: -9px; margin: 0;
    min-width: 16px; height: 16px; line-height: 14px; padding: 0 4px; font-size: 10px;
    background: #2f6fed; color: #fff; border: 2px solid var(--panel); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 10px 12px; border-bottom: 1px solid var(--border); }
.notif-list li.unread { background: var(--bg); }
.notif-list li.unread .notif-text { font-weight: 600; }
.notif-list .notif-text { color: var(--text); }
.notif-list a.notif-text:hover { color: var(--accent); }
.notif-list time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---- activity feed (typed notifications) ---- */
.notif-filters { display: flex; gap: 6px; margin: 8px 0 4px; }
.notif-filters .chip { font: inherit; font-size: 12px; padding: 3px 12px; border-radius: 999px;
    border: 1px solid var(--border); background: transparent; color: var(--muted); cursor: pointer; }
.notif-filters .chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.notif-list.feed li { align-items: flex-start; }
.notif-ico { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; background: var(--bg); color: var(--muted);
    border: 1px solid var(--border); }
.notif-ico .icon { width: 16px; height: 16px; }
/* per-type accent so the feed scans at a glance */
.notif-ico.nt-reply  { color: #3a7ca5; }
.notif-ico.nt-mention{ color: #b85490; }
.notif-ico.nt-friend { color: #82b366; }
.notif-ico.nt-group  { color: #d79b00; }
.notif-ico.nt-share  { color: #6c8ebf; }
.notif-ico.nt-suggestion { color: #2e8b57; }
.notif-ico.nt-mod    { color: #c0392b; }
.notif-list.feed .notif-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-list.feed .notif-text { overflow-wrap: anywhere; }
.notif-list.feed .notif-time { color: var(--muted); font-size: 12px; }
.notif-empty { padding: 18px 4px; }

/* chat: message timestamp + "is typing…" indicator */
.chat-msg .chat-time { display: block; font-size: 10px; opacity: .6; margin-top: 2px; text-align: right; }
.chat-msg.out .chat-time { color: #fff; }
.chat-typing { padding: 2px 10px 4px; font-size: 11px; color: var(--muted); font-style: italic; }
/* chat: unread badge, minimize, delivery/read ticks, minimized state */
.chat-head .spacer { flex: 1; }
.chat-unread { background: #fff; color: var(--accent); font-size: 11px; font-weight: 700; min-width: 16px; height: 16px;
    border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; margin-left: 6px; }
.chat-unread[hidden] { display: none; }   /* the display rule above would otherwise beat the hidden attribute */
.chat-min { background: none; border: none; color: #fff; cursor: pointer; font-size: 15px; line-height: 1; padding: 0 4px; }
.chat-meta { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 2px; }
.chat-meta .chat-time { display: inline; margin: 0; }
.chat-status { font-size: 10px; opacity: .85; letter-spacing: -1px; }
.chat-msg.out .chat-status { color: #fff; }
.chat-box.min { height: auto; }
.chat-box.min .chat-msgs, .chat-box.min .chat-typing, .chat-box.min .chat-form,
.chat-box.min .chat-info { display: none; }   /* minimized = just the header bar (the About panel folds away too) */
.chat-box.min .chat-head { border-radius: 10px; cursor: pointer; }

/* group join requests + notifications header */
.members-only { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.members-only form { margin: 0; }
.join-requests { margin: 8px 0 12px; }
.join-requests .mod-list li { gap: 8px; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* moderation audit log */
.mod-log { list-style: none; margin: 0; padding: 0; }
.mod-log li { display: flex; gap: 8px; align-items: baseline; padding: 5px 0;
    border-bottom: 1px solid var(--border); font-size: 13px; flex-wrap: wrap; }
.mod-log .ml-action { font-weight: 700; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.mod-log .ml-target { font-weight: 600; }
.mod-log time { margin-left: auto; }

/* ---------------- admin taxonomy management ---------------- */
.tax-tree { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.tax-domain { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.tax-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.tax-row .tax-name { min-width: 0; }
.tax-name.dom { font-weight: 800; text-transform: uppercase; font-size: 12px; letter-spacing: .04em; }
.tax-cat { margin: 4px 0 4px 6px; }
.tax-name.cat { font-weight: 700; }
.tax-sub { margin-left: 16px; }
.tax-name.sub { font-weight: 600; color: var(--muted); }
.tax-row form { display: inline; }
.tax-topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px 28px; }
.tax-topic { display: inline-flex; align-items: center; gap: 4px; background: var(--bg);
    border: 1px solid var(--border); border-radius: 7px; padding: 2px 4px 2px 8px; font-size: 12.5px; }
.tax-topic form { display: inline; }
.tax-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; line-height: 1; padding: 0 2px; }
.tax-x:hover { color: var(--danger); }
.tax-x.add { color: var(--accent); }
.tax-x.add:hover { color: var(--accent); filter: brightness(1.2); }

/* inline add-forms in the taxonomy tree */
.tax-add { display: inline-flex; align-items: center; gap: 6px; }
.tax-add input[type=text] { font-size: 12.5px; padding: 3px 7px; border: 1px solid var(--border);
    border-radius: 7px; background: var(--bg); color: var(--text); }
.tax-add-cat { margin: 4px 0 10px; }
.tax-add-sub { margin: 2px 0 6px 16px; }
.tax-add-topic { display: inline-flex; }
.tax-add-topic input[type=text] { width: 130px; }

/* ---------------- admin dashboard ---------------- */
.admin-dash h2 { font-size: 16px; margin: 24px 0 10px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; margin: 14px 0; }
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.stat-n { font-size: 26px; font-weight: 800; line-height: 1; }
.stat-n.danger { color: var(--danger); }
.stat-l { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* profile: data export button + account-deletion danger zone */
.btn-link { display: inline-block; padding: 8px 14px; border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 13px; }
.btn-link:hover { background: var(--bg); text-decoration: none; }
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }
button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button.danger:hover { filter: brightness(1.08); }
.stat-sub { font-size: 11px; color: var(--accent); margin-top: 4px; }
.admin-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-tools .cta-secondary { display: inline-flex; align-items: center; gap: 8px; }
.admin-users { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.admin-users th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--border); }
.admin-users td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-users td.num, .admin-users th.num { text-align: right; }
.admin-users .avatar.small { margin-right: 6px; vertical-align: middle; }
.admin-users .tag.prem { font-size: 9px; font-weight: 700; background: var(--accent); color: #fff; border-radius: 5px; padding: 1px 5px; margin-left: 4px; }

/* ---------------- friends management (profile) ---------------- */
/* find-a-friend search box + results in the profile Friends card */
.friend-search { width: 100%; margin: 4px 0 6px; padding: 9px 11px; border: 1px solid var(--border);
    border-radius: 10px; background: var(--panel); color: var(--text); font-size: 16px; }
.friend-search:focus { outline: none; border-color: var(--accent); }
.friend-search-results:not(:empty) { margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.friend-add-btn { font-weight: 600; color: var(--accent); }
.friend-add-btn[disabled] { color: var(--muted); cursor: default; }
.friends-list { display: flex; flex-direction: column; gap: 2px; }
.friend-row { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.friend-row .friend-name { font-weight: 600; }
.friend-row .tag.mutual { font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--accent); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; }
.friend-row .user-actions { display: inline-flex; gap: 2px; }
.friend-row .user-actions .icon { width: 17px; height: 17px; }

/* ---------------- tier lists ---------------- */
.tier-page { max-width: 880px; margin: 0 auto; padding: 8px 4px 48px; }
.tier-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.tier-head h1 { margin: 0; }
.new-tier { margin: 14px 0; }
.tier-create { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tier-create input[name=name] { flex: 1 1 200px; }
.tier-create select { flex: 1 1 240px; }
.tier-index { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tier-index li { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--border); }
.tier-index-name { font-weight: 600; text-decoration: none; }

.tier-actions { display: flex; gap: 8px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
#tier-shot-area { background: var(--panel); padding: 10px; border-radius: 12px; }

/* ---------------- tactics board ---------------- */
.tac-toolbar { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin: 12px 0 6px;
    padding: 8px 10px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; }
.tac-group { display: flex; gap: 6px; align-items: center; }
.tac-group + .tac-group { border-left: 1px solid var(--border); padding-left: 14px; }
.tac-tool, .tac-del, .tac-undo, .tac-clear, .tac-add-tok { background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; padding: 5px 9px; cursor: pointer; color: var(--text); font-size: 14px; line-height: 1; }
.tac-tool { min-width: 32px; font-size: 16px; }
.tac-tool.on { border-color: var(--accent); background: var(--accent); color: #fff; }
.tac-add-tok { font-weight: 600; font-size: 12.5px; }
.tac-add-tok.home { border-left: 3px solid #e23b3b; }
.tac-add-tok.away { border-left: 3px solid #2f6fdb; }
.tac-colors .tac-color { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); cursor: pointer; padding: 0; }
.tac-colors .tac-color.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.tac-size-group { gap: 8px; }
.tac-size-ico { color: var(--muted); font-size: 15px; }
.tac-size { width: 110px; cursor: ew-resize; }
.tac-actions { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
#tac-shot-area { display: block; width: max-content; max-width: 100%; background: var(--panel); padding: 10px; border-radius: 12px; }
.tac-board { width: 420px; max-width: 100%; aspect-ratio: 100 / 130; margin: 0 auto;
    border-radius: 8px; overflow: hidden; touch-action: none; }
.tac-svg { width: 100%; height: 100%; display: block; }
.tac-svg .tac-hit { cursor: pointer; }
.tac-svg .tac-token { cursor: grab; }
.tac-editor .tac-board { cursor: crosshair; }

/* phones: board fills the column, slider hidden, bigger tap targets, no group dividers */
@media (max-width: 760px) {
    #tac-shot-area { width: 100%; padding: 6px; }
    .tac-board { width: 100% !important; }
    .tac-size-group { display: none; }
    .tac-toolbar { gap: 8px; padding: 8px; }
    .tac-group { flex-wrap: wrap; gap: 8px; }
    .tac-group + .tac-group { border-left: 0; padding-left: 0; }
    .tac-tool, .tac-del, .tac-undo, .tac-clear, .tac-add-tok { padding: 9px 13px; font-size: 15px; }
    .tac-tool { min-width: 42px; }
    .tac-colors .tac-color { width: 30px; height: 30px; }
    .tac-actions { gap: 6px; }
    .tac-actions button { flex: 1 1 auto; padding: 11px; }
}
.tier-shot-title { font-weight: 800; font-size: 18px; padding: 4px 6px 10px; }

.tier-board { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--border);
    border-radius: 10px; overflow: hidden; }
.tier-row { display: flex; align-items: stretch; min-height: 60px; background: var(--bg); }
.tier-label { width: 58px; flex: 0 0 58px; display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 20px; color: #1a1a1a; }
.tier-S .tier-label { background: #ff7f7f; }
.tier-A .tier-label { background: #ffbf7f; }
.tier-B .tier-label { background: #ffdf7f; }
.tier-C .tier-label { background: #ffff7f; }
.tier-D .tier-label { background: #bfff7f; }
.tier-E .tier-label { background: #7fff7f; }
.tier-dropzone { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; align-content: flex-start; min-width: 0; }
.tier-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel);
    border: 1px solid var(--border); border-radius: 8px; padding: 5px 10px; font-size: 13px;
    cursor: grab; user-select: none; max-width: 100%; }
.tier-chip span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier-chip.dragging { opacity: .45; }
/* tap-to-place (touch): a picked chip is outlined; rows show a dashed drop cue while one is held */
.tier-chip { cursor: pointer; touch-action: manipulation; }
.tier-chip.picked { outline: 2px solid var(--accent); outline-offset: 1px; }
.tier-editor.has-pick .tier-dropzone { outline: 1px dashed var(--accent); outline-offset: -3px; }
.tier-pool-wrap { margin-top: 16px; }
.tier-pool { border: 1px dashed var(--border); border-radius: 10px; min-height: 56px; }
.tier-add { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.tier-add .tier-add-input { flex: 1; max-width: 280px; }
.tier-add .tier-add-link { flex: 1; min-width: 160px; max-width: 280px; }
/* a custom chip carrying a link becomes clickable in the view */
.tier-chip a { color: inherit; text-decoration: none; }
.tier-chip-link { text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px; }
.tier-chip-link:hover { text-decoration-style: solid; }

/* tier-list conversation */
.tier-comments { margin-top: 28px; }
.tier-comments h2 { font-size: 17px; }
.tl-comments { display: flex; flex-direction: column; gap: 12px; margin: 12px 0 16px; }
.tl-comment { display: flex; gap: 10px; }
.tl-comment .tl-comment-body { flex: 1; min-width: 0; }
.tl-comment-head { display: flex; gap: 8px; align-items: baseline; }
.tl-comment-head .username { font-weight: 600; font-size: 13px; }
.tl-comment-head time { font-size: 11px; color: var(--muted); }
.tl-comment .body { font-size: 14px; }
.tl-comment-form { margin-top: 8px; }
.tl-comment-form button[type=submit] { margin-top: 8px; }

/* "More" menu (premium extras) */
/* ---------------- report reason menu ---------------- */
.report-menu { position: absolute; z-index: 70; background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.25); padding: 6px; min-width: 180px;
    display: flex; flex-direction: column; gap: 2px; }
/* the `display:flex` above overrides the `hidden` attribute — restore it so close() actually hides the menu */
.report-menu[hidden] { display: none; }
.report-menu .rm-head { font-size: 11px; color: var(--muted); padding: 4px 8px; }
.report-menu button { text-align: left; background: none; border: none; padding: 7px 8px; border-radius: 7px;
    cursor: pointer; font-size: 13px; color: var(--text); }
.report-menu button:hover { background: var(--bg); }
.report-menu .rm-major { color: var(--danger); font-weight: 600; }

/* ---------------- Play hub (fun features: tier lists + games) ---------------- */
.play-link .play-ico { font-size: 14px; }
.play-page { max-width: 760px; margin: 0 auto; padding: 8px 4px 44px; }
.play-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin: 16px 0; }
.play-card-h { display: flex; align-items: center; gap: 10px; }
.play-card-h h2 { margin: 0; font-size: 18px; }
.play-card .play-ico { font-size: 22px; }

/* ---------------- favorites hub ---------------- */
.fav-page { max-width: 760px; margin: 0 auto; padding: 8px 4px 44px; }
.fav-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin: 16px 0; }
.fav-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fav-card-h h2 { margin: 0; font-size: 18px; }
.fav-ico { font-size: 20px; }

/* saved items (bookmarked collections/podcasts/tier lists/tactics) */
.saved-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.saved-item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.saved-ico { flex: 0 0 auto; display: inline-flex; color: var(--muted); }
.saved-ico .icon { width: 16px; height: 16px; }
.saved-name { color: var(--text); font-weight: 600; text-decoration: none; }
.saved-name:hover { color: var(--accent); }
.saved-kind { margin-left: auto; }
/* the star bookmark toggle on an item's page; filled gold when saved */
.fav-toggle-form { display: inline; }
.fav-toggle.active { color: #e0a800; }
.fav-toggle.active .icon { fill: #e0a800; }
/* search + sort toolbar above the liked feed */
.fav-tools { display: flex; gap: 8px; align-items: center; margin: 4px 0 2px; }
.fav-search { flex: 1 1 auto; min-width: 0; padding: 7px 10px; border: 1px solid var(--border);
    border-radius: 8px; background: var(--bg); color: var(--text); font-size: 13px; }
.fav-search:focus { outline: none; border-color: var(--accent); }
.fav-sort { flex: 0 0 auto; padding: 7px 8px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text); font-size: 13px; }
.fav-nomatch { margin: 10px 2px 0; }
.liked-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liked-link { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: 10px; text-decoration: none; color: var(--text); background: var(--bg); }
.liked-link:hover { border-color: var(--accent); text-decoration: none; }
.liked-head { display: flex; align-items: center; gap: 7px; }
.liked-head .avatar.sm { width: 20px; height: 20px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 700; }
.liked-author { font-weight: 600; font-size: 13px; }
.liked-kind { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
    border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; }
.liked-body { font-size: 13px; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.liked-topic { align-self: flex-start; font-size: 11.5px; color: var(--muted);
    border: 1px solid var(--border); border-left-width: 3px; border-radius: 6px; padding: 1px 7px; }
.liked-likes { font-size: 12px; color: var(--muted); }

/* "all posts of a user" page */
.user-page { max-width: 760px; margin: 0 auto; padding: 8px 4px 44px; }
.user-hero { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; }
.avatar.lg { width: 56px; height: 56px; font-size: 24px; }
.user-hero-meta h1 { margin: 0; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.user-hero-meta p { margin: 2px 0 0; }
.user-posts .liked-author { font-size: 13.5px; }
.user-empty { list-style: none; padding: 24px 4px; text-align: center; }

.play-actions { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.play-games { margin-top: 8px; }
.play-cat { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 12px 0 2px; }
.play-league { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1px solid var(--border); }
.play-league .pl-name { font-weight: 600; }
.play-league .game-link { font-size: 13px; text-decoration: none; color: var(--accent); white-space: nowrap; }
.play-league .game-link:hover { text-decoration: underline; }
.play-league .game-icon { font-size: 18px; line-height: 1; padding: 2px 4px; border-radius: 7px; }
.play-league .game-icon:hover { background: var(--bg); text-decoration: none; }
.play-legend { margin: 2px 0 6px; }
.game-type { cursor: help; }

/* ---------------- guest (read-only) sign-in CTAs ---------------- */
.me.guest { gap: 10px; }
.me.guest .guest-signin { font-weight: 600; text-decoration: none; color: var(--accent); }
.me.guest .guest-register { font-size: 12px; text-decoration: none; color: var(--muted);
    border: 1px solid var(--border); border-radius: 8px; padding: 3px 10px; }
.me.guest .guest-register:hover { color: var(--text); border-color: var(--accent); }

.empty.guest-welcome { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 36px; text-align: left; }
.empty.guest-welcome .auth-agenda { width: 520px; }
.guest-welcome .guest-cta { display: flex; gap: 10px; margin-top: 0; flex-wrap: wrap; justify-content: center; }
.cta-primary { text-decoration: none; background: var(--accent); color: #fff;
    border-radius: 10px; padding: 9px 18px; font-weight: 600; }
.cta-primary:hover { filter: brightness(1.08); }
.cta-secondary { text-decoration: none; color: var(--accent); border: 1px solid var(--border);
    border-radius: 10px; padding: 9px 18px; font-weight: 600; }
.cta-secondary:hover { border-color: var(--accent); }

.guest-join { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 16px; margin: 8px 0 14px; color: var(--muted); }
.guest-join .cta-primary, .guest-join .cta-secondary { padding: 7px 14px; }
.guest-join .cta-secondary { margin-left: auto; }

/* Home domain picker (landing) */
.landing-card { width: 460px; }
/* the card is the positioning context for the floating Back button (below) */
.auth-card.landing-card { position: relative; }
/* Create account + Sign in stacked & full-width, each centred (matches the sign-in card) */
.landing-card .guest-cta { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 4px; }
.landing-card .guest-cta .cta-primary, .landing-card .guest-cta .cta-secondary { text-align: center; }

/* In-page sign-in: the home card swaps between the CTA buttons and the login form (no navigation). */
.guest-auth .guest-login { display: none; }
.guest-auth.show-login .guest-cta { display: none; }
.guest-auth.show-login .guest-login { display: block; margin: 14px 0 4px; }
.guest-login .inline-login { display: flex; flex-direction: column; gap: 8px; }
.guest-login .inline-login label { display: flex; flex-direction: column; gap: 3px; text-align: left; font-size: 13px; }
.guest-login .inline-login input { width: 100%; padding: 8px 10px; border: 1px solid var(--border);
    border-radius: 8px; background: var(--bg); color: var(--text); }
.guest-login .inline-login button[type=submit] { background: var(--accent); color: #fff; border: none;
    border-radius: 10px; padding: 9px 18px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.guest-login .muted { text-align: center; margin: 8px 0 0; }
/* the "Sign in" trigger + "Back" are <button>s styled like the original links */
button.cta-secondary { background: none; font: inherit; cursor: pointer; }
.linklike { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; padding: 0; }
/* the login view's Back is now an icon-only button at the top-left of the card */
/* Back sits in the empty top-left corner of the card (the brand row is centre-aligned), so it doesn't
   take a row of its own above the form */
/* Back sits just left of the theme toggle (top-right); the brand logo packs to the left, so the old
   top-left corner overlapped it. Absolute against the card (.landing-card is position:relative). */
.guest-login .auth-back { position: absolute; top: 24px; right: 56px; left: auto; margin: 0; z-index: 2; color: var(--muted); }
.guest-login .auth-back:hover { color: var(--accent); }
/* logged-in home: greeting + a Log out button, side by side */
.landing-greeting { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 4px; flex-wrap: wrap; }
.landing-greeting p { margin: 0; }
.landing-logout { margin: 0; }
.landing-logout button { padding: 7px 16px; }

/* group "About" panel: meta list + a read-only, scrollable, searchable member peek */
.group-info .group-meta { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.group-info .group-meta > li > span:first-child { color: var(--muted); }
.member-list.peek { max-height: 220px; overflow-y: auto; }
.member-list.peek li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.landing-greeting { text-align: center; margin: 10px 0 4px; }
.domains-head { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; opacity: .6;
    margin: 18px 0 10px; text-align: center; }
.domain-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.domain-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
    text-decoration: none; color: var(--text); background: var(--bg);
    border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
    transition: border-color .12s, transform .12s; }
.domain-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.domain-emoji { font-size: 22px; line-height: 1; }
.domain-name { font-weight: 700; font-size: 15px; }
.domain-meta { font-size: 12px; color: var(--muted); }
.domain-back { margin: 0 0 6px; }
.domain-back a { color: var(--muted); text-decoration: none; font-size: 13px; }
.domain-back a:hover { color: var(--accent); }
@media (max-width: 540px) { .domain-grid { grid-template-columns: 1fr; } .landing-card { width: 320px; } }

/* Landing: "Why TalkScrolls" agenda sits to the RIGHT of the card on desktop; stacks on mobile */
/* two equal columns (same width AND height) on desktop; stack on mobile */
.landing .auth-layout { max-width: 1000px; align-items: stretch; flex-wrap: nowrap; gap: 28px; }
.landing .auth-card.landing-card { flex: 1 1 0; width: auto; }
.landing .auth-agenda { flex: 1 1 0; width: auto; max-width: none; }
@media (max-width: 860px) {
    .landing .auth-layout { flex-wrap: wrap; }
    .landing .auth-card.landing-card, .landing .auth-agenda { flex-basis: 100%; width: 100%; max-width: 100%; }
}

/* brand name links home */
.brand-home { color: inherit; text-decoration: none; }
.brand-home:hover { color: var(--accent); }

/* group members/owners panel: clickable avatar rows, scrollable, with a filter for big groups */
.member-filter { width: 100%; margin: 8px 0 6px; }
.member-list { max-height: 264px; overflow-y: auto; }
.mod-list li { display: flex; align-items: center; gap: 8px; }
.mod-list .mod-name { text-decoration: none; color: var(--text); }
.mod-list a.mod-name:hover { color: var(--accent); text-decoration: underline; }
.mod-list .spacer { flex: 1; }
.icon-btn.ok { color: #2e9e4f; }

/* moderation: blocked-user rows — bigger, clickable name + consistent action buttons */
.blocked-row .mod-name { font-size: 15px; font-weight: 600; color: var(--text); text-decoration: none; }
.blocked-row a.mod-name:hover { color: var(--accent); text-decoration: underline; }
.blocked-row .sug-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.link-btn.ok { color: #2e9e4f; }

/* edit-group form: even spacing + a separated danger zone */
.topic-edit > form { display: flex; flex-direction: column; gap: 11px; margin: 10px 0 4px; }
.topic-edit > form > label { display: flex; flex-direction: column; gap: 4px; margin: 0; font-size: 13px; }
.topic-edit > form > label.colors { flex-direction: row; align-items: center; gap: 8px; }
.topic-edit .group-danger { display: flex; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* 'Beta' badge next to the brand name */
.beta-tag { display: inline-block; font-size: 10px; font-weight: 800; text-transform: uppercase;
    letter-spacing: .05em; background: var(--accent); color: #fff; border-radius: 6px;
    padding: 1px 6px; margin-left: 6px; vertical-align: middle; }

/* breathing room between the sign-in / sign-up buttons and the domain grid */
.landing .domain-grid { margin-top: 24px; }

/* moderation: block-a-user form */
.mod-block-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
    background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
.mod-block-form input[name=username] { flex: 1 1 160px; min-width: 140px; }

/* admin: global-moderator roster */
.mod-roster { list-style: none; margin: 10px 0 4px; padding: 0; max-width: 460px; }
.mod-roster li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.mod-roster .spacer { flex: 1; }

/* ---------------- collections (per-domain personal libraries) ---------------- */
.coll-page, .coll-view { max-width: 760px; margin: 0 auto; padding: 8px 4px 44px; }
.coll-head h1 { margin: 0 0 2px; }
.coll-back { display: inline-flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.coll-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 16px 0; }
.coll-card h2 { margin: 0 0 10px; font-size: 16px; }
.coll-new-form, .coll-item-form { display: flex; flex-direction: column; gap: 8px; }
.coll-new-form input, .coll-item-form input, .coll-item-form textarea, .coll-item-form select,
.coll-pick-form input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
    background: var(--bg); color: var(--text); font-size: 14px; }
.coll-item-row { display: flex; gap: 8px; }
.coll-item-row > * { flex: 1 1 0; min-width: 0; }
.coll-new-form button, .coll-item-form button { align-self: flex-start; }
.coll-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.coll-card-link { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border);
    border-radius: 10px; text-decoration: none; color: var(--text); background: var(--bg); }
.coll-card-link:hover { border-color: var(--accent); text-decoration: none; }
.coll-name { font-weight: 600; }
.coll-vis { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.coll-items { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.coll-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.ci-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ci-title { font-weight: 600; }
.ci-rating { color: #e0a82e; letter-spacing: 1px; }
.ci-tag { font-size: 11px; font-weight: 600; color: var(--accent); border: 1px solid var(--border);
    border-radius: 999px; padding: 1px 8px; }
.ci-note { margin: 6px 0 0; color: var(--text); white-space: pre-wrap; }
.ci-link { display: inline-block; margin-top: 5px; font-size: 12px; color: var(--accent);
    overflow: hidden; text-overflow: ellipsis; max-width: 100%; white-space: nowrap; }
.ci-del { margin-left: auto; }
.coll-vis-form { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.coll-vis-form label { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.coll-vis-form button { margin-top: 4px; }
.coll-pick-form { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.coll-pick-form input { flex: 1 1 auto; min-width: 0; }
.coll-shared { margin-top: 10px; }
.coll-discussion { margin-top: 20px; }
.coll-discussion h2 { font-size: 16px; margin: 0 0 10px; }

/* ---------------- Science rich text (KaTeX formulas + plots) ---------------- */
/* Math is rendered by KaTeX (vendored). Our wrappers just control block vs inline flow and
   error styling; KaTeX's own CSS supplies the fonts and glyph layout. */
.math-block { display: block; margin: 10px 0; }
.math-err { color: var(--danger, #c0392b); font-family: monospace; }
.sci-plot { margin: 12px 0; border: 1px solid var(--border); border-radius: 10px; padding: 8px;
    background: var(--bg); max-width: 460px; }
.sci-plot svg { display: block; width: 100%; height: auto; }
.sci-plot figcaption { font-size: 12px; color: var(--muted); margin-top: 4px; text-align: center;
    font-family: "Cambria Math", Georgia, serif; }
.sci-plot .sp-range { opacity: .8; }
.sp-frame { fill: none; stroke: var(--border); }
.sp-axis { stroke: var(--border); stroke-width: 1; }
.sp-curve { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.sci-hint { margin: 6px 2px 0; }

/* ---------------- podcasts (reuses .coll-* layout) ---------------- */
.pod-episode .ci-head { gap: 8px; }
.pod-audio { width: 100%; margin-top: 8px; height: 36px; }

/* ---------------- guest call-to-action (browse freely; register to write) ---------------- */
.guest-cta { border: 1px dashed var(--border); border-radius: 12px; padding: 14px 16px; margin: 14px 0;
    background: var(--panel); display: flex; flex-direction: column; gap: 10px; }
.guest-cta-msg { margin: 0; color: var(--text); }
.guest-cta-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------------- collections/podcasts polish (cover, reorder, edit) ---------------- */
.coll-cover { display: block; max-width: 100%; max-height: 240px; border-radius: 12px; margin: 4px 0 10px; object-fit: cover; }
.coll-cover-form { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.coll-cover-form input[type=file] { font-size: 12px; }
.ci-ctrls { display: inline-flex; align-items: center; gap: 2px; }
.ci-ctrls form { display: inline; }
.ci-ctrls .icon-btn { padding: 3px 5px; font-size: 12px; line-height: 1; }
.ci-edit { margin-top: 8px; }
.ci-edit > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.ci-edit > summary:hover { color: var(--text); }
.ci-edit .coll-item-form { margin-top: 8px; }
.ci-dur { margin-left: 8px; }
.tier-public { margin-top: 22px; }

/* ---- abuse / legal report form + admin triage queue ---- */
.report-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; margin-top: 14px; }
.report-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.report-form label > span { color: var(--muted); }
.report-form button[type=submit] { align-self: flex-start; }
.report-note { margin-top: 16px; max-width: 600px; }
.abuse-filter { display: flex; gap: 14px; margin: 12px 0 16px; font-size: 13px; flex-wrap: wrap; }
.abuse-filter a { color: var(--muted); text-decoration: none; padding-bottom: 2px; }
.abuse-filter a.active { color: var(--text); font-weight: 700; border-bottom: 2px solid var(--accent); }
.abuse-report { margin-bottom: 12px; }
.ar-head { display: flex; align-items: center; gap: 8px; }
.ar-cat { font-weight: 800; font-size: 11px; letter-spacing: .04em; }
.ar-details { white-space: pre-wrap; margin: 8px 0; }
.ar-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.ar-actions input[name=resolution] { flex: 1; min-width: 200px; }

/* private-league fantasy game launch icons reuse the shared .game-icon style (🎮 Manager / 🎯 Predict) */
.sd-play-row { display: flex; gap: 10px; align-items: center; margin: 6px 0; }

/* "What is this?" help disclosure shown at the top of feature pages (Predict/Manager/Leagues/
   Collections/Podcasts/Tier lists/Tactics). Collapsed by default; click the info pill to expand. */
.page-help { margin: 0 0 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.page-help-sum { display: flex; align-items: center; gap: 7px; cursor: pointer; padding: 8px 12px;
    font-size: 13px; font-weight: 600; color: var(--muted); list-style: none; -webkit-user-select: none; user-select: none; }
.page-help-sum::-webkit-details-marker { display: none; }
.page-help-sum::marker { content: ""; }
.page-help-sum .icon { width: 16px; height: 16px; flex: none; color: var(--accent); }
.page-help[open] .page-help-sum { color: var(--text); border-bottom: 1px solid var(--border); }
.page-help-body { padding: 11px 14px 13px; font-size: 13.5px; line-height: 1.55; color: var(--text); }
.page-help-body strong { font-weight: 600; }

/* @mention autocomplete menu */
.mention-menu { position: absolute; z-index: 3000; background: var(--bg); border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); overflow: hidden; max-height: 220px; overflow-y: auto; }
.mention-item { padding: 6px 12px; font-size: 14px; cursor: pointer; white-space: nowrap; }
.mention-item.on, .mention-item:hover { background: var(--accent); color: #fff; }

/* chat "about" info affordance */
/* sits in the accent-coloured chat header, so it matches the — and ✕ buttons (plain white) */
.chat-info-btn { background: none; border: none; color: #fff; cursor: pointer; line-height: 1;
    padding: 0 4px; display: inline-flex; align-items: center; opacity: .9; }
.chat-info-btn:hover { opacity: 1; }
.chat-info-btn svg { width: 15px; height: 15px; }
.chat-info { padding: 8px 12px; font-size: 12.5px; line-height: 1.5; color: var(--muted);
    background: rgba(127,127,127,.08); border-bottom: 1px solid var(--border); }

/* global search page */
.search-page-form { display: flex; gap: 8px; margin: 10px 0 18px; width: 100%; }
.search-page-form input { flex: 1 1 auto; min-width: 0; padding: 11px 14px; font-size: 16px;
    border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); }
.search-page-form input:focus { outline: none; border-color: var(--accent); }
.search-page-form .search-go { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 46px; border: none; border-radius: 10px; background: var(--accent); color: #fff; cursor: pointer; }
.search-page-form .search-go .icon { width: 20px; height: 20px; }
.search-page-form .search-go:hover { filter: brightness(1.08); }
.search-results { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.search-hit a { display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; }
.search-hit a:hover { border-color: var(--accent); }
.search-hit-snip { display: block; color: var(--text); }
.search-hit-meta { display: block; margin-top: 4px; }

/* public profile enrichment */
.user-stats { margin: 2px 0; }
.user-about { margin: 8px 0 0; color: var(--text); max-width: 60ch; white-space: pre-wrap; }
.user-actions { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.user-actions .chat-open { width: auto; padding: 0 10px; gap: 6px; }
.user-content { margin: 22px 0; }
.user-content h2, .user-posts-h { font-size: 15px; margin: 0 0 8px; }
/* profile sections: a styled heading with an accent underline, less plain than a bare h2 */
.user-section { margin: 22px 0; }
.user-section-h { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
    color: var(--muted); margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--border);
    display: flex; align-items: center; gap: 8px; }
.user-section-h::before { content: ""; width: 4px; height: 14px; border-radius: 2px; background: var(--accent); }
.user-section .tier-index { margin-top: 0; }

/* whole-app search: grouped sections + domain badge on results */
.search-section { margin: 18px 0; }
.search-section-h { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
    margin: 0 0 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.search-hit-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.search-domain { font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--accent); color: #fff; }

/* ---- Flashcards / study decks (cs92) ---- */
.deck-progress { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin: 8px 0; }
.deck-progress-bar { height: 100%; background: var(--accent); transition: width .2s ease; }
.deck-flashcard {
    min-height: 220px; border: 1px solid var(--border); border-radius: 14px; background: var(--panel);
    padding: 28px 24px; margin: 14px 0; display: flex; flex-direction: column; gap: 14px;
    align-items: center; justify-content: center; text-align: center; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.dc-face { font-size: 20px; line-height: 1.5; max-width: 640px; }
.dc-front-face { font-weight: 600; }
.dc-back-face { color: var(--accent); }
.dc-divider { width: 60%; border-top: 1px dashed var(--border); }
.dc-hint-line { color: var(--muted); font-size: 14px; font-style: italic; }
.deck-study-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: center; margin-top: 6px; }
.deck-rate { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.deck-hint-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    background: var(--panel); color: var(--muted); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.deck-hint-btn:hover { border-color: var(--accent); color: var(--accent); }
.deck-rate-btn { border: none; border-radius: 8px; padding: 9px 16px; font-size: 15px; font-weight: 600;
    color: #fff; cursor: pointer; }
.deck-rate-btn:hover { filter: brightness(1.08); }
.deck-rate-btn.r-again { background: #c0392b; }
.deck-rate-btn.r-hard  { background: #e67e22; }
.deck-rate-btn.r-good  { background: #2980b9; }
.deck-rate-btn.r-easy  { background: #27ae60; }

/* ---- "schedules coming" notice on Manager/Predict (2026-07-10) ---- */
.games-notice {
    display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
    background: color-mix(in srgb, var(--accent) 10%, var(--panel));
    border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
    border-radius: 10px; padding: 10px 14px; margin: 10px 0 14px; font-size: 14px; line-height: 1.5; }
.games-notice strong { color: var(--text); }

/* ---- public Groups directory (/groups) ---- */
.groups-dir-head h1 { margin-bottom: 4px; }
.groups-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 6px; }
.groups-sorts { display: inline-flex; gap: 6px; }
.groups-sorts .chip { padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px;
    color: var(--muted); text-decoration: none; font-size: .9rem; }
.groups-sorts .chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.groups-search { min-width: 160px; }
.groups-count { margin: 2px 0 12px; }
.groups-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.group-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
    text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.group-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.group-chip { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 10px; color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; }
.group-card-body { min-width: 0; }
.group-card-title { font-weight: 600; }
.group-card-desc { color: var(--muted); font-size: .9rem; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.group-card-meta { color: var(--muted); font-size: .8rem; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }
.group-blurb { color: var(--muted); font-size: .9rem; margin: 2px 0 8px; }
.grp-browse-all { display: block; margin-top: 6px; font-size: .85rem; color: var(--accent); text-decoration: none; }
.grp-browse-all:hover { text-decoration: underline; }

/* ---- admin dashboard: trends + activity feed ---- */
.dash-trends { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 14px 0 8px; }
.trend-card { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 12px 14px; }
.trend-h { color: var(--muted); font-size: .82rem; }
.trend-sub { opacity: .7; }
.trend-n { font-size: 1.7rem; font-weight: 700; display: flex; align-items: baseline; gap: 8px; margin-top: 2px; }
.trend-delta { font-size: .8rem; font-weight: 600; }
.trend-delta.up { color: #1a9d54; }
.trend-delta.down { color: #c2413a; }
.trend-prev { color: var(--muted); font-size: .78rem; margin-top: 2px; }
.spark-card .spark { display: flex; align-items: flex-end; gap: 3px; height: 46px; margin-top: 8px; }
.spark-bar { flex: 1 1 auto; min-height: 2px; background: var(--accent); border-radius: 2px 2px 0 0; opacity: .8; }
.dash-activity { list-style: none; padding: 0; margin: 6px 0 8px; display: flex; flex-direction: column; }
.dash-activity li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.dash-activity .act-body { flex: 1 1 auto; min-width: 0; }
.dash-activity .act-line { display: flex; flex-wrap: wrap; gap: 5px; align-items: baseline; }
.dash-activity .act-snippet { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; }
.dash-activity .act-time { flex: 0 0 auto; white-space: nowrap; }

/* staff delete affordance on Groups directory cards */
.group-card-wrap { position: relative; display: flex; }
.group-card-wrap .group-card { flex: 1 1 auto; }
.group-del { position: absolute; top: 8px; right: 8px; margin: 0; }
.group-del .icon-btn { background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
    width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; opacity: .55; }
.group-card-wrap:hover .group-del .icon-btn { opacity: 1; }

/* Groups directory: scope toggle + private badge */
.groups-scope { display: inline-flex; gap: 6px; margin-top: 10px; }
.grp-priv { font-size: .72rem; color: var(--muted); border: 1px solid var(--border); border-radius: 999px;
    padding: 1px 7px; margin-left: 6px; white-space: nowrap; }

/* ===== Chalkboard (Beta) ===== */
.chalk-editor .tier-head h1,
.chalk-viewer .tier-head h1,
.chalk-slide-ind {
    font-family: "Chalkboard SE", "Bradley Hand", "Comic Sans MS", "Segoe Print", cursive;
}
.chalk-board {
    width: 100%;
    max-width: 760px;
    margin: .5rem 0;
    border: 10px solid #6b4b2b;                 /* wooden frame */
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,.35), inset 0 0 40px rgba(0,0,0,.4);
    background: #26302b;
    overflow: hidden;
    touch-action: none;                          /* draw without scrolling the page */
}
.chalk-svg { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.chalk-board.readonly .chalk-svg { cursor: default; }
.chalk-stroke { filter: drop-shadow(0 0 .3px rgba(255,255,255,.25)); }  /* faint chalk dustiness */

.chalk-toolbar {
    display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
    margin: .5rem 0; padding: .5rem .6rem;
    background: var(--panel, #f4f4f4); border-radius: 8px;
}
.chalk-group { display: flex; gap: .35rem; align-items: center; padding-right: .6rem; border-right: 1px solid var(--border, #ddd); }
.chalk-group:last-child { border-right: 0; }
.chalk-toolbar button {
    min-width: 34px; height: 34px; padding: 0 .5rem;
    border: 1px solid var(--border, #ccc); border-radius: 6px;
    background: var(--bg, #fff); cursor: pointer; font-size: 1rem; line-height: 1;
}
.chalk-toolbar button:hover { background: var(--hover, #eee); }
.chalk-toolbar button.on { outline: 2px solid var(--accent, #3a7ca5); outline-offset: 1px; }
.chalk-colors .chalk-color {
    width: 30px; height: 30px; border-radius: 50%; padding: 0;
    background: var(--c); border: 2px solid rgba(0,0,0,.25);
}
.chalk-color.on { outline: 3px solid var(--accent, #3a7ca5); outline-offset: 2px; }
.chalk-slide-ind { min-width: 3.5rem; text-align: center; font-size: 1.05rem; }
.chalk-slides-ctl { gap: .3rem; }
.chalk-view-nav { display: inline-flex; align-items: center; margin: .4rem 0; }
.chalk-view-nav button { min-width: 34px; height: 34px; border: 1px solid var(--border,#ccc); border-radius: 6px; background: var(--bg,#fff); cursor: pointer; }
.chalk-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: .6rem 0; }
.chalk-actions button, .chalk-actions .link-btn { padding: .4rem .8rem; }
.chalk-limit { margin: .3rem 0; }
@media (max-width: 760px) {
    .chalk-board { border-width: 6px; }
    .chalk-toolbar { gap: .4rem; }
}
