/*
 * WFP Forum — front-end styles. Loaded on forum routes only.
 *
 * Visual reference: the WFP Home Concept (Claude Design), with rounded corners.
 * Tokens live on .wfp-forum; a group's accent (its book's accent_color when
 * linked) arrives as --g-accent, with --g-on-accent for text on it; tints use
 * color-mix. Fonts are the site's own ('WFP Serif' = Goudy Old Style, Lato),
 * declared in Additional CSS. WFP Serif has no true italic, so headings never
 * set font-style: italic. Kadence's global heading family is deliberately not used.
 */

/* ── Page & tokens ──────────────────────────────────────────────────── */

body.wfp-forum-page,
body.wfp-forum-page .site,
body.wfp-forum-page #inner-wrap { background: #080C10; }
body.wfp-forum-page .content-area { margin-top: 0; margin-bottom: 0; }
/* Post pages sit on true black under a glow of the group's color (.wfp-glow). */
body.wfp-forum-view-post,
body.wfp-forum-view-post .site,
body.wfp-forum-view-post #inner-wrap { background: #000; }
body.wfp-forum-view-post .wfp-forum { --f-bg: #000; }
.wfp-forum-area { overflow-x: clip; }

.wfp-forum {
    --f-bg:          #080C10;
    --f-surface:     #11161C;
    --f-raised:      #152738;
    --f-text:        #FFFFFF;
    --f-text-2:      #D0D0D0;
    --f-muted:       #8C949C;
    --f-label:       #B4D8F9;
    --f-accent:      var(--wfp-btn-bg, #739EBF);   /* brand accent: the button system's color (class-buttons.php) */
    --f-line:        rgba(255, 255, 255, 0.08);
    --f-line-strong: rgba(255, 255, 255, 0.16);
    --f-serif:       'WFP Serif', 'Goudy Old Style', Georgia, serif;
    --f-sans:        Lato, 'Helvetica Neue', Arial, sans-serif;
    --f-radius:      16px;
    --f-radius-sm:   10px;
    --f-max:         1200px;
    --f-gutter:      1.5rem;
    --f-ease:        cubic-bezier(.2, .7, .2, 1);
    --g-accent:      var(--f-accent);
    --g-on-accent:   var(--wfp-btn-text, #000000);
    --g-accent-hover: var(--wfp-btn-bg-hover, #B4D8F9);
    --f-top:         24px;   /* breadcrumbs sit this far below the site header on every page */

    position: relative;
    box-sizing: border-box;
    max-width: var(--f-max);
    margin: 0 auto;
    padding: var(--f-top) 0 120px;
    color: var(--f-text-2);
    font-family: var(--f-sans);
    font-size: 16px;
    line-height: 1.6;
}
.wfp-forum *, .wfp-forum *::before, .wfp-forum *::after { box-sizing: inherit; }
body.wfp-forum-view-group .wfp-forum,
body.wfp-forum-view-restricted .wfp-forum { padding-top: 0; }

.wfp-forum a { color: var(--f-label); text-decoration: none; transition: color .15s var(--f-ease); }
.wfp-forum a:hover { color: var(--f-accent); }
.wfp-forum :focus-visible { outline: 2px solid var(--f-label); outline-offset: 3px; border-radius: 4px; }
/* Containers that are only focused by a link or script (a settings section you jumped to) never get a ring. */
.wfp-forum section:focus, .wfp-forum section:focus-visible, .wfp-forum :target, .wfp-forum :target:focus, .wfp-forum :target:focus-visible, .wfp-forum [tabindex="-1"]:not(button):not(a):not(input):not(textarea):not(select):focus-visible { outline: none; }
/* Reset the site's global heading styles (letter-spacing, transforms, Kadence family). */
.wfp-forum h1, .wfp-forum h2, .wfp-forum h3 { color: var(--f-text); letter-spacing: normal; text-transform: none; font-variant: normal; }

.wfp-icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* Full-bleed hero image, gradient and statbar rules are absolutely positioned
   100vw layers; the content itself stays in the page column so its edges always
   match the theme's container padding. */

/* ── Type ───────────────────────────────────────────────────────────── */

.wfp-forum .wfp-display {
    margin: 0;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(56px, 9vw, 136px);
    line-height: .95;
    letter-spacing: -0.01em;
    color: var(--f-text);
}
.wfp-lede { margin: 28px 0 0; max-width: 640px; font-size: clamp(17px, 1.6vw, 20px); font-weight: 300; line-height: 1.6; color: var(--f-text-2); }

.wfp-forum .wfp-eyebrow {
    display: block;
    margin: 0 0 14px;
    font-family: var(--f-sans);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .26em;
    line-height: 1.4;
    text-transform: uppercase;
    color: var(--f-label);
}
.wfp-forum .wfp-eyebrow-accent { color: color-mix(in srgb, var(--g-accent) 85%, #fff); }
/* Admin-set group message: shown exactly as typed (lowercase allowed). */
.wfp-forum .wfp-message { text-transform: none; letter-spacing: .18em; }

.wfp-forum .wfp-section-title {
    margin: 0 0 48px;
    font-family: var(--f-serif);
    font-weight: 400;
    font-size: clamp(36px, 4.6vw, 60px);
    line-height: 1.05;
}

/* Breadcrumbs: the first thing on every forum page, in the same top-left spot. */
.wfp-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-height: 20px; margin: 0 0 36px; color: var(--f-muted); font-size: 12px; line-height: 20px; }
.wfp-crumbs a { font-size: 12px; font-weight: 700; letter-spacing: .24em; text-transform: uppercase; color: var(--f-text-2) !important; transition: color .2s var(--f-ease) !important; }
.wfp-crumbs a:hover { color: var(--g-accent) !important; }
body.wfp-forum-view-index .wfp-crumbs { margin-bottom: clamp(48px, 7vw, 88px); }

.wfp-meta { font-size: 14px; font-weight: 300; color: var(--f-muted); }
.wfp-sep { margin: 0 8px; opacity: .6; }

/* ── Groups index ───────────────────────────────────────────────────── */

.wfp-intro { max-width: 820px; margin-bottom: clamp(56px, 7vw, 88px); }

.wfp-group-grid {
    list-style: none; margin: 0; padding: 0;
    display: grid; gap: 38px 36px;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.wfp-group-card { margin: 0; }
.wfp-group-card-link { display: flex; flex-direction: column; color: inherit !important; }

.wfp-group-card-media {
    position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
    margin-bottom: 18px;
    background: var(--f-surface);
    border: 1px solid var(--f-line);
    border-radius: var(--f-radius);
    transition: border-color .25s var(--f-ease);
}
.wfp-group-card-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--f-ease), opacity .3s var(--f-ease); }
.wfp-group-card-media.is-blank { display: flex; align-items: center; justify-content: center; color: color-mix(in srgb, var(--g-accent) 60%, transparent); }
.wfp-group-card-link:hover .wfp-group-card-media { border-color: color-mix(in srgb, var(--g-accent) 60%, transparent); }
.wfp-group-card-link:hover .wfp-group-card-media img { transform: scale(1.035); }

.wfp-group-card .wfp-eyebrow { margin-bottom: 7px; }
.wfp-group-card-name {
    font-family: var(--f-serif); font-size: clamp(26px, 2.4vw, 32px); line-height: 1.1; color: var(--f-text);
    transition: color .2s var(--f-ease);
}
.wfp-group-card-link:hover .wfp-group-card-name { color: var(--g-accent); }
.wfp-group-card .wfp-meta { margin-top: 7px; }

.wfp-group-card.is-locked .wfp-group-card-media img { opacity: .45; filter: grayscale(.4); }

/* "● 6 NEW" / "Locked" chip over a card image */
.wfp-pill {
    position: absolute; top: 14px; left: 14px;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px;
    background: rgba(8, 12, 16, .82);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; line-height: 1.2;
    color: var(--f-text);
}
.wfp-pill-dot { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--g-accent) 80%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-accent) 25%, transparent); }
.wfp-pill-lock { color: var(--f-text-2); }
.wfp-pill-lock .wfp-icon { width: 14px; height: 14px; }

/* ── Group hero ─────────────────────────────────────────────────────── */

.wfp-hero {
    position: relative; isolation: isolate;
    display: flex; align-items: flex-end;
    min-height: clamp(380px, 58vh, 620px);
    padding: clamp(80px, 12vw, 160px) 0 clamp(36px, 5vw, 56px);
}
.wfp-hero-media { position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw; z-index: -2; }
.wfp-hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.wfp-hero::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw; z-index: -1;
    background:
        linear-gradient(to bottom, rgba(8,12,16,.25) 0%, rgba(8,12,16,.55) 55%, #080C10 100%),
        linear-gradient(to right, rgba(8,12,16,.75) 0%, rgba(8,12,16,0) 60%);
}
.wfp-hero.is-plain { min-height: 0; padding-top: clamp(64px, 9vw, 120px); }
.wfp-hero.is-plain::before { background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--g-accent) 14%, transparent), transparent 60%); }

