/* ============================================================================
   HOUSE COMMON ROOMS — سالن‌های عمومی گروه‌ها
   ----------------------------------------------------------------------------
   Each house gets its own atmosphere: Gryffindor sits by the fire, Hufflepuff
   in a sunlit burrow, Ravenclaw under the stars, Slytherin beneath the lake.

   Every ambient layer animates transform/opacity only, so the whole scene stays
   on the compositor and costs the CPU nothing. The particle canvas is driven by
   common-room/assets/js/common-room.js and stops itself when the tab is hidden.
   ========================================================================== */

/* ---------------------------------------------------------------- tokens -- */

/* The tokens are declared on a second, layout-free selector as well, because
   an open «⋯» menu is parented to <body> — outside `.wc-room` and therefore
   outside the palette it declares. common-room.js puts `wc-room-tokens` and the
   room's own `wc-room-house-*` class on that menu, so it keeps its room's
   colours wherever it is rendered. Copying the resolved values onto the element
   in JS instead would be a list that goes stale the first time a token is
   added. */
.wc-room,
.wc-room-tokens {
    /* Neutral fallback (hub page). Houses override below. */
    --room-primary:   #a119a6;
    --room-secondary: #c93dd4;
    --room-deep:      #1a0a20;
    --room-accent:    #d8b4fe;

    --room-ink:       #e9e6ef;
    --room-muted:     #a9a3b8;

    /* Panels are opaque on purpose. Translucent cards over a fixed, animated
       backdrop change colour as they scroll past it, which reads as flicker. */
    --room-panel:     #17151f;
    --room-panel-2:   #1f1c2a;
    --room-border:    rgba(255, 255, 255, 0.09);
    --room-radius:    18px;

    /* The colour the page header's own gradient ends on — `.site-brand-main`
       in custom-pww.css (dark) / light-wc.css (light). `.wc-room::after` starts
       the room on it so the two never meet at a visible line. */
    --room-header-fade: #09080d;
}

.wc-room {
    position: relative;
    z-index: 1;
    min-height: 60vh;
    padding: 10px 0 70px;
    font-family: 'Estedad', Tahoma, sans-serif;
    color: var(--room-ink);
}

/* The menu is not inside the room, so it inherits none of its typography. */
.wc-room-tokens { font-family: 'Estedad', Tahoma, sans-serif; color: var(--room-ink); }

.wc-room-house-gryffindor {
    --room-primary:   #DC574F;
    --room-secondary: #ff8a7a;
    --room-deep:      #2a0708;
    --room-accent:    #D3A625;
}

.wc-room-house-hufflepuff {
    --room-primary:   #FCC056;
    --room-secondary: #ffe1a3;
    --room-deep:      #241a0b;
    --room-accent:    #b98a2f;
}

.wc-room-house-ravenclaw {
    --room-primary:   #2B77DF;
    --room-secondary: #7db4ff;
    --room-deep:      #060c1c;
    --room-accent:    #C0A062;
}

.wc-room-house-slytherin {
    --room-primary:   #5A8B80;
    --room-secondary: #8ed3c0;
    --room-deep:      #061410;
    --room-accent:    #cfd6d3;
}

.wc-room-inner {
    position: relative;
    /* 3, because .wc-room::after was raised to 2 to cover the canvas. */
    z-index: 3;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 18px;
}

/* -------------------------------------------------------- ambient layers -- */

.wc-room-ambience,
.wc-room-scene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.wc-room-ambience {
    z-index: 1;
}

.wc-room-scene::before,
.wc-room-scene::after,
.wc-room::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

/* The theme insets #page by 8px/12px, so the page background is visible as a
   rim along the top and sides. Left at the site default it reads as a white
   gap around the room, so paint it to match. */
body.wc-room-page {
    background: #09080d;
}

/* The theme caps #content at 1100px and centres it. That is right for an
   article, but a room's atmosphere is fixed to the *viewport*, so anything the
   room paints inside its own box — `.wc-room::after` below — stopped at the
   column edge while the ambience carried on into the gutters. On a wide screen
   that turned the bottom of the page header into a hard line with two lit
   strips either side of it. Room pages put nothing but `.wc-room` in #content,
   so let it run full width; `.wc-room-inner` still holds the reading column. */
body.wc-room-page #content {
    max-width: none;
    margin-inline: 0;
}

/* The ambience is fixed to the viewport, so once the visitor reaches the
   bottom of the page it would otherwise sit on top of the footer and wash it
   out. Lift the footer above it. */
body.wc-room-page .site-footer {
    position: relative;
    z-index: 3;
}

/* A house-tinted wash sits under everything and keeps the room readable
   whatever the page header image happens to be. Its top stays transparent so
   the site header still shows through. */
.wc-room::before {
    background:
        radial-gradient(120% 90% at 50% 0%, transparent 30%, var(--room-deep) 100%),
        linear-gradient(180deg, rgba(6, 5, 10, 0.55) 0%, rgba(6, 5, 10, 0.88) 60%, rgba(6, 5, 10, 0.96) 100%);
    opacity: 0.94;
}

/* `.site-brand-main` fades the header to a flat colour at its bottom edge
   (#09080d dark, #ebebeb light) while the wash right below it is house-tinted,
   so the two met at a hard horizontal line and the header read as a separate
   image pasted above the page. Start the room on that exact colour and dissolve
   it into the wash over the first 150px.

   Absolute, not fixed like the other layers: this one belongs to the top of the
   room, not to the viewport — it has to scroll away with the header. It is the
   painted above both ambient layers — the CSS scene *and* the particle canvas —
   so neither can meet the page header at a visible edge; `.wc-room-inner`
   (z-index 3) stays above it. */
.wc-room::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 150px;
    background: linear-gradient(180deg,
        var(--room-header-fade) 0%,
        color-mix(in srgb, var(--room-header-fade) 60%, transparent) 42%,
        transparent 100%);
    pointer-events: none;
    /* Above the ambience canvas (z-index 1), not merely last at z-index 0.
       The canvas is `position: fixed`, so it covers the whole viewport — but the
       page header sits above the whole room at z-index 10, so the canvas is only
       *visible* below the header's bottom edge. That put a hard tonal step
       exactly where the header ended, which is the one thing this fade exists to
       prevent; sitting under the canvas, it was masking the scene and nothing
       else. `.wc-room-inner` is bumped to 3 to stay above it. */
    z-index: 2;
}

/* ==== Gryffindor — the fire in the hearth ================================= */

.wc-room-house-gryffindor .wc-room-scene::before {
    /* Firelight pooling up from the hearth, breathing. */
    background:
        radial-gradient(70% 45% at 50% 108%, rgba(255, 158, 61, 0.55) 0%, rgba(219, 68, 42, 0.22) 40%, transparent 72%),
        radial-gradient(38% 26% at 22% 104%, rgba(255, 196, 92, 0.28) 0%, transparent 70%),
        radial-gradient(38% 26% at 80% 106%, rgba(255, 120, 60, 0.24) 0%, transparent 70%);
    animation: wc-room-firelight 5.5s ease-in-out infinite alternate;
    will-change: opacity, transform;
}

