/* AllSupernatural — midnight charcoal, spectral violet, and ember-orange actions. */
:root {
    --bg: #0c0d12;
    --bg-deep: #07080c;
    --bg-card: #14161e;
    --bg-header: #101117;
    --border: #2b2e3c;
    --text: #d5d7e0;
    --text-dim: #9ca1b2;
    --accent: #afa0d9;        /* spectral violet — atmospheric glows, focus states */
    --accent-soft: #d1c4f0;
    --ember: #c77c43;
    --ember-soft: #dd975e;
    --bg-button: #211712;
    --bg-button-hover: #342219;
    --border-button: #8e613d;
    --glyph-text: #dedbea;
    --glyph-active: #d1c4f0;
    --glow: #cfeef2;          /* spectral glow white-blue */
    --heading: #f1f0f5;
    color-scheme: dark;
    --serif: Georgia, 'Times New Roman', serif;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
.sr-only {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; border: 0;
    clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}
.subcat-count { color: var(--text-dim); font-weight: 400; margin-left: .15rem; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    line-height: 1.65;
}
a { color: var(--accent-soft); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
.muted { color: var(--text-dim); }

/* header */
.site-header {
    background: linear-gradient(180deg, var(--bg-deep) 0%, var(--bg) 100%);
    padding: 30px 0 .65rem;
}
.header-inner { display: flex; flex-direction: column; gap: .35rem; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.header-row-nav { border-top: 1px solid rgba(255, 255, 255, .06); padding-top: .5rem; }
.brand { display: flex; align-items: center; gap: .8rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { height: 52px; width: auto; }
.footer-mark { height: 40px; opacity: .8; }
.brand-text {
    font-family: var(--serif);
    font-size: 1.25rem;
    color: var(--heading);
    letter-spacing: .5px;
    line-height: 1.2;
}
.brand-net { color: var(--text-dim); }
.brand-tag {
    display: block;
    font-family: var(--sans);
    font-size: .62rem;
    color: var(--accent-soft);
    letter-spacing: 1.6px;
    text-transform: uppercase;
    margin-top: .15rem;
}
.site-nav { display: flex; flex-wrap: wrap; gap: 1.3rem; }
.site-nav a {
    position: relative;
    padding: .55rem 0;
    color: var(--heading);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    opacity: .85;
    transition: color .22s ease, opacity .22s ease, text-shadow .3s ease, transform .3s ease;
}
.site-nav a::after {
    content: "";
    position: absolute;
    bottom: .2rem;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ember), var(--ember-soft), transparent);
    box-shadow: 0 2px 12px rgba(199, 124, 67, .55);
    transform: scaleX(0);
    transform-origin: center;
    opacity: 0;
    transition: transform .55s cubic-bezier(.65, 0, .35, 1), opacity .2s ease;
    pointer-events: none;
}
.site-nav a:is(:hover, :focus-visible) {
    color: var(--accent-soft);
    opacity: 1;
    text-decoration: none;
    text-shadow: 0 0 18px rgba(175, 160, 217, .65);
    transform: translateY(-2px);
}
.site-nav a:is(:hover, :focus-visible)::after { transform: scaleX(1); opacity: 1; }
.site-nav a:focus-visible { outline: 1px solid var(--accent); outline-offset: 5px; }
.mobile-menu { display: none; }
.search-form { margin-left: auto; }
.desktop-nav-row .search-form {
    display: flex;
    justify-content: flex-end;
    flex: 0 0 clamp(180px, calc(100vw - 900px), 300px);
}
.search-form input {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--text);
    padding: .45rem .9rem;
    width: 180px;
    font-size: .9rem;
    transition: width .45s cubic-bezier(.22, 1, .36, 1), border-color .25s ease, box-shadow .3s ease, background-color .3s ease;
}
.search-form input:focus {
    outline: 1px solid var(--accent);
    border-color: var(--accent);
    background: var(--bg-card);
    box-shadow: 0 0 20px rgba(175, 160, 217, .14);
}
.desktop-nav-row .search-form input:focus { width: 100%; }

@media (prefers-reduced-motion: reduce) {
    .site-nav a, .site-nav a::after, .search-form input { transition: none; }
    .site-nav a:is(:hover, :focus-visible) { transform: none; }
}

/* Hero artwork and live foreground text scroll independently. */
.hero {
    position: relative;
    width: 100%;
    background: linear-gradient(180deg, rgba(12, 13, 24, .25), rgba(12, 13, 24, .18) 45%, rgba(12, 13, 24, .58)), url('../images/main-hero-image.jpg') center / cover no-repeat;
    aspect-ratio: 4 / 1;
    min-height: 280px;
    max-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem;
}
.hero-content { text-align: center; }
.hero-title {
    color: #fff;
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5.2vw, 6.5rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -.035em;
    margin: 0 0 clamp(1.5rem, 3vw, 3rem);
    text-shadow: 0 2px 20px rgba(7, 8, 12, .35);
}
.home-page main.container { max-width: none; padding: 0; }
.home-page main .container { padding: 0 1.25rem; }

/* Native scroll-driven parallax; static artwork remains the fallback. */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .hero {
            overflow: hidden;
            isolation: isolate;
            view-timeline-name: --hero-scroll;
            view-timeline-axis: block;
        }
        .hero::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: -1;
            background: inherit;
            pointer-events: none;
            animation: hero-parallax linear both;
            animation-timeline: --hero-scroll;
            animation-range: exit 0% exit 100%;
        }
        @keyframes hero-parallax {
            from { transform: translateY(0); }
            to { transform: translateY(35%); }
        }
    }
}

