@layer maxrooster {
    .site-body {
        --mr-body-font: "MR-opensans", system-ui, sans-serif;
        --bs-body-font-family: var(--mr-body-font);
        --body-font: var(--mr-body-font);
    }
    .site-body.henhouse-body { --community-font: var(--mr-body-font); }

    /* Account menu: let Bootstrap own positioning, dismissal and keyboard navigation. */
    .site-header .header-user-dropdown {
        --bs-menu-min-width: 16rem;
        --bs-menu-max-height: calc(100dvh - var(--site-header-height, 80px) - 1rem);
        --bs-menu-border-color: #e4dfd4;
        --bs-menu-item-hover-bg: #f8f1dc;
        --bs-menu-item-active-bg: #f9e9ac;
        --bs-menu-box-shadow: 0 14px 40px #1113;
        max-width: calc(100vw - 1.5rem);
    }
    .site-header .header-user-dropdown .menu-item { display:flex; align-items:center; gap:.65rem; font-weight:600; }
    .site-header .header-user-dropdown .menu-item svg { width:1.05rem; height:1.05rem; flex:none; }
    .site-header .header-dropdown-identity { display:flex; align-items:center; gap:.75rem; }
    .site-header .header-dropdown-identity > div { display:grid; gap:.125rem; min-width:0; overflow-wrap:anywhere; }
    .site-header .header-dropdown-identity strong { color:#171715; font-size:.875rem; }
    .site-header .header-dropdown-identity small { color:#6a655a; }
    .site-header .header-user-dropdown .account-tour-toggle { color:#171715; }
    .site-header .header-user-dropdown .account-logout { color:#a91913; }

    /* Give both scrolling children a definite height and allow both grid items to shrink. */
    .site-body.henhouse-body .messages-layout {
        display:grid;
        grid-template-columns:minmax(0, 1fr) minmax(0, 2fr);
        grid-template-rows:minmax(0, 1fr);
        height:clamp(32rem, calc(100dvh - var(--site-header-height, 80px) - 7rem), 49rem);
        min-height:0;
    }
    .site-body.henhouse-body .messages-layout > :is(.conversation-panel, .message-thread) {
        min-height:0; min-width:0; max-height:none; overflow:hidden;
    }
    .site-body.henhouse-body .conversation-panel > :is(header, .conversation-search),
    .site-body.henhouse-body .message-thread > :not(.message-history, .message-thread-placeholder) { flex:none; }
    .site-body.henhouse-body .conversation-panel > header { padding:1rem 1.125rem .75rem; }
    .site-body.henhouse-body .conversation-panel > header h2 { font-size:clamp(1.3rem,2vw,1.75rem); }
    .site-body.henhouse-body .conversation-search { padding:0 1.125rem .75rem; }
    .site-body.henhouse-body .conversation-search .form-control { font-size:.875rem; }
    .site-body.henhouse-body .messages-layout :is(.conversation-list, .message-history) {
        flex:1 1 0; min-height:0; max-height:none; overflow-y:auto; overscroll-behavior-y:contain; scrollbar-gutter:stable;
    }
    .site-body.henhouse-body .conversation-list { position:relative; padding:.25rem .625rem .75rem; }
    .site-body.henhouse-body .conversation-list:focus-visible,
    .site-body.henhouse-body .message-history:focus-visible { outline:2px solid #b97900; outline-offset:-3px; }
    .site-body.henhouse-body .conversation-list > * { flex:none; }
    .site-body.henhouse-body .conversation-list .numbered-pagination { margin:.25rem 0 0; padding:.5rem 0 0; border:0; }
    .site-body.henhouse-body .conversation-item {
        grid-template-columns:2.5rem minmax(0,1fr) max-content; grid-template-rows:auto;
        align-items:center; gap:.625rem; padding:.625rem; min-height:4.125rem; border:1px solid transparent;
        border-radius:var(--bs-radius-5);
    }
    .site-body.henhouse-body .conversation-item.has-unread { background:#fff6da; }
    .site-body.henhouse-body .conversation-item:hover { background:#f0ede4; }
    .site-body.henhouse-body .conversation-item[aria-current] { background:#ffe9a7; border-color:#d2a83f; }
    .site-body.henhouse-body .conversation-item .message-avatar { grid-row:auto; width:2.5rem; height:2.5rem; }
    .site-body.henhouse-body .conversation-copy strong { font-size:.8125rem; }
    .site-body.henhouse-body .conversation-copy small { font-size:.75rem; color:#635d53; }
    .site-body.henhouse-body .conversation-meta { display:grid; grid-column:auto; grid-row:auto; justify-items:end; gap:.25rem; }
    .site-body.henhouse-body .conversation-meta time { color:#625e54; font-size:.6875rem; }
    .site-body.henhouse-body .community-nav-count { border-radius:var(--bs-radius-pill); font-variant-numeric:tabular-nums; }
    .site-body.henhouse-body .conversation-meta .community-nav-count { min-width:1.125rem; padding:.25em .45em; }
    .site-body.henhouse-body .message-thread-placeholder {
        display:grid; grid-template-columns:minmax(0,26rem); place-content:center; justify-items:center; gap:.75rem; min-height:0;
        background:radial-gradient(ellipse at center,#fff6d8 0,transparent 65%),#fffefa;
    }
    .site-body.henhouse-body .inbox-add-icon { width:1rem; height:1rem; }
    .site-body.henhouse-body .message-thread-placeholder > h2 { color:#222; margin:0; }
    .site-body.henhouse-body .message-thread-placeholder > p { margin:0; color:#625e54; }
    .site-body.henhouse-body .message-thread-placeholder > .inbox-empty-icon {
        width:3.75rem; height:3.75rem; padding:.875rem; border-radius:var(--bs-radius-5); transform:none;
    }
    .site-body.henhouse-body .message-history { justify-content:flex-start; background:#faf8f2; }
    .site-body.henhouse-body .message-history > * { flex:none; }
    .site-body.henhouse-body .message-bubble { border-radius:var(--bs-radius-6); border-end-start-radius:var(--bs-radius-2); }
    .site-body.henhouse-body .message-bubble.is-sent { border-end-start-radius:var(--bs-radius-6); border-end-end-radius:var(--bs-radius-2); }
    .site-body.henhouse-body .message-bubble footer { color:#655f53; }
    @media (width < 768px) {
        .site-body.henhouse-body .messages-layout { grid-template-columns:minmax(0,1fr); height:clamp(29rem,66dvh,42rem); }
        .site-body.henhouse-body .messages-layout > .conversation-panel { border:0; }
    }

    /* Community actions. */
    .site-body.henhouse-body :is(.henhouse-composer, .henhouse-comment-composer) .emoji-picker-toggle {
        display:inline-grid; place-items:center; padding:0; line-height:1;
    }
    .site-body.henhouse-body .emoji-picker-toggle-icon { display:block; width:1.25rem; height:1.25rem; }
    .site-body.henhouse-body .community-content .profile-rooster-search { border-radius:var(--bs-radius-5); }
    .site-body.henhouse-body :is(.henhouse-suggestions,.community-person-actions,.henhouse-composer) .btn-sm {
        min-height:2rem; padding:.35rem .65rem; font-size:.6875rem; line-height:1.3;
    }
    .site-body.henhouse-body .community-connection-tabs {
        display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:.35rem; padding:.35rem;
        border:1px solid #e5dfd2; border-radius:var(--bs-radius-5); background:#f6f3ed;
    }
    .site-body.henhouse-body .community-connection-tabs .nav-link { color:#403b32; border-radius:var(--bs-radius-4); }
    .site-body.henhouse-body .community-connection-tabs .nav-link:not(.active):hover { background:#ece6d8; }
    .site-body.henhouse-body .community-connection-tabs .nav-link.active { color:#fff; background:#201e19; }
    .site-body.henhouse-body .community-connection-tabs .badge { background:#e4decf; color:#353028; }
    .site-body.henhouse-body .community-connection-tabs .active .badge { background:#ffc400; color:#171715; }
    .site-body.henhouse-body .henhouse-comments-panel { border:0; }
    .site-body.henhouse-body .henhouse-comments-toolbar .henhouse-comment-filters {
        display:inline-flex; gap:2px; padding:3px; background:#f2eee4; border-radius:var(--bs-radius-5);
    }
    .site-body.henhouse-body .henhouse-comment-filters > .btn {
        border:0; border-radius:var(--bs-radius-4); margin:0; min-height:1.875rem; color:#484336; background:transparent;
    }
    .site-body.henhouse-body .henhouse-comment-filters > .btn[aria-pressed="true"] { background:#26231d; color:#fff; }
    .site-body.henhouse-body .henhouse-comment-filters > .btn:not([aria-pressed="true"]):hover { background:#e5dece; color:#211e19; }
    .site-body.henhouse-body .henhouse-user-popover {
        width:min(17.5rem, calc(100vw - 3.5rem)); padding:0; border-color:#e1dbce; border-radius:var(--bs-radius-5);
        box-shadow:0 12px 38px #30281c25; color:#171715; background:#fff;
    }
    .site-body.henhouse-body .henhouse-user-popover-top {
        display:flex; align-items:center; gap:.65rem; min-width:0; padding:.85rem; background:#faf6eb;
        border-radius:var(--bs-radius-5) var(--bs-radius-5) 0 0;
    }
    .site-body.henhouse-body .henhouse-user-popover-top > :last-child { min-width:0; overflow-wrap:anywhere; }
    .site-body.henhouse-body .henhouse-user-popover-top small { color:#625b4e; }
    .site-body.henhouse-body .henhouse-user-popover-stats { display:flex; flex-wrap:wrap; gap:.4rem .75rem; padding:.75rem .85rem 0; margin:0; color:#4b4437; }
    .site-body.henhouse-body .henhouse-user-popover-actions { display:flex; flex-wrap:wrap; gap:.35rem; margin:0; padding:.65rem .85rem .85rem; }
    .site-body.henhouse-body .henhouse-user-popover-actions .btn { min-height:1.875rem; font-size:.65rem; padding:.3rem .5rem; }

    /* Rooster art stays in its own frame above the brand strip. */
    .site-body .builder-motion-canvas {
        display:none; position:absolute; bottom:0; left:50%; transform:translateX(-50%);
        width:min(100%,100cqh); height:auto; aspect-ratio:1; z-index:9; pointer-events:none;
    }
    .site-body [data-builder-preview] { container-type:size; }
    .site-body .is-motion-ready > .builder-motion-canvas { display:block; }
    .site-body .is-motion-ready > img.rooster-layer { visibility:hidden; }
    .site-body .hero-character { --hero-brand-height:clamp(2rem,3vw,3rem); }
    .site-body .hero-rooster { bottom:var(--hero-brand-height); height:calc(100% - var(--hero-brand-height)); }
    .site-body .hero-rooster-brand {
        position:absolute; inset:auto 0 0; z-index:10; height:var(--hero-brand-height); display:grid;
        place-items:center; padding:.45rem .75rem; background:#090909;
    }
    .site-body .hero-rooster-brand img { width:auto; height:100%; max-height:1.5rem; object-fit:contain; }
    .site-body .mobile-preview-frame { align-self:center; min-width:0; overflow:hidden; border-radius:var(--bs-radius-4); }
    .site-body .mobile-preview-frame .mobile-trait-preview-art { border-radius:0; }
    .site-body .mobile-rooster-brand { display:grid; place-items:center; padding:.175rem .25rem; background:#090909; }
    .site-body .mobile-rooster-brand img { width:auto; height:.6rem; }

    .site-body .home-about-section { background:#f4eddb; padding-block:clamp(2.5rem,5vw,5rem); }
    .site-body .home-about-layout .home-about-intro { padding:0; }
    .site-body .home-about-layout .home-about-intro h2 { font-size:clamp(2.4rem,4.2vw,4.6rem); color:#a91d14; line-height:1; margin:0 0 1rem; }
    .site-body .home-about-layout .home-about-intro p { color:#40392e; font-size:1rem; max-width:39ch; margin:0; }
    .site-body .home-about-layout .home-about-steps article {
        display:block; position:relative; background:#fffdf7; border:1px solid #ddd2bb;
        border-top:4px solid #ffc400; padding:clamp(1rem,1.8vw,1.75rem);
    }
    .site-body .home-about-steps article h3 { font-size:1.75rem; margin:.75rem 0 .4rem; }
    .site-body .home-about-steps article p { color:#554b3e; font-size:.875rem; margin:0; }
    .site-body .home-about-step-number { position:absolute; top:1.25rem; right:1rem; color:#73644e; font-size:.8rem; font-weight:700; }
    .site-body .home-about-step-icon { border-radius:var(--bs-radius-4); }

    /* Public information pages. */
    .site-body .content-article-page,
    .site-body .contact-page { width:100%; max-width:none; padding:clamp(2rem,5vw,4.5rem) 0; margin:0; }
    .site-body .content-article-page > .container > .content-article-header {
        width:100%; max-width:none; margin:0 0 2rem; padding:0; text-align:left;
    }
    .site-body :is(.content-article-page .content-article-header,.contact-page .compact-page-header) h1 {
        font-size:clamp(3.25rem,7vw,6rem); color:#a91d14; line-height:1; margin:0 0 .6rem; overflow-wrap:anywhere;
    }
    .site-body :is(.content-article-header,.contact-page .compact-page-header) > p { margin:0; font-size:1rem; color:#534a3c; }
    .site-body .contact-page .contact-layout { margin-inline:calc(-.5 * var(--bs-gutter-x, 1.5rem)); }
    .site-body .contact-page :is(.contact-card,.contact-help-card) { padding:0; width:100%; border-color:#ded3bc; box-shadow:none; }
    .site-body .contact-page .contact-card { background:#fff; }
    .site-body .contact-page .contact-help-card { background:#fffaf0; }
    .site-body .contact-page .card-body { padding:clamp(1.15rem,3.1vw,2.25rem); }
    .site-body .contact-page .card-body h2 { margin:0 0 1.15rem; font-size:1.95rem; }
    .site-body .contact-page .contact-help-item { padding:.85rem 0; border-top:1px solid #e8dec9; }
    .site-body .contact-page .contact-help-item:last-child { padding-bottom:0; }
    .site-body .contact-page .contact-help-item h3 { margin:0 0 .25rem; font-size:1.25rem; }
    .site-body .contact-page .contact-help-item p { margin:0; color:#514839; }
    .site-body .contact-page .contact-message-form { position:relative; }
    .site-body .contact-page .contact-message-form .form-label { color:#39342c; font-size:.875rem; font-weight:650; }
    .site-body .contact-page .contact-message-form .form-control { background:#fff; }
    .site-body .contact-page .contact-message-form .honeypot-field { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
    .site-body .contact-page .contact-form-footer { display:flex; flex-wrap:wrap; align-items:center; gap:.65rem 1.25rem; }
    .site-body .contact-page .contact-form-footer small { color:#605649; }
    .site-body .help-reading-column, .site-body .release-history { max-width:52rem; }
    .site-body .help-reading-column .form-control { background:#fff; }
    .site-body .help-section { margin:1.75rem 0; scroll-margin-top:6rem; }
    .site-body .help-section > h2 { font-size:1.85rem; margin:0 0 .75rem; }
    .site-body .help-question-list { overflow:hidden; background:#fff; border:1px solid #ded3bc; border-radius:var(--bs-radius-5); }
    .site-body .help-question-list .help-question { border:0; background:#fff; margin:0; }
    .site-body .help-question-list .help-question + .help-question { border-top:1px solid #e7dfd0; }
    .site-body .help-question-list .help-question summary { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.875rem 1rem; color:#201d18; font-weight:700; }
    .site-body .help-question-list .help-question[open] summary { background:#fff5d4; }
    .site-body .help-question-list .help-question > div { padding:.75rem 1rem; color:#4f4539; }
    .site-body .help-question-list .help-question > div > :last-child { margin-bottom:0; }
    .site-body .help-footer { padding-top:1rem; border-top:1px solid #dfd4bc; }
    .site-body .release-history { display:grid; gap:1rem; }
    .site-body .release-history .card { background:#fffdfa; border-color:#ded3bc; }
    .site-body .release-history .card-body { padding:1.4rem 1.5rem; }
    .site-body .release-history h2 { font-size:2.1rem; margin:.4rem 0 .7rem; }
    .site-body .release-history ul { margin:0; padding-inline-start:1.25rem; }
    .site-body .release-meta { display:flex; align-items:center; flex-wrap:wrap; gap:.75rem; color:#645745; font-size:.8rem; }
}
