/* Global search — centred in the nav on every page. */
/* `margin:0 auto` only centres in the space LEFT OVER, and the nav's right
   flank (5 links + the theme toggle, ~530px) is far wider than its left one
   (logo + Browse, ~300px), so that put the box 130px left of the page's
   midline. Instead the flanks are wrapped in two side groups at runtime and
   the nav becomes a 1fr auto 1fr grid: equal side tracks put the middle child
   on the true centre line whatever they hold. Grid, not flex:1 1 0 — a 1fr
   track's floor is its own content, so a flank that no longer fits widens its
   track and squeezes the box instead of overlapping it.

   True centring needs 2 x (widest flank) + box + padding to fit the window.
   With all five links that is 1540px, so below the breakpoints here the links
   the mega-menu and this box already cover step out of the way:
     [data-p=2] Categories — the Browse panel next to the logo IS this
     [data-p=1] Topics / Issues / Authors — in-page anchors, also in the footer
     [data-p=0] Subscribe — the CTA, never hidden */
nav{display:grid!important;grid-template-columns:1fr minmax(0,380px) 1fr;
  align-items:center;}
nav > .nav-side{display:flex;align-items:center;min-width:0;}
nav > .nav-side.l{justify-content:flex-start;gap:4px;}
nav > .nav-side.r{justify-content:flex-end;gap:20px;}
nav > .nav-side.l > .nav-logo{white-space:nowrap;}
/* minmax(0,380px), not auto: an `auto` middle track holds its 380px and the
   squeeze lands on the side tracks instead, which wrapped the logo onto two
   lines at 1024px. This way the box gives way and the flanks keep their size. */
.gs-wrap{position:relative;width:100%;min-width:0;}
@media (max-width:1540px){nav .nav-links li[data-p="2"]{display:none;}
  nav .nav-links{gap:26px;}}
@media (max-width:1270px){nav .nav-links li[data-p="1"]{display:none;}}
/* Below 900 the box and the links are both gone and the side tracks are wildly
   uneven, so equal 1fr tracks only push the logo around. Back to a plain row. */
@media (max-width:900px){nav{display:flex!important;}
  nav > .nav-side{flex:0 0 auto;} nav > .nav-side.r{margin-left:auto;}}
.gs-in{display:flex;align-items:center;gap:8px;background:rgba(128,128,128,.12);
  border:1px solid rgba(128,128,128,.28);border-radius:4px;padding:0 10px;
  transition:border-color .18s,background .18s;}
.gs-in:focus-within{border-color:#e53935;background:rgba(128,128,128,.06);}
.gs-in svg{width:14px;height:14px;flex-shrink:0;stroke:currentColor;fill:none;stroke-width:2;
  opacity:.5;}
.gs-in input{flex:1;min-width:0;background:none;border:0;outline:none;color:inherit;
  font-family:'DM Mono',monospace;font-size:11.5px;letter-spacing:.4px;padding:9px 0;
  -webkit-appearance:none;appearance:none;}
.gs-in input::placeholder{opacity:.45;}
.gs-k{font-family:'DM Mono',monospace;font-size:9px;letter-spacing:1px;opacity:.4;
  border:1px solid currentColor;border-radius:3px;padding:1px 5px;flex-shrink:0;}

.gs-pop{position:fixed;z-index:999;display:none;background:#16181d;
  border:1px solid rgba(255,255,255,.1);box-shadow:0 30px 80px rgba(0,0,0,.5);
  max-height:min(70vh,560px);overflow-y:auto;scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.25) transparent;}
.gs-pop.on{display:block;}
.gs-pop::-webkit-scrollbar{width:8px;}
.gs-pop::-webkit-scrollbar-thumb{background:rgba(255,255,255,.22);border-radius:4px;}
.gs-head{padding:10px 16px;font-family:'DM Mono',monospace;font-size:9px;letter-spacing:2px;
  text-transform:uppercase;color:rgba(255,255,255,.35);
  border-bottom:1px solid rgba(255,255,255,.07);position:sticky;top:0;background:#16181d;}
.gs-r{display:flex;align-items:center;gap:11px;padding:9px 16px;text-decoration:none;
  border-left:2px solid transparent;}
.gs-r:hover,.gs-r.sel{background:rgba(255,255,255,.06);border-left-color:#e53935;}
.gs-t{font-family:'DM Mono',monospace;font-size:8px;letter-spacing:1px;text-transform:uppercase;
  padding:2px 6px;border-radius:3px;flex-shrink:0;width:66px;text-align:center;}
.gs-t.k0{background:rgba(0,194,212,.18);color:#4dd6e4;}
.gs-t.k1{background:rgba(132,204,22,.16);color:#a7e137;}
.gs-t.k2{background:rgba(229,57,53,.18);color:#f07570;}
.gs-t.k3{background:rgba(245,158,11,.16);color:#f5b544;}
.gs-n{flex:1;min-width:0;}
.gs-n b{display:block;font-size:13px;font-weight:500;color:rgba(255,255,255,.9);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.gs-n span{display:block;font-family:'DM Mono',monospace;font-size:8.5px;letter-spacing:.8px;
  text-transform:uppercase;color:rgba(255,255,255,.35);margin-top:2px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.gs-n mark{background:rgba(245,158,11,.35);color:#fff;padding:0 1px;border-radius:2px;}
.gs-none{padding:26px 16px;text-align:center;font-family:'DM Mono',monospace;font-size:10px;
  letter-spacing:1.4px;text-transform:uppercase;color:rgba(255,255,255,.35);}
@media(max-width:900px){.gs-wrap{display:none;}}
