/* Forum-style top bar, shared by every page: one slim sticky bar, page tabs on the left, tools and the Sites menu on the right. */
:root { --bar-h: 44px; }
.site-header { position: sticky; top: 0; z-index: 90; border-bottom: 1px solid var(--bar-line); background: var(--bar); box-shadow: 0 2px 0 #0008; }
.site-header .topbar { display: flex; align-items: stretch; min-height: 42px; }
.site-header .brand { padding: 0 12px; border-right: 1px solid var(--bar-line); font-size: 17px; }
.site-header .topbar-menu { flex: 1; min-width: 0; display: flex; align-items: stretch; }
.site-header .tabs { display: flex; align-items: stretch; flex-wrap: wrap; }
.site-header .tabs > a, .site-header .tabs > button, .site-header .topbar-right > button, .site-header .sites-menu > summary {
  display: inline-flex; align-items: center; gap: 4px; margin: 0; border: 0; border-right: 1px solid var(--bar-line); border-radius: 0; min-height: 0;
  background: transparent; color: #ddd; padding: 0 13px; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; list-style: none; white-space: nowrap;
}
.site-header .tabs > a:hover, .site-header .tabs > button:hover, .site-header .topbar-right > button:hover:not(:disabled), .site-header .sites-menu > summary:hover,
.site-header .sites-menu[open] > summary { background: var(--selected); color: #fff; }
.site-header .tabs > .active { background: var(--selected); color: #fff; box-shadow: inset 0 -2px 0 var(--link); }
.site-header .topbar-right { margin-left: auto; display: flex; align-items: stretch; }
.site-header .topbar-right > button:first-child, .site-header .sites-menu > summary { border-left: 1px solid var(--bar-line); }
.site-header .topbar-right > button:disabled { color: #999; cursor: default; }
.site-header .sites-menu > summary::-webkit-details-marker { display: none; }
.site-header .sites-menu > summary::after { content: '▾'; font-size: 10px; }
.site-header .sites-menu { position: relative; display: flex; }
.site-header .sites-panel { position: absolute; right: 0; top: 100%; z-index: 1; min-width: 210px; padding: 6px 0; border: 1px solid var(--line); background: var(--panel); box-shadow: 0 6px 14px #000a; }
.site-header .sites-group { display: flex; flex-direction: column; padding: 2px 0 6px; }
.site-header .sites-group + .sites-group { border-top: 1px solid var(--line-soft); padding-top: 6px; }
.site-header .sites-group b { padding: 2px 12px; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.site-header .sites-group a { padding: 6px 12px; color: #ddd; font-size: 13px; text-decoration: none; }
.site-header .sites-group a:hover { background: var(--selected); color: #fff; }
.site-header .sites-group button { padding: 6px 12px; border: 0; background: transparent; color: #ddd; font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.site-header .sites-group button:hover { background: var(--selected); color: #fff; }
.site-header .sites-group button.active::before { content: '✓ '; color: var(--green); }
.site-header .menu-toggle { display: none; }
.top-pagination { top: var(--bar-h); }

@media (max-width: 760px) {
  .site-header .topbar { flex-wrap: wrap; }
  .site-header .brand { flex: 1; border-right: 0; min-height: 42px; }
  .site-header .menu-toggle { display: inline-flex; align-items: center; gap: 6px; margin: 0; border: 0; border-left: 1px solid var(--bar-line); border-radius: 0; background: transparent; color: #ddd; padding: 0 14px; font: inherit; font-size: 13px; cursor: pointer; }
  .site-header .menu-toggle.has-alert::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #e5bc6a; }
  .site-header.open .menu-toggle { background: var(--selected); color: #fff; }
  .site-header .topbar-menu { display: none; flex-basis: 100%; flex-direction: column; border-top: 1px solid var(--bar-line); background: var(--header); max-height: calc(100dvh - 44px); overflow-y: auto; }
  .site-header.open .topbar-menu { display: flex; }
  .site-header .tabs { flex-direction: column; }
  .site-header .tabs > a, .site-header .tabs > button, .site-header .topbar-right > button, .site-header .sites-menu > summary { min-height: 42px; border-right: 0; border-bottom: 1px solid var(--bar-line); padding: 0 14px; font-size: 14px; }
  .site-header .tabs > .active { box-shadow: inset 3px 0 0 var(--link); }
  .site-header .topbar-right { margin-left: 0; flex-direction: column; }
  .site-header .topbar-right > button:first-child, .site-header .sites-menu > summary { border-left: 0; }
  .site-header .sites-menu { flex-direction: column; }
  .site-header .sites-panel { position: static; border: 0; box-shadow: none; padding: 0; background: var(--panel-deep); }
  .site-header .sites-group a, .site-header .sites-group button { padding: 10px 24px; width: 100%; }
}
.site-header .hidden { display: none !important; }
