/* ── /forum: the Qubibyte Forum ──────────────────────────────────────────────
   A discussion board in the familiar forum shape (category table, topic
   lists with replies / views / activity columns, a post stream with a
   timeline beside it), drawn in the site's own language: flat surfaces,
   hairline rules, chamfered cards, Khand for display and Inter for text.
   Tokens come from .pricing-v2 (css/pricing.css) and account.css. */

.forum-page {
    --fm-hover: var(--pr-current-bg);
    --fm-solved: #22c55e;
    --fm-solved-bg: rgba(34, 197, 94, 0.1);
    --fm-like: #f43f5e;
    --fm-staff: #a78bfa;
    --fm-mark: rgba(250, 204, 21, 0.3);
    --fm-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    --fm-warn: #f59e0b;
    --fm-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.4' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M8 4.6V8l2.4 1.6' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
}

html[data-theme="light"] .forum-page {
    --fm-solved: #16a34a;
    --fm-solved-bg: rgba(22, 163, 74, 0.08);
    --fm-like: #e11d48;
    --fm-staff: #7c3aed;
    --fm-mark: rgba(250, 204, 21, 0.45);
    --fm-shadow: 0 18px 44px rgba(20, 30, 70, 0.16);
    --fm-warn: #d97706;
}

.fm-main {
    padding-top: 92px;
}

.fm-wrap {
    position: relative;
    width: min(1180px, 100% - 40px);
    margin: 0 auto;
}

.fm-muted {
    color: var(--pr-faint);
}

/* ── Head: title and search ──────────────────────────────────────────────── */

.fm-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0 20px;
}

.fm-title {
    font-family: var(--font-display, 'Khand', sans-serif);
    font-size: 2.9rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    color: var(--pr-ink);
    text-decoration: none;
}

.fm-title:hover {
    color: var(--pr-ink);
}

.fm-tagline {
    margin: 6px 0 0;
    color: var(--pr-muted);
    font-size: 0.92rem;
}

.fm-search {
    position: relative;
    flex: 0 1 380px;
}

.fm-search svg {
    position: absolute;
    left: 13px;
    top: 50%;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    color: var(--pr-faint);
    pointer-events: none;
}

.fm-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 8px;
    background: var(--pr-surface);
    color: var(--pr-ink);
    font-size: 0.92rem;
    outline: none;
    transition: border-color .15s ease;
}

.fm-search input:focus {
    border-color: var(--pr-accent);
}

/* ── Bar: category picker, list tabs, New Topic ──────────────────────────── */

.fm-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--pr-line);
}

.fm-bar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex-wrap: wrap;
}

.fm-pick {
    position: relative;
}

.fm-pick-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    min-width: 190px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 7px;
    background: var(--pr-surface);
    color: var(--pr-ink);
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
}

.fm-pick-btn svg {
    margin-left: auto;
    color: var(--pr-muted);
}

.fm-pick-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 30;
    width: 280px;
    max-height: 420px;
    overflow: auto;
    padding: 6px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 10px;
    background: var(--pr-surface);
    box-shadow: var(--fm-shadow);
}

.fm-pick-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    color: var(--pr-ink);
    font-size: 0.88rem;
    text-decoration: none;
}

.fm-pick-item > span:last-child {
    display: flex;
    justify-content: space-between;
    flex: 1;
    gap: 8px;
}

.fm-pick-item:hover {
    background: var(--fm-hover);
    color: var(--pr-ink);
}

.fm-pick-count {
    color: var(--pr-faint);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.fm-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    background: var(--c, var(--pr-faint));
}

.fm-dot.is-empty {
    background: transparent;
    box-shadow: inset 0 0 0 1.5px var(--pr-faint);
}

.fm-tabs {
    display: flex;
    gap: 2px;
}

.fm-tabs a {
    padding: 8px 13px;
    border-radius: 7px;
    color: var(--pr-muted);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
}

.fm-tabs a:hover {
    color: var(--pr-ink);
    background: var(--fm-hover);
}

.fm-tabs a.is-on {
    color: var(--pr-solid-ink);
    background: var(--pr-solid);
}

.fm-tabs a[hidden] {
    display: none;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.fm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid var(--pr-btn-border);
    border-radius: 7px;
    background: transparent;
    color: var(--pr-ink);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, opacity .15s ease;
}

.fm-btn svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.fm-btn:hover,
.fm-btn:focus-visible {
    border-color: var(--pr-ink);
    color: var(--pr-ink);
}

.fm-btn--solid {
    border-color: var(--pr-solid);
    background: var(--pr-solid);
    color: var(--pr-solid-ink);
}

.fm-btn--solid:hover,
.fm-btn--solid:focus-visible {
    opacity: 0.88;
    color: var(--pr-solid-ink);
    border-color: var(--pr-solid);
}

.fm-btn--sm {
    padding: 7px 12px;
    font-size: 0.82rem;
}

.fm-btn--block {
    display: flex;
    width: 100%;
}

