/*
  Gallery components (DESIGN-C.md §2). Pages built on the Gallery templates load tokens.css and this file,
  never core.css. Covers lead; hairlines, not cards; shadows on covers only; sentence case, no all-caps,
  no pills; every control at least 44px. Motion is a 3px cover lift and a menu fade, both off under
  prefers-reduced-motion.
*/

/* ==== Base ======================================================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 var(--fs-body) / 1.55 var(--sans);
  font-feature-settings: 'kern', 'liga';
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

@media (hover: hover) {
  a:hover {
    color: var(--accent);
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h3 {
  letter-spacing: -0.01em;
}

p {
  margin: 0;
}

/* Only real faces: no faux bold or italic when a weight or style has no file (Juno on #558). A cited title sets
   upright, since Public Sans ships no italic here. */
html {
  font-synthesis: none;
}

cite {
  font-style: normal;
}

[hidden] {
  display: none !important;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: var(--gut);
  top: -100px;
  z-index: 20;
  padding: var(--s2) var(--s3);
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--r-control);
  font-weight: 600;
}

.skip:focus {
  top: var(--s2);
}

.w {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.sec {
  margin-top: var(--sec);
}

.sec-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.sec-h h2 {
  font-size: var(--fs-h2);
}

.lnk {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

@media (hover: hover) {
  .lnk:hover {
    text-decoration-color: currentColor;
  }
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s2);
  margin: calc(-1 * var(--s2)) 0 0;
  font-size: var(--fs-small);
  color: var(--soft);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
}

.crumbs a + a::before,
.crumbs a + span::before {
  content: '/';
  margin-right: var(--s2);
  color: var(--faint);
}

.note {
  margin-top: var(--s2);
  font-size: var(--fs-small);
  color: var(--faint);
}

/* ==== Buttons ==================================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s1);
  min-height: var(--tap);
  padding: 0 18px;
  border: 1px solid var(--fill);
  border-radius: var(--r-control);
  background: var(--fill);
  color: var(--on-fill);
  font: 600 15px / 1 var(--sans);
  cursor: pointer;
}

@media (hover: hover) {
  .btn:hover {
    color: var(--on-fill);
    filter: brightness(1.08);
  }
}

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}

@media (hover: hover) {
  .btn.ghost:hover {
    border-color: var(--ink);
    filter: none;
  }
}

.btn svg {
  flex: none;
}

.btn[aria-pressed='true'] svg,
.btn.is-saved svg {
  fill: currentColor;
}

.acts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin-top: var(--s4);
}

/* ==== Header ===================================================================================== */

.hd {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--band);
  color: var(--band-soft);
}

.hd-in {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: var(--maxw);
  height: 64px;
  margin: 0 auto;
  padding: 0 var(--gut);
}

.brand {
  font: 500 21px / 1 var(--display);
  letter-spacing: -0.01em;
  color: var(--band-ink);
}

@media (hover: hover) {
  .brand:hover {
    color: var(--band-ink);
  }
}

.hd-nav {
  display: flex;
  gap: var(--s4);
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hd-nav > li {
  position: relative;
  display: flex;
}

.hd-menu {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  padding: 0;
  border: 0;
  border-bottom: 2px solid transparent;
  border-top: 2px solid transparent;
  background: none;
  color: inherit;
  font: 600 15px / 1 var(--sans);
  cursor: pointer;
}

.hd-menu svg {
  opacity: 0.7;
}

.hd-menu[aria-expanded='true'] {
  color: var(--band-ink);
}
@media (hover: hover) {
  .hd-menu:hover {
    color: var(--band-ink);
  }
}

.hd-menu[aria-current] {
  color: var(--band-ink);
  border-bottom-color: var(--band-accent);
}

.hd-panel {
  position: absolute;
  top: 100%;
  left: calc(var(--s3) * -1);
  min-width: 260px;
  margin: 0;
  padding: var(--s2);
  list-style: none;
  background: var(--page);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 18px 40px -18px rgba(15, 27, 61, 0.45);
}

.hd-panel[hidden] {
  display: none;
}

.hd-panel.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 520px;
}

.hd-panel a {
  display: block;
  min-height: var(--tap);
  padding: var(--s2) var(--s3);
  border-radius: var(--r-control);
  font-weight: 600;
  font-size: 15px;
}

.hd-panel a:focus-visible {
  background: var(--sunk);
  color: var(--ink);
}
@media (hover: hover) {
  .hd-panel a:hover {
    background: var(--sunk);
    color: var(--ink);
  }
}

.hd-panel small {
  display: block;
  margin-top: 2px;
  font-weight: 400;
  font-size: var(--fs-meta);
  color: var(--faint);
}

.hd-search {
  position: relative;
  margin-left: auto;
}

.hd-field {
  display: flex;
  align-items: center;
  gap: var(--s1);
  width: 300px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--band-line);
  border-radius: var(--r-control);
  background: var(--band-field);
  color: var(--band-soft);
}

.hd-field:focus-within {
  border-color: var(--band-accent);
}

.hd-field input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--band-ink);
  font: 15px var(--sans);
}

.hd-field input::placeholder {
  color: var(--band-soft);
}

.hd-suggest {
  position: absolute;
  top: calc(100% + var(--s1));
  right: 0;
  width: 360px;
  margin: 0;
  padding: var(--s1);
  list-style: none;
  background: var(--page);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: 0 18px 40px -18px rgba(15, 27, 61, 0.45);
}

.hd-suggest[hidden] {
  display: none;
}

.hd-suggest a {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--s2);
  align-items: center;
  min-height: var(--tap);
  padding: var(--s1) var(--s2);
  border-radius: var(--r-control);
  font-weight: 600;
  font-size: var(--fs-small);
}

.hd-suggest a[aria-selected='true'] {
  background: var(--sunk);
  color: var(--ink);
}
@media (hover: hover) {
  .hd-suggest a:hover {
    background: var(--sunk);
    color: var(--ink);
  }
}

.hd-suggest .cov {
  width: 32px;
}

.hd-suggest small {
  display: block;
  font-weight: 400;
  color: var(--faint);
}

.hd-suggest .none {
  padding: var(--s2);
  font-size: var(--fs-small);
  color: var(--soft);
}

.hd-app {
  font-weight: 600;
  font-size: 15px;
  color: var(--band-accent);
  white-space: nowrap;
}

@media (hover: hover) {
  .hd-app:hover {
    color: var(--band-ink);
  }
}

.hd-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--band-ink);
  cursor: pointer;
}

/* The phone menu: a full-height sheet with the four groups, Subjects open first. */
.hd-sheet {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--page);
  color: var(--ink);
}

.hd-sheet::backdrop {
  background: rgba(15, 27, 61, 0.5);
}

.sheet-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  padding: 0 var(--s1) 0 var(--gut);
  background: var(--band);
  color: var(--band-ink);
}

.sheet-b {
  padding: var(--s2) var(--gut) var(--s5);
}

.sheet-b details {
  border-bottom: 1px solid var(--line);
}

.sheet-b summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  padding: var(--s1) 0;
  font: 500 var(--fs-h3) / 1.2 var(--display);
  cursor: pointer;
  list-style: none;
}

.sheet-b summary::-webkit-details-marker {
  display: none;
}

.sheet-b .chev {
  flex: none;
  color: var(--soft);
}

.sheet-b details[open] > summary .chev {
  transform: rotate(180deg);
}

.sheet-b details ul {
  margin: 0 0 var(--s3);
  padding: 0;
  list-style: none;
}

.sheet-b details a {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  font-weight: 600;
  font-size: 15px;
}

@media (max-width: 899px) {
  .hd-in {
    gap: 0;
    height: 56px;
  }

  .hd-nav,
  .hd-field,
  .hd-app {
    display: none;
  }

  .hd-icon {
    display: inline-flex;
  }

  /* Sign in, or My books once signed in, stays on a phone (Atlas); Account and Sign out are in the menu. */
  .hd-app.hd-keep {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 var(--s2);
  }

  .hd-search {
    margin-left: auto;
    position: static;
  }

  /* Above the brand link (position: relative), so the brand never shows through or takes a tap (Vera, #189). */
  .hd.searching .hd-field {
    position: absolute;
    z-index: 2;
    left: var(--s2);
    right: var(--s2);
    top: 8px;
    display: flex;
    width: auto;
    background: var(--band);
  }

  .hd-suggest {
    left: var(--s2);
    right: var(--s2);
    top: 56px;
    width: auto;
  }
}

/* ==== Hero search field ========================================================================== */

.big-s {
  display: flex;
  align-items: center;
  gap: var(--s2);
  max-width: 520px;
  height: 52px;
  margin-top: var(--s4);
  padding: 0 var(--s3);
  border-radius: var(--r-control);
  background: #ffffff;
  color: #62677a;
}

.big-s:focus-within {
  outline: 2px solid var(--band-accent);
  outline-offset: 2px;
}

.big-s input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: #11152a;
  font: 16px var(--sans);
}

/* ==== Bands ====================================================================================== */

.band {
  background: var(--band);
  color: var(--band-ink);
  overflow: hidden;
}

/* A band with the hero search lets the suggestions panel hang over the page below it. */
.band:has(.hs) {
  position: relative;
  z-index: 2;
  overflow: visible;
}

.band h1,
.band h2,
.band h3 {
  color: var(--band-ink);
}

.band .crumbs,
.band .crumbs a,
.band .by,
.band .by a,
.band .lede {
  color: var(--band-soft);
}

@media (hover: hover) {
  .band a:hover {
    color: var(--band-ink);
  }
}

.band .btn {
  background: var(--fill);
  border-color: var(--fill);
  color: var(--on-fill);
}

.band .btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--band-ink);
}

/* `.band a:hover` is more specific than `.band .btn`: keep a filled button's ink in every state (Juno, #242). */
.band .btn:not(.ghost):focus-visible,
.band .btn:not(.ghost):visited {
  color: var(--on-band-accent);
}
@media (hover: hover) {
  .band .btn:not(.ghost):hover {
    color: var(--on-band-accent);
  }
}

.band .proof {
  color: var(--band-ink);
}

.lede {
  /* 38ch of Public Sans (its 0 is .612em), in em so the measure is the same before and after the font arrives: a ch
     measure follows the fallback's narrower 0 and rewrapped the lede (Vera, CLS on /subject/business). */
  max-width: 23.2em;
  margin-top: var(--s3);
  font-size: var(--fs-lead);
}

/* ==== Cover tile ================================================================================= */

.cov {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--sunk);
  border-radius: var(--rc);
  box-shadow: var(--cover-shadow);
}

/* No verified cover: search only, never on shelves, Home or collections. */
.cov-none {
  display: flex;
  align-items: flex-end;
  padding: var(--s2);
  font: 500 15px / 1.2 var(--display);
  color: var(--soft);
  box-shadow: none;
  overflow: hidden;
}

.tile {
  min-width: 0;
}

.tile-a {
  display: block;
  border-radius: var(--rc);
}

.tile h3 {
  margin-top: var(--s2);
  font: 600 var(--fs-tile) / 1.3 var(--sans);
  letter-spacing: 0;
  color: var(--ink);
}

.tile .by {
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--faint);
}

.tile .why {
  display: -webkit-box;
  margin-top: var(--s1);
  font-size: var(--fs-small);
  color: var(--soft);
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-a:focus-visible h3 {
  color: var(--accent);
}
@media (hover: hover) {
  .tile-a:hover h3 {
    color: var(--accent);
  }
}

.tile-a:focus-visible {
  outline-offset: 6px;
}

@media (prefers-reduced-motion: no-preference) {
  /* A cover still loading fades in over its title block (DIRECTION §4). */
  .cv-box > .cv {
    transition: opacity 150ms ease;
  }

  .tile .cov {
    transition:
      transform 250ms ease,
      box-shadow 250ms ease;
  }

  .tile-a:focus-visible .cov {
    transform: translateY(-3px);
    box-shadow: var(--cover-shadow-hi);
  }
  @media (hover: hover) {
    .tile-a:hover .cov {
      transform: translateY(-3px);
      box-shadow: var(--cover-shadow-hi);
    }
  }

  .hd-panel:not([hidden]),
  .hd-suggest:not([hidden]) {
    animation: fade 120ms ease;
  }

  @keyframes fade {
    from {
      opacity: 0;
    }
  }
}

/* ==== Book row (List view) ======================================================================= */

.rows {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto var(--tap);
  gap: var(--s3);
  align-items: start;
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--line);
}

