.element-site[data-hero-theme] {
    --unified-hero-accent: var(--crest-accent, #e6bd74);
    --unified-hero-ink: var(--unified-ink, #f4e9d3);
    --unified-hero-edge: color-mix(in srgb, var(--unified-hero-accent) 50%, var(--crest-slate, #101f28));
    --unified-hero-art: url('fortress/reference-archive.webp');
    --unified-hero-focus: 48%;
    --unified-hero-size: min(73%, 45rem) auto;
    --unified-hero-title-size: clamp(1.75rem, 2.85vw, 2.44rem);
    --unified-hero-veil: linear-gradient(97deg, #121f28 18%, #12232ddd 45%, #15293678 74%, #12222d46);
    --unified-hero-background:
        var(--unified-hero-veil),
        var(--unified-hero-art) right var(--unified-hero-focus) / var(--unified-hero-size) no-repeat,
        url('fortress/slate-material.webp') center / 51rem auto var(--crest-slate, #101f28);
}

.element-site[data-hero-theme='chat'] { --unified-hero-art: url('renewal/hall.webp'); }
.element-site[data-hero-theme='forum'] { --unified-hero-art: url('renewal/archive.webp'); }
.element-site[data-hero-theme='join'] { --unified-hero-art: url('renewal/watch.webp'); }
.element-site[data-hero-theme='roster'] { --unified-hero-art: url('../design-2026/home/hero-home-three-warriors-v4.webp'); }
.element-site[data-hero-theme='news'] { --unified-hero-art: url('fortress-masthead.webp'); }
.element-site[data-hero-theme='events'] { --unified-hero-art: url('../design-2026/events/event-tournament.webp'); }
.element-site[data-hero-theme='halloween'] { --unified-hero-art: url('../img/event-dungeon.webp'); }
.element-site[data-hero-theme='gate'] { --unified-hero-art: url('fortress/fortress-art.webp'); }
.element-site[data-hero-theme='account'] { --unified-hero-art: url('../design-2026/chat/clan-hall.webp'); }
.element-site[data-hero-theme='forge'] { --unified-hero-art: url('fortress/reference-forge.webp'); }
.element-site[data-hero-theme='safe'] { --unified-hero-art: url('renewal/forge.webp'); }
.element-site[data-hero-theme='combat'] { --unified-hero-art: url('../img/event-battle.webp'); }
.element-site[data-hero-theme='arcane'] { --unified-hero-art: url('fortress/reference-depths.webp'); }
.element-site[data-hero-theme='observatory'] { --unified-hero-art: url('../design-2026/events/event-tactics.webp'); }
.element-site[data-hero-theme='depths'] { --unified-hero-art: url('renewal/cavern.webp'); }
.element-site[data-hero-theme='atlas'] { --unified-hero-art: url('library-atlas.webp'); }
.element-site[data-hero-theme='atlas-extension'] { --unified-hero-art: url('../help/bk-map-extension/gribnica-lossless.webp'); }
.element-site[data-hero-theme='cities'] { --unified-hero-art: url('renewal/world.webp'); }
.element-site[data-hero-theme='trade'] { --unified-hero-art: url('home-atlas/cities.webp'); }
.element-site[data-hero-theme='journey'] { --unified-hero-art: url('../design-2026/home/card-tactics-guides.webp'); }

.element-site:is([data-hero-theme='forum'], [data-hero-theme='roster'], [data-hero-theme='journey']) {
    --unified-hero-focus: 40%;
}

.element-site:is([data-hero-theme='news'], [data-hero-theme='join'], [data-hero-theme='cities']) {
    --unified-hero-focus: 53%;
}

.element-site:is([data-hero-theme='atlas'], [data-hero-theme='atlas-extension']) { --unified-hero-size: min(56%, 33rem) auto; }

body.element-site.element-unified:not(.page-home) .site-wrap > #content {
    padding-block-start: 12px;
}

body.element-site.element-unified:not(.page-home) #content > :is(
    .help-page, .armory-page, .tool-page, .power-page, .spirit-tool, .knowledge-page,
    .bk-content:has(> .news-breadcrumb)
) {
    margin-block-start: 0;
    padding-block-start: 0;
}

.element-site.element-unified:not(.page-home)[data-hero-theme] #content :is(
    .help-breadcrumb, .armory-breadcrumb, .power-breadcrumb, .news-breadcrumb
) {
    margin-block: 0 8px;
}

.element-site.element-unified[data-hero-theme] #content :is(
    .dungeon-atlas > .dungeon-atlas-hero, .map-extension-page > .map-extension-hero, .power-page > .power-title,
    .armory-page > .armory-extras-nav, .spirit-tool > .spirit-header
) {
    margin-block: 0 12px;
}

.element-site.element-unified[data-hero-theme] #content .armory-page > .armory-extras-nav {
    gap: 4px 6px;
}

.element-site.element-unified[data-hero-theme] #content .armory-page > .armory-extras-nav a {
    display: flex;
    align-items: center;
    min-block-size: 36px;
    padding: 5px 9px;
    line-height: 1.25;
}