.fm-btn--danger:hover,
.fm-btn.is-confirm {
    border-color: var(--pr-error);
    color: var(--pr-error);
}

.fm-btn[disabled] {
    opacity: 0.55;
    cursor: default;
}

/* ── Cards and tables ────────────────────────────────────────────────────── */

.fm-card {
    /* newindex.css pads every <section> for the home page bands. */
    padding: 0;
    border: 1px solid var(--pr-line-strong);
    border-radius: 10px;
    background: var(--pr-surface);
    overflow: hidden;
}

.fm-card-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 14px 18px 12px;
    border-bottom: 1px solid var(--pr-line);
}

.fm-card-head h2 {
    margin: 0;
    font-family: var(--font-display, 'Khand', sans-serif);
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--pr-ink);
}

.fm-more-link {
    color: var(--pr-accent);
    font-size: 0.84rem;
    text-decoration: none;
}

.fm-table {
    width: 100%;
    border-collapse: collapse;
    /* Columns from the header row, the first taking what is left. Left to
       size themselves, one-line titles (cut with an ellipsis) count at full
       length and push the table past the edge of a phone. */
    table-layout: fixed;
}

.fm-table th {
    padding: 11px 16px;
    border-bottom: 1px solid var(--pr-line-strong);
    color: var(--pr-faint);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: left;
}

.fm-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--pr-line);
    vertical-align: middle;
}

.fm-table tr:last-child td {
    border-bottom: 0;
}

.fm-table th.fm-num,
.fm-table td.fm-num {
    width: 84px;
    text-align: center;
    color: var(--pr-muted);
    font-variant-numeric: tabular-nums;
}

.fm-none {
    margin: 0;
    padding: 28px 18px;
    color: var(--pr-muted);
    text-align: center;
    font-size: 0.92rem;
}

/* The front page: categories beside the latest topics. */
.fm-split {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.fm-cat-row td:first-child {
    position: relative;
    padding-left: 22px;
}

.fm-cat-row td:first-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--c);
}

.fm-cat-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--pr-ink);
    text-decoration: none;
}

.fm-cat-name:hover {
    color: var(--pr-accent);
}

.fm-cat-desc {
    margin: 4px 0 0;
    color: var(--pr-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.fm-cat-latest {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    /* No wider than the cell, so long titles end in an ellipsis. */
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
}

.fm-cat-latest li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.84rem;
}

.fm-cat-latest a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--pr-ink);
    text-decoration: none;
}

.fm-cat-latest a:hover {
    color: var(--pr-accent);
}

.fm-cats td.fm-num strong {
    display: block;
    color: var(--pr-ink);
    font-size: 1.05rem;
}

.fm-cats td.fm-num span {
    font-size: 0.72rem;
    color: var(--pr-faint);
}

.fm-rules {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: 10px;
    vertical-align: 2px;
}

.fm-rule {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 999px;
    color: var(--pr-muted);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.fm-rule svg {
    width: 11px;
    height: 11px;
}

.fm-rule--staff {
    border-color: color-mix(in srgb, var(--fm-staff) 50%, transparent);
    color: var(--fm-staff);
}

.fm-rule--solved {
    border-color: color-mix(in srgb, var(--fm-solved) 45%, transparent);
    color: var(--fm-solved);
}

/* The latest list on the front page. */
.fm-latest {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fm-latest-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--pr-line);
}

.fm-latest-row:last-child {
    border-bottom: 0;
}

.fm-latest-main .fm-topic-link {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.93rem;
}

.fm-latest-meta {
    margin-top: 3px;
}

.fm-latest-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    font-size: 0.78rem;
}

.fm-replies-pill {
    min-width: 26px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--fm-hover);
    color: var(--pr-ink);
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* Topic rows. */
.fm-topic-link {
    color: var(--pr-ink);
    font-weight: 600;
    font-size: 0.98rem;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.fm-topic-link:hover {
    color: var(--pr-accent);
}

.fm-topic-link:visited {
    color: var(--pr-muted);
}

.fm-topic-row:hover td {
    background: var(--fm-hover);
}

.fm-topic-row.is-pinned td {
    background: color-mix(in srgb, var(--pr-accent) 5%, transparent);
}

.fm-topic-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.fm-excerpt {
    margin: 6px 0 0;
    color: var(--pr-muted);
    font-size: 0.84rem;
    line-height: 1.5;
    /* Ids and links have no spaces to break at. */
    overflow-wrap: anywhere;
}

.fm-excerpt mark,
.fm-topic-link mark {
    padding: 0 1px;
    border-radius: 2px;
    background: var(--fm-mark);
    color: inherit;
}

.fm-likes-mini {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
}

.fm-likes-mini svg {
    width: 11px;
    height: 11px;
    color: var(--fm-like);
}

.fm-posters,
.fm-posters-h {
    width: 92px;
    white-space: nowrap;
}

.fm-posters a + a {
    margin-left: -6px;
}

.fm-num--replies.is-hot,
.fm-num--views.is-hot {
    color: #f59e0b !important;
    font-weight: 700;
}

.fm-num--act {
    font-size: 0.86rem;
}

.fm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--pr-muted);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
}