.row .cov {
  width: 56px;
}

/* A row's title is never cut: it wraps to as many lines as it takes (no ellipsis, no clamp; Juno on #367). */
.row-t {
  display: block;
  font: 600 17px / 1.3 var(--sans);
  overflow-wrap: break-word;
}

.row-sub {
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--soft);
}

.row .by {
  margin-top: 2px;
  font-size: var(--fs-small);
  color: var(--faint);
}

.row .rank {
  max-width: 220px;
  margin-top: 0;
  text-align: right;
}

.pick-mark {
  display: inline-block;
  margin-left: var(--s1);
  padding: 1px 6px;
  border: 1px solid var(--accent);
  border-radius: var(--rc);
  color: var(--accent);
  font: 600 var(--fs-small) / 1.3 var(--sans);
  vertical-align: 1px;
}

.save {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  background: none;
  color: var(--soft);
  cursor: pointer;
}

.save[aria-pressed='true'] {
  color: var(--accent);
}

.save[aria-pressed='true'] svg {
  fill: currentColor;
}

@media (max-width: 899px) {
  .row {
    grid-template-columns: 56px minmax(0, 1fr) var(--tap);
  }

  .row {
    row-gap: 8px;
    align-content: start;
  }

  .row > .cov {
    grid-row: 1 / span 2;
  }

  .row .save {
    grid-column: 3;
    grid-row: 1;
  }

  .row .rank {
    grid-column: 2;
    grid-row: 2;
    margin-top: 0;
    max-width: none;
    text-align: left;
  }
}

/* ==== Shelf: rail and grid ======================================================================= */

.rail,
.grid {
  margin-top: 0;
  margin-bottom: 0;
  list-style: none;
}

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 150px;
  gap: 20px;
  /* The first tile lines up with the gutter, like the heading; the rail bleeds only on the right. */
  margin-right: calc(var(--gut) * -1);
  padding: 4px var(--gut) 16px 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--gut);
  scrollbar-width: thin;
}

/* From 900 a rail stops at the column's edge, under its "See all", rather than overhang it (Juno, PR 396). */
@media (min-width: 900px) {
  .rail {
    margin-right: 0;
    padding-right: 0;
  }
}

.rail.few {
  grid-auto-flow: row;
  grid-template-columns: repeat(auto-fill, 150px);
  margin-right: 0;
  padding-right: 0;
  overflow: visible;
}

.rail .tile {
  scroll-snap-align: start;
}

.sec-tools {
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.rail-arrows {
  display: none;
  gap: var(--s1);
}

.rail-arrows button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.rail-arrows button:disabled {
  opacity: 0.4;
  cursor: default;
}

.grid {
  display: grid;
  padding: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 20px;
}

@media (min-width: 900px) {
  /* n tiles and 0.4 of the next: 3 from 900, 4 from 1100, 5 from 1240, about 190 to 220 px a tile (Juno, PR 396). */
  .rail {
    --rail-n: 3;
    grid-auto-columns: calc((100% - var(--rail-n) * 28px) / (var(--rail-n) + 0.4));
    gap: 28px;
    margin-right: 0;
    padding-right: 0;
    scroll-padding-inline: 0;
  }

  .rail.few {
    grid-template-columns: repeat(auto-fill, 184px);
  }

  .overflows .rail-arrows {
    display: flex;
  }

  .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 36px 28px;
  }

  .lst .grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .rail {
    --rail-n: 4;
  }
}

@media (min-width: 1240px) {
  .rail {
    --rail-n: 5;
  }
}

/* ==== Collection card ============================================================================ */

.colls {
  display: grid;
  gap: var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.coll {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: var(--s3);
  align-items: start;
  padding: var(--s3);
  background: var(--sunk);
  border-radius: var(--r-card);
}

.coll-s {
  position: relative;
  grid-row: span 2;
  height: 96px;
}

.coll-s .cov {
  position: absolute;
  top: 4px;
  width: 56px;
}

.coll-s .cov:nth-child(1) {
  left: 0;
  transform: rotate(-5deg);
}

.coll-s .cov:nth-child(2) {
  left: 28px;
  top: 0;
  z-index: 2;
}

.coll-s .cov:nth-child(3) {
  left: 56px;
  transform: rotate(5deg);
}

.coll-s .cov:only-child {
  transform: none;
}

.coll-t {
  font: 500 20px / 1.2 var(--display);
  letter-spacing: -0.01em;
  color: var(--ink);
}

.coll-r {
  margin-top: 4px;
  font-size: var(--fs-small);
  color: var(--soft);
}

@media (hover: hover) {
  .coll:hover .coll-t {
    color: var(--accent);
  }
}

@media (min-width: 900px) {
  .colls {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s4);
  }

  .coll {
    grid-template-columns: 140px minmax(0, 1fr);
    padding: var(--s4);
  }

  .coll-s {
    height: 120px;
  }

  .coll-s .cov {
    width: 70px;
  }

  .coll-s .cov:nth-child(2) {
    left: 35px;
  }

  .coll-s .cov:nth-child(3) {
    left: 70px;
  }
}

/* ==== Subject opener ============================================================================= */

.opener {
  display: grid;
  gap: var(--s4);
  padding-top: var(--s4);
  padding-bottom: var(--s5);
}

.opener h1 {
  font-size: var(--fs-hero);
  line-height: 1;
}

.count-l {
  margin-top: var(--s3);
  font-weight: 600;
  color: var(--band-accent);
}

.strip {
  display: flex;
  height: 150px;
}

.strip .cov {
  width: 100px;
  height: 150px;
  margin-left: -24px;
  box-shadow: -8px 0 20px -6px rgba(0, 0, 0, 0.6);
}

.strip .cov:first-child {
  margin-left: 0;
}

.spot {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 20px;
  background: var(--sunk);
  border-radius: var(--r-card);
}

.spot .kick {
  margin-bottom: var(--s1);
  font-weight: 600;
  font-size: var(--fs-small);
  color: var(--accent);
}

.spot .spot-t {
  margin: 0;
  font: 600 16px / 22px var(--sans);
}

.spot .why {
  margin-top: var(--s2);
  font: 500 18px / 1.4 var(--display);
}

@media (min-width: 900px) {
  .opener {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding-top: var(--s5);
    padding-bottom: var(--s6);
  }

  .strip {
    height: 240px;
  }

  .strip .cov {
    width: 160px;
    height: 240px;
    margin-left: -40px;
  }

  .spot {
    grid-template-columns: 240px minmax(0, 560px);
    gap: var(--s6);
    padding: 48px;
  }

  .spot .why {
    font-size: var(--fs-lead);
  }
}

/* ==== Listing tools ============================================================================== */

.lst {
  display: grid;
  gap: var(--s4);
}

.lst-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px var(--s3);
  margin-bottom: var(--s4);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--line);
}

.lst-bar .count {
  margin-right: auto;
  font-weight: 600;
}

.sel {
  display: flex;
  align-items: center;
  gap: var(--s1);
  font-size: var(--fs-small);
  color: var(--soft);
}

.sel select {
  min-height: var(--tap);
  padding: 0 30px 0 var(--s2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background-color: var(--field);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 20px,
    calc(100% - 10px) 20px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  color: var(--ink);
  font: 15px var(--sans);
  appearance: none;
}

/* Grid/List: the house segmented control (Going / Maybe), a grey track with the current option raised (PL21). */
.view {
  display: flex;
  border-radius: var(--r-control);
  background: var(--sunk);
}

/* Until gallery.js wires it, the switch keeps its room but stays out of sight and out of reach (R3-76). */
.view[data-pending] {
  visibility: hidden;
}

.view button {
  min-height: var(--tap);
  padding: 0 16px;
  border: 0;
  border-radius: var(--r-control);
  background: transparent;
  color: var(--soft);
  font: 600 var(--fs-small) var(--sans);
  cursor: pointer;
}

.view button[aria-pressed='true'] {
  background: var(--page);
  color: var(--ink);
  box-shadow: inset 0 0 0 3px var(--sunk), inset 0 0 0 4px var(--line-strong);
}

/* Dark: raised reads lighter than its track, not darker. */
@media (prefers-color-scheme: dark) {
  .view button[aria-pressed='true'] {
    background: var(--line);
  }
}

.rf-open {
  min-height: var(--tap);
}

.facets {
  display: none;
}

.facets .facets-h,
.rf-sheet h2 {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font: 600 15px / 1.3 var(--sans);
  letter-spacing: 0;
}

.facets fieldset,
.rf-sheet fieldset {
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.facets legend,
.rf-sheet legend {
  margin-bottom: var(--s1);
  font-size: var(--fs-meta);
  color: var(--faint);
}

.facets label,
.rf-sheet label {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--tap);
  font-size: var(--fs-small);
}

.facets input,
.rf-sheet input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.rf-sheet {
  width: 100%;
  max-width: none;
  max-height: 85vh;
  margin: auto 0 0;
  padding: var(--s4) var(--gut);
  border: 0;
  border-radius: var(--r-card) var(--r-card) 0 0;
  background: var(--page);
  color: var(--ink);
}

.rf-sheet::backdrop {
  background: rgba(15, 27, 61, 0.5);
}

.rf-sheet .btn {
  width: 100%;
  margin-top: var(--s4);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  margin: 0 0 var(--s3);
  padding: 0;
  list-style: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: var(--tap);
  padding: 0 var(--s2) 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--field);
  color: var(--ink);
  font: 600 var(--fs-small) var(--sans);
  cursor: pointer;
}

@media (hover: hover) {
  .chip:hover {
    border-color: var(--ink);
  }
}

.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  margin-top: 32px;
  font-weight: 600;
  font-size: var(--fs-small);
}

.pager a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--tap);
  min-height: var(--tap);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
}

.pager a[aria-current] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--page);
}

.pager span {
  padding: 0 var(--s1);
  font-weight: 600;
  color: var(--faint);
}

.pager .nx {
  margin-left: auto;
  padding: 0 var(--s3);
}

.empty {
  padding: var(--s5) 0;
}

.empty h2 {
  font-size: var(--fs-h2);
}

.empty .acts {
  margin-top: var(--s3);
}

@media (min-width: 900px) {
  .lst {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 48px;
  }

  .facets {
    display: block;
  }

  .rf-open {
    display: none;
  }
}

/* ==== Book hero ================================================================================== */

/* The phone rule: cover, title, author, proof, reason, ranking and the buttons all sit above the fold. */
.bk {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  grid-template-areas:
    'cr cr'
    'cv hd'
    'rs rs';
  column-gap: var(--s3);
  align-items: end;
  padding-top: var(--s3);
  padding-bottom: 28px;
}

.bk .crumbs {
  grid-area: cr;
}

.bk-c {
  grid-area: cv;
}

/* A Google jacket only checked at 128px stays at 150px in the hero rather than blurring (Juno, #184). */
.bk-c .cov-sm {
  max-width: 150px;
  margin-inline: 0;
}

.bk-h {
  grid-area: hd;
}

.bk-r {
  grid-area: rs;
  margin-top: var(--s3);
}

.bk h1 {
  font-size: 28px;
  line-height: 1.05;
  /* A one-word title longer than the column ("Empowered" at 320) breaks with a hyphen rather than being cut
     (Vera B, Nov 14). Never clamped: a title shows in full however many lines it takes (Vera B VB1). */
  overflow-wrap: break-word;
  hyphens: auto;
}