.wc-room-house-gryffindor .wc-room-scene::after {
    /* Scarlet velvet drapes down both walls, with gold thread catching light. */
    background:
        repeating-linear-gradient(90deg,
            rgba(122, 12, 15, 0.40) 0px,
            rgba(74, 6, 9, 0.46) 26px,
            rgba(150, 22, 24, 0.30) 52px,
            rgba(74, 6, 9, 0.46) 78px),
        linear-gradient(180deg, rgba(40, 4, 6, 0.9) 0%, transparent 45%);
    -webkit-mask-image: linear-gradient(90deg, #000 0%, transparent 26%, transparent 74%, #000 100%);
            mask-image: linear-gradient(90deg, #000 0%, transparent 26%, transparent 74%, #000 100%);
    opacity: 0.75;
    animation: wc-room-drape 14s ease-in-out infinite alternate;
}

/* ==== Hufflepuff — sunlight in the burrow ================================= */

.wc-room-house-hufflepuff .wc-room-scene::before {
    /* Honeycomb lattice, drifting slowly like light through a lattice window.
       Kept faint on purpose — it is a texture behind the text, not a pattern
       competing with it, and it fades out toward the middle of the page. */
    background-image:
        repeating-conic-gradient(from 30deg at 50% 50%,
            rgba(252, 192, 86, 0.05) 0deg 60deg,
            transparent 60deg 120deg);
    background-size: 58px 58px;
    opacity: 0.55;
    -webkit-mask-image: radial-gradient(75% 60% at 50% 45%, transparent 20%, #000 100%);
            mask-image: radial-gradient(75% 60% at 50% 45%, transparent 20%, #000 100%);
    animation: wc-room-honeycomb 46s linear infinite;
}

.wc-room-house-hufflepuff .wc-room-scene::after {
    /* Warm shafts of afternoon sun, swaying. */
    background:
        repeating-linear-gradient(105deg,
            rgba(255, 214, 130, 0.05) 0px,
            rgba(255, 214, 130, 0.05) 70px,
            transparent 70px,
            transparent 260px),
        radial-gradient(60% 40% at 78% -5%, rgba(255, 208, 120, 0.22) 0%, transparent 68%),
        radial-gradient(90% 55% at 50% 112%, rgba(74, 50, 18, 0.55) 0%, transparent 72%);
    opacity: 0.8;
    animation: wc-room-sunbeam 16s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

/* ==== Ravenclaw — the night sky from the tower ============================ */

.wc-room-house-ravenclaw .wc-room-scene::before {
    /* Hand-placed star field; three sizes so it reads as depth, not noise. */
    background-image:
        radial-gradient(1.6px 1.6px at 18% 12%, #ffffff, transparent),
        radial-gradient(1.4px 1.4px at 62% 8%,  #dce9ff, transparent),
        radial-gradient(1.8px 1.8px at 84% 26%, #ffffff, transparent),
        radial-gradient(1.2px 1.2px at 34% 34%, #cfe0ff, transparent),
        radial-gradient(1.5px 1.5px at 8%  48%, #ffffff, transparent),
        radial-gradient(1.1px 1.1px at 72% 44%, #e6f0ff, transparent),
        radial-gradient(1.9px 1.9px at 46% 58%, #ffffff, transparent),
        radial-gradient(1.2px 1.2px at 92% 62%, #cfe0ff, transparent),
        radial-gradient(1.4px 1.4px at 26% 72%, #ffffff, transparent),
        radial-gradient(1.6px 1.6px at 66% 82%, #dce9ff, transparent),
        radial-gradient(1.1px 1.1px at 12% 88%, #ffffff, transparent),
        radial-gradient(1.5px 1.5px at 88% 92%, #e6f0ff, transparent);
    background-size: 520px 520px;
    animation: wc-room-twinkle 7s ease-in-out infinite alternate;
}

.wc-room-house-ravenclaw .wc-room-scene::after {
    /* Moonlight through the tower window, and a slow blue nebula behind it. */
    background:
        radial-gradient(46% 34% at 14% 8%, rgba(150, 190, 255, 0.30) 0%, transparent 68%),
        radial-gradient(58% 40% at 80% 70%, rgba(43, 119, 223, 0.22) 0%, transparent 72%),
        radial-gradient(90% 60% at 50% 112%, rgba(6, 12, 34, 0.75) 0%, transparent 72%);
    opacity: 0.9;
    animation: wc-room-nebula 24s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

/* ==== Slytherin — light through the lake above ============================ */

.wc-room-house-slytherin .wc-room-scene::before {
    /* Caustics: two crossed gradient grids sliding over each other at unequal
       spacings, so they never settle into a readable lattice. Soft-edged and
       masked away from the centre column where the text sits. */
    background:
        repeating-linear-gradient(64deg,
            transparent 0px,
            rgba(120, 220, 190, 0.07) 6px,
            transparent 13px,
            transparent 41px),
        repeating-linear-gradient(-51deg,
            transparent 0px,
            rgba(150, 235, 205, 0.05) 5px,
            transparent 11px,
            transparent 67px);
    opacity: 0.75;
    -webkit-mask-image: radial-gradient(70% 55% at 50% 45%, transparent 10%, #000 95%);
            mask-image: radial-gradient(70% 55% at 50% 45%, transparent 10%, #000 95%);
    animation: wc-room-caustics 18s linear infinite;
    will-change: transform;
}

.wc-room-house-slytherin .wc-room-scene::after {
    /* Green murk, deepening toward the dungeon floor. */
    background:
        radial-gradient(70% 44% at 50% -8%, rgba(126, 214, 184, 0.26) 0%, transparent 70%),
        radial-gradient(100% 70% at 50% 115%, rgba(3, 22, 16, 0.88) 0%, transparent 72%),
        linear-gradient(180deg, rgba(10, 40, 30, 0.28) 0%, transparent 55%);
    animation: wc-room-murk 12s ease-in-out infinite alternate;
}

/* ==== The hub — loose magic in the corridor =============================== */

/* The corridor the four rooms open off. It belongs to no house, so it wears
   the site's own purple and borrows no house's weather: drifting arcane dust
   and a slow violet haze, over the crest-and-starfield cover. */
.wc-room--hub .wc-room-scene::before {
    /* Fine dust hanging in the air. Two tile sizes with no common factor, so
       the field never settles into a readable grid. */
    background-image:
        radial-gradient(1.5px 1.5px at 16% 14%, #f4e0ff, transparent),
        radial-gradient(1.2px 1.2px at 58% 9%,  #d8b4fe, transparent),
        radial-gradient(1.7px 1.7px at 86% 28%, #ffffff, transparent),
        radial-gradient(1.1px 1.1px at 31% 37%, #e9d5ff, transparent),
        radial-gradient(1.4px 1.4px at 7%  52%, #f4e0ff, transparent),
        radial-gradient(1.2px 1.2px at 74% 47%, #c77dff, transparent),
        radial-gradient(1.8px 1.8px at 44% 61%, #ffffff, transparent),
        radial-gradient(1.1px 1.1px at 94% 66%, #d8b4fe, transparent),
        radial-gradient(1.3px 1.3px at 24% 76%, #f4e0ff, transparent),
        radial-gradient(1.5px 1.5px at 68% 86%, #e9d5ff, transparent),
        radial-gradient(1.1px 1.1px at 11% 91%, #ffffff, transparent),
        radial-gradient(1.4px 1.4px at 90% 95%, #c77dff, transparent);
    background-size: 470px 470px;
    animation: wc-room-arcane-dust 9s ease-in-out infinite alternate;
}

.wc-room--hub .wc-room-scene::after {
    /* Violet haze pooling at the corners, drifting. */
    background:
        radial-gradient(48% 36% at 12% 6%, rgba(199, 125, 255, 0.26) 0%, transparent 68%),
        radial-gradient(56% 40% at 84% 62%, rgba(161, 25, 166, 0.24) 0%, transparent 72%),
        radial-gradient(90% 60% at 50% 112%, rgba(14, 6, 22, 0.78) 0%, transparent 72%);
    opacity: 0.9;
    animation: wc-room-arcane-haze 26s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

/* ==== The prefects' hall — candlelight behind a closed door =============== */

/* Not a house room and not the hub: a small private study the four houses
   share. Gold candlelight in the corners over the hub's violet, so it reads as
   related to the corridor outside without borrowing any house's weather.
   Both selectors, because the room index writes `.wc-room--prefects` while a
   topic page writes `.wc-room-house-prefects` — a thread in this hall keeps the
   hall's atmosphere. */
.wc-room--prefects .wc-room-scene::before,
.wc-room-house-prefects .wc-room-scene::before {
    /* Motes hanging in still air, gold shading into violet. */
    background-image:
        radial-gradient(1.5px 1.5px at 14% 16%, #ffe6ad, transparent),
        radial-gradient(1.2px 1.2px at 57% 7%,  #d8b4fe, transparent),
        radial-gradient(1.7px 1.7px at 83% 25%, #fff3d4, transparent),
        radial-gradient(1.1px 1.1px at 29% 39%, #f2d28a, transparent),
        radial-gradient(1.4px 1.4px at 6%  54%, #ffe6ad, transparent),
        radial-gradient(1.2px 1.2px at 71% 45%, #c9a7f5, transparent),
        radial-gradient(1.8px 1.8px at 42% 63%, #fff3d4, transparent),
        radial-gradient(1.1px 1.1px at 92% 68%, #e5c36b, transparent),
        radial-gradient(1.3px 1.3px at 22% 78%, #ffe6ad, transparent),
        radial-gradient(1.5px 1.5px at 66% 88%, #d8b4fe, transparent),
        radial-gradient(1.1px 1.1px at 9%  93%, #fff3d4, transparent),
        radial-gradient(1.4px 1.4px at 88% 97%, #e5c36b, transparent);
    background-size: 430px 430px;
    animation: wc-room-candle-motes 8s ease-in-out infinite alternate;
}

.wc-room--prefects .wc-room-scene::after,
.wc-room-house-prefects .wc-room-scene::after {
    /* Two candles high on the walls, violet pooling on the floor between them. */
    background:
        radial-gradient(42% 30% at 88% 4%, rgba(245, 205, 120, 0.22) 0%, transparent 66%),
        radial-gradient(38% 28% at 10% 12%, rgba(245, 205, 120, 0.16) 0%, transparent 68%),
        radial-gradient(58% 42% at 50% 80%, rgba(124, 77, 204, 0.20) 0%, transparent 72%),
        radial-gradient(90% 60% at 50% 112%, rgba(14, 9, 26, 0.82) 0%, transparent 72%);
    opacity: 0.9;
    animation: wc-room-candle-glow 20s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

/* ------------------------------------------------------------ keyframes -- */

@keyframes wc-room-candle-motes {
    0%   { opacity: 0.38; transform: translate3d(0, 0, 0); }
    50%  { opacity: 0.80; }
    100% { opacity: 0.52; transform: translate3d(-14px, -12px, 0); }
}

@keyframes wc-room-candle-glow {
    0%   { transform: scale(1);    opacity: 0.74; }
    100% { transform: scale(1.07); opacity: 1; }
}

@keyframes wc-room-arcane-dust {
    0%   { opacity: 0.4;  transform: translate3d(0, 0, 0); }
    50%  { opacity: 0.85; }
    100% { opacity: 0.55; transform: translate3d(16px, -14px, 0); }
}

@keyframes wc-room-arcane-haze {
    0%   { transform: scale(1) translateX(0);        opacity: 0.72; }
    100% { transform: scale(1.09) translateX(-26px); opacity: 1; }
}

@keyframes wc-room-firelight {
    0%   { opacity: 0.72; transform: translateY(0) scale(1); }
    35%  { opacity: 0.95; transform: translateY(-6px) scale(1.03); }
    60%  { opacity: 0.80; transform: translateY(-2px) scale(1.01); }
    100% { opacity: 1;    transform: translateY(-9px) scale(1.05); }
}

@keyframes wc-room-drape {
    0%   { transform: translateX(0) scaleY(1); }
    100% { transform: translateX(-10px) scaleY(1.02); }
}

@keyframes wc-room-honeycomb {
    0%   { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-74px, -74px, 0); }
}

@keyframes wc-room-sunbeam {
    0%   { transform: translateX(-30px) skewX(0deg);  opacity: 0.65; }
    100% { transform: translateX(30px)  skewX(-2deg); opacity: 0.9; }
}

@keyframes wc-room-twinkle {
    0%   { opacity: 0.45; transform: translate3d(0, 0, 0); }
    50%  { opacity: 0.95; }
    100% { opacity: 0.6;  transform: translate3d(-18px, 12px, 0); }
}

@keyframes wc-room-nebula {
    0%   { transform: scale(1) translateX(0);     opacity: 0.75; }
    100% { transform: scale(1.08) translateX(24px); opacity: 1; }
}

@keyframes wc-room-caustics {
    0%   { transform: translate3d(0, 0, 0) scale(1.2); }
    50%  { transform: translate3d(-40px, 26px, 0) scale(1.25); }
    100% { transform: translate3d(-80px, 0, 0) scale(1.2); }
}

@keyframes wc-room-murk {
    0%   { opacity: 0.8; }
    100% { opacity: 1; }
}

/* ================================================================= HUB ==== */

.wc-room-hero {
    text-align: center;
    padding: 30px 0 34px;
}

.wc-room-eyebrow {
    margin: 0 0 6px;
    font-size: 0.78rem;
    color: var(--room-accent);
    opacity: 0.85;
}

.wc-room-hero-title {
    margin: 0 0 14px;
    font-size: 2.5rem;
    line-height: 1.35;
    background: linear-gradient(120deg, #fff 0%, var(--room-secondary) 55%, var(--room-primary) 100%);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
}

.wc-room-hero-text {
    margin: 0 auto;
    max-width: 620px;
    color: var(--room-muted);
    font-size: 1rem;
    line-height: 2.1;
}

/* ================================================ MANAGEMENT ROOM ======= */

/* One pinned line, not a card: the announcement itself is the whole panel, so
   nothing here may claim more than a row of height. */
.wc-room-management-panel {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 20px;
    padding: 0 14px;
    border: 1px solid rgba(216, 180, 254, 0.22);
    border-radius: var(--room-radius);
    background: linear-gradient(135deg, #21172d, var(--room-panel) 58%);
    box-shadow: 0 18px 44px -34px rgba(126, 34, 206, 0.75);
}

.wc-room-management-pin {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 0;
    color: inherit;
    text-decoration: none;
}

.wc-room-management-label {
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid rgba(216, 180, 254, 0.2);
    color: #e9d5ff;
    background: rgba(126, 34, 206, 0.22);
    font-size: 0.68rem;
    line-height: 1.9;
    white-space: nowrap;
}

/* The title takes the room that is left and gives up first, so a long
   announcement shortens instead of pushing the date onto a second line. */
.wc-room-management-title {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 0.92rem;
    line-height: 1.8;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-room-management-pin:hover .wc-room-management-title { color: #d8b4fe; }
.wc-room-management-pin.is-empty .wc-room-management-title { color: var(--room-muted); font-size: 0.85rem; }

.wc-room-management-when {
    flex: 0 0 auto;
    color: var(--room-muted);
    font-size: 0.72rem;
    white-space: nowrap;
}

.wc-room-management-when i { margin-inline-start: 5px; }

.wc-room-management-more {
    flex: 0 0 auto;
    color: #d8b4fe;
    text-decoration: none;
    font-size: 0.78rem;
    white-space: nowrap;
}

/* Shared with the management room's own list rows, which keep the larger mark —
   only the pinned line shrinks it. */
.wc-room-management-seal,
.wc-room-management-icon {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    color: #e9d5ff;
    border: 1px solid rgba(216, 180, 254, 0.25);
    background: rgba(126, 34, 206, 0.16);
}

.wc-room-management-seal { width: 50px; height: 50px; border-radius: 50%; font-size: 1.2rem; }
.wc-room-management-icon { width: 42px; height: 42px; border-radius: 12px; }

.wc-room-management-panel .wc-room-management-icon {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: 0.72rem;
}

.wc-room-management-banner { border-color: rgba(216, 180, 254, 0.22); }
.wc-room-management-banner::before { background: linear-gradient(180deg, #c084fc, #7c3aed); }
.wc-room-announcement .wc-room-management-icon { margin-top: 2px; }

.wc-room-doors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 12px;
}

.wc-room-door {
    position: relative;
    padding: 28px 22px 24px;
    text-align: center;
    border-radius: var(--room-radius);
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #14121c;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.35s, border-color 0.35s;
}

/* The door's own house colour, so the hub previews all four atmospheres. */
.wc-room-door--gryffindor { --door: #DC574F; --door-2: #D3A625; }
.wc-room-door--hufflepuff { --door: #FCC056; --door-2: #8a6a2f; }
.wc-room-door--ravenclaw  { --door: #2B77DF; --door-2: #C0A062; }
.wc-room-door--slytherin  { --door: #5A8B80; --door-2: #cfd6d3; }

.wc-room-door::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(100% 70% at 50% 0%, color-mix(in srgb, var(--door) 26%, transparent) 0%, transparent 70%);
    opacity: 0.7;
    transition: opacity 0.35s;
}

.wc-room-door::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--door), var(--door-2), transparent);
    transform: scaleX(0.4);
    transition: transform 0.45s ease;
}

.wc-room-door:hover {
    transform: translateY(-8px);
    border-color: color-mix(in srgb, var(--door) 55%, transparent);
    box-shadow: 0 22px 50px -18px color-mix(in srgb, var(--door) 65%, transparent);
}

.wc-room-door:hover::after { transform: scaleX(1); }
.wc-room-door:hover::before { opacity: 1; }

.wc-room-door > * { position: relative; z-index: 1; }

.wc-room-door.is-mine {
    border-color: color-mix(in srgb, var(--door) 60%, transparent);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--door) 30%, transparent),
                0 18px 44px -20px color-mix(in srgb, var(--door) 70%, transparent);
}

.wc-room-door.is-locked { opacity: 0.62; }
.wc-room-door.is-locked:hover { transform: none; }

.wc-room-door-crest img {
    width: 96px;
    height: auto;
    filter: drop-shadow(0 6px 18px color-mix(in srgb, var(--door) 55%, transparent));
    transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.wc-room-door:hover .wc-room-door-crest img { transform: scale(1.08) rotate(-3deg); }

.wc-room-door-title {
    margin: 14px 0 6px;
    font-size: 1.22rem;
    color: #fff;
}

.wc-room-door-tagline {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--door);
}

.wc-room-door-place {
    margin: 0 0 16px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

.wc-room-door-stats {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin: 0 0 18px;
    padding: 12px 0;
    list-style: none;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.wc-room-door-stats li,
.wc-room-banner-stats li {
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.5;
}

.wc-room-door-stats strong,
.wc-room-banner-stats strong {
    font-size: 1.12rem;
    color: #fff;
}

.wc-room-door-stats span,
.wc-room-banner-stats span {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.5);
}

.wc-room-door-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 0.92rem;
    text-decoration: none;
    color: #12100f;
    background: linear-gradient(135deg, var(--door), var(--door-2));
    transition: filter 0.25s, transform 0.25s;
}

.wc-room-door-btn:hover { filter: brightness(1.12); transform: translateY(-2px); color: #12100f; }

.wc-room-door-btn.is-disabled {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
}

/* ========================================================== ROOM BANNER === */

.wc-room-banner {
    display: flex;
    align-items: center;
    gap: 22px;
    margin: 24px 0 22px;
    padding: 26px 26px;
    border-radius: var(--room-radius);
    border: 1px solid var(--room-border);
    background: var(--room-panel);
    box-shadow: 0 24px 60px -30px rgba(0, 0, 0, 0.9);
    position: relative;
    overflow: hidden;
}

.wc-room-banner::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--room-primary), var(--room-accent));
}

.wc-room-banner-crest img {
    width: 84px;
    height: auto;
    filter: drop-shadow(0 8px 22px color-mix(in srgb, var(--room-primary) 60%, transparent));
    animation: wc-room-crest-float 6s ease-in-out infinite alternate;
}

@keyframes wc-room-crest-float {
    0%   { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-8px) rotate(2deg); }
}

.wc-room-banner-text { flex: 1 1 auto; min-width: 0; }

.wc-room-title {
    margin: 0 0 6px;
    font-size: 1.75rem;
    line-height: 1.5;
    color: #fff;
    text-shadow: 0 2px 20px color-mix(in srgb, var(--room-primary) 55%, transparent);
}

.wc-room-tagline {
    margin: 0 0 6px;
    font-size: 0.95rem;
    color: var(--room-secondary);
}

.wc-room-place {
    margin: 0;
    font-size: 0.8rem;
    color: var(--room-muted);
}

.wc-room-place i { color: var(--room-accent); }

.wc-room-banner-stats {
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 0 0 auto;
}

/* ================================================================ TOOLBAR = */

.wc-room-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.wc-room-search {
    position: relative;
    flex: 1 1 240px;
}

.wc-room-search i {
    position: absolute;
    inset-inline-start: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--room-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

.wc-room-search input[type="search"] {
    width: 100%;
    padding: 12px 44px 12px 16px;
    border-radius: 999px;
    border: 1px solid var(--room-border);
    background: var(--room-panel);
    color: var(--room-ink);
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.wc-room-search input[type="search"]:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--room-primary) 65%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--room-primary) 18%, transparent);
}

/* ------------------------------------------------------------------- sort */

/* One pill per order, in the same rounded language as the search field beside
   it. Plain links, not a <select> — the room has no client-side state to keep
   and a link works with the page cached and JavaScript off. */
.wc-room-sort {
    display: flex;
    flex: 0 0 auto;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--room-border);
    background: var(--room-panel);
}

.wc-room-sort-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--room-muted);
    font-size: 0.84rem;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
}

.wc-room-sort-link i { font-size: 0.8rem; }
.wc-room-sort-link:hover { color: var(--room-ink); background: rgba(255, 255, 255, 0.05); }

.wc-room-sort-link.is-current {
    color: #14110f;
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
}

.wc-room-sort-link.is-current:hover { color: #14110f; }

/* ================================================================ BUTTONS = */

.wc-room-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 0;
    border-radius: 999px;
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    text-decoration: none;
    color: #14110f;
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--room-primary) 85%, transparent);
    transition: transform 0.25s, filter 0.25s, box-shadow 0.25s;
    position: relative;
    overflow: hidden;
}

.wc-room-btn::after {
    /* Wand-light sweep on hover. */
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transition: inset-inline-start 0.6s ease;
}

/* custom-pww.css paints `button:hover, button:focus, button:active {
   background: #10141b }` — specificity 0-1-1, one step above the plain
   `.wc-room-btn` class that sets the gradient, so touching one of these buttons
   blacked it out. Restating the background on the interactive states wins at
   0-2-0 without reaching for !important. Every room button is a real <button>,
   so all three states have to be covered, not just :hover. */
.wc-room-btn:hover,
.wc-room-btn:focus,
.wc-room-btn:active {
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    color: #14110f;
}

.wc-room-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.wc-room-btn:hover::after { inset-inline-start: 130%; }

.wc-room-btn--ghost {
    background: transparent;
    border: 1px solid var(--room-border);
    color: var(--room-ink);
    box-shadow: none;
}

/* Same story, and it has to come after the block above to keep its own
   transparent background on those states. */
.wc-room-btn--ghost:hover,
.wc-room-btn--ghost:focus,
.wc-room-btn--ghost:active {
    background: transparent;
    color: #fff;
    border-color: var(--room-primary);
}

/* ============================================================ TOPIC LIST == */

.wc-room-topics {
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wc-room-topic {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1px solid var(--room-border);
    background: var(--room-panel);
    position: relative;
    overflow: hidden;
    transition: transform 0.28s, border-color 0.28s, background 0.28s;
}

.wc-room-topic::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--room-primary), transparent);
    opacity: 0;
    transition: opacity 0.28s;
}

.wc-room-topic:hover {
    transform: translateX(-4px);
    border-color: color-mix(in srgb, var(--room-primary) 45%, transparent);
    background: var(--room-panel-2);
}

.wc-room-topic:hover::before { opacity: 1; }

.wc-room-topic.is-pinned {
    border-color: color-mix(in srgb, var(--room-accent) 45%, transparent);
    /* Mixed against the panel, not transparent, so the card stays opaque. */
    background: linear-gradient(90deg, color-mix(in srgb, var(--room-accent) 12%, var(--room-panel)), var(--room-panel) 40%);
}

.wc-room-topic.is-locked { opacity: 0.78; }

.wc-room-topic-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--room-primary) 45%, transparent);
    object-fit: cover;
}

.wc-room-topic-main { flex: 1 1 auto; min-width: 0; }

.wc-room-topic-title {
    margin: 0 0 6px;
    font-size: 1.06rem;
    line-height: 1.8;
}

.wc-room-topic-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.22s;
}

.wc-room-topic-title a:hover { color: var(--room-secondary); }

.wc-room-topic-excerpt {
    margin: 0 0 8px;
    font-size: 0.86rem;
    line-height: 1.9;
    color: var(--room-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wc-room-topic-meta {
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.42);
}

.wc-room-topic-meta i { color: var(--room-primary); opacity: 0.8; }

.wc-room-topic-last { color: var(--room-secondary); opacity: 0.85; }

.wc-room-topic-count {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 8px 4px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--room-border);
}

.wc-room-topic-count strong { font-size: 1.15rem; color: var(--room-secondary); }
.wc-room-topic-count span { font-size: 0.7rem; color: rgba(255, 255, 255, 0.45); }

/* ------------------------------------------------------------------ flags */

.wc-room-flag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    margin-inline-end: 6px;
    border-radius: 999px;
    font-size: 0.68rem;
    vertical-align: middle;
}

.wc-room-flag--pin  { background: color-mix(in srgb, var(--room-accent) 22%, transparent); color: var(--room-accent); }
.wc-room-flag--lock { background: rgba(255, 255, 255, 0.09); color: rgba(255, 255, 255, 0.6); }

/* Audience. Private borrows the management purple — it is the one state where
   the site's administrators are the only outsiders — and open borrows nothing
   from the house palette on purpose, because it belongs to all four. */
.wc-room-flag--private {
    background: rgba(126, 34, 206, 0.2);
    color: #e9d5ff;
    border: 1px solid rgba(216, 180, 254, 0.28);
}

.wc-room-flag--everyone {
    background: rgba(56, 189, 248, 0.16);
    color: #bae6fd;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.wc-room-flag--new {
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    color: #14110f;
    margin-inline-start: 6px;
    margin-inline-end: 0;
    animation: wc-room-pulse 2.2s ease-in-out infinite;
}

@keyframes wc-room-pulse {
    0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--room-primary) 60%, transparent); }
    50%      { box-shadow: 0 0 0 6px transparent; }
}

/* ============================================================== NEW TOPIC = */

.wc-room-form {
    margin: 0 0 24px;
    padding: 24px;
    border-radius: var(--room-radius);
    border: 1px solid color-mix(in srgb, var(--room-primary) 30%, var(--room-border));
    background: var(--room-panel-2);
    animation: wc-room-unfurl 0.45s cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes wc-room-unfurl {
    from { opacity: 0; transform: translateY(-10px) scaleY(0.96); transform-origin: top; }
    to   { opacity: 1; transform: none; }
}

.wc-room-field { margin-bottom: 16px; }

.wc-room-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.88rem;
    color: var(--room-secondary);
}

.wc-room-field input[type="text"],
.wc-room-field textarea {
    width: 100%;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--room-border);
    background: rgba(0, 0, 0, 0.32);
    color: var(--room-ink);
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 2;
    transition: border-color 0.25s, box-shadow 0.25s;
    resize: vertical;
}

.wc-room-field input[type="text"]:focus,
.wc-room-field textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--room-primary) 70%, transparent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--room-primary) 16%, transparent);
}

.wc-room-hint {
    display: block;
    margin-top: 7px;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.4);
}

.wc-room-spam-warning {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0 14px;
    padding: 10px 12px;
    color: #f5d58a;
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: 9px;
    font-size: .72rem;
    line-height: 1.8;
}

.wc-room-spam-warning i { margin-top: .35em; color: #f59e0b; }
.comment-form .wc-room-spam-warning { clear: both; }

.wc-room-form-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.wc-room-topic-options {
    margin: 4px 0 18px;
    padding: 16px;
    border: 1px solid var(--room-border);
    border-radius: 12px;
}

.wc-room-topic-options legend { padding: 0 8px; color: var(--room-secondary); font-size: 0.86rem; }
.wc-room-check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; cursor: pointer; }
.wc-room-check:last-of-type { margin-bottom: 0; }
.wc-room-check input { margin-top: 5px; accent-color: var(--room-primary); }
.wc-room-check span { display: flex; flex-direction: column; gap: 2px; }
.wc-room-check strong { color: var(--room-ink); font-size: 0.84rem; }
.wc-room-check small { color: var(--room-muted); font-size: 0.72rem; line-height: 1.7; }

/* ------------------------------------------------------- audience picker */

.wc-room-audience {
    margin: 0 0 16px;
    padding: 0 0 14px;
    border-bottom: 1px dashed var(--room-border);
}

.wc-room-audience-legend {
    display: block;
    margin: 0 0 10px;
    color: var(--room-secondary);
    font-size: 0.8rem;
}

/* The three choices read as one control, so the selected one lights up its
   whole row rather than just its dot. `:has()` is progressive — without it the
   radio still works, it simply looks like the other checkboxes. */
.wc-room-audience-option {
    padding: 9px 11px;
    margin: 0 0 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
}

.wc-room-audience-option:last-child { margin-bottom: 0; }
.wc-room-audience-option:hover { background: rgba(255, 255, 255, 0.04); }
.wc-room-audience-option strong i { margin-inline-end: 5px; color: var(--room-secondary); }

.wc-room-audience-option:has(input:checked) {
    background: color-mix(in srgb, var(--room-primary) 12%, transparent);
    border-color: color-mix(in srgb, var(--room-primary) 34%, transparent);
}

.wc-room-poll-fields {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--room-border);
}

.wc-room-poll-fields label { display: block; margin: 0 0 6px; color: var(--room-secondary); font-size: 0.8rem; }
.wc-room-poll-fields label:not(:first-child) { margin-top: 12px; }
.wc-room-poll-fields input,
.wc-room-poll-fields textarea {
    width: 100%;
    padding: 11px 13px;
    color: var(--room-ink);
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--room-border);
    border-radius: 10px;
    font-family: inherit;
}
.wc-room-poll-fields small { color: var(--room-muted); font-size: 0.7rem; }

/* Honeypot — off-screen rather than display:none, which some bots skip. */
.wc-room-hp {
    position: absolute !important;
    inset-inline-start: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ================================================================ ALERTS == */

.wc-room-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--room-border);
    background: var(--room-panel);
    font-size: 0.9rem;
    color: var(--room-ink);
}

.wc-room-alert i { color: var(--room-accent); }
.wc-room-alert a { color: var(--room-secondary); }

.wc-room-alert--error {
    border-color: rgba(220, 87, 79, 0.45);
    background: rgba(220, 87, 79, 0.12);
}

.wc-room-alert--error i { color: #ff8a7a; }

/* The one alert that is good news. Every other variant here reports a refusal,
   so without this a delivered letter announced itself in the same red the
   refusals wear. */
.wc-room-alert--good {
    border-color: rgba(90, 139, 128, 0.5);
    background: rgba(90, 139, 128, 0.14);
}

.wc-room-alert--good i { color: #8ed3c0; }

.wc-room-alert--banned {
    align-items: flex-start;
    border-color: rgba(220, 87, 79, 0.5);
    background: rgba(220, 87, 79, 0.14);
    line-height: 1.95;
}

.wc-room-alert--banned i { margin-top: .45em; color: #ff8a7a; }
.wc-room-alert--banned strong { color: #ffb4ab; }

.wc-room-searching {
    margin: 0 0 14px;
    font-size: 0.88rem;
    color: var(--room-muted);
}

.wc-room-searching a { color: var(--room-secondary); margin-inline-start: 8px; }

/* ================================================================= EMPTY == */

.wc-room-empty {
    text-align: center;
    padding: 64px 20px;
    border-radius: var(--room-radius);
    border: 1px dashed var(--room-border);
    background: var(--room-panel);
}

.wc-room-empty i {
    font-size: 2.6rem;
    color: var(--room-primary);
    opacity: 0.55;
    animation: wc-room-crest-float 4s ease-in-out infinite alternate;
}

.wc-room-empty p {
    margin: 16px 0 18px;
    color: var(--room-muted);
}

/* ============================================================ PAGINATION == */

.wc-room-pagination {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 26px;
}

/* `wc-room-pagelink`, not `wc-room-page`: `wc-room-page` is the *body* class
   wc_room_body_class() puts on every room page (common-room/common-room.php), so styling
   it here landed this card's padding, border-radius, font-size and text-align on
   <body> itself — a 12px rim around the whole page that made the header cover
   look like a floating, cut-off card, and a :hover transform on <body> that
   re-parented the fixed ambience layers. Never style a bare `.wc-room-page`. */
.wc-room-pagelink {
    min-width: 40px;
    padding: 8px 12px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid var(--room-border);
    background: var(--room-panel);
    color: var(--room-ink);
    text-decoration: none;
    font-size: 0.88rem;
    transition: border-color 0.22s, color 0.22s, transform 0.22s;
}

.wc-room-pagelink:hover { color: var(--room-secondary); border-color: var(--room-primary); transform: translateY(-2px); }

.wc-room-pagelink.is-current {
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    border-color: transparent;
    color: #14110f;
}

/* ============================================================== LOCKED ==== */

.wc-room--locked { display: flex; align-items: center; min-height: 62vh; }

.wc-room-locked-card {
    max-width: 520px;
    margin: 40px auto;
    padding: 46px 32px;
    text-align: center;
    border-radius: 22px;
    border: 1px solid var(--room-border);
    background: var(--room-panel-2);
    box-shadow: 0 30px 80px -40px #000;
}

.wc-room-locked-crest {
    position: relative;
    display: inline-block;
    margin-bottom: 18px;
}

.wc-room-locked-crest img {
    width: 120px;
    height: auto;
    filter: grayscale(0.7) brightness(0.7);
}

.wc-room-locked-lock {
    position: absolute;
    inset-inline-end: -6px;
    bottom: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--room-deep);
    border: 1px solid var(--room-border);
    color: var(--room-accent);
    animation: wc-room-lock-shake 5s ease-in-out infinite;
}

@keyframes wc-room-lock-shake {
    0%, 84%, 100% { transform: rotate(0deg); }
    88%  { transform: rotate(-11deg); }
    92%  { transform: rotate(9deg); }
    96%  { transform: rotate(-5deg); }
}

.wc-room-locked-card h1 { margin: 0 0 6px; font-size: 1.5rem; color: #fff; }
.wc-room-locked-place { margin: 0 0 20px; font-size: 0.82rem; color: var(--room-muted); }
.wc-room-locked-text { margin: 0 0 24px; line-height: 2.1; color: var(--room-ink); font-size: 0.95rem; }

/* ========================================================= SINGLE TOPIC === */

.wc-room-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 22px 0 14px;
    font-size: 0.84rem;
    color: var(--room-muted);
}

.wc-room-breadcrumb a { color: var(--room-secondary); text-decoration: none; }
.wc-room-breadcrumb a:hover { color: #fff; }

.wc-room-thread {
    padding: 26px;
    margin-bottom: 22px;
    border-radius: var(--room-radius);
    border: 1px solid var(--room-border);
    background: var(--room-panel-2);
    box-shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.9);
}

.wc-room-thread-head {
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--room-border);
}

/* Only the face and the title share a line. The meta line used to continue the
   title's column, so four items — author, date, views, replies — had to wrap
   inside whatever width the 64px avatar left them, and on a phone that was a
   240px gutter holding three ragged rows. Out here it gets the whole panel.

   Centred rather than top-aligned: with the meta gone from this row there is
   nothing under a one-line title to balance a 64px face against, and it sat
   stranded at the top of an otherwise empty box. */
.wc-room-thread-headline {
    display: flex;
    gap: 16px;
    align-items: center;
}

.wc-room-thread-avatar img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid color-mix(in srgb, var(--room-primary) 55%, transparent);
    object-fit: cover;
}

/* The avatar must not be squeezed by a long title: it is a flex item with an
   intrinsic width, and without `flex: 0 0 auto` a title with no break
   opportunity shrinks the face to an oval before it agrees to wrap. */
.wc-room-thread-avatar { flex: 0 0 auto; }

.wc-room-thread-title {
    /* The flex child that gives up space; `min-width: 0` is what lets it shrink
       below its content so the wrapping rules below can act. */
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.7;
    color: #fff;
    /* Titles are member-written and nothing trims them. `min-width: 0` above
       lets the text column shrink below its content, and this is what makes it
       actually wrap — including mid-token, which is the only thing that saves
       the layout from a pasted URL or one very long Latin word. `anywhere`
       rather than `break-word` so the break is allowed to count towards the
       element's intrinsic width; `break-word` leaves the box sized for the
       unbroken word and the row overflows anyway. */
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wc-room-thread-meta {
    margin: 14px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

.wc-room-thread-meta i { color: var(--room-primary); opacity: 0.8; }
.wc-room-thread-meta a { color: var(--room-secondary); text-decoration: none; }

.wc-room-thread-body {
    font-size: 1rem;
    line-height: 2.2;
    color: var(--room-ink);
}

.wc-room-thread-body p { margin: 0 0 1em; }
.wc-room-thread-body a { color: var(--room-secondary); }

.wc-room-thread-body blockquote {
    margin: 1em 0;
    padding: 12px 18px;
    border-inline-start: 3px solid var(--room-primary);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 10px 10px 0;
}

.wc-room-thread-body code,
.wc-room-thread-body pre {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 2px 7px;
    font-size: 0.9em;
}

.wc-room-thread-body pre { padding: 14px 16px; overflow-x: auto; }

/* -------------------------------------------------------------- polls -- */

.wc-room-poll {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid color-mix(in srgb, var(--room-primary) 34%, var(--room-border));
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.16);
}

.wc-room-poll > header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.wc-room-poll > header > i { color: var(--room-primary); font-size: 1.45rem; }
.wc-room-poll > header > div { flex: 1 1 auto; min-width: 0; }
.wc-room-poll > header p { margin: 0; color: var(--room-secondary); font-size: 0.7rem; }
.wc-room-poll > header h2 { margin: 2px 0 0; color: #fff; font-size: 1.02rem; line-height: 1.8; }
.wc-room-poll > header > span { color: var(--room-muted); font-size: 0.76rem; white-space: nowrap; }
.wc-room-poll-options { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }

.wc-room-poll-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid var(--room-border);
    border-radius: 10px;
    cursor: pointer;
}

.wc-room-poll-option.is-chosen { border-color: var(--room-primary); background: color-mix(in srgb, var(--room-primary) 9%, transparent); }
.wc-room-poll-option input { accent-color: var(--room-primary); }
.wc-room-poll-option-copy { flex: 1 1 auto; min-width: 0; }
.wc-room-poll-option-copy strong { display: block; margin-bottom: 6px; color: var(--room-ink); font-size: 0.84rem; }
.wc-room-poll-option-copy > span { display: block; height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.wc-room-poll-option-copy > span i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--room-primary), var(--room-secondary)); }
.wc-room-poll-option > b { color: var(--room-secondary); font-size: 0.78rem; white-space: nowrap; }
.wc-room-poll-option > b small { color: var(--room-muted); font-weight: normal; }
.wc-room-poll-notice { padding: 9px 12px; border-radius: 9px; color: #b7f7d0; background: rgba(34, 197, 94, 0.12); font-size: 0.8rem; }
.wc-room-poll-notice.is-error { color: #fecaca; background: rgba(239, 68, 68, 0.12); }
.wc-room-poll-login,
.wc-room-poll-privacy { margin: 10px 0 0; color: var(--room-muted); font-size: 0.72rem; line-height: 1.8; }
.wc-room-poll-privacy i { color: var(--room-accent); }

/* --------------------------------------------------------- prefect tools - */

.wc-room-mod {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px dashed var(--room-border);
    font-size: 0.82rem;
}

.wc-room-mod-label { color: var(--room-accent); }
.wc-room-mod a { color: var(--room-muted); text-decoration: none; transition: color 0.2s; }
.wc-room-mod a:hover { color: var(--room-secondary); }
.wc-room-mod a.is-danger:hover { color: #ff6b6b; }

/* The author's own bar. Same shape as the prefect one, but its label is a
   statement of ownership rather than a badge of office, so it takes the
   house's own colour instead of the accent gold. */
.wc-room-mod--author .wc-room-mod-label { color: var(--room-secondary); }

.wc-room-prefect-note {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: var(--room-muted);
}

.wc-room-prefect-note i { color: var(--room-accent); }

/* A topic opened to everyone is listed in two rooms and so gets two ways back;
   flex rather than inline text, or the second link sits flush against the
   first with no space between them. */
.wc-room-backlink {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 26px;
    margin: 24px 0 0;
    text-align: center;
}

.wc-room-backlink a { color: var(--room-secondary); text-decoration: none; font-size: 0.9rem; }

/* ------------------------------------------------- comments inside a room - */

.wc-room-replies {
    padding: 4px 26px 26px;
    border-radius: var(--room-radius);
    border: 1px solid var(--room-border);
    background: var(--room-panel);
}

.wc-room-replies .comments-area { margin: 0; }

/* The «۳ دیدگاه» heading says a number the thread header has already printed as
   «۳ پاسخ» one panel higher, and it was spending a fifth of the first screen of
   replies to repeat it. Clipped rather than `display: none`, because hidden
   text is dropped from the accessibility tree and the replies would lose the
   only heading that marks where they begin — the same call the shortcut bar's
   labels make. `backdrop-filter` goes with it: a 1px box has nothing to blur,
   and leaving it would keep forcing a render surface that re-blurs on every
   scroll frame for no visible result. */
body.wc-room-page .comments-area > .comments-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    border: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

/* --------------------------------------------- the replies' sort switch --- */

/* Placement only: the control itself is `.wc-room-sort`, the room index's own
   segmented switch, reused rather than reproduced. See the note on
   wc_room_render_comment_sort(). */
.wc-room-csort {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 20px;
}

.wc-room-csort-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--room-muted);
    font-size: 0.82rem;
    line-height: 1.4;
    white-space: nowrap;
}

.wc-room-csort-label i { color: var(--room-primary); opacity: 0.8; }

/* The pills sit inside `#comments`, where style.css claims bare `a` — without
   this the current segment's dark-on-gradient text is repainted link-blue. */
.wc-room-csort .wc-room-sort-link,
.wc-room-csort .wc-room-sort-link:hover,
.wc-room-csort .wc-room-sort-link:focus { text-decoration: none; }

/* ------------------------------------------ one action row under a reply -- */

/* Reactions, report, edit and the prefect's tools each arrive from their own
   `comment_text` filter (see wc_room_render_comment_actions()), and each used
   to print a full-width block — four rows holding one control apiece. They now
   share this row: what the reader *feels* about the reply leads it, what is
   *done about* the reply is pushed to the far end. The reply link is folded in
   from its own `.reply` div by common-room.js. */
.wc-room-comment-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding-top: 13px;
    border-top: 1px solid var(--room-border);
}

.wc-room-comment-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-inline-start: auto;
}

/* Every control in the row is the same pill, so no single one reads as the
   loud option; only colour separates them on hover. */
.wc-room-comment-actions .wc-room-reactions button,
.wc-room-comment-actions .wc-room-reactions > span,
.wc-room-comment-tools .wc-room-report-trigger,
.wc-room-comment-tools .wc-room-edit-trigger,
.wc-room-comment-tools .wc-room-cmod-link,
.wc-room-comment-tools .wc-room-owl-link,
#comments .wc-room-comment-actions .comment-reply-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    box-sizing: border-box;
    padding: 5px 12px;
    color: var(--room-muted);
    background: transparent;
    border: 1px solid var(--room-border);
    border-radius: 999px;
    font: inherit;
    font-size: .74rem;
    font-weight: 400;
    line-height: 1.6;
    text-decoration: none;
    white-space: nowrap;
    transition: color .2s, border-color .2s, background .2s;
}

/* «نامه با جغد» is the one control in the row that is coloured at rest.
   Everything else here is something done *about* a reply — report it, edit it,
   take it down — and those stay muted outlines until hovered, so a moderation
   action never advertises itself. Writing to the person is the opposite kind of
   act, and the colour is what separates it at a glance rather than making the
   reader parse four identical pills.

   Owl-post amber, hard-coded rather than var(--room-primary): the pill sits in
   whichever house room the thread is in, and the house accent would make it a
   twin of the edit control. This colour belongs to the owlery, and it is the
   same one the mailbox and the profile button wear.

   Contrast is why the amber is the *pale* stop: --room-secondary in Hufflepuff
   is already a light gold, so the deep #b98a2f would nearly vanish there. */
.wc-room-comment-tools .wc-room-owl-link {
    color: #f0d29a;
    border-color: rgba(227, 193, 115, .38);
    background: rgba(227, 193, 115, .09);
}

.wc-room-comment-tools .wc-room-owl-link i { color: #e3c173; }

.wc-room-comment-tools .wc-room-owl-link:hover,
.wc-room-comment-tools .wc-room-owl-link:focus-visible {
    color: #fdf0d3;
    border-color: rgba(227, 193, 115, .75);
    background: rgba(227, 193, 115, .2);
}

.wc-room-reactions { display: inline-flex; align-items: center; margin: 0; }
.wc-room-reactions form { display: inline-flex; gap: 6px; margin: 0; }
.wc-room-comment-actions .wc-room-reactions button,
.wc-room-comment-actions .wc-room-reactions > span { min-width: 54px; }
.wc-room-reactions button { cursor: pointer; }
.wc-room-reactions button:hover,
.wc-room-reactions button.is-active { color: var(--room-secondary); border-color: var(--room-primary); background: color-mix(in srgb, var(--room-primary) 12%, transparent); }
.wc-room-reactions button.is-active { font-weight: 700; }

/* The reply link is the one thing a reader is meant to reach for, so it keeps
   a filled background while the rest stay outlines. `#comments` prefixes it
   because style.css pins `.reply` to the card corner from an ID selector. */
#comments .wc-room-comment-actions .comment-reply-link {
    position: static;
    margin: 0;
    color: var(--room-ink);
    background: color-mix(in srgb, var(--room-primary) 20%, transparent);
    border-color: color-mix(in srgb, var(--room-primary) 45%, transparent);
    font-weight: 700;
    transform: none;
    box-shadow: none;
}

#comments .wc-room-comment-actions .comment-reply-link:hover {
    color: #fff;
    background: color-mix(in srgb, var(--room-primary) 40%, transparent);
    border-color: var(--room-primary);
    transform: none;
    box-shadow: none;
}

#comments .wc-room-comment-actions .comment-reply-link .spaceLeft { margin: 0; }
#comments .wc-room-comment-actions .comment-reply-link > span { display: inline-flex; align-items: center; gap: 6px; }

/* The «⋯» exists only where the script that opens it does — see addToolsMenu()
   — and only on a phone, where the row runs out of width. */
.wc-room-comment-more { display: none; }

/* ------------------------------------------------------------ reports -- */

.wc-room-report-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    color: var(--room-muted);
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
    transition: color .2s;
}

.wc-room-report-trigger:hover { color: #ff8b8b; }
.wc-room-comment-tools .wc-room-report-trigger:hover { color: #ff8b8b; border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .1); }

/* A reply taken down by a moderator: the thread keeps its place, the words go. */
.wc-room-removed {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 4px 0;
    padding: 13px 15px;
    color: #f0c9c4;
    background: rgba(220, 87, 79, .1);
    border: 1px dashed rgba(220, 87, 79, .4);
    border-radius: 11px;
    font-size: .84rem;
    line-height: 1.9;
}

.wc-room-removed i { margin-top: .35em; color: #ff8a7a; }
.wc-room-removed strong { display: block; color: #ffb4ab; font-size: .88rem; }
.wc-room-removed p { margin: 2px 0 0 !important; }
.wc-room-removed-reason { color: var(--room-muted); }

.wc-room-report-notice {
    margin: 16px 0;
    padding: 12px 15px;
    color: #b7f7d0;
    background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .25);
    border-radius: 10px;
    font-size: .82rem;
}

.wc-room-report-notice.is-error { color: #fecaca; background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .25); }
body.wc-room-report-open,
body.wc-room-edit-open { overflow: hidden; }

.wc-room-report-dialog {
    position: fixed;
    z-index: 10020;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(5, 4, 9, .78);
    backdrop-filter: blur(5px);
}

.wc-room-report-dialog[hidden],
.wc-room-edit-dialog[hidden] { display: none; }
.wc-room-report-card,
.wc-room-edit-card {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 25px;
    color: var(--room-ink);
    background: var(--room-panel-solid, #17131f);
    border: 1px solid var(--room-border);
    border-radius: 16px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

.wc-room-dialog-head { display: flex; align-items: center; gap: 14px; margin-bottom: 7px; direction: ltr; }
.wc-room-dialog-head > div { flex: 1 1 auto; min-width: 0; direction: rtl; text-align: right; }
.wc-room-dialog-head .wc-room-eyebrow { margin: 0; }
.wc-room-report-card h2,
.wc-room-edit-card h2 { margin: 2px 0 0; color: var(--room-ink); font-size: 1.2rem; }
.wc-room-report-target { margin: 0 0 18px; color: var(--room-muted); font-size: .8rem; }
.wc-room-report-card form > label { display: block; margin: 13px 0 6px; color: var(--room-ink); font-size: .8rem; }
.wc-room-report-card label small { color: var(--room-muted); font-weight: normal; }
.wc-room-report-card select,
.wc-room-report-card textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    color: var(--room-ink);
    background: rgba(0, 0, 0, .22);
    border: 1px solid var(--room-border);
    border-radius: 9px;
    font: inherit;
}

.wc-room-dialog-close {
    position: static;
    flex: 0 0 42px;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    padding: 0;
    color: var(--room-muted);
    background: transparent;
    border: 1px solid var(--room-border);
    border-radius: 50%;
    cursor: pointer;
}

.wc-room-report-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }
.wc-room-report-hp { position: absolute !important; inset-inline-start: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ----------------------------------------------------- author editing -- */

.wc-room-edit-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0;
    color: var(--room-muted);
    background: transparent;
    border: 0;
    font: inherit;
    cursor: pointer;
    transition: color .2s;
}

.wc-room-edit-trigger:hover { color: var(--room-secondary); }
.wc-room-comment-tools .wc-room-edit-trigger:hover { color: var(--room-secondary); border-color: var(--room-primary); background: color-mix(in srgb, var(--room-primary) 12%, transparent); }
.wc-room-mod .wc-room-edit-trigger { font-size: .82rem; }

.wc-room-edited {
    margin: 12px 0 0 !important;
    padding-top: 9px;
    color: var(--room-muted);
    border-top: 1px dashed var(--room-border);
    font-size: .7rem;
    line-height: 1.7;
}

.wc-room-edited i { color: var(--room-primary); }
.wc-room-edit-notice {
    margin: 16px 0;
    padding: 12px 15px;
    color: #b7f7d0;
    background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .25);
    border-radius: 10px;
    font-size: .82rem;
}

.wc-room-edit-notice.is-error { color: #fecaca; background: rgba(239, 68, 68, .12); border-color: rgba(239, 68, 68, .25); }
.wc-room-edit-dialog {
    position: fixed;
    z-index: 10020;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(5, 4, 9, .78);
    backdrop-filter: blur(5px);
}

.wc-room-edit-card form > label,
.wc-room-edit-title-field label { display: block; margin: 13px 0 6px; color: var(--room-ink); font-size: .8rem; }
.wc-room-edit-title-field { margin: 0; }
.wc-room-edit-title-field[hidden] { display: none; }
.wc-room-edit-card input[type="text"],
.wc-room-edit-card textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 10px 12px;
    color: var(--room-ink);
    background: rgba(0, 0, 0, .22);
    border: 1px solid var(--room-border);
    border-radius: 9px;
    font: inherit;
}

.wc-room-edit-note { margin: 10px 0 0; color: var(--room-muted); font-size: .72rem; }
.wc-room-edit-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

/* Unicode is inserted as text, not image markup, so WordPress's KSES filters
   preserve it in both room topics and room replies. */
.wc-room-emoji-picker { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; direction: ltr; }
.wc-room-emoji {
    display: inline-grid;
    place-items: center;
    width: 31px;
    height: 31px;
    padding: 0;
    color: inherit;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--room-border);
    border-radius: 7px;
    font: 1.05rem/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    cursor: pointer;
    transition: transform .15s, background .15s, border-color .15s;
}

.wc-room-emoji::before { content: attr(data-emoji); display: block; }
.wc-room-emoji:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--room-primary) 10%, transparent); border-color: var(--room-primary); }

/* Let the shared comment styles pick up this room's colours. */
.wc-room {
    --house-primary: var(--room-primary);
    --house-secondary: var(--room-secondary);
    --house-border: color-mix(in srgb, var(--room-primary) 22%, transparent);
    --house-shadow: color-mix(in srgb, var(--room-primary) 34%, transparent);
}

/* ------------------------------ the reply's action row, folded for a phone -- */

/* Six labelled pills do not fit one line on a 375px screen, and wrapping them
   gave every reply a second row of scattered buttons. The two a reader reaches
   for — the reactions and the reply — keep the row; report, edit and the
   prefect's take-down move into a menu behind «⋯», where they keep their full
   labels instead of being reduced to unlabelled icons.

   Everything hangs off `has-menu`, which common-room.js adds when it inserts
   the button: with JS off the class is absent, the menu never applies, and the
   controls stay inline and reachable. */
@media (max-width: 640px) {
    .wc-room-comment-actions { gap: 6px; }
    .wc-room-comment-actions.has-menu { position: relative; }

    .wc-room-comment-actions.has-menu .wc-room-comment-more {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 34px;
        height: 32px;
        padding: 0;
        margin-inline-start: auto;
        color: var(--room-muted);
        background: transparent;
        border: 1px solid var(--room-border);
        border-radius: 999px;
        font: inherit;
        cursor: pointer;
        transition: color .2s, border-color .2s, background .2s;
    }

    .wc-room-comment-actions.has-menu.is-open .wc-room-comment-more {
        color: var(--room-secondary);
        border-color: var(--room-primary);
        background: color-mix(in srgb, var(--room-primary) 14%, transparent);
    }

    /* The panel keys off `is-menu` — a class on the menu itself, added by
       common-room.js — and not off the row that contains it, because an open
       menu is not inside that row. It is moved to <body> and positioned from
       the viewport; see initCommentMenus(). The reason is iOS Safari, which
       clipped the menu dead on the comment card's rounded bottom edge whatever
       we did to the card's z-index, its stacking context or its transform. A
       menu parented to <body> has no ancestor left that could clip it.

       `top`/`left` are written by the script, so nothing here positions it. */
    .wc-room-comment-tools.is-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        flex-wrap: nowrap;
        gap: 3px;
        min-width: 180px;
        margin: 0;
        padding: 6px;
        background: var(--room-panel-solid, #17131f);
        border: 1px solid var(--room-border);
        border-radius: 13px;
        box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
    }

    /* Above the fixed navbar (10001) so a menu opened near the top of the
       screen is not half-covered, and below the report/edit dialogs (10020),
       which a menu item is usually on its way to opening. */
    .wc-room-comment-tools.is-menu.is-detached {
        display: flex;
        position: fixed;
        z-index: 10010;
    }

    /* Written at ID weight to beat `#comments ol article`. See the note in
       common-room.js: the card's hover transform boxes the menu's z-index in,
       so the card is what has to rise.

       `transform: none` is the other half, and it is not belt-and-braces for
       the `hover: hover` guard in custom-pww.css — it covers what that guard
       cannot. A touch-capable laptop matches `hover: hover`, so on a narrow
       Safari window the lift still applies, and a transformed box with a
       `border-radius` clips its overflowing descendants to the rounded border
       box in WebKit: the menu would be sliced off at the card's bottom edge
       again. Flattening the card for as long as its own menu is open is the
       one state where the lift is worth less than the menu. Dropping the
       transform costs nothing else, because the card is `position: relative`
       and keeps its z-index without it. */
    #comments ol article.comment-body.wc-room-menu-open {
        z-index: 20;
        transform: none;
    }

    /* Menu rows, not pills: full width, left-led, no outline of their own. */
    .wc-room-comment-tools.is-menu .wc-room-report-trigger,
    .wc-room-comment-tools.is-menu .wc-room-edit-trigger,
    .wc-room-comment-tools.is-menu .wc-room-cmod-link,
    .wc-room-comment-tools.is-menu .wc-room-owl-link {
        justify-content: flex-start;
        width: 100%;
        min-height: 36px;
        padding: 6px 10px;
        border-color: transparent;
        border-radius: 9px;
        font-size: .82rem;
        white-space: normal;
    }

    /* The owl row keeps its text colour — that is what identifies it — but
       drops the tinted fill, or it would read as a *selected* row inside a menu
       whose other rows are plain. */
    .wc-room-comment-tools.is-menu .wc-room-owl-link {
        background: transparent;
    }

    .wc-room-comment-tools.is-menu .wc-room-owl-link:hover,
    .wc-room-comment-tools.is-menu .wc-room-owl-link:focus-visible {
        background: rgba(227, 193, 115, .16);
        border-color: transparent;
    }
}

/* =============================================================== MOBILE === */

@media (max-width: 768px) {
    .wc-room-banner {
        flex-direction: column;
        text-align: center;
        gap: 14px;
        padding: 22px 18px;
    }

    .wc-room-banner-stats { justify-content: center; width: 100%; }
    .wc-room-prefects-banner .wc-room-prefects-crests { justify-content: center; width: 100%; }
    .wc-room-hero-title { font-size: 1.85rem; }

    .wc-room-topic {
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px;
    }

    .wc-room-topic-avatar img { width: 40px; height: 40px; }

    .wc-room-topic-count {
        flex-direction: row;
        gap: 6px;
        min-width: 0;
        padding: 4px 12px;
    }

    .wc-room-topic-main { flex: 1 1 100%; order: 3; }

    .wc-room-thread { padding: 20px 16px; }

    /* The head stays a row here. Stacked, the avatar took a line of its own and
       pushed the title — the one thing the page is about — below the fold on a
       375px screen, which is what a reader arriving from the room index is
       looking for confirmation of. A smaller face and a tighter gap buy the
       title the width instead; it wraps as far as it needs to. */
    .wc-room-thread-headline { gap: 12px; }
    .wc-room-thread-avatar img { width: 46px; height: 46px; }

    .wc-room-thread-title {
        font-size: 1.2rem;
        /* 1.7 is a reading line-height, and this is a heading that now wraps to
           three or four lines on a narrow screen — at that length the loose
           setting reads as four separate lines rather than one title. */
        line-height: 1.55;
    }

    .wc-room-thread-meta { margin-top: 12px; gap: 10px 14px; }
    .wc-room-replies { padding: 4px 14px 20px; }
    .wc-room-toolbar { flex-direction: column; align-items: stretch; }

    /* The toolbar stacks here, so the search's flex-basis would become a
       240px-tall box instead of a 240px-wide one. */
    .wc-room-search { flex: 0 0 auto; width: 100%; }

    /* Three pills on a 390px screen: share the width evenly, and let the row
       scroll rather than wrap into a second line of half-pills. */
    .wc-room-sort { overflow-x: auto; }
    .wc-room-sort-link { flex: 1 1 0; justify-content: center; padding: 8px 10px; font-size: 0.78rem; }

    /* Two pills instead of three, so the switch takes the width the label
       leaves rather than scrolling. */
    .wc-room-csort { gap: 10px; }
    .wc-room-csort .wc-room-sort { flex: 1 1 auto; overflow-x: visible; }

    .wc-room-doors { grid-template-columns: 1fr; }

    /* On a phone the pin keeps the title and drops the framing around it: the
       label and the elapsed time are what a 375px line has no room for. */
    .wc-room-management-label,
    .wc-room-management-when { display: none; }
    .wc-room-poll > header { align-items: flex-start; flex-wrap: wrap; }

    /* Three stacked radios plus their notes is the tallest thing in the form
       on a phone; trim the padding so the submit button stays reachable. */
    .wc-room-audience-option { padding: 8px; }
}

/* ================================================ ROOM PAGE HEADER ======== */

/* No room styles the header's *look*: wc_room_header_data() (common-room/common-room.php)
   sets house_cover — images/profiles/{house}.jpg, or assets/images/hub.jpg for the
   hub — and the theme paints it. The two rules below are about layout and
   stacking only, and they apply to all five rooms so the hub can never drift
   from the houses again.

   `.wc-room` is `position: relative; z-index: 1`, so it opens a stacking
   context, and its ambient layers are `position: fixed; inset: 0` — they cover
   the whole viewport, including the page header above them. `#masthead` is
   `position: relative` with `z-index: auto` (custom-pww.css), so it loses to
   that z-index 1 and the room's wash (`.wc-room::before`, ~55% black at the
   top of the viewport) was being painted straight over the header, greying out
   a title that is actually #fff. Lift the header above the ambience, exactly
   as the footer already does a few rules up.

   z-index 10, not 3: the navbar lives *inside* #masthead at z-index 10000, so
   any numeric z-index here traps it in this stacking context. 10 clears the
   footer's 3 while staying below body-level overlays (lightboxes ~1042), which
   should still open over the header. */
body.wc-room-page #masthead {
    position: relative;
    z-index: 10;
    /* custom-pww.css rules a 1px #0b0a11 line under every header. With
       `.wc-room::after` now dissolving the header into the room, that line is
       the one thing left drawing a border between them — invisible in dark
       mode, a grey hairline in light mode. */
    border-bottom: 0;
}

/* js/jquery.fortunatopro.min.js sizes third_header_height headers to
   `innerHeight / 1.5` — about 560px on a phone, two thirds of the screen for
   a cover and one line of title. Compact it, and beat the inline height the
   script writes on load and on every resize.

   A fixed length rather than auto/min-height: #masthead::before draws the
   cover at `height: 100%`, and a percentage height only resolves against an
   ancestor with a definite height — `auto` would leave the cover with nothing
   to size against and paint nothing at all. */
@media (max-width: 782px) {
    body.wc-room-page .site-header,
    body.wc-room-page .site-brand-main {
        height: 300px !important;
    }
}

/* ====================================================== REDUCED MOTION ==== */

@media (prefers-reduced-motion: reduce) {
    .wc-room-ambience { display: none; }

    .wc-room *,
    .wc-room-scene::before,
    .wc-room-scene::after,
    .wc-room::before {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* ================================================= ADAPTIVE PERFORMANCE ==== */

/* common-room.js adds `.wc-room-lite` only when the browser reports constrained
   hardware, data saver, or a slow-update display. The gradients stay in place,
   preserving each room's identity; only the two full-screen texture animations
   are frozen. The smaller canvas particle field remains the moving magical cue. */
html.wc-room-lite .wc-room-scene::before,
html.wc-room-lite .wc-room-scene::after {
    animation: none !important;
    will-change: auto !important;
}

/* Keep the already-rendered particle frame visible while the low-power loop is
   paused during a scroll gesture, so the room never flashes or looks empty. */
html.wc-room-lite.wc-room-scrolling .wc-room-ambience {
    opacity: 0.82;
}

/* Long rooms no longer ask an old browser to paint every off-screen topic and
   reply up front. Unsupported browsers simply ignore these progressive hints. */
html.wc-room-lite .wc-room-topic,
html.wc-room-lite .wc-room-replies .comment-body {
    content-visibility: auto;
    contain-intrinsic-size: auto 170px;
}

/* Phone-sized scenes gain more from a static full-viewport texture than from
   its barely perceptible drift. Particles, crest movement and interactions all
   remain animated, including on modern phones. */
@media (max-width: 782px) {
    .wc-room-scene::before,
    .wc-room-scene::after {
        animation: none !important;
        will-change: auto !important;
    }
}

/* ================================================= PREFECT ELECTIONS ===== */

/* A `<details>`, closed on the room index. The panel is a standing notice over
   every visit to the room while a cycle runs, and nominating or voting happens
   once — so it costs a screenful of scrolling to everyone who is only there to
   read the room. Closed it is a one-line header that still says which phase the
   cycle is in, how many nominees there are and when the deadline falls, which
   is the whole of what a passing reader needs. It opens itself where it is the
   page (the election topic) and whenever it is carrying a notice. */
.wc-room-election {
    margin: 22px 0;
    padding: 18px 20px;
    border: 1px solid color-mix(in srgb, var(--room-accent) 35%, transparent);
    border-radius: var(--room-radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--room-accent) 8%, var(--room-panel)), var(--room-panel) 60%);
    box-shadow: 0 18px 45px rgba(0, 0, 0, .18);
    font-size: .92rem;
}

.wc-room-election-head {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
}

.wc-room-election-head::-webkit-details-marker { display: none; }
.wc-room-election-head::marker { content: ''; }
.wc-room-election[open] > .wc-room-election-head { border-bottom: 1px solid var(--room-border); padding-bottom: 13px; }
.wc-room-election-head-text { min-width: 0; }
.wc-room-election-head h2 { margin: 0; color: var(--room-ink); font-size: 1.08rem; line-height: 1.6; }
.wc-room-election-head p { margin: 0 0 2px; font-size: .72rem; }

.wc-room-election-head-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px 12px;
    margin-inline-start: auto;
}

.wc-room-election-head time { color: var(--room-accent); font-size: .78rem; }
.wc-room-election-headcount { display: inline-flex; align-items: center; gap: 6px; color: var(--room-muted); font-size: .78rem; }
.wc-room-election-headcount i { font-size: .72rem; opacity: .8; }

.wc-room-election-upcoming {
    display: flex;
    align-items: center;
    gap: 14px;
}
.wc-room-election-upcoming__text { flex: 1 1 auto; min-width: 0; }
.wc-room-election-upcoming__text p { margin: 3px 0 0; color: var(--room-muted); line-height: 1.8; }
.wc-room-election-upcoming__text .wc-room-eyebrow { margin: 0 0 2px; color: var(--room-accent); font-size: .72rem; }
.wc-room-election-upcoming h2 { margin: 0; color: var(--room-ink); font-size: 1.02rem; line-height: 1.65; }
.wc-room-election-upcoming time { flex: 0 0 auto; color: var(--room-accent); font-size: .78rem; white-space: nowrap; }

.wc-room-election-caret { flex: 0 0 auto; color: var(--room-muted); font-size: .75rem; transition: transform .2s ease; }
.wc-room-election[open] .wc-room-election-caret { transform: rotate(180deg); }
.wc-room-election-body { margin-top: 13px; }

.wc-room-election-seal,
.wc-room-prefects-emblem {
    display: grid;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--room-accent) 45%, transparent);
    border-radius: 50%;
    color: var(--room-accent);
    background: color-mix(in srgb, var(--room-accent) 10%, transparent);
    font-size: 1.1rem;
}

/* The prefects' hall reuses this emblem outside an election header, where the
   larger badge is still the right weight. */
.wc-room-prefects-emblem { flex-basis: 50px; width: 50px; height: 50px; font-size: 1.3rem; }

.wc-room-election-frozen { margin: 0 0 10px; color: var(--room-muted); font-size: .76rem; }
.wc-room-election-frozen i { color: var(--room-accent); margin-left: 5px; }
.wc-room-election-notice { padding: 10px 12px; border-radius: 10px; color: var(--room-ink); background: color-mix(in srgb, var(--room-primary) 14%, transparent); font-size: .88rem; }

.wc-room-election-stage {
	margin: 16px 0 8px;
	padding: 14px 16px;
	border: 1px solid var(--room-border);
	border-radius: 13px;
	background: color-mix(in srgb, var(--room-primary) 10%, var(--room-panel-2));
}
.wc-room-election-stage h3 {
	margin: 0 0 5px;
	color: var(--room-ink);
	font-size: .94rem;
}
.wc-room-election-stage p {
	margin: 0;
	color: var(--room-muted);
	line-height: 1.9;
	font-size: .86rem;
}

.wc-room-election-candidates { display: grid; gap: 10px; margin: 18px 0; padding: 0; list-style: none; }
.wc-room-election-candidates li { display: flex; align-items: flex-start; gap: 13px; padding: 15px; border: 1px solid var(--room-border); border-radius: 13px; background: var(--room-panel-2); }
.wc-room-election-candidates img { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.wc-room-election-candidates li > div { flex: 1 1 auto; min-width: 0; }

/* Name and tally share the first line; the statement gets the full width of
   the card underneath. As a third column of the row the tally took the width
   the statement needed, and a long sealed marker left the text wrapping one
   word per line. */
.wc-room-election-candidate-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.wc-room-election-candidates strong { color: var(--room-ink); font-size: .92rem; }
.wc-room-election-candidates p {
    margin: 7px 0 0;
    padding-inline-start: 11px;
    border-inline-start: 2px solid color-mix(in srgb, var(--room-accent) 30%, transparent);
    color: var(--room-muted);
    font-size: .86rem;
    line-height: 1.95;
    overflow-wrap: anywhere;
}
.wc-room-election-candidates .is-eliminated { opacity: .58; }
.wc-room-election-count { flex: 0 0 auto; padding: 3px 10px; border-radius: 99px; color: var(--room-accent); background: color-mix(in srgb, var(--room-accent) 10%, transparent); font-size: .74rem; line-height: 1.8; }
/* The sealed count says the ballot box is shut, not that the candidate is at
   zero — so it must not wear the colour the real numbers wear. */
.wc-room-election-count--sealed { color: var(--room-muted); background: rgba(255, 255, 255, .04); font-size: .72rem; }
.wc-room-election-count--sealed i { margin-left: 5px; }

.wc-room-election-rules,
.wc-room-election-charter { margin: 14px 0; padding: 15px; border: 1px solid var(--room-border); border-radius: 13px; background: var(--room-panel-2); font-size: .86rem; }
.wc-room-election-rules h3,
.wc-room-election-charter h3 { margin-top: 0; margin-bottom: 10px; color: var(--room-ink); font-size: .92rem; }
.wc-room-election-charter p { margin: 0; line-height: 1.95; }
.wc-room-election-rules ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 16px; margin: 0; padding: 0; list-style: none; }
.wc-room-election-rules li { display: flex; align-items: center; gap: 7px; color: var(--room-muted); }
.wc-room-election-rules li small { margin-inline-start: auto; }
.wc-room-election-rules .is-pass i { color: #4ade80; }
.wc-room-election-rules .is-fail i { color: #f87171; }

.wc-room-election-form,
.wc-room-election-ballot { margin-top: 18px; }
.wc-room-election-form > label:first-of-type { display: grid; gap: 7px; color: var(--room-ink); font-weight: 700; }
.wc-room-election-form textarea { width: 100%; padding: 11px; border: 1px solid var(--room-border); border-radius: 10px; color: var(--room-ink); background: var(--room-panel-2); font: inherit; }
.wc-room-election-accept { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: var(--room-ink); }
.wc-room-election-ballot fieldset { display: grid; gap: 8px; margin: 0 0 12px; padding: 14px; border: 1px solid var(--room-border); border-radius: 12px; }
.wc-room-election-ballot legend { padding: 0 8px; color: var(--room-ink); font-weight: 700; }
.wc-room-election-ballot label { color: var(--room-ink); font-size: .9rem; }
.wc-room-election-ballot small { margin-right: 10px; color: var(--room-muted); font-size: .78rem; }
.wc-room-election-winner { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 15px; border: 1px solid color-mix(in srgb, #f5c451 45%, transparent); border-radius: 14px; background: color-mix(in srgb, #f5c451 10%, var(--room-panel)); }
.wc-room-election-winner i { color: #f5c451; font-size: 1.35rem; }
.wc-room-election-winner strong { font-size: .98rem; }
.wc-room-election-winner span { color: var(--room-muted); font-size: .84rem; }
.wc-room-election-empty { color: var(--room-muted); font-size: .86rem; }
.wc-room-election-current-rules { margin: 14px 0 22px; padding: 13px 16px; border: 1px solid var(--room-border); border-radius: 12px; color: var(--room-muted); background: var(--room-panel); font-size: .85rem; }
/* Folded into the panel rather than sitting beside it: no trailing gap, and a
   flatter ground so it reads as a section of the box, not a card on top of one. */
.wc-room-election-body > .wc-room-election-current-rules { margin: 14px 0 0; background: var(--room-panel-2); }
.wc-room-election-current-rules summary { cursor: pointer; color: var(--room-ink); font-size: .92rem; font-weight: 700; }
.wc-room-election-current-rules summary i { color: var(--room-accent); margin-left: 6px; }
.wc-room-election-current-rules ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px; margin: 14px 0; }
.wc-room-election-current-rules p { padding-top: 12px; border-top: 1px solid var(--room-border); line-height: 1.9; }
.wc-room-election-cta { white-space: nowrap; }

/* ---------------------------------------------------------- prefect badge */

/* A prefect keeps their own name; this is the mark that follows it. Small,
   quiet and inline — it rides beside a name inside running text, in a topic
   list, in a byline and in the comment walker's `.fn`, so it must never grow
   tall enough to push a line apart. `vertical-align` rather than flex
   alignment for the same reason: it sits *in* the text, not beside it. */
.wc-room-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 7px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .68rem;
    line-height: 1.7;
    vertical-align: 1px;
    white-space: nowrap;
}

.wc-room-badge i { font-size: .62rem; }

.wc-room-badge--prefect {
    color: var(--room-accent, #d8b4fe);
    border-color: color-mix(in srgb, var(--room-accent, #d8b4fe) 40%, transparent);
    background: color-mix(in srgb, var(--room-accent, #d8b4fe) 12%, transparent);
}

/* The comment walker prints room replies outside `.wc-room`'s custom
   properties on some screens, so the badge needs a palette of its own there
   rather than falling back to an unset variable. */
.comment-author .wc-room-badge--prefect,
.fn .wc-room-badge--prefect {
    color: #d8b4fe;
    border-color: rgba(216, 180, 254, .4);
    background: rgba(216, 180, 254, .12);
}

/* ============================================ PREFECT TOOLS & LOG BOOK ==== */

/* The reminder in a prefect's own room. Same card language as the election
   panel, because it does the same job — an official notice inside the room. */
.wc-room-prefect-tools {
    margin: 26px 0 10px;
    padding: 20px 22px;
    border: 1px solid color-mix(in srgb, var(--room-accent) 30%, transparent);
    border-radius: var(--room-radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--room-accent) 7%, var(--room-panel)), var(--room-panel) 60%);
}

.wc-room-prefect-tools header { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.wc-room-prefect-tools header .wc-room-eyebrow { margin: 0 0 2px; }
.wc-room-prefect-tools h2 { margin: 0; color: var(--room-ink); font-size: 1.15rem; }

.wc-room-prefect-tools-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin: 0 0 14px;
    padding: 0;
    list-style: none;
}

.wc-room-prefect-tools-list li { display: flex; align-items: baseline; gap: 8px; color: var(--room-muted); line-height: 1.9; }
.wc-room-prefect-tools-list i { flex: 0 0 auto; color: var(--room-accent); font-size: .85rem; }
.wc-room-prefect-tools-list strong { color: var(--room-ink); }

.wc-room-prefect-tools-note {
    margin: 0;
    padding-top: 13px;
    border-top: 1px solid var(--room-border);
    color: var(--room-muted);
    font-size: .88rem;
    line-height: 2;
}

.wc-room-prefect-tools-note i { color: var(--room-accent); margin-left: 6px; }
.wc-room-prefect-tools-note strong { color: var(--room-ink); }

/* The prefect's control inside the reply's action row. Deliberately quiet — it
   sits in every thread a moderator reads, so it must not shout over the
   conversation — but fenced off by a rule from the member-facing controls
   beside it, because a moderation link is not one of their options. */
.wc-room-cmod {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding-inline-start: 10px;
    border-inline-start: 1px solid var(--room-border);
    font-size: .74rem;
}

.wc-room-cmod-label { display: inline-flex; align-items: center; gap: 5px; color: var(--room-muted); white-space: nowrap; }
.wc-room-cmod-label i { color: var(--room-accent); margin: 0; }
.wc-room-cmod-link { color: var(--room-secondary); text-decoration: none; }
.wc-room-cmod-link:hover { text-decoration: none; }
.wc-room-comment-tools .wc-room-cmod-link:hover { color: var(--room-ink); border-color: var(--room-accent); background: color-mix(in srgb, var(--room-accent) 14%, transparent); }
.wc-room-cmod-link.is-danger { color: #f87171; }
.wc-room-comment-tools .wc-room-cmod-link.is-danger { border-color: rgba(248, 113, 113, .3); }
.wc-room-comment-tools .wc-room-cmod-link.is-danger:hover { color: #fecaca; border-color: rgba(248, 113, 113, .55); background: rgba(248, 113, 113, .12); }

/* On a phone the moderation link is a row of the overflow menu rather than a
   pill on the action row, so the label becomes its heading. */
@media (max-width: 640px) {
    .wc-room-comment-tools .wc-room-cmod {
        flex-direction: column;
        align-items: stretch;
        gap: 3px;
        margin-top: 3px;
        padding: 6px 0 0;
        border-inline-start: 0;
        border-top: 1px solid var(--room-border);
    }

    .wc-room-comment-tools .wc-room-cmod-label { padding: 0 10px 2px; font-size: .68rem; }
}

/* The log book panel in the prefects' hall. */
.wc-room-modlog {
    margin: 22px 0;
    border: 1px solid var(--room-border);
    border-radius: var(--room-radius);
    background: var(--room-panel);
    overflow: hidden;
}

/* Closed, the head is the whole panel — so the bottom rule only belongs there
   once something is under it. */
.wc-room-modlog-head {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
}

.wc-room-modlog-head::-webkit-details-marker { display: none; }
.wc-room-modlog-head::marker { content: ''; }
.wc-room-modlog[open] > .wc-room-modlog-head { border-bottom: 1px solid var(--room-border); }
.wc-room-modlog-head .wc-room-eyebrow { margin: 0 0 2px; }
.wc-room-modlog-head h2 { margin: 0; color: var(--room-ink); font-size: 1.12rem; }
.wc-room-modlog-total { margin-inline-start: auto; color: var(--room-muted); font-size: .8rem; white-space: nowrap; }
.wc-room-modlog-caret { flex: 0 0 auto; color: var(--room-muted); font-size: .75rem; transition: transform .2s ease; }
.wc-room-modlog[open] .wc-room-modlog-caret { transform: rotate(180deg); }
.wc-room-modlog-empty { padding: 16px 20px; }

.wc-room-modlog-list { margin: 0; padding: 0; list-style: none; }

.wc-room-modlog-list li {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 13px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.wc-room-modlog-list li:last-child { border-bottom: 0; }
.wc-room-modlog-list li > div { flex: 1 1 auto; min-width: 0; }

.wc-room-modlog-icon {
    display: grid;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--room-border);
    color: var(--room-muted);
    font-size: .78rem;
}

/* A removal reads differently from a pin, and the row should say so at a glance. */
.wc-room-modlog-list li.is-danger .wc-room-modlog-icon { color: #f87171; border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .08); }
.wc-room-modlog-list li.is-warn .wc-room-modlog-icon { color: #fbbf24; border-color: rgba(251, 191, 36, .32); background: rgba(251, 191, 36, .08); }

.wc-room-modlog-what { margin: 0 0 4px; color: var(--room-muted); line-height: 1.8; }
.wc-room-modlog-what strong { color: var(--room-ink); }
.wc-room-modlog-target { color: var(--room-muted); }

.wc-room-modlog-where {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 0;
    color: var(--room-muted);
    font-size: .74rem;
}

.wc-room-modlog-where i { margin-left: 4px; }
.wc-room-modlog-where a { color: var(--room-secondary); }
.wc-room-modlog-note { font-style: italic; opacity: .85; }

@media (max-width: 640px) {
    .wc-room-prefect-tools-list { grid-template-columns: 1fr; }
    .wc-room-modlog-head { flex-wrap: wrap; }
    /* The caret takes the space the count gave up, so the closed panel still
       reads as something that opens. */
    .wc-room-modlog-caret { margin-inline-start: auto; }
    .wc-room-modlog-total { order: 3; margin-inline-start: 46px; width: 100%; }
}

/* ================================================== THE PREFECTS' HALL ==== */

/* The hall belongs to all four houses, so it takes neither a house palette nor
   the hub's: the corridor's violet with the prefects' gold on top of it. Both
   selectors — the index writes `.wc-room--prefects`, a topic page writes
   `.wc-room-house-prefects` — or a thread in the hall would fall back to the
   default purple and stop looking like the room it is in. */
.wc-room--prefects,
.wc-room-house-prefects {
    --room-primary: #7c4dcc;
    --room-secondary: #b88bf4;
    --room-deep: #130d24;
    --room-accent: #e5c36b;
}

/* -------------------------------------------------------------- the door - */

/* The fifth door on the hub floor. Wide rather than square because it sits
   under the 2×2 grid instead of inside it, but it speaks the doors' language:
   its own accent pair driving the shared `.wc-room-door-btn` (which is built
   on --door/--door-2 and rendered as invisible dark text without them), the
   accent line that widens on hover, the glow and the lift. */
.wc-room-prefects-door {
    --door: #e5c36b;
    --door-2: #a97bf0;

    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 22px 0 0;
    padding: 22px 24px;
    border: 1px solid rgba(229, 195, 107, 0.2);
    border-radius: var(--room-radius);
    background: #14121c;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.35s, border-color 0.35s;
}

.wc-room-prefects-door::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(70% 130% at 92% 0%, color-mix(in srgb, var(--door) 22%, transparent) 0%, transparent 70%);
    opacity: 0.7;
    transition: opacity 0.35s;
}

.wc-room-prefects-door::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--door), var(--door-2), transparent);
    transform: scaleX(0.4);
    transition: transform 0.45s ease;
}

.wc-room-prefects-door:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--door) 50%, transparent);
    box-shadow: 0 22px 50px -20px color-mix(in srgb, var(--door) 55%, transparent);
}

.wc-room-prefects-door:hover::after { transform: scaleX(1); }
.wc-room-prefects-door:hover::before { opacity: 1; }
.wc-room-prefects-door > * { position: relative; z-index: 1; }

/* Same reason as the eyebrow: the emblem belongs to the door, not to the
   corridor's palette it happens to be standing in. */
.wc-room-prefects-door .wc-room-prefects-emblem {
    color: var(--door);
    border-color: color-mix(in srgb, var(--door) 45%, transparent);
    background: color-mix(in srgb, var(--door) 12%, transparent);
}

.wc-room-prefects-door-text { flex: 1 1 auto; min-width: 0; }
/* The hub's --room-accent is the corridor's violet; on this card the gold is
   the identity, so the eyebrow follows the door rather than the floor. */
.wc-room-prefects-door-text .wc-room-eyebrow { margin: 0 0 4px; color: var(--door); }
.wc-room-prefects-door h2 { margin: 0 0 4px; color: #fff; font-size: 1.3rem; }
.wc-room-prefects-door p { margin: 0; color: var(--room-muted); font-size: 0.9rem; }
.wc-room-prefects-door .wc-room-door-btn { flex: 0 0 auto; }

/* ------------------------------------------------------------- the crests */

/* One room, four houses — so the crest of this room is all four of them, the
   visitor's own one lit. Same device as the front-page hub banner. */
.wc-room-prefects-crests {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wc-room-prefects-crest {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    opacity: 0.68;
    transition: opacity 0.3s, transform 0.3s, border-color 0.3s, background 0.3s;
}

/* The crest art is dim by design (see promo.css) — dimmed further by the
   unlit opacity it disappears into the card. */
.wc-room-prefects-crest img { width: 32px; height: auto; filter: brightness(1.2); }

.wc-room-prefects-crest.is-mine {
    opacity: 1;
    border-color: color-mix(in srgb, var(--room-accent) 50%, transparent);
    background: color-mix(in srgb, var(--room-accent) 12%, transparent);
    box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--room-accent) 70%, transparent);
}

.wc-room-prefects-door:hover .wc-room-prefects-crest { opacity: 0.9; transform: translateY(-2px); }
.wc-room-prefects-door:hover .wc-room-prefects-crest.is-mine { opacity: 1; }

/* ------------------------------------------------------------- the banner */

.wc-room-prefects-banner { border-color: color-mix(in srgb, var(--room-accent) 24%, transparent); }

/* A house banner is crest → text → stats. This one has no house crest and no
   per-house numbers, so the emblem stands in for the first and the four crests
   for the last; without them the banner sat half empty. */
.wc-room-prefects-banner .wc-room-prefects-emblem {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    font-size: 1.8rem;
    animation: wc-room-crest-float 6s ease-in-out infinite alternate;
}

.wc-room-prefects-banner .wc-room-eyebrow { margin: 0 0 4px; }

/* --------------------------------------------------------- the locked door */

/* The house version hangs the padlock off a 120px crest image; here the crest
   is a glyph, so it needs the size the image would have had. */
.wc-room-prefects-lock { color: var(--room-accent); }
.wc-room-prefects-lock > i { font-size: 4.6rem; opacity: 0.75; }

@media (max-width: 640px) {
    .wc-room-election { padding: 16px; }
    .wc-room-election-upcoming { align-items: flex-start; flex-wrap: wrap; }
    .wc-room-election-upcoming__text { flex-basis: calc(100% - 58px); }
    .wc-room-election-upcoming time { margin-inline-start: 56px; }
    .wc-room-prefects-door { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
    .wc-room-prefects-door-text { flex: 1 1 100%; order: 2; }
    .wc-room-prefects-crests { order: 3; }
    .wc-room-prefects-door .wc-room-door-btn { order: 4; margin-inline-start: auto; }
    /* The seal and the caret hold the two ends of the closed header, and the
       title and the meta stack between them. Sharing one line was the version
       that broke: a full deadline — «مهلت: ۲۵ مرداد ۰۵ در ۹:۰۰ ب٫ظ» — left the
       phase name and the count each wrapping onto two lines of their own. */
    .wc-room-election-head {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas:
            "seal text caret"
            "seal meta caret";
        align-items: center;
        gap: 3px 10px;
    }

    .wc-room-election-head .wc-room-election-seal { grid-area: seal; }
    .wc-room-election-head-text { grid-area: text; }
    .wc-room-election-head h2 { font-size: 1rem; }
    .wc-room-election-head-meta { grid-area: meta; justify-content: flex-start; gap: 3px 12px; }
    .wc-room-election-caret { grid-area: caret; }
    .wc-room-election-rules ul { grid-template-columns: 1fr; }
    .wc-room-election-current-rules ul { grid-template-columns: 1fr; }
    /* Deliberately *not* wrapping: the name and tally already wrap inside
       their own row, and letting the card wrap instead pushed the avatar onto
       a line by itself with nothing beside it. */
    .wc-room-election-candidates li { gap: 10px; padding: 12px; }
    .wc-room-election-candidates img { width: 40px; height: 40px; }
    .wc-room-election-candidates p { padding-inline-start: 10px; }
}

/* On a phone the avatar column costs the statement about a quarter of the
   line — enough to break a sentence into three-word fragments. Flattening the
   wrapper into the card's own grid lets the statement run under the avatar
   while the name stays beside it. */
@media (max-width: 480px) {
    .wc-room-election-candidates li {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: start;
    }

    .wc-room-election-candidates li > div { display: contents; }
    .wc-room-election-candidate-head { grid-column: 2; align-self: center; min-height: 40px; }
    .wc-room-election-candidates p { grid-column: 1 / -1; margin-top: 10px; }
}

/* =================================================== THE GREAT HALL ======= */

/* The room every house shares. It takes neither a house palette nor the hub's
   violet: candlelit stone, an amber warm enough to read as its own room and
   far enough from Hufflepuff's bright gold not to be mistaken for it.

   Both selectors, for the same reason the prefects' hall needs both — the index
   writes `.wc-room--public` and a topic page writes `.wc-room-house-public`, and
   with only one of them a thread in the hall falls back to the default purple
   and stops looking like the room it is in. */
.wc-room--public,
.wc-room-house-public {
    --room-primary: #C68B3C;
    --room-secondary: #f0b45f;
    --room-deep: #1b1207;
    --room-accent: #e8d5a8;
}

/* -------------------------------------------------------- the atmosphere - */

/* Four banners hanging over the tables. The hall's identity is that all four
   houses are in it at once, so its weather is the four house colours together
   rather than any one of them — the one ambience on the site that would be
   wrong anywhere else. */
.wc-room--public .wc-room-scene::before,
.wc-room-house-public .wc-room-scene::before {
    /* Dust in the candlelight, in the four colours. Two tile sizes with no
       common factor, so the field never settles into a readable grid. */
    background-image:
        radial-gradient(1.6px 1.6px at 12% 18%, #ffb3a8, transparent),
        radial-gradient(1.2px 1.2px at 55% 8%,  #ffe6ad, transparent),
        radial-gradient(1.7px 1.7px at 84% 26%, #a8caff, transparent),
        radial-gradient(1.1px 1.1px at 27% 41%, #a8e0cf, transparent),
        radial-gradient(1.4px 1.4px at 5%  56%, #ffe6ad, transparent),
        radial-gradient(1.2px 1.2px at 73% 44%, #ffb3a8, transparent),
        radial-gradient(1.8px 1.8px at 40% 65%, #fff3d4, transparent),
        radial-gradient(1.1px 1.1px at 93% 70%, #a8caff, transparent),
        radial-gradient(1.3px 1.3px at 20% 80%, #a8e0cf, transparent),
        radial-gradient(1.5px 1.5px at 64% 90%, #ffe6ad, transparent),
        radial-gradient(1.1px 1.1px at 8%  94%, #fff3d4, transparent),
        radial-gradient(1.4px 1.4px at 87% 96%, #ffb3a8, transparent);
    background-size: 450px 450px;
    animation: wc-room-hall-motes 9s ease-in-out infinite alternate;
}

.wc-room--public .wc-room-scene::after,
.wc-room-house-public .wc-room-scene::after {
    /* The banners themselves: scarlet and gold high on one wall, blue and
       green on the other, with the floor lost in the dark between them. */
    background:
        radial-gradient(40% 34% at 6% 4%,   rgba(220, 87, 79, 0.20) 0%, transparent 68%),
        radial-gradient(38% 30% at 33% 0%,  rgba(252, 192, 86, 0.18) 0%, transparent 70%),
        radial-gradient(38% 30% at 67% 0%,  rgba(43, 119, 223, 0.18) 0%, transparent 70%),
        radial-gradient(40% 34% at 94% 4%,  rgba(90, 139, 128, 0.20) 0%, transparent 68%),
        radial-gradient(70% 44% at 50% 92%, rgba(198, 139, 60, 0.16) 0%, transparent 74%),
        radial-gradient(90% 60% at 50% 112%, rgba(16, 11, 6, 0.82) 0%, transparent 72%);
    opacity: 0.9;
    animation: wc-room-hall-glow 24s ease-in-out infinite alternate;
    will-change: transform, opacity;
}

@keyframes wc-room-hall-motes {
    0%   { opacity: 0.36; transform: translate3d(0, 0, 0); }
    50%  { opacity: 0.78; }
    100% { opacity: 0.50; transform: translate3d(12px, -13px, 0); }
}

@keyframes wc-room-hall-glow {
    0%   { transform: scale(1);    opacity: 0.76; }
    100% { transform: scale(1.06); opacity: 1; }
}

/* -------------------------------------------------------------- the door - */

/* Built on `.wc-room-prefects-door`'s pattern rather than a fifth house card:
   it is not a fifth house, it is the room the four of them open onto, so it is
   wide and sits under the grid. --door/--door-2 are not optional — the shared
   `.wc-room-door-btn` is built on them and paints near-black text on an invalid
   gradient without them. */
.wc-room-public-door {
    --door: #e0a94f;
    --door-2: #d97757;

    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 24px 0 0;
    padding: 22px 24px;
    border: 1px solid rgba(224, 169, 79, 0.22);
    border-radius: var(--room-radius);
    background: #171208;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.35s, border-color 0.35s;
}

.wc-room-public-door::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(70% 130% at 92% 0%, color-mix(in srgb, var(--door) 20%, transparent) 0%, transparent 70%);
    opacity: 0.7;
    transition: opacity 0.35s;
}

.wc-room-public-door::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    top: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--door), var(--door-2), transparent);
    transform: scaleX(0.4);
    transition: transform 0.45s ease;
}

.wc-room-public-door:hover {
    transform: translateY(-6px);
    border-color: color-mix(in srgb, var(--door) 50%, transparent);
    box-shadow: 0 22px 50px -20px color-mix(in srgb, var(--door) 55%, transparent);
}

.wc-room-public-door:hover::after { transform: scaleX(1); }
.wc-room-public-door:hover::before { opacity: 1; }
.wc-room-public-door > * { position: relative; z-index: 1; }

.wc-room-public-door-text { flex: 1 1 auto; min-width: 0; }
/* The hub's --room-accent is the corridor's violet; on this card the amber is
   the identity, so the eyebrow follows the door rather than the floor. */
.wc-room-public-door-text .wc-room-eyebrow { margin: 0 0 4px; color: var(--door); }
.wc-room-public-door h2 { margin: 0 0 4px; color: #fff; font-size: 1.3rem; }
.wc-room-public-door p { margin: 0; color: var(--room-muted); font-size: 0.9rem; }
.wc-room-public-door .wc-room-door-btn { flex: 0 0 auto; }

/* The house doors are stacked cards, where the rules above and below the
   numbers separate them from the tagline and the button. Here the numbers sit
   *between* two things on one line, so the rules would be two stray verticals'
   worth of noise. */
.wc-room-public-door .wc-room-door-stats {
    flex: 0 0 auto;
    margin: 0;
    padding: 0;
    border: 0;
    gap: 16px;
}

/* ------------------------------------------------------------ the emblem - */

.wc-room-public-emblem {
    display: grid;
    place-items: center;
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--room-accent) 34%, transparent);
    background: color-mix(in srgb, var(--room-accent) 10%, transparent);
    color: var(--room-accent);
    font-size: 1.3rem;
}

.wc-room-public-door .wc-room-public-emblem {
    color: var(--door);
    border-color: color-mix(in srgb, var(--door) 45%, transparent);
    background: color-mix(in srgb, var(--door) 12%, transparent);
}

/* ------------------------------------------------------------- the crests */

/* One room, four houses — the visitor's own crest lit. On the banner they sit
   on their own line under it rather than inside it: the hall *does* have stats
   to put where a house banner puts them, so the crests would have had nowhere
   to go without pushing the numbers out. */
.wc-room-public-crests {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.wc-room-public-crests--banner {
    justify-content: center;
    margin: -8px 0 22px;
}

.wc-room-public-crest {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    opacity: 0.68;
    transition: opacity 0.3s, transform 0.3s, border-color 0.3s, background 0.3s;
}

/* The crest art is dim by design (see promo.css) — dimmed further by the
   unlit opacity it disappears into the card. */
.wc-room-public-crest img { width: 32px; height: auto; filter: brightness(1.2); }

.wc-room-public-crest.is-mine {
    opacity: 1;
    border-color: color-mix(in srgb, var(--room-accent) 50%, transparent);
    background: color-mix(in srgb, var(--room-accent) 12%, transparent);
    box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--room-accent) 70%, transparent);
}

/* ------------------------------------------------------------- the banner */

.wc-room-public-banner { border-color: color-mix(in srgb, var(--room-accent) 24%, transparent); }

.wc-room-public-banner .wc-room-public-emblem {
    flex: 0 0 68px;
    width: 68px;
    height: 68px;
    font-size: 1.8rem;
    animation: wc-room-crest-float 6s ease-in-out infinite alternate;
}

.wc-room-public-banner .wc-room-eyebrow { margin: 0 0 4px; }

/* --------------------------------------------------------- the origin chip */

/* Every row in the hall is «باز به روی همه», so that flag says nothing here.
   Which door the conversation started behind does, so it takes the flag's
   place in the meta line. */
.wc-room-origin {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 1px 9px;
    border-radius: 99px;
    border: 1px solid var(--room-border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--room-ink);
    font-size: 0.7rem;
    line-height: 1.9;
}

.wc-room-origin i { color: inherit; opacity: 0.85; }
.wc-room-origin--hall { color: var(--room-accent); border-color: color-mix(in srgb, var(--room-accent) 34%, transparent); }
.wc-room-origin--gryffindor { color: #ff8a7a; border-color: rgba(220, 87, 79, 0.34); }
.wc-room-origin--hufflepuff { color: #ffda8a; border-color: rgba(252, 192, 86, 0.34); }
.wc-room-origin--ravenclaw  { color: #7db4ff; border-color: rgba(43, 119, 223, 0.4); }
.wc-room-origin--slytherin  { color: #8ed3c0; border-color: rgba(90, 139, 128, 0.42); }

/* --------------------------------------------------------- the locked door */

/* The house version hangs the padlock off a 120px crest image; here the crest
   is a glyph, so it needs the size the image would have had. */
.wc-room-public-lock { color: var(--room-accent); }
.wc-room-public-lock > i { font-size: 4.6rem; opacity: 0.75; }

@media (max-width: 640px) {
    .wc-room-public-door { align-items: flex-start; flex-wrap: wrap; padding: 18px; }
    .wc-room-public-door-text { flex: 1 1 100%; order: 2; }
    .wc-room-public-door .wc-room-door-stats { order: 3; }
    .wc-room-public-door .wc-room-door-btn { order: 4; margin-inline-start: auto; }
    .wc-room-public-crests--banner { gap: 8px; }
    .wc-room-public-crest { width: 40px; height: 40px; }
    .wc-room-public-crest img { width: 27px; }
}

/* ============================================================================
   ROOM SHORTCUT BAR  (.wc-room-shortcutbar)
   ----------------------------------------------------------------------------
   NOT `.wc-room-toolbar` — that class was already taken by the search + sort bar
   further up this file, and both were being styled by whichever block came
   last. Anything added here must stay under the `shortcutbar` prefix.
   ----------------------------------------------------------------------------
   One segmented control, not a scatter of loose pills. A single rounded track
   holds every shortcut, hairlines separate the three groups (places / mine /
   off-site), and the current page is filled rather than outlined — so the bar
   reads as one object whose shape a member learns once, instead of a list they
   re-read on every page.
   ========================================================================== */

.wc-room-shortcutbar {
    /* Centred at every width. The track is `width: max-content`, so it shrinks
       to its contents and this is what puts that shrunken box in the middle of
       the column instead of against the start edge. Once the track outgrows the
       column it fills 100% and becomes a scroller, where centring is a no-op —
       so one rule covers desktop and mobile without a breakpoint. */
    display: flex;
    justify-content: center;
    margin: 22px 0 18px;
}

/* The **track** is the scroll container, not the wrapper around it. That is the
   whole fix for a bar wider than its column: keep the border, the rounded ends
   and the raised surface pinned to the visible width and let the items scroll
   *inside* them. Scrolling the wrapper instead let the viewport edge cut the
   last control in half with no container edge behind it, which reads as a
   broken bar rather than as "there is more this way". */
.wc-room-shortcutbar-track {
    display: flex;
    align-items: stretch;
    gap: 2px;
    width: max-content;
    max-width: 100%;
    padding: 5px;
    border-radius: 16px;
    border: 1px solid var(--room-border);
    /* Two stops rather than a flat fill: the track has to read as a raised
       surface sitting on the room's backdrop, not as a hole cut in it. */
    background: linear-gradient(180deg, var(--room-panel-2), var(--room-panel));
    box-shadow: 0 10px 30px -20px rgba(0, 0, 0, 0.95),
                inset 0 1px 0 rgba(255, 255, 255, 0.045);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* Resting positions land on an item's edge instead of bisecting one.
       `proximity`, not `mandatory`: a short drag should not be yanked back. */
    scroll-snap-type: inline proximity;
    scroll-padding-inline: 5px;
    overscroll-behavior-inline: contain;
}

.wc-room-shortcutbar-track::-webkit-scrollbar { display: none; }

.wc-room-shortcutbar-sep {
    flex: 0 0 1px;
    scroll-snap-align: none;
    align-self: center;
    width: 1px;
    height: 22px;
    margin: 0 5px;
    background: var(--room-border);
}

.wc-room-tool {
    position: relative;
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 11px;
    color: var(--room-muted);
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.18s, background 0.18s;
}

/* The icon is a box, not a glyph, because the badge is anchored to its corner
   and a bare <i> has no reliable one to anchor to. */
.wc-room-tool-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    font-size: 0.98rem;
    color: var(--room-accent);
    transition: color 0.18s, transform 0.18s;
}

.wc-room-tool-label { display: inline-block; }

.wc-room-tool:hover,
.wc-room-tool:focus-visible {
    color: var(--room-ink);
    background: color-mix(in srgb, var(--room-primary) 12%, transparent);
}

.wc-room-tool:hover .wc-room-tool-icon { transform: translateY(-1px); }

.wc-room-tool.is-current {
    color: #14110f;
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    box-shadow: 0 6px 16px -10px color-mix(in srgb, var(--room-primary) 90%, transparent);
}

.wc-room-tool.is-current .wc-room-tool-icon { color: inherit; }
.wc-room-tool.is-current:hover { color: #14110f; }

/* -- the unread badge, on the icon ------------------------------------------ */

.wc-room-tool-badge {
    position: absolute;
    /* Anchored to the icon's upper *outer* corner. In RTL that is the left, so
       this is a logical property: `right` would put it under the label. */
    top: -7px;
    inset-inline-end: -9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    /* A ring in the track's own colour, so the badge reads as sitting *above*
       the icon rather than merged into it. */
    border: 2px solid var(--room-panel);
    background: linear-gradient(135deg, #ff5a4e, #ff8a7a);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.02em;
    box-shadow: 0 2px 8px -2px rgba(255, 90, 78, 0.8);
}

/* Something is waiting: the item stops being muted, and its icon takes the
   badge's colour so the pairing is obvious at a glance. */
.wc-room-tool.has-badge { color: var(--room-ink); }
.wc-room-tool.has-badge .wc-room-tool-icon { color: #ff8a7a; }
.wc-room-tool.has-badge.is-current .wc-room-tool-icon { color: inherit; }

@media (prefers-reduced-motion: no-preference) {
    /* One slow pulse on the ring only — the number itself never moves, so the
       bar cannot reflow, and it stays legible while it breathes. */
    .wc-room-tool-badge { animation: wc-room-badge-pulse 2.6s ease-in-out infinite; }
}

@keyframes wc-room-badge-pulse {
    0%, 100% { box-shadow: 0 2px 8px -2px rgba(255, 90, 78, 0.8); }
    50%      { box-shadow: 0 2px 14px 0 rgba(255, 90, 78, 0.95); }
}

/* -- narrow screens --------------------------------------------------------- */

@media (max-width: 560px) {
    /* Labels go last, not first: an icon-only bar is unreadable to anyone who
       has not memorised it. Only the runs the member did not come here for drop
       their text — the current item keeps its own, because it is the one that
       says where you are, and so does anything carrying a badge.

       Clipped rather than `display: none`: hidden text is dropped from the
       accessibility tree, which would leave a screen reader with eight links
       named only by a decorative <i>. This keeps every label announced while it
       takes no space. */
    .wc-room-tool { padding: 8px 10px; }

    .wc-room-tool-label {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        padding: 0;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .wc-room-tool.is-current .wc-room-tool-label,
    .wc-room-tool.has-badge .wc-room-tool-label {
        position: static;
        width: auto;
        height: auto;
        margin: 0;
        overflow: visible;
        clip-path: none;
    }

    .wc-room-shortcutbar-sep { margin: 0 3px; }
}

/* ============================================================================
   جغدخانه — the owlery
   ----------------------------------------------------------------------------
   Laid out as a messenger, not as a page of stacked cards: one fixed-height
   panel, the conversation list and the open conversation each scrolling inside
   themselves, and the composer pinned to the foot of the thread. That shape is
   what lets somebody read a letter, glance at the rest of their mail and answer
   without the page moving under them.

   Below `--owl-split` the two panes become one, and `[data-view]` on the panel
   decides which of them is on screen — so a phone gets list-then-thread with a
   back arrow, out of the same markup and without a second request.
   ========================================================================== */

.wc-room--owlery {
    /* Owl-post brown over the corridor's violet: the owlery opens off the hub,
       so it keeps the hub's deep ground and takes its own warm accent rather
       than borrowing a house's colour. */
    --room-primary:   #b98a2f;
    --room-secondary: #e3c173;
    --room-deep:      #1b1207;
    --room-accent:    #ffd89b;

    /* One number the whole panel is built from. */
    --owl-h: min(70vh, 620px);
}

.wc-owlery-seal {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, var(--room-secondary), var(--room-primary));
    color: #241a0b;
    font-size: 1.4rem;
    box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.9);
}

.wc-owlery-closed { text-align: center; }
.wc-owlery-closed .wc-owlery-seal { margin: 0 auto 16px; }

/* -- title bar -------------------------------------------------------------- */

/* Two lines of chrome, not a hero banner. The old banner spent a third of the
   first screen introducing a page whose title is already in the toolbar. */
.wc-owlery-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
}

.wc-owlery-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    color: #241a0b;
    font-size: 0.92rem;
}

.wc-owlery-heading {
    margin: 0;
    font-size: 1.22rem;
    line-height: 1.2;
    color: var(--room-ink);
}

.wc-owlery-unread {
    padding: 4px 10px;
    border-radius: 999px;
    background: color-mix(in srgb, #ff5a4e 18%, transparent);
    border: 1px solid rgba(255, 90, 78, 0.4);
    color: #ffb4ab;
    font-size: 0.74rem;
    white-space: nowrap;
}

.wc-owlery-newbtn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-inline-start: auto;
    padding: 9px 16px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    color: #241a0b;
    font-size: 0.84rem;
    text-decoration: none;
    white-space: nowrap;
    transition: filter 0.2s, transform 0.2s;
}

.wc-owlery-newbtn:hover { color: #241a0b; filter: brightness(1.08); transform: translateY(-1px); }
.wc-owlery-newbtn.is-current { filter: none; opacity: 0.55; }

/* -- the panel -------------------------------------------------------------- */

.wc-owlery-app {
    display: grid;
    grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
    height: var(--owl-h);
    margin-bottom: 30px;
    border-radius: var(--room-radius);
    border: 1px solid var(--room-border);
    background: var(--room-panel);
    box-shadow: 0 26px 64px -38px rgba(0, 0, 0, 0.95);
    /* The rounded corners have to clip the panes, which scroll under them. */
    overflow: hidden;
}

.wc-owlery-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.wc-owlery-pane--list {
    border-inline-end: 1px solid var(--room-border);
    background: color-mix(in srgb, var(--room-deep) 26%, var(--room-panel));
}

/* -- conversation list ------------------------------------------------------ */

.wc-owlery-listhead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex: 0 0 auto;
    padding: 13px 16px;
    border-bottom: 1px solid var(--room-border);
    font-size: 0.8rem;
    color: var(--room-muted);
    letter-spacing: 0.01em;
}

.wc-owlery-listcount {
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--room-primary) 16%, transparent);
    color: var(--room-accent);
    font-size: 0.72rem;
}

.wc-owlery-convos {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    margin: 0;
    padding: 6px;
    list-style: none;
}

.wc-owlery-convos li { margin: 0; padding: 0; list-style: none; background: none; }

.wc-owlery-convo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 12px;
    color: var(--room-ink);
    text-decoration: none;
    transition: background 0.16s;
}

.wc-owlery-convo:hover { background: color-mix(in srgb, var(--room-primary) 10%, transparent); }

.wc-owlery-convo.is-active {
    background: color-mix(in srgb, var(--room-primary) 20%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--room-primary) 45%, transparent);
}

.wc-owlery-ava { flex: 0 0 auto; display: inline-flex; }

.wc-owlery-ava img {
    display: block;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.wc-owlery-ava--lg img { width: 40px; height: 40px; }

/* Both rows inside are `min-width: 0` chains so the name and the preview are
   what give up space — without it the time and the badge get pushed out. */
.wc-owlery-convo-main { flex: 1 1 auto; min-width: 0; }

.wc-owlery-convo-top,
.wc-owlery-convo-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.wc-owlery-convo-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.9rem;
}

.wc-owlery-mutedmark { font-size: 0.7em; color: var(--room-muted); }

.wc-owlery-convo-top time {
    flex: 0 0 auto;
    font-size: 0.7rem;
    color: var(--room-muted);
}

.wc-owlery-convo-snip {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.78rem;
    color: var(--room-muted);
}

.wc-owlery-convo-snip b { color: var(--room-muted); font-weight: 400; }

.wc-owlery-convo-badge {
    flex: 0 0 auto;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5a4e, #ff8a7a);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

.wc-owlery-convo.is-unread .wc-owlery-convo-name { font-weight: 700; }
.wc-owlery-convo.is-unread .wc-owlery-convo-snip { color: var(--room-ink); }

.wc-owlery-listempty {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--room-muted);
    font-size: 0.84rem;
    text-align: center;
}

.wc-owlery-listempty i { font-size: 1.5rem; opacity: 0.5; }
.wc-owlery-listempty p { margin: 0; }

.wc-owlery-listpages {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    padding: 8px;
    border-top: 1px solid var(--room-border);
}

.wc-owlery-listpages .wc-room-pagelink { min-width: 30px; padding: 4px 8px; font-size: 0.76rem; }

.wc-owlery-blocks {
    flex: 0 0 auto;
    padding: 9px 14px;
    border-top: 1px solid var(--room-border);
    font-size: 0.76rem;
    color: var(--room-muted);
}

.wc-owlery-blocks summary { cursor: pointer; }
.wc-owlery-blocks ul { margin: 8px 0 0; padding: 0; list-style: none; }

.wc-owlery-blocks li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 5px;
    padding: 0;
    list-style: none;
    background: none;
}

.wc-owlery-blocks form { margin: 0; }

.wc-owlery-blocks button {
    padding: 3px 9px;
    border: 1px solid var(--room-border);
    border-radius: 8px;
    background: var(--room-panel);
    color: var(--room-ink);
    font-family: inherit;
    font-size: 0.72rem;
    cursor: pointer;
}

.wc-owlery-blocks button:hover,
.wc-owlery-blocks button:focus { background: var(--room-panel-2); color: var(--room-ink); }

/* -- thread header ---------------------------------------------------------- */

.wc-owlery-threadbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: 10px 14px;
    border-bottom: 1px solid var(--room-border);
    background: color-mix(in srgb, var(--room-deep) 20%, var(--room-panel));
}

/* Only meaningful in the one-pane layout; above the split there is nothing to
   go back to, because the list never left. */
.wc-owlery-back {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--room-primary) 14%, transparent);
    color: var(--room-accent);
    text-decoration: none;
    font-size: 1rem;
}

.wc-owlery-threadmark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--room-primary) 18%, transparent);
    color: var(--room-accent);
}

.wc-owlery-threadwho { flex: 1 1 auto; min-width: 0; line-height: 1.35; }

.wc-owlery-threadwho strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
    color: var(--room-ink);
}

.wc-owlery-threadwho strong a { color: inherit; text-decoration: none; }
.wc-owlery-threadwho strong a:hover { color: var(--room-secondary); }
.wc-owlery-threadwho small { display: block; font-size: 0.72rem; color: var(--room-muted); }

/* -- the kebab -------------------------------------------------------------- */

.wc-owlery-menu { position: relative; flex: 0 0 auto; }

.wc-owlery-menu summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--room-muted);
    cursor: pointer;
    list-style: none;
}

.wc-owlery-menu summary::-webkit-details-marker { display: none; }
.wc-owlery-menu summary:hover { background: color-mix(in srgb, var(--room-primary) 14%, transparent); color: var(--room-ink); }

.wc-owlery-menu-body {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline-end: 0;
    z-index: 5;
    min-width: 210px;
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--room-border);
    background: var(--room-panel-2);
    box-shadow: 0 20px 44px -22px rgba(0, 0, 0, 0.95);
}

.wc-owlery-menu-body form { margin: 0; }

.wc-owlery-menu-body button {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--room-ink);
    font-family: inherit;
    font-size: 0.82rem;
    text-align: start;
    cursor: pointer;
}

.wc-owlery-menu-body button:hover,
.wc-owlery-menu-body button:focus { background: color-mix(in srgb, var(--room-primary) 16%, transparent); color: var(--room-ink); }
.wc-owlery-menu-body button.is-danger { color: #ff8a7a; }
.wc-owlery-menu-body button.is-danger:hover,
.wc-owlery-menu-body button.is-danger:focus { background: rgba(220, 87, 79, 0.16); color: #ffb4ab; }

/* -- the stream ------------------------------------------------------------- */

.wc-owlery-stream {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 16px 6px;
}

.wc-owlery-older { margin: 0 0 12px; font-size: 0.78rem; text-align: center; }
.wc-owlery-older a { color: var(--room-secondary); text-decoration: none; }

/* A centred date rule, the way every messenger separates days. */
.wc-owlery-day {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
    font-size: 0.7rem;
    color: var(--room-muted);
}

.wc-owlery-day::before,
.wc-owlery-day::after {
    content: '';
    flex: 1 1 auto;
    height: 1px;
    background: var(--room-border);
}

.wc-owlery-msg {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    /* `fit-content`, not a plain max-width: the stream is a block container, so
       a percentage width would make every row that wide whatever the letter
       says — and the report flag, which is positioned against this box, would
       then float in empty space a third of the pane away from the short bubble
       it belongs to. */
    width: fit-content;
    max-width: 76%;
    margin-bottom: 3px;
}

/* Consecutive letters from one person tighten into a run; only the first of a
   run carries the name and the extra space above it. */
.wc-owlery-msg.starts-run { margin-top: 10px; }

/* `margin-inline-start: auto` and not `float` — a long thread never needs
   clearing, and it flips with the document direction on its own. */
.wc-owlery-msg.is-mine { align-items: flex-end; margin-inline-start: auto; }

.wc-owlery-msgwho {
    margin: 0 4px 3px;
    font-size: 0.72rem;
    color: var(--room-accent);
}

.wc-owlery-bubble {
    position: relative;
    padding: 9px 13px 7px;
    border-radius: 14px;
    /* The corner that points at its own side stays square, which is the cue
       that says who is speaking without repeating the name. */
    border-start-start-radius: 5px;
    background: var(--room-panel-2);
    border: 1px solid var(--room-border);
}

.wc-owlery-msg.is-mine .wc-owlery-bubble {
    border-start-start-radius: 14px;
    border-start-end-radius: 5px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--room-primary) 26%, var(--room-panel-2)),
        color-mix(in srgb, var(--room-primary) 15%, var(--room-panel-2)));
    border-color: color-mix(in srgb, var(--room-primary) 45%, transparent);
}

.wc-owlery-msgtext {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.85;
    color: var(--room-ink);
    overflow-wrap: anywhere;
}

.wc-owlery-msgtext.is-removed { color: var(--room-muted); font-style: italic; }
.wc-owlery-msgtext.is-removed i { color: #ff8a7a; margin-inline-end: 5px; }

.wc-owlery-msgtime {
    display: block;
    margin-top: 3px;
    font-size: 0.64rem;
    color: var(--room-muted);
    text-align: end;
}

/* -- the report flag -------------------------------------------------------- */

/* Hidden until the letter is hovered or the control is focused, so a thread is
   a conversation rather than a page of moderation buttons. `:focus-within`
   keeps it reachable from the keyboard, and it stays permanently visible on
   touch, where there is no hover to reveal it. */
.wc-owlery-flagbox {
    position: absolute;
    top: 0;
    inset-inline-start: -26px;
    font-size: 0.72rem;
}

.wc-owlery-flagbox summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    color: var(--room-muted);
    cursor: pointer;
    list-style: none;
    opacity: 0;
    transition: opacity 0.16s, color 0.16s;
}

.wc-owlery-flagbox summary::-webkit-details-marker { display: none; }
.wc-owlery-msg:hover .wc-owlery-flagbox summary,
.wc-owlery-flagbox[open] summary,
.wc-owlery-flagbox summary:focus-visible { opacity: 1; }
.wc-owlery-flagbox summary:hover { color: #ff8a7a; }

@media (hover: none) {
    /* No hover to reveal it, so it stays on — but faint, because it is a
       moderation control sitting beside every letter somebody wrote to you. */
    .wc-owlery-flagbox summary { opacity: 0.3; }
}

.wc-owlery-flagbox form {
    position: absolute;
    top: 26px;
    inset-inline-start: 0;
    z-index: 6;
    width: 250px;
    margin: 0;
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--room-border);
    background: var(--room-panel-2);
    box-shadow: 0 20px 44px -22px rgba(0, 0, 0, 0.95);
}

.wc-owlery-flagbox select,
.wc-owlery-flagbox textarea {
    width: 100%;
    margin-bottom: 7px;
    padding: 7px 9px;
    border-radius: 9px;
    border: 1px solid var(--room-border);
    background: var(--room-panel);
    color: var(--room-ink);
    font-family: inherit;
    font-size: 0.78rem;
}

.wc-owlery-flagbox p { margin: 0 0 8px; font-size: 0.68rem; line-height: 1.7; color: var(--room-muted); }

.wc-owlery-flagbox button {
    width: 100%;
    padding: 7px;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    color: #241a0b;
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
}

.wc-owlery-flagbox button:hover,
.wc-owlery-flagbox button:focus {
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    color: #241a0b;
    filter: brightness(1.08);
}

/* -- composer --------------------------------------------------------------- */

.wc-owlery-composeform {
    display: contents;
}

.wc-owlery-composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    padding: 10px 12px;
    border-top: 1px solid var(--room-border);
    background: color-mix(in srgb, var(--room-deep) 20%, var(--room-panel));
}

.wc-owlery-composer textarea {
    flex: 1 1 auto;
    min-width: 0;
    /* One line to start; JS grows it to fit and stops at max-height, which is
       what keeps the composer from eating the thread above it. */
    height: 42px;
    max-height: 132px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--room-border);
    background: var(--room-panel);
    color: var(--room-ink);
    font-family: inherit;
    font-size: 0.88rem;
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
}

.wc-owlery-composer textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--room-primary) 65%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--room-primary) 16%, transparent);
}

