/* Display the mark for the active theme in a 44px target. */
body.element-site.element-unified .site-header .header-actions > .element-theme-toggle {
    --theme-mark-glow: #ffe4b0bf;
    --theme-mark-blur: 2px;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    inline-size: 44px;
    block-size: 44px;
    min-inline-size: 44px;
    min-block-size: 44px;
    max-inline-size: none;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

body.element-site.element-unified .site-header .header-actions > .element-theme-toggle:hover {
    --theme-mark-blur: 3px;
}

.element-unified .element-theme-icon {
    display: block;
    flex: none;
    inline-size: auto;
    block-size: 19px;
    filter: drop-shadow(0 1px var(--theme-mark-blur) var(--theme-mark-glow));
}

.element-unified .element-theme-mark--light,
html[data-element-theme='light'] .element-unified .element-theme-mark--dark {
    display: none;
}

html[data-element-theme='light'] .element-unified .element-theme-mark--light {
    display: block;
}

@media (max-width: 449px) {
    body.element-site.element-unified .site-header .header-actions > .account-link {
        display: none;
    }
}

@media (min-width: 341px) and (max-width: 389px) {
    body.element-site.element-unified .site-header[data-compact] .clan-logo .clan-wordmark {
        font-size: 15px;
    }
}

@media (min-width: 450px) and (max-width: 490px) {
    body.element-site.element-unified .site-header .clan-logo .clan-wordmark {
        font-size: 20px;
    }
}

@media (min-width: 951px) and (max-width: 1380px) {
    body.element-site.element-unified .site-wrap > .site-header[data-compact]:has(.element-theme-toggle) {
        padding-inline: calc(var(--site-frame-corner-size) + 1px);
        column-gap: 5px;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .header-actions {
        gap: 4px;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .masthead-action-text {
        display: none;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .header-search:has(.masthead-action-text) {
        inline-size: 44px;
        min-inline-size: 44px;
        padding-inline: 0;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .element-primary-nav .element-community-nav > a {
        padding-inline: 3px;
    }
}

@media (min-width: 951px) and (max-width: 1000px) {
    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .element-nav-group > .element-nav-tab {
        padding-inline: 3px 0;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .element-disclosure:not(.element-disclosure-full) > summary {
        min-inline-size: 22px;
        padding-inline: 4px;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .element-disclosure-full > summary {
        padding-inline: 4px;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) :is(.element-nav-tab, .element-disclosure-full > summary) > .element-glyph {
        inline-size: 16px;
        block-size: 16px;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .element-primary-nav .element-community-nav > a {
        padding-inline: 2px;
    }
}

@media (min-width: 951px) and (max-width: 1020px) {
    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .brand .clan-emblem {
        inline-size: 28px;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .clan-wordmark {
        font-size: 16px;
    }

    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .element-primary-nav :is(.element-nav-tab, .element-disclosure > summary, .element-community-nav > a) {
        font-size: .78rem;
        gap: 4px;
    }
}

@media (min-width: 1151px) and (max-width: 1200px) {
    body.element-site.element-unified .site-header[data-compact]:has(.element-theme-toggle) .element-primary-nav :is(.element-nav-tab, .element-disclosure > summary, .element-community-nav > a) {
        font-size: .86rem;
    }
}

html[data-element-theme='light']:has(.element-unified) {
    color-scheme: light;
    scrollbar-color: #8b7b62 #f3efe3;
    background:
        linear-gradient(180deg, #eee2cd5c 0, #efe6d594 min(48vh, 480px), #e5daccf0 820px),
        url('fortress/fortress-art.webp') center top / max(100%, 1440px) auto no-repeat,
        url('fortress/slate-material.webp') center top / 1080px auto repeat #e5dacc;
    background-attachment: fixed;
}

html[data-element-theme='light'] body.element-unified {
    --light-paper: #fbf8ee;
    --light-stone: #f3efe3;
    --light-inset: #e9e0cc;
    --light-line: #aa9b81;
    --light-control-line: #8d7c65;
    --light-ink: #1d3039;
    --light-muted: #45585e;
    --light-bronze: #795433;
    --light-link: #315b6f;
    --light-focus: #315b70;
    --light-hover: #eae0cb;
    --light-current: #e5d7ba;

    --crest-slate: var(--light-stone);
    --crest-panel: var(--light-paper);
    --crest-steel: #687e88;
    --crest-bronze: #8c7559;
    --crest-fire: #88472f;
    --crest-earth: var(--light-bronze);
    --crest-air: #486271;
    --crest-water: #315e76;
    --crest-seam: linear-gradient(90deg, transparent, #a39c84 24%, #b2966d 55%, #819091 78%, transparent);
    --unified-ink: var(--light-ink);
    --unified-muted: var(--light-muted);
    --unified-gold: var(--light-bronze);
    --unified-rule: var(--light-line);
    --unified-panel: var(--light-paper);
    --unified-deep: var(--light-stone);
    --unified-surface: linear-gradient(115deg, #fbf8ee, #f0ebde);
    --unified-texture: none;
    --unified-strip: none;
    --unified-copper: none;

    --crest-control-text: #fffaf0;
    --crest-ember: #815539;
    --crest-ember-ledge: #714829;
    --crest-ember-face: linear-gradient(145deg, #8e6142, #734831);
    --crest-control-steel: #f2ecdd;
    --crest-steel-ledge: var(--light-control-line);
    --crest-steel-face: linear-gradient(145deg, #fdf9ef, #ede5d4);
    --crest-danger: #793e3b;
    --crest-danger-ledge: #6a3232;
    --crest-danger-face: linear-gradient(145deg, #8b4942, #6b3533);
    color: var(--light-ink);
    background: transparent;
}

html[data-element-theme='light'] body.element-site.element-unified {
    --fortress-line: var(--light-line);
    --fortress-recess: #eee7d8;
    --fortress-glaze: #f5efe1;
    --fortress-header: #efe6d2;
    --fortress-border-soft: #aa9b8180;
    --site-frame-surface:
        linear-gradient(100deg, #fbf5e5f5 22%, #f4eddced 61%, #e8e1d4e0),
        url('reference-ui/header-elemental-v2.webp') center 52% / cover no-repeat #efe6d2;
}

html[data-element-theme='light'] .element-unified ::selection {
    color: #182d38;
    background: #e7cca3;
}

html[data-element-theme='light'] body.element-site.element-unified #content {
    color: var(--unified-ink);
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(.muted, .meta, .footnote) {
    color: var(--unified-muted);
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(.text-link, .back-link, .link-button, .catalog-search-clear, .quests-directory-reset, .help-reset, .mine-secondary),
html[data-element-theme='light'] body.element-site.element-unified .site-footer a {
    color: var(--light-link);
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(.text-link, .back-link, .link-button, .catalog-search-clear, .quests-directory-reset, .help-reset, .mine-secondary):is(:hover, :focus-visible),
html[data-element-theme='light'] body.element-site.element-unified .site-footer a:is(:hover, :focus-visible) {
    color: #253c50;
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(button.link-button, button.mine-secondary)[data-confirm] {
    color: #8c3434;
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(
    input:not([type='checkbox'], [type='radio'], [type='hidden'], [type='range'], [type='submit'], [type='reset'], [type='button']),
    textarea, select
) {
    color-scheme: light;
    border-color: var(--light-control-line);
    color: var(--light-ink);
    background: #fffdf7;
    box-shadow: inset 0 1px 2px #6b5a411c;
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(input, textarea)::placeholder {
    color: var(--light-muted);
    opacity: 1;
}

html[data-element-theme='light'] body.element-site.element-unified #content input:-webkit-autofill {
    -webkit-text-fill-color: var(--light-ink);
    box-shadow: inset 0 0 0 100px #fff5db;
}

html[data-element-theme='light'] body.element-site.element-unified :is(
    a, button, input, textarea, select, summary, [tabindex]
):focus-visible {
    outline: 2px solid var(--light-focus);
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(.button, .icon-button, .spirit-link-button, .bestiary-primary, .bestiary-button) {
    text-shadow: none;
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(
    .button.ghost, .icon-button:not(.button, .danger-text), .spirit-link-button, .bestiary-button,
    .dungeon-index-more, .home-calendar__controls button, .dg-map-zoom > button,
    button[data-map-prev], button[data-map-next], button[data-map-all-cancel], button[data-index-layer],
    form button[type='reset'], form input[type='reset']
) {
    --crest-control-text: var(--light-ink);
    --control-symbol: var(--light-link);
    --control-glint: #ffffff80;
    color: var(--light-ink);
    text-shadow: none;
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(
    .button.ghost, .icon-button:not(.button, .danger-text), .spirit-link-button, .bestiary-button,
    .dungeon-index-more, .home-calendar__controls button, .dg-map-zoom > button,
    button[data-map-prev], button[data-map-next], button[data-map-all-cancel], button[data-index-layer],
    form button[type='reset'], form input[type='reset']
):is(:hover, [aria-pressed='true']):not(:disabled, [aria-disabled='true']) {
    border-color: var(--light-bronze);
    background: var(--light-hover);
    color: var(--light-ink);
}

html[data-element-theme='light'] body.element-site.element-unified #content :is(button[data-index-layer], button[data-map-zoom-fit])[aria-pressed='true'] {
    background: var(--light-current);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header {
    --masthead-ink: var(--light-ink);
    --menu-metal: var(--light-line);
    --menu-line: #9d8e755c;
    --menu-surface: linear-gradient(145deg, #fffaf0, #f0eadc);
    --menu-hover: var(--light-hover);
    --menu-current: var(--light-current);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header:not([data-compact]) > .element-masthead {
    background: var(--site-frame-surface);
    box-shadow: inset 0 -1px #8d765c40;
}

html[data-element-theme='light'] body.element-site.element-unified .site-wrap > .site-header[data-compact] {
    background: var(--site-frame-surface) !important;
    box-shadow: 0 4px 11px #53473235;
}

html[data-element-theme='light'] body.element-site.element-unified .site-header .header-actions > .element-theme-toggle {
    --theme-mark-glow: #31291eb3;
}

html[data-element-theme='light'] body.element-site.element-unified .site-header[data-compact] :is(a, button, summary):focus-visible {
    outline-color: var(--light-focus);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header:not([data-compact]) .element-masthead > .element-primary-nav {
    border-color: var(--light-line);
    background:
        var(--crest-seam) center bottom / 100% 1px no-repeat,
        linear-gradient(90deg, #f9f4e8f5, #eddfcaf3);
    box-shadow: none;
}

html[data-element-theme='light'] body.element-site.element-unified .site-header :is(.clan-wordmark, .clan-logo small),
html[data-element-theme='light'] body.element-site.element-unified .site-header .element-primary-nav :is(.element-nav-tab, .element-disclosure > summary, .element-community-nav > a) {
    color: var(--light-ink);
    text-shadow: none;
}

html[data-element-theme='light'] body.element-site.element-unified .site-header .element-nav-group[data-facet] {
    --masthead-facet-metal: var(--crest-accent);
    --masthead-facet-wash: color-mix(in srgb, var(--crest-accent) 18%, transparent);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header .element-primary-nav .element-community-nav {
    border-color: var(--light-line);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header .element-primary-nav .element-community-nav > a:is(:hover, [aria-current]) {
    color: var(--light-bronze);
    text-decoration-color: currentColor;
}

html[data-element-theme='light'] body.element-site.element-unified .site-header .element-primary-nav .element-disclosure[open] > summary {
    color: var(--light-ink);
    background: var(--light-hover);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header :is(
    .header-actions > a, .mobile-menu-toggle, .element-drawer-close
) {
    --control-symbol: var(--light-link);
    border-color: var(--light-control-line);
    color: var(--light-ink);
    background: var(--crest-steel-face) var(--crest-control-steel);
    box-shadow: inset 0 1px #fffaf0;
}

html[data-element-theme='light'] body.element-site.element-unified .site-header :is(
    .header-actions > a, .mobile-menu-toggle, .element-drawer-close
):is(:hover, [aria-expanded='true']) {
    border-color: var(--light-bronze);
    background: var(--light-hover);
    color: var(--light-ink);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header :is(.header-telegram svg, .element-drawer-links .icon) {
    color: var(--light-bronze);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header .element-primary-nav .element-nav-panel a,
html[data-element-theme='light'] body.element-site.element-unified .site-header .element-drawer-links > a {
    color: var(--light-ink);
    border-color: transparent;
}

html[data-element-theme='light'] body.element-site.element-unified .site-header .element-drawer-links > a {
    background: #f5eddd;
}

html[data-element-theme='light'] body.element-site.element-unified .site-header :is(
    .element-primary-nav .element-nav-panel a, .element-drawer-links > a
):is(:hover, :focus-visible) {
    border-color: var(--light-line);
    color: var(--light-ink);
    background: var(--light-hover);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header :is(
    .element-primary-nav .element-nav-panel a, .element-drawer-links > a
)[aria-current='page'] {
    color: var(--light-ink);
    border-color: var(--light-bronze);
    background: var(--light-current);
}

html[data-element-theme='light'] body.element-site.element-unified .site-header .element-drawer-head {
    background: linear-gradient(100deg, #f3e9d5, #e7dac0);
}

html[data-element-theme='light'] body.element-site.element-unified .mobile-bottom {
    border-color: var(--light-line);
    background: linear-gradient(180deg, #f6f0e4, #ece2d0);
    box-shadow: 0 -2px 9px #4f443126;
}

html[data-element-theme='light'] body.element-site.element-unified .mobile-bottom a {
    color: var(--light-ink);
}

html[data-element-theme='light'] body.element-site.element-unified .mobile-bottom a[aria-current='page'] {
    border-color: var(--light-bronze);
    background: var(--light-current);
    color: #53371f;
}

html[data-element-theme='light'] body.element-site.element-unified .mobile-bottom a .metal-icon {
    filter: grayscale(1) brightness(.5);
}

html[data-element-theme='light'] body.element-site.element-unified :is(.site-footer strong, .site-footer .footer-brand p) {
    color: var(--light-ink);
    text-shadow: none;
}

html[data-element-theme='light'] body.element-site.element-unified .site-footer .footer-center > :is(p, .demo-label) {
    color: var(--light-muted);
}

html[data-element-theme='light'] body.element-site.element-unified .site-footer .footer-links .icon {
    color: var(--light-link);
}

html[data-element-theme='light'] body.element-site.element-unified .element-quicklinks {
    border-color: var(--light-line);
    background: #eee6d7;
}

html[data-element-theme='light'] body.element-site.element-unified .element-quicklinks a:is(:hover, [aria-current]) {
    color: var(--light-ink);
    background: var(--light-hover);
}

html[data-element-theme='light'] .page-home #content {
    --home-wash: #ded2b866;
}

html[data-element-theme='light'] .unified-home > [data-home-element='earth'] {
    --home-element-heading: #e4e7d4;
    --home-element-surface: #f7f5e9;
    --home-element-metal: #8e916f;
}

html[data-element-theme='light'] .unified-home > [data-home-element='air'] {
    --home-element-heading: #e1e9e9;
    --home-element-surface: #f3f5ef;
    --home-element-metal: #83949c;
}

html[data-element-theme='light'] .unified-home > [data-home-element='fire'] {
    --home-element-heading: #f0e1d5;
    --home-element-surface: #fbf2e9;
    --home-element-metal: #a28571;
}

html[data-element-theme='light'] .unified-home > [data-home-element='water'] {
    --home-element-heading: #dce8ec;
    --home-element-surface: #f0f5f3;
    --home-element-metal: #8098a4;
}

html[data-element-theme='light'] body.element-site.page-home #content .unified-home-hero {
    background: #eee6d4;
}

html[data-element-theme='light'] body.element-site.page-home #content .unified-home :is(
    .unified-home-heading, .home-calendar__header > h2
) {
    text-shadow: none;
}

html[data-element-theme='light'] body.element-site.page-home #content .unified-home :is(
    .unified-home-topic > summary, .unified-home-topic li a, .unified-home-tools > a, .unified-home-headlines a
):is(:hover, :focus-visible) {
    color: var(--light-ink);
}

html[data-element-theme='light'] body.element-site.page-home #content .unified-home .home-calendar :is(
    a, summary, button, select
):is(:hover, :focus-visible) {
    color: var(--light-ink);
}

html[data-element-theme='light'] body.element-site.page-home #content .home-calendar__active {
    color: #375c37;
}

@media (forced-colors: active) {
    body.element-site.element-unified .site-header .element-theme-toggle:focus-visible {
        outline-color: Highlight;
    }

    .element-unified .element-theme-icon {
        filter: none;
    }

    html[data-element-theme='light'] body.element-site.element-unified :is(
        a, button, input, textarea, select, summary, [tabindex]
    ):focus-visible {
        outline-color: Highlight;
    }

    html[data-element-theme='light'] body.element-site.element-unified .site-wrap > .site-header[data-compact] {
        background: Canvas !important;
    }
}