.bk .by {
  margin-top: var(--s1);
  font-size: 15px;
}

.bk .by.tl {
  margin-top: 0;
}

.bk .subj-l {
  margin-top: 4px;
  font-size: 15px;
}

.band .subj-l a {
  color: var(--band-soft);
}

/* The author and subject links each get a tap target over 24 px through padding, and the two never overlap: no
   negative margins, 4 px of space between them (Vera B on VB3, #564). */
.bk .by a,
.bk .subj-l a {
  display: inline-block;
  padding: 4px 0;
}

.bk .proof {
  margin-top: var(--s1);
}

.bk .why {
  font: 500 20px / 1.35 var(--display);
  letter-spacing: -0.01em;
  color: var(--band-ink);
}

.bk .rank {
  color: var(--band-soft);
}

/* The subtitle, part of the title block (Juno #343): 18/26 body sans, regular (no extra serif cut). */
.bk .bk-sub {
  margin: var(--s1) 0 0;
  font: 400 18px / 26px var(--sans);
  color: var(--band-ink);
}

/* The Associates disclosure under Buy, on the navy band (stoareads-20). */
.bk .note {
  color: var(--band-soft);
}


.bk .rank-k {
  color: var(--band-ink);
}

.bk .acts {
  gap: var(--s2);
  margin-top: var(--s3);
}

.bk .acts .btn {
  flex: 1;
}

@media (min-width: 900px) {
  .bk {
    grid-template-columns: 260px minmax(0, 640px);
    grid-template-areas:
      'cv cr'
      'cv hd'
      'cv rs';
    column-gap: var(--s6);
    align-items: start;
    padding-top: 48px;
    padding-bottom: var(--s6);
  }

  .bk-c {
    align-self: center;
  }

  .bk .crumbs {
    align-self: end;
  }

  .bk h1 {
    font-size: var(--fs-h1);
    -webkit-line-clamp: unset;
  }

  .bk .by {
    font-size: var(--fs-body);
  }

  .bk-r {
    margin-top: 28px;
  }

  .bk .why {
    font-size: 26px;
  }

  .bk .acts {
    margin-top: 28px;
  }

  .bk .acts .btn {
    flex: none;
  }
}

/* ==== Proof line and ranking slot ================================================================ */

.proof {
  display: flex;
  align-items: baseline;
  gap: var(--s1);
  margin-top: var(--s1);
  font-size: var(--fs-small);
  color: var(--ink);
}

/* The dot never stands alone: it is drawn only before a proof line's own text. */
.proof::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--proof);
  transform: translateY(-1px);
}

.proof a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

.rank {
  margin-top: var(--s1);
  font-size: var(--fs-small);
  color: var(--soft);
}

.rank-k {
  margin-right: 4px;
  font-weight: 600;
  color: var(--ink);
}

/* ==== Book body: facts and sources ================================================================ */

.bk-body {
  display: grid;
  gap: var(--s5);
}

.facts {
  display: grid;
  /* The label column fits its longest label on one line ("First published" wrapped at 390, Nt3-J2). */
  grid-template-columns: minmax(96px, max-content) minmax(0, 1fr);
  align-self: start;
  margin: 0;
  border-top: 1px solid var(--line);
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-small);
}

.facts dt {
  padding-right: 16px;
  color: var(--faint);
}

.facts a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}

/* One column since the club questions left (WS-23): the facts and sources keep a reading measure. */
.bk-body > div {
  max-width: 760px;
}

/* ==== Subject tiles ============================================================================== */

.subj {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Tiles in a row share one height, so a name that wraps doesn't stand taller than its neighbours (Juno, #189). */
.subj li {
  display: flex;
}

.subj a {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0 var(--s3);
  border-radius: var(--r-control);
  background: var(--sunk);
  font-weight: 600;
  font-size: 15px;
  min-width: 0;
  overflow-wrap: break-word; /* a long prize name wraps inside its tile at 320 (Vera on #497) */
}

@media (hover: hover) {
  .subj a:hover {
    background: var(--accent);
    color: var(--on-accent);
  }
}

@media (min-width: 900px) {
  .subj {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ==== Footer ===================================================================================== */

.ft {
  margin-top: var(--foot-gap);
  padding: var(--s6) 0;
  border-top: 1px solid var(--line);
  background: var(--foot);
}

.ft-in {
  display: grid;
  grid-template-columns: 1.2fr 2fr 1fr;
  gap: var(--s5);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

.ft .brand {
  color: var(--ink);
}

.ft-b p {
  max-width: 30ch;
  margin-top: var(--s1);
  font-size: var(--fs-small);
  color: var(--soft);
}

.ft h2,
.ft-more {
  margin-bottom: var(--s2);
  font: 600 var(--fs-small) / 1.3 var(--sans);
  letter-spacing: 0;
  color: var(--ink);
}

.ft ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ft-sub ul {
  columns: 2;
  column-gap: var(--s4);
}

.ft a {
  display: inline-flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  font-size: var(--fs-small);
  color: var(--soft);
}

.ft-more {
  display: none;
}

@media (max-width: 899px) {
  .ft-in {
    grid-template-columns: minmax(0, 1fr);
  }

  /* On a phone the 12 subjects fold behind one disclosure, to keep the page short. */
  .js .ft-sub h2 {
    display: none;
  }

  .js .ft-more {
    display: flex;
    align-items: center;
    gap: var(--s1);
    min-height: var(--tap);
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
  }

  .js .ft-more[aria-expanded='false'] + ul {
    display: none;
  }

  .ft a {
    min-height: var(--tap);
  }
}

@media (max-width: 899px) {
  /* On a phone the bar is one row: the count, then Refine and the view toggle. Sort lives in the Refine sheet. */
  .lst-bar {
    flex-wrap: nowrap;
  }

  .lst-bar .sel {
    display: none;
  }
}

.rf-sort {
  justify-content: space-between;
  margin-top: var(--s3);
}

.rf-sort select {
  flex: 1;
  max-width: 220px;
}

/* ==== Hit areas (Vera's check of #174, Juno's call) ================================================
   Every standalone link gets a 44px-tall target without changing how it looks: an invisible box
   centred on the text. A book row's title stretches over the whole row; its Save button stays on top. */
.brand,
.hd-app,
.sec-h .lnk,
.chips .lnk,
.crumbs a,
.ft a,
.spot .lnk {
  position: relative;
}

/* A section's own link ("See all", "Official list"): a real 44 px box around the same text, pulled back by the same
   amount, so nothing around it moves (audit P1 #7). */
.sec-h .lnk {
  display: inline-block;
  padding-block: calc((var(--tap) - 1lh) / 2);
  margin-block: calc((1lh - var(--tap)) / 2);
}

.brand::after,
.hd-app::after,
.sec-h .lnk::after,
.chips .lnk::after,
.crumbs a::after,
.ft a::after,
.spot .lnk::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--tap);
  transform: translateY(-50%);
}

.row {
  position: relative;
}

.row-t::after {
  content: '';
  position: absolute;
  inset: 0;
}

.row .save,
.row .by a,
.row .cite a {
  position: relative;
  z-index: 1;
}

/* A cover that fails to load leaves its sunk block, never broken-image alt text over it. */
.cov {
  color: transparent;
  font-size: 0;
}

.cover-credit {
  margin-top: var(--s4);
  font-size: var(--fs-meta);
  color: var(--faint);
}

.cov.gone {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'/%3E");
}

/* ==== Book body: description, recognition, evidence, editions, sources (catalog pages) =========== */
.bk-body > div > * + * {
  margin-top: var(--s4);
}

.bk-body h2 {
  margin-top: var(--s5);
  margin-bottom: var(--s2);
  font-size: var(--h-sub);
  line-height: 1.2;
}

.bk-body ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.bk-body li {
  padding: var(--s2) 0;
  border-bottom: 1px solid var(--line);
}

/* An edition's ISBN on its own muted line, never broken (Juno on R3-30). */
.bk-body .ed-isbn {
  display: block;
  color: var(--soft);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Who and source links fill their row's height (about 45px) without moving a line (Night 3 Nt3-3) */
.bk-body .book-ev a.ev-who,
.bk-body .book-ev a.ev-src {
  display: inline-block;
  max-width: 100%;
  padding-block: var(--s2);
  margin-block: calc(-1 * var(--s2));
}

.bk-body .about h2 {
  margin-top: 0;
}

/* Juno #250: keep the quote to a readable measure, and let the source read as a link. */
.bk-body .about {
  max-width: 68ch;
}

/* About this book (SPEC-PRE-SPRINT F.2): the publisher's words at 17/26 in ink, no drawn quote marks; the source
   under it at 14/20, linked. */
.bk-body .about-src {
  margin: var(--s2) 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--faint);
}

.bk-body .about-src a,
.bk-body .an dd a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

.bk-body .desc {
  margin: 0;
  padding-left: var(--s3);
  border-left: 2px solid var(--line-strong);
  font-size: 17px;
  line-height: 26px;
  color: var(--ink);
}

.bk-body .desc p {
  margin: 0;
  text-wrap: pretty;
}

/* Publisher back-cover copy runs to a few paragraphs (Seph, Nov 14): a gap between them (Juno, #524). */
.bk-body .desc p + p {
  margin-top: 12px;
}

/* Why it's ranked / Not ranked yet (F.3, F.4): a plain rank line, then one group per kind of evidence with
   hairlines between, every row at least a tap tall. */
.bk-body .an {
  max-width: 68ch;
}

.bk-body .an-rank {
  margin: 0;
  font-size: 16px;
  line-height: 22px;
  font-weight: 600;
  color: var(--ink);
}

.bk-body .an-rank a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.bk-body .an-miss {
  margin: 0;
  font-size: 16px;
  line-height: 24px;
  color: var(--ink);
}

/* A book ranked on its description alone: its line is a sentence of its own under the rank line (Vera B, #612). */
.bk-body .an-rank + .an-miss {
  margin-top: var(--s2);
}

.bk-body .an-dl {
  margin: var(--s3) 0 0;
}

.bk-body .an-dl > div {
  padding: var(--s2) 0 0;
  border-top: 1px solid var(--line);
}

.bk-body .an-dl > div:last-child {
  border-bottom: 1px solid var(--line);
}

.bk-body .an-dl dt {
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--faint);
}

.bk-body .an-dl dd {
  /* Inline text, so a name, its standing and the source wrap as one sentence; 11 + 22 + 11 makes a 44 px row. */
  min-height: var(--tap);
  margin: 0;
  padding: 11px 0;
  font-size: 15px;
  line-height: 22px;
  color: var(--ink);
}

.bk-body .an-src {
  display: block;
  font-size: 14px;
  line-height: 20px;
  color: var(--faint);
}

/* The source link is a 24 px tall target on its own, with no change to the 20 px line (Nt4-1, axe target-size).
   It grows down into the row's 11 px bottom padding, so it never overlaps the name on the line above (VB-75). */
.bk-body .an-src a {
  display: inline-block;
  padding: 0 0 4px;
  margin: 0 0 -4px;
}

/* The recommender's name is a 24 px tall target too: its 22 px line grows 2 px up into the row's 11 px top padding,
   taken back by the margin so no line moves, and it never meets the source link below (VB-74, VB-75, axe target-size). */
.bk-body .an-dl a.ev-who {
  display: inline-block;
  max-width: 100%;
  padding: 2px 0 0;
  margin: -2px 0 0;
}

.bk-body .an-m,
.bk-body .an-nc {
  color: var(--faint);
}

.bk-body .an-nc {
  margin: var(--s3) 0 0;
  font-size: 14px;
  line-height: 20px;
}

.bk-body .an-how {
  margin: var(--s3) 0 0;
  font-size: 15px;
  line-height: 20px;
}

.bk-body .an-how a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.bk-body details summary {
  display: flex;
  align-items: center;
  min-height: var(--tap);
  /* A section head like Sources beside it (Juno on #558): Newsreader 500 at the h3 size. */
  font: 500 var(--fs-h3) / 1.2 var(--display);
  letter-spacing: -0.02em;
  cursor: pointer;
}

/* No reason (a catalog book with no why line or subtitle): the ranking slot closes up under the head. */
.bk-r.bare {
  margin-top: var(--s2);
}

@media (min-width: 900px) {
  .bk-r.bare {
    margin-top: var(--s3);
  }
}

/* A tall cover gives its extra height to the space after the actions, never between head and reason. */
@media (min-width: 900px) {
  .bk {
    grid-template-rows: auto auto 1fr;
  }
}

/* Links on the navy band use the band's accent, so they keep their contrast in light mode. */
.band .lnk {
  color: var(--band-accent);
  text-decoration-color: color-mix(in srgb, var(--band-accent) 45%, transparent);
}

/* ==== Subject listing: refine options are links, one pre-built page per state (no query strings) == */
.fgroup {
  margin-top: 20px;
}

.fgroup h3,
.rf-sort h3 {
  margin-bottom: var(--s1);
  font: 600 var(--fs-meta) / 1.3 var(--sans);
  color: var(--faint);
}

.fgroup ul,
.rf-sort ul,
.sorts {
  margin: 0;
  padding: 0;
  list-style: none;
}

.opt {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--tap);
  font-size: var(--fs-small);
  color: var(--ink);
}