.fm-chip .fm-dot {
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

.fm-chip:hover {
    color: var(--pr-ink);
}

.fm-ico {
    display: inline-flex;
    width: 14px;
    height: 14px;
    margin-right: 6px;
    vertical-align: -1px;
    color: var(--pr-faint);
}

.fm-ico svg {
    width: 100%;
    height: 100%;
}

.fm-ico--solved {
    color: var(--fm-solved);
}

.fm-ico--pin {
    color: var(--pr-accent);
}

/* Avatars. */
.fm-av {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--pr-current-bg);
    vertical-align: middle;
}

.fm-av--xs { width: 20px; height: 20px; font-size: 0.62rem; }
.fm-av--sm { width: 26px; height: 26px; font-size: 0.72rem; }
.fm-av--md { width: 34px; height: 34px; font-size: 0.85rem; }
.fm-av--lg { width: 46px; height: 46px; font-size: 1.1rem; }

.fm-av--letter {
    font-weight: 700;
    color: var(--pr-ink);
    background: color-mix(in srgb, var(--pr-accent) 22%, transparent);
}

.fm-posters .fm-av {
    box-shadow: 0 0 0 2px var(--pr-surface);
}

/* A category's own page. */
.fm-cat-head {
    min-height: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
    padding: 4px 0 4px 18px !important;
    border-left: 5px solid var(--c);
}

.fm-cat-head h1 {
    margin: 0;
    font-family: var(--font-display, 'Khand', sans-serif);
    font-size: 2.1rem;
    font-weight: 600;
    color: var(--pr-ink);
}

.fm-cat-head p {
    margin: 2px 0 6px;
    max-width: 720px;
    color: var(--pr-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.fm-cat-head .fm-rules {
    margin-left: 0;
}

.fm-cat-stats {
    display: flex;
    gap: 18px;
    color: var(--pr-muted);
    font-size: 0.84rem;
    white-space: nowrap;
}

.fm-cat-stats strong {
    color: var(--pr-ink);
    font-size: 1.1rem;
}

.fm-note {
    margin: 0 0 14px;
    padding: 10px 14px;
    border: 1px dashed var(--pr-line-strong);
    border-radius: 8px;
    color: var(--pr-muted);
    font-size: 0.86rem;
}

.fm-filters {
    display: inline-flex;
    gap: 2px;
    margin-bottom: 12px;
    padding: 3px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 8px;
}

.fm-filters a {
    padding: 5px 12px;
    border-radius: 6px;
    color: var(--pr-muted);
    font-size: 0.82rem;
    font-weight: 500;
    text-decoration: none;
}

.fm-filters a.is-on {
    background: var(--fm-hover);
    color: var(--pr-ink);
}

.fm-pager {
    display: flex;
    justify-content: center;
    padding: 18px 0 0;
}

.fm-pager:empty {
    display: none;
}

/* ── A topic ─────────────────────────────────────────────────────────────── */

.fm-topic-head {
    margin-bottom: 18px;
}

.fm-topic-head h1 {
    margin: 0 0 8px;
    font-family: var(--font-display, 'Khand', sans-serif);
    font-size: 2.2rem;
    font-weight: 600;
    line-height: 1.1;
    color: var(--pr-ink);
    overflow-wrap: anywhere;
}

.fm-topic-head h1 .fm-ico {
    width: 20px;
    height: 20px;
    vertical-align: 1px;
}

.fm-topic-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.fm-tag {
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--fm-hover);
    color: var(--pr-muted);
    font-size: 0.74rem;
    font-weight: 600;
}

.fm-tag--solved {
    background: var(--fm-solved-bg);
    color: var(--fm-solved);
}

.fm-topic-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 200px;
    gap: 32px;
    align-items: start;
}

.fm-stream {
    min-width: 0;
    max-width: 820px;
}

.fm-post {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    padding: 18px 0 8px;
    border-top: 1px solid var(--pr-line);
    scroll-margin-top: 96px;
}

.fm-post.is-first {
    border-top: 0;
    padding-top: 0;
}

.fm-post.is-flash .fm-post-main {
    animation: fm-flash 1.6s ease;
}

@keyframes fm-flash {
    0% { background: color-mix(in srgb, var(--pr-accent) 16%, transparent); }
    100% { background: transparent; }
}

.fm-post-main {
    min-width: 0;
    border-radius: 8px;
}

/* A solution is marked by its "Solution" flag and the box under the first
   post, not by restyling the whole post. */

.fm-post-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.fm-post-name {
    color: var(--pr-ink);
    font-weight: 700;
    text-decoration: none;
}

.fm-post-name:hover {
    color: var(--pr-accent);
}

.fm-post-head .qb-verified {
    width: 14px;
    height: 14px;
    margin-left: -4px;
}

.fm-post-real {
    color: var(--pr-faint);
    font-size: 0.84rem;
}