.wc-owlery-send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    color: #241a0b;
    font-size: 0.95rem;
    cursor: pointer;
    transition: filter 0.2s, transform 0.2s;
}

/* custom-pww.css paints a flat dark background on every button's interactive
   states at specificity 0-1-1; restating the gradient here wins at 0-2-0
   without !important. Same trap `.wc-room-btn` documents. */
.wc-owlery-send:hover,
.wc-owlery-send:focus,
.wc-owlery-send:active {
    background: linear-gradient(135deg, var(--room-primary), var(--room-secondary));
    color: #241a0b;
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.wc-owlery-emoji { position: relative; flex: 0 0 auto; }

.wc-owlery-emoji summary {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 42px;
    border-radius: 12px;
    color: var(--room-muted);
    font-size: 1.05rem;
    cursor: pointer;
    list-style: none;
}

.wc-owlery-emoji summary::-webkit-details-marker { display: none; }
.wc-owlery-emoji summary:hover { color: var(--room-accent); }

.wc-owlery-emoji-body {
    position: absolute;
    bottom: calc(100% + 8px);
    inset-inline-start: 0;
    z-index: 6;
    width: 244px;
    padding: 8px;
    border-radius: 12px;
    border: 1px solid var(--room-border);
    background: var(--room-panel-2);
    box-shadow: 0 20px 44px -22px rgba(0, 0, 0, 0.95);
}

.wc-owlery-emoji-body .wc-room-emoji-picker { margin: 0; }

/* -- compose view + placeholder --------------------------------------------- */

.wc-owlery-stream--compose { padding-top: 18px; }

.wc-owlery-toline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 0.88rem;
    color: var(--room-muted);
}