/* Hero pages start at the very top; their breadcrumbs pin to the same spot as everywhere else. */
.wfp-hero .wfp-crumbs { position: absolute; top: var(--f-top); left: 0; right: 0; margin: 0; }
.wfp-hero .wfp-display { max-width: 12ch; text-shadow: 0 2px 24px rgba(0,0,0,.45); }

/* Stats strip under the hero */
.wfp-statbar { position: relative; }
.wfp-statbar::before {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 100vw; margin-left: -50vw;
    border-top: 1px solid var(--f-line); border-bottom: 1px solid var(--f-line); pointer-events: none;
}
.wfp-statbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.wfp-stats { display: flex; margin: 0; }
.wfp-stats > div { padding: 22px 36px 22px 0; margin-right: 36px; border-right: 1px solid var(--f-line); }
.wfp-stats > div:last-child { border-right: 0; margin-right: 0; }
.wfp-stats dt { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--f-muted); }
.wfp-stats dd { margin: 0; font-family: var(--f-serif); font-size: 22px; line-height: 1.2; color: var(--f-text); }
.wfp-statbar-actions { display: flex; gap: 12px; padding: 14px 0; }

/* ── Group layout: posts + sidebar ──────────────────────────────────── */

.wfp-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: clamp(40px, 6vw, 80px);
    margin-top: clamp(48px, 6vw, 72px);
}
.wfp-aside { display: flex; flex-direction: column; gap: 48px; }

.wfp-place {
    padding: 28px 30px 26px;
    background: var(--f-surface);
    border: 1px solid var(--f-line);
    border-radius: var(--f-radius);
}
.wfp-forum .wfp-place-chapter { margin: 0 0 18px; font-family: var(--f-serif); font-size: 44px; line-height: 1; color: var(--f-text); }
.wfp-place-total { margin-left: 6px; font-family: var(--f-sans); font-size: 13px; font-weight: 300; color: var(--f-muted); }
.wfp-progress { height: 2px; margin-bottom: 26px; background: var(--f-line-strong); border-radius: 2px; overflow: hidden; }
.wfp-progress:last-child { margin-bottom: 0; }
.wfp-progress span { display: block; height: 100%; background: var(--g-accent); border-radius: 2px; }
.wfp-place-note { margin: 14px 0 0; font-size: 13px; font-weight: 300; line-height: 1.6; color: var(--f-muted); }

/* Switch (role=switch) */
.wfp-forum .wfp-switch,
.wfp-forum .wfp-switch:hover,
.wfp-forum .wfp-switch:focus {
    display: inline-flex; align-items: center; gap: 12px;
    padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer;
    font: inherit; text-transform: none; letter-spacing: normal; color: var(--f-text);
}
.wfp-switch-track {
    position: relative; width: 40px; height: 22px; border-radius: 999px;
    background: var(--f-line-strong); transition: background-color var(--wfp-btn-duration, .2s) var(--wfp-btn-ease, ease);
}
.wfp-switch-thumb {
    position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: transform var(--wfp-btn-duration, .2s) var(--wfp-btn-ease, ease), background-color var(--wfp-btn-duration, .2s) var(--wfp-btn-ease, ease);
}
/* On: the track takes the accent and the knob the text color a filled button would use there (black, or white on dark accents). */
.wfp-switch[aria-checked="true"] .wfp-switch-track { background: var(--g-accent); }
.wfp-switch[aria-checked="true"] .wfp-switch-thumb { transform: translateX(18px); background: var(--g-on-accent); }
.wfp-switch-label { font-size: 16px; }
.wfp-switch:disabled { cursor: progress; opacity: .8; }

.wfp-about .wfp-eyebrow { margin-bottom: 16px; }
.wfp-forum .wfp-about-text { margin: 0; font-family: var(--f-serif); font-size: 22px; line-height: 1.45; color: var(--f-text); }

/* ── Settings (account page tab) ────────────────────────────────────── */

.wfp-forum.wfp-settings { max-width: 640px; margin: 24px 0 0; padding: 0; color: var(--f-text-2); }
.wfp-settings-section + .wfp-settings-section { margin-top: 40px; padding-top: 32px; border-top: 1px solid var(--f-line); }
.wfp-settings .wfp-eyebrow { margin-bottom: 18px; }
.wfp-forum .wfp-settings-intro { margin: -6px 0 18px; font-size: 14px; color: var(--f-muted); }
.wfp-setting { display: flex; align-items: flex-start; gap: 16px; }
.wfp-setting + .wfp-setting { margin-top: 18px; }
.wfp-setting .wfp-switch { margin-top: 2px; }
.wfp-setting-text { display: flex; flex-direction: column; gap: 2px; }
.wfp-setting-label { font-size: 16px; color: var(--f-text); }
.wfp-setting-note { font-size: 14px; font-weight: 300; color: var(--f-muted); }
.wfp-unsubscribe-form { margin-top: 28px; }
/* The beta opt-out (WFP Beta Options) drawn like the forum's own switches. */
.wfp-settings-beta .wfp-optout-row { display: flex; align-items: center; gap: 16px; }
.wfp-settings-beta .wfp-toggle__track { width: 40px !important; height: 22px !important; border: 0 !important; background: var(--f-line-strong) !important; transition: background-color var(--wfp-btn-duration, .2s) var(--wfp-btn-ease, ease) !important; }
.wfp-settings-beta .wfp-toggle--on .wfp-toggle__track { background: var(--g-accent) !important; }
.wfp-settings-beta .wfp-toggle__thumb { top: 3px !important; left: 3px !important; width: 16px !important; height: 16px !important; transform: none !important; transition: transform var(--wfp-btn-duration, .2s) var(--wfp-btn-ease, ease), background-color var(--wfp-btn-duration, .2s) var(--wfp-btn-ease, ease) !important; }
.wfp-settings-beta .wfp-toggle--on .wfp-toggle__thumb { transform: translateX(18px) !important; background: var(--g-on-accent) !important; }
.wfp-settings-beta .wfp-optout-label { font-size: 16px !important; color: var(--f-text) !important; }

/* ── Lodge widget and profile tab (embedded outside the forum pages) ──── */

