/* ---------- The site header (Views/Shared/_Layout, site-header.js) ----------
   One slim line that stays at the top: the logo, the menus as plain words with thin sage
   lines between them and no arrows (a white tab under the pointer; their drop-downs open
   on hover; only a lone MORE on phones keeps its arrow), then search, chat, alerts,
   night mode, cart, the My Shelf name tab (book spines + first name) and, for staff, the Admin ☰.
   Under 1100px the menus move into the ☰ menu, which slides in from the right.
   The icon buttons keep site.css's header-action styles. Text uses the site font. */

.sh {
  --sh-royal: #2747b8;
  --sh-line: var(--bb-sage-200);
  --sh-ink: var(--bb-sage-900);
  --sh-muted: #59614f;
  --sh-surface: #fff;
  --sh-dust: #c4a35e;
  --sh-dust-2: #a8853f;
  /* The menus' soft green track and the white tab with the royal blue border. */
  --sh-track: var(--bb-sage-50);
  --sh-track-line: #e1e8d6;
  --sh-tab: #fff;
  --sh-tab-line: #4169e1;
  /* The thin lines between the menus (2026-11-28). */
  --sh-sep: var(--bb-sage-500);
  --sh-tab-ink: var(--bb-blue-700);
  position: sticky;
  top: 0;
  z-index: 1030;
  margin-bottom: 0.75rem;
  background: var(--sh-surface);
  box-shadow: 0 1px 0 var(--sh-line);
}

[data-blog-theme="dark"] .sh {
  --sh-royal: var(--blog-night-link);
  --sh-line: var(--blog-night-border);
  --sh-ink: var(--blog-night-heading);
  --sh-muted: var(--blog-night-muted);
  --sh-surface: var(--blog-night-surface);
  --sh-track: var(--blog-night-raised);
  --sh-track-line: var(--blog-night-border);
  --sh-tab: var(--blog-night-surface);
  --sh-tab-line: var(--blog-night-link);
  --sh-tab-ink: var(--blog-night-link);
  --sh-sep: var(--blog-night-border);
}

.sh-in {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 1400px;
  min-height: 60px;
  margin: 0 auto;
  padding: 0.35rem 12px;
}

.sh-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  text-decoration: none;
}

.sh-brand-img { height: 40px; width: auto; }
.sh-brand-icon { display: none; }

.sh-brand-text {
  font-family: var(--brand-font);
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  color: var(--brand-book);
}

.sh-brand-text span { color: var(--brand-swing); }

/* ---- Menus ---- */

.sh-nav {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
}

/* The menus are plain words on the bar with a thin sage line between them (no
   track, no arrows); the one under the pointer (or open) lifts into a white tab
   with a royal blue border. The soft green track this replaced (2026-11-28) is in
   bookswing_last_code_version. */
.sh-nav,
.sh-mnav {
  gap: 3px;
  padding: 3px 0;
}

.sh-nav { margin-left: 1rem; }

/* The lines: before every shown menu that has a shown menu before it (MORE and the
   menus moved into it are [hidden], so no line is left at either end). */
.sh-nav > :not([hidden]) ~ :not([hidden])::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 30%;
  bottom: 30%;
  width: 1px;
  background: var(--sh-sep);
  pointer-events: none;
}

/* No arrows beside the menus; a lone MORE (phones, a squeezed line) gets one back below. */
.sh-nav .sh-chev,
.sh-mnav .sh-chev { display: none; }

/* Wide screens (1400px and up) have room to spare: a little more space between the
   menus and after the logo. Under 1400px the tighter spacing below keeps them on
   one line (2026-11-28). */
@media (min-width: 1400px) {
  .sh-nav { gap: 5px; margin-left: 2rem; }
  .sh-nav > :not([hidden]) ~ :not([hidden])::before { left: -3px; }
  .sh-nav .sh-nl { padding-inline: 0.5rem; }
}

.sh-item { position: relative; }

