/* Shared navigation stays available while the research remains the focus. */
:root { --header-height:76px; }
html { scroll-padding-top:calc(var(--header-height) + 16px); }
#main:focus { outline:none; }
.site-header { position:sticky; top:0; z-index:60; }
.site-header .header-inner { display:flex; padding:12px 36px; gap:16px; flex-wrap:nowrap; }
.header-actions { display:flex; gap:12px; align-items:center; margin-left:0; }
.site-header .primary-navigation { display:flex; align-items:center; gap:20px; margin-left:auto; }
.site-header .primary-navigation>a { min-height:44px; padding:10px 0; }
.site-header .primary-navigation>a[aria-current=page]:after { bottom:0; }
.header-sections { display:flex; align-items:center; gap:18px; }
.header-dropdown { position:relative; }
.header-dropdown>summary { display:flex; align-items:center; gap:5px; list-style:none; min-height:44px; padding:10px 0; color:var(--muted); }
.header-dropdown>summary::-webkit-details-marker { display:none; }
.header-dropdown>summary .icon { width:13px; height:13px; transform:rotate(90deg); }
.header-dropdown[open]>summary { margin:0; color:var(--accent); }
.header-dropdown[open]>summary .icon { transform:rotate(-90deg); }
.site-header .header-dropdown>nav { position:absolute; right:0; top:calc(100% + 12px); width:260px; display:flex; flex-direction:column; align-items:stretch; gap:2px; margin:0; padding:12px; max-height:calc(100dvh - var(--header-height) - 24px); overflow:auto; overscroll-behavior:contain; border:1px solid var(--border); border-radius:10px; background:var(--card); box-shadow:0 12px 32px #0002; }
.site-header .header-dropdown>nav a { white-space:normal; min-height:44px; padding:10px; border-radius:6px; }
.site-header .header-dropdown>nav a:hover,.site-header .header-dropdown>nav a[aria-current=page] { background:var(--soft); text-decoration:none; }
.site-header .header-dropdown>nav a[aria-current=page]:after { display:none; }
.site-menu { display:none; }
.site-header .theme-button { position:static; margin:0; flex:none; }
.site-menu>summary { display:flex; align-items:center; gap:8px; min-height:44px; padding:9px 14px; border:1px solid var(--border); border-radius:8px; background:var(--card); list-style:none; }
.site-menu[open]>summary { margin:0; border-color:var(--accent); background:var(--soft); }
.site-menu>summary::-webkit-details-marker { display:none; }
.site-menu-panel { position:absolute; top:100%; right:max(16px, calc((100vw - 1168px)/2)); width:min(780px, calc(100vw - 32px)); max-height:calc(100dvh - var(--header-height) - 16px); overflow:auto; overscroll-behavior:contain; background:var(--card); border:1px solid var(--border); border-radius:0 0 16px 16px; padding:28px; box-shadow:0 16px 36px #0002; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.site-header .site-menu nav { display:flex; flex-direction:column; align-items:stretch; gap:2px; margin:0; }
.site-header .site-menu nav a { white-space:normal; padding:11px 10px; min-height:44px; border-radius:6px; font-size:13px; }
.site-header .site-menu nav a:hover,.site-header .site-menu nav a[aria-current=page] { background:var(--soft); text-decoration:none; }
.site-header .site-menu nav a[aria-current=page]:after { display:none; }
.menu-section .eyebrow { margin:0 10px 8px; }
.aside-sticky,.prose-aside { top:calc(var(--header-height) + 20px); }
.back-to-top { position:fixed; z-index:50; right:20px; bottom:calc(20px + env(safe-area-inset-bottom)); display:flex; align-items:center; justify-content:center; gap:7px; min-height:44px; padding:10px 14px; color:var(--text); background:var(--card); border:1px solid var(--border); box-shadow:0 4px 18px #0002; border-radius:24px; }
.back-to-top .icon { transform:rotate(-90deg); }
.back-to-top[hidden] { display:none; }
@media(max-width:1039px) {
  :root { --header-height:112px; }
  .site-header .header-inner { display:grid; grid-template-columns:minmax(0,1fr) auto; padding:8px 16px 3px; gap:4px 8px; }
  .site-header .brand { grid-column:1; grid-row:1; }
  .header-actions { grid-column:2; grid-row:1; }
  .site-header .primary-navigation { grid-column:1/-1; grid-row:2; display:flex; justify-content:space-between; gap:8px; margin:0; width:100%; }
  .site-header .primary-navigation>a { gap:4px; font-size:11px; }
  .header-sections { display:none; }
  .site-menu { display:block; }
  .site-header .brand { gap:7px; font-size:21px; }
  .site-header .brand img { width:34px; height:34px; }
  .header-actions { gap:4px; }
  .site-menu>summary { padding:9px 10px; }
  .site-menu-panel { left:0; right:0; width:100%; max-height:calc(100dvh - var(--header-height)); padding:20px; grid-template-columns:repeat(2,minmax(0,1fr)); gap:20px 12px; border-width:0 0 1px; }
  .menu-section:last-child { grid-column:auto; }
  .site-header .site-menu nav a { font-size:12px; }
}
@media(max-width:360px) {
  .site-header .brand { font-size:18px; gap:5px; letter-spacing:-.7px; }
  .site-header .brand img { width:29px; height:29px; }
  .site-menu>summary { padding:9px 8px; gap:5px; }
}