.wc-owlery-toline strong { color: var(--room-ink); }

.wc-owlery-tofield { display: block; margin-bottom: 12px; }

.wc-owlery-tofield span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.78rem;
    color: var(--room-muted);
}

.wc-owlery-tofield input {
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px solid var(--room-border);
    background: var(--room-panel-2);
    color: var(--room-ink);
    font-family: inherit;
    font-size: 0.88rem;
}

.wc-owlery-tofield input:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--room-primary) 65%, transparent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--room-primary) 16%, transparent);
}

.wc-owlery-hint {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 11px;
    border: 1px solid var(--room-border);
    background: color-mix(in srgb, var(--room-primary) 8%, transparent);
    font-size: 0.75rem;
    line-height: 1.9;
    color: var(--room-muted);
}

.wc-owlery-hint i { margin-top: 0.45em; color: var(--room-accent); }

.wc-owlery-placeholder {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px;
    text-align: center;
    color: var(--room-muted);
}

.wc-owlery-placeholder p { margin: 0; font-size: 0.9rem; }

.wc-owlery-blockedfoot {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
    padding: 13px 16px;
    border-top: 1px solid var(--room-border);
    background: rgba(220, 87, 79, 0.1);
    font-size: 0.82rem;
    color: var(--room-ink);
}