.element-site.element-unified[data-hero-theme] #content .armory-page > .armory-extras-nav [aria-current='page'] {
    box-shadow: inset 0 -2px #c1a266;
}

/* Real headings retain their own actions and metadata in the existing page layout. */
.element-site.element-unified:not(.page-home)[data-hero-theme] #content :is(
    .page-hero, .inf-hero, .element-community-title, .admin-heading, .topic-heading, .news-detail-heading,
    .tool-page > .safe-tool-hero, .power-page > .power-title, .spirit-tool > .spirit-header,
    .knowledge-page > .knowledge-intro, .element-library-intro, .help-page > header:has(h1),
    .armory-page > header:has(h1), .error-page
) {
    box-sizing: border-box;
    min-inline-size: 0;
    min-block-size: 86px;
    padding: clamp(10px, 1.3vw, 18px) clamp(12px, 2vw, 28px);
    border: 1px solid var(--unified-hero-edge);
    border-radius: 4px;
    background: var(--unified-hero-background);
    box-shadow: inset 0 1px #d4dfdd12;
    color: var(--unified-hero-ink);
}

.element-site.element-unified:not(.page-home)[data-hero-theme] #content .safe-tool > .safe-tool-hero {
    background: var(--unified-hero-background) !important;
}

.element-site.element-unified:not(.page-home)[data-hero-theme] #content :is(
    .page-hero, .inf-hero, .element-community-title, .admin-heading, .topic-heading, .news-detail-heading,
    .tool-page > .safe-tool-hero, .power-page > .power-title, .spirit-tool > .spirit-header,
    .knowledge-page > .knowledge-intro, .element-library-intro, .help-page > header:has(h1),
    .armory-page > header:has(h1), .error-page, .auth-form, .armory-detail
) h1 {
    margin-block: 0 5px;
    color: var(--unified-hero-ink);
    font: 700 var(--unified-hero-title-size)/1.04 'Cormorant SC', Georgia, serif;
    font-variant-caps: normal;
    letter-spacing: -.016em;
    text-wrap: pretty;
    overflow-wrap: anywhere;
    text-shadow: 0 2px 4px #070e14;
}

.element-site.element-unified:not(.page-home)[data-hero-theme] #content :is(
    .element-community-title, .safe-tool-hero, .power-title, .spirit-header, .element-library-intro,
    .help-page > header:has(h1), .armory-page > header:has(h1)
) :where(p, .dg-intro, .city-shop-intro) {
    max-inline-size: 69ch;
    color: var(--unified-hero-ink);
    text-wrap: pretty;
}

.element-site.element-unified:not(.page-home)[data-hero-theme] #content :is(
    .catalog-heading, .dungeon-atlas-hero, .armory-hero, .charms-hero, .spirit-header
) h1::before { content: none; }