.opt::before {
  content: '';
  flex: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--line-strong);
  border-radius: 50%;
}

.opt[aria-current]::before {
  border: 5px solid var(--accent);
}

.opt.off {
  color: var(--faint);
}

.opt.off::before {
  border-style: dashed;
}

.sorts {
  display: flex;
  gap: var(--s3);
}

.sorts .opt::before {
  display: none;
}

.sorts .opt {
  color: var(--soft);
}

.sorts .opt[aria-current] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 6px;
}

.rf-sort {
  margin-top: var(--s3);
}

.lst.bare {
  grid-template-columns: minmax(0, 1fr);
}

.rows {
  display: none;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lst[data-view='list'] .grid {
  display: none;
}

.lst[data-view='list'] .rows {
  display: block;
}

.pager .nx[rel='prev'] {
  margin-left: 0;
}

.opener .count-l {
  margin-top: var(--s2);
  font-weight: 600;
  color: var(--band-accent);
}

.spot + .lst {
  margin-top: var(--s5);
}

/* Hit areas, take two (Vera on #175, measured with elementFromPoint): the invisible box sits above the
   next element, so it is not covered; footer links get the full height; fact and source links too. */
.facts a,
.bk-body li a {
  position: relative;
}

.facts a::after,
.bk-body li a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--tap);
  transform: translateY(-50%);
}

.brand,
.hd-app,
.sec-h .lnk,
.chips .lnk,
.crumbs a,
.spot .lnk,
.facts a,
.bk-body li a {
  z-index: 1;
}

.ft a {
  min-height: var(--tap);
}

/* Phone: the count stands alone (the pager gives the page), and the opener strip shows only whole covers. */
@media (max-width: 899px) {
  .lst-bar .pg {
    display: none;
  }

  .strip .cov:nth-child(n + 4) {
    display: none;
  }
}

/* The cover credit link gets the same 44px target as the other standalone links (Vera on #178). */
.cover-credit a {
  position: relative;
  z-index: 1;
}

.cover-credit a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--tap);
  transform: translateY(-50%);
}

/* ==== Search and browse (/browse, Iris PR 4) ======================================================
   The hero field (DESIGN-C §2): white, 52px, radius 6; Home uses it too. Then site/search.js's own
   toolbar, chips, rows and states, in the Gallery look. */

.hs {
  display: flex;
  gap: var(--s2);
  width: 100%;
  max-width: 640px;
}

.hs input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 var(--s3);
  border: 1px solid transparent;
  border-radius: var(--r-control);
  background: #fff;
  color: #14161c;
  font: 17px var(--sans);
}

.hs input::placeholder {
  color: #5b606b;
}

.hs input:focus {
  outline: 2px solid var(--band-accent);
  outline-offset: 2px;
}

.hs .btn {
  min-height: 52px;
}

.brw-op {
  align-items: end;
}

.brw-op h1 {
  font-size: var(--fs-h1);
}

.sec.brw {
  margin-top: var(--s5);
}

@media (min-width: 900px) {
  .brw-op {
    grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
  }
}

.brw .find-status {
  margin: 0 0 var(--s3);
  font-weight: 600;
}

.brw .find-coverage,
.brw .find-read {
  margin: 0 0 var(--s3);
  font-size: var(--fs-small);
  color: var(--soft);
}

.brw .find-list[hidden],
.brw .find-browse[hidden] {
  display: none;
}

.brw .find-browse {
  margin-top: var(--s4);
}

/* Prize tiles read from the top: a name that wraps to four lines beside one of two never floats (Juno, Nov 13). */
.subj-n a {
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2px;
  min-height: 64px;
  padding-block: var(--s2);
}

.subj-n a span {
  font-weight: 400;
  font-size: var(--fs-meta);
  color: var(--soft);
}

@media (hover: hover) {
  .subj-n a:hover span {
    color: inherit;
  }
}

.brw .row .row-sub {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* An empty block is not a cover: no cover shadow, a 1px line, the same on every row (Juno, #181). */
.brw .cov-none,
.brw .cov.gone {
  width: 56px;
  padding: 0;
  border: 1px solid var(--line);
  box-shadow: none;
}

/* The ranking line sits under the author on every width; only Save is on the right (Juno, #181). */
.brw .row {
  grid-template-columns: 56px minmax(0, 1fr) var(--tap);
  row-gap: 8px;
  align-content: start;
}

.brw .row > .cov {
  grid-row: 1 / span 2;
}

.brw .row .save {
  grid-column: 3;
  grid-row: 1;
}

.brw .row .rank {
  grid-column: 2;
  grid-row: 2;
  margin-top: 0;
  max-width: none;
  text-align: left;
}

.brw .find-open-tools {
  min-height: var(--tap);
}

.brw .cover-credit[hidden] {
  display: none;
}

/* The toolbar: Subject, Published, Sort. Each opens a short list that applies on tap (refine.js). */
.brw .find-tools {
  margin: 0 0 var(--s3);
}

.brw .find-tools[hidden],
.brw .find-toolbar[hidden],
.brw .find-chips[hidden] {
  display: none;
}

.brw .find-toolbar {
  display: flex;
  gap: var(--s2);
  margin-inline: -2px;
  padding: 2px 2px var(--s1);
  overflow-x: auto;
  scrollbar-width: none;
}

.brw .find-tool {
  position: relative;
  flex: none;
}

.brw .find-tool > summary {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: var(--tap);
  padding: 0 var(--s3);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  color: var(--ink);
  font: 600 var(--fs-small) var(--sans);
  white-space: nowrap;
  list-style: none;
  cursor: pointer;
}

.brw .find-tool > summary::-webkit-details-marker {
  display: none;
}

.brw .find-tool > summary::after {
  content: '';
  width: 7px;
  height: 7px;
  margin: -3px 0 0 var(--s1);
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg);
}

.brw .find-tool[open] > summary {
  border-color: var(--ink);
}
@media (hover: hover) {
  .brw .find-tool > summary:hover {
    border-color: var(--ink);
  }
}

.brw .find-tool > summary:focus-visible,
.brw .find-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.brw .find-menu {
  position: fixed;
  z-index: 30;
  min-width: 15rem;
  max-height: min(60vh, 26rem);
  margin: 0;
  padding: var(--s1) 0;
  overflow-y: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-card);
  background: var(--page);
  box-shadow: var(--cover-shadow-hi);
}

.brw .find-menu label {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--tap);
  padding: 0 var(--s3);
  font-size: 15px;
  cursor: pointer;
}

@media (hover: hover) {
  .brw .find-menu label:hover {
    background: var(--sunk);
  }
}

.brw .find-menu input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.brw .find-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s1);
  margin-top: var(--s2);
}

.brw .find-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: var(--tap);
  padding: 0 var(--s2) 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-control);
  background: var(--field);
  color: var(--ink);
  font: 600 var(--fs-small) var(--sans);
  cursor: pointer;
}

@media (hover: hover) {
  .brw .find-chip:hover {
    border-color: var(--ink);
  }
}

.brw .find-chip-x {
  font-size: 0.8em;
  color: var(--soft);
}

.brw .find-offer {
  background: transparent;
  border-style: dashed;
}

.brw .find-from,
.brw .find-unsupported {
  font-size: var(--fs-small);
  color: var(--soft);
}

.link-button {
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 var(--fs-small) var(--sans);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.brw .find-more {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  padding: var(--s4) 0 0;
  font-size: var(--fs-small);
  color: var(--soft);
  list-style: none;
}

.brw .find-divider {
  padding: var(--s5) 0 var(--s2);
  list-style: none;
}

.brw .find-divider h2 {
  font-size: var(--fs-h3);
}

.brw .find-divider p {
  margin-top: var(--s1);
  font-size: var(--fs-small);
  color: var(--soft);
}

/* No results (DESIGN-C §2): the query, near matches, three subjects, search tips. */
.brw .find-none > * + * {
  margin-top: var(--s3);
}

.brw .find-none strong {
  font: 500 var(--fs-h3) / 1.3 var(--display);
}

.brw .find-none .find-tips strong {
  font: inherit;
  font-weight: 600;
}

.brw .find-none a {
  color: var(--accent);
  font-weight: 600;
}

.brw .find-none .find-ask a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
}

.brw .find-closest {
  display: block;
}