.sh-nl {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.5rem 0.4rem;
  border: 0;
  border-radius: 9px;
  background: none;
  /* Capitals set the menu apart from the page's text; anything that no longer
     fits moves into More (site-header.js). Normal weight, not bold (2026-11-28). */
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--sh-ink);
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.sh-nl:hover,
.sh-nl:focus-visible,
.sh-item.is-open > .sh-nl {
  color: var(--sh-tab-ink);
  background: var(--sh-tab);
  outline: none;
  box-shadow: 0 1px 2px rgba(29, 34, 25, 0.12), inset 0 0 0 1px var(--sh-tab-line);
}

.sh-chev {
  width: 9px;
  height: 9px;
  opacity: 0.6;
  transition: transform 0.2s ease;
}

.sh-item.is-open .sh-chev,
[aria-expanded="true"] > .sh-chev { transform: rotate(180deg); }

/* A menu's drop-down: plain words, a grey line under each. */
.sh-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: -0.25rem;
  z-index: 5;
  display: none;
  width: 340px;
  padding: 6px;
  background: var(--sh-surface);
  border: 1px solid var(--sh-line);
  border-radius: 14px;
  box-shadow: 0 24px 48px -24px rgba(29, 34, 25, 0.45);
}

/* Keeps the pointer inside while it crosses the gap under the word. */
.sh-drop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}

.sh-item.is-open > .sh-drop { display: block; }

/* More: the menus that don't fit on the line (site-header.js moves them here). */
.sh-more > .sh-drop {
  left: auto;
  right: -0.25rem;
  max-height: min(70vh, 560px);
  overflow-y: auto;
}

.sh-more-sec:not([hidden]) ~ .sh-more-sec:not([hidden]) {
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--sh-line);
}

.sh-more-sec > .sh-grp-h { color: var(--sh-ink); font-size: 0.72rem; }

.sh-drop.is-wide {
  width: auto;
  display: none;
  grid-template-columns: max-content max-content;
  gap: 0 0.25rem;
}

.sh-drop.is-wide .sh-link { padding-right: 1.5rem; }

.sh-item.is-open > .sh-drop.is-wide { display: grid; }

.sh-grp + .sh-grp { margin-top: 0.25rem; }
.sh-drop.is-wide .sh-grp + .sh-grp { margin-top: 0; }

.sh-grp-h {
  margin: 0;
  padding: 0.55rem 0.75rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sh-royal);
}

.sh-link {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 9px;
  color: var(--sh-ink);
  text-decoration: none;
}

.sh-link:hover,
.sh-link:focus-visible { background: var(--bb-sage-50); color: var(--bb-blue-700); }
[data-blog-theme="dark"] .sh-link:hover { background: var(--blog-night-raised); }

.sh-link-t {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.sh-link small {
  display: block;
  font-size: 0.77rem;
  color: var(--sh-muted);
}

.sh-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 800;
  vertical-align: 2px;
  color: #fff;
  background: linear-gradient(135deg, var(--sh-dust), var(--sh-dust-2));
}

/* ---- Right side ---- */