.element-site.element-unified:not(.page-home)[data-page-facet][data-hero-theme] #content :is(
    .catalog-heading, .dungeon-atlas-hero, .map-extension-hero,
    .element-community-title:not(.element-community-title--emblem), .admin-heading, .armory-hero:not(.move-detail-hero)
) h1::before {
    display: inline-block;
    inline-size: .66em;
    block-size: .66em;
    flex: none;
    margin-inline-end: .35em;
    border: 0;
    vertical-align: .06em;
    background: var(--crest-mark, var(--crest-earth-mark)) center / contain no-repeat;
    content: '';
}

.element-site.element-unified:not(.page-home)[data-page-facet][data-hero-theme] #content :is(
    .catalog-heading, .dungeon-atlas-hero, .armory-hero:not(.move-detail-hero)
) h1 { align-items: flex-start; column-gap: 0; }

.element-site.element-unified:not(.page-home)[data-page-facet][data-hero-theme] #content :is(
    .catalog-heading, .dungeon-atlas-hero, .armory-hero:not(.move-detail-hero)
) h1::before { margin-block-start: .2em; }

.element-site.element-unified:not(.page-home)[data-hero-theme] #content :is(
    .charms-hero > .hero-content > .eyebrow, .safe-tool-hero .eyebrow, .admin-heading .eyebrow
) { display: none; }

.element-site.element-unified:not(.page-home)[data-hero-theme] #content .dungeon-atlas > .dungeon-atlas-hero::before { content: none; }
.element-site.element-unified:not(.page-home)[data-hero-theme] #content .dungeon-atlas > .dungeon-atlas-hero > .dungeon-atlas-hero-art { display: none; }

.element-site.element-unified:not(.page-home)[data-hero-theme] #content .knowledge-page > .knowledge-intro > .panel-head {
    min-block-size: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

.element-site.element-unified[data-hero-theme] #content .element-community-title > div > p {
    margin-block: 4px 0;
    font-size: .94rem;
    line-height: 1.38;
}

.element-site.element-unified[data-hero-theme] #content .element-library-intro {
    grid-template-columns: minmax(0, 1fr) minmax(210px, 29%);
    gap: 12px clamp(14px, 3vw, 34px);
}

.element-site.element-unified[data-hero-theme] #content .element-library .catalog-heading { margin-block-end: 6px; }
.element-site.element-unified[data-hero-theme] #content .element-library .catalog-heading p {
    max-inline-size: 75ch;
    font-size: .94rem;
    line-height: 1.35;
}

.element-site.element-unified[data-hero-theme] #content .element-library .element-library-atlas img {
    block-size: 63px;
    object-fit: cover;
    object-position: center 49%;
}

.element-site.element-unified[data-hero-theme] #content :is(
    .dungeon-guide > header:has(> h1), .expedition-cover, .archive-intro,
    .bestiary-hero, .dungeon-atlas-hero, .move-library > .armory-hero
) > p,
.element-site.element-unified[data-hero-theme] #content :is(
    .expedition-cover, .archive-intro, .map-extension-hero, .class-guide-header
) > div > p {
    margin-block: 5px 0;
    font-size: .94rem;
    line-height: 1.4;
}

.element-site.element-unified[data-hero-theme] #content :is(
    .dungeon-guide > header:has(> h1) > .bk-kicker, .archive-intro .bk-kicker, .armory-hero > .bk-kicker
) { display: none; }

.element-site.element-unified[data-hero-theme] #content .dungeon-atlas-hero h1 { max-inline-size: 30ch; }
.element-site.element-unified[data-hero-theme] #content .archive-intro > img { inline-size: 52px; block-size: 52px; }
.element-site.element-unified[data-hero-theme] #content .expedition-cover .expedition-actions { margin-block-start: 8px; }
.element-site.element-unified[data-hero-theme] #content .expedition-cover figure img { max-block-size: 74px; }

.element-site.element-unified[data-hero-theme] #content .floor-hero .floor-jumps { margin-top: 7px; }

