/* ==========================================================================
 * wsp_header.css — App header bar chrome: logo, trigger buttons, nav links,
 *                  divider, and dropdown menus.
 * Loaded on: EVERY page.   @see STYLE_GUIDE.md
 *
 * INJECTED BY : layout.py  (a <link> to this file) + shared.py ::
 *               build_header_vars_block()  (emits the :root { --wsp-* } values).
 * VALUES FROM : app.toml  [header_buttons] / [header_menu] / [header_divider] /
 *               [header_logo] / [header_selector_link] / [header_nav_links] /
 *               [filter_picker].  Edit knobs THERE, not hex/px here.
 *               Static CSS does NOT hot-reload — restart after editing rules.
 * ========================================================================== */

:root {
    /* Header buttons (Save settings, map basemap /
       palette / Options / Filters). Source values live in
       `app.toml [header_buttons]`. */
    /* Header bar background — black, overrides Quasar's `bg-secondary`. */
}
/* ── Header text SIZE model ───────────────────────────────────────────
   Base size is set once on `.wsp-header` (layout.py) and inherited by
   every descendant. Only TWO category rules below touch size, both by
   plain specificity (no !important):
     1. q-btn / q-field — defeat Quasar's `.q-btn{font-size:14px}` so
        button label spans inherit the header size instead.
     2. q-icon — the one category that isn't the base text size.
   Everything else (nav links and trigger buttons) just
   inherits. Don't reintroduce per-element `font-size` here. */
.wsp-header .q-btn,
.wsp-header .q-field,
.wsp-header .q-field__control,
.wsp-header .q-field__native {
    font-size: inherit;
}
.wsp-header .q-icon {
    font-size: var(--wsp-header-btn-icon-size);
}
.wsp-header-item {
    display: inline-flex;
    align-items: center;
    height: var(--wsp-header-btn-height);
    font-family: inherit;
    font-weight: var(--wsp-header-btn-font-weight);
    line-height: 1;
    color: #fff;
    white-space: nowrap;
    letter-spacing: var(--wsp-header-btn-letter-spacing);
}
.wsp-header .wsp-header-item .q-btn,
.wsp-header .wsp-header-item .q-field,
.wsp-header .wsp-header-item .q-field__control {
    min-height: var(--wsp-header-btn-height) !important;
    height: var(--wsp-header-btn-height) !important;
    font-family: inherit;
    font-weight: var(--wsp-header-btn-font-weight);
}
.wsp-header .wsp-header-item .q-field__native,
.wsp-header .wsp-header-item .q-field__input {
    min-height: var(--wsp-header-btn-height) !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
.wsp-header .wsp-header-btn .q-btn__content,
.wsp-header .wsp-header-dropdown .q-btn__content {
    gap: var(--wsp-header-btn-content-gap);
}
/* Every header trigger (region/Save/Refresh + the map page's
   basemap/Options/Legend dropdowns) — flat text-only, no borders,
   no fills. Hover / active = 2-px white underline beneath the label
   (drawn via `border-bottom`). Reserves the underline space at rest
   with a transparent border so text doesn't jump 2 px on hover. */
.wsp-header .wsp-header-btn,
.wsp-header .wsp-header-dropdown,
.wsp-header .wsp-header-trigger-btn {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 var(--wsp-header-btn-padding-x) !important;
    min-height: var(--wsp-header-btn-height) !important;
    height: var(--wsp-header-btn-height) !important;
    box-shadow: none !important;
    transition: border-color 120ms ease, color 120ms ease;
    font-family: inherit !important;
    font-weight: var(--wsp-header-btn-font-weight) !important;
    letter-spacing: var(--wsp-header-btn-letter-spacing) !important;
    color: #ffffff !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
/* Underline lives on the INNER content wrapper, not the outer button,
   so padding doesn't widen the red bar. The bar hugs the label / icon
   group; padding creates whitespace around it. */
.wsp-header .wsp-header-btn .q-btn__content,
.wsp-header .wsp-header-dropdown .q-btn__content,
.wsp-header .wsp-header-trigger-btn .q-btn__content {
    border-bottom: var(--wsp-header-btn-underline-px) solid transparent !important;
    transition: border-color 120ms ease !important;
    /* Keep the label + the `icon-right` chevron on one line — the button
       has `min-width: 0`, so without this the arrow wraps below the text
       under width pressure (seen at 1080p). */
    flex-wrap: nowrap !important;
    white-space: nowrap;
}
.wsp-header .wsp-header-btn:hover .q-btn__content,
.wsp-header .wsp-header-dropdown:hover .q-btn__content,
.wsp-header .wsp-header-trigger-btn:hover .q-btn__content,
.wsp-header .wsp-header-btn:active .q-btn__content,
.wsp-header .wsp-header-dropdown:active .q-btn__content,
.wsp-header .wsp-header-trigger-btn:active .q-btn__content {
    border-bottom-color: var(--wsp-header-btn-underline-color) !important;
}
/* Force every text / icon child to white so Quasar's `text-primary`
   can't paint the label red. */
.wsp-header .wsp-header-btn *,
.wsp-header .wsp-header-dropdown *,
.wsp-header .wsp-header-trigger-btn * {
    color: #ffffff !important;
}
.wsp-header .wsp-header-btn:hover,
.wsp-header .wsp-header-dropdown:hover,
.wsp-header .wsp-header-trigger-btn:hover,
.wsp-header .wsp-header-btn:active,
.wsp-header .wsp-header-dropdown:active,
.wsp-header .wsp-header-trigger-btn:active {
    color: var(--wsp-header-btn-hover-fg) !important;
}
.wsp-header .wsp-header-btn:hover *,
.wsp-header .wsp-header-dropdown:hover *,
.wsp-header .wsp-header-trigger-btn:hover *,
.wsp-header .wsp-header-btn:active *,
.wsp-header .wsp-header-dropdown:active *,
.wsp-header .wsp-header-trigger-btn:active * {
    color: var(--wsp-header-btn-hover-fg) !important;
}
/* Quasar's q-btn paints a translucent overlay via `.q-focus-helper`
   on hover/focus that bled through as a faint white wash. Suppress
   it so the only hover signal is the red text + red underline. */
.wsp-header .wsp-header-btn .q-focus-helper,
.wsp-header .wsp-header-dropdown .q-focus-helper,
.wsp-header .wsp-header-trigger-btn .q-focus-helper {
    background: transparent !important;
    opacity: 0 !important;
}
.wsp-header .wsp-header-trigger-btn .q-btn__content {
    font-family: inherit !important;
    font-weight: var(--wsp-header-btn-font-weight) !important;
    gap: var(--wsp-header-btn-content-gap) !important;
    padding: 0 !important;
    line-height: 1 !important;
    align-items: center !important;
    justify-content: center !important;
}
.wsp-header .wsp-header-trigger-btn .q-btn__content > .q-icon {
    margin: 0 !important;
}
.wsp-header .wsp-header-trigger-btn { line-height: 1 !important; }
/* Group-label header inside the Filters picker — values from
   `app.toml [filter_picker]`. Non-clickable section break. */
.wsp-filter-picker-menu .wsp-filter-picker-group {
    padding: var(--wsp-fp-group-padding);
    font-size: var(--wsp-fp-group-font-size);
    font-weight: var(--wsp-fp-group-font-weight);
    letter-spacing: var(--wsp-fp-group-letter-spacing);
    text-transform: uppercase;
    color: var(--wsp-fp-group-color);
    background: var(--wsp-fp-group-bg);
    pointer-events: none;
}
/* (Older hover rule removed — the flat text + underline style above
   handles hover via `border-bottom-color`. Keeping a stale
   `border-color: transparent` here would clobber the underline.) */
/* Nav links on the right side of the header — same hover behavior
   as the header buttons (red text + red underline). One set of CSS
   vars (`--wsp-header-btn-hover-fg / underline-color / underline-px`)
   drives both surfaces so they stay in lock-step. */
.wsp-header .wsp-header-link {
    /* Reserve the underline space at rest so text doesn't jump on
       hover (matching the header-button trick). Font props are forced
       to match `.wsp-header-btn` exactly so the red on hover renders
       at the same weight/size on both surfaces — otherwise differing
       font-weight (link vs q-btn-inner-span) makes the same hex look
       like two different reds due to text-AA. */
    border-bottom: var(--wsp-header-btn-underline-px) solid transparent !important;
    text-decoration: none !important;
    color: #ffffff !important;
    font-family: inherit !important;
    font-weight: var(--wsp-header-btn-font-weight) !important;
    letter-spacing: var(--wsp-header-btn-letter-spacing) !important;
    line-height: 1 !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: border-color 120ms ease, color 120ms ease;
}
.wsp-header .wsp-header-link:hover {
    color: var(--wsp-header-btn-hover-fg) !important;
    border-bottom-color: var(--wsp-header-btn-underline-color) !important;
    text-decoration: none !important;
}
/* Active nav link — same red underline as :hover so the user can see
   which page they're on. Color stays white at rest (the underline alone
   is the cue); hover deepens to red for consistency with non-active
   links. Applied in `layout.py`'s NAV_ENTRIES loop when the route
   guard's `slug` matches the link's slug. */
.wsp-header .wsp-header-link--active {
    border-bottom-color: var(--wsp-header-btn-underline-color) !important;
}
.wsp-header .wsp-header-link--active:hover {
    color: var(--wsp-header-btn-hover-fg) !important;
}
/* `.wsp-hoverable` + auto-applied panel rows — single canonical
   hover signal: a soft canonical-green highlight band. No text
   color shift, no weight change. Same `#16a34a` everywhere so the
   "you can click this" cue reads consistently across the map's
   side panels.
   Canonical green: rgba(22, 163, 74, 0.14). */
.wsp-hoverable {
    transition: background-color 120ms ease;
    cursor: pointer;
}
.wsp-hoverable:hover,
.bdis-side.bdis-side--map .bdis-sub-body .bdis-results-row:hover,
.bdis-side.bdis-side--map .bdis-sub-body .bdis-typeahead-chip:hover,
.bdis-side.bdis-side--map .bdis-sub-body .bdis-filter-cell__clear-x:hover,
.bdis-side.bdis-side--map .bdis-sub-body .bdis-scope-preset:hover {
    background: rgba(22, 163, 74, 0.14) !important;
}
/* Region dropdown menu now uses the canonical `.wsp-header-menu` (bdis.css
   §19) — same dark-bg + red-hover look as every other header-origin
   dropdown (map basemap / palette / Options). The styling block formerly
   here was duplicated against map_page.py's inline `.wsp-pick-menu`; the
   merged version lives in bdis.css. */
.wsp-header-divider {
    width: var(--wsp-hdr-divider-width-px);
    height: var(--wsp-hdr-divider-height-px);
    background: var(--wsp-hdr-divider-color);
    /* Symmetric breathing room — wrapper rows use `gap-0` so adjacent
       items sit `margin-px` away from the divider on both sides. Anti-
       button-padding tweaks live in the per-item margin knobs below. */
    margin: 0 var(--wsp-hdr-divider-margin-px);
    flex-shrink: 0;
}
/* Per-item margins around the divider — absorb button internal padding so
   the visible icon / text sits at the same distance from the divider on
   both sides. All driven by app.toml. */
.wsp-header .wsp-home-link {
    margin-left: var(--wsp-hdr-logo-margin-left-px);
    margin-right: var(--wsp-hdr-logo-margin-right-px);
    /* Never shrink — under width pressure a flexible logo box would let
       the SVG overrun into the adjacent divider. Keeps a clean gap. */
    flex-shrink: 0;
}
.wsp-header .wsp-header-home-divider,
.wsp-header .wsp-header-brr-home-divider {
    flex-shrink: 0;
}
.wsp-header .wsp-header-selector-globe {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 40px;
    min-width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    color: #fff !important;
    border: 1px solid transparent;
    border-radius: 50%;
    text-decoration: none !important;
    transition: background-color 120ms ease, border-color 120ms ease;
}
.wsp-header .wsp-header-selector-globe .q-icon {
    font-size: var(--wsp-acct-menu-trigger-icon-size-px, 20px);
}
.wsp-header .wsp-header-selector-globe:hover {
    color: #fff !important;
    border-color: rgba(255, 255, 255, 0.65);
    background: #2d2d30;
}
.wsp-header .wsp-header-selector-link,
.wsp-header .wsp-header-home-link {
    padding-left: var(--wsp-hdr-selector-padding-x-px);
    padding-right: var(--wsp-hdr-selector-padding-x-px);
    flex-shrink: 0;
}
.wsp-header .wsp-header-scope-context {
    color: inherit;
    padding: 0 var(--wsp-hdr-selector-padding-x-px);
    font-size: 0.92em;
    font-weight: 500;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
}
.wsp-header .wsp-header-nav-links {
    position: absolute;
    left: var(--wsp-header-nav-left-inset, var(--wsp-header-nav-safe-inset, 320px));
    right: var(--wsp-header-nav-right-inset, var(--wsp-header-nav-safe-inset, 320px));
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    margin-left: 0;
    padding-left: var(--wsp-hdr-nav-padding-x-px);
    padding-right: var(--wsp-hdr-nav-padding-x-px);
    gap: var(--wsp-hdr-nav-inter-link-gap-px);
    justify-content: flex-start;
    /* The first link starts just after the left divider; JS extends the rail
       to the available space before the account controls on the right. */
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
    flex-wrap: nowrap;
    overflow-x: hidden;
    overflow-y: hidden;
    opacity: 1;
    visibility: visible;
    transition: opacity 100ms ease;
}
.wsp-header .wsp-header-nav-links--overflowing {
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}
.wsp-header .wsp-header-nav-links--overflowing::-webkit-scrollbar {
    display: none;
}
.wsp-header .wsp-header-nav-links--overflowing > * { cursor: grab; }
.wsp-header .wsp-header-nav-links--overflowing.wsp-header-nav-dragging,
.wsp-header .wsp-header-nav-links--overflowing.wsp-header-nav-dragging > * {
    cursor: grabbing !important;
    user-select: none !important;
}
.wsp-header .wsp-header-nav-links--can-scroll-left::before,
.wsp-header .wsp-header-nav-links--can-scroll-right::after {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 3;
    display: block;
    width: 30px;
    content: "";
    pointer-events: none;
}
.wsp-header .wsp-header-nav-links--can-scroll-left::before {
    left: 0;
    background: linear-gradient(to right, var(--wsp-header-bar-bg, #000) 0%, transparent 100%);
}
.wsp-header .wsp-header-nav-links--can-scroll-right::after {
    right: 0;
    background: linear-gradient(to left, var(--wsp-header-bar-bg, #000) 0%, transparent 100%);
}
.wsp-header .wsp-header-nav-links > * {
    flex: 0 0 auto;
}
.wsp-header .wsp-header-nav-links > .wsp-header-trigger-btn {
    min-width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
.wsp-header .wsp-header-nav-links:not(.wsp-header-nav-links--can-scroll-left)::before,
.wsp-header .wsp-header-nav-links:not(.wsp-header-nav-links--can-scroll-right)::after {
    display: none;
}
/* Header flow: left chrome + page extras stay in normal flow; the nav
   rail is absolutely centered and bounded; the account section stays
   fixed at the far right. */
.wsp-header .wsp-header-section--left {
    flex: 1 1 auto;
    min-width: 0;
    z-index: 2;
}
.wsp-header .wsp-header-section--right {
    flex: 0 0 auto;
    min-width: max-content;
    justify-content: flex-end;
    z-index: 2;
}
/* Navy header bar — overrides Quasar's `bg-secondary` utility that
   the `<q-header>` element ships with. Sourced from
   `app.toml [header_buttons] bar-bg`. */
.q-header.wsp-header,
.wsp-header.bg-secondary {
    background: var(--wsp-header-bar-bg) !important;
}
/* ─── Header dropdown menus (.wsp-header-menu) ────────────────────
   Shared by region / basemap / Options / Filters. Three states:
     - rest      → flat bg from `[header_menu] bg`
     - hover     → `hover-bg`
     - selected  → `active-bg` + left navy accent stripe (NOT a checkmark)
   Custom scrollbar so the menu's right edge always reads as bordered. */
.wsp-header-menu {
    background: var(--wsp-hm-bg) !important;
    color: var(--wsp-hm-fg) !important;
    border: 1px solid var(--wsp-hm-border) !important;
    /* Firefox scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--wsp-hm-sb-thumb) var(--wsp-hm-sb-track);
}
/* WebKit/Blink scrollbar — left border on the track so the scroll
   gutter visually separates from the menu items. */
.wsp-header-menu::-webkit-scrollbar {
    width: var(--wsp-hm-sb-w);
}
.wsp-header-menu::-webkit-scrollbar-track {
    background: var(--wsp-hm-sb-track);
    border-left: 1px solid var(--wsp-hm-border);
}
.wsp-header-menu::-webkit-scrollbar-thumb {
    background: var(--wsp-hm-sb-thumb);
    border: var(--wsp-hm-sb-thumb-border);
    border-radius: 4px;
}
.wsp-header-menu .q-item {
    padding: var(--wsp-hdr-menu-item-padding) !important;
    position: relative;
}
/* Active row — bold text + a narrow navy stripe positioned via
   `::before` so we can place it close to the text (controlled by
   `--wsp-hm-stripe-left`) without narrowing the menu itself. The menu
   keeps its full padding for visual breathing; only the stripe sits
   near the text. */
.wsp-header-menu .q-item.wsp-header-menu-item--active,
.wsp-header-menu .q-item.wsp-header-menu-item--active:hover,
.wsp-header-menu .q-item.wsp-header-menu-item--active:focus,
.wsp-header-menu .wsp-header-menu-item--active.q-item {
    color: var(--wsp-hm-active-fg, #0b1f3f) !important;
    font-weight: 700 !important;
}
.wsp-header-menu .q-item.wsp-header-menu-item--active:hover {
    background: var(--wsp-hm-hover-bg) !important;
}
/* Legend control — "Legend" caption + Show / Hide buttons inside a
   shared bordered wrapper. The wrapper carries the canonical header
   button chrome (same bg / border / radius) so the cluster reads as a
   single grouped control. The Show / Hide buttons themselves are
   text-only with a 2 px black underline as the active / hover
   indicator (replaces the earlier filled-pill look the user disliked). */
/* Legend cluster — three vertically-centered children of equal
   height: "Legend" label, Show, Hide. Wrapper uses navy bg so the
   black hover/active underline actually shows against it (was
   black-on-black before, hover invisible).
   Every text element uses `line-height: var(--wsp-header-btn-height)`
   so the baselines line up across all three children regardless of
   internal padding / pseudo-element decorations. */
.wsp-legend-radio-bar {
    align-items: stretch;
    gap: 0;
    height: var(--wsp-header-btn-height);
    padding: 0 0 0 10px;
    background: #1a3d7c;
    border: var(--wsp-header-btn-border);
    border-radius: var(--wsp-header-btn-radius);
    overflow: hidden;
}
.wsp-legend-radio-title {
    display: inline-flex;
    align-items: center;
    color: #ffffff;
    font-family: inherit;
    font-size: var(--wsp-header-btn-font-size);
    font-weight: var(--wsp-header-btn-font-weight);
    letter-spacing: var(--wsp-header-btn-letter-spacing);
    height: var(--wsp-header-btn-height);
    line-height: 1;
    padding-right: 10px;
    margin-right: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.35);
}
/* Show / Hide — full-height transparent text buttons. Same font /
   weight / letter-spacing as `--wsp-header-btn-*` so the whole bar
   reads as one typographic unit. Quasar's red `text-primary` default
   is nuked via the wildcard descendant color rule below. */
.wsp-legend-radio-bar .wsp-legend-radio.q-btn,
.wsp-legend-radio-bar .wsp-legend-radio.q-btn * {
    font-family: inherit !important;
    font-size: var(--wsp-header-btn-font-size) !important;
    font-weight: var(--wsp-header-btn-font-weight) !important;
    letter-spacing: var(--wsp-header-btn-letter-spacing) !important;
    text-transform: none !important;
    color: #ffffff !important;
}
.wsp-legend-radio-bar .wsp-legend-radio.q-btn {
    min-height: var(--wsp-header-btn-height) !important;
    height: var(--wsp-header-btn-height) !important;
    padding: 0 12px !important;
    background: transparent !important;
    border: 0 !important;
    /* Reserve underline space at the bottom of every button so the
       text x-position doesn't shift when the underline turns on. */
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    margin: 0 !important;
    transition: border-color 120ms ease, background-color 120ms ease;
    cursor: pointer;
}
.wsp-legend-radio-bar .wsp-legend-radio.q-btn .q-btn__content {
    line-height: 1 !important;
}
/* Hover — subtle white tint + soft black underline (50% alpha so it
   reads as a hint, not a commitment). The tint is what carries the
   "I can click this" signal against the navy bar. */
.wsp-legend-radio-bar .wsp-legend-radio.q-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    border-bottom-color: rgba(0, 0, 0, 0.45) !important;
}
/* Active — solid black underline + slightly darker tint to clearly
   signal "this is picked". Higher selector specificity than the
   inactive descendant-color rule above so text stays white. */
.wsp-legend-radio-bar .wsp-legend-radio--active.q-btn,
.wsp-legend-radio-bar .wsp-legend-radio--active.q-btn:hover {
    background: rgba(0, 0, 0, 0.20) !important;
    border-bottom-color: #000000 !important;
}
/* Pinned legend panel — floating card anchored below the Legend
   header radio. The JS shim in `map_page._LEGEND_PANEL_JS` drives
   the actual `top` / `left` / `width` / `height` (persisted to
   `localStorage`); this rule sets the chrome only. Very transparent
   white so the basemap shows through; backdrop blur keeps text
   legible. */
.wsp-legend-panel {
    position: fixed;
    /* Above the side panels (z 1200) + photo overlay (z 5000) but
       below the header dropdown menus (z 10001). Keeps the legend
       visible no matter which panel the user has open. */
    z-index: 5500;
    /* Translucent + blurred — text-legible without obscuring the map. */
    /* Solid alpha-blend (no `backdrop-filter: blur`) — visually
       similar but skips the GPU shader pass every paint. */
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(0, 0, 0, 0.55);
    border-radius: 5px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.20);
    color: #0b1f3f;
    font-size: 12px;
    min-width: 160px;
    min-height: 110px;
    /* Default geometry — hidden until the JS shim positions the panel
       below the Legend label in the header (no flash from a CSS
       default position → JS-anchored position). */
    visibility: hidden;
    top: calc(var(--wsp-header-h, 48px) + 8px);
    left: 12px;
    width: 220px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* Drag handle strip — grip on the LEFT (visible drag target) + X
   close button on the RIGHT. Grip area is grabbable; the close
   button explicitly opts out of drag via JS (mousedown event with
   `.closest('.wsp-legend-close')` returns true → bail). */
/* Solid black header strip — long white drag band on the left,
   close button on the right. Same chrome as the page header bar so
   the panel reads as a small sibling window. */
.wsp-legend-panel .wsp-legend-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 4px 3px 6px;
    background: #000000;
    color: #ffffff;
    /* Open-hand pointer at rest, closed fist while dragging — the
       conventional UX for a "grab and drag" handle. */
    cursor: grab;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    flex: 0 0 auto;
    min-height: 22px;
    gap: 6px;
}
.wsp-legend-panel .wsp-legend-handle:active {
    cursor: grabbing;
}
/* Simple white horizontal pill — fixed width, centered horizontally
   in the remaining space between the left padding and the close
   button. (`margin: 0 auto` does the centering; the close button
   stays right-pinned by `justify-content: space-between`.) */
.wsp-legend-panel .wsp-legend-handle-grip {
    flex: 0 0 auto;
    width: 48px;
    height: 4px;
    margin: 0 auto;
    border-radius: 2px;
    background: #ffffff;
}
/* Close X — small flat circular button. Idle = white glyph;
   hover = WSP red so the destructive action signals before commit. */
.wsp-legend-panel .wsp-legend-close.q-btn {
    min-height: 18px !important;
    min-width: 18px !important;
    width: 18px !important;
    height: 18px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    cursor: pointer;
}
.wsp-legend-panel .wsp-legend-close.q-btn .q-icon {
    font-size: 15px !important;
    color: #ffffff !important;
}
.wsp-legend-panel .wsp-legend-close.q-btn:hover {
    background: rgba(255, 255, 255, 0.12) !important;
}
.wsp-legend-panel .wsp-legend-close.q-btn:hover .q-icon {
    color: #F9423A !important;
}
/* Scrollable body so resizing smaller still lets the user reach
   every swatch. */
.wsp-legend-panel .wsp-legend-body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 6px 10px 6px 10px;
    /* `margin-bottom` shrinks the flex item's box so its right-edge
       scrollbar ends ABOVE the bottom-right corner. The 14×14 resize
       handle is absolutely positioned in that reserved corner, so
       the two no longer collide visually or interaction-wise. */
    margin-bottom: 14px;
}
.wsp-legend-panel .wsp-legend-section {
    padding: 2px 0 1px;
    font-size: 7.5px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #1f2937;
    border-bottom: 1px solid rgba(0, 0, 0, 0.18);
    margin-bottom: 2px;
}
.wsp-legend-panel .wsp-legend-section:not(:first-child) {
    margin-top: 8px;
}
.wsp-legend-panel .nicegui-row {
    padding: 2px 0;
}
/* Force every text element inside the panel to dark navy on the
   translucent white surface. `.text-white` is inherited from the
   header-context swatch helper and would otherwise be invisible. */
.wsp-legend-panel,
.wsp-legend-panel *:not(.q-icon, .q-icon *, .material-icons, .material-icons *, .material-symbols-outlined, .material-symbols-outlined *) {
    font-family: Arial, Helvetica, sans-serif !important;
}
/* Wildcard descendant — every text element inside the body forced to
   navy, beats Tailwind's `.text-white` utility and Quasar's
   `text-primary`. Drag handle title keeps white via its own rule. */
.wsp-legend-panel .wsp-legend-body,
.wsp-legend-panel .wsp-legend-body *:not(.q-icon, .q-icon *, .material-icons, .material-icons *, .material-symbols-outlined, .material-symbols-outlined *) {
    color: #0b1f3f !important;
}
.wsp-legend-panel .wsp-swatch-label,
.wsp-legend-panel .nicegui-label,
.wsp-legend-panel .nicegui-row .nicegui-label {
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}
/* Bottom-right resize corner — two thin diagonal lines via stacked
   linear-gradients so the affordance is obvious without painting a
   half-square triangle (which the user found too "cross-y"). The
   `nwse-resize` cursor on hover is the standard diagonal-resize
   double-arrow shape. */
.wsp-legend-panel .wsp-legend-resize {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
    /* Sit ON TOP of the body's overflow scrollbar (which is browser
       chrome with its own arrow cursor). Without this z-index the
       scrollbar intercepts the hover and the resize cursor never
       shows. The body is shrunk via padding-bottom below so its
       scrollbar thumb doesn't reach the corner. */
    z-index: 3;
    background:
        linear-gradient(135deg,
            transparent 0%, transparent 35%,
            rgba(0, 0, 0, 0.55) 35%, rgba(0, 0, 0, 0.55) 50%,
            transparent 50%, transparent 70%,
            rgba(0, 0, 0, 0.55) 70%, rgba(0, 0, 0, 0.55) 85%,
            transparent 85%);
}
.wsp-header-menu .wsp-header-menu-item--active::before {
    content: var(--wsp-hm-glyph) !important;
    position: absolute;
    left: var(--wsp-hm-glyph-left);
    top: 50%;
    transform: translateY(-50%);
    color: var(--wsp-hm-glyph-color);
    font-size: var(--wsp-hm-glyph-size);
    line-height: 1;
    pointer-events: none;
}

/* The Load Rating Tool (BrR) header uses the same H1 bar as every page (user 2026-11-18): scope
   picker, white click-open menus for Region 9 / NYSTA. Its old divider / hover-caret rules are gone. */

/* H1 header (user 2026-11-18): every header dropdown (scope, Stats ▾, Map Options + its submenus,
   account) is one white menu — 2 px ink border, square corners, 40 px rows of 15 px text, grey
   hover, the current item marked by a 4 px red bar + bold. Overrides the older bdis.css §19 and
   the per-menu rules above, hence the !important. */
.q-menu.wsp-header-menu {
    width: max-content;
    min-width: 0;  /* menus hug their items (user 2026-11-18: Overview, Map Options too wide) */
    max-width: min(420px, 92vw);
    color: #161616 !important;
    background: #ffffff !important;
    border: 2px solid #161616 !important;
    border-radius: 0 !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18) !important;
    padding: 4px 0 !important;
    font-family: var(--wsp-header-font-family) !important;
}
.q-menu.wsp-header-menu .q-list { padding: 0 !important; background: transparent !important; }
.q-menu.wsp-header-menu .q-item {
    position: relative;
    min-height: 40px !important;
    padding: 0 16px !important;
    color: #161616 !important;
    background: transparent !important;
    border: 0 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}
.q-menu.wsp-header-menu .q-item::after { content: none !important; }
.q-menu.wsp-header-menu .q-item:hover,
.q-menu.wsp-header-menu .q-item:focus-visible {
    color: #161616 !important;
    background: #f0f0f0 !important;
}
.q-menu.wsp-header-menu .q-item.wsp-header-menu-item--active,
.q-menu.wsp-header-menu .q-item.wsp-header-menu-item--active:hover {
    font-weight: 700 !important;
    color: #161616 !important;
    box-shadow: inset 4px 0 0 #F9423A;
}
.q-menu.wsp-header-menu .wsp-header-menu-item--active::before { content: none !important; }
.q-menu.wsp-header-menu .q-separator,
.q-menu.wsp-header-menu .wsp-header-menu-divider,
.q-menu.wsp-header-menu .wsp-account-divider {
    height: 1px !important; margin: 4px 0 !important; background: #c6c6c6 !important;
}
.q-menu.wsp-header-menu .wsp-header-menu-group,
.q-menu.wsp-header-menu .wsp-header-menu-section {
    padding: 10px 16px 4px !important; font-size: 12px !important; color: #6f6f6f !important;
    letter-spacing: 0.04em !important;
}
.q-menu.wsp-header-menu .q-item .q-icon,
.q-menu.wsp-header-menu .q-item .material-icons { color: #161616 !important; }
/* Account menu: identity on white (email bold, roles grey), text-only rows like the mockup. */
.q-menu.wsp-account-menu .wsp-account-id {
    padding: 10px 16px 8px !important; background: #ffffff !important; color: #161616 !important;
}
.q-menu.wsp-account-menu .wsp-account-email {
    color: #161616 !important; font-size: 15px !important; font-weight: 700 !important;
}
.q-menu.wsp-account-menu .wsp-account-role {
    color: #6f6f6f !important; font-size: 13px !important; text-transform: none !important;
    letter-spacing: 0 !important; opacity: 1 !important;
}
.q-menu.wsp-account-menu .q-item .q-item__section--avatar { display: none !important; }
.q-menu.wsp-account-menu .q-item.wsp-account-item { padding: 0 16px !important; min-height: 40px !important; }

/* Scope picker in place of the breadcrumb: an outlined button, white outline on hover. */
.wsp-header .wsp-header-scope-pill {
    height: 36px;
    /* Logo ink -> box and box -> divider = --wsp-hdr-scope-gap-px (net of the logo's and the
       divider's own margins). */
    margin: 0 calc(var(--wsp-hdr-scope-gap-px) - var(--wsp-hdr-divider-margin-px)) 0
        calc(var(--wsp-hdr-scope-gap-px) - var(--wsp-hdr-logo-margin-right-px));
    padding: 0 14px !important;
    border: 1px solid #8d8d8d !important;
    border-radius: 0 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    white-space: nowrap;
}
/* Nav menus (scope, Overview ▾) are also at least as wide as their trigger (Quasar `fit`). */
.wsp-header .wsp-header-scope-pill:hover,
.wsp-header .wsp-header-scope-pill[aria-expanded="true"] { border-color: #ffffff !important; }
.wsp-header .wsp-header-scope-pill::before,
.wsp-header .wsp-header-scope-pill::after { display: none !important; }

/* Current page: bold as well as underlined. */
.wsp-header .wsp-header-link--active { font-weight: 700 !important; }

/* Account button: initials on a white disc. */
/* Same visual size as the site-map globe (user 2026-11-18): --wsp-hdr-corner-icon-px. */
.wsp-header .wsp-account-trigger.wsp-account-initials {
    width: var(--wsp-hdr-corner-icon-px); height: var(--wsp-hdr-corner-icon-px);
    min-width: var(--wsp-hdr-corner-icon-px); min-height: var(--wsp-hdr-corner-icon-px);
    background: #ffffff !important; color: #000000 !important;
    font-size: calc(var(--wsp-hdr-corner-icon-px) * 0.42); font-weight: 700; letter-spacing: 0.2px;
}

/* Black with white text is reserved for hover tooltips (site map and clipped
   cell explanations); interactive controls keep their page-specific styles. */
.q-tooltip,
.ag-tooltip {
    color: #fff !important;
    background: #000 !important;
    background-color: #000 !important;
}
.q-tooltip *,
.ag-tooltip * {
    color: #fff !important;
}
.wsp-header .wsp-account-trigger.wsp-account-initials .q-btn__content {
    border-bottom: 0 !important; padding: 0 !important;
}
.wsp-header .wsp-account-trigger.wsp-account-initials:hover { box-shadow: 0 0 0 2px #F9423A; }

/* The divider between the scope box and the first nav link (user 2026-11-19: same bar as the old
   globe | initials one, which is gone). The bar's font is pinned in layout.py's header CSS. */
.wsp-header .wsp-header-bar .wsp-header-nav-boundary { display: block !important; flex: none; }
.wsp-header .wsp-header-section--right { gap: 10px; }
/* The logo's "p" descender makes it read high: shift it so the "ws" letters sit on the nav baseline. */
.wsp-header .wsp-home-link svg { transform: translateY(var(--wsp-hdr-logo-offset-y-px)); }
/* The globe glyph's circle spans 20 of its 24 px em box: size the font so the circle's diameter
   equals the initials disc. */
.wsp-header .wsp-header-selector-globe .q-icon {
    font-size: calc(var(--wsp-hdr-corner-icon-px) * 1.2) !important;
}
/* Nav labels reserve their bold width (a hidden bold copy under the text), so the bold current
   page never pushes the links after it: the nav sits in the same place on every page. */
.wsp-header a.wsp-header-link[data-label],
.wsp-header .wsp-nav-label[data-label] {
    display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
}
.wsp-header a.wsp-header-link[data-label]::after,
.wsp-header .wsp-nav-label[data-label]::after {
    content: attr(data-label); font-weight: 700; height: 0; overflow: hidden;
    visibility: hidden; pointer-events: none; user-select: none;
}
/* Initials stay black on the white disc (a header button colour rule turned the label red). */
.wsp-header .wsp-account-trigger.wsp-account-initials .block,
.wsp-header .wsp-account-trigger.wsp-account-initials .q-btn__content { color: #000000 !important; }

/* Phones (same width as report_check.toml [viewer] mobile_max_px): the scope box shrinks and cuts its
   label with "…" instead of running under the globe / account icons (user 2026-11-21). */
@media (max-width: 760px) {
    .wsp-header .wsp-header-section--left { overflow: hidden; }
    .wsp-header .wsp-header-scope-pill { flex: 0 1 auto; min-width: 0; overflow: hidden; padding: 0 8px !important;
        font-size: 13px !important; }
    .wsp-header .wsp-header-scope-pill .q-btn__content { min-width: 0; max-width: 100%; overflow: hidden; flex-wrap: nowrap; }
    .wsp-header .wsp-header-scope-pill .q-btn__content .block { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* A scope box with phone names ([header_scope_phone] in app.toml): the full name on wider screens,
   the first phone name up to 760 px, the second at 360 px and below. */
.wsp-header .wsp-scope-names { display: inline; white-space: nowrap; }
.wsp-header .wsp-scope-name--p1, .wsp-header .wsp-scope-name--p2 { display: none; }
@media (max-width: 760px) {
    .wsp-header .wsp-scope-name--full { display: none; }
    .wsp-header .wsp-scope-name--p1 { display: inline; }
}
@media (max-width: 360px) {
    .wsp-header .wsp-scope-name--p1 { display: none; }
    .wsp-header .wsp-scope-name--p2 { display: inline; }
}
