/* The original Archive console uses an olive metal housing, an ivory BIG/WHITE
   nameplate with a red foot and inset black market keys. The housing scrolls
   with the document. Its surface and fasteners are static CSS paint. */
.bws-nav {
  --console-paper: #e7e6dc;
  --console-red: #ef283a;
  --console-type: "Courier New", Courier, monospace;
  --console-surface: linear-gradient(180deg, rgb(231 236 210 / .14), transparent 25%, rgb(0 0 0 / .29)), repeating-linear-gradient(91deg, rgb(245 246 224 / .025) 0 1px, transparent 1px 4px);
  position: relative;
  z-index: 8;
  color: var(--console-paper);
  border: 2px solid;
  border-color: #75796a #0d100b #0b0d09 #565b4b;
  background: var(--console-surface), #2b3023;
  box-shadow: inset 1px 1px #777c67, inset -1px -2px #171b13, 0 2px 0 #090b08;
  font: 600 15px/1.35 Arial, Helvetica, sans-serif;
}
.bws-nav::before, .bws-nav::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 5px;
  width: 8px;
  height: 8px;
  border: 1px solid #7a7e70;
  border-radius: 50%;
  background: linear-gradient(140deg, transparent 42%, #1a1d17 44% 54%, transparent 56%), radial-gradient(circle at 32% 27%, #dcdece, #7d8173 28%, #2b2e26 57%, #0d0f0c 78%);
  box-shadow: 0 0 0 2px #151812, 0 2px 2px #090b08;
  pointer-events: none;
}
.bws-nav::before { left: 5px; }
.bws-nav::after { right: 5px; }
.bws-nav *, .bws-nav *::before, .bws-nav *::after { box-sizing: border-box; }
.bws-nav a, .bws-nav button, .bws-nav summary, .bws-nav input, .bws-nav select { font: inherit; letter-spacing: normal; text-transform: none; }
.bws-nav a, .bws-nav summary { color: inherit; text-decoration: none; }
.bws-nav button { color: inherit; border: 0; cursor: pointer; }
.bws-nav [hidden] { display: none !important; }
.bws-nav :is(a, summary, button, input, select):focus-visible { outline: 2px solid #ff8c8e; outline-offset: 2px; }
.bws-nav__inner {
  position: relative; display: grid; grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand . tools" "search search search" "rail rail rail";
  align-items: center; column-gap: 8px; row-gap: 5px; max-width: 1440px; margin: 0 auto; padding: 8px 12px 0;
}
.bws-nav .bws-nav__brand {
  grid-area: brand; display: grid; place-items: center; width: 53px; height: 48px; color: #0d0e0b;
  border: 1px solid; border-color: #faf9ef #97998f #747669 #d8d9cb; border-bottom: 5px solid var(--console-red);
  background: linear-gradient(125deg, #fffef55c, transparent 36%), repeating-linear-gradient(0deg, #12140e08 0 1px, transparent 1px 4px), #e2e1d8;
  box-shadow: inset 1px 1px #fffef2a8, inset -1px -1px #80817470, 0 3px 0 #10120d;
}
.bws-nav__brand strong { display: block; font: 1000 15px/.94 "Arial Black", Arial, sans-serif; letter-spacing: -.045em; text-align: center; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.bws-nav__tools { grid-area: tools; display: flex; align-items: center; gap: 5px; }
.bws-nav__tools > a, .bws-nav__tools .cart-bubble__trigger, .bws-nav__more > summary {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  padding: 0 3px; color: var(--console-paper); font: 700 12px/1 var(--console-type); white-space: nowrap;
}
.bws-nav__tools .cart-bubble__trigger { position: relative; background: transparent; }
.bws-nav__tools .cart-bubble__count { font: 700 12px/1 var(--console-type); }
.bws-nav__more > summary {
  gap: 5px; padding-inline: 7px; min-height: 44px; text-transform: uppercase; color: #1b1f16;
  background: linear-gradient(155deg,#efeee3,#c3c5b6); border: 1px solid #a0a490; border-top-color: #f6f4e6; border-bottom: 3px solid #ba2432;
  box-shadow: inset 1px 1px #fffdf299, 0 2px 0 #0d100a;
}
.bws-nav__tools svg { width: 17px; height: 17px; }
.bws-nav summary { list-style: none; cursor: pointer; }
.bws-nav summary::-webkit-details-marker { display: none; }
.bws-nav__search-group { grid-area: search; min-width: 0; }
.bws-nav__search-toggle { display: none; }
.bws-nav__search {
  display: flex; align-items: stretch; min-width: 0; width: 100%; margin: 0;
  background: #0c0e0a; border: 2px solid; border-color: #11130e #727768 #858978 #12150f; padding: 2px;
}
.bws-nav__field { display: flex; align-items: center; min-width: 0; flex: 1; background: linear-gradient(180deg,#d7d6c9,#eeede4 22%,#e3e2d9); color: #171913; }
.bws-nav__field input, .bws-nav__index input {
  appearance: none; flex: 1; min-width: 0; width: 100%; height: 44px; margin: 0; padding: 0 0 0 9px;
  border: 0; border-radius: 0; outline: 0; background: transparent; color: #171913; box-shadow: none;
  font: 500 15px/1.2 var(--console-type);
}
.bws-nav__field input::placeholder, .bws-nav__index input::placeholder { color: #595d53; opacity: 1; }
.bws-nav__field:focus-within { outline: 2px solid #ff8c8e; outline-offset: 0; }
.bws-nav__field input:focus-visible { outline: 0; }
.bws-nav .bws-nav__go {
  display: grid; place-items: center; width: 44px; min-height: 44px; padding: 0; flex-shrink: 0;
  background: linear-gradient(#373b30,#141810); border: 1px solid #555a4b; border-bottom-color: #10130d; color: #f5f4e9;
}
.bws-nav__go svg { width: 18px; height: 18px; }
.bws-nav__scope { display: flex; align-items: stretch; order: -1; margin-right: 2px; }
.bws-nav__scope-label { display: none; }
.bws-nav__scope button {
  position: relative; min-width: 44px; min-height: 44px; padding: 0 7px; white-space: nowrap; text-transform: uppercase;
  background: linear-gradient(#373b30,#1c2017); border: 1px solid #565b4c; border-bottom-color: #12150e;
  color: #e2e1d4; font: 700 12px/1 var(--console-type);
}
.bws-nav__scope button[aria-pressed="true"] { background: #0d100b; border-color: #20251c; box-shadow: inset 0 -3px var(--console-red); color: #fff9ed; }
.bws-nav__rail {
  grid-area: rail; display: flex; align-items: stretch; justify-content: space-between; gap: 3px;
  border-top: 1px solid #141810; box-shadow: inset 0 1px #83897660;
}
.bws-nav__rail > a, .bws-nav__brands > summary {
  display: inline-flex; gap: 4px; align-items: center; justify-content: center; min-height: 44px;
  white-space: nowrap; font: 700 12px/1.2 var(--console-type); text-transform: uppercase; color: #f3f1e5;
}
.bws-nav__rail > a[aria-current="page"] { box-shadow: inset 0 -2px var(--console-red); }
.bws-nav__brands > summary::after { content: "+"; font: 700 13px/1 var(--console-type); }
.bws-nav__brands[open] > summary::after { content: "−"; }
.bws-nav__rail > a:hover, .bws-nav__rail summary:hover, .bws-nav__tools > a:hover { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.bws-nav .bws-nav__long, .bws-nav .bws-nav__journal { display: none; }
.bws-nav__popover { position: absolute; z-index: 11; left: 0; right: 0; top: 100%; overflow: auto; overscroll-behavior: contain; max-height: min(68vh, 650px); max-height: min(68dvh, 650px); padding: 20px; border: 2px solid #3f4438; border-top: 4px solid #a11f2b; box-shadow: 0 5px 0 #090b08, inset 1px 1px #fffdef; color: #20221f; background: #e8e7de; text-align: start; }
.bws-nav__store { top: 58px; left: auto; right: 12px; width: min(325px, calc(100% - 24px)); padding: 9px 16px 16px; }
.bws-nav__store > a { display: block; padding: 11px 0; border-bottom: 1px solid #d8d8ce; }
.bws-nav__store a:hover, .bws-nav__brand-panel a:hover { color: #9a2c25; text-decoration: underline; text-underline-offset: 3px; }
.bws-nav__notices { margin-block: 14px; font-size: 13px; }
.bws-nav__notices > a, .bws-nav__notices a[href] { text-decoration: underline; text-underline-offset: 3px; }
.bws-nav__notices ul { margin: 6px 0 0; padding-inline-start: 17px; list-style: disc; }
.bws-nav__notices li { margin: 5px 0; }
.bws-nav__store form { margin: 12px 0 0; }
.bws-nav__store label { display: grid; gap: 4px; margin: 8px 0; font-size: 13px; }
.bws-nav__store :is(select, button), .bws-nav__brand-scope select { max-width: 100%; width: 100%; padding: 7px; border: 1px solid #aaa99f; background: #fffdf7; color: #222420; }
.bws-nav__store button { margin-top: 4px; font-weight: 700; }
.bws-nav__brand-panel { display: grid; grid-template-columns: minmax(0,1fr); gap: 16px; }
.bws-nav .bws-nav__close { position: absolute; top: 5px; right: 8px; display: grid; place-items: center; width: 40px; height: 40px; color: #373934; font-size: 24px; }
.bws-nav__caption { display: block; margin: 0 0 9px; color: #4c5145; font: 700 12px/1.4 "Courier New", monospace; text-transform: uppercase; letter-spacing: .04em; }
.bws-nav__makers { align-self: start; padding-right: 25px; }
.bws-nav__makers a { display: inline-flex; margin: 0 12px 0 0; min-height: 44px; align-items: center; color: #242621; font-size: 15px; font-weight: 700; }
.bws-nav__index input { border: 1px solid #a8aa9e; padding: 0 10px; margin: 0 0 6px; background: #fffefa; }
.bws-nav__brand-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-content: start; max-height: 230px; max-height: min(30dvh, 262px); overflow-y: auto; overscroll-behavior: contain; }
.bws-nav__brand-list a { display: flex; align-items: center; min-height: 44px; padding: 3px 4px; border-bottom: 1px solid #d8d8ce; font-size: 14px; }
.bws-nav__no-brand { margin: 12px 0; }
.bws-nav__brand-scope { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; }
.bws-nav__brand-scope select { width: auto; min-height: 36px; }
.bws-nav__rail-slot { grid-area: rail; }

/* The directory lives in the native menu on small screens and also works
   there before the desktop enhancement moves it into the visible rail. */
.bws-nav__store .bws-nav__rail {
  display: grid; gap: 0; justify-content: stretch;
  border-top: 0; border-bottom: 1px solid #adaf9e; box-shadow: none;
}
.bws-nav__store .bws-nav__rail > a,
.bws-nav__store .bws-nav__brands > summary {
  display: flex; justify-content: flex-start; width: 100%; min-height: 44px;
  color: #22251e; border-bottom: 1px solid #cdcec1;
  font: 700 15px/1.3 var(--console-type); text-transform: none;
}
.bws-nav__store .bws-nav__rail > a[aria-current="page"] { box-shadow: none; color: #87251f; }
.bws-nav__store .bws-nav__brands > summary { justify-content: space-between; }
.bws-nav__store .bws-nav__brand-panel {
  position: relative; inset: auto; display: grid; grid-template-columns: minmax(0,1fr);
  width: auto; max-height: none; overflow: visible; padding: 12px 8px;
  border: 0; border-block: 1px solid #9b9e8e; box-shadow: none; background: #dedfd2;
}
.bws-nav__store .bws-nav__makers a { display: inline-flex; }
.bws-nav__store .bws-nav__brand-list { grid-template-columns: repeat(2, minmax(0,1fr)); }
.bws-nav__store .bws-nav__rail .bws-nav__journal { display: none; }

@media not all and (min-width: 960px) {
  .bws-nav__inner {
    grid-template: "brand search tools" auto / auto minmax(0,1fr) auto;
    gap: 6px; padding: 5px 12px;
  }
  .bws-nav .bws-nav__brand { width: 46px; height: 44px; }
  .bws-nav__brand strong { font-size: 13px; }
  .bws-nav__tools { gap: 2px; }
  .bws-nav__tools > .bws-nav__account, .bws-nav__rail-slot { display: none; }
  .bws-nav__search-group { justify-self: end; }
  .bws-nav__search-toggle { display: block; }
  .bws-nav__search-toggle > summary {
    display: grid; place-items: center; width: 44px; min-height: 44px;
    color: var(--console-paper);
  }
  .bws-nav__search-toggle svg { display: block; width: 25px; height: 25px; }
  .bws-nav__search-toggle svg:last-child { width: 19px; height: 19px; }
  .bws-nav__search-toggle:not([open]) svg:last-child,
  .bws-nav__search-toggle[open] svg:first-child { display: none; }
  .bws-nav__search {
    position: absolute; z-index: 11; inset: 100% 0 auto; display: none;
    flex-direction: column; gap: 4px; padding: 8px 12px;
    background: #292e22; border: 1px solid #171b13; border-top: 2px solid #a11f2b;
    box-shadow: 0 3px 0 #1117;
  }
  /* Keep an active desktop field focusable through the breakpoint change. */
  .bws-nav__search-toggle[open] + .bws-nav__search,
  .bws-nav__search-group[data-inline-search] .bws-nav__search:focus-within { display: flex; }
  .bws-nav__search .bws-nav__field { flex: auto; }
  .bws-nav__search .bws-nav__field input { padding-inline-start: 7px; font-size: 16px; }
  .bws-nav__scope {
    order: 0; gap: 3px; align-items: center; margin: 0;
  }
  .bws-nav__scope-label { display: block; margin-inline-end: 5px; white-space: nowrap; font: 700 12px/1.2 var(--console-type); }
  .bws-nav__store {
    top: 100%; inset-inline: auto 0; width: min(360px, calc(100% - 48px));
    max-height: min(70vh, 600px); max-height: min(70dvh, 600px);
  }
  .bws-nav__store .bws-nav__index input { font-size: 16px; }
}

@media (max-width: 359px) {
  .bws-nav__inner { padding-inline: 9px; }
  .bws-nav__more > summary span { display: none; }
  .bws-nav__field input { padding-left: 6px; font-size: 13px; }
  .bws-nav__scope button { padding-inline: 4px; }
  .bws-nav__rail > a, .bws-nav__brands > summary { font-size: 11px; }
}
@media (min-width: 600px) {
  .bws-nav__inner { padding-inline: 22px; }
  .bws-nav__rail { justify-content: flex-start; gap: 26px; }
  .bws-nav .bws-nav__journal { display: inline-flex; }
  .bws-nav__brand-panel { grid-template-columns: minmax(160px,.7fr) minmax(250px,1.6fr); padding: 24px 36px 24px 24px; }
}
@media (min-width: 960px) {
  .bws-nav__rail-slot { min-height: 43px; }
  .bws-nav { border-width: 4px; }
  .bws-nav::before, .bws-nav::after { top: 9px; width: 12px; height: 12px; }
  .bws-nav::before { left: 9px; }
  .bws-nav::after { right: 9px; }
  .bws-nav__inner {
    padding: 9px clamp(32px,3.2vw,55px) 0; grid-template-columns: auto minmax(240px,1fr) auto;
    grid-template-areas: "brand search tools" "rail rail rail"; column-gap: 16px; row-gap: 8px;
  }
  .bws-nav .bws-nav__brand { width: 65px; height: 53px; border-bottom-width: 6px; }
  .bws-nav__brand strong { font-size: 18px; }
  .bws-nav__tools { justify-self: end; gap: 7px; }
  .bws-nav__tools > a, .bws-nav__tools .cart-bubble__trigger { padding-inline: 10px; text-transform: uppercase; background: linear-gradient(#3c4033,#20251a); border: 1px solid #5f6554; border-bottom: 2px solid #12150e; }
  .bws-nav__scope button { min-width: 64px; padding-inline: 12px; }
  .bws-nav__field input { padding-left: 17px; font-size: 16px; }
  .bws-nav__rail { gap: clamp(20px,2.5vw,38px); }
  .bws-nav__rail > a, .bws-nav__brands > summary { min-height: 42px; font-size: 14px; }
  .bws-nav .bws-nav__long { display: inline; }
  .bws-nav .bws-nav__short { display: none; }
  .bws-nav__store { right: clamp(32px,3.2vw,55px); top: 64px; }
  .bws-nav__brand-panel { left: clamp(32px,3.2vw,55px); right: auto; width: min(740px,88%); }
  .bws-nav__makers a { display: flex; }
  .bws-nav__brand-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