.wfp-forum.wfp-recent, .wfp-forum.wfp-profile-activity { max-width: none; margin: 0; padding: 0; text-align: left; }
.wfp-forum .wfp-recent-list { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.wfp-forum .wfp-recent-list > li { margin: 0 !important; }
.wfp-recent-item { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-top: 1px solid var(--f-line); cursor: pointer; }
.wfp-recent-list .wfp-recent-item:first-child { border-top: 0; padding-top: 4px; }
.wfp-recent-main { min-width: 0; }
.wfp-forum .wfp-recent-where { margin: 0 0 4px; font-size: 11px; }
.wfp-recent-where time { letter-spacing: .1em; }
.wfp-forum .wfp-recent-title { display: block; font-family: var(--f-serif); font-size: 21px; line-height: 1.25; color: var(--f-text); transition: color .2s var(--f-ease); }
.wfp-forum .wfp-recent-item:hover .wfp-recent-title { color: var(--g-accent); }
.wfp-recent-title .wfp-dot { margin-right: 8px; vertical-align: .2em; background: color-mix(in srgb, var(--g-accent) 70%, #fff); }
.wfp-forum .wfp-recent-meta, .wfp-forum .wfp-recent-excerpt { margin: 4px 0 0; font-size: 14px; color: var(--f-muted); }
.wfp-forum .wfp-recent-excerpt { color: var(--f-text-2); line-height: 1.6; }
.wfp-forum .wfp-recent-empty { margin: 0; color: var(--f-muted); }
.wfp-forum .wfp-recent-all { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--f-text); }
.wfp-forum .wfp-recent-all:hover { color: var(--f-accent); }

/* ── People: avatars, role rings, badges ────────────────────────────── */

.wfp-avatar {
    --size: 44px; --ring: var(--f-muted); --ring-a: 100%;
    position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    width: var(--size); height: var(--size); border-radius: 50%;
    background: var(--f-surface);
    box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--ring) var(--ring-a), transparent);
    overflow: hidden;
}
.wfp-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.wfp-avatar-initials { font-family: var(--f-serif); font-size: calc(var(--size) * .4); line-height: 1; color: var(--f-text); letter-spacing: .02em; }
.wfp-role-admin  { --ring: #56778F; --badge: #56778F; }
.wfp-role-author { --ring: #1159AF; --badge: #1159AF; }
.wfp-role-beta   { --ring: #13612E; --badge: #13612E; }
.wfp-role-arc    { --ring: #B4D8F9; --ring-a: 55%; --badge: #B4D8F9; }

.wfp-badge {
    display: inline-block; padding: 3px 9px; border-radius: 4px;
    background: var(--badge, var(--f-raised));
    font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; line-height: 1.4;
    color: #fff; vertical-align: middle;
}
.wfp-badge.wfp-role-arc { background: color-mix(in srgb, #B4D8F9 18%, transparent); color: #B4D8F9; }

/* ── Buttons: see buttons.css (the one place buttons are drawn) ───────── */

/* ── Unread dot (a quieter cousin of the Lodge TOC bullets) ─────────── */

.wfp-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: var(--f-label); box-shadow: 0 0 0 3px color-mix(in srgb, var(--f-label) 18%, transparent);
}

/* ── Empty states ───────────────────────────────────────────────────── */

.wfp-empty {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    max-width: 560px; margin: 24px auto; padding: 64px 24px;
}
.wfp-empty .wfp-pines { color: color-mix(in srgb, var(--g-accent) 55%, transparent); margin-bottom: 24px; }
.wfp-forum .wfp-empty-title { margin: 0; font-family: var(--f-serif); font-size: 30px; line-height: 1.2; color: var(--f-text); }
.wfp-empty-text { margin: 10px 0 0; font-weight: 300; color: var(--f-text-2); }
.wfp-main > .wfp-empty { margin-top: 0; border-top: 1px solid var(--f-line); }

/* ── Narrow pages (new post, locked post) ───────────────────────────── */

.wfp-narrow { max-width: 760px; margin: 0 auto; }
.wfp-forum .wfp-page-title { margin: 0 0 32px; font-family: var(--f-serif); font-weight: 400; font-size: clamp(40px, 5vw, 56px); line-height: 1.05; }

/* ── Small controls ─────────────────────────────────────────────────── */

.wfp-forum .wfp-input, .wfp-forum .wfp-select {
    min-height: 40px; padding: 8px 14px;
    background: var(--f-bg); color: var(--f-text);
    border: 1px solid var(--f-line-strong); border-radius: var(--f-radius-sm);
    font: 15px/1.3 var(--f-sans);
}
.wfp-forum .wfp-select { padding-right: 34px; appearance: none; -webkit-appearance: none; max-width: 100%;
    background: var(--f-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23B4D8F9' stroke-width='1.3'/%3E%3C/svg%3E") no-repeat right 14px center; }
.wfp-forum .wfp-input:focus, .wfp-forum .wfp-select:focus { outline: none; border-color: var(--g-accent); }
/* Additional CSS has a wpForo-era `select { background: white !important; color: black !important; width: 95% !important; … }`. */
.wfp-forum select.wfp-select {
    width: auto !important; padding: 8px 34px 8px 14px !important; background-color: var(--f-bg) !important; color: var(--f-text) !important;
    border: 1px solid var(--f-line-strong) !important; border-radius: var(--f-radius-sm) !important;
}
.wfp-forum select.wfp-select:focus { border-color: var(--g-accent) !important; }
.wfp-forum .wfp-select:disabled { opacity: .5; }

.wfp-check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--f-text-2); }
.wfp-check[hidden] { display: none; }
/* Same box as the WFP Forms checkbox: 18px, 1px outline, thin black check. */
.wfp-forum .wfp-check input[type="checkbox"] {
    -webkit-appearance: none; appearance: none; flex-shrink: 0;
    display: inline-grid; place-content: center; width: 18px; height: 18px; margin: 0; padding: 0; cursor: pointer;
    background: transparent; border: 1px solid color-mix(in srgb, var(--f-text) 45%, transparent); border-radius: 5px; box-shadow: none;
    transition: background-color .15s ease, border-color .15s ease;
}
.wfp-forum .wfp-check input[type="checkbox"]::before {
    content: ""; width: 4px; height: 8px; margin-top: -2px; background: none;
    border: solid #000; border-width: 0 1.5px 1.5px 0; clip-path: none;
    transform: rotate(45deg) scale(0); transition: transform .15s ease;
}
.wfp-forum .wfp-check:hover input[type="checkbox"]:not(:checked) { border-color: color-mix(in srgb, var(--f-text) 65%, transparent); }
.wfp-forum .wfp-check input[type="checkbox"]:checked { background: var(--g-accent); border-color: var(--g-accent); }
.wfp-forum .wfp-check input[type="checkbox"]:checked::before { transform: rotate(45deg) scale(1); }
.wfp-forum .wfp-check input[type="checkbox"]:focus-visible { outline: 2px solid var(--g-accent); outline-offset: 2px; }


.wfp-note { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; font-weight: 300; color: var(--f-muted); }

/* ── Composer ───────────────────────────────────────────────────────── */

.wfp-composer {
    margin: 0 0 40px; padding: 8px 20px 8px 8px;
    background: var(--f-surface); border: 1px solid var(--f-line); border-radius: 999px;
    transition: border-color .2s var(--f-ease);
}
.wfp-composer:not(.is-open):hover { border-color: var(--g-accent); }
.wfp-composer.is-open { padding: 16px 22px 20px; border-radius: var(--f-radius); border-color: var(--f-line-strong); }
.wfp-composer-head { display: flex; align-items: center; gap: 14px; }
.wfp-forum .wfp-composer-prompt {
    flex: 1; padding: 4px 0; border: 0; background: none; box-shadow: none; cursor: text; text-align: left;
    font-family: var(--f-serif); font-size: 18px; font-weight: 400; letter-spacing: normal; text-transform: none; color: var(--f-muted);
}
.wfp-forum .wfp-composer-prompt { transition: color .2s var(--f-ease); }
.wfp-forum .wfp-composer-prompt:hover { background: none; }
.wfp-forum .wfp-composer:not(.is-open):hover .wfp-composer-prompt { color: var(--f-text-2); }
.wfp-forum .wfp-composer-title,
.wfp-forum .wfp-composer-title:focus {
    flex: 1; min-width: 0; padding: 4px 0; border: 0 !important; background: none !important; box-shadow: none !important; outline: none;
    font-family: var(--f-serif); font-size: clamp(24px, 3vw, 30px); line-height: 1.2; color: var(--f-text);
}
.wfp-composer-title::placeholder { color: var(--f-muted); }
.wfp-composer-body { margin-top: 2px; padding-left: 50px; }
/* An open reply box has no title row: the editor starts right at the top. */
.wfp-composer-reply.is-open .wfp-composer-head { display: none; }
.wfp-composer-reply.is-open .wfp-composer-body { margin-top: 0; padding-left: 0; }
.wfp-composer-reply.is-open { padding-top: 6px; }
.wfp-composer.is-editing { margin: 0 0 40px; border-radius: var(--f-radius); }
.wfp-composer.is-editing .wfp-composer-head > .wfp-avatar { display: none; }
.wfp-composer.is-editing .wfp-composer-body { padding-left: 0; }

.wfp-editor { border-top: 0; }
.wfp-editor.is-loading { min-height: 160px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.03), transparent) 0 0 / 200% 100%; animation: wfp-shimmer 1.4s linear infinite; }
@keyframes wfp-shimmer { to { background-position: -200% 0; } }

.wfp-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 0; border-bottom: 1px solid var(--f-line); }
.wfp-forum .wfp-tool {
    display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
    border: 0; border-radius: 8px; background: none; box-shadow: none; color: var(--f-muted); cursor: pointer;
}
.wfp-forum .wfp-tool:hover { background: rgba(255,255,255,.05); color: var(--f-text); }
.wfp-forum .wfp-tool[aria-pressed="true"] { background: color-mix(in srgb, var(--g-accent) 22%, transparent); color: var(--f-text); }

.wfp-linkbox { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--f-line); }
.wfp-linkbox .wfp-input { flex: 1; min-width: 0; }

.wfp-forum .wfp-editor-content { min-height: 160px; padding: 16px 0 8px; outline: none; }
.wfp-forum .wfp-editor-content:focus-visible { outline: none; }
.wfp-editor-content p.is-editor-empty:first-child::before {
    content: attr(data-placeholder); float: left; height: 0; pointer-events: none; color: var(--f-muted);
}

.wfp-composer-options { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; padding: 16px 0 4px; border-top: 1px solid var(--f-line); }
.wfp-chapter-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; flex-basis: 100%; padding-left: 28px; }
.wfp-chapter-picker[hidden] { display: none; }
.wfp-chapter-picker .wfp-select { flex: 1 1 200px; }