.sh-acts {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

/* My Shelf: the book-spine mark and the first name on a white tab with a royal
   blue border; under the pointer (or open) the tab turns the track's soft green. */
.sh-acct {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  padding: 6px 10px 6px 8px;
  border: 0;
  border-radius: 10px;
  color: var(--sh-tab-ink);
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1;
  background: var(--sh-tab);
  box-shadow: 0 1px 2px rgba(29, 34, 25, 0.12), inset 0 0 0 1px var(--sh-tab-line);
  transition: background-color 0.15s ease;
}

.sh-acct:hover,
.sh-acct:focus-visible,
.sh-acct[aria-expanded="true"] { background: var(--sh-track); outline: none; }

/* Three book spines on a little shelf: blue, green and a gold one that stands
   straight and leans out under the pointer or while My Shelf is open. */
.sh-spines {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 19px;
  padding-bottom: 1px;
  border-bottom: 2px solid var(--sh-line);
  flex: none;
}

.sh-spines i { display: block; width: 4px; border-radius: 1.5px 1.5px 0 0; }
.sh-spines i:nth-child(1) { height: 16px; background: var(--bb-blue-700); }
.sh-spines i:nth-child(2) { height: 11px; background: #718a56; }
.sh-spines i:nth-child(3) {
  height: 14px;
  margin-left: 1px;
  background: var(--sh-dust);
  transform-origin: bottom left;
  transition: transform 0.2s ease;
}

.sh-acct:hover .sh-spines i:nth-child(3),
.sh-acct[aria-expanded="true"] .sh-spines i:nth-child(3) { transform: rotate(10deg); }

.sh-acct-name {
  max-width: 9ch;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sh-book { width: 20px; height: 20px; flex: none; }
.sh-acct .sh-chev { opacity: 0.6; }
.sh-acct-initial { display: none; }

.sh-signin {
  margin-left: 6px;
  padding: 6px 14px;
  border: 1.5px solid var(--bb-blue-700);
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--bb-blue-700);
  text-decoration: none;
  white-space: nowrap;
}

.sh-signin:hover { background: var(--bb-blue-700); color: #fff; }

.sh-burger {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: 6px;
  border: 1px solid var(--sh-line);
  border-radius: 10px;
  background: var(--sh-surface);
}

.sh-burger:hover,
.sh-burger[aria-expanded="true"] { border-color: var(--bb-blue-700); }

.sh-burger i {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--sh-ink);
  box-shadow: 0 5px 0 var(--sh-ink), 0 -5px 0 var(--sh-ink);
}

.sh-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dc2626;
  border: 2px solid var(--sh-surface);
}

.sh-narrow-only { display: none; }

/* The short menu for phones and small tablets (shown under 1100px). */
.sh-mnav { display: none; }

/* ---- Search, My Shelf and Admin: panels under the header, on the right ---- */

.sh-search,
.sh-panel {
  position: absolute;
  top: 100%;
  right: max(12px, calc((100% - 1400px) / 2 + 12px));
  z-index: 4;
  background: var(--sh-surface);
  border: 1px solid var(--sh-line);
  border-radius: 14px;
  box-shadow: 0 24px 48px -24px rgba(29, 34, 25, 0.45);
}

.sh-search {
  display: flex;
  gap: 6px;
  width: min(560px, calc(100% - 24px));
  margin-top: 6px;
  padding: 6px;
}

.sh-search[hidden] { display: none; }

.sh-search input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--sh-line);
  border-radius: 9px;
  background: transparent;
  color: var(--sh-ink);
}

.sh-search button {
  padding: 0 1rem;
  border: 0;
  border-radius: 9px;
  background: var(--bb-blue-700);
  color: #fff;
  font-weight: 700;
}

.sh-panel {
  display: none;
  width: min(1000px, calc(100% - 24px));
  margin-top: 6px;
  /* Never a sideways scrollbar: when the panel is taller than the window it
     scrolls as a whole, top to bottom. */
  max-height: calc(100vh - 80px);
  overflow-x: hidden;
  overflow-y: auto;
}

.sh-panel.is-open { display: block; }

.sh-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(90deg, #faf6ea, var(--sh-surface));
}

.sh-panel.is-admin .sh-panel-head { background: linear-gradient(90deg, #eef0f3, var(--sh-surface)); }
[data-blog-theme="dark"] .sh-panel-head { background: var(--blog-night-raised); }

.sh-panel-head strong {
  display: block;
  font-size: 1.02rem;
  color: var(--sh-ink);
}

.sh-panel-head span {
  font-size: 0.78rem;
  color: var(--sh-muted);
}

.sh-panel-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sh-panel-actions form { margin: 0; }

.sh-signout {
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--sh-line);
  border-radius: 8px;
  background: var(--sh-surface);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--bb-blue-700);
}

