/* Shared by siteHeader(): keep page-specific styles outside this component. */
.cvl-header {
  --fg: #fafafa;
  --fg2: #d4d4d4;
  --muted: #a1a1a1;
  --line: #2a2a2a;
  --surface: #1c1c1c;
  --green: #71deb0;
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px 24px;
  min-width: 0;
  min-height: 73px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 10, 10, .92);
  color: var(--fg);
  font: 400 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  backdrop-filter: blur(8px);
}
.cvl-header .brand {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  color: var(--fg);
  text-decoration: none;
}
.cvl-header .brand strong { font-size: 24px; font-weight: 700; letter-spacing: -1px; }
.cvl-header .brand .dot { color: var(--green); width: auto; height: auto; }
.cvl-header .brand-mark { height: 26px; width: auto; margin-right: -4px; flex: none; }
.cvl-header .brand > span { font-size: 14px; color: var(--muted); border-left: 1px solid var(--line); padding-left: 14px; white-space: nowrap; }
/* Navigation follows the brand; only actions consume the remaining space. */
.cvl-header .site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; min-width: 0; }
.cvl-header .site-nav a { display: inline-flex; align-items: center; gap: .28em; min-height: 44px; padding: 8px 14px; border-radius: 8px; color: var(--fg2); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap; }
.cvl-header .site-nav a:hover { background: var(--surface); color: var(--fg); }
.cvl-header .site-nav a[aria-current] { color: var(--fg); background: var(--surface); box-shadow: inset 0 -2px 0 var(--green); }
.cvl-header .top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin-left: auto; }
.cvl-header .news-link { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 8px; color: var(--fg2); font-size: 15px; text-decoration: none; white-space: nowrap; }
.cvl-header .news-link:hover { background: var(--surface); color: var(--fg); }
.cvl-header .appstore-badge { display: inline-flex; flex: none; line-height: 0; }
.cvl-header .appstore-badge img { display: block; height: 40px; width: auto; }
/* Google artwork includes its required clear space; do not crop it. */
.cvl-header .appstore-badge img.play-badge { height: 52px; }
.cvl-header :focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

/* Map controls occupy their own row below branding and primary navigation. */
.cvl-header .top-actions > button { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.cvl-header .map-actions { flex-basis: 100%; margin-left: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.cvl-header .map-actions .desktop-action { display: inline-flex; }
.cvl-header .tool { background: transparent; border-color: transparent; color: var(--fg2); }
.cvl-header .tool:hover { background: var(--surface); color: var(--fg); }
.cvl-header .radio-live { white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--fg); border-color: rgba(113, 222, 176, .45); }
.cvl-header .radio-live:hover { background: rgba(113, 222, 176, .1); }
.cvl-header .radio-live > svg { color: var(--green); flex: none; }
.cvl-header .radio-short, .cvl-header .settings-icon { display: none; }
.cvl-header .top-actions .header-layers { display: inline-flex; align-items: center; justify-content: center; gap: 9px; flex-shrink: 0; background: #d9ff3f; color: #0a0a0a; border: 1px solid #eaff94; font-weight: 700; box-shadow: 0 0 0 3px #d9ff3f1f; }
.cvl-header .header-layers:hover { background: #edff99; border-color: #fff; }
.cvl-header .header-layers:focus-visible { outline-width: 3px; outline-offset: 4px; }
.cvl-header .layers-icon { display: block; width: 21px; height: 21px; }
.posts { --top: 73px; }

@media (max-width: 1439px) {
  .cvl-header .site-nav .wide { display: none; }
  .cvl-header .radio-long { display: none; }
  .cvl-header .radio-short { display: inline; }
  .cvl-header .settings-label { display: none; }
  .cvl-header .settings-icon { display: block; }
  .cvl-header .top-actions button[data-dialog="settings"] { width: 44px; padding: 11px; }
}
@media (max-width: 1239px) {
  .cvl-header { column-gap: 12px; }
  .cvl-header .brand > span { display: none; }
  .cvl-header .site-nav a { padding-inline: 10px; }
}
@media (max-width: 999px) {
  .cvl-header { position: static; min-height: 60px; padding: 8px 16px; }
  .cvl-header .desktop-action, .cvl-header .appstore-badge { display: none; }
  /* Subpages keep navigation; map navigation retains its desktop-action behavior. */
  .cvl-header .site-nav:not(.desktop-action) { order: 3; flex-basis: 100%; }
  .cvl-header .top-actions > button { font-size: 14px; padding: 8px 12px; }
  .posts { --top: 0px; }
}
@media (max-width: 600px) {
  .cvl-header { gap: 6px; padding-inline: 8px; }
  .cvl-header .brand { gap: 9px; }
  .cvl-header .top-actions { gap: 6px; }
  .cvl-header .top-actions .radio-live { font-size: 12px; padding-inline: 7px; }
  .cvl-header .top-actions .header-layers { padding: 8px 10px; gap: 6px; font-size: 14px; }
  .cvl-header .site-nav a { padding-inline: 8px; font-size: 14px; }
}
@media (max-width: 380px) {
  .cvl-header .radio-short { display: none; }
}
body.app-mode .cvl-header, html.widget .cvl-header { display: none !important; }