.element-site.element-unified[data-hero-theme] #content .error-page .error-number {
    display: block;
    margin-block: 0 5px;
    color: var(--unified-hero-accent);
    font: 700 clamp(1.75rem, 4vw, 2.5rem)/1 var(--unified-serif, Georgia, serif);
    text-shadow: none;
}

.element-site.element-unified[data-hero-theme] #content .map-extension-hero .map-extension-actions {
    gap: 6px;
    margin-block-start: 9px;
}

.element-site.element-unified[data-hero-theme] #content .map-extension-hero .map-extension-byline {
    margin-block: 7px 0;
    font-size: .84rem;
    line-height: 1.35;
}

.element-site.element-unified[data-hero-theme] #content .bestiary-hero:not(.bestiary-profile) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    column-gap: clamp(18px, 2.5vw, 36px);
    align-content: center;
}

.element-site.element-unified[data-hero-theme] #content .bestiary-hero > .bestiary-filters {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    gap: 7px;
}

.element-site.element-unified[data-hero-theme] #content .bestiary-filters > label { font-size: .88rem; }
.element-site.element-unified[data-hero-theme] #content .bestiary-filters > a { justify-self: start; }

.element-site.element-unified[data-hero-theme] #content .bestiary-filters :is(input[type='search'], select) {
    padding-inline: 8px;
    font-weight: 400;
    text-overflow: ellipsis;
}

.element-site.element-unified[data-hero-theme] #content :is(
    .bestiary-hero .bestiary-primary, .expedition-actions .expedition-map-action,
    .map-extension-hero .map-extension-download,
    .dungeon-atlas #atlas-directory [data-atlas-controls] .map-extension-download
) {
    color: var(--unified-hero-ink);
    border-color: var(--unified-hero-accent);
    background: color-mix(in srgb, var(--unified-hero-accent) 22%, var(--crest-slate, #101f28));
}

.element-site.element-unified[data-hero-theme] #content :is(
    .bestiary-hero .bestiary-primary, .expedition-actions .expedition-map-action,
    .map-extension-hero .map-extension-download,
    .dungeon-atlas #atlas-directory [data-atlas-controls] .map-extension-download
):focus-visible {
    outline: 2px solid #ffe4a0;
    outline-offset: 3px;
}

.element-site.element-unified[data-hero-theme] #content .knowledge-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(190px, 32%);
    gap: 3px 20px;
    align-items: start;
}

.element-site.element-unified[data-hero-theme] #content .knowledge-intro > :is(.knowledge-intro-copy, .knowledge-login, .knowledge-account) {
    padding: 0;
}

.element-site.element-unified[data-hero-theme] #content .knowledge-intro > :is(.knowledge-login, .knowledge-account) {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
}

.element-site.element-unified[data-hero-theme] #content .knowledge-intro p {
    margin: 0 0 5px;
    font-size: .94rem;
    line-height: 1.35;
}

.element-site.element-unified:not(.page-home)[data-hero-theme] #content .admin-heading { min-block-size: 78px; }

.element-site.element-unified:not(.page-home)[data-hero-theme] #content :is(.auth-form > h1, .armory-detail h1) {
    min-block-size: 55px;
    align-content: center;
    padding: 8px 13px;
    border: 1px solid var(--unified-hero-edge);
    border-radius: 4px;
    background: var(--unified-hero-background);
}

.element-site.element-unified:not(.page-home)[data-hero-theme] #content .auth-shell > .auth-art {
    background: linear-gradient(#13232d6b, #12232dea), var(--unified-hero-art) center / cover no-repeat var(--crest-slate, #101f28);
}

.element-site.element-unified[data-hero-theme] #content > .auth-shell { margin-block-start: 0; }

@media (min-width: 761px) {
    .element-site.element-unified[data-hero-theme] #content > .auth-shell {
        max-inline-size: 68rem;
        margin-inline: auto;
    }
}