@media (max-width: 899px) {
  .brw .find-sort-now {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .hs .btn {
    padding: 0 14px;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Next steps under a partial answer (Vera's baseline): each link a 44px target. */
.brw .find-next {
  margin: 0 0 var(--s3);
  font-size: var(--fs-small);
  color: var(--soft);
}

.brw .find-next a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  color: var(--accent);
  font-weight: 600;
}

/* Suggestions as you type (DESIGN-C §2 Header, "Search focused"): books, then subjects and authors. */
/* The hero form holds its panel. The header form only does on desktop: on a phone its field is
   positioned itself and the panel is fixed under the header, so the form must stay static (Vera, #189). */
.hs.sg-host {
  position: relative;
}

@media (min-width: 900px) {
  .hd-search.sg-host {
    position: relative;
  }
}

.sg {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: max(100%, 360px);
  max-width: calc(100vw - 2 * var(--s2));
  max-height: min(70vh, 520px);
  overflow-y: auto;
  padding: var(--s1) 0;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--field);
  color: var(--ink);
  box-shadow: var(--cover-shadow);
  text-align: left;
}

@media (prefers-color-scheme: dark) {
  .sg {
    background: var(--sunk);
  }
}

.hd-search .sg {
  right: 0;
  left: auto;
}

.sg-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sg-o {
  display: flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--tap);
  padding: 6px var(--s3);
  cursor: pointer;
}

.sg-o[aria-selected='true'] {
  background: var(--sunk);
}
@media (hover: hover) {
  .sg-o:hover {
    background: var(--sunk);
  }
}

.sg-o[aria-selected='true'] .sg-t {
  color: var(--accent);
}

.sg-c {
  flex: none;
  width: 40px;
  height: 60px;
  border-radius: 2px;
  object-fit: cover;
  background: var(--sunk);
}

.sg-o > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sg-t {
  font: 600 var(--fs-body) / 1.3 var(--sans);
  overflow-wrap: break-word; /* a suggestion wraps, never cut (Juno on #367) */
}

.sg-by {
  color: var(--faint);
  font-size: var(--fs-small);
  overflow-wrap: break-word;
}

.sg-all {
  border-top: 1px solid var(--line);
}


.sg-none {
  margin: 0;
  padding: var(--s2) var(--s3);
  color: var(--soft);
  font-size: var(--fs-small);
}

@media (max-width: 899px) {
  .hd.searching .sg {
    position: fixed;
    top: 56px;
    right: var(--s2);
    left: var(--s2);
    width: auto;
  }
}

/* ==== Home (DESIGN-C §4.1) ======================================================================= */

.hero {
  display: grid;
  gap: var(--s5);
  padding-top: var(--s5);
  padding-bottom: var(--s5);
}

.home .hero h1 {
  font-size: 40px;
  line-height: 1;
  font-weight: 600;
}

.hero .lede {
  margin-top: var(--s3);
  max-width: 34ch;
}

.hero .hs {
  margin-top: var(--s4);
  max-width: 560px;
}

/* The fan of three pick covers is desktop only, so the field sits above the fold on a phone. */
.fan {
  display: none;
}

.rail-why .why {
  -webkit-line-clamp: 2;
}

.spot-home .by {
  margin-top: 2px;
  color: var(--soft);
}

.spot-home h2 {
  font-size: var(--fs-h2);
}

/* On a phone the Spotlight stacks: the cover above, so the text gets the full width. */
.spot-home {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.spot-home > .cov {
  width: 120px;
  height: auto;
}

.spot-home .why {
  font-size: 18px;
}

.spot-home .btn {
  margin-top: var(--s4);
}

@media (min-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    align-items: center;
    padding-top: var(--s6);
    padding-bottom: var(--s6);
  }

  .home .hero h1 {
    font-size: var(--fs-hero);
  }

  .fan {
    display: block;
    position: relative;
    height: 380px;
  }

  .fan-i {
    position: absolute;
    top: 10px;
    width: 42%;
    max-width: 220px;
  }

  .fan-i .cov {
    width: 100%;
    height: auto;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  }

  .fan-i.f0 {
    left: 0;
    top: 34px;
    transform: rotate(-6deg);
  }

  .fan-i.f1 {
    left: 29%;
    z-index: 2;
  }

  .fan-i.f2 {
    left: 58%;
    top: 34px;
    transform: rotate(6deg);
  }

  .spot-home {
    grid-template-columns: 240px minmax(0, 560px);
    align-items: center;
  }

  .spot-home > .cov {
    width: 240px;
  }

  .spot-home .why {
    font-size: 20px;
  }
}

/* ==== Collection and Prize pages (DESIGN-C §4.2, §4.5) ========================================== */

.opener .rule {
  margin-top: var(--s1);
  color: var(--band-soft);
  font-size: var(--fs-small);
}

.row-why {
  margin-top: var(--s1);
  font-size: var(--fs-small);
  color: var(--soft);
}

/* The prize status is plain text in the meta line: never a medal or a gold badge. */
.row-meta {
  margin-top: 2px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--ink);
}

.prize-year + .prize-year {
  margin-top: var(--s5);
}

.prize-year h2 {
  font-size: 22px;
}

.prize-menu {
  margin-top: var(--s6);
}

/* ==== Author and Recommender pages (DESIGN-C §4.3, §4.4): a sunk band, people not sections ======= */

.sunk-band {
  background: var(--sunk);
}

.person h1 {
  font-size: 32px;
  line-height: 1.1;
}

.person .count-l {
  color: var(--soft);
}

.row .by a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

@media (hover: hover) {
  .row .by a:hover {
    color: var(--accent);
  }
}

.cite {
  margin-top: var(--s1);
  font-size: var(--fs-small);
}

.cite a {
  /* At least a 24 px target without moving the line (Vera B VB6). */
  display: inline-block;
  padding: 4px 0;
  margin: -4px 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
}

@media (min-width: 900px) {
  .person h1 {
    font-size: 48px;
  }
}

/* Collection, prize and people rows put the ranking line under the author line (Juno, #193). */
.row > div > .rank {
  max-width: none;
  margin-top: 2px;
  text-align: left;
}

/* Start here rows name their subject above the title (Juno, #193). */
.row-kick {
  margin-bottom: 2px;
  font-size: var(--fs-small);
  font-weight: 600;
  color: var(--accent);
}

/* A path collection (DESIGN-C §4.2a): one section per stage, in order; headings are never sticky. */
.path .stage + .stage {
  margin-top: var(--s5);
}

.stage h2 {
  font-family: var(--display);
  font-size: var(--h-sub);
}

.stage .step {
  margin-right: 6px;
  color: var(--faint);
  font-weight: 400;
}

.stage-line {
  margin: var(--s1) 0 var(--s2);
  font-size: 15px;
  color: var(--soft);
}

/* ==== Clubs and About (DESIGN-C §4.6, §4.7): the reading width ================================== */

/* The column keeps the page's left gutter, so title and body share one edge (Juno, #196). */
.read > * {
  max-width: 66ch;
}

.read {
  font-size: 17px;
  line-height: 1.6;
}

.read h2 {
  margin-top: var(--s5);
  font-size: var(--fs-h2);
}

.read section:first-child h2,
.read > h2:first-child {
  margin-top: 0;
}

.read p,
.read ul,
.read ol {
  margin-top: var(--s2);
}

.read a:not(.btn) {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.read .hs {
  margin-top: var(--s3);
  max-width: 560px;
}

.read .acts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s3);
}

.read .note {
  font-size: var(--fs-small);
  color: var(--soft);
}

.opener.person .lede,
.opener.person .small {
  margin-top: var(--s2);
  color: var(--soft);
}

/* The hero field on a page body (Clubs) keeps its field look: a hairline on the light page. */
.read .hs input {
  border: 1px solid var(--line-strong);
}

/* /browse?q=…: hold the page until the first results are drawn (browse-q.js sets q-wait; search.js clears
   it), so nothing above the fold moves (Vera's flip baseline: CLS 0.814 from the toolbar and footer). */
.brw .find-tools:empty {
  display: none;
}

.q-wait .brw .find-tools:empty {
  display: block;
  min-height: 44px; /* the folded "Filter and sort" button */
}

/* On a wide screen the toolbar row and the folded button take the same 52px, so neither moves the status line. */
@media (min-width: 900px) {
  .q-wait .brw .find-tools:empty,
  .brw .find-tools {
    min-height: 52px;
  }
}

.q-wait .brw .find-browse {
  display: none;
}

.q-wait .sec.brw {
  min-height: 100svh;
}

/* Phone LCP (Vera's rerun on #201, Juno's yes): the first covers in view stay smaller than the headline
   text, so a third-party cover that takes three hosts to arrive is never the page's LCP. Phone only. */
@media (max-width: 899px) {
  [aria-labelledby="picks-title"] .rail {
    grid-auto-columns: 128px;
  }

  [aria-labelledby="picks-title"] .rail.few {
    grid-template-columns: repeat(auto-fill, 128px);
  }

  /* Subject on a phone (Juno, after Vera's rerun): the opener's cover strip is hidden, and the spot reads
     text first with its cover under it, so the opener or the spot's text is the LCP whatever the copy. */
  .opener .strip {
    display: none;
  }

  .spot {
    grid-template-columns: minmax(0, 1fr);
  }

  .spot > .cov {
    order: 1;
    width: 96px;
    height: 144px;
  }

  .spot .lnk {
    display: inline-block;
    margin-top: 10px;
  }

  /* Every subject listing opens in List on a phone, on every page (Juno and Vera, #228): a two-column tile
     would be the LCP, and the view never flips mid-subject. A Grid or List the reader chose wins (gallery.js). */
  .lst[data-view='auto'] .grid {
    display: none;
  }

  .lst[data-view='auto'] .rows {
    display: block;
  }
}

/* ---- One sign-in with stoareads.app (WS-25) ------------------------------------------------------- */

/* /session: the page that finishes a sign-in. One centred line on the navy band. */
.session-page {
  display: grid;
  place-content: center;
  gap: var(--s4, 16px);
  min-height: 100vh;
  padding: 0 var(--gut);
  text-align: center;
  background: var(--band);
  color: var(--band-ink);
}
.session-page h1 {
  margin: 0;
  color: var(--band-ink);
  font: 500 var(--fs-h2) / 1.2 var(--display);
}
.session-page p {
  margin: 0;
  color: var(--band-soft);
}
.session-page a:not(.brand) {
  color: var(--band-accent);
}

/* The header shows Sign in, or My books once this browser is signed in here. session-state.js sets
   data-signed-in on <html> before the page draws, from a cookie with no identity in it, so the right
   link is there on first paint; site.js checks with /api/me and puts Sign in back if the session ended. */
.sheet-acct {
  display: flex;
  align-items: center;
  gap: var(--s5, 24px);
  margin: var(--s3, 12px) 0 0;
  padding: 0;
  list-style: none;
}
.sheet-acct a,
.sheet-acct button,
button.hd-app {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  font: 600 var(--fs-body) / 1.2 var(--sans);
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
}
button.hd-app {
  color: var(--band-accent);
  font-size: 15px;
}
@media (hover: hover) {
  button.hd-app:hover {
    color: var(--band-ink);
  }
}
@media (max-width: 899px) {
  button.hd-app {
    display: none;
  }
}
[data-signed-in] [data-signed-out-only],
:root:not([data-signed-in]) [data-signed-in-only] {
  display: none !important;
}

/* Search: a book we don't carry, searched on Amazon. One quiet text line, last under the results (WS-28). */
.find-amazon {
  margin-top: var(--s4);
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  font-size: var(--fs-body);
  line-height: 1.5;
}
.find-amazon p {
  margin: 0;
}
.find-amazon-q,
.find-amazon-note {
  color: var(--faint);
}
.find-amazon a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.find-amazon p.find-amazon-note {
  margin-top: 6px;
  font-size: 15px;
}
/* On zero results, room before Browse by subject (Juno, #254). */
.brw .find-amazon + .find-browse {
  margin-top: 40px;
}

/* ---- "I've read it" on a book page (WS-36): its own line under Save and Buy, in ink, no fill ---- */

.ri-line {
  margin-top: var(--s2);
}

.ri,
.ri-done,
.ri-rate,
.ri-link {
  display: inline-flex;
  align-items: center;
  gap: var(--s1);
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 600 var(--fs-body) / 1.3 var(--sans);
  text-decoration: none;
  cursor: pointer;
}

.ri[hidden],
.btn[hidden] {
  display: none;
}

@media (hover: hover) {
  .ri:hover span,
  .ri-reopen:hover,
  .ri-rate:hover,
  .ri-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

.ri-check {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ri-check.filled {
  box-sizing: border-box;
  padding: 3px;
  border-radius: 50%;
  background: var(--band-saved);
  stroke: var(--band);
}

.ri-done {
  color: var(--band-saved);
  cursor: default;
}

button.ri-done {
  cursor: pointer;
}

/* The filled check keeps its 20 px circle beside any words, and a two-line rating reads from the left (Seph's iPhone,
   Nov 22: a squashed oval beside centred words on cards and desktop rows). */
.ri-done > .ri-check {
  flex: none;
}

button.ri-reopen {
  text-align: left;
}

.ri-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s3);
}