.fm-role {
    /* An employee's company role: set as type beside the name, split off by
       a hairline, rather than as a badge. */
    padding-left: 9px;
    border-left: 1px solid var(--pr-line-strong);
    color: var(--fm-staff);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    line-height: 1.1;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Who a reply answers: the curled arrow, their picture and name, top right,
   just left of the time. */
.fm-reply-to {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 2px 8px 2px 6px;
    border-radius: 999px;
    color: var(--pr-muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}

.fm-reply-to:hover {
    background: var(--fm-hover);
    color: var(--pr-ink);
}

.fm-reply-to svg {
    width: 13px;
    height: 13px;
    color: var(--pr-faint);
}

.fm-reply-to .fm-av {
    width: 18px;
    height: 18px;
    font-size: 0.58rem;
}

.fm-reply-to + .fm-post-date {
    margin-left: 0;
}

/* The answers a reply got, folded under it. */
.fm-replies {
    margin-top: 6px;
}

.fm-replies-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--pr-muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.fm-replies-toggle:hover {
    background: var(--fm-hover);
    color: var(--pr-ink);
}

.fm-replies-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform .15s ease;
}

.fm-replies-toggle.is-open svg {
    transform: rotate(180deg);
}

.fm-replies-list {
    display: grid;
    gap: 10px;
    margin-top: 8px;
    padding: 12px 0 4px 14px;
    border-left: 2px solid var(--pr-line-strong);
}

/* A reply shown again under what it answers: the same post, read only. */
.fm-post.fm-post--copy {
    padding: 0;
    border: 0;
}

.fm-post--copy .fm-post-main {
    padding: 0;
}

.fm-post--copy .fm-post-head {
    font-size: 0.86rem;
}

.fm-post--copy .fm-post-body {
    font-size: 0.92rem;
}

.fm-jump {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    color: var(--pr-accent);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
}

.fm-jump:hover {
    text-decoration: underline;
}

.fm-jump svg {
    width: 13px;
    height: 13px;
}

.fm-post-date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    color: var(--pr-faint);
    font-size: 0.82rem;
    text-decoration: none;
}

.fm-edited svg {
    width: 12px;
    height: 12px;
}

.fm-post-body {
    color: var(--pr-ink);
    font-size: 0.95rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.fm-post-body p {
    margin: 0 0 12px;
}

.fm-post-body h4 {
    margin: 14px 0 8px;
    font-size: 1.05rem;
    font-weight: 700;
}

.fm-post-body ul,
.fm-post-body ol {
    margin: 0 0 12px;
    padding-left: 22px;
}

.fm-post-body blockquote {
    margin: 0 0 12px;
    padding: 8px 14px;
    border-left: 3px solid var(--pr-line-strong);
    background: var(--fm-hover);
    color: var(--pr-muted);
}

.fm-post-body code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--fm-hover);
    color: var(--pr-ink);
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.86em;
}

.fm-code {
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px solid var(--pr-line);
    border-radius: 8px;
    background: var(--fm-hover);
    overflow: auto;
    font-size: 0.85rem;
    line-height: 1.55;
}

.fm-code code {
    padding: 0;
    background: none;
}

.fm-post-body a {
    color: var(--pr-accent);
}

.fm-mention {
    font-weight: 600;
    text-decoration: none;
}

.fm-post-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px 0 6px;
}

.fm-act {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--pr-faint);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
}

.fm-act svg {
    width: 16px;
    height: 16px;
}

.fm-act:hover:not([disabled]) {
    background: var(--fm-hover);
    color: var(--pr-ink);
}

.fm-act[disabled] {
    cursor: default;
    opacity: 0.7;
}

.fm-act--like.is-on,
.fm-act--like:hover:not([disabled]) {
    color: var(--fm-like);
}

.fm-act--like.is-pop svg {
    animation: fm-pop .35s ease;
}

@keyframes fm-pop {
    40% { transform: scale(1.35); }
}

.fm-like-n {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.fm-act--solve.is-on,
.fm-act--solve:hover {
    color: var(--fm-solved) !important;
}

.fm-act--danger:hover {
    color: var(--pr-error) !important;
}

.fm-act.is-confirm {
    color: var(--pr-error);
    background: color-mix(in srgb, var(--pr-error) 10%, transparent);
}

.fm-solution-flag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--fm-solved-bg);
    color: var(--fm-solved);
    font-size: 0.8rem;
    font-weight: 700;
}

.fm-solution-flag svg {
    width: 14px;
    height: 14px;
}

.fm-solution-box {
    display: block;
    margin: 6px 0 12px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--fm-solved) 40%, transparent);
    border-radius: 8px;
    background: var(--fm-solved-bg);
    color: var(--pr-ink);
    text-decoration: none;
}

.fm-solution-box:hover {
    color: var(--pr-ink);
    border-color: var(--fm-solved);
}

.fm-solution-head {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--fm-solved);
    font-size: 0.86rem;
    font-weight: 600;
}

.fm-solution-head > svg {
    width: 16px;
    height: 16px;
}