@media screen and (prefers-reduced-motion: no-preference) {
    body.element-site.element-unified:not(.page-home)[data-hero-theme][data-element-enter] #content h1 {
        animation: element-heading-arrive 360ms cubic-bezier(.22, 1, .36, 1);
    }

    @keyframes element-heading-arrive {
        from { translate: 0 5px; }
        to { translate: 0 0; }
    }
}

@media (hover: hover) and (pointer: fine) {
    .element-site.element-unified[data-hero-theme] #content :is(
        .bestiary-hero .bestiary-primary, .expedition-actions .expedition-map-action,
        .map-extension-hero .map-extension-download,
        .dungeon-atlas #atlas-directory [data-atlas-controls] .map-extension-download
    ):hover {
        color: #fff5e3;
        border-color: color-mix(in srgb, white 12%, var(--unified-hero-accent));
        background: color-mix(in srgb, var(--unified-hero-accent) 32%, var(--crest-slate, #101f28));
    }
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
    .element-site.element-unified #content :is(a.dg-dungeon-card, .news-list-card:has(a[href]), .bestiary-tile:has(a[href])) {
        transition: translate 120ms var(--element-action-ease, ease-out), border-color 120ms var(--element-action-ease, ease-out);
    }

    .element-site.element-unified #content :is(a.dg-dungeon-card, .news-list-card:has(a[href]), .bestiary-tile:has(a[href])):is(:hover, :focus-visible, :has(:focus-visible)) {
        translate: 0 -2px;
        border-color: #c1a266;
        transition-duration: 180ms;
    }

    .element-site.element-unified #content .catalog-item .catalog-item-arrow {
        transition: translate 120ms var(--element-action-ease, ease-out);
    }

    .element-site.element-unified #content .catalog-item:is(:hover, :focus-visible) .catalog-item-arrow {
        translate: 3px 0;
        transition-duration: 150ms;
    }

    .element-site.element-unified #content .news-list-image > img {
        transition: scale 400ms var(--element-action-ease, ease-out);
    }

    .element-site.element-unified #content .news-list-image:is(:hover, :focus-visible) > img {
        scale: 1.025;
        transition-duration: 600ms;
    }
}