/* Book-inspired nameplates: copper tooling, dark leather, inset edges. */
.btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: inline-block;
    background:
        linear-gradient(172deg, transparent 15%, rgba(237, 195, 148, .12) 15.5%, transparent 16.5%) 0 0 / 57px 31px,
        linear-gradient(24deg, transparent 68%, rgba(0, 0, 0, .3) 69%, transparent 71%) 11px 6px / 83px 43px,
        radial-gradient(ellipse at 14% 18%, rgba(199, 124, 67, .17), transparent 36%),
        radial-gradient(ellipse at 82% 80%, rgba(0, 0, 0, .3), transparent 45%),
        radial-gradient(circle at 7px 7px, #bb8757 0 1px, transparent 1.5px),
        radial-gradient(circle at calc(100% - 7px) 7px, #bb8757 0 1px, transparent 1.5px),
        radial-gradient(circle at 7px calc(100% - 7px), #bb8757 0 1px, transparent 1.5px),
        radial-gradient(circle at calc(100% - 7px) calc(100% - 7px), #bb8757 0 1px, transparent 1.5px),
        repeating-linear-gradient(115deg, transparent 0 3px, rgba(199, 124, 67, .035) 3px 4px),
        linear-gradient(180deg, rgba(199, 124, 67, .1), transparent 45%, rgba(0, 0, 0, .2)), var(--bg-button);
    border: 1px solid var(--border-button);
    border-radius: 2px;
    color: #edc394;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: 2.2px;
    text-transform: uppercase;
    padding: .85rem 1.9rem;
    text-shadow: 0 1px 1px #000;
    box-shadow: inset 0 0 0 3px var(--bg-button), inset 0 0 0 4px rgba(199, 124, 67, .2), 0 3px 0 #100c0a, 0 7px 18px rgba(0, 0, 0, .35);
    transition: transform .25s ease, box-shadow .3s ease, background-color .3s ease, border-color .3s ease, color .3s ease;
}
.btn::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent);
    transform: translateX(-160%) skewX(-20deg);
    pointer-events: none;
}
.btn::after {
    content: "";
    position: absolute;
    inset: 2px;
    border-radius: 1px;
    background:
        linear-gradient(90deg, transparent 8%, rgba(237, 195, 148, .3) 9% 17%, transparent 18% 64%, rgba(237, 195, 148, .18) 65% 79%, transparent 80%) top / 100% 1px no-repeat,
        linear-gradient(90deg, transparent 20%, rgba(199, 124, 67, .24) 21% 35%, transparent 36% 85%, rgba(237, 195, 148, .25) 86%) bottom / 100% 1px no-repeat;
    box-shadow: inset 1px 0 2px rgba(237, 195, 148, .12), inset -1px -1px 2px rgba(0, 0, 0, .5);
    pointer-events: none;
}
.btn:is(:hover, :focus-visible) {
    background-color: var(--bg-button-hover);
    color: #ffe1b9;
    text-decoration: none;
    border-color: var(--ember-soft);
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 3px var(--bg-button-hover), inset 0 0 0 4px rgba(221, 151, 94, .45), 0 4px 0 #100c0a, 0 0 22px rgba(199, 124, 67, .24);
}
.btn:is(:hover, :focus-visible)::before { animation: button-sheen .7s ease-out; }
.btn:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 4px; }
.btn:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .2); }
@keyframes button-sheen { to { transform: translateX(360%) skewX(-20deg); } }
.auth-nav > a.btn, .mobile-auth-nav > a.btn { color: #edc394; }
.auth-nav > a.btn:is(:hover, :focus-visible),
.mobile-auth-nav > a.btn:is(:hover, :focus-visible) { color: #ffe1b9; }
@media (prefers-reduced-motion: reduce) {
    .btn { transition: none; }
    .btn:is(:hover, :focus-visible, :active) { transform: none; }
    .btn:is(:hover, :focus-visible)::before { animation: none; }
}
.btn-sm { padding: .45rem 1rem; letter-spacing: 1.6px; font-size: .7rem; }
.btn-danger { background: #3a1210; border-color: #6e2018; color: var(--heading); }
.btn-danger:is(:hover, :focus-visible) { background: #4a1613; border-color: #c53030; color: var(--heading); }

/* Dark category band with alchemical marks. */
.glyph-band {
    background: radial-gradient(ellipse at 50% 0%, rgba(175, 160, 217, .09), transparent 70%), var(--bg-header);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 2.6rem 0 2.2rem;
}
.glyph-row { display: flex; justify-content: center; gap: 8%; flex-wrap: wrap; }
.glyph-link { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--glyph-text); }
.glyph-link:hover { color: var(--glyph-active); text-decoration: none; }
.glyph-icon { width: 52px; height: 52px; }
.glyph-icon svg { width: 100%; height: 100%; }
.glyph-label { font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.glyph-count { font-size: .7rem; color: #9ca1b2; letter-spacing: 1.2px; text-transform: uppercase; }
.glyph-link:hover .glyph-count { color: var(--glyph-active); }

/* A spectral halo and orbit ring bring the category glyphs to life. */
.glyph-link { position: relative; isolation: isolate; }
.glyph-icon { position: relative; display: grid; place-items: center; }
.glyph-icon::before, .glyph-icon::after {
    content: "";
    position: absolute;
    inset: -12px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transform: scale(.65) rotate(-45deg);
    transition: transform .6s cubic-bezier(.16, 1, .3, 1), opacity .35s ease;
}
.glyph-icon::before {
    background: radial-gradient(circle, rgba(175, 160, 217, .3), transparent 70%);
    z-index: -1;
}
.glyph-icon::after { border: 1px solid rgba(175, 160, 217, .45); border-top-color: transparent; border-bottom-color: transparent; }
.glyph-icon svg { transition: transform .5s cubic-bezier(.16, 1, .3, 1), filter .4s ease; }
.glyph-label, .glyph-count { transition: transform .4s ease, color .3s ease; }
.glyph-link:is(:hover, :focus-visible) { color: var(--glyph-active); text-decoration: none; }
.glyph-link:is(:hover, :focus-visible) .glyph-icon::before,
.glyph-link:is(:hover, :focus-visible) .glyph-icon::after { opacity: 1; transform: scale(1) rotate(45deg); }
.glyph-link:is(:hover, :focus-visible) .glyph-icon svg { transform: translateY(-4px) scale(1.12); filter: drop-shadow(0 4px 6px rgba(175, 160, 217, .2)); }
.glyph-link:is(:hover, :focus-visible) .glyph-label { transform: translateY(3px); }
.glyph-link:is(:hover, :focus-visible) .glyph-count { color: var(--glyph-active); transform: translateY(5px); }
.glyph-link:focus-visible { outline: 2px solid var(--glyph-active); outline-offset: 16px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
    .glyph-icon::before, .glyph-icon::after, .glyph-icon svg, .glyph-label, .glyph-count { transition: none; }
    .glyph-link:is(:hover, :focus-visible) .glyph-icon svg,
    .glyph-link:is(:hover, :focus-visible) .glyph-label,
    .glyph-link:is(:hover, :focus-visible) .glyph-count { transform: none; }
}

/* section titles — letterspaced caps like the comp's R E C E N T */
.band-title {
    font-family: var(--sans);
    font-size: .95rem;
    font-weight: 600;
    color: var(--heading);
    letter-spacing: 8px;
    text-transform: uppercase;
    text-align: center;
    margin: 3rem 0 1.4rem;
}
.section-title {
    font-family: var(--serif);
    color: var(--heading);
    border-bottom: 1px solid var(--border);
    padding-bottom: .4rem;
    margin-top: 2.2rem;
}
.page-title { font-family: var(--serif); font-size: 2.2rem; color: var(--heading); margin-bottom: .3rem; }

/* story cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.1rem;
}
.story-card {
    min-width: 0;
    overflow-wrap: anywhere;
    position: relative;
    isolation: isolate;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1.4rem 1.5rem 1.1rem;
    margin: 0 0 1.1rem;
}
.card-grid .story-card { margin: 0; display: flex; flex-direction: column; }
.story-card h3 { margin: 0 0 .3rem; font-family: var(--serif); font-size: 1.22rem; font-weight: 400; }
.story-card h3 a { color: var(--heading); }
.story-card h3 a:hover { color: #fff; }
.story-card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 3px; }
.story-card-link:hover::after { background: rgba(255, 255, 255, .025); }
.story-card-link:focus-visible::after { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
.story-card .story-meta a { position: relative; z-index: 2; }
.story-meta { font-size: .82rem; color: var(--text-dim); margin: .2rem 0 .6rem; }
.story-meta a { color: var(--text-dim); text-decoration: underline dotted; }
.story-meta a:hover { color: var(--accent-soft); }
.story-excerpt { margin: .4rem 0; color: var(--text); font-size: .93rem; flex: 1; }
.story-stats { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .85rem; font-size: .78rem; margin: .5rem 0 0; }
.story-attachment { display: inline-flex; align-items: center; gap: .3rem; }
.story-attachment svg { flex: none; color: var(--accent-soft); }
.cat-badge {
    display: inline-block;
    color: var(--ember);
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    margin-right: .4rem;
}
a.cat-badge:hover { color: var(--ember-soft); text-decoration: none; }
.subcat-nav { margin: .5rem 0 1.8rem; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; }

/* Original illustrated books, presented as artifacts from each archive. */
.category-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 195px;
    align-items: center;
    gap: 2rem;
    margin: 1.5rem 0 1.2rem;
    padding: 1.25rem 2rem;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: radial-gradient(ellipse at 90% 50%, rgba(175, 160, 217, .09), transparent 60%), var(--bg-header);
}
.category-eyebrow { color: var(--ember); font-size: .68rem; font-weight: 600; letter-spacing: 2.5px; text-transform: uppercase; margin: 0 0 .5rem; }
.category-intro .page-title { margin: 0; font-weight: 400; font-size: clamp(2rem, 3.5vw, 3rem); line-height: 1.2; }
.category-description { max-width: 540px; margin: .65rem 0 0; color: var(--text-dim); }
.category-book { position: relative; isolation: isolate; display: grid; place-items: center; padding: .25rem 0; }
.category-book::before {
    content: "";
    position: absolute;
    inset: -10%;
    z-index: -1;
    background: radial-gradient(ellipse, rgba(199, 124, 67, .14), transparent 65%);
}
.category-book img {
    display: block;
    width: 175px;
    max-width: 100%;
    height: auto;
    filter: saturate(.65) brightness(.9) drop-shadow(0 18px 16px rgba(0, 0, 0, .45));
}
@media (max-width: 600px) {
    .category-intro { grid-template-columns: minmax(0, 1fr); gap: .25rem; padding: 1rem 1.25rem; text-align: center; }
    .category-book { grid-row: 1; }
    .category-book img { width: 115px; }
    .category-intro .page-title { font-size: 1.8rem; }
    .category-description { font-size: .9rem; }
}

/* story page */
.breadcrumb { font-size: .8rem; margin: 1.4rem 0 .4rem; letter-spacing: .6px; text-transform: uppercase; }
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--accent-soft); }
.story-full { width: 100%; min-width: 0; margin: 0 auto; }
.story-body {
    overflow-wrap: anywhere;
    font-size: 1.1rem;
    font-family: var(--serif);
    color: var(--heading);
    margin: 1.5rem 0;
}
.story-body p { margin: 1.05rem 0; }
.story-detail, .submit-card, .account-area {
    position: relative;
    isolation: isolate;
}
.story-detail::before, .submit-card::before, .account-area::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: min(900px, 100%);
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 25% 12%, rgba(199, 124, 67, .09), transparent 45%),
        radial-gradient(ellipse 80% 500px at 50% 230px, rgba(48, 44, 60, .3), transparent);
    mask-image:
        linear-gradient(to right, transparent, #000 12%, #000 88%, transparent),
        linear-gradient(to bottom, transparent, #000 90px, #000 70%, transparent);
    mask-composite: intersect;
}
.story-detail .story-heading {
    margin-top: 1.5rem;
    padding: 1.4rem clamp(1.1rem, 3vw, 2rem) 1.6rem;
}
.story-detail .breadcrumb { margin: 0 0 1rem; }
.story-detail .breadcrumb a { color: var(--ember-soft); }
.story-detail .breadcrumb a:hover { color: #ffe1b9; }
.story-detail .page-title { margin-top: 0; color: #fffaf3; font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.15; }
.story-detail .story-meta { margin-top: .9rem; color: #b6b8c6; }
.story-detail .story-meta a { color: var(--accent-soft); }
.story-detail .story-body {
    margin: 0;
    padding: 1.25rem clamp(1.1rem, 3vw, 2rem);
    background: transparent;
    color: #f3eee6;
    line-height: 1.85;
    border: 0;
}
.story-detail .comments > .section-title {
    color: var(--ember-soft);
    border-bottom: 0;
    padding-bottom: .8rem;
    background: linear-gradient(90deg, rgba(199, 124, 67, .65), transparent 75%) left bottom / 100% 1px no-repeat;
}
.story-detail .comment-list > .comment {
    margin: .8rem 0;
    padding: 1.1rem clamp(1.1rem, 3vw, 2rem);
    background: linear-gradient(90deg, transparent, rgba(131, 120, 161, .25) 15%, rgba(131, 120, 161, .25) 70%, transparent) left bottom / 100% 1px no-repeat;
    border: 0;
    border-radius: 0;
}
.story-detail .comment-meta strong { color: var(--accent-soft); }
.story-detail .comment-meta .muted { color: #aeb3c3; }
.story-detail .comment-body { color: #e2e4ec; }
.story-detail .comment-reply { border-left-color: var(--ember); }
.media-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.media-grid figure { margin: 0; max-width: 240px; }
.media-grid img { max-width: 100%; border-radius: 2px; border: 1px solid var(--border); }
.media-grid figcaption { font-size: .8rem; color: var(--text-dim); margin-top: .3rem; }
.media-audio { width: 100%; max-width: 420px; }
.media-audio audio { width: 100%; }

/* comments */
.comments { margin-top: 2.5rem; }
.flag-form { margin: .65rem 0; }
.flag-form .flag-button { position: relative; display: inline-grid; place-items: center; width: 44px; min-height: 44px; padding: .5rem; }
.flag-button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.flag-tooltip { position: absolute; top: 50%; left: 100%; transform: translateY(-50%); z-index: 2; width: max-content; padding: .4rem .65rem; border: 1px solid #9b4b50; border-radius: 5px; background: #58272d; color: #fff1f2; font-size: .8rem; line-height: 1.5; box-shadow: 0 4px 14px #0006; visibility: hidden; }
.flag-button:hover .flag-tooltip, .flag-button:focus-visible .flag-tooltip { visibility: visible; }
.comment-composer { margin: 1rem 0 1.5rem; }
.comment-composer > summary { color: var(--accent-soft); cursor: pointer; padding: .6rem 0; min-height: 44px; }
.comment-composer > summary:hover { text-decoration: underline; }
.comment-composer > summary:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
.comment { border-top: 1px solid var(--border); padding: .9rem 0; }
.comment-meta { margin: 0 0 .3rem; font-size: .9rem; }
.comment-meta strong { color: var(--heading); }
.comment-meta .muted { margin-left: .5rem; font-size: .8rem; }
.comment-body { font-size: .96rem; }
.comment-body p { margin: .4rem 0; }
.comment-reply {
    border-top: 1px solid rgba(255, 255, 255, .06);
    border-left: 2px solid var(--border);
    margin: .8rem 0 0 1.1rem;
    padding: .75rem 0 .2rem 1rem;
}
.reply-panel { margin-top: .65rem; }
.reply-panel summary {
    color: var(--accent-soft);
    cursor: pointer;
    font-size: .8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.reply-form {
    border-top: none;
    margin-top: .6rem;
    padding-top: 0;
}

/* member profile */
.member-header { display: flex; gap: 1.5rem; align-items: flex-start; margin: 2rem 0; }
.avatar {
    width: 96px; height: 96px;
    border-radius: 3px;
    border: 1px solid var(--border);
    object-fit: cover;
    background: var(--bg-card);
}
.member-about { font-size: .95rem; color: var(--text-dim); }

/* static pages */
.page-body {
    width: 100%;
    margin: 2rem auto 0;
}
.page-body h2 {
    color: var(--heading);
    font-family: var(--serif);
    font-size: 1.25rem;
    font-weight: 400;
    margin: 2rem 0 .45rem;
}
.page-body ul { padding-left: 1.4rem; }
.page-body li { margin: .35rem 0; }
.site-map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem 2rem;
    margin-top: 1rem;
}
.site-map-list { list-style: none; margin: 0; padding: 0; }
.site-map-list li { margin: .2rem 0; }

/* auth + forms */
.auth-nav { display: flex; align-items: center; gap: 1rem; font-size: .85rem; }
.auth-nav > a { color: var(--text); }
.mobile-auth-nav { display: none; }
.inline-form { display: inline; }
.link-btn {
    background: none; border: none; color: var(--text-dim);
    cursor: pointer; font: inherit; font-size: .85rem; padding: 0;
}
.link-btn:hover { color: var(--accent-soft); }
.auth-card {
    max-width: 460px;
    margin: 3rem auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2rem 2.2rem 2.2rem;
}
.auth-card form { display: flex; flex-direction: column; gap: .9rem; margin-top: 1.2rem; }
.auth-card label { display: flex; flex-direction: column; gap: .3rem; font-size: .82rem; color: var(--text-dim); letter-spacing: .8px; text-transform: uppercase; }
.auth-card input[type=email], .auth-card input[type=password], .auth-card input[type=text], .auth-card input[type=url],
.auth-card input[type=date], .auth-card select, .auth-card textarea, .comment-form textarea {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 2px;
    color: var(--text);
    padding: .6rem .8rem;
    font-size: 1rem;
    font-family: var(--sans);
}
.auth-card input:focus, .auth-card select:focus, .auth-card textarea:focus,
.comment-form textarea:focus { outline: 1px solid var(--accent); }
.check-label { flex-direction: row !important; align-items: center; gap: .5rem !important; text-transform: none !important; }
.auth-links { font-size: .85rem; margin-top: 1.4rem; }
.form-error { color: #fc8181; font-size: .85rem; margin: -.4rem 0 0; }
.flash {
    background: rgba(175, 160, 217, .08);
    border: 1px solid rgba(175, 160, 217, .45);
    border-radius: 2px;
    color: var(--accent-soft);
    margin: 1.2rem auto;
    padding: .8rem 1.1rem;
    max-width: 1080px;
}
.home-page .flash { margin: 1.2rem; }

/* submission + moderation */
.hp-field { position: absolute; left: -9999px; height: 0; width: 0; opacity: 0; }
.submit-card {
    max-width: 1120px;
    padding: clamp(1.25rem, 4vw, 3rem);
    background: transparent;
    border-color: transparent;
}
.submit-card form { gap: 1.3rem; }
.submit-card input[type="text"]:not(.hp-field), .submit-card input[type="url"], .submit-card input[type="date"], .submit-card select {
    min-height: 54px;
    padding: .85rem 1rem;
    border-radius: 5px;
    line-height: 1.5;
}
.submit-card label:not(.story-category-choice) { gap: .5rem; }
.submit-card textarea { min-height: 360px; resize: vertical; line-height: 1.75; }
.submit-card .field-row { flex-wrap: wrap; }
.submit-card .field-row label { min-width: 0; flex: 1 1 200px; }
.submit-card .field-row input { min-width: 0; width: 100%; }
.submit-card .btn { align-self: flex-start; }
.story-category-options { border: 0; padding: 0; margin: 0 0 1.1rem; min-width: 0; }
.story-category-options legend { font-size: .82rem; color: var(--text-dim); letter-spacing: .8px; text-transform: uppercase; }
.category-help { font-size: .85rem; color: var(--text-dim); margin: .4rem 0 .8rem; }
.story-category-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.auth-card .story-category-choice {
    flex-direction: row; align-items: center; gap: .7rem; padding: 1rem;
    border: 1px solid var(--border); border-radius: 3px; background: var(--bg-deep);
    cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 1rem; color: var(--text);
}
.story-category-choice input { accent-color: var(--accent); flex-shrink: 0; }
.story-category-choice:has(input:checked) { border-color: var(--accent); background: rgba(175, 160, 217, .12); }
.story-category-choice:hover { border-color: var(--accent-soft); }
.story-category-choice:has(input:focus-visible) { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
@media (max-width: 760px) {
    .story-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 380px) {
    .story-category-grid { grid-template-columns: 1fr; }
}
.field-row { display: flex; gap: .8rem; }
.field-row label { flex: 1; }
.comment-form { display: flex; flex-direction: column; gap: .6rem; margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.3rem; }
.comment-form textarea {
    width: 100%;
    min-height: 160px;
    padding: 1rem 1.2rem;
    border-radius: 5px;
    line-height: 1.65;
    resize: vertical;
}
.comment-form .btn { align-self: flex-start; }
.comment-cta { border-top: 1px solid var(--border); margin-top: 1.5rem; padding-top: 1.3rem; }
.mod-actions { display: flex; gap: .8rem; margin-top: 1rem; }
.mod-verdict {
    border-left: 3px solid var(--border);
    font-size: .85rem;
    margin: .6rem 0;
    padding: .3rem .8rem;
}
.mod-verdict strong { text-transform: uppercase; letter-spacing: 1.2px; font-size: .78rem; }
.mod-verdict-flag { border-left-color: #f6ad55; color: #f6ad55; }
.mod-verdict-spam { border-left-color: #fc8181; color: #fc8181; }
.mod-verdict-approve { border-left-color: var(--accent); color: var(--accent-soft); }
.pending-card { border-color: rgba(175, 160, 217, .5); }
.pending-body { max-height: 260px; overflow-y: auto; font-size: .95rem; padding-right: .5rem; }
.badge-pending {
    border: 1px solid rgba(246, 173, 85, .5);
    border-radius: 2px;
    color: #f6ad55;
    font-size: .65rem;
    font-family: var(--sans);
    letter-spacing: 1.4px;
    text-transform: uppercase;
    padding: .12rem .55rem;
    vertical-align: middle;
}

/* homepage cta + pagination */
.home-cta { text-align: center; margin: 2.6rem 0 1rem; }
.pagination { margin: 2rem 0; padding-top: 1.5rem; border-top: 1px solid var(--border); text-align: center; }
.pagination-summary { color: var(--text-dim); font-size: .78rem; margin: 0 0 1rem; font-variant-numeric: tabular-nums; }
.pagination-controls, .pagination-numbers { display: flex; align-items: center; justify-content: center; gap: .4rem; }
.page-control {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    min-width: 44px; min-height: 44px; padding: .5rem .7rem;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 3px;
    color: var(--text); font-size: .85rem; font-variant-numeric: tabular-nums;
    transition: background-color .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease;
}
.page-direction { padding-inline: 1rem; }
a.page-control:hover { text-decoration: none; border-color: var(--ember); color: var(--ember-soft); background: #251e1b; box-shadow: 0 0 16px rgba(199, 124, 67, .12); }
a.page-control:focus-visible { outline: 2px solid var(--ember); outline-offset: 3px; }
.page-control[aria-current=page] { background: var(--ember); border-color: var(--ember); color: var(--bg-deep); font-weight: 700; }
.page-control[aria-disabled=true] { color: var(--text-dim); opacity: .45; background: transparent; }
.page-ellipsis { min-width: 24px; color: var(--text-dim); }
.pagination-position { display: none; color: var(--text-dim); font-size: .8rem; font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
    .pagination-numbers { display: none; }
    .pagination-position { display: block; }
    .pagination-controls { justify-content: space-between; gap: .5rem; }
    .page-direction { padding-inline: .7rem; }
}
@media (prefers-reduced-motion: reduce) { .page-control { transition: none; } }

/* 404 — the eye from the original 2006 header, watching from the dark */
.lost-page {
    position: relative;
    text-align: center;
    padding: 5rem 1rem 10rem;
    max-width: 560px;
    margin: 0 auto;
}
.lost-code {
    font-family: var(--serif);
    font-size: 1rem;
    letter-spacing: 6px;
    color: var(--text-dim);
    margin: 0 0 .4rem;
}
.lost-actions { margin-top: 2.2rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.lost-link { font-size: .88rem; color: var(--text-dim); }
.lost-link:hover { color: var(--accent-soft); }
.the-eye {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 245px;
    height: 100px;
    background: url('../images/the-eye.png') center / contain no-repeat;
    opacity: 0;
    transition: opacity 4s ease-in;
    pointer-events: none;
}
.the-eye.awake { opacity: .75; }
.the-eye.blink { opacity: .05; transition: opacity .12s ease-out; }

/* footer */
.site-footer {
    background: var(--bg-deep);
    margin-top: 4rem;
    padding: 2.2rem 0 2.6rem;
    font-size: .85rem;
    color: var(--text-dim);
    text-align: center;
}
.site-footer p { margin: .3rem 0; }
.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .5rem 1rem;
}
.footer-links a { color: var(--text-dim); }
.footer-links a:hover { color: var(--accent-soft); }
.home-page .site-footer { margin-top: 0; }

@media (max-width: 820px) {
    .brand-tag { display: none; }
    .brand-mark { height: 38px; }
    .brand-text { font-size: 1.05rem; }
    .brand { min-width: 0; }
    .header-row { flex-wrap: nowrap; }
    .desktop-auth,
    .desktop-nav-row { display: none; }
    .mobile-menu {
        border-top: 1px solid rgba(255, 255, 255, .06);
        display: block;
        padding-top: .45rem;
    }
    .mobile-menu-summary {
        align-items: center;
        color: var(--heading);
        cursor: pointer;
        display: flex;
        font-size: .78rem;
        font-weight: 600;
        justify-content: space-between;
        letter-spacing: 0;
        list-style: none;
        min-height: 44px;
        text-transform: uppercase;
    }
    .mobile-menu-summary::-webkit-details-marker { display: none; }
    .mobile-menu-icon,
    .mobile-menu-icon::before,
    .mobile-menu-icon::after {
        background: var(--heading);
        content: "";
        display: block;
        height: 2px;
        transition: transform .16s ease, background-color .16s ease;
        width: 20px;
    }
    .mobile-menu-icon {
        position: relative;
    }
    .mobile-menu-icon::before,
    .mobile-menu-icon::after {
        left: 0;
        position: absolute;
    }
    .mobile-menu-icon::before { top: -6px; }
    .mobile-menu-icon::after { top: 6px; }
    .mobile-menu[open] .mobile-menu-icon { background: transparent; }
    .mobile-menu[open] .mobile-menu-icon::before { transform: translateY(6px) rotate(45deg); }
    .mobile-menu[open] .mobile-menu-icon::after { transform: translateY(-6px) rotate(-45deg); }
    .mobile-menu-panel {
        display: grid;
        gap: .85rem;
        padding: .3rem 0 .8rem;
    }
    .mobile-site-nav {
        display: grid;
        gap: .5rem;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .mobile-site-nav a {
        background: var(--bg-deep);
        border: 1px solid var(--border);
        border-radius: 2px;
        color: var(--heading);
        font-size: .72rem;
        font-weight: 600;
        letter-spacing: 0;
        min-height: 42px;
        padding: .62rem .7rem;
        text-transform: uppercase;
    }
    .mobile-site-nav a:hover {
        border-color: var(--accent);
        color: var(--accent-soft);
        text-decoration: none;
    }
    .mobile-auth-nav {
        align-items: center;
        border-top: 1px solid rgba(255, 255, 255, .06);
        display: flex;
        flex-wrap: wrap;
        gap: .7rem 1rem;
        padding-top: .8rem;
    }
    .mobile-auth-nav > a { color: var(--text); }
    .search-form { margin-left: 0; width: 100%; }
    .search-form input { width: 100%; }
    .field-row { flex-direction: column; }
    .glyph-row { gap: 1.6rem 2.2rem; }
    .glyph-icon { width: 42px; height: 42px; }
    .hero {
        aspect-ratio: auto;
        height: 280px;
        background-position: 42% center;
    }
    .btn-hero { padding: .7rem 1.3rem; }
    .member-header { flex-direction: column; }
    .auth-card { padding: 1.5rem 1.2rem; margin: 1.5rem auto; }
}

/* Comment loading feedback occupies a stable space between batches. */
.comment-loader { text-align: center; padding: 1.5rem 0; }
.comment-loading-status { min-height: 1.5rem; color: var(--text-dim); font-size: .85rem; }
.comment-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    margin-right: .5rem;
    vertical-align: -.15rem;
    border: 2px solid rgba(199, 124, 67, .2);
    border-top-color: var(--ember-soft);
    border-radius: 50%;
    animation: comment-spin .8s linear infinite;
}
.comment-spinner[hidden], [data-comment-next][hidden] { display: none; }
[data-comment-next][aria-disabled="true"] { opacity: .55; cursor: progress; }
@keyframes comment-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .comment-spinner { animation: none; }
}

/* Evidence gallery and native modal viewer */
.story-media {
    margin: 1.8rem clamp(1.1rem, 3vw, 2rem) 2.4rem;
    padding-top: 1.2rem;
    background: linear-gradient(90deg, rgba(199,124,67,.4), transparent 85%) left top / 100% 1px no-repeat;
    display: grid;
    grid-template-columns: 155px minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
}
.evidence-heading { display: grid; gap: .4rem; padding-top: .3rem; }
.evidence-heading h2 { font: 400 1.1rem var(--serif); color: var(--heading); margin: 0; }
.evidence-type { color: var(--ember-soft); font-size: .62rem; text-transform: uppercase; letter-spacing: 1.5px; }
.evidence-count { color: var(--text-dim); font-size: .75rem; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: .75rem; }
.evidence-card { display: flex; align-items: center; gap: .85rem; min-width: 0; padding: .5rem; border: 1px solid transparent; border-radius: 5px; background: rgba(28,26,35,.45); transition: border-color .25s, background-color .25s; }
.evidence-card:hover { text-decoration: none; border-color: rgba(199,124,67,.45); background: #211c22; }
.evidence-card:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 4px; }
.evidence-preview { flex: 0 0 64px; width: 64px; height: 64px; border-radius: 3px; background: radial-gradient(ellipse, #332735, #0c0d12 80%); display: grid; place-items: center; overflow: hidden; }
.evidence-preview img { width: 100%; height: 100%; object-fit: cover; }
.evidence-preview-audio { background: radial-gradient(ellipse, #30251e, #0c0d12 80%); }
.evidence-symbol { font-size: 2rem; color: var(--ember-soft); font-weight: 300; }
.evidence-caption { min-width: 0; flex: 1; display: grid; gap: .2rem; }
.evidence-caption strong { font: 400 1rem var(--serif); color: var(--heading); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evidence-action { color: var(--text-dim); font-size: .7rem; display: flex; justify-content: space-between; gap: .5rem; }
@media (max-width: 700px) {
    .story-media { grid-template-columns: minmax(0, 1fr); gap: .8rem; }
    .evidence-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
}
.media-viewer { width: min(1100px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 32px); padding: 0; color: var(--text); background: #101117; border: 1px solid #49404e; border-radius: 12px; box-shadow: 0 30px 100px #000b; }
.media-viewer::backdrop { background: #030409e8; backdrop-filter: blur(8px); }
.media-viewer[open] { display: flex; flex-direction: column; animation: viewer-open .25s ease-out; }
.viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.3rem; }
.viewer-header h2 { margin: .25rem 0 0; font: 400 1.3rem var(--serif); color: var(--heading); overflow-wrap: anywhere; }
.viewer-stage { height: min(62dvh, 650px); min-height: 150px; flex-shrink: 1; overflow: auto; background: #06070a; overscroll-behavior: contain; }
.viewer-canvas { min-width: 100%; min-height: 100%; width: max-content; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.viewer-canvas img { display: block; max-width: none; flex-shrink: 0; }
.viewer-canvas video { display: block; width: min(100%, 1000px); max-height: 56dvh; }
.viewer-canvas:has(video), .viewer-canvas:has(audio) { width: 100%; }
.viewer-canvas audio { width: min(100%, 540px); }
.viewer-audio-emblem { font-size: 7rem; color: var(--ember-soft); line-height: 1.5; text-shadow: 0 0 60px #c77c4355; }
.viewer-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 1.3rem 1rem; }
.viewer-paging, .viewer-zoom { display: flex; align-items: center; gap: .5rem; }
.viewer-zoom[hidden] { display: none; }
.viewer-zoom output { min-width: 3.5rem; text-align: center; font-size: .8rem; font-variant-numeric: tabular-nums; }
.viewer-control { min-width: 44px; min-height: 44px; padding: .4rem .7rem; border: 1px solid #49404e; background: #1e1b26; border-radius: 5px; color: var(--heading); cursor: pointer; font: inherit; }
.viewer-control:hover:not(:disabled) { border-color: var(--ember); background: #30241c; }
.viewer-control:focus-visible, .viewer-original:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.viewer-control:disabled { opacity: .3; cursor: default; }
.viewer-original { font-size: .8rem; color: var(--ember-soft); }
.viewer-status { margin: .65rem 1.3rem; min-height: 1.4em; font-size: .78rem; color: var(--text-dim); }
@keyframes viewer-open { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 600px) {
    .viewer-toolbar { justify-content: center; }
    .viewer-original { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
    .media-viewer[open] { animation: none; }
    .evidence-card { transition: none; }
    .evidence-card:hover { transform: none; }
}
.viewer-stage.is-zoomed { cursor: grab; }
.viewer-stage.is-dragging { cursor: grabbing; user-select: none; }
.viewer-canvas img { -webkit-user-drag: none; user-select: none; }

/* Submission category motion and locally hosted rich-text editor. */
.story-category-choice { transition: background-color 220ms ease, border-color 220ms ease, box-shadow 220ms ease; }
.story-category-choice:has(input:checked) { box-shadow: 0 0 18px rgba(175, 160, 217, .08); }
.story-composer { min-width: 0; }
.story-composer > textarea { width: 100%; }
.story-editor-shell { border: 1px solid var(--border); border-radius: 3px; background: var(--bg-deep); }
.story-editor-shell:focus-within { border-color: var(--accent); }
.story-editor-shell .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--border); background: var(--bg-card); padding: .65rem; }
.story-editor-shell .ql-container.ql-snow { border: 0; font-family: var(--sans); font-size: 1.05rem; }
.story-editor-shell .ql-editor { min-height: 360px; padding: 1.3rem 1.5rem; line-height: 1.8; color: var(--text); overflow-wrap: anywhere; }
.story-editor-shell .ql-editor.ql-blank::before { color: var(--text-dim); font-style: normal; left: 1.5rem; right: 1.5rem; }
.story-editor-shell .ql-snow .ql-stroke { stroke: var(--text); }
.story-editor-shell .ql-snow .ql-fill { fill: var(--text); }
.story-editor-shell .ql-toolbar button { width: 36px; height: 36px; border-radius: 3px; }
.story-editor-shell .ql-toolbar button:hover, .story-editor-shell .ql-toolbar button.ql-active { background: rgba(175, 160, 217, .17); }
.story-editor-shell .ql-toolbar button:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.story-editor-shell .ql-snow .ql-tooltip { background: var(--bg-card); color: var(--text); border-color: var(--border); box-shadow: 0 4px 18px #0006; z-index: 2; white-space: normal; max-width: min(420px, 85vw); }
.story-editor-shell .ql-snow .ql-tooltip input[type=text] { width: 170px; max-width: 100%; font-size: 16px; height: 36px; }
.story-editor-shell .ql-snow .ql-tooltip a { color: var(--accent-soft); }
.story-editor-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .4rem 1rem; padding: .7rem 1rem; border-top: 1px solid var(--border); color: var(--text-dim); font-size: .78rem; }
.story-editor-error { margin-top: .7rem; }
.story-body h2, .story-body h3 { margin: 1.5em 0 .6em; }
.story-body ul, .story-body ol { padding-left: 1.6em; margin: 1em 0; }
.story-body li { margin: .35em 0; }
.story-body blockquote, .story-editor-shell .ql-editor blockquote { border-left: 3px solid var(--accent); padding-left: 1.1em; margin: 1em 0; color: var(--text-dim); }
.story-body a, .story-editor-shell .ql-editor a { color: var(--accent-soft); text-decoration: underline; }
@media (prefers-reduced-motion: reduce) {
    .story-category-choice { transition: none; }
}
@media (max-width: 600px) {
    .story-editor-shell .ql-editor { padding: 1rem; }
    .story-editor-shell .ql-toolbar.ql-snow .ql-formats { margin-right: .35rem; }
    .story-editor-footer { font-size: .75rem; }
}

/* Style the topic control while retaining the browser's selection behavior. */
.submit-card select[name="sub_category_id"] {
    width: 100%; min-height: 54px; padding: .85rem 1rem;
    border: 1px solid #68503f; border-radius: 5px;
    background: linear-gradient(110deg, #211a17, #15141d 65%);
    color: var(--text); font-weight: 500; letter-spacing: .15px;
    box-shadow: inset 0 1px 0 #ffffff08;
    cursor: pointer;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}
.submit-card select[name="sub_category_id"]:invalid { color: var(--text-dim); }
.submit-card select[name="sub_category_id"]:hover { border-color: var(--ember); }
.submit-card select[name="sub_category_id"]:focus-visible {
    outline: 2px solid var(--accent); outline-offset: 3px;
    border-color: var(--accent);
}
/* Supported desktop browsers can also style the native popup. Mobile retains its OS picker. */
@supports (appearance: base-select) {
    @media (hover: hover) and (pointer: fine) {
        .submit-card select[name="sub_category_id"],
        .submit-card select[name="sub_category_id"]::picker(select) { appearance: base-select; }
        .submit-card select[name="sub_category_id"]::picker-icon {
            color: var(--ember-soft); font-size: .85rem; margin-left: auto;
        }
        .submit-card select[name="sub_category_id"]::picker(select) {
            margin-top: 8px; padding: 6px; border: 1px solid #68503f; border-radius: 6px;
            background: #17161e; color: var(--text); max-height: 340px; overflow-y: auto;
            box-shadow: 0 18px 40px #0009, inset 0 1px 0 #ffffff08;
            font: 1rem var(--sans); scrollbar-color: #685879 #17161e;
        }
        .submit-card select[name="sub_category_id"] option {
            min-height: 44px; padding: .7rem 1rem; border-radius: 3px;
            gap: .8rem; cursor: pointer; text-transform: none; letter-spacing: 0;
        }
        .submit-card select[name="sub_category_id"] option[value=""] {
            color: var(--text-dim); font-size: .88rem;
            border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 4px;
        }
        .submit-card select[name="sub_category_id"] option:hover,
        .submit-card select[name="sub_category_id"] option:focus { background: #30283e; color: var(--heading); outline: none; }
        .submit-card select[name="sub_category_id"] option:checked { background: #292333; color: var(--accent-soft); }
        .submit-card select[name="sub_category_id"] option::checkmark { color: var(--ember-soft); }
    }
}
@media (prefers-reduced-motion: reduce) {
    .submit-card select[name="sub_category_id"] { transition: none; }
}

.blog-author-header .page-title { overflow-wrap: anywhere; }

.evidence-preview-video { position: relative; }
.evidence-play { position: absolute; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #08090cbb; color: #fff; font-size: .8rem; border: 1px solid #ffffff70; }
.viewer-canvas:has(iframe) { width: 100%; }
.viewer-canvas iframe { width: 100%; aspect-ratio: 16 / 9; min-height: 200px; max-height: 56dvh; border: 0; }
.submission-videos { margin: 1.5rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: 5px; min-width: 0; }
.submission-videos legend { font-family: var(--serif); color: var(--heading); padding: 0 .5rem; }

.video-slot { min-width: 0; margin: 1rem 0; padding: 1rem; border: 1px solid var(--border); border-radius: 5px; }
.video-source-choice { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; margin-bottom: 1rem; }
.video-source-choice[hidden], .video-slot [hidden] { display: none; }
.submit-card .video-source-choice label { display: flex; flex-direction: row; align-items: center; gap: .5rem; margin: 0; cursor: pointer; }
.video-source-choice input[type=radio] { width: auto; min-height: auto; margin: 0; accent-color: var(--ember); }
.video-slot input[type=file] { max-width: 100%; font-size: .9rem; }
.video-slot input[type=file]::file-selector-button { margin-right: .75rem; padding: .65rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-card); color: var(--heading); cursor: pointer; }

.submission-evidence { min-width: 0; margin: 1rem 0; padding: 1.75rem; border: 1px solid var(--border); border-radius: 6px; }
.submission-evidence legend { padding: 0 .5rem; font-family: var(--serif); color: var(--heading); }
.submission-evidence > .category-help:first-of-type { margin: .5rem 0 1.5rem; }
.submission-evidence #evidence-file-help { margin: 1.25rem 0 0; line-height: 1.9; }
.evidence-dropzone { display: flex; flex-direction: column; align-items: center; gap: 1rem; padding: 2.5rem 1.25rem; border: 1px dashed var(--ember); border-radius: 6px; background: var(--bg-deep); text-align: center; }
.evidence-dropzone.is-dragging, .evidence-dropzone:focus-within { background: #29212a; outline: 2px solid var(--accent); outline-offset: 2px; }
.evidence-dropzone strong { color: var(--heading); font: 1.2rem var(--serif); }
.evidence-dropzone input { max-width: 100%; font-size: .9rem; }
.evidence-dropzone input::file-selector-button { background: var(--bg-card); color: var(--heading); border: 1px solid var(--border); border-radius: 4px; padding: .7rem 1rem; margin-right: .6rem; cursor: pointer; }
.evidence-link-entry { display: flex; align-items: flex-end; gap: 1rem; margin: 2rem 0 1.5rem; }
.evidence-link-entry label { flex: 1; min-width: 0; }
.evidence-link-entry button { min-height: 54px; white-space: nowrap; }
.submit-card .evidence-link-entry .btn { align-self: auto; }
.evidence-pending-list { display: grid; gap: .6rem; list-style: none; padding: 0; margin: 0; }
.evidence-pending-item { display: flex; align-items: center; gap: .85rem; padding: .75rem; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 5px; }
.evidence-pending-preview { flex: 0 0 48px; width: 48px; height: 48px; object-fit: cover; display: grid; place-items: center; background: var(--bg-card); border-radius: 4px; color: var(--ember-soft); font-size: 1.6rem; }
.evidence-pending-detail { min-width: 0; flex: 1; display: grid; gap: .3rem; }
.evidence-pending-detail strong { color: var(--heading); overflow-wrap: anywhere; font-size: .95rem; font-weight: 400; }
.evidence-pending-detail span { color: var(--text-dim); font-size: .75rem; }
.evidence-remove { min-height: 44px; padding: .5rem; color: var(--text-dim); border: 0; background: transparent; cursor: pointer; }
.evidence-remove:hover { color: var(--heading); }
.evidence-remove:focus-visible { outline: 2px solid var(--accent); }
@media (max-width: 600px) {
    .submission-evidence { padding: 1.25rem 1rem; }
    .evidence-dropzone { padding: 2rem 1rem; }
    .evidence-link-entry { flex-direction: column; align-items: stretch; }
    .evidence-pending-item { gap: .5rem; }
}
.evidence-pending-detail progress { width: 100%; height: 8px; accent-color: var(--ember); }
.evidence-retry { justify-self: start; background: transparent; border: 1px solid var(--border); color: var(--heading); padding: .5rem .7rem; border-radius: 4px; cursor: pointer; min-height: 44px; }
.submit-card button[type=submit]:disabled { opacity: .5; cursor: wait; }

/* Private member area */
.account-area { margin: 2.5rem auto; padding: 1.5rem clamp(0rem, 2vw, 1.5rem) 3rem; }
.account-welcome, .account-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.account-heading { display: flex; align-items: center; gap: 1.5rem; padding: .75rem 0 1rem; }
.account-heading .account-header-avatar { width: 96px; height: 96px; object-fit: cover; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--border); }
.account-identity { min-width: 0; }
.account-heading .page-title { margin: .35rem 0 .5rem; font-size: clamp(2rem, 4.5vw, 3.5rem); line-height: 1.15; overflow-wrap: anywhere; }
.account-identity > a { display: inline-block; padding: .35rem 0; }
.account-nav { display: flex; flex-wrap: wrap; gap: .35rem 1rem; border-bottom: 1px solid var(--border); margin: 1.5rem 0 2rem; }
.account-nav a { display: block; padding: .7rem .3rem; min-height: 44px; border-bottom: 2px solid transparent; color: var(--text-dim); }
.account-nav a[aria-current=page] { border-bottom-color: var(--ember); color: var(--heading); }
.account-nav a:hover { color: var(--heading); text-decoration: none; }
.account-welcome h2 { font: 1.6rem var(--serif); color: var(--heading); margin: 0 0 .6rem; }
.account-welcome p { max-width: 38rem; margin: 0; }
.account-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 2rem 0 2.5rem; }
.account-stats a { padding: 1.3rem; border: 1px solid var(--border); border-radius: 6px; background: linear-gradient(145deg, #201c2988, #14161e66); color: var(--text); }
.account-stats a:hover { border-color: var(--ember); text-decoration: none; }
.account-stats strong { display: block; font: 2.3rem var(--serif); color: var(--heading); margin: .65rem 0; }
.account-stats small { color: var(--text-dim); }
.account-empty { padding: 2rem 0; }
.account-content .account-form { max-width: none; margin: 0; padding: 0; border: 0; }
.account-form::before { display: none; }
.account-form form { max-width: 760px; margin-bottom: 2.5rem; }
.account-form textarea { min-height: 160px; }
.account-form input[type=email], .account-form input[type=password] { min-height: 54px; padding: .85rem 1rem; border-radius: 5px; }
.account-avatar-row { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.account-avatar-row .avatar { width: 80px; height: 80px; object-fit: cover; }
.account-avatar-row input { max-width: 100%; }
.account-favorite { margin-bottom: 1.5rem; }
.account-favorite .story-card { margin-bottom: .3rem; }
.account-favorite button, .favorite-form button { min-height: 44px; }
.favorite-form { display: inline-block; margin-top: 1rem; }
@media (max-width: 600px) {
    .account-area { margin-top: 1rem; }
    .account-heading { gap: 1rem; }
    .account-heading .account-header-avatar { width: 72px; height: 72px; }
    .account-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; }
    .account-stats a { padding: 1rem; }
    .account-nav { gap: .25rem .8rem; }
}

.account-form .avatar-editor { display: flex; flex-direction: row; align-items: center; gap: 1.75rem; padding: 1rem 0 2rem; border-bottom: 1px solid var(--border); }
.avatar-editor-preview { position: relative; flex: 0 0 120px; }
.avatar-editor-preview > img { display: block; width: 120px; height: 120px; border-radius: 20px; object-fit: cover; border: 1px solid #554453; box-shadow: 0 8px 30px #0004; }
.avatar-editor-badge { position: absolute; bottom: -6px; right: -6px; display: grid; place-items: center; width: 34px; height: 34px; border: 3px solid var(--bg); border-radius: 50%; background: #332832; color: var(--ember-soft); }
.avatar-editor-controls { min-width: 0; flex: 1; }
.avatar-editor-controls h3 { margin: 0 0 .4rem; color: var(--heading); font: 1.35rem var(--serif); }
.avatar-editor-controls p { margin: 0 0 1rem; font-size: .85rem; }
.avatar-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; }
.avatar-choose { font: .82rem var(--sans); line-height: 1.4; color: var(--heading); background: #211d27; border: 1px solid #665265; border-radius: 5px; padding: .4rem .75rem; min-height: 34px; cursor: pointer; }
@media (pointer: coarse) { .avatar-choose { min-height: 44px; } }
.avatar-choose:hover { background: #302733; border-color: var(--ember); }
.avatar-choose:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.avatar-editor-actions .link-btn { min-height: 44px; }
.avatar-editor [hidden] { display: none; }
.avatar-editor-controls .avatar-editor-status { margin: .8rem 0 0; color: var(--text-dim); font-size: .8rem; }
.avatar-editor-status:empty { display: none; }
.avatar-editor-controls > input:not(.sr-only) { max-width: 100%; margin-bottom: 1rem; }
@media (max-width: 480px) {
    .account-form .avatar-editor { align-items: flex-start; flex-direction: column; gap: 1.5rem; }
}

.action-icon { display: inline-block; width: 18px; height: 18px; margin-right: .45rem; vertical-align: -.2em; flex-shrink: 0; pointer-events: none; }
.trash-icon { color: #f08085; }

/* Private messages */
.message-toolbar, .message-actions, .message-folders { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
.message-toolbar { justify-content: space-between; margin-bottom: 1.75rem; }
.message-folders a { padding: .5rem 0; min-height: 44px; color: var(--text-dim); }
.message-folders a[aria-current=page] { color: var(--ember-soft); }
.message-row { display: flex; align-items: flex-start; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.message-row-content { flex: 1; min-width: 0; }
.message-row h3 { margin: .35rem 0; font: 1.2rem var(--serif); overflow-wrap: anywhere; }
.message-avatar { flex-shrink: 0; width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.message-excerpt { color: var(--text-dim); font-size: .9rem; margin: .35rem 0 0; overflow-wrap: anywhere; }
.message-unread h3 a { color: var(--heading); font-weight: bold; }
.message-count, .message-unread-label { display: inline-block; border-radius: 10px; padding: .1rem .5rem; margin-left: .5rem; background: #382634; color: #f4c8a6; font-size: .72rem; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 1.5rem 0 2rem; line-height: 1.85; }
.private-message .page-title { overflow-wrap: anywhere; }
.message-actions { border-top: 1px solid var(--border); padding-top: 1rem; }
.message-actions .link-btn, .message-row .link-btn { min-height: 44px; }
.message-delete { display: grid; place-items: center; width: 44px; }
.message-delete .trash-icon { margin: 0; }
.message-notice { padding: 1rem 1.25rem; border-left: 2px solid var(--ember); background: #211b2580; margin-bottom: 2rem; }
.message-original summary { cursor: pointer; color: var(--text-dim); padding: .65rem 0; }
@media (max-width: 600px) {
    .message-row { gap: .65rem; }
    .message-avatar { width: 36px; height: 36px; }
    .message-toolbar { align-items: flex-start; }
}

/* Compact member mailbox */
.mailbox { display: grid; grid-template-columns: 180px minmax(0, 1fr); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--bg-card); min-height: 460px; }
.mailbox-sidebar { padding: 1.25rem 1rem; border-right: 1px solid var(--border); background: var(--bg-deep); }
.mailbox-title { font: 1.3rem var(--serif); color: var(--heading); margin: 0 0 1.25rem; }
.mailbox-sidebar > .btn { display: block; text-align: center; }
.mailbox-sidebar .message-folders { display: flex; flex-direction: column; align-items: stretch; gap: .25rem; margin: 1.25rem 0 2rem; }
.mailbox-sidebar .message-folders a { display: flex; align-items: center; justify-content: space-between; padding: .65rem .75rem; border-radius: 5px; }
.mailbox-sidebar .message-folders a[aria-current=page] { background: rgba(175, 160, 217, .12); color: var(--heading); }
.mailbox-settings { font-size: .8rem; color: var(--text-dim); }
.mailbox-main { min-width: 0; padding: 1.25rem; }
.mailbox-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.mailbox-heading h2 { margin: 0; font: 1.5rem var(--serif); color: var(--heading); }
.mailbox-heading > span, .mailbox-hint { font-size: .82rem; }
.mailbox .message-row { align-items: center; gap: .5rem; padding: 0 .5rem 0 0; }
.message-row-link { display: flex; align-items: flex-start; gap: .8rem; flex: 1; min-width: 0; padding: 1rem .5rem; color: var(--text); border-radius: 4px; }
.message-row-link:hover { background: rgba(175, 160, 217, .06); text-decoration: none; color: var(--text); }
.message-row-link:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: -2px; }
.mailbox .message-avatar { width: 40px; height: 40px; }
.message-row-meta { display: flex; justify-content: space-between; gap: .75rem; color: var(--text-dim); font-size: .78rem; }
.message-row-meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.message-row-meta time { flex-shrink: 0; }
.mailbox .message-row h3 { font: .95rem var(--sans); margin: .25rem 0; color: var(--heading); }
.mailbox .message-unread { background: rgba(175, 160, 217, .055); box-shadow: inset 2px 0 var(--accent-soft); }
.mailbox .message-unread h3 { font-weight: 700; }
.mailbox .message-excerpt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .82rem; margin: .25rem 0 0; }
.mailbox-empty { padding: 4rem 1rem; text-align: center; }
.mailbox-empty h3 { color: var(--heading); font: 1.3rem var(--serif); }
.mailbox-back { display: inline-block; font-size: .82rem; margin-bottom: 1.5rem; }
.mailbox .private-message .page-title { font-size: 1.7rem; overflow-wrap: anywhere; }
.mailbox .account-form { margin: 0; padding: .5rem 0 1rem; }
.mailbox .account-form textarea { min-height: 240px; }
.mailbox-main > .section-title { margin-top: 0; }
.message-restore { padding: .5rem; font-size: .8rem; }
@media (max-width: 720px) {
    .mailbox { grid-template-columns: minmax(0, 1fr); }
    .mailbox-sidebar { border-right: 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: 1rem; }
    .mailbox-title { margin: 0; flex: 1; }
    .mailbox-sidebar .message-folders { flex-direction: row; order: 3; width: 100%; margin: 0; }
    .mailbox-sidebar .message-folders a { flex: 1; justify-content: center; }
    .mailbox-settings { order: 4; }
    .mailbox-main { padding: 1rem .65rem; }
    .message-row-link { gap: .5rem; }
    .mailbox .message-avatar { display: none; }
    .message-row-meta { font-size: .72rem; }
}

/* Unread message indicators */
.message-count, .message-bell-count { background: #b83b49; color: #fff; font-family: var(--sans); font-size: .7rem; font-weight: 700; line-height: 1.4; letter-spacing: 0; }
.message-count { min-width: 1.35rem; text-align: center; }
.message-bell { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; color: var(--heading); }
.message-bell:hover { background: rgba(175, 160, 217, .1); text-decoration: none; }
.message-bell:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.message-bell-count { position: absolute; top: 0; right: -2px; min-width: 18px; padding: 1px 4px; border-radius: 10px; border: 2px solid var(--bg-deep); text-align: center; }
.mobile-message-bell { display: none; }
@media (max-width: 820px) {
    .mobile-message-bell { display: inline-flex; }
}

/* Quiet header actions and native account disclosure */
.header-member-actions { display: flex; align-items: center; gap: .65rem; flex-shrink: 0; }
.account-dropdown summary:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 3px; }
.account-dropdown { position: relative; }
.account-dropdown summary { display: flex; align-items: center; justify-content: center; gap: .45rem; min-width: 54px; min-height: 44px; padding: .25rem; border-radius: 6px; cursor: pointer; list-style: none; color: var(--text-dim); }
.account-dropdown summary::-webkit-details-marker { display: none; }
.account-dropdown summary img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.account-dropdown summary:hover, .account-dropdown[open] summary { background: rgba(175, 160, 217, .08); }
.account-dropdown[open] summary svg { transform: rotate(180deg); }
.account-dropdown-panel { position: absolute; z-index: 50; top: calc(100% + .6rem); right: 0; width: 220px; max-width: calc(100vw - 2rem); padding: .5rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); box-shadow: 0 12px 32px #0008; }
.account-dropdown-name { margin: 0 .25rem .35rem; padding: .6rem .5rem .8rem; border-bottom: 1px solid var(--border); font-size: .78rem; color: var(--text-dim); overflow-wrap: anywhere; }
.account-dropdown-panel a, .account-dropdown-panel button { display: flex; align-items: center; width: 100%; min-height: 44px; padding: .65rem .75rem; background: none; border: 0; border-radius: 4px; color: var(--text); font: .85rem var(--sans); text-align: left; cursor: pointer; }
.account-dropdown-panel a:hover, .account-dropdown-panel button:hover { background: rgba(175, 160, 217, .09); text-decoration: none; }
.account-dropdown-panel a:focus-visible, .account-dropdown-panel button:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: -2px; }
.account-dropdown-panel form { border-top: 1px solid var(--border); margin-top: .35rem; padding-top: .35rem; }
.desktop-nav-row .search-form { flex-basis: clamp(180px, calc(100vw - 1050px), 250px); }
.desktop-nav-row .search-form input { width: 165px; font-size: .82rem; padding: .45rem .75rem; border-radius: 5px; }
@media (max-width: 820px) {
    .header-member-actions { gap: .25rem; }
}
@media (max-width: 380px) {
    .header-row { gap: .35rem; }
    .brand { gap: .4rem; }
    .brand-text { font-size: .9rem; }
}

/* Story favorites: independent of the card's main link. */
.story-heart-card > h3, .story-heart-card > .story-meta:first-of-type { padding-right: 2.5rem; }
.story-detail .story-heart-heading { position: relative; padding-right: 3.25rem; }
.favorite-heart-form, .favorite-heart-guest { position: absolute; top: .65rem; right: .65rem; z-index: 3; }
.favorite-heart { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-dim); cursor: pointer; }
.favorite-heart:hover { color: #ed6475; background: #b83b4914; }
.favorite-heart[aria-pressed=true] { color: #e34d62; }
.favorite-heart[aria-pressed=true] svg { fill: currentColor; }
.favorite-heart:focus-visible { outline: 2px solid var(--accent-soft); outline-offset: 2px; }
.favorite-heart:disabled { opacity: .55; cursor: progress; }
.favorite-toast { position: fixed; z-index: 100; bottom: max(1.5rem, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: calc(100vw - 2rem); width: max-content; padding: .8rem 1.25rem; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); color: var(--heading); box-shadow: 0 6px 24px #0008; font-size: .9rem; opacity: 0; pointer-events: none; }
.favorite-toast.is-visible { opacity: 1; }

.proofreading { margin: .75rem 0; }
.proofreading-suggestion { border-top: 1px solid var(--border); padding: .75rem 0; }
.proofreading-suggestion p { margin: 0 0 .5rem; font-size: .85rem; }
.proofreading-suggestion button { margin: 0 .4rem .4rem 0; }
[data-proofread-results] { max-height: 320px; overflow-y: auto; }

.story-toolbar-row { display: flex; align-items: center; flex-wrap: wrap; gap: .25rem .75rem; padding-right: .65rem; background: var(--bg-card); border-bottom: 1px solid var(--border); }
.story-toolbar-row .ql-toolbar.ql-snow { flex: 1 1 auto; border-bottom: 0; }
.story-proofread-button { flex: 0 0 auto; margin: .4rem 0 .4rem auto; }
.story-editor-shell .proofreading { margin: 0; padding: 0 1rem; }
.story-editor-shell .proofreading:has([data-proofread-status]:not(:empty)) { padding-top: 1rem; padding-bottom: .75rem; background: #292335; border-left: 3px solid var(--accent-soft); border-bottom: 1px solid #51435f; }
.story-editor-shell .proofreading [data-proofread-status] { color: #d7cbe8; }
.story-editor-shell .proofreading-suggestion { border-top-color: #51435f; }
.story-editor-shell [data-proofread-status]:empty { margin: 0; }
.proofreading-context { color: var(--heading); line-height: 1.6; }
.proofreading-context mark { background: #67472d; color: #fff4df; padding: .1rem .2rem; border-radius: 3px; }
.proofreading-suggestion .link-btn { padding: .5rem .75rem; min-height: 40px; }

[data-story-composer] { scroll-margin-top: 1.5rem; }

.proofreading-review-dialog { width: min(460px, calc(100vw - 2rem)); max-height: calc(100dvh - 2rem); overflow-y: auto; padding: clamp(1.25rem, 4vw, 2rem); border: 1px solid #665476; border-radius: 10px; background: #292335; color: var(--heading); box-shadow: 0 20px 80px #0009; }
.proofreading-review-dialog::backdrop { background: #09090dbb; }
.proofreading-review-dialog h2 { margin: 0 0 .85rem; font: 1.65rem var(--serif); }
.proofreading-review-dialog p { margin: 0 0 1.4rem; font-size: .95rem; line-height: 1.7; color: #ded5e9; }
.proofreading-review-dialog .avatar-choose { min-height: 44px; }

/* Editorial placements: wrappers exist only when populated or previewing locally. */
.adsense-placement { width: 100%; min-width: 0; }
.adsense-placement > .placement-eyebrow { display: none; }
.adsense-placement.has-ad { margin: 2rem 0; }
.adsense-placement.has-ad > .placement-eyebrow { display: block; text-align: center; }
.adsense-placement ins[data-ad-status="unfilled"] { display: none !important; }
.placement-eyebrow { margin: 0 0 .8rem; color: var(--accent-soft); font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .13em; }
.placement-preview-label { display: inline-block; margin: .25rem 0 .25rem .5rem; padding: .2rem .45rem; border: 1px solid var(--border); border-radius: 3px; font-size: .62rem; letter-spacing: .04em; color: var(--text-dim); }
.ad-placement { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 150px; margin: 2rem 0; padding: 1.25rem; border: 1px dashed var(--border); border-radius: 4px; text-align: center; background: rgba(131, 120, 161, .035); }
.ad-placement .placement-eyebrow { margin-bottom: .4rem; }
.ad-placement p { margin: .4rem 0; color: var(--text-dim); font-family: var(--serif); font-size: 1.15rem; }
.ad-placement small { color: var(--text-dim); font-size: .75rem; }
.community-poll { margin: 3rem 0; padding: clamp(1.25rem, 3vw, 2rem); display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; border: 1px solid var(--border); border-radius: 4px; background: linear-gradient(120deg, rgba(131, 120, 161, .1), transparent); }
.community-poll h2, .product-recommendations h2 { margin: 0 0 1rem; font-family: var(--serif); color: var(--heading); font-weight: 400; line-height: 1.35; }
.poll-intro, .poll-content { min-width: 0; overflow-wrap: anywhere; }
.poll-content fieldset { border: 0; margin: 0 0 1rem; padding: 0; }
.poll-option { display: flex; align-items: baseline; gap: .7rem; padding: .65rem 0; cursor: pointer; }
.poll-option input { accent-color: var(--accent-soft); width: auto; flex: 0 0 auto; }
.poll-preview-options { list-style: circle; margin: 0; padding-left: 1.25rem; }
.poll-preview-options li { padding: .4rem 0; }
.poll-result { margin-bottom: .85rem; }
.poll-result > div { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.poll-result strong { color: var(--accent-soft); font-size: .85rem; }
.poll-result meter { display: block; width: 100%; height: .8rem; margin-top: .3rem; accent-color: var(--accent-soft); }
.product-recommendations { margin: 3rem 0; overflow-wrap: anywhere; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 1.2rem; }
.product-card { display: flex; gap: 1.2rem; align-items: flex-start; min-width: 0; padding: 1.4rem; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-card); }
.product-card > div:last-child { min-width: 0; }
.product-illustration { display: grid; place-items: center; width: 90px; min-height: 110px; flex: 0 0 90px; color: var(--ember-soft); background: rgba(199, 124, 67, .055); border-radius: 3px; }
.product-image { width: 90px; height: 110px; object-fit: contain; flex: 0 0 90px; }
.product-card h3 { margin: .4rem 0; font: 400 1.25rem/1.35 var(--serif); color: var(--heading); }
.product-card p { margin: .6rem 0 1rem; font-size: .9rem; }
.product-affiliate-label, .affiliate-disclosure { color: var(--text-dim); font-size: .75rem; }
.product-link { color: var(--ember-soft); font-size: .9rem; }
.affiliate-disclosure { margin: .8rem 0 0; }
.story-with-recommendation { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2rem; align-items: start; }
.story-recommendation { position: sticky; top: 1.5rem; min-width: 0; margin-top: 2.9rem; max-height: calc(100dvh - 3rem); overflow-y: auto; }
.story-recommendation .product-recommendations { margin: 0; }
.story-recommendation .product-grid { display: block; }
.story-recommendation .product-card { flex-direction: column; }
.story-recommendation .product-illustration { width: 100%; }
.story-recommendation .product-image { width: 100%; height: 150px; flex-basis: auto; }
.story-recommendation .placement-preview-label { margin-left: 0; }
.placement-admin-form { max-width: 720px; display: grid; gap: .7rem; }
.placement-admin-form > label:not(.placement-checkbox) { margin-top: .8rem; font-weight: 600; }
.placement-admin-form > input, .placement-admin-form > textarea, .placement-admin-form > select { width: 100%; min-width: 0; padding: .75rem; color: var(--heading); background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px; font: inherit; }
.placement-admin-form > textarea { resize: vertical; }
.placement-admin-form .muted { margin: 0 0 .5rem; font-size: .85rem; }
.placement-checkbox { display: flex; gap: .65rem; align-items: center; padding: .5rem 0; }
.placement-checkbox input { width: auto; accent-color: var(--accent-soft); }
.placement-admin-form > button { justify-self: start; margin-top: 1rem; }
.placement-admin-results { margin-top: 2rem; max-width: 720px; }
.placement-admin-results p { display: flex; justify-content: space-between; gap: 1rem; }
@media (max-width: 959px) {
    .story-with-recommendation { display: block; }
    .story-recommendation { position: static; margin: 2rem 0; max-height: none; overflow-y: visible; }
    .story-recommendation .product-card { flex-direction: row; }
    .story-recommendation .product-illustration { width: 90px; }
    .story-recommendation .product-image { width: 90px; height: 110px; flex-basis: 90px; }
}
@media (max-width: 639px) {
    .community-poll { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .ad-placement { min-height: 130px; }
    .product-card, .story-recommendation .product-card { flex-direction: column; }
}

.blog-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.blog-save-actions { display: flex; align-items: center; gap: 1.25rem; }
.blog-actions > .btn-danger { margin-left: auto; }
.account-form #blog-delete-form { display: none; }