.fm-solution-head strong {
    color: var(--pr-ink);
}

.fm-solution-text {
    display: block;
    margin-top: 6px;
    color: var(--pr-muted);
    font-size: 0.87rem;
    line-height: 1.5;
}

/* The topic map: the summary under the first post. */
.fm-map {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 22px;
    margin: 4px 0 6px;
    padding: 12px 16px;
    border: 1px solid var(--pr-line);
    border-radius: 8px;
    font-size: 0.8rem;
}

.fm-map > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--pr-faint);
}

.fm-map > div:nth-child(-n+2) {
    display: grid;
    grid-template-columns: auto auto;
    column-gap: 6px;
    align-items: center;
}

.fm-map > div:nth-child(-n+2) span {
    grid-column: 1 / -1;
}

.fm-map strong {
    color: var(--pr-ink);
    font-size: 0.95rem;
}

.fm-map-people {
    flex-direction: row !important;
    gap: 2px !important;
    margin-left: auto;
}

.fm-closed {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0 0;
    padding: 14px 16px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 8px;
    color: var(--pr-muted);
    font-size: 0.9rem;
}

.fm-closed svg {
    width: 16px;
    height: 16px;
}

/* The reply box. */
.fm-composer,
.fm-compose-cta {
    margin-top: 18px;
    padding: 16px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 10px;
    background: var(--pr-surface);
    scroll-margin-top: 96px;
}

.fm-compose-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.fm-compose-cta p {
    margin: 0;
    color: var(--pr-muted);
    font-size: 0.92rem;
}

.fm-composer-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--pr-muted);
    font-size: 0.86rem;
}

.fm-chip-x {
    border: 0;
    background: var(--fm-hover);
    color: var(--pr-muted);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    line-height: 1;
    cursor: pointer;
}

.fm-composer textarea,
.fm-input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 8px;
    background: transparent;
    color: var(--pr-ink);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.93rem;
    line-height: 1.55;
    outline: none;
    resize: vertical;
}

.fm-composer textarea:focus,
.fm-input:focus {
    border-color: var(--pr-accent);
}

/* The mention layer under a box (js/forum.js liveMentions): the same text in
   the same place, with @names coloured; the box shows caret and selection. */
.fm-hl {
    position: relative;
    display: block;
    width: 100%;
}

.fm-hl-back {
    position: absolute;
    inset: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    color: var(--pr-ink);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.93rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: break-word;
    pointer-events: none;
}

.fm-hl-box,
.fm-composer .fm-hl-box,
.fm-hl .fm-input {
    position: relative;
    background: transparent;
    color: transparent;
    caret-color: var(--pr-ink);
}

.fm-hl-box::placeholder {
    color: var(--pr-faint);
}

.fm-hl-box::selection {
    background: color-mix(in srgb, var(--pr-accent) 30%, transparent);
}

mark.fm-mention-live {
    background: transparent;
    color: var(--pr-accent);
    font-weight: 600;
}

select.fm-input {
    background: var(--pr-surface);
}

.fm-composer-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.fm-form-msg {
    margin: 8px 0 0;
    color: var(--pr-error);
    font-size: 0.86rem;
    line-height: 1.45;
}

.fm-form-msg:empty {
    display: none;
}

/* Running into a limit: a note, not an error. */
.fm-form-msg.is-warn {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 12px;
    border: 1px solid color-mix(in srgb, var(--fm-warn) 45%, transparent);
    border-radius: 8px;
    background: color-mix(in srgb, var(--fm-warn) 10%, transparent);
    color: var(--pr-ink);
    font-variant-numeric: tabular-nums;
}

.fm-form-msg.is-warn::before {
    content: '';
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    margin-top: 1px;
    background: var(--fm-warn);
    -webkit-mask: var(--fm-clock) center / contain no-repeat;
    mask: var(--fm-clock) center / contain no-repeat;
}

.fm-form-msg.is-ok {
    color: var(--fm-solved);
}

.fm-form-msg.is-restricted::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--pr-error);
}

.fm-preview {
    margin-top: 12px;
    padding: 12px 14px;
    border: 1px dashed var(--pr-line-strong);
    border-radius: 8px;
}

.fm-edit {
    display: grid;
    gap: 8px;
}

/* The side column: timeline and controls. */
.fm-side {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 10px;
}

.fm-timeline {
    position: relative;
    display: grid;
    gap: 6px;
    padding: 0 0 8px 14px;
    border-left: 1px solid var(--pr-line);
}

.fm-timeline-track {
    position: relative;
    height: 120px;
}

/* On the line itself, and free to travel its whole length: the top of the
   timeline is the first post, the bottom the last. */
.fm-timeline-thumb {
    position: absolute;
    left: -3px;
    top: 0;
    width: 5px;
    height: 36px;
    border-radius: 3px;
    background: var(--pr-accent);
    transition: top .15s ease;
}

.fm-side-link {
    color: var(--pr-faint);
    font-size: 0.8rem;
    text-decoration: none;
}

.fm-side-link:hover {
    color: var(--pr-ink);
}