@media (max-width: 760px) {
    body.element-site.element-unified:not(.page-home) .site-wrap > #content { padding-block-start: 8px; }

    .element-site[data-hero-theme] {
        --unified-hero-size: cover;
        --unified-hero-title-size: clamp(1.55rem, 6vw, 1.85rem);
        --unified-hero-veil: linear-gradient(103deg, #121f28f2 12%, #12232dce 51%, #132733b0 77%, #132834a3);
    }

    .element-site:is([data-hero-theme='atlas'], [data-hero-theme='atlas-extension']) { --unified-hero-size: cover; }

    .element-site.element-unified:not(.page-home)[data-hero-theme] #content :is(
        .page-hero, .inf-hero, .element-community-title, .admin-heading, .topic-heading, .news-detail-heading,
        .tool-page > .safe-tool-hero, .power-page > .power-title, .spirit-tool > .spirit-header,
        .knowledge-page > .knowledge-intro, .element-library-intro, .help-page > header:has(h1),
        .armory-page > header:has(h1), .error-page
    ) { min-block-size: 66px; }

    .element-site.element-unified:not(.page-home)[data-hero-theme] #content .element-community-title > img {
        inline-size: 48px;
        block-size: auto;
        object-fit: contain;
    }

    .element-site.element-unified[data-hero-theme] #content :is(.element-library-intro, .knowledge-intro) {
        grid-template-columns: minmax(0, 1fr);
    }

    body.element-site.element-unified:not(.page-home)[data-hero-theme] #content .element-library > .element-library-intro {
        gap: 8px;
        min-block-size: 0;
        padding: 0;
        border: 0;
        background: none;
        box-shadow: none;
    }

    .element-site.element-unified[data-hero-theme] #content .element-library-intro-copy { display: contents; }

    .element-site.element-unified[data-hero-theme] #content .element-library .catalog-heading {
        margin: 0;
        padding: 10px 12px;
        border: 1px solid var(--unified-hero-edge);
        border-radius: 4px;
        background: var(--unified-hero-background);
    }

    .element-site.element-unified[data-hero-theme] #content .element-library .element-library-atlas {
        grid-template-columns: 64px minmax(0, 1fr) auto;
        gap: 8px;
        min-block-size: 44px;
        padding: 5px 8px 5px 5px;
    }

    .element-site.element-unified[data-hero-theme] #content .element-library .element-library-atlas img {
        block-size: 37px;
    }

    .element-site.element-unified[data-hero-theme] #content .floor-hero { row-gap: 7px; }

    .element-site.element-unified[data-hero-theme] #content .floor-hero .dg-intro { line-height: 1.42; }

    .element-site.element-unified[data-hero-theme] #content .floor-portraits img {
        inline-size: 37px;
        block-size: 51px;
        object-fit: contain;
        background: var(--crest-slate, #101f28);
    }

    .element-site.element-unified[data-hero-theme] #content .element-library .catalog-jump {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .element-site.element-unified[data-hero-theme] #content .element-library .catalog-jump a {
        display: flex;
        justify-content: center;
        align-items: center;
        min-inline-size: 0;
        min-block-size: 44px;
        padding: 4px 5px;
        font-size: .83rem;
        line-height: 1.25;
        text-align: center;
        text-wrap: balance;
    }

    .element-site.element-unified[data-hero-theme] #content .map-extension-hero .map-extension-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .element-site.element-unified[data-hero-theme] #content .map-extension-hero .map-extension-actions > a {
        display: flex;
        justify-content: center;
        align-items: center;
        min-block-size: 44px;
        padding-inline: 5px;
        font-size: .84rem;
        text-align: center;
    }

    .element-site.element-unified[data-hero-theme] #content .map-extension-hero .map-extension-download { grid-column: 1 / -1; }

    .element-site.element-unified[data-hero-theme] #content .armory-page > .armory-extras-nav {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
    }

    .element-site.element-unified[data-hero-theme] #content .armory-page > .armory-extras-nav a {
        justify-content: center;
        min-block-size: 44px;
        padding-inline: 5px;
        font-size: .85rem;
        text-align: center;
        text-wrap: balance;
    }

    .element-site.element-unified[data-hero-theme] #content .auth-shell > .auth-art { order: 2; }

    .element-site.element-unified[data-hero-theme] #content .bestiary-hero:not(.bestiary-profile) {
        grid-template-columns: minmax(0, 1fr);
    }

    .element-site.element-unified[data-hero-theme] #content .bestiary-hero > .bestiary-filters {
        grid-column: 1;
        grid-row: auto;
        grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
        margin-block-start: 8px;
    }

    .element-site.element-unified[data-hero-theme] #content .bestiary-filters input[type='search']::placeholder {
        font-size: .84rem;
    }

    .element-site.element-unified[data-hero-theme] #content .bestiary-profile > img {
        inline-size: 48px;
        max-block-size: 70px;
    }

    .element-site.element-unified[data-hero-theme] #content .expedition-cover .expedition-actions > a,
    .element-site.element-unified[data-hero-theme] #content .expedition-cover .expedition-actions > details > summary {
        padding-inline: 8px;
        font-size: .87rem;
    }

    .element-site.element-unified[data-hero-theme] #content .knowledge-intro > :is(.knowledge-login, .knowledge-account) {
        grid-column: 1;
        grid-row: auto;
    }

    .element-site.element-unified[data-hero-theme] #content .safe-tool > .safe-tool-hero {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 10px;
        align-items: start;
    }

    .element-site.element-unified[data-hero-theme] #content .safe-hero-lock {
        inline-size: 38px;
        block-size: 38px;
    }

    .element-site.element-unified[data-hero-theme] #content .safe-hero-lock > .icon { inline-size: 30px; block-size: 30px; }
}
.element-unified.page-help #content .element-library .catalog-item:has(> .catalog-item-image) {
    grid-template-columns: auto minmax(0, 1fr) 14px;
}
