.site-header { position: relative; overflow: visible; background: #0f172a; color: #e5e7eb; border-bottom: 1px solid rgba(255,255,255,0.08); }
.site-header,
.site-header * { line-height: 1.2; }
.site-header .shell { max-width: 1200px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; overflow: visible; }
.site-header .brand { color: #fff; text-decoration: none; display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; line-height: 1; }
.site-header .brand-main { font-weight: 700; letter-spacing: 0.2px; font-size: 15px; }
.site-header .brand-tagline { font-size: 11px; font-weight: 500; color: #cbd5e1; white-space: nowrap; }
.site-header .header-nav-shell { position: relative; flex: 1 1 auto; min-width: 0; overflow: visible; margin-left: 18px; }
.site-header nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.site-header nav a,
.site-header .guides-toggle,
.site-header .state-toggle {
  color: #e5e7eb;
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.18s ease, color 0.18s ease;
  font-size: 13px;
}
.site-header nav a:hover,
.site-header .guides-item.is-open > .guides-toggle,
.site-header .state-menu-item.is-open > .state-toggle {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.site-header .guides-item,
.site-header .state-menu-item {
  flex: 0 0 auto;
}
.site-header .guides-toggle,
.site-header .state-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  user-select: none;
}
.site-header .guides-toggle::after,
.site-header .state-toggle::after {
  content: "▾";
  font-size: 11px;
  opacity: 0.8;
  transition: transform 0.22s ease;
}
.site-header .guides-item.is-open > .guides-toggle::after,
.site-header .state-menu-item.is-open > .state-toggle::after {
  transform: rotate(180deg);
}
.site-header .guides-toggle:focus-visible,
.site-header .guides-panel a:focus-visible,
.site-header .state-toggle:focus-visible,
.site-header .state-menu-panel a:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.site-header .guides-panel,
.site-header .state-menu-panel {
  display: grid;
  gap: 4px;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin-top: 0;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  background: #0f172a;
  box-shadow: 0 14px 28px rgba(0,0,0,0.28);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}
.site-header .state-menu-panel {
  min-width: 200px;
}
.site-header .guides-panel a,
.site-header .state-menu-panel a {
  display: block;
  padding: 8px 10px;
  color: #e5e7eb;
  white-space: nowrap;
  border-radius: 6px;
}
.site-header .guides-panel a:hover,
.site-header .state-menu-panel a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.site-header .guides-panel.is-open,
.site-header .state-menu-panel.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}
.site-header .state-menu-panel a:first-child {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 9px;
  margin-bottom: 2px;
}
@media (max-width: 768px) {
  .site-header .shell { padding: 6px 10px; }
  .site-header .brand-main { font-size: 13px; }
  .site-header .brand-tagline { display: none; }
  .site-header .header-nav-shell { margin-left: 0; }
  .site-header nav {
    flex: 1 1 auto;
    min-width: 0;
    gap: 8px;
    padding: 4px 10px 10px;
    scrollbar-width: none;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: center;
    scroll-padding-inline: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .site-header nav::-webkit-scrollbar { display: none; }
  .site-header nav > * {
    flex: 0 0 auto;
  }
  .site-header nav a,
  .site-header .guides-toggle,
  .site-header .state-toggle {
    font-size: 12px;
    white-space: nowrap;
    min-height: 38px;
    padding: 8px 10px;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .site-header .guides-item,
  .site-header .state-menu-item {
    width: auto;
  }
  .site-header .guides-panel,
  .site-header .state-menu-panel {
    top: calc(100% + 6px);
    width: min(280px, calc(100vw - 20px));
    min-width: 0;
    max-width: calc(100vw - 20px);
    max-height: min(70vh, 420px);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 0 10px 20px rgba(0,0,0,0.18);
    z-index: 1000;
  }
  .site-header .guides-panel a,
  .site-header .state-menu-panel a {
    white-space: normal;
  }
}