.fm-side-count {
    color: var(--pr-ink);
    font-weight: 700;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.fm-side-controls {
    display: grid;
    gap: 6px;
    padding-top: 10px;
    border-top: 1px solid var(--pr-line);
}

.fm-side-controls .fm-btn {
    justify-content: flex-start;
}

.fm-side-label {
    color: var(--pr-faint);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.fm-side-back {
    padding-top: 6px;
    color: var(--pr-muted);
    font-size: 0.84rem;
    text-decoration: none;
}

/* ── Search and New Topic ────────────────────────────────────────────────── */

.fm-card.fm-search-panel {
    padding: 16px;
    margin-bottom: 16px;
}

.fm-adv-main {
    display: flex;
    gap: 10px;
}

.fm-adv-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.fm-adv-grid label,
.fm-field {
    display: grid;
    gap: 5px;
    margin: 0;
}

.fm-adv-grid label span,
.fm-field span {
    color: var(--pr-faint);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.fm-result-count {
    margin: 0 0 10px;
    color: var(--pr-muted);
    font-size: 0.88rem;
}

.fm-result-count strong {
    color: var(--pr-ink);
}

.fm-compose form {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.fm-cat-hint {
    margin: -6px 0 0;
    padding-left: 10px;
    border-left: 3px solid var(--c);
    color: var(--pr-muted);
    font-size: 0.84rem;
}

.fm-locked {
    margin: 0;
    padding: 12px 18px 16px;
    border-top: 1px solid var(--pr-line);
    color: var(--pr-faint);
    font-size: 0.8rem;
}

/* ── States ──────────────────────────────────────────────────────────────── */

.fm-loading {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 60px 0;
}

.fm-loading span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pr-faint);
    animation: fm-bounce 1s infinite ease-in-out;
}

.fm-loading span:nth-child(2) { animation-delay: .15s; }
.fm-loading span:nth-child(3) { animation-delay: .3s; }

@keyframes fm-bounce {
    0%, 80%, 100% { opacity: .3; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-5px); }
}

.fm-empty-card {
    max-width: 520px;
    margin: 30px auto;
    padding: 36px 30px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 10px;
    background: var(--pr-surface);
    text-align: center;
}

.fm-empty-card h2 {
    font-family: var(--font-display, 'Khand', sans-serif);
    font-size: 1.8rem;
    color: var(--pr-ink);
}

.fm-empty-card p {
    color: var(--pr-muted);
    margin: 8px 0 18px;
}

.fm-toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 2000;
    padding: 10px 18px;
    border-radius: 8px;
    background: var(--pr-solid);
    color: var(--pr-solid-ink);
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--fm-shadow);
    opacity: 0;
    transform: translate(-50%, 10px);
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.fm-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

.fm-toast.is-error {
    background: var(--pr-error);
    color: #fff;
}

/* ── Narrow screens ──────────────────────────────────────────────────────── */