.wc-owlery-blockedfoot i { color: #ff8a7a; }

/* -- one pane at a time ----------------------------------------------------- */

@media (max-width: 860px) {
    .wc-room--owlery { --owl-h: min(72dvh, 620px); }

    .wc-owlery-app { grid-template-columns: minmax(0, 1fr); }

    /* Both panes are always in the markup; `data-view` picks the one on screen,
       so moving between them is a normal page load with no second request and
       no duplicated template. */
    .wc-owlery-app[data-view="thread"] .wc-owlery-pane--list,
    .wc-owlery-app[data-view="compose"] .wc-owlery-pane--list { display: none; }
    .wc-owlery-app[data-view="empty"] .wc-owlery-pane--thread { display: none; }

    .wc-owlery-pane--list { border-inline-end: 0; }
    .wc-owlery-back { display: inline-flex; }
    .wc-owlery-msg { max-width: 88%; }

    /* Room for the flag alongside the bubble is gone at this width, so it moves
       inside the letter's own top corner. */
    .wc-owlery-flagbox { inset-inline-start: auto; inset-inline-end: 2px; top: 2px; }
    .wc-owlery-flagbox form { inset-inline-start: auto; inset-inline-end: 0; }
}

@media (max-width: 520px) {
    .wc-owlery-heading { font-size: 1.08rem; }
    .wc-owlery-newbtn { padding: 9px 12px; }
    .wc-owlery-newbtn span { display: none; }
    .wc-owlery-msg { max-width: 94%; }
    .wc-owlery-stream { padding-inline: 12px; }
}

/* The «نامه با جغد» control in a reply's action row, styled like its siblings. */
.wc-room-owl-link { white-space: nowrap; }

/* ============================================================================
   PAGE HEADER — shorter, on room pages only
   ----------------------------------------------------------------------------
   Every non-front page gets `third_header_height` (see wc_get_page_class()),
   and jquery.fortunatopro turns that into an inline `height` of one and a half
   *thirds* of the window — about two-thirds of the screen. On an article that
   is a cover worth having. On a room it is two-thirds of the first screen spent
   on a title the toolbar already carries, before the reader reaches a single
   topic.

   These rules live in this stylesheet rather than in custom-pww.css because
   this file is enqueued only on room pages (wc_room_enqueue_assets()), so the
   override cannot reach an article by accident. `body.wc-room-page` scopes it
   again anyway — belt and braces, and it names the intent for the next reader.

   `!important` is not decoration here: the height is an *inline* style written
   by the theme's own JS, re-applied on every resize, and nothing in a
   stylesheet outranks that without it.
   ========================================================================== */

body.wc-room-page .site-header,
body.wc-room-page .site-brand-main {
    height: clamp(170px, 26vh, 220px) !important;
}

/* Deliberately ASYMMETRIC, which is where this parts company with the tall-hero
   rule in custom-pww.css.

   `#masthead` starts at y=0, underneath the fixed navbar — so on a 258px header
   the top 66px are never seen. `.site-branding` is a table cell that centres its
   content in its own content box, and symmetric padding therefore centres the
   title in the *whole* box, leaving it half a navbar too high in the part the
   reader can actually see. Centring in the visible region instead needs exactly
   one thing: padding-top − padding-bottom = the navbar's height.

   The extra 14px on both sides is slack, not alignment — it keeps the equation
   true while leaving the title off the header's very edge. And the top inset is
   still ≥ the navbar, so a cell that outgrows its box grows downwards and a long
   room name lengthens the header rather than sliding under the bar. */
body.wc-room-page .site-brand-main .site-branding {
    padding-top: calc(var(--wc-navbar-h, 66px) + 14px);
    padding-bottom: 14px;
}

/* The bar is shorter on small screens (new-navbar.css pins it by min-height at
   these same breakpoints) while the token stays 66px. Narrowing it here — scoped
   to room pages, so nothing else reads a changed value — keeps the equation
   above honest instead of pushing the title a few pixels low. */
@media (max-width: 1025px) { body.wc-room-page { --wc-navbar-h: 58px; } }
@media (max-width: 768px)  { body.wc-room-page { --wc-navbar-h: 56px; } }
@media (max-width: 480px)  { body.wc-room-page { --wc-navbar-h: 54px; } }

/* Below this the label and two full-width pills stop fitting one line. Dropped
   rather than clipped — unlike the shortcut bar's labels this text is a second
   copy of the `aria-label` on the <nav> beside it, so the accessibility tree
   keeps the sentence either way and a clipped copy would only say it twice. */
@media (max-width: 420px) {
    .wc-room-csort-label { display: none; }
}

/* 3.5em against a 220px header is most of the box. Scaled to the viewport it
   stays the page's largest text without setting the height itself. */
body.wc-room-page .site-branding .site-title,
body.wc-room-page .site-branding .site-title.custom {
    font-size: clamp(1.45rem, 4.4vw, 2.3rem);
    letter-spacing: -1px;
}

/* The chevron invited a scroll past a hero that is now shorter than the thing
   it was pointing at, and it was the tallest item left in the box. */
body.wc-room-page .site-branding .scrollDown { display: none; }

@media (min-width: 768px) {
    body.wc-room-page .site-header,
    body.wc-room-page .site-brand-main {
        height: clamp(210px, 30vh, 280px) !important;
    }
}
