/* Compact wordmarks on the header surface, with real text if art does not load. */
body>header {height:60px;}
body>header .brand-mark {width:34px;height:34px;}
body>header #nav {
 display:flex;align-items:center;justify-content:center;flex:0 1 auto;
 gap:clamp(6px,.87vw,13px);height:auto;min-width:0;
}
body>header #nav .quick-nav-row { display:contents; }
body>header #nav .nav-tile,body>header #nav #settings.nav-tile {
 display:grid;place-items:center;position:relative;
 min-width:44px;min-height:44px;height:44px;width:auto;
 padding:0 clamp(4px,.46vw,7px);
 border:0;border-radius:7px;background:transparent;
 color:var(--chrome-text);font-size:.84rem;font-weight:750;line-height:1.15;
 box-shadow:none;white-space:normal;
}
body>header #nav .nav-tile img {
 width:auto;height:clamp(13px,1.31vw,19px);max-width:100%;
 display:block;object-fit:contain;opacity:.86;pointer-events:none;
 transition:transform 150ms ease,opacity 150ms ease;
}
body>header #nav .nav-tile:has(img:not([hidden])) .nav-label {display:none;}
body>header #nav .nav-tile:is(:hover,:focus-visible,[aria-current=page]) img {opacity:1;}
body>header #nav .nav-tile[aria-current=page] {
 color:var(--chrome-primary);
}
body>header #nav .nav-tile[aria-current=page]::after {
 inset:auto 24% 4px;height:2px;border-radius:100%;
 background:var(--chrome-primary);pointer-events:none;
}
body>header #nav .nav-tile:focus-visible {outline:2px solid var(--chrome-primary);outline-offset:1px;}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
 body>header #nav .nav-tile:hover img {transform:translateY(-1px) scale(1.055);}
}
@media (max-width:860px) {
 body>header {flex-wrap:wrap;height:auto;padding-block:4px;gap:2px 12px;}
 body>header #nav {
  width:100%;order:3;flex:1 0 100%;gap:3px 6px;flex-wrap:wrap;justify-content:start;
 }
}
@media (max-width:575px) {
 body>header #nav {display:grid;grid-template-columns:minmax(0,1fr);row-gap:0;}
 body>header #nav .quick-nav-row {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;}
 body>header #nav .quick-nav-row:last-child {grid-template-columns:minmax(0,1.15fr) minmax(0,.95fr) minmax(0,.9fr);}
 body>header #nav .nav-tile,body>header #nav #settings.nav-tile {padding-inline:3px;min-width:0;}
 body>header #nav .nav-tile img {height:17px;}
 body>header #nav .nav-tile {font-size:.76rem;}
 body>header .brand-mark {width:30px;height:30px;}
}
@media (prefers-reduced-motion:reduce) {
 body>header #nav .nav-tile img {transition:none;}
}
@media (forced-colors:active) {
 body>header #nav .nav-tile img {display:none;}
 body>header #nav .nav-tile:has(img:not([hidden])) .nav-label {display:inline;}
 body>header #nav .nav-tile[aria-current=page] {outline:2px solid Highlight;}
}
/* The mark stays anchored; the shortcut group begins next to it. */
body>header {
 justify-content:flex-start;
 column-gap:clamp(15px,2vw,27px);
}
body>header .brand {
 gap:8px;flex-shrink:0;
}
body>header .brand-wordmark {
 display:block;width:auto;height:clamp(25px,2.25vw,32px);max-width:122px;object-fit:contain;object-position:left center;
}
body>header .brand:has(.brand-wordmark:not([hidden])) .brand-fallback {display:none;}
body>header #nav {justify-content:start;}
@media (max-width:575px) {
 body>header .brand-wordmark {height:28px;max-width:106px;}
}
@media (forced-colors:active) {
 body>header .brand-wordmark {display:none;}
 body>header .brand:has(.brand-wordmark:not([hidden])) .brand-fallback {display:inline;}
}
@media (width > 860px) {
 body>header {justify-content:center;}
}

/* Center the compact header on the same axis as the page below it. */
@media (max-width:860px) {
 body>header,body>header #nav {justify-content:center;}
}
@media (max-width:575px) {
 body>header #nav .quick-nav-row:last-child {
  grid-template-columns:repeat(2,minmax(0,1fr));
  justify-self:center;
  width:calc((100% - 4px) * 2 / 3);
 }
}

/* Keep shortcuts available without covering the next keyboard focus target. */
body>header:not([hidden]) {
 position:sticky;
 inset-block-start:0;
 z-index:12;
}
html:has(body>header:not([hidden])) {scroll-padding-block-start:68px;}
@media (max-width:860px) {
 html:has(body>header:not([hidden])) {scroll-padding-block-start:100px;}
}
@media (max-width:575px) {
 html:has(body>header:not([hidden])) {scroll-padding-block-start:142px;}
}
