/* Deliberately self-contained. Load after legacy/theme styles, never on the workspace shell. */
/* Reserve the same gutter on short/long pages and override legacy 8px scrollbars. */
html:has(.ea-public-header) { scrollbar-gutter: stable; scrollbar-width: thin; }
.ea-public-header.ea-public-header {
    --ph-ink: #172033;
    --ph-muted: #566176;
    --ph-paper: #fff;
    --ph-line: #d9e0e8;
    --ph-soft: #eef2f6;
    --ph-accent: #245bc5;
    position: sticky;
    inset: 0 0 auto;
    z-index: 100;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 1px solid var(--ph-line);
    background: var(--ph-paper) !important;
    color: var(--ph-ink);
    font: 500 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
    letter-spacing: normal;
    text-transform: none;
    backdrop-filter: none;
    box-shadow: none;
}
.ea-public-header *, .ea-public-header *::before, .ea-public-header *::after { box-sizing: border-box; }
.ea-public-header .ea-public-header__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    width: min(1200px, calc(100% - 48px));
    min-height: 72px;
    margin: 0 auto;
    padding: 0;
}
.ea-public-header .ea-public-header__brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 44px;
    margin: 0;
    padding: 0;
}
.ea-public-header .ea-public-header__brand img {
    /* Match the header surface even before theme.js runs or in script-free previews. */
    content: url("../brand/easy-annotation-wordmark.png");
    display: block;
    width: 232px;
    height: 46px;
    max-width: none;
    margin: 0;
    padding: 0;
    object-fit: contain;
    object-position: left center;
}
.ea-public-header .ea-public-header__desktop { display: flex; align-items: center; gap: 8px; }
.ea-public-header .ea-public-header__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--ph-muted);
    font: inherit;
    letter-spacing: normal;
    text-decoration: none !important;
    white-space: nowrap;
    word-break: normal;
}
.ea-public-header .ea-public-header__link:hover,
.ea-public-header .ea-public-header__link[aria-current="page"] { background: var(--ph-soft); color: var(--ph-ink); }
.ea-public-header .ea-public-header__link[aria-current="page"] { text-decoration: underline !important; text-underline-offset: 5px; }
.ea-public-header .ea-public-header__link--primary { background: var(--ph-accent); color: #fff; }
.ea-public-header .ea-public-header__link--primary:hover { background: var(--ph-ink); color: var(--ph-paper); }
.ea-public-header a:focus-visible, .ea-public-header summary:focus-visible { outline: 3px solid #b97516; outline-offset: 3px; }
.ea-public-header .ea-public-header__mobile { display: none; }
html[data-ea-theme="dark"] .ea-public-header {
    --ph-ink: #edf3fa;
    --ph-muted: #aebdce;
    --ph-paper: #121a26;
    --ph-line: #334154;
    --ph-soft: #202c3b;
    --ph-accent: #2f6fed;
}
html[data-ea-theme="dark"] .ea-public-header .ea-public-header__brand img {
    content: url("../brand/easy-annotation-wordmark-light.png");
}
@media (max-width: 991px) {
    .ea-public-header .ea-public-header__inner { width: calc(100% - 32px); min-height: 68px; gap: 12px; flex-wrap: wrap; padding-block: 10px; }
    .ea-public-header .ea-public-header__desktop { display: none; }
    .ea-public-header .ea-public-header__mobile { display: block; flex: 0 0 auto; margin: 0 0 0 auto; padding: 0; }
    .ea-public-header .ea-public-header__menu {
        display: list-item;
        min-height: 44px;
        padding: 11px 10px;
        border: 1px solid var(--ph-line);
        border-radius: 6px;
        background: var(--ph-paper);
        color: var(--ph-ink);
        font: inherit;
        cursor: pointer;
        list-style-position: inside;
    }
    .ea-public-header .ea-public-header__panel {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
        max-height: calc(100dvh - 84px);
        overflow-y: auto;
        padding: 12px;
        border: 1px solid var(--ph-line);
        border-radius: 0 0 10px 10px;
        background: var(--ph-paper);
        box-shadow: 0 12px 24px #172d3b18;
    }
    .ea-public-header .ea-public-header__panel .ea-public-header__link { justify-content: flex-start; white-space: normal; }
}
/* Keep the full wordmark at narrow widths; the native summary retains its accessible name. */
@media (max-width: 374px) {
    .ea-public-header .ea-public-header__inner { width: calc(100% - 16px); }
    .ea-public-header .ea-public-header__menu {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        list-style: none;
    }
    .ea-public-header .ea-public-header__menu::-webkit-details-marker { display: none; }
    .ea-public-header .ea-public-header__menu::before {
        content: "";
        width: 18px;
        height: 12px;
        border-block: 2px solid currentColor;
        background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
    }
    .ea-public-header .ea-public-header__menu-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }
}
@media print { .ea-public-header.ea-public-header { display: none; } }