/* Decluttered top bar (2026-09-24): ui/menuHost.js menus that host existing panels as tabs, count
   badges (ui/topbarBadge.js), and icon-only account buttons. */
.menu-host {
    position: fixed;
    z-index: 100001;
    width: min(420px, calc(100vw - 16px));
    /* Stop above the timeline bar so the bottom of a long list isn't hidden behind it. */
    max-height: calc(100vh - var(--topbar-h) - var(--timeline-h, 0px) - 16px);
    display: flex;
    flex-direction: column;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 7px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.48);
    color: var(--text-light);
}
.menu-host[hidden] { display: none; }
/* Hazards carries four badged tabs and the densest lists (ATC programs, storms): give it room so
   every tab label shows and program rows don't wrap. */
#hazardsMenu { width: min(560px, calc(100vw - 16px)); }
/* Tabs wrap to a second row on a narrow screen rather than hiding behind a sideways scroll. */
.menu-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 6px 6px 0;
    border-bottom: 1px solid var(--panel-border);
    flex: 0 0 auto;
}
.menu-tabs .menu-tab {
    border-radius: 5px 5px 0 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    white-space: nowrap;
}
.menu-tabs .menu-tab.menu-tab-active {
    border-bottom-color: var(--mint, #43d2aa);
    color: white;
    background: rgba(255, 255, 255, 0.06);
}
.menu-body { overflow-y: auto; flex: 1 1 auto; }
/* A hosted panel drops its own dropdown chrome and positioning (some set inline top/right on open). */
.menu-host .menu-hosted {
    position: static !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: auto !important;
    max-height: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}
.menu-host .menu-hosted[hidden] { display: none !important; }

/* Long lists fill the menu's height (which already stops above the viewport edge) instead of a
   fixed-height box: the panel shrinks to the menu body and only its list scrolls, so the header,
   map switches and source notes stay in view. */
.menu-body { display: flex; flex-direction: column; }
.menu-host #atcProgramsPanel.menu-hosted { flex: 1 1 auto; min-height: 0; }
.menu-host #atcProgramsPanel .atc-programs-list { max-height: none; flex: 1 1 auto; min-height: 120px; }
.menu-host #atcProgramsPanel > :not(.atc-programs-list) { flex-shrink: 0; }
.menu-host #nwsAlertsPanel .nws-alerts-types { max-height: min(480px, calc(100vh - var(--topbar-h) - 260px)); }

/* Count pill on a top bar button / tab. */
.topbar-badge {
    display: inline-block;
    min-width: 16px;
    margin-left: 5px;
    padding: 0 5px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.16);
    color: var(--text-light);
}
.topbar-badge-alert { background: #e34b4b; color: #111; }
.topbar-menu-btn::after { content: " \25BE"; font-size: 10px; opacity: 0.7; }
.topbar-menu-btn.menu-open { background: rgba(255, 255, 255, 0.1); }

/* Account items as compact icons. */
.topbar-icon-only { display: inline-flex; align-items: center; justify-content: center; padding-left: 8px; padding-right: 8px; }
.topbar-user-btn { display: inline-flex; align-items: center; gap: 6px; }
.topbar-user-name:empty { display: none; }
.topbar-user-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-display-toggle[aria-pressed="true"] { border-color: var(--mint, #43d2aa); color: var(--mint, #43d2aa); }