.ri-rate,
.ri-link {
  font-weight: 600;
  font-size: var(--fs-small);
  color: var(--band-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* The rating block (SPEC-SHELL §7.7): one slider, a ring for the keyboard only, token spacing. */
.ri-prompt{flex-basis:100%;margin:0}
.ri-stars{display:flex;gap:0;width:220px;max-width:calc(100% + 8px);margin:0 0 0 -8px;color:var(--ink);cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:pan-y}
.ri-stars:focus{outline:none}.ri-stars:focus-visible{outline:2px solid var(--ink);outline-offset:4px}
/* Each star is a 44 px slot, the art 28 px in its middle: a tap picks the whole star it lands on (Vera R1). */
.ri-star{position:relative;display:inline-flex;flex:1 1 0;min-width:28px;height:44px}
.ri-star svg{position:absolute;top:10px;left:50%;width:24px;height:24px;margin-left:-12px;pointer-events:none;overflow:visible}
:root{--laurel:#3e6b3a;--laurel-off:.3}@media (prefers-color-scheme:dark){:root{--laurel:#8fbf86;--laurel-off:.4}}
/* Laurels, not stars (SPEC-STOA-GRADE, 18:30 Nov 15): a given laurel filled in --laurel, the rest the same drawing at 30%. */
.ri-star{color:var(--laurel);border-radius:var(--r-control);}.ri-star:focus{outline:none}.ri-star:focus-visible{outline:2px solid var(--ink);outline-offset:-2px}
.ri-star:not(.on) svg{opacity:var(--laurel-off)}.ri-laurel .lr-stem{fill:none;stroke:currentColor;stroke-width:1.3;stroke-linecap:round}.ri-laurel .lr-leaf{fill:currentColor;stroke:none}
.ri-tools{display:flex;align-items:center;gap:16px;margin:8px 0 0;line-height:20px;min-height:20px}.ri-tools .ri-link{min-height:44px}
.ri-your{font-size:15px;color:var(--ink)}.ri-x{font-size:20px;text-decoration:none}
/* Under 600 a rating takes its own full-width row, so the rating words never break; Change and Undo go on the row below, left, 16px apart (Juno, laurels v2). */
@media (max-width:599.98px){.ri-tools:has(.ri-change){flex-wrap:wrap;row-gap:12px}.ri-tools:has(.ri-change) .ri-your{flex:1 0 100%;text-wrap:pretty}}
.ri-private{margin:4px 0 0;color:var(--soft);font-size:14px}

.ri-error {
  flex-basis: 100%;
  margin-top: 4px; /* R3-90: a breath under Remove rating */
  color: var(--band-ink);
  font-size: var(--fs-small);
}

/* shared:cover-box start (shared/discover/cover-box.css; edit it there) */
/* The cover box (DIRECTION §4), canonical in shared/discover: spliced into site/css/gallery.css by scripts/shared.mjs. */
/* ==== Covers never blank (sprint 3, DIRECTION §4) ==============================================
 * Every cover is a 2:3 box in its subject's dark tone with the title, a hairline and the surname drawn
 * in type; the real cover, when there is one, sits on top (site.js fades it in, and takes it away if it
 * fails, so a dead cover looks like no cover). Sized by the box: the title at 15% of its width. */
@media (prefers-color-scheme: dark) {
  .cv-box {
    outline: 1px solid var(--line);
    outline-offset: -1px;
  }
}

.cv-box {
  position: relative;
  display: block;
  overflow: hidden;
  color: #f4f4f0;
  container-type: inline-size;
}

.cv-box > .cv {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--rc);
}

.cv-box > .cv.cv-wait {
  opacity: 0;
}

.cv-none {
  position: absolute;
  inset: 0;
  display: block;
  padding: 18cqw 10cqw 0;
  text-align: left;
}

.cv-none b {
  display: -webkit-box;
  overflow: hidden;
  font: 500 15cqi / 1.12 var(--display,'Newsreader',Georgia,serif);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

/* The title's size is a fixed scale of three steps (Juno, WS-63 N2-pre-2): L 15cqi, M 11.5cqi, S 9cqi, picked at build
   per title (cover-tone.mjs coverStep: the largest that wraps to 5 lines without splitting a word; S with hyphens when
   nothing else fits). A step that would draw under 12px hides the title instead (tone, hairline, surname), so no
   typeset title is ever under 12px: S under 133.33px wide, M under 104.35px, L under 80px. */
.cv-box .cv-none b{font-size:15cqi;-webkit-line-clamp:5}
.cv-box .cv-none b.cv-m{font-size:11.5cqi}.cv-box .cv-none b.cv-s{font-size:9cqi}.cv-box .cv-none b.cv-hy{-webkit-hyphens:auto;hyphens:auto;overflow-wrap:anywhere}
/* A cv-hy title carries soft hyphens in its long words (cover-tone.mjs softHyphens), so it breaks with a hyphen even
   with no dictionary; where the browser has one, it keeps at least 4 letters either side of a break. Anything left
   breaks anywhere rather than run off the cover. */
@supports (hyphenate-limit-chars:10 4 4){.cv-box .cv-none b.cv-hy{hyphenate-limit-chars:10 4 4}}
@container (max-width:133.34px){.cv-box .cv-none b.cv-s{visibility:hidden}}
@container (max-width:104.35px){.cv-box .cv-none b.cv-m{visibility:hidden}}
@container (max-width:79.99px){.cv-box .cv-none b{visibility:hidden}}

/* The hairline sits about 11% of the height above the bottom (16cqw of the width), the surname under it with
   room to breathe, never on the edge. */
.cv-none i {
  position: absolute;
  right: 10cqw;
  bottom: 0;
  left: 10cqw;
  overflow: hidden;
  height: 16cqw;
  padding-top: 2.5cqw;
  border-top: 1px solid rgb(244 244 240 / 0.3);
  font: 400 max(9px, 9cqw) / 1 var(--sans,'Public Sans',system-ui,-apple-system,'Segoe UI',sans-serif);
  font-style: normal;
  white-space: nowrap; /* never cut: fit.js hides a surname that doesn't fit (Juno on #367) */
}

/* Under 64px wide (list thumbnails): the title alone. */
@container (max-width: 63.98px) {
  .cv-none {
    padding: 10cqw 8cqw 0;
  }

  .cv-none i {
    display: none;
  }
}

.cvt-history {
  background: #3a3f5a;
}

.cvt-lives {
  background: #4a3c52;
}

.cvt-society {
  background: #2f4a4a;
}

.cvt-politics {
  background: #44303d;
}

.cvt-economics {
  background: #2c4a3b;
}

.cvt-business {
  background: #3a4651;
}

.cvt-nature {
  background: #34492f;
}

.cvt-science {
  background: #234059;
}

.cvt-technology {
  background: #333a44;
}

.cvt-health {
  background: #2d4c55;
}

.cvt-mind {
  background: #3e3d5e;
}

.cvt-philosophy {
  background: #2b2b38;
}

.cvt-arts {
  background: #4a3838;
}

.cvt-none {
  background: #2b2b38;
}
/* R3-93 (Juno): a small box is a typeset mini-cover, never a lone letter and never a blank slab. The old one-letter
   tile (UX-27) is retired; its <em class="cv-ini"> stays in the markup until the next full rebuild, never shown.
   96 to 133 px: every title step at 12cqi, up to 5 lines. 48 to 95 px: the title at max(8px, 14cqi), up to 4 lines,
   over the hairline where the surname sits on a big cover. Under 48 px: no type; a title-block mark (a 2 px rule
   over a 1 px rule) and the same hairline. The text is decoration: .cv-none is aria-hidden, and the row names the book.
   A home fan (.dh-fc, .dh-hc) and an opener strip (.strip) keep their own rules: their covers overlap, so a title there would be cut (Vera A on app #631).
   Long words break with a real hyphen (hyphens:auto, lang="en"); a word still too wide is clipped, never split (Juno). */
.cv-box .cv-none .cv-ini{display:none}
@container (min-width:96px) and (max-width:133.34px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-m,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-s{visibility:visible;font-size:12cqi;-webkit-line-clamp:5;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:normal;word-break:normal}}
@container (max-width:95.98px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none{padding:12cqw 10cqw 0}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none i{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-m,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-s{visibility:visible;font-size:max(8px,14cqi);line-height:1.15;-webkit-line-clamp:4;-webkit-hyphens:auto;hyphens:auto;overflow-wrap:normal;word-break:normal}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none::after{content:'';position:absolute;left:10cqw;right:10cqw;bottom:16cqw;border-top:1px solid rgb(244 244 240/.3)}}
/* A title whose longest word would not fit a small tier's size steps down to the size it fits (cv-wN, coverFit at build and in
   cover-box.js), to the 8 px floor; only under the floor is a word clipped (Juno, R3-93 follow-up). */
@container (min-width:96px) and (max-width:133.34px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w11{font-size:max(8px,11cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w10{font-size:max(8px,10cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w9{font-size:max(8px,9cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w8{font-size:max(8px,8cqi)}}
@container (max-width:95.98px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w13{font-size:max(8px,13cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w12{font-size:max(8px,12cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w11{font-size:max(8px,11cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w10{font-size:max(8px,10cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w9{font-size:max(8px,9cqi)}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w8{font-size:max(8px,8cqi)}}
/* ...and where even the 8 px floor can't fit that word (a box under 800/N px), the title-block mark stands in for the title,
   so no word is ever clipped (Juno, R3-93 follow-up). */
@container (max-width:99.99px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w8{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w8)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:88.88px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w9{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w9)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:79.99px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w10{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w10)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:72.72px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w11{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w11)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:66.66px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w12{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w12)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:61.53px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w13{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w13)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:57.13px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w14{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w14)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:53.32px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w15{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w15)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:49.99px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-w16{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none:has(> b.cv-w16)::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
/* Under 64 px a typeset cover sits in a row that already names the book (the rate strip, search, Ask, shelf lists), so it
   always shows the title-block mark: text there only repeats the row, and mixing the two looks uneven (Juno, Vera B on
   #644). Fans keep their own rules; Discover's subject and genre tiles (.dh-sc) name a subject, so their covers keep the tiers. */
@container (max-width:63.98px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip, .dh-sc) *) .cv-none b,.cv-box:not(:is(.dh-fc, .dh-hc, .strip, .dh-sc) *) .cv-none b.cv-m,.cv-box:not(:is(.dh-fc, .dh-hc, .strip, .dh-sc) *) .cv-none b.cv-s{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip, .dh-sc) *) .cv-none::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
@container (max-width:47.98px){.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-m,.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none b.cv-s{visibility:hidden}.cv-box:not(:is(.dh-fc, .dh-hc, .strip) *) .cv-none::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}}
/* Home's fans (.dh-fc, .dh-hc): the covers overlap, so a typeset card shows the title-block mark and the hairline,
   never its title (home.css hides the text), at every size and on the front cover too: never a blank block (R3-45),
   never a clipped title (Juno, R3-93 follow-up, Vera A on app #631). */
:is(.dh-fc,.dh-hc) .cv-box:not(:has(> img)) .cv-none::before{content:'';position:absolute;left:12cqw;right:12cqw;top:16cqw;height:20cqw;border-top:max(2px,3cqw) solid rgb(244 244 240/.75);border-bottom:1px solid rgb(244 244 240/.3)}
:is(.dh-fc,.dh-hc) .cv-box:not(:has(> img)) .cv-none::after{content:'';position:absolute;left:10cqw;right:10cqw;bottom:16cqw;border-top:1px solid rgb(244 244 240/.3)}
/* shared:cover-box end */
/* §7.7 (Vera R2, #284): the open block is about 108 px, not 158. Read, the readout and Undo draw at 20 px and keep
   their 44 px targets in padding that overhangs the 8 px gaps, so nothing moves and every target stays 44 px. */
.ri-wrap:has(.ri-stars) .ri-done,.ri-tools .ri-link{min-height:20px;padding-top:12px;padding-bottom:12px;margin-top:-12px;margin-bottom:-12px}
.ri-stars{position:relative;z-index:1}

/* ---- Book page actions block (SPEC-SHELL §7.9, Seph 02:00 Nov 9) ----
   Phone: Save and I've read it as two equal columns, Buy on Amazon full width under them, the disclosure 8 px below.
   Desktop: all three in one row, each sized to its content. Read: the rating block takes row 1 at full width. */
.bk .bk-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.bk .bk-acts .pair {
  display: flex;
  flex: 1 1 100%;
  gap: 8px;
}
.bk .bk-acts .pair > *:not([hidden]) {
  flex: 1 1 0;
}
/* On a phone the pair's two halves are about 138 px: each label holds one line (Vera on #371), so the side padding
   gives way to the label, never the other way round. */
@media (max-width: 599.98px) {
  .bk .bk-acts .pair .btn,
  .bk .bk-acts .pair .ri {
    padding-inline: 8px;
    gap: 6px;
    white-space: nowrap;
  }
}
.bk .bk-acts > .btn {
  flex: 1 1 100%;
}
/* Narrower than any phone we gate on (Vera B's 260 rig): the pair's two one-line labels no longer fit side by side, so
   they stack, each full width, rather than run past the edge. */
@media (max-width: 299.98px) {
  .bk .bk-acts .pair {
    flex-direction: column;
  }

  .bk .bk-acts .pair > .ri {
    margin-left: 0;
  }
}
.bk .bk-acts .btn,
.bk .bk-acts .ri {
  min-height: 44px;
  padding: 0 24px;
  border-radius: var(--r-control);
  font: 600 15px / 20px var(--sans);
}
.bk .bk-acts .ri {
  justify-content: center;
  border: 1px solid var(--ink);
  color: var(--ink);
}
.band .bk-acts .ri {
  border-color: var(--band-ink);
  color: var(--band-ink);
}
@media (hover: hover) {
  .bk .bk-acts .ri:hover span {
    text-decoration: none;
  }
}
.bk .bk-acts .ri[hidden] {
  display: none;
}
.bk .bk-acts .ri-wrap:empty {
  display: none;
}
.bk .bk-succ {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 20px;
  color: var(--soft);
}
.bk .bk-print a {
  display: inline-block;
  padding-block: 12px;
  margin-block: -12px;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.bk .bk-succ + .note,
.bk .bk-acts + .note,
.bk .mc + .note {
  margin-top: 8px;
  font-size: 13px;
  line-height: 18px;
}
/* A club member's "Suggest to {Club}" line (my-clubs.js drawBookAction) comes after /api/me/clubs: its room is kept from
   the first paint when this browser's last answer had one (session-state.js data-club-due), so the disclosure under it
   never moves (R3-42). The same space .mc takes: its top margin, its own height last time at this width (--mc-h, VB-46:
   a long club name wraps to two rows) or one tap row, then the note's own 8px. */
:root[data-signed-in][data-club-due] .bk .bk-acts + .note {
  margin-top: calc(var(--s2) + var(--mc-h, var(--tap)) + 8px);
}
@media (min-width: 600px) {
  /* R3-86 (Vera B VB-41): "Read / Rate it" or "Your rating" takes the room Save and "I've read it" had, on the same
     line as Buy, so a book already read draws at the row's own height: nothing below moves. --ri-w is that room,
     measured by read-it.js before the swap. Only the open rating prompt or an error takes a line of its own. */
  .bk .bk-acts .pair:not(:has(.ri-prompt, .ri-error)) {
    display: contents;
  }
  .bk .bk-acts .pair > *:not([hidden]),
  .bk .bk-acts > .btn {
    flex: none;
  }
  .bk .bk-acts .ri-wrap {
    min-width: var(--ri-w, 0);
  }
}
/* R3-86 (Juno): a rating folded on the book page: dot, five 18 px laurels 3 px apart, the words, then Change, on one
   44 px line. If the room is narrower than the line, the words go under the laurels in the same box, never a new row. */
.bk .ri-rated {
  flex-wrap: wrap;
  column-gap: var(--s1);
  row-gap: 0;
  min-width: 0;
}
.bk .ri-rated .ri-glyphs {
  display: inline-flex;
  gap: 3px;
  color: var(--laurel);
}
.bk .ri-rated .ob-glyph svg {
  display: block;
  width: 18px;
  height: 18px;
}
.bk .ri-rated .ob-glyph:not(.on) svg {
  opacity: var(--laurel-off);
}
/* R3-99 (Juno): an old half value draws a half laurel: a dimmed laurel, its left half drawn whole over it (a 12-unit
   view of the same laurel, half as wide). */
.bk .ri-rated .ob-glyph.ob-half {
  position: relative;
}
.bk .ri-rated .ob-glyph.ob-half > svg:first-child {
  opacity: var(--laurel-off, 0.3);
}
.bk .ri-rated .ob-glyph.ob-half > svg.ob-half-on {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  opacity: 1;
}
.bk .ri-rated .lr-stem {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
}
.bk .ri-rated .lr-leaf {
  fill: currentColor;
}
.bk .ri-wrap:has(.ri-rated) {
  flex-wrap: nowrap;
  column-gap: var(--s2);
}
/* Stacked, Change sits on the words' line, the second one, not between the two (Juno). */
.bk .ri-wrap:has(.ri-stack) > .ri-change {
  align-self: stretch;
  align-items: flex-end;
  padding-bottom: 1px;
}
.bk .ri-rated.ri-stack {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-content: center;
  column-gap: var(--s1);
  row-gap: 4px;
}
.bk .ri-rated.ri-stack > .ri-check {
  grid-row: span 2;
}
.bk .ri-rated .ri-words {
  font-size: var(--fs-small);
}
.bk .ri-rated.ri-stack .ri-words {
  line-height: 18px;
}
@media (min-width: 600px) {
  .bk .bk-acts .pair:has(.ri-prompt, .ri-error) > .ri-wrap {
    flex: 1 1 100%;
  }
}

/* Book page cover box pinned at 240 on desktop, every book the same (SPEC-SHELL §4; Juno, #300). */
@media (min-width: 900px) {
  .bk-c .cov,
  .bk-c .cov-sm {
    width: 240px;
    max-width: 240px;
  }
  /* A jacket only checked small (128 px) sits centred in the same 240×360 box at 1.5× at most (192), on a --sunk
     mat (gallery's --soft) with a 1 px --line edge, so it never blurs and the frame never changes size (Juno, #300). Without the jacket,
     the drawn cover fills the box as before. */
  .bk-c .cov-sm:has(> img.cv) {
    background: var(--sunk);
    box-shadow: inset 0 0 0 1px var(--line);
  }
  .bk-c .cov-sm:has(> img.cv) > .cv-none {
    display: none;
  }
  .bk-c .cov-sm > img.cv {
    inset: 50% auto auto 50%;
    width: 192px;
    height: 288px;
    transform: translate(-50%, -50%);
  }
}

/* ==== Genre pages (SPEC-GENRES-SWITCH §3) ========================================================= */

/* "in <genre>" over a sub-genre's heading. */
.opener .g-in {
  margin-bottom: var(--s1);
  color: var(--band-soft);
  font-size: var(--fs-small);
}

.opener .g-in a,
.g-subs a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

/* The sub-genre row (Juno, polish PL6): links 24 px apart with no commas, each with its count in soft ink; the
   current one is ink, semi-bold and not underlined. An item that doesn't fit starts the next line whole. */
.g-subs {
  margin-top: var(--s3);
}

.g-subs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-subs li {
  display: inline-flex;
  align-items: baseline;
  line-height: 44px;
}

/* Each sub-genre link is a 44 px target, the gate on every tap (Vera's device pass, Nov 12); the whole line
   shares that height, so "All", the links and the commas keep one baseline. */
.g-subs a {
  display: inline-block;
}

.g-subs strong {
  font-weight: 600;
  color: var(--band-ink);
}

.g-subs .n {
  color: var(--band-soft);
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

/* On phones the row is one line that scrolls sideways (Juno, #658): the same links in the same order, the page
   gutter at both ends, the next link peeking at the right edge, no arrows or visible scrollbar. The links stay
   tabbable, and sub-row.js scrolls the current one just into view before the row first paints; once the row is
   scrolled, its leading edge fades (Juno, after #733). */
@media (max-width: 599px) {
  .opener > div {
    min-width: 0;
  }

  .g-subs {
    margin-inline: calc(-1 * var(--gut));
  }

  .g-subs ul {
    flex-wrap: nowrap;
    gap: 0 16px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--gut);
    padding-inline-start: var(--gut);
    scrollbar-width: none;
  }

  .g-subs ul::-webkit-scrollbar {
    display: none;
  }

  .g-subs ul[data-back] {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32px);
    mask-image: linear-gradient(to right, transparent 0, #000 32px);
  }

  .g-subs li {
    flex: none;
    white-space: nowrap;
    scroll-snap-align: start;
  }

  /* The end gutter sits on the last item: a scroller's own end padding is dropped by some engines. */
  .g-subs li:last-child {
    padding-inline-end: var(--gut);
  }

  /* Unseen for the moment before sub-row.js places the row, so it never paints at the start and jumps (Vera B,
     VB-65); shown after 1 s whatever happens. */
  .g-subs:has([aria-current]) ul:not([data-placed]) {
    visibility: hidden;
    animation: g-subs-show 0s 1s forwards;
  }
}

@keyframes g-subs-show {
  to {
    visibility: visible;
  }
}

/* "Stoa's picks": the heading over a genre's list, in the list column above the count bar (§3.1). */
.part-h {
  margin-bottom: var(--s3);
  font-size: var(--h-sub);
  line-height: 1.2;
}

/* "More in <genre>" (§3.1): always rows, under the picks in the same column, spaced as "Stoa's picks" is. */
.more {
  margin-top: var(--s5);
}

.rows.more-rows {
  display: block;
}

.more .part-n {
  margin-bottom: var(--s3);
}

/* A genre heading with a word too long for the hero size at 320 ("entrepreneurship"): the next size down, never cut. */
@media (max-width: 399.98px) {
  .opener h1.long {
    font-size: min(var(--fs-h1), 10.5vw);
  }
}

/* A book title with a word too wide for the 144 px column beside the cover at 320 ("Empowered"): the next size down,
   22 px, the floor (Juno). If a word is still wider than the column there ("Entrepreneurship"), the title goes full width
   under the cover; a word wider than that again ("Supercommunicators") breaks with a visible hyphen. The build measures
   which (gallery.mjs titleFit). */
@media (max-width: 399.98px) {
  .bk h1.long {
    font-size: 22px;
  }

  .bk:has(h1.wide),
  .bk:has(h1.tall) {
    grid-template-areas:
      'cr cr'
      'cv .'
      'hd hd'
      'rs rs';
  }

  .bk:has(h1.wide) .bk-h,
  .bk:has(h1.tall) .bk-h {
    margin-top: var(--s3);
  }
}

/* A title of more than four lines beside the cover starts level with the cover's top, not low beside it (Juno on VB1). */
@media (max-width: 899.98px) {
  .bk:has(h1.tall) {
    align-items: start;
  }
}

/* Narrower than any phone we test (Vera B's WebKit at 260): a full-width title sizes down with the screen, so its widest
   word ("Supercommunicators", 231 px at 22 px) still fits whole rather than breaking without a hyphen. 240 is the widest
   full-width word in the catalog at 22 px, with room; test/long-titles.test.mjs fails the build if one goes past it. */
@media (max-width: 299.98px) {
  .bk h1.wide {
    font-size: min(22px, calc((100vw - 2 * var(--gut)) * 22 / 240));
  }

  /* Beside the cover a title gets only 84 to 123 px under 300, so "Thinking, Fast and Slow" broke as "Thinki" / "ng,"
     and was clamped (Vera B, live 56acdd7). Every title goes full width under the cover here, at its own size. */
  .bk {
    grid-template-areas:
      'cr cr'
      'cv .'
      'hd hd'
      'rs rs';
  }

  .bk .bk-h {
    margin-top: var(--s3);
  }
}

/* On a wide screen the same word beside the cover strip ran under it at 1280 to 1440 (Vera B, Nov 14): the next size
   down there too, and a long word still never leaves its column. */
@media (min-width: 900px) {
  .opener h1.long {
    font-size: var(--fs-h1);
  }
}

/* Between 900 and 1280 the five-cover strip left a long word ("entrepreneurship", 495 px at 60 px) a 156 to 496 px
   column, so it broke mid-word (Vera B on #540). There the strip shows two covers, then three, and the word sits whole. */
@media (min-width: 900px) and (max-width: 1099.98px) {
  .opener:has(h1.long) .strip .cov:nth-child(n + 3) {
    display: none;
  }
}

@media (min-width: 1100px) and (max-width: 1279.98px) {
  .opener:has(h1.long) .strip .cov:nth-child(n + 4) {
    display: none;
  }
}

.opener h1 {
  overflow-wrap: break-word;
  hyphens: auto;
}

/* A person's page: the band has no rule above a list of rows, so the first hairline sits 40px under the count line,
   the same gap as on a genre page (Juno on #581, Nov 15; was the opener's padding plus a section gap, about 100px). */
.sunk-band:has(> .person):has(+ .sec .rows) > .person {
  padding-bottom: 0;
}

.sunk-band:has(> .person) + .sec:has(> #list) {
  margin-top: 40px;
}

/* ---- "Suggest to {Club}" / "Make this my pick" on a book page (SPEC-MY-SHELF-AND-CLUBS §3a, §3e): club members only,
   one quiet line under the actions, in ink like "I've read it" ---- */

.mc {
  margin-top: var(--s2);
}

/* my-clubs.js measures the line here on a visit that doesn't draw it (VB-46): no height, so nothing moves. */
.mc.mc-probe {
  height: 0;
  margin: 0;
  overflow: hidden;
  visibility: hidden;
}

.mc-b,
.mc-c,
.mc-u {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: 600 var(--fs-body) / 1.3 var(--sans);
  text-align: left;
  cursor: pointer;
}

@media (hover: hover) {
  .mc-b:hover,
  .mc-c:hover,
  .mc-u:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }
}

.mc-b[disabled] {
  opacity: 0.6;
  cursor: default;
}

.mc-l {
  margin: 0 0 var(--s1);
  padding: 0 0 0 var(--s3);
  border-left: 2px solid var(--line);
  list-style: none;
}

.mc-l[hidden] {
  display: none;
}

.mc-s {
  margin: 0;
  color: var(--soft);
  font-size: var(--fs-small);
}

.mc-s:empty {
  display: none;
}

.mc-u {
  min-height: 0;
  font-size: var(--fs-small);
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* R3-1 (Juno, round 3): under 600 every list of books takes search's S7 row. F3 (UX audit Nov 28): its one status
   control is labelled, as on /browse, on a 40 px line under the title, its target 44 px tall. */
@media (max-width: 599.98px) {
  /* VB-59 (Vera B on #653): the icons sit on one 40 px line under the title, the slot a read or rated row's line
     takes (two lines of a long rating fit it too), so a row is the same height before and after the member's shelf arrives and nothing below it moves. */
  li.row.row:has(> .sv-ri) {
    grid-template-columns: 56px minmax(0, 1fr);
  }
  li.row.row > .sv-ri {
    grid-column: 2;
    grid-row: 2;
    align-self: start;
    justify-self: start;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    min-height: 40px;
    margin: 4px 0 0 -4px;
  }
  li.row.row > .sv-ri .sv-s {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    min-height: 44px;
    padding: 0 4px;
    margin: -2px 0;
    font-size: 14px;
    white-space: nowrap;
  }
  /* Read, rated or rating it (Seph's iPhone, Nov 22): the words never squeeze into the 44 px icon column. Once
     I've read it has its line, the row gives up the column and the line sits under the title, as search's S7 row:
     the filled check and "Your rating: Loved it (only you)", or the laurels while a rating is given. */
  li.row.row > .sv-ri:has(> .ri-wrap:not(:empty)) {
    justify-self: stretch;
    margin: 4px 0 0;
  }
  li.row.row > .sv-ri > .ri-wrap > .ri-done {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0;
    margin: 0;
    font-size: var(--fs-small);
    line-height: 20px;
    text-align: left;
  }
  li.row.row > .sv-ri > .ri-wrap > .ri-done > .ri-check {
    flex: none;
  }
  /* More like this: after the status control, or on its own line where the two don't fit (320). */
  li.row.row > .sv-ri:has(> .ml-a) {
    flex-wrap: wrap;
    column-gap: 16px;
  }
  li.row.row > .sv-ri .ml-a {
    height: 44px;
    margin: -2px 0;
    padding: 0 4px;
  }
}

/* A prize page's pager names its pages by year (Juno, page-size fix): "2025 to 2021" needs side room a number doesn't. */
.pager .yr {
  padding: 0 var(--s3);
}

.pager .yp-now {
  display: none;
}

/* A prize page's pager on a phone: one row, Previous, "2025 to 2017, 1 of 4", Next (Juno on #577). The year buttons
   need about 650 px with Previous and Next, so they come back from 760; below that the label may wrap inside its slot. */
@media (max-width: 759px) {
  .pager.yp {
    flex-wrap: nowrap;
  }

  .pager.yp .yr {
    display: none;
  }

  .pager.yp .yp-now {
    display: block;
    flex: 1;
    min-width: 0;
    padding: 0 var(--s2);
    color: var(--ink);
    font-weight: 600;
    text-align: center;
  }

  /* If it must wrap at 320, it breaks after the comma, never inside the years. */
  .pager.yp .yp-now b {
    font-weight: inherit;
    white-space: nowrap;
  }

  .pager.yp .nx {
    flex: none;
    margin-left: 0;
  }
}

@media (max-width: 599px) {
  /* Other categories of a prize: one column, so a long name like Biography/Autobiography never runs into its neighbour. */
  .subj-pz {
    grid-template-columns: minmax(0, 1fr);
  }
}

.bk .subj-l.bm-b {
  margin-top: 0;
}

/* Recommended by N people (PEOPLE-AND-LISTS §3; people.mjs), with the People switch 'on': one compact row a person,
   a 32 px typeset monogram, the name linking to their page, then the source and date as meta. Rows past 5 sit in a
   closed <details>, so the first five hold their height from first paint and nothing moves until the reader asks. */
.mono{display:inline-grid;place-items:center;flex:none;width:32px;height:32px;border-radius:2px;background:#3a3f5a;color:#f4f4f0}
.mono b{font:500 14px/1 var(--display);letter-spacing:.02em}
.bk-body .rb-l li{display:flex;gap:var(--s3);align-items:flex-start}
.bk-body .rb-l .mono{margin-top:0}
.bk-body .rb span.rb-n{display:inline-flex;align-items:center;min-height:32px;font-weight:600}
.rb-t{min-width:0}
.bk-body .rb a.rb-n{display:inline-flex;align-items:center;min-height:44px;margin-block:-6px;font-weight:600;color:var(--ink)}
.rb-m{margin:0;font-size:var(--fs-meta);line-height:20px;color:var(--soft)}
.bk-body .rb-m a{display:inline-flex;align-items:center;min-height:44px;margin-block:-12px;color:var(--soft)}
.rb-more > summary{display:inline-flex;align-items:center;min-height:44px;margin-top:var(--s2);cursor:pointer;list-style:none;font-weight:600;text-decoration:underline;text-underline-offset:4px}
.rb-more > summary::-webkit-details-marker{display:none}
.rb-more[open] > summary{display:none}

/* Apple Books (books.mjs appleBadge): Apple's official badge, unaltered, under the description's credit. 100 px high, Apple's
   digital minimum, with 0.25x clear space (25 px) around it; no underline, shadow or effect on it. */
.bk-body .apple-b{margin:25px 0 0;padding:0;line-height:0}
.bk-body .apple-b a{display:inline-block;padding:0;text-decoration:none}
.bk-body .apple-b img{display:block;width:352px;max-width:100%;height:auto}
.bk-body .apple-b a:focus-visible{outline:2px solid var(--ink);outline-offset:4px}
/* Recommended by: the person's role line under the name (PEOPLE-AND-LISTS §3). */
.rb-r{margin:0;font-size:var(--fs-meta);line-height:20px;color:var(--ink)}

/* Recent standouts on a genre page (Seph 20:35Z Nov 23): the page's ranked books from 2020 on that people we cite
   recommend, as a rail between the spotlight and Stoa's picks, with the section's own room under it. */
.rcs {
  margin-bottom: var(--s6);
}
/* What "recent" means, under the heading (Juno on #703). */
.rcs .rcs-d {
  margin: -4px 0 16px;
  color: var(--soft);
  font-size: var(--fs-meta);
  line-height: 20px;
}
/* The Home card from #702: author right under the title, the actions at the foot (Juno on #703). The tiles don't
   share title rows here, so a one-line title leaves no band before the author. */
.gx .rcs .rail {
  grid-template-rows: auto;
}
.gx .rcs .card {
  display: flex;
  flex-direction: column;
  grid-row: auto;
}
.gx .rcs .card h3 {
  min-height: 0;
}
.gx .rcs .card .sv-ri {
  align-self: stretch;
  margin-top: auto;
  padding-top: 8px;
}

/* The book page's club picker (Juno, Nov 24): each club a 44px row with its tile and name; a club that already has the
   book shows a check and "On {Club}'s shelf", disabled. */
.mc-c {
  gap: var(--s2);
  width: 100%;
  /* A two-line row (name, then On {Club}'s shelf) keeps air above and below it (Vera, #721). */
  padding-block: 6px;
  font-weight: 400;
}

.mc-t {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-control);
  object-fit: cover;
  background: var(--soft);
  font: 600 14px/1 var(--sans);
  color: var(--soft);
}

.mc-x {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
}

.mc-n {
  overflow-wrap: break-word;
}

.mc-has {
  display: inline-flex;
  align-items: flex-start;
  gap: 4px;
  font: 400 14px/20px var(--sans);
  color: var(--soft);
}

.mc-c[disabled] {
  cursor: default;
}

.mc-c[disabled] .mc-n {
  color: var(--soft);
}

@media (hover: hover) {
  .mc-c[disabled]:hover {
    text-decoration: none;
  }
}

.mc-has svg {
  flex: none;
  margin-top: 1px;
}

/* Every club holds the book: muted, with its check, at full opacity (Juno, #721). */
.mc-b.mc-held[disabled] {
  gap: 6px;
  color: var(--soft);
  opacity: 1;
}

/* R3-104 (Juno): the genre and list pages' lede and row lines wrap with pretty, as in reading-room.css, so none ends on a one-word line. */
.lede,.row-why{text-wrap:pretty}
/* 4b (Juno's mock 10): a genre page's ranked rows, in the genre's own order, lead with their place, out of the grid. */
.row.row-rk{padding-left:44px}
.rk-n{position:absolute;left:0;top:var(--s3);width:38px;font:500 22px/1 var(--display,Newsreader,Georgia,serif);color:var(--ink);font-variant-numeric:tabular-nums;white-space:nowrap}
@media (min-width:900px){.row.row-rk{padding-left:56px}.rk-n{width:48px;font-size:28px}}
/* Book page: the author line leads as the subtitle does, 26 px, when it wraps (Juno, Nov 28). The links stay inline,
   their 4 px padding still widening each tap target inside the line, never pushing the lines apart. */
.bk .by{line-height:26px}
.bk .by a{display:inline}
/* A genre page's Grade group (Juno, Nov 28): the mark before the words, the count after, as the /browse menu. */
.opt-g .stg-m{flex:none}
.opt-g .opt-n{margin-left:auto;color:var(--mut);font-variant-numeric:tabular-nums}

/* Book page: Compare's quiet entry under More like this (scripts/gallery.mjs). */
.sim-cmp{margin:4px 0 0}
.sim-cmp a{display:inline-flex;align-items:center;min-height:44px;color:var(--accent);font:600 var(--fs-small,.9375rem)/1.3 var(--sans,system-ui,sans-serif);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;text-decoration-color:color-mix(in srgb,var(--accent) 45%,transparent)}
/* Genre page: its reading path, under the lede (scripts/paths.mjs withPathLink). */
.g-path{margin:12px 0 0}
.g-path a{display:inline-flex;align-items:center;min-height:44px;color:var(--accent);font:600 var(--fs-small,.9375rem)/1.3 var(--sans,system-ui,sans-serif);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px;text-decoration-color:color-mix(in srgb,var(--accent) 45%,transparent)}