/* Cart, Chat and Sign out in My Shelf's head: an icon, the word, a red count. */
.sh-pa {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sh-pa svg { width: 17px; height: 17px; flex: none; }
.sh-pa:hover { background: var(--sh-track); border-color: var(--sh-tab-line); }

.sh-pa-n {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  font-size: 0.66rem;
  line-height: 1.3;
  text-align: center;
  color: #fff;
  background: #dc2626;
}

.sh-pa-n[hidden] { display: none; }
.sh-pa-n.is-cart { background: #2f7d4a; }

/* Cart and Chat are in My Shelf on every screen, so the header line keeps room
   for all the main menus. Books in the cart (green) and new chat messages (red)
   show as counts on the name; on phones one dust-gold dot says "something waiting". */
.sh-acts .sh-to-shelf { display: none; }
.sh-acct { position: relative; }
.sh-acct-signs {
  position: absolute;
  top: -10px;
  right: -10px;
  display: flex;
  gap: 3px;
  pointer-events: none;
}
.sh-acct-sign {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 19px;
  padding: 0 5px 0 4px;
  border: 2px solid var(--sh-surface);
  border-radius: 999px;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.sh-acct-sign svg { width: 11px; height: 11px; flex: none; }
.sh-acct-sign.is-cart { background: #2f7d4a; }
.sh-acct-sign.is-chat { background: #dc2626; }
/* chat.js hides the count when there's nothing new; the whole sign goes with it. */
.sh-acct-sign.is-chat:has([data-chat-badge][hidden]) { display: none; }
.sh-acct-dot {
  display: none;
  position: absolute;
  top: -5px;
  right: -5px;
  width: 13px;
  height: 13px;
  border: 2px solid var(--sh-surface);
  border-radius: 50%;
  background: #94742f;
  pointer-events: none;
}
@media (max-width: 767.98px) {
  .sh-acct-signs { display: none; }
  .sh-acct:has(.sh-acct-sign.is-cart, [data-chat-badge]:not([hidden])) .sh-acct-dot { display: block; }
}

.sh-panel-grid {
  /* Groups flow into balanced columns, so a short group fills the shortest column
     instead of starting a new row on its own. */
  columns: 4;
  column-gap: 1rem;
  padding: 0.15rem 0.75rem 0.85rem;
}

.sh-panel-grid.is-four { columns: 4; }

/* My Shelf: three columns in a narrower panel. Groups never split across columns,
   so four columns left the last one empty. */
.sh-panel:not(.is-admin) { width: min(780px, calc(100% - 24px)); }
.sh-panel:not(.is-admin) .sh-panel-grid { columns: 3; }

/* Admin: four fixed columns (the layout picks each column's groups). */
.sh-panel-grid.is-cols {
  columns: auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 1rem;
  align-items: start;
}

.sh-col .sh-grp + .sh-grp { margin-top: 0.35rem; }
.sh-panel-grid .sh-grp-h { padding-top: 0.6rem; }
.sh-panel-grid .sh-grp { break-inside: avoid; }
.sh-panel-grid .sh-grp + .sh-grp { margin-top: 0.35rem; }
.sh-panel-grid .sh-link { padding: 0.2rem 0.75rem; }
.sh-panel-grid .sh-link-t { font-weight: 500; font-size: 0.85rem; }

@media (max-width: 1219.98px) {
  .sh-panel-grid { columns: 3; }
  .sh-panel-grid.is-cols { columns: auto; }
}

/* ---- Between 1100 and 1400px (1366px laptops too): the logo's icon only, tighter menus ---- */

@media (max-width: 1399.98px) {
  .sh-brand-text { display: none !important; }
  .sh-brand-img { height: 34px; }
  .sh-in { gap: 0.4rem; }
  .sh-nl { padding-inline: 0.3rem; font-size: 0.76rem; letter-spacing: 0.04em; }
  .sh-acts .header-action-btn { padding-inline: 0.3rem; }
}

/* Small laptops: tighter menus (MORE takes any that don't fit). */
@media (max-width: 1219.98px) {
  .sh-nl { padding-inline: 0.24rem; font-size: 0.74rem; letter-spacing: 0.03em; }
  .sh-chev { display: none; }
}

/* ---- Under 1100px: the ☰ menu ---- */

@media (max-width: 1099.98px) {
  .sh-nav,
  .sh-wide-only { display: none !important; }
  .sh-narrow-only { display: grid; }
  .sh-brand-text { display: inline; font-size: 1.05rem; }
  .sh-in { min-height: 54px; padding-block: 0.3rem; }
  .sh-panel { display: none !important; }
  .sh-acct { padding: 6px 9px 6px 7px; gap: 6px; margin-left: 4px; }
  .sh-mnav { padding: 2px 0; }
  .sh-mnav .sh-nl { padding-block: 0.4rem; }
  .sh-acct .sh-chev { display: none; }
}

/* Under 1100px. Small tablets and an open Z Fold: as many main menus as fit on
   the line, and a MORE holding the rest (site-header.js; MORE hides when all fit).
   Phones: one MORE with Books, Blog and Community (the other menus are in the
   ☰ menu). When no menu fits beside it, site-header.js adds is-squeezed and MORE
   holds everything. Signed in, cart and chat are in My Shelf (on every screen). */
@media (max-width: 1099.98px) {
  .sh-mnav { display: flex; align-items: center; min-width: 0; margin-left: 1rem; }
  .sh-mnav.is-squeezed .sh-mitem { display: none; }
  /* MORE on its own (a squeezed line; phones below) keeps its arrow so it still
     reads as a menu, and always looks like an open tab (white, royal blue border).
     Next to other menus it has neither, like them. */
  .sh-mnav.is-squeezed .sh-mmore .sh-chev { display: inline; }
  .sh-mnav.is-squeezed .sh-mmore > .sh-nl {
    color: var(--sh-tab-ink);
    background: var(--sh-tab);
    box-shadow: 0 1px 2px rgba(29, 34, 25, 0.12), inset 0 0 0 1px var(--sh-tab-line);
  }
  /* The thin lines go on the words themselves (MORE is position: static so its
     drop-down can span the screen, which a line on MORE itself couldn't follow). */
  .sh-mnav:not(.is-squeezed) > :not([hidden]) ~ .sh-nl:not([hidden])::before,
  .sh-mnav:not(.is-squeezed) > :not([hidden]) ~ .sh-item:not([hidden]) > .sh-nl::before {
    content: "";
    position: absolute;
    left: -2px;
    top: 30%;
    bottom: 30%;
    width: 1px;
    background: var(--sh-sep);
    pointer-events: none;
  }
  /* The drop-downs open under the header, inside the screen. */
  .sh-mnav .sh-drop { max-height: calc(100vh - 90px); max-width: calc(100vw - 16px); overflow-y: auto; }
  .sh-mmore { position: static; }
  .sh-mmore > .sh-drop { top: calc(100% + 4px); }
  .sh-mmore .sh-link { padding: 0.4rem 0.75rem; }
  .sh-mmore .sh-link small { font-size: 0.74rem; line-height: 1.3; }
  .sh-mm-top .sh-link-t { font-weight: 700; }
  .sh-mmore .sh-more-sec > .sh-grp-h { color: var(--sh-royal); }
  /* MORE's sections: Books/Blog/Community (main) and the other menus (rest). */
  .sh-mmore .sh-more-sec { margin: 0 !important; padding: 0 !important; border: 0 !important; }
  /* Only the menus that aren't on the line show here (site-header.js hides the rest). */
  .sh-mm-main:not([hidden]) ~ .sh-mm-main:not([hidden]),
  .sh-mm-main:not([hidden]) + .sh-mm-rest:not([hidden]) {
    margin-top: 0.35rem !important;
    padding-top: 0.35rem !important;
    border-top: 1px solid var(--sh-line) !important;
  }
  /* Small tablets: MORE drops on the right, the menus in two columns. */
  .sh-mmore > .sh-drop {
    left: auto;
    right: 8px;
    width: min(560px, calc(100vw - 16px));
  }
  /* Two flowing columns: each menu sits straight under the one before it, so a
     short menu beside a long one leaves no empty gap (a grid row did). */
  .sh-mmore.is-open > .sh-drop { display: block; }
  .sh-mm-cols { columns: 2; column-gap: 0.5rem; }
  .sh-mmore .sh-more-sec { padding-bottom: 0.3rem !important; break-inside: avoid; }
  .sh-mm-main { column-span: all; }
}

/* Phones: one MORE (Books, Blog, Community) across the screen. It never shrinks;
   the logo picture scales down a little instead when the line is short. */
@media (max-width: 599.98px) {
  .sh-mnav .sh-mitem { display: none; }
  .sh-mm-main { display: block; }
  .sh-mm-rest { display: none; }
  .sh-mmore > .sh-drop { left: 8px; right: 8px; width: auto; }
  .sh-mmore.is-open > .sh-drop { display: block; }
  .sh-mm-cols { columns: auto; }
  .sh-mmore .sh-grp { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-mmore .sh-grp-h { grid-column: 1 / -1; }
  .sh-mm-main:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sh-in { gap: 0.35rem; }
  .sh-mnav, .sh-acts { flex: none; }
  .sh-brand { flex: 0 1 auto; min-width: 0; }
  .sh-brand-img { height: auto; max-height: 30px; max-width: 100%; }
  .sh-mnav { margin-left: 0.5rem; }
  .sh-mmore > .sh-nl { padding-inline: 0.25rem; font-size: 0.84rem; }
  /* Phones show MORE alone (site-header.js adds is-squeezed): arrow, open-tab look, no line. */
  .sh-mmore .sh-chev { display: inline; }
  .sh-mmore > .sh-nl::before { display: none; }
  .sh-acts .sh-burger { margin-left: 4px; }
}

/* The ☰ menu's Explore list is for phones only; tablets have those menus in MORE,
   so a signed-in member who isn't staff has no ☰ there. */
@media (min-width: 600px) {
  .sh-dr-rest { display: none; }
  .sh-burger.sh-phone-only { display: none !important; }
}

@media (max-width: 767.98px) {
  .sh-acct-name { display: none; }
  .sh-acct-initial { display: inline; font-size: 0.88rem; }
  .sh-book { width: 17px; height: 17px; }
  .sh-spines { height: 17px; }
  .sh-spines i:nth-child(1) { height: 14px; }
  .sh-spines i:nth-child(2) { height: 10px; }
  .sh-spines i:nth-child(3) { height: 12px; }
  .sh-signin { padding: 5px 10px; font-size: 0.8rem; }
  .sh-acts .header-action-btn { padding-inline: 0.3rem; }
}

@media (max-width: 399.98px) {
  .sh-brand-img { display: none; }
  .sh-brand-icon { display: block; width: 32px; height: 32px; }
}

@media (max-width: 419.98px) {
  .sh-brand-text { display: none; }
}

/* ---- The ☰ menu ---- */

.sh-dim {
  position: fixed;
  inset: 0;
  z-index: 1040;
  background: rgba(29, 34, 25, 0.35);
}

.sh-dim[hidden] { display: none; }

.sh-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1045;
  width: min(86vw, 360px);
  overflow: hidden;
  background: var(--blog-night-surface, #fff);
  box-shadow: -20px 0 40px -24px rgba(29, 34, 25, 0.45);
  animation: sh-in 0.25s cubic-bezier(0.3, 0.9, 0.3, 1);
}

.sh-drawer[hidden] { display: none; }

@keyframes sh-in { from { transform: translateX(100%); } to { transform: none; } }

.sh-dr-page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  padding: 0.75rem 1.1rem 1.5rem;
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0px));
}

.sh-dr-page[hidden] { display: none; }
.sh-dr-page.is-entering { animation: sh-in 0.22s ease; }
.sh-drawer.is-direct [data-sh-back] { visibility: hidden; }

.sh-dr-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sh-dr-top strong,
.sh-dr-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--blog-night-heading, var(--bb-sage-900));
}

.sh-dr-title { margin-bottom: 0.25rem; }

.sh-dr-x {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--blog-night-muted, #59614f);
}

.sh-dr-back {
  border: 0;
  background: none;
  padding: 0.3rem 0;
  font-weight: 700;
  color: var(--bb-blue-700);
}

.sh-dr-me {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-bottom: 0.5rem;
  padding: 0.75rem 0.9rem;
  border: 0;
  border-radius: 12px;
  text-align: left;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #c4a35e, #a8853f);
}

.sh-dr-me small {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  opacity: 0.85;
}

.sh-dr-me .sh-go { margin-left: auto; color: #fff; }

/* Admin in the ☰ menu: the same button as yours, in grey. */
.sh-dr-me.is-admin { background: linear-gradient(135deg, #6b7280, #4b5563); }

.sh-dr-guest {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.sh-dr-guest .btn { flex: 1; }

.sh-dr-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  width: 100%;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1px solid var(--blog-night-border, #eef0ea);
  background: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--blog-night-text, #1d2219);
  text-decoration: none;
}

.sh-dr-row small {
  flex-basis: 100%;
  order: 3;
  font-size: 0.75rem;
  color: var(--blog-night-muted, #59614f);
}

.sh-go {
  margin-left: auto;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--blog-night-muted, #59614f);
}

.sh-dr-h {
  margin: 1rem 0 0.1rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #2747b8;
}

[data-blog-theme="dark"] .sh-dr-h { color: var(--blog-night-link); }

.sh-drawer .sh-grp-h { padding-inline: 0; color: #2747b8; }
[data-blog-theme="dark"] .sh-drawer .sh-grp-h { color: var(--blog-night-link); }

.sh-drawer .sh-link {
  padding: 0.6rem 0;
  border-radius: 0;
  border-bottom: 1px solid var(--blog-night-border, #eef0ea);
  color: var(--blog-night-text, #1d2219);
}

.sh-drawer .sh-link:hover { background: none; }

/* Cart, Chat and Sign out at the top of My Shelf in the ☰ menu. */
.sh-dr-quick {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  gap: 8px;
  margin: 0.35rem 0 0.5rem;
}

.sh-dr-quick form { margin: 0; display: contents; }

.sh-dr-q {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0.6rem 0.25rem;
  border: 1px solid var(--blog-night-border, #e3e7dd);
  border-radius: 10px;
  background: var(--blog-night-surface, #fff);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--bb-blue-700);
  text-decoration: none;
  transition: background-color 0.12s ease, transform 0.12s ease;
}

.sh-dr-q svg { width: 22px; height: 22px; }

.sh-dr-qn {
  position: absolute;
  top: 5px;
  right: calc(50% - 24px);
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  font-size: 0.66rem;
  line-height: 1.3;
  color: #fff;
  background: #dc2626;
}

.sh-dr-qn[hidden] { display: none; }
.sh-dr-qn.is-cart { background: #2f7d4a; }

/* A tap shows at once (and stays while the next page loads), so it's clear the
   item was pressed. site-header.js adds is-tapped. */
.sh-drawer, .sh { --sh-tap: #e9eef9; }
[data-blog-theme="dark"] .sh-drawer,
[data-blog-theme="dark"] .sh { --sh-tap: var(--blog-night-raised); }

.sh-drawer a, .sh-drawer button, .sh-drop a, .sh-panel a { -webkit-tap-highlight-color: transparent; }

.sh-dr-row:active, .sh-dr-row.is-tapped,
.sh-drawer .sh-link:active, .sh-drawer .sh-link.is-tapped {
  background: var(--sh-tap);
  box-shadow: -1.1rem 0 0 var(--sh-tap), 1.1rem 0 0 var(--sh-tap);
  color: var(--bb-blue-700);
}

.sh-drop .sh-link:active, .sh-drop .sh-link.is-tapped,
.sh-panel .sh-link:active, .sh-panel .sh-link.is-tapped {
  background: var(--sh-tap);
  color: var(--bb-blue-700);
}

.sh-dr-q:active, .sh-dr-q.is-tapped { background: var(--sh-tap); transform: scale(0.97); }
.sh-dr-me:active, .sh-dr-me.is-tapped { filter: brightness(0.93); }
.sh-dr-back:active, .sh-dr-back.is-tapped { opacity: 0.6; }
.sh-nl:active { color: var(--bb-blue-700); }

html.sh-locked { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .sh-drawer, .sh-dr-page.is-entering { animation: none; }
  .sh-nl, .sh-acct, .sh-chev, .sh-spines i { transition: none; }
}