.wfp-composer-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 18px; }
.wfp-form-error { flex: 1 1 100%; margin: 0; font-size: 14px; color: #F29B9B; text-align: right; }
.wfp-form-error:empty { display: none; }

/* ── Prose (post bodies and the editor) ─────────────────────────────── */

.wfp-prose { font-size: 18px; line-height: 1.75; color: var(--f-text-2); overflow-wrap: anywhere; }
.wfp-prose > * { margin: 0 0 1.1em; }
.wfp-prose > *:last-child { margin-bottom: 0; }
.wfp-prose strong { color: var(--f-text); font-weight: 700; }
.wfp-prose a { color: var(--f-label); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--f-label) 35%, transparent); text-underline-offset: 3px; }
.wfp-prose a:hover { color: var(--f-text); text-decoration-color: currentColor; }
.wfp-prose blockquote {
    margin-left: 0; padding: 4px 0 4px 22px; border-left: 2px solid var(--g-accent);
    font-family: var(--f-serif); font-size: 21px; line-height: 1.55; color: var(--f-text);
}
.wfp-prose ul, .wfp-prose ol { padding-left: 1.4em; }
.wfp-prose li { margin: .3em 0; }
.wfp-prose li > p { margin: 0; }
.wfp-prose img { display: block; max-width: 100%; height: auto; border-radius: var(--f-radius-sm); }
.wfp-prose img.wfp-img { cursor: zoom-in; width: auto; max-height: min(640px, 75vh); }
.wfp-reply-body img.wfp-img { max-height: min(420px, 60vh); }
.wfp-editor-content img { width: auto; max-height: 320px; }
.wfp-editor-figure { margin: 0 0 1.1em; }
.wfp-editor-figure img { display: block; margin: 0; border-radius: var(--f-radius-sm); }
.wfp-editor-figure.ProseMirror-selectednode img { outline: 2px solid var(--g-accent); outline-offset: 3px; }
.wfp-forum .wfp-caption-input, .wfp-forum .wfp-caption-input:focus {
    display: block; width: 100%; max-width: 480px; margin: 8px 0 0; padding: 2px 0; border: 0 !important; background: none !important; box-shadow: none !important; outline: none;
    font: 14px/1.5 var(--f-sans); color: var(--f-muted);
}
.wfp-caption-input::placeholder { color: color-mix(in srgb, var(--f-muted) 70%, transparent); }
/* Captioned images */
.wfp-prose .wfp-figure { margin: 0 0 1.1em; }
.wfp-prose .wfp-figure img { margin: 0; }
.wfp-prose .wfp-figure figcaption { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--f-muted); }
.wfp-lightbox figure { flex-direction: column; gap: 12px; }
.wfp-lightbox figcaption { max-width: 720px; font: 15px/1.5 var(--f-sans); color: rgba(255, 255, 255, .7); text-align: center; }
.wfp-lightbox figcaption:empty { display: none; }
.wfp-editor-content img { margin: 0 0 1.1em; }