@media (max-width: 991.98px) {
    .fm-split,
    .fm-topic-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .fm-side {
        position: static;
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .fm-timeline {
        display: none;
    }

    .fm-adv-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .fm-wrap {
        width: calc(100% - 32px);
    }

    .fm-head {
        flex-direction: column;
        align-items: stretch;
    }

    .fm-search {
        flex-basis: auto;
    }

    .fm-bar {
        flex-wrap: wrap;
    }

    .fm-tabs {
        overflow-x: auto;
    }

    .fm-posters,
    .fm-posters-h,
    .fm-num--views,
    .fm-topics th:nth-child(4) {
        display: none;
    }

    .fm-table th.fm-num,
    .fm-table td.fm-num {
        width: 64px;
        padding-left: 3px;
        padding-right: 3px;
    }

    /* "Activity" has to fit the number column. */
    .fm-table th.fm-num {
        font-size: 0.64rem;
        letter-spacing: 0.02em;
    }

    .fm-table td,
    .fm-table th {
        padding-left: 12px;
        padding-right: 12px;
    }

    .fm-post {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .fm-post .fm-av--lg {
        width: 36px;
        height: 36px;
    }

    .fm-cat-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .fm-adv-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .fm-compose-cta {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
}

@media (max-width: 479.98px) {
    /* Categories: the name, description and latest topics need the room;
       the topic count stays, the post count goes. */
    .fm-cats th:nth-child(3),
    .fm-cats td:nth-child(3) {
        display: none;
    }

    .fm-table th {
        letter-spacing: 0.04em;
    }
}

/* ── Composer toolbar, attachments and embeds ────────────────────────────── */

.fm-composer-foot .fm-tools {
    margin-right: auto;
}

.fm-tools {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

.fm-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--pr-muted);
    cursor: pointer;
}

.fm-tool svg {
    width: 16px;
    height: 16px;
}

.fm-tool:hover,
.fm-tool:focus-visible {
    background: var(--fm-hover);
    color: var(--pr-ink);
}

.fm-tools-sep {
    width: 1px;
    height: 18px;
    margin: 0 4px;
    background: var(--pr-line-strong);
}

.fm-tools.is-uploading [data-tool="attach"] {
    color: var(--pr-accent);
    animation: fm-pulse 1s ease-in-out infinite;
}

@keyframes fm-pulse {
    50% { opacity: 0.4; }
}

.fm-composer textarea.is-drop,
.fm-input.is-drop {
    border-color: var(--pr-accent);
    border-style: dashed;
    background: color-mix(in srgb, var(--pr-accent) 6%, transparent);
}

/* Attachments in posts. */
.fm-img-link {
    display: inline-block;
    max-width: 100%;
    margin: 4px 0;
}

.fm-img {
    display: block;
    max-width: 100%;
    max-height: 460px;
    border: 1px solid var(--pr-line);
    border-radius: 8px;
    object-fit: contain;
    background: var(--fm-hover);
}

.fm-post-body a.fm-file {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 7px;
    color: var(--pr-ink);
    font-size: 0.86rem;
    text-decoration: none;
}

.fm-file svg {
    width: 14px;
    height: 14px;
    color: var(--pr-muted);
}

.fm-post-body a.fm-file:hover {
    border-color: var(--pr-accent);
}

/* Qubi code blocks. */
.fm-qubi {
    margin: 0 0 12px;
    border: 1px solid var(--pr-line);
    border-radius: 8px;
    overflow: hidden;
}

.fm-qubi-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px 5px 12px;
    border-bottom: 1px solid var(--pr-line);
    color: var(--pr-faint);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fm-qubi-copy {
    padding: 3px 8px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--pr-muted);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
}

.fm-qubi-copy:hover {
    background: var(--fm-hover);
    color: var(--pr-ink);
}

.fm-qubi .fm-code {
    margin: 0;
    border: 0;
    border-radius: 0;
}

/* Embedded circuits. */
.fm-circuit {
    margin: 4px 0 12px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 10px;
    overflow: hidden;
}

.fm-circuit > .fm-muted {
    display: block;
    padding: 14px 16px;
    font-size: 0.86rem;
}

.fm-circuit-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px 10px 16px;
    border-bottom: 1px solid var(--pr-line);
}

.fm-circuit-copy {
    display: grid;
    min-width: 0;
    font-size: 0.9rem;
}

.fm-circuit-copy .fm-muted {
    font-size: 0.78rem;
}

.fm-circuit-figure {
    padding: 8px 10px;
    overflow-x: auto;
}

/* Plus and Pro, set like an employee's role but in the page's ink. */
.fm-role--tier {
    color: var(--pr-ink);
}

/* "Turn off replies" when starting a topic. */
.fm-check {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0;
    font-size: 0.88rem;
    color: var(--pr-ink);
    cursor: pointer;
}

.fm-check input {
    width: 15px;
    height: 15px;
    accent-color: var(--pr-accent);
    transform: translateY(2px);
}

.fm-check .fm-muted {
    font-size: 0.8rem;
}

.fm-mono {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
}

/* The circuit picker. */
.fm-modal-shade {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(5, 6, 20, 0.6);
}

.fm-modal {
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: min(640px, 100%);
    padding: 18px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 12px;
    background: var(--pr-surface);
    box-shadow: var(--fm-shadow);
    color: var(--pr-ink);
}

.fm-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.fm-modal-head h2 {
    margin: 0;
    font-family: var(--font-display, 'Khand', sans-serif);
    font-size: 1.5rem;
    font-weight: 600;
}

.fm-modal-x {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--pr-muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
}

.fm-modal-x:hover {
    background: var(--fm-hover);
    color: var(--pr-ink);
}

.fm-modal-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding-bottom: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--pr-line);
}

.fm-modal-tabs button {
    padding: 6px 12px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--pr-muted);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
}

.fm-modal-tabs button[aria-selected="true"] {
    background: var(--pr-solid);
    color: var(--pr-solid-ink);
}

.fm-modal-body {
    flex: 1 1 auto;
    min-height: 160px;
    overflow-y: auto;
}

.fm-modal-empty {
    margin: 0;
    padding: 28px 8px;
    color: var(--pr-muted);
    font-size: 0.9rem;
    text-align: center;
}

.fm-modal-empty a {
    color: var(--pr-accent);
}

.fm-modal-group h3 {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 10px 4px 4px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.fm-modal-group h3 .fm-muted {
    font-weight: 500;
}

.fm-modal-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--pr-ink);
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
}

.fm-modal-file:hover {
    background: var(--fm-hover);
}

.fm-modal-file .fm-muted {
    font-size: 0.78rem;
    white-space: nowrap;
}

.fm-modal-file.is-busy {
    opacity: 0.55;
    pointer-events: none;
}

.fm-modal-link {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--pr-line);
}

.fm-modal-link .fm-input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
}

.fm-modal-paste {
    display: grid;
    gap: 10px;
}

.fm-modal-paste textarea {
    font-size: 0.86rem;
}

.fm-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.fm-modal-actions .is-busy {
    opacity: 0.55;
    pointer-events: none;
}

/* Share links in posts: a simulator project's circuit, a Graphics document
   playing in a frame, a 3D model turning in one, or a Chemistry workspace
   shown in one. Built on the circuit embed's card. */
.fm-share {
    margin: 4px 0 12px;
}

.fm-share.fm-share--simulator,
.fm-share.fm-share--graphics,
.fm-share.fm-share--3d,
.fm-share.fm-share--molecule {
    border: 1px solid var(--pr-line-strong);
    border-radius: 10px;
    overflow: hidden;
}

.fm-share-app {
    color: var(--pr-faint);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.fm-share .fm-circuit-copy .fm-muted {
    font-size: 0.78rem;
}

.fm-share-frame {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--fm-hover);
}

.fm-share-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.fm-share-note {
    margin: 0;
    padding: 8px 16px 12px;
    color: var(--pr-muted);
    font-size: 0.8rem;
}


/* ── Embed a circuit: what to show under it ─────────────────────────── */

.fm-modal-with {
    min-width: 0;
    margin: 12px 0 0;
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid var(--pr-line);
}

.fm-modal-with legend {
    float: left;
    width: 100%;
    margin: 0 0 8px;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--pr-faint);
}

.fm-with-chips {
    clear: both;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* A chip that fills in when it is on; the real checkbox stays for keyboards
   and screen readers, only its picture is replaced. */
.fm-with-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 10px;
    border: 1px solid var(--pr-line-strong);
    border-radius: 999px;
    color: var(--pr-muted);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.fm-with-chip input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.fm-with-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border: 1.5px solid var(--pr-line-strong);
    border-radius: 4px;
    transition: background .15s ease, border-color .15s ease;
}

.fm-with-box::after {
    content: '';
    width: 4px;
    height: 8px;
    margin-top: -2px;
    border: solid var(--pr-on-accent, #06070f);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .15s ease;
}

.fm-with-chip:hover {
    border-color: var(--pr-muted);
    color: var(--pr-ink);
}

.fm-with-chip:has(input:checked) {
    border-color: var(--pr-accent);
    background: color-mix(in srgb, var(--pr-accent) 12%, transparent);
    color: var(--pr-ink);
}

.fm-with-chip input:checked + .fm-with-box {
    background: var(--pr-accent);
    border-color: var(--pr-accent);
}

.fm-with-chip input:checked + .fm-with-box::after {
    transform: rotate(45deg) scale(1);
}

.fm-with-chip:has(input:focus-visible) {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pr-accent) 40%, transparent);
}

@media (prefers-reduced-motion: reduce) {
    .fm-with-chip,
    .fm-with-box,
    .fm-with-box::after { transition: none; }
}

/* ── Video embeds: [video:<link>] (js/forum-video.js) ─────────────────── */

.fm-video {
    margin: 6px 0 14px;
    max-width: 720px;
}

.fm-video-frame {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--pr-line-strong);
    border-radius: 10px;
    background: #000;
}

.fm-video-frame iframe,
.fm-video-frame video {
    display: block;
    width: 100%;
    border: 0;
}

/*
 * The players' own pages do not say they are dark, and when a frame's
 * scheme differs from its page's, the browser paints the frame white
 * behind it (and draws light scrollbars). Matching them keeps it clear.
 */
.fm-video-frame iframe {
    color-scheme: normal;
}

/* Players, landscape: 16:9. */
.fm-video--wide .fm-video-frame iframe,
.fm-video--wide .fm-video-frame video {
    aspect-ratio: 16 / 9;
    height: auto;
}

/* Shorts, TikToks and reels: portrait. */
.fm-video--tall {
    max-width: 340px;
}

.fm-video--tall .fm-video-frame iframe {
    aspect-ratio: 9 / 16;
    height: auto;
}

/* Posts (X, Instagram, LinkedIn): as tall as the post says it is. */
.fm-video--post {
    max-width: 550px;
}

.fm-video--post .fm-video-frame {
    background: transparent;
    border-color: var(--pr-line);
}

.fm-video--post .fm-video-frame iframe {
    height: 560px;
}

.fm-video figcaption {
    margin-top: 6px;
    font-size: 0.8rem;
}

.fm-video figcaption a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    color: var(--pr-muted);
    text-decoration: none;
}

.fm-video figcaption a:hover {
    color: var(--pr-ink);
}

.fm-video-site {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--pr-ink);
}

.fm-video-url {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fm-video figcaption svg {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
}

/* The composer's dialog. */
.fm-modal--video {
    width: min(640px, 100%);
    max-height: min(820px, 100%);
}

.fm-video-label {
    margin-bottom: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--pr-muted);
}

.fm-video-sites {
    margin: 6px 0 12px;
    font-size: 0.76rem;
    color: var(--pr-faint);
}

.fm-video-preview {
    min-height: 140px;
    padding: 2px;
}

.fm-video-preview .fm-video {
    margin: 0 auto;
}

.fm-video-opts {
    margin: 12px 0 4px;
}
