:root {
    color: #102a4c;
    background: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: inherit; }
:focus-visible { outline: 2px solid #a57300; outline-offset: 3px; }
.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.brand { background: #102a4c; color: white; }
.brand-row { display: flex; align-items: center; gap: .75rem; min-height: 5rem; padding-block: .65rem; }
.logo { display: block; border-radius: .25rem; flex: none; }
.logo img { display: block; width: clamp(10rem, 20vw, 14rem); height: auto; }
.logo--custom img { height: clamp(3.333rem, 6.667vw, 4.667rem); object-fit: contain; object-position: left center; }
.brand-identity { margin: 0; font-size: .875rem; }
.public-header nav { background: #17345e; color: white; }
.nav-row, .links, .nav-controls { display: flex; align-items: center; }
.nav-row { min-height: 3.25rem; }
.links { gap: .25rem .35rem; min-width: 0; flex: 1; flex-wrap: wrap; padding-block: .25rem; }
.nav-controls { gap: .25rem; margin-inline-start: auto; flex: none; }
.public-header :is(a, summary, .menu-toggle) { text-decoration: none; color: #fff; font-weight: 500; transition: color .18s ease; }
.links > a, .explore > summary { max-inline-size: 100%; padding: .48rem .65rem; overflow-wrap: anywhere; }
.public-header :is(a, summary, .menu-toggle):is(:hover, :focus-visible) { color: #e1b54a; }
.public-header :is([aria-current="page"], .explore > .explore-current) { color: #e1b54a; font-weight: 700; }
.public-header :focus-visible { outline: 2px dotted #e1b54a; outline-offset: 2px; }
.nav-controls .theme-selector :is(summary:hover,summary:focus-visible), .nav-controls .theme-selector[open] > summary { background: transparent; }
.nav-controls .theme-selector { z-index: 4; }
.account, .menu-toggle, .nav-controls .theme-selector > summary { width: 44px; height: 44px; }
.account { display: grid; place-items: center; }
.account svg, .menu-toggle svg { width: 21px; height: 21px; }
.explore { position: relative; }
.explore summary { display: inline-flex; align-items: center; gap: .35rem; list-style: none; cursor: pointer; }
.explore summary::marker { content: ''; }
.explore summary::-webkit-details-marker { display: none; }
.explore-chevron { width: 16px; height: 16px; flex: none; transition: transform .2s ease; }
.explore[open] .explore-chevron { transform: rotate(180deg); }
.categories { position: absolute; z-index: 3; inset: calc(100% + .35rem) auto auto 0; width: max-content; max-width: min(20rem, calc(100vw - 2rem)); max-height: 12rem; overflow-y: auto; background: #17345e; border: 1px solid #748aa6; padding: .75rem; border-radius: .45rem; }
.explore.align-end .categories { inset-inline: auto 0; }
.categories a { padding-inline: .35rem; }
.menu-toggle, .mobile-drawer:not([open]) { display: none; }
main { padding-block: 2.5rem; flex: 1; }
h1 { margin-top: 0; font-size: clamp(1.6rem, 4vw, 2.5rem); }
@media (max-width: 40rem) {
    .brand-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .5rem; }
    .logo img { width: min(100%, 10rem); }
    .logo--custom img { height: 3rem; }
    .brand-identity { grid-column: 1 / -1; grid-row: 2; text-align: center; font-size: .75rem; }
    .nav-controls { grid-column: 2; grid-row: 1; gap: 0; }
    .navigation-ready .menu-toggle { display: grid; place-items: center; background: transparent; border: 0; cursor: pointer; padding: 0; }
    .navigation-ready .public-header > nav { display: none; }
    .links { flex: 0 0 100%; flex-direction: column; gap: .2rem; padding-block: .5rem 1rem; align-items: start; }
    .categories { position: static; margin-top: .35rem; }

    .navigation-ready { scrollbar-gutter: stable; }
    .drawer-open { overflow: hidden; scrollbar-gutter: auto; }
    .drawer-open body { padding-right: var(--drawer-scrollbar, 0px); }
    .mobile-drawer {
        position: fixed;
        inset: 0 0 0 auto;
        margin: 0;
        width: min(85vw, 320px);
        max-width: none;
        height: 100%;
        height: 100dvh;
        max-height: none;
        padding: env(safe-area-inset-top, 0px) .875rem env(safe-area-inset-bottom, 0px);
        border: 0;
        background: #202327;
        color: #eceff1;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
    .mobile-drawer[open] { animation: drawer-slide .25s ease-out both; }
    .mobile-drawer[open]::backdrop { animation: drawer-shade .25s ease-out both; background: rgb(0 0 0 / .55); }
    .mobile-drawer.is-closing { animation-name: drawer-slide-out; animation-timing-function: ease-in; }
    .mobile-drawer.is-closing::backdrop { animation-name: drawer-shade-out; animation-timing-function: ease-in; }
    .drawer-close {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        margin: .5rem 0 .25rem auto;
        padding: 0;
        border: 0;
        background: transparent;
        color: inherit;
        cursor: pointer;
    }
    .drawer-close svg { width: 22px; height: 22px; }
    .public-header .mobile-drawer nav { background: transparent; color: inherit; }
    .mobile-drawer .nav-row { width: 100%; min-height: 0; }
    .mobile-drawer :is(.links, .explore, .links > a, .explore > summary, .categories) { width: 100%; }
    .mobile-drawer :is(.links > a, .explore > summary, .categories a) { min-height: 44px; display: flex; align-items: center; }
    .public-header .mobile-drawer :is(a, summary) { color: #eceff1; }
    .public-header .mobile-drawer :is(a, summary, .drawer-close):is(:hover, :focus-visible),
    .public-header .mobile-drawer :is([aria-current="page"], .explore-current) { color: #e1b54a; }
    .mobile-drawer .categories {
        max-height: none;
        max-width: none;
        padding: .25rem .65rem .5rem;
        background: transparent;
        border: 0;
        border-top: 1px solid #3b4249;
        border-radius: 0;
    }
}
@keyframes drawer-slide { from { transform: translateX(100%); } }
@keyframes drawer-slide-out { to { transform: translateX(100%); } }
@keyframes drawer-shade { from { opacity: 0; } }
@keyframes drawer-shade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
    .public-header :is(a, summary, .menu-toggle), .explore-chevron { transition: none; }
    .mobile-drawer[open], .mobile-drawer[open]::backdrop { animation: none; }
}
:root[data-theme="dark"] { color-scheme: dark; background: #15191e; color: #e5ebf1; }
[data-theme="dark"] main button:not(.password-toggle) { background: #315f94; }
[data-theme="dark"] .auth-form .password-toggle { color: #cfe4fc; }
[data-theme="dark"] #session-warning { color: #e5ebf1; background: #232a32; border-color: #596777; }
