.site-header {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--accent);
    color: var(--accent-contrast);
    box-shadow: 0 1px 4px var(--shadow);
    z-index: 1000;
}

.site-header__brand {
    color: inherit;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
}

.site-header__filters {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.site-header__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.site-header__nav a {
    display: inline-block;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--accent-border);
    border-radius: 6px;
    color: var(--accent-contrast);
    font-size: 0.9rem;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
}

.site-header__nav a:hover {
    background: var(--accent-fill-hover);
}

.site-header__nav a[aria-current="page"] {
    background: var(--accent-contrast);
    border-color: var(--accent-contrast);
    color: var(--accent);
}

.site-header .hazard-legend-button {
    min-width: 0;
    padding: 0.35rem 0.65rem;
    border: 1px solid var(--accent-border);
    background: var(--accent-fill);
    color: var(--accent-contrast);
    font-size: 0.9rem;
    line-height: 1.2;
    box-shadow: none;
}

.site-header .hazard-legend-button:hover {
    background: var(--accent-fill-active);
}

.site-header .hazard-legend-panel[open] .hazard-legend-button,
.site-header .hazard-legend-panel[open] .hazard-legend-button:hover {
    border-color: transparent;
    background: var(--surface);
    color: var(--text-primary);
}

.site-header .hazard-legend-body {
    top: calc(100% + 6px);
    left: 0;
}

.site-header .hazard-legend-panel {
    position: static;
}

.site-header__search {
    position: relative;
    flex: 1 1 190px;
    max-width: none;
    min-width: 0;
    font-size: 0.9rem;
}

@media (max-width: 640px) {
    .site-header__filters {
        flex: 1 1 100%;
    }

    .site-header .hazard-legend-body {
        width: auto;
        right: 0;
    }

    .site-header__search {
        width: 100%;
        flex-basis: 100%;
        max-width: none;
    }
}

.site-header__nav a:focus-visible,
.site-header__action:focus-visible,
.site-header__search input:focus-visible,
.site-header summary:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