/* @mentions */
.wfp-forum .wfp-prose a.wfp-mention { text-decoration: none; font-weight: 700; color: var(--f-label); }
.wfp-forum .wfp-prose a.wfp-mention:hover { color: var(--f-text); }
.wfp-mention-list {
    position: fixed; z-index: 100001; min-width: 240px; max-width: min(340px, calc(100vw - 16px)); margin: 0; padding: 6px; list-style: none;
    background: #101318; border: 1px solid var(--f-line-strong); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
    font: 14px/1.3 var(--f-sans); color: var(--f-text-2);
}
.wfp-mention-option { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; cursor: pointer; }
.wfp-mention-option .wfp-avatar { --f-bg: #101318; }
.wfp-mention-option.is-active, .wfp-mention-option:hover { background: rgba(255, 255, 255, .07); color: var(--f-text); }
.wfp-mention-name { font-weight: 700; color: var(--f-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wfp-mention-handle { margin-left: auto; padding-left: 8px; font-size: 12px; color: var(--f-muted); white-space: nowrap; }
.wfp-mention-empty { padding: 8px 10px; color: var(--f-muted); }

/* Upload progress chips under the editor */
.wfp-uploads { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.wfp-uploads[hidden] { display: none; }
.wfp-upload { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; border: 1px solid var(--f-line); border-radius: 999px; font-size: 13px; color: var(--f-text-2); }
.wfp-upload-bar { position: relative; width: 60px; height: 3px; border-radius: 3px; background: var(--f-line-strong); overflow: hidden; }
.wfp-upload-bar span { position: absolute; inset: 0 auto 0 0; width: 4%; background: var(--g-accent); transition: width .2s linear; }

/* Lightbox */
.wfp-lightbox { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; margin: 0; padding: 0; border: 0; background: transparent; color: #fff; }
.wfp-lightbox::backdrop { background: rgba(0, 0, 0, .9); }
.wfp-lightbox figure { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; padding: 56px 72px; box-sizing: border-box; }
.wfp-lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--f-radius-sm); }
.wfp-forum .wfp-lightbox button, .wfp-lightbox button {
    position: absolute; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); box-shadow: none; color: #fff; cursor: pointer; transition: background .15s;
}
.wfp-lightbox button:hover { background: rgba(255, 255, 255, .18); }
.wfp-lightbox [data-close] { top: 16px; right: 16px; }
.wfp-lightbox [data-prev] { left: 16px; top: 50%; margin-top: -24px; }
.wfp-lightbox [data-next] { right: 16px; top: 50%; margin-top: -24px; }
.wfp-lightbox button[hidden] { display: none; }
@media (max-width: 700px) { .wfp-lightbox figure { padding: 64px 12px; } .wfp-lightbox [data-prev], .wfp-lightbox [data-next] { top: auto; bottom: 16px; margin: 0; } }

/* YouTube: poster + play button until pressed (styled after the WFP video gallery:
   rounded thumbnail, outlined triangle that turns ice-blue; no zoom, it plays in place). */
.wfp-yt { position: relative; margin: 0 0 1.2em; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 20px; background: #000; }
.wfp-yt.is-short { aspect-ratio: 9 / 16; max-width: 340px; }
.wfp-forum .wfp-yt-play,
.wfp-forum .wfp-yt-play:hover { position: absolute; inset: 0; display: block; width: 100%; padding: 0; border: 0; border-radius: 20px; background: #000; box-shadow: none; cursor: pointer; }
.wfp-yt-play img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
.wfp-yt-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none; line-height: 0; }
.wfp-yt-icon { width: clamp(60px, 15%, 110px); }
.wfp-yt.is-short .wfp-yt-icon { width: clamp(60px, 26%, 110px); }
.wfp-yt-icon svg { width: 100%; height: auto; filter: drop-shadow(0 1px 8px rgba(0, 0, 0, .45)); }
.wfp-yt-icon path { stroke: #FFFFFF; transition: stroke .18s; }
.wfp-yt-play:hover .wfp-yt-icon path, .wfp-yt-play:focus-visible .wfp-yt-icon path { stroke: var(--g-accent); }
.wfp-forum .wfp-yt-play:focus-visible { outline: 3px solid rgba(180, 216, 249, .4); outline-offset: 3px; }
.wfp-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ── Byline ─────────────────────────────────────────────────────────── */

.wfp-byline { display: flex; align-items: center; gap: 16px; min-width: 0; }
.wfp-byline-text { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; font-size: 14px; }
.wfp-forum .wfp-byline-name { font-weight: 700; color: var(--f-text); }
.wfp-forum a.wfp-byline-name:hover { color: var(--f-label); }
.wfp-byline-time, .wfp-edited { color: var(--f-muted); font-weight: 300; }
.wfp-edited { margin-left: -6px; cursor: help; }
.wfp-tags { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.wfp-tag-chapter, .wfp-tag-flag { font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; }
.wfp-tag-chapter { color: var(--f-muted); font-weight: 400; }
.wfp-tag-flag { display: inline-flex; align-items: center; gap: 4px; color: color-mix(in srgb, var(--g-accent) 70%, #fff); }
.wfp-tag-flag .wfp-icon { width: 13px; height: 13px; }
.wfp-tag-muted { color: var(--f-muted); }
.wfp-tag-spoiler { color: #F2A6A6; }
.wfp-tag-beta { color: #7FC79A; }

/* ── Post rows (group list) ─────────────────────────────────────────
   Avatar in its own column, top-aligned with the byline; the whole row opens
   the post (forum.js), so its title lights up on hover. */

.wfp-row { position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 0 16px; padding: 26px 0; border-top: 1px solid var(--f-line); }
.wfp-rows .wfp-row:last-child { border-bottom: 1px solid var(--f-line); }
.wfp-row[data-wfp-card] { cursor: pointer; }
.wfp-row-main { min-width: 0; }
.wfp-row .wfp-byline-text { min-height: 22px; }
.wfp-row-body { margin-top: 9px; }
.wfp-forum .wfp-row-title { margin: 0; font-family: var(--f-serif); font-weight: 400; font-size: clamp(23px, 2.3vw, 28px); line-height: 1.2; }
.wfp-forum .wfp-row-title a { color: var(--f-text); transition: color .2s var(--f-ease); }
.wfp-forum .wfp-row-title a:hover,
.wfp-forum .wfp-row[data-wfp-card]:hover .wfp-row-title a { color: var(--g-accent); }
.wfp-row-excerpt { margin: 8px 0 0; font-size: 16px; line-height: 1.65; color: var(--f-text-2); }
.wfp-row-excerpt strong { color: var(--f-text); font-weight: 700; }
.wfp-forum .wfp-row-excerpt a { color: var(--f-label); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--f-label) 35%, transparent); text-underline-offset: 3px; }
.wfp-forum .wfp-row-excerpt a.wfp-mention { text-decoration: none; }
.wfp-forum .wfp-row-excerpt a:hover { color: var(--f-text); }
.wfp-row-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; margin-top: 8px; cursor: auto; }
.wfp-count { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--f-text-2); }
.wfp-count .wfp-icon { color: var(--f-muted); }
/* Unread: a dot before the title; "N new" beside the reply count; "New" on replies. */
.wfp-row-title .wfp-dot { margin: 0 12px 0 0; vertical-align: .32em; background: color-mix(in srgb, var(--g-accent) 70%, #fff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--g-accent) 22%, transparent); }
.wfp-count-new { margin-left: 10px; font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: color-mix(in srgb, var(--g-accent) 70%, #fff); }
.wfp-new-tag { font-size: 10px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: color-mix(in srgb, var(--g-accent) 70%, #fff); }
.wfp-row-locked { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-family: var(--f-serif); font-size: 19px; color: var(--f-muted); }
.wfp-row.is-pinned::before { content: ""; position: absolute; left: -16px; top: 26px; bottom: 26px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--g-accent) 70%, transparent); }

/* ── Spoiler veil ───────────────────────────────────────────────────── */

.wfp-veil { position: relative; display: grid; }
/* Content and cover share one grid cell, so the box is as tall as whichever is taller. */
.wfp-veil > .wfp-veil-content, .wfp-veil > .wfp-veil-cover { grid-area: 1 / 1; min-width: 0; }
.wfp-veil .wfp-veil-content { filter: blur(9px); opacity: .45; user-select: none; pointer-events: none; transition: filter .5s var(--f-ease), opacity .5s var(--f-ease); }
.wfp-veil-cover {
    position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
    padding: 8px 4px; transition: opacity .3s var(--f-ease);
}
.wfp-veil-cover .wfp-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.wfp-veil-cover .wfp-icon { width: 18px; height: 18px; }
.wfp-forum .wfp-veil-text { margin: 0 0 14px; font-family: var(--f-serif); font-size: clamp(20px, 2.2vw, 26px); line-height: 1.3; color: var(--f-text); }
.wfp-veil.is-unveiled .wfp-veil-content { filter: none; opacity: 1; user-select: auto; pointer-events: auto; }
.wfp-veil.is-unveiled .wfp-veil-cover { display: none; }
.wfp-thread-main.wfp-veil { min-height: 240px; align-items: start; }
.wfp-thread-main.wfp-veil > .wfp-veil-cover { align-self: start; padding-top: 24px; }

/* ── Post page ──────────────────────────────────────────────────────── */

.wfp-thread { position: relative; z-index: 0; max-width: 760px; margin: 0 auto; }
.wfp-glow {
    position: absolute; z-index: -1; top: calc(-1 * var(--f-top)); left: 50%; width: 100vw; margin-left: -50vw; height: min(900px, 120vh);
    background: radial-gradient(ellipse 65% 80% at 0% 0%, color-mix(in srgb, var(--g-accent) 20%, transparent) 0%, transparent 72%);
    pointer-events: none;
}
.wfp-thread-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.wfp-thread-actions { display: flex; align-items: center; gap: 22px; margin-top: 28px; }
.wfp-thread.is-veiled .wfp-thread-actions { display: none; }
.wfp-forum .wfp-thread-title { margin: 0 0 32px; font-family: var(--f-serif); font-weight: 400; font-size: clamp(38px, 5.2vw, 60px); line-height: 1.06; color: var(--f-text); }
.wfp-thread-main .wfp-prose { font-size: 19px; }
.wfp-replies { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--f-line-strong); }
.wfp-replies-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.wfp-forum .wfp-replies-title { margin: 0; font-family: var(--f-serif); font-weight: 400; font-size: clamp(28px, 3.2vw, 36px); line-height: 1.1; color: var(--f-text); }
.wfp-replies-title[hidden] { display: none; }
.wfp-replies-head:not(:has(> :not([hidden]))) { display: none; }
.wfp-sort { display: flex; gap: 8px; }
/* ── Replies ──────────────────────────────────────────────────────────
   Each branch is indented beside a quiet line. Replies by the post's author sit
   on a lightly shaded panel (flush with the line when nested). On small screens
   nesting stops indenting past depth 3. */

.wfp-forum { --r-av: 40px; --r-gap: 16px; --r-indent: 26px; --r-pad: 20px; --r-line: rgba(255, 255, 255, .14); }
.wfp-thread.is-veiled .wfp-replies { display: none; }
.wfp-replies .wfp-composer-reply { margin: 24px 0 8px; }

.wfp-reply-list, .wfp-reply-children { list-style: none; margin: 0; padding: 0; }
.wfp-reply-list { margin-top: 10px; }
.wfp-reply { position: relative; }
.wfp-reply-list > .wfp-reply + .wfp-reply { margin-top: 4px; }

/* A nested reply's line runs beside that reply only; its own replies are
   indented again with their own line. */
.wfp-reply-card { display: grid; grid-template-columns: var(--r-av) minmax(0, 1fr); gap: var(--r-gap); padding: 12px 0; }
.wfp-reply-rail { display: flex; flex-direction: column; align-items: center; }
.wfp-reply-children { margin-left: var(--r-indent); }
.wfp-reply-children > .wfp-reply > .wfp-reply-card { padding-left: var(--r-pad); padding-right: var(--r-pad); border-left: 1px solid var(--r-line); }
/* Top-level cards reach out by the panel padding (content stays put), so a highlight or
   focus ring on any reply is exactly the size of the post author's shaded panel. */
.wfp-reply-list > .wfp-reply > .wfp-reply-card { margin: 0 calc(-1 * var(--r-pad)); padding-left: var(--r-pad); padding-right: var(--r-pad); border-radius: var(--f-radius-sm); }
.wfp-forum .wfp-reply:focus { outline: none; }
.wfp-forum .wfp-reply:focus-visible > .wfp-reply-card { outline: 2px solid var(--f-label); outline-offset: 2px; }
.wfp-reply-children > .wfp-reply + .wfp-reply { margin-top: 6px; }
.wfp-reply-children > .wfp-reply:first-child { margin-top: 2px; }

.wfp-reply.is-op > .wfp-reply-card {
    --f-bg: color-mix(in srgb, var(--g-accent) 9%, #000);
    background: var(--f-bg); padding: 14px var(--r-pad); border-radius: var(--f-radius-sm);
}
.wfp-reply-children > .wfp-reply.is-op > .wfp-reply-card { border-radius: 0 var(--f-radius-sm) var(--f-radius-sm) 0; }

.wfp-reply-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 34px; }
.wfp-reply-head .wfp-byline-text { gap: 4px 12px; font-size: 15px; }
.wfp-reply-head .wfp-byline-name { font-size: 16px; }
.wfp-forum a.wfp-byline-time { color: var(--f-muted); }
.wfp-forum a.wfp-byline-time:hover { color: var(--f-text); }
.wfp-reply-head .wfp-menu-button { width: 32px; height: 32px; opacity: .6; }
.wfp-reply-card:hover .wfp-menu-button, .wfp-reply-head .wfp-menu-button:focus-visible, .wfp-reply-head .wfp-menu-button[aria-expanded="true"] { opacity: 1; }
.wfp-reply-body { margin-top: 0; font-size: 17px; line-height: 1.65; }
.wfp-reply-body blockquote { font-size: 19px; }

.wfp-reply-actions { display: flex; align-items: center; gap: 22px; margin-top: 4px; }
.wfp-forum .wfp-reply-btn {
    display: inline-flex; align-items: center; padding: 6px 0; border: 0; background: none; box-shadow: none; cursor: pointer;
    font: 700 12px/1.2 var(--f-sans); letter-spacing: .2em; text-transform: uppercase; color: var(--f-text-2);
    transition: color .15s var(--f-ease);
}
.wfp-forum .wfp-reply-btn:hover { background: none; color: var(--g-accent); }

.wfp-reply-slot:empty { display: none; }
.wfp-reply-slot .wfp-composer, .wfp-reply-slot .wfp-composer.is-open { margin: 14px 0 6px; padding: 0; background: none; border: 0; border-radius: 0; }
.wfp-reply-slot .wfp-composer-body { margin-top: 0; padding-left: 0; }
.wfp-reply-slot .wfp-editor { border: 1px solid var(--f-line-strong); border-radius: var(--f-radius-sm); padding: 0 14px; background: var(--f-surface); }
.wfp-reply-slot .wfp-composer:focus-within .wfp-editor { border-color: color-mix(in srgb, var(--g-accent) 60%, var(--f-line)); }
.wfp-reply-slot .wfp-editor-content { min-height: 90px; }
.wfp-reply-slot .wfp-composer-actions { margin-top: 12px; }
.wfp-composer-reply .wfp-editor-content { min-height: 110px; }

.wfp-avatar-ghost { background: transparent; box-shadow: 0 0 0 1px var(--f-line-strong); }
.wfp-forum .wfp-tombstone { margin: 0; min-height: var(--r-av); display: flex; align-items: center; font-family: var(--f-serif); font-size: 17px; color: var(--f-muted); }

.wfp-forum .wfp-expand {
    display: inline-flex; align-items: center; gap: 10px; margin: 0 0 10px calc(var(--r-pad) + var(--r-av) + var(--r-gap));
    padding: 6px 0; border: 0; background: none; box-shadow: none; cursor: pointer;
    font: 700 12px/1.2 var(--f-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--f-label);
}
.wfp-forum .wfp-expand::before { content: ""; width: 24px; height: 1px; background: var(--r-line); }
.wfp-forum .wfp-expand:hover { background: none; color: var(--g-accent); }

.wfp-load-more { display: flex; margin: 32px auto 0; }
.wfp-reply.is-target > .wfp-reply-card, .wfp-reply.is-new-local > .wfp-reply-card {
    border-radius: var(--f-radius-sm);
    animation: wfp-glow 2.4s var(--f-ease) 1;
}
@keyframes wfp-glow { 0%, 40% { background: color-mix(in srgb, var(--g-accent) 14%, transparent); } 100% { background: transparent; } }
.wfp-reply.is-op.is-target > .wfp-reply-card, .wfp-reply.is-op.is-new-local > .wfp-reply-card { animation-name: wfp-glow-op; }
@keyframes wfp-glow-op { 0%, 40% { background: color-mix(in srgb, var(--g-accent) 20%, #000); } 100% { background: var(--f-bg); } }

/* Avatar stack (recent repliers on a post row) */
.wfp-stack { display: inline-flex; align-items: center; }
.wfp-stack .wfp-avatar { margin-left: -4px; }
.wfp-stack .wfp-avatar:first-child { margin-left: 0; }

/* ── "…" menu ───────────────────────────────────────────────────────── */

.wfp-menu { position: relative; flex-shrink: 0; }
.wfp-forum .wfp-menu-button {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0;
    border: 1px solid transparent; border-radius: 50%; background: none; box-shadow: none; color: var(--f-muted); cursor: pointer;
}
.wfp-forum .wfp-menu-button:hover, .wfp-forum .wfp-menu-button[aria-expanded="true"] { background: rgba(255,255,255,.05); border-color: var(--f-line); color: var(--f-text); }
.wfp-menu-list {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 200px; margin: 0; padding: 6px; list-style: none;
    background: #101318; border: 1px solid var(--f-line); border-radius: 14px; box-shadow: 0 12px 32px rgba(0,0,0,.5);
}
.wfp-menu-list[hidden] { display: none; }
.wfp-forum .wfp-menu-item {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px;
    background: none; box-shadow: none; cursor: pointer; text-align: left;
    font: 14px/1.3 var(--f-sans); letter-spacing: normal; text-transform: none; color: var(--f-text-2);
}
.wfp-forum .wfp-menu-item:focus { outline: none; }
.wfp-forum .wfp-menu-item:hover, .wfp-forum .wfp-menu-item:focus-visible { background: rgba(255,255,255,.06); color: var(--f-text); outline: none; }
.wfp-menu-item .wfp-icon { width: 16px; height: 16px; color: var(--f-muted); }
.wfp-forum .wfp-menu-item.is-danger { color: #F29B9B; }
.wfp-menu-item.is-danger .wfp-icon { color: currentColor; }

/* ── Reactions ──────────────────────────────────────────────────────
   Each reaction has its own color. Outlined until chosen; solid when it's
   yours (.f parts fill, .k features turn to ink, .ks parts appear). Icons in a
   summary are all 20px with an even 8px between them. */

.wfp-forum { --rx-ink: #0B0D10; }
.wfp-rx-heart     { color: #F07178; }
.wfp-rx-surprised { color: #F2C94C; }
.wfp-rx-celebrate { color: #B794F4; }
.wfp-rx-sad       { color: #6FA8F2; }
.wfp-rx-fire      { color: #F2994A; }
.wfp-rx-wave      { color: #6FCF97; }
.wfp-rx-icon .ks { display: none; }
.wfp-rx.is-mine .wfp-rx-main .wfp-rx-icon .f,
.wfp-rx-option[aria-pressed="true"] .f,
.wfp-rx-mix .f { fill: currentColor; }
.wfp-rx.is-mine .wfp-rx-main .k, .wfp-rx-option[aria-pressed="true"] .k, .wfp-rx-mix .k,
.wfp-rx.is-mine .wfp-rx-main .ks, .wfp-rx-option[aria-pressed="true"] .ks, .wfp-rx-mix .ks { stroke: var(--rx-ink); }
.wfp-rx.is-mine .wfp-rx-main .k[fill], .wfp-rx-option[aria-pressed="true"] .k[fill], .wfp-rx-mix .k[fill],
.wfp-rx.is-mine .wfp-rx-main .kf, .wfp-rx-option[aria-pressed="true"] .kf, .wfp-rx-mix .kf { fill: var(--rx-ink); }
.wfp-rx.is-mine .wfp-rx-main .ks, .wfp-rx-option[aria-pressed="true"] .ks, .wfp-rx-mix .ks { display: inline; }

.wfp-rx { position: relative; display: inline-flex; align-items: center; cursor: auto; }
.wfp-forum .wfp-rx-main {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; margin-left: -7px; padding: 0;
    border: 0; border-radius: 50%; background: none; box-shadow: none; color: var(--f-text-2); cursor: pointer;
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation;
    transition: background .15s var(--f-ease);
}
/* Not yet reacted: a quiet outline heart; its color shows on hover. */
.wfp-rx:not(.is-mine) .wfp-rx-main .wfp-rx-icon { color: var(--f-text-2); transition: color .15s var(--f-ease); }
.wfp-forum .wfp-rx:not(.is-mine) .wfp-rx-main:hover .wfp-rx-icon { color: #F07178; }
.wfp-forum .wfp-rx-main:hover { background: rgba(255, 255, 255, .06); }
.wfp-rx-main.is-pop svg { animation: wfp-pop .32s var(--f-ease); }
@keyframes wfp-pop { 40% { transform: scale(1.25); } 100% { transform: scale(1); } }

.wfp-forum .wfp-rx-count {
    display: inline-flex; align-items: center; gap: 8px; min-height: 34px; margin-left: 1px; padding: 0; border: 0; background: none; box-shadow: none; cursor: pointer;
    font: 700 13px/1 var(--f-sans); letter-spacing: .12em; color: var(--f-text-2); text-transform: none;
}
.wfp-forum .wfp-rx-count:hover { background: none; color: var(--f-text); }
.wfp-rx-count[hidden] { display: none; }
.wfp-rx-mix { display: inline-flex; gap: 8px; }
.wfp-rx-mix:empty { display: none; }

/* The tray opens just above the heart, its first option over the heart itself. */
.wfp-rx-tray {
    position: absolute; bottom: calc(100% + 2px); left: -17px; z-index: 60; display: flex; gap: 2px; padding: 5px;
    background: #101318; border: 1px solid var(--f-line-strong); border-radius: 999px; box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
    animation: wfp-tray-in .18s var(--f-ease);
}
.wfp-rx-tray[hidden] { display: none; }
@keyframes wfp-tray-in { from { opacity: 0; transform: translateY(4px); } }
.wfp-forum .wfp-rx-option {
    display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0;
    border: 0; border-radius: 50%; background: none; box-shadow: none; cursor: pointer;
    transition: background .15s var(--f-ease);
}
.wfp-forum .wfp-rx-option:hover, .wfp-forum .wfp-rx-option:focus-visible { background: rgba(255, 255, 255, .08); outline: none; }
.wfp-forum .wfp-rx-option[aria-pressed="true"] { background: rgba(255, 255, 255, .1); }

.wfp-rx-who {
    position: absolute; bottom: calc(100% + 6px); left: 0; z-index: 60; width: max-content; min-width: 200px; max-width: min(320px, calc(100vw - 32px));
    padding: 12px 14px; background: #101318; border: 1px solid var(--f-line-strong); border-radius: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
    font-size: 13px; line-height: 1.5; color: var(--f-text-2); animation: wfp-tray-in .18s var(--f-ease);
}
.wfp-rx-who-row + .wfp-rx-who-row { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--f-line); }
.wfp-rx-who-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--f-text); }
.wfp-rx-who-n { margin-left: auto; padding-left: 16px; font-weight: 400; color: var(--f-muted); }
.wfp-rx-who-names { display: block; margin-top: 4px; }

/* ── Dialog and toast ───────────────────────────────────────────────── */

.wfp-dialog {
    max-width: min(440px, calc(100vw - 32px)); padding: 28px 28px 24px; margin: auto;
    background: var(--f-surface); color: var(--f-text); border: 1px solid var(--f-line-strong); border-radius: var(--f-radius);
    box-shadow: 0 24px 64px rgba(0,0,0,.6);
}
.wfp-dialog::backdrop { background: rgba(4, 6, 8, .72); backdrop-filter: blur(2px); }
.wfp-forum .wfp-dialog-text { margin: 0 0 24px; font-family: var(--f-serif); font-size: 22px; line-height: 1.35; }
.wfp-dialog-actions { display: flex; justify-content: flex-end; gap: 12px; }
.wfp-report-dialog { width: min(480px, calc(100vw - 32px)); }
.wfp-report-label { display: block; margin: -8px 0 8px; font-size: 14px; color: var(--f-muted); }
.wfp-forum .wfp-report-reason, .wfp-forum .wfp-report-reason:focus {
    display: block; width: 100%; min-height: 84px; margin-bottom: 20px; padding: 10px 14px; resize: vertical; font: 15px/1.5 var(--f-sans);
    background: var(--f-bg) !important; color: var(--f-text) !important; border: 1px solid var(--f-line-strong) !important; border-radius: var(--f-radius-sm) !important; box-shadow: none !important; outline: none;
}
.wfp-forum .wfp-report-reason:focus { border-color: var(--g-accent) !important; }

/* ── Search ─────────────────────────────────────────────────────────── */

.wfp-search { position: relative; display: flex; align-items: center; max-width: 520px; }
.wfp-intro .wfp-search { margin-top: 32px; }
.wfp-search > .wfp-icon { position: absolute; left: 16px; color: var(--f-muted); pointer-events: none; }
.wfp-forum .wfp-search-input, .wfp-forum .wfp-search-input:focus {
    width: 100%; min-height: 46px; padding: 10px 18px 10px 44px; border: 1px solid var(--f-line-strong) !important; border-radius: 999px !important;
    background: var(--f-surface) !important; color: var(--f-text) !important; box-shadow: none !important; outline: none; font: 15px/1.3 var(--f-sans);
    transition: border-color .2s var(--f-ease);
}
.wfp-forum .wfp-search-input:hover, .wfp-forum .wfp-search-input:focus { border-color: var(--g-accent) !important; }
.wfp-search-input::placeholder { color: var(--f-muted); }
.wfp-search-input::-webkit-search-cancel-button { filter: invert(.7); }
.wfp-search-head { max-width: 760px; margin-bottom: 36px; }
.wfp-search-head .wfp-page-title { margin-bottom: 24px; }
.wfp-forum .wfp-search-summary { margin: 18px 0 0; font-size: 15px; color: var(--f-muted); }
.wfp-search-widen { margin-left: 12px; }
.wfp-results { max-width: 760px; margin: 0; padding: 0; list-style: none; }
.wfp-result { padding: 24px 0; border-top: 1px solid var(--f-line); cursor: pointer; }
.wfp-results .wfp-result:last-child { border-bottom: 1px solid var(--f-line); }
.wfp-result .wfp-eyebrow { margin-bottom: 8px; }
.wfp-forum .wfp-result-title { margin: 0; font-family: var(--f-serif); font-weight: 400; font-size: clamp(22px, 2.2vw, 26px); line-height: 1.25; }
.wfp-forum .wfp-result-title a { color: var(--f-text); transition: color .2s var(--f-ease); }
.wfp-forum .wfp-result:hover .wfp-result-title a, .wfp-forum .wfp-result-title a:hover { color: var(--g-accent); }
.wfp-result-title.is-veiled a { display: inline-flex; align-items: center; gap: 10px; color: var(--f-muted); }
.wfp-result-snippet { margin: 8px 0 0; font-size: 16px; line-height: 1.65; color: var(--f-text-2); }
.wfp-forum mark { padding: 0 2px; border-radius: 3px; background: color-mix(in srgb, var(--g-accent) 28%, transparent); color: var(--f-text); }
.wfp-result .wfp-meta { margin: 10px 0 0; font-size: 13px; }

.wfp-toast {
    position: fixed; left: 50%; bottom: 28px; z-index: 100000; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
    padding: 12px 20px; border-radius: 999px; background: #F2F4F6; color: #080C10;
    font: 700 13px/1.2 Lato, sans-serif; letter-spacing: .04em; box-shadow: 0 8px 28px rgba(0,0,0,.45);
    transition: opacity .25s, transform .25s;
}
.wfp-toast.is-shown { opacity: 1; transform: translate(-50%, 0); }

/* ── Pagination ─────────────────────────────────────────────────────── */

.wfp-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 40px; }
.wfp-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 12px;
    border: 1px solid var(--f-line); border-radius: 999px; font-size: 14px; color: var(--f-text-2);
}
.wfp-pagination a.page-numbers:hover { border-color: var(--g-accent); color: var(--f-text); }
.wfp-pagination .page-numbers.current { background: var(--g-accent); border-color: var(--g-accent); color: var(--g-on-accent); }
.wfp-pagination .page-numbers.dots { border-color: transparent; }

/* ── Reveal: fade in and rise on first appearance ───────────────────────
   Only active under html.wfp-anim (set in <head> when motion is allowed).
   forum.js adds .is-revealed and a stagger index (--wfp-i). */

.wfp-anim [data-wfp-reveal] {
    opacity: 0;
    transform: translateY(14px);
    /* Opacity and transform stagger in; hover colors keep their own quick transitions. */
    transition: opacity .7s var(--f-ease) calc(var(--wfp-i, 0) * 70ms), transform .7s var(--f-ease) calc(var(--wfp-i, 0) * 70ms),
                border-color .2s var(--f-ease), background-color .2s var(--f-ease), color .2s var(--f-ease), box-shadow .2s var(--f-ease);
}
.wfp-anim [data-wfp-reveal].is-revealed { opacity: 1; transform: none; }

/* ── Small screens ──────────────────────────────────────────────────── */

@media (max-width: 900px) {
    .wfp-layout { grid-template-columns: minmax(0, 1fr); }
    .wfp-aside { order: -1; gap: 32px; }
}

@media (max-width: 700px) {
    .wfp-forum { padding-bottom: 80px; }
    .wfp-row { grid-template-columns: 34px minmax(0, 1fr); gap: 0 12px; padding: 22px 0; }
    .wfp-row-avatar .wfp-avatar { --size: 34px !important; }
    .wfp-row.is-pinned::before { left: -10px; }
    .wfp-composer.is-open { padding: 16px; }
    .wfp-composer-body { padding-left: 0; }
    .wfp-composer-head > .wfp-avatar { --size: 32px !important; }
    .wfp-chapter-picker { padding-left: 0; }
    .wfp-prose, .wfp-thread-main .wfp-prose { font-size: 17px; }
    .wfp-composer-actions .wfp-btn { flex: 1; }
    .wfp-forum { --r-av: 34px; --r-gap: 12px; --r-indent: 12px; --r-pad: 12px; }
    .wfp-reply-rail .wfp-avatar { --size: var(--r-av) !important; }
    /* Past depth 3, branches stop indenting so text keeps a readable width. */
    .wfp-reply-children .wfp-reply-children .wfp-reply-children { margin-left: 0; }
    .wfp-group-grid { gap: 32px; }
    .wfp-stats > div { padding-right: 24px; margin-right: 24px; }
    .wfp-statbar-actions { width: 100%; padding-top: 0; padding-bottom: 20px; }
    .wfp-statbar-actions .wfp-btn { flex: 1; }
    .wfp-place { padding: 22px 22px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .wfp-forum *, .wfp-forum *::before, .wfp-forum *::after { transition: none !important; animation: none !important; }
    .wfp-group-card-link:hover .wfp-group-card-media img { transform: none; }
}
