.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--header-h);
  padding: 0 0.9rem 0 0.7rem;
  background: rgba(0, 0, 0, 0.86);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: var(--text-primary);
  text-decoration: none;
}

.brand img {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
}

.brand-name {
  font-weight: 650;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.header-search {
  flex: 1;
  display: flex;
  justify-content: center;
}

.search-launch {
  position: relative;
  width: min(34rem, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-primary);
  border: 1px solid var(--border-primary);
  color: var(--text-muted);
}

.search-launch kbd,
kbd {
  font-family: var(--mono);
  font-size: 0.75rem;
  border: 1px solid var(--border-primary);
  border-radius: 6px;
  padding: 0.05rem 0.35rem;
  color: var(--text-secondary);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.platform-switch {
  display: flex;
  padding: 0.15rem;
  border-radius: 999px;
  background: var(--surface-primary);
  border: 1px solid var(--border-subtle);
}

.platform-switch button {
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  color: var(--text-secondary);
}

.platform-switch button[aria-pressed="true"] {
  background: var(--accent-primary);
  color: var(--on-accent);
}

.menu-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-primary);
}

.shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  align-items: start;
}

.shell.has-toc {
  grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--toc-w);
}

.rail {
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow: auto;
  padding: 0.8rem 0.7rem 2rem;
  border-right: 1px solid var(--border-subtle);
  background: #050506;
}

.content {
  min-width: 0;
  padding: 1.6rem 1.8rem 4rem;
}

.content-inner {
  max-width: var(--content);
}

.toc {
  position: sticky;
  top: var(--header-h);
  max-height: calc(100vh - var(--header-h));
  overflow: auto;
  padding: 1.4rem 1rem 2rem 0.2rem;
}

.toc h2 {
  margin: 0 0 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.toc a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.28rem 0;
}

.toc a:hover,
.toc a[aria-current="true"] {
  color: var(--accent-primary);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1rem;
}

.crumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--accent-primary);
}
