/* Page layer for redesigned pages (home now, listings and entries as they are ported). Loaded after shell.css. */
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 500; color: var(--ink-strong); text-wrap: balance; }
p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; }
a { color: var(--brand-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
button { font: inherit; color: inherit; }
code, kbd, samp, pre { font-family: var(--font-mono); }
code { font-size: .875em; }
mark { background: var(--mark); color: var(--mark-ink); border-radius: 2px; padding: 0 1px; }
.btn:active, .chip:active, .folder:active, .copy:active, .pg-step:active, .pager a:active { transform: translateY(1px); }
.wrap-wide { width: min(100% - 2 * var(--gutter), var(--wide)); margin-inline: auto; }
.num { font-variant-numeric: tabular-nums lining-nums; }

/* ---------- masthead (blueprint sheet) ---------- */
.masthead { position: relative; isolation: isolate; padding-top: clamp(28px, 4.2vw, 56px); }
.masthead::before { content: ""; position: absolute; inset: 0 0 -160px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, var(--grid-major) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-major) 1px, transparent 1px),
    linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px; background-position: calc(50% + 12px) -1px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 92%); mask-image: linear-gradient(to bottom, #000 0, #000 45%, transparent 92%); }
.masthead .wrap { position: relative; }
.reg { position: absolute; width: 22px; height: 22px; color: var(--line-strong); stroke-width: 1; }
.reg-tl { left: -34px; top: -6px; } .reg-tr { right: -34px; top: -6px; }
@media (max-width: 1290px) { .reg { display: none; } }
.hero-title { font-size: var(--step-display); line-height: var(--leading-display); letter-spacing: var(--tracking-display); }
.hero-title em { font-family: "EB Garamond Accent", var(--font-display); font-style: italic; color: var(--accent-display); padding-right: .04em; }
html:lang(zh-CN) .hero-title { font-size: calc(var(--step-display) * .9); letter-spacing: 0; }
html:lang(zh-CN) .hero-title em { font-style: normal; }
.lede { max-width: 64ch; margin-top: 16px; font-size: clamp(1.0625rem, 1rem + .28vw, 1.25rem); line-height: 1.5; color: var(--ink); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); }

.hero-search { position: relative; display: flex; align-items: center; height: 64px; margin-top: 28px;
  background: var(--bg-raised); border: 1px solid var(--border-input); border-radius: var(--r-panel);
  box-shadow: 3px 3px 0 var(--sheet); }
.hero-search:focus-within, .list-search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 3px 3px 0 var(--sheet), 0 0 0 6px color-mix(in srgb, var(--focus) 22%, transparent); }
.hero-search input:focus-visible, .list-search input:focus-visible, .pal-field input:focus-visible { outline: 0; box-shadow: none; }
.hero-search > .i { width: 22px; height: 22px; margin-left: 20px; color: var(--ink-2); }
/* Visible label sat on the field's top edge, like the label holder on a catalogue drawer. */
.hs-label { position: absolute; left: 16px; top: 0; transform: translateY(-55%); padding: 1px 8px; border: 1px solid var(--border-input);
  border-radius: 2px; background: var(--bg-raised); color: var(--ink-2); font-size: .75rem; font-weight: 500; line-height: 1.4; }
.hero-search input { flex: 1; min-width: 0; height: 100%; padding: 0 14px; border: 0; outline: 0; background: none;
  color: var(--ink-strong); font: 400 1.1875rem/1.2 var(--font-body); }
.hero-search input::placeholder { color: var(--ink-2); opacity: 1; }
.hero-search input::-webkit-search-cancel-button { display: none; }
.hs-side { display: flex; align-items: center; gap: 10px; padding-right: 14px; }
.hs-count { font: 400 .8125rem/1 var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.hs-clear { display: none; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: var(--r-control);
  background: none; color: var(--ink-2); cursor: pointer; }
.hs-clear:hover { color: var(--ink-strong); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.has-query .hs-clear { display: inline-flex; }
.has-query .hs-kbd { display: none; }
.hero-meta { display: flex; align-items: center; gap: 10px 18px; margin-top: 14px; }
.hero-star { height: 44px; padding: 0 16px; gap: 9px; font-size: .9375rem; }
.hero-star::after { inset: 0; }
.hero-star .i { width: 17px; height: 17px; }
.hero-stats { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 24px; font-size: .9375rem; color: var(--ink); }
.hero-stats strong { color: var(--ink-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.hero-stats a { color: var(--brand-ink); }
.hero-stats a:hover { color: var(--brand-strong); }
.s-sm { display: none; }
/* Fixed width: the JS relative time can never change whether this wraps, so it cannot shift the drawer (CLS). */
.hero-stats .updated { flex: none; min-width: 23ch; text-align: right; color: var(--ink-2); white-space: nowrap; }

/* ---------- folder tabs (target domains) ---------- */
.folders { position: relative; z-index: 2; display: flex; gap: 0; margin: 32px 0 -1px; padding: 0 8px; overflow-x: auto; scrollbar-width: none; }
.folders::-webkit-scrollbar { display: none; }
.folder { position: relative; z-index: 0; display: inline-flex; flex: none; align-items: center; gap: 8px; height: 46px; padding: 2px 20px 0;
  margin-right: -6px; color: var(--ink-2); font-size: 1rem; font-weight: 500; text-decoration: none; white-space: nowrap; }
.folder::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bg); border: 1px solid var(--line-strong);
  border-bottom: 0; border-radius: 7px 7px 0 0; transform: perspective(36px) rotateX(2.4deg); transform-origin: 50% 100%; }
.folder:hover { color: var(--ink-strong); }
.folder:hover::before { background: color-mix(in srgb, var(--surface) 55%, var(--surface-2)); }
.folder .i { width: 17px; height: 17px; color: var(--ink-2-panel); }
.folder .count { font: 500 .8125rem/1 var(--font-mono); color: var(--ink-2-panel); font-variant-numeric: tabular-nums; }
.folder[aria-current="true"] { z-index: 3; color: var(--ink-strong); font-weight: 600; }
.folder[aria-current="true"]::before { background: var(--surface); border-color: var(--panel-edge); }
.folder[aria-current="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; top: 0; height: 3px; background: var(--focus); }
.folder[aria-current="true"] .i, .folder[aria-current="true"] .count { color: var(--ink-strong); }
.folder:focus-visible { outline-offset: -5px; box-shadow: none; }
.folder:focus-visible::before { background: var(--secondary-soft); }

/* ---------- drawer (sage panel holding the cards) ---------- */
.drawer { --card-ground: var(--surface); position: relative; z-index: 1; padding: 20px 24px 24px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 0 var(--r-panel) var(--r-panel) var(--r-panel); }
.drawer-bar { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "chips meta sort"; align-items: center; gap: 6px 14px; margin-bottom: 12px; }
.drawer-bar .chips { grid-area: chips; }
.drawer-bar .select { grid-area: sort; }
.drawer-bar .drawer-meta { grid-area: meta; }
.drawer-meta { font-size: .8125rem; color: var(--ink-2-panel); white-space: nowrap; }
.drawer-meta strong { color: var(--ink-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 2px; }
/* Chips are the second filter layer: small, borderless text toggles under the folder tabs. */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 8px; border: 1px solid transparent;
  border-radius: var(--r-control); background: none; color: var(--ink); font-size: .8125rem; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap; }
.chip:hover { color: var(--ink-strong); background: color-mix(in srgb, var(--bg-raised) 60%, transparent); border-color: var(--line-strong); }
.chip .count { font: 400 .75rem/1 var(--font-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.chip .i { display: none; width: 14px; height: 14px; stroke-width: 2; }
.subject-nav .chip, .pal-recent .chip, .near .chip { height: 34px; padding: 0 11px; border-color: var(--line-strong); background: var(--bg-raised); font-size: .875rem; }
.chip[aria-pressed="true"] { background: var(--stamp-case-bg); color: var(--stamp-case-ink); border-color: var(--focus); box-shadow: inset 0 -2px 0 var(--focus); }
.chip[aria-pressed="true"] .i { display: block; }
.chip[aria-pressed="true"] .count { color: var(--stamp-case-ink); }
.chip:disabled { opacity: .5; cursor: default; }
.select { position: relative; display: inline-flex; align-items: center; }
.select select { appearance: none; height: 34px; padding: 0 34px 0 12px; border: 1px solid var(--border-input); border-radius: var(--r-control);
  background: var(--bg-raised); color: var(--ink); font: 500 .875rem/1 var(--font-body); cursor: pointer; }
.select .i { position: absolute; right: 9px; width: 16px; height: 16px; pointer-events: none; color: var(--ink-2); }
@media (min-width: 920px) {
  .drawer-bar .select select { height: 30px; font-size: .8125rem; }
  .drawer-bar .select-label { font-size: .8125rem; }
}
.select-label { font-size: .875rem; color: var(--ink-2-panel); margin-right: 8px; }
.kind-select { display: none; }
.drawer-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; margin-top: 22px; }
.drawer-foot .note { font-size: .875rem; color: var(--ink-2-panel); max-width: 70ch; }

/* ---------- index card (catalogue row) ---------- */
.cards { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; container-type: inline-size; }
.card { position: relative; min-width: 0; }
.card-face { position: relative; z-index: 1; display: grid; grid-template-columns: 92px minmax(0, 1fr) minmax(0, max-content);
  grid-template-areas: "call name stamp" "call desc targets"; column-gap: 20px; row-gap: 2px; padding: 12px 20px 12px 18px;
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: 2px 2px 0 var(--sheet); }
.callno { grid-area: call; padding-top: 3px; color: var(--callno); font: 500 .8125rem/1.5 var(--font-mono); letter-spacing: .04em; white-space: nowrap; }
.is-case .callno > span[aria-hidden] { padding: 2px 6px; background: var(--stamp-case-bg); color: var(--stamp-case-ink);
  box-shadow: 0 0 0 1px var(--stamp-case-bg), 0 0 0 2px var(--bg-raised), 0 0 0 3px var(--label-case); border-radius: 1px; }
.card-name { grid-area: name; font: 600 1.0625rem/1.35 var(--font-body); letter-spacing: -.006em; color: var(--ink-strong); }
.card-name a { color: inherit; text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card:hover .card-name a, .card-name a:focus-visible { text-decoration: underline; text-decoration-thickness: 1px; }
.card-name a:focus-visible { outline: 0; box-shadow: none; }
.card-face:has(.stretch:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; box-shadow: 2px 2px 0 var(--sheet), 0 0 0 7px color-mix(in srgb, var(--focus) 20%, transparent); }
.card-desc { grid-area: desc; color: var(--ink); font-size: .9375rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-targets { grid-area: targets; list-style: none; display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start;
  gap: 4px 14px; max-width: 270px; padding-top: 3px; margin-right: 12px; color: var(--ink); font-size: .875rem; line-height: 1.4; }
.card-targets li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.card-targets .i { width: 15px; height: 15px; }
/* Signature: the corner folds back on hover/focus and the evidence slip slides out from under it. */
.card:hover .card-face, .card:focus-within .card-face { border-color: var(--border-input); }
.card-face::after { content: ""; position: absolute; top: -1px; right: -1px; z-index: 2; width: 30px; height: 30px;
  background: linear-gradient(to bottom left, var(--card-ground) 50%, var(--secondary) 50%, color-mix(in srgb, var(--secondary) 70%, var(--bg-raised)) 100%);
  filter: drop-shadow(-2px 2px 1px color-mix(in srgb, var(--ink-strong) 16%, transparent));
  transform: scale(0); transform-origin: 100% 0; transition: transform var(--t-slow) var(--ease); }
.card:hover .card-face::after, .card:focus-within .card-face::after { transform: scale(1); }
/* Review date stays visible; the pinned source is a slip that slides out from under the fold on hover or focus. */
.stamp { grid-area: stamp; position: relative; z-index: 2; justify-self: end; display: inline-flex; align-items: center; gap: 5px; margin-right: 12px;
  padding-top: 3px; color: var(--ok-fg); font: 400 .78rem/1.5 var(--font-mono); white-space: nowrap; pointer-events: none; }
.stamp > .i { width: 13px; height: 13px; stroke-width: 2.2; }
.ev { position: absolute; right: calc(100% + 10px); top: 50%; display: inline-flex; gap: .5em; max-width: min(430px, 56vw); padding: 2px 8px; background: var(--surface-2);
  border: 1px solid var(--line-strong); box-shadow: 2px 2px 0 var(--sheet); color: var(--brand-ink); text-decoration: none; opacity: 0;
  transform: translate(14px, -50%); transition: transform var(--t-slow) var(--ease), opacity var(--t-base) var(--ease); }
.card:hover .ev, .card:focus-within .ev { opacity: 1; transform: translate(0, -50%); pointer-events: auto; }
.ev:hover { text-decoration: underline; }
@media (hover: none) { .ev { display: none; } }
.ev-repo { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sha { flex: none; color: var(--ink-2-panel); }
/* Narrow columns (tablet home, /resources/ beside the facets, related lists): description takes the full width. */
@container (max-width: 900px) {
  .card-face { grid-template-areas: "call name stamp" "call desc desc" "call targets targets"; }
  .card-targets { justify-content: flex-start; max-width: none; margin-right: 0; padding-top: 2px; }
}
/* Phones: stacked, with the review date beside the call number. */
@container (max-width: 560px) {
  .card-face { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "call stamp" "name name" "desc desc" "targets targets"; padding: 9px 12px 10px; row-gap: 3px; }
  .card-face::before { display: none; }
  .stamp { margin-right: 14px; padding-top: 2px; }
  .ev { display: none; }
  .card-targets { gap: 4px 12px; padding-top: 4px; }
  .card-targets li:nth-child(n+4) { display: none; }
}

/* ---------- sections ---------- */
.section { padding-top: clamp(56px, 7vw, 96px); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin-bottom: 24px; }
.section-head h2 { font-size: var(--step-h2); line-height: var(--leading-heading); letter-spacing: var(--tracking-h2); }
.section-head .count { font: 400 .875rem/1 var(--font-mono); color: var(--ink-2); }
.section-head .more { margin-left: auto; font-size: .9375rem; font-weight: 500; white-space: nowrap; }
.section-intro { max-width: 66ch; margin: -12px 0 24px; color: var(--ink-2); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--border-input);
  border-radius: var(--r-control); background: var(--bg-raised); color: var(--ink-strong); font-size: .9375rem; font-weight: 600;
  text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { color: var(--ink-strong); border-color: var(--ink-2); background: color-mix(in srgb, var(--bg-raised) 80%, var(--surface)); }
.btn-primary { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: var(--btn-ink); }
:root[data-theme="dark"] .btn-primary:hover { background: var(--accent-display); color: var(--btn-ink); }
.btn .i { width: 17px; height: 17px; }
.btn-quiet { border-color: transparent; background: none; color: var(--brand-ink); padding-inline: 10px; }
.btn-quiet:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); border-color: transparent; color: var(--brand-strong); }

/* ---------- hero layout: headline and standfirst side by side on wide screens ---------- */
.masthead > .wrap { display: flex; flex-direction: column; }
.hero-top { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: end; column-gap: clamp(32px, 4vw, 64px); }
.hero-top .lede { margin: 0; max-width: 46ch; padding-bottom: .55em; font-size: clamp(1rem, .95rem + .25vw, 1.125rem); color: var(--ink); }
@media (max-width: 1099px) {
  .hero-top { grid-template-columns: minmax(0, 1fr); }
  .hero-top .lede { margin-top: 14px; max-width: 62ch; padding-bottom: 0; }
}
@media (max-width: 767px) {
  .hero-top { display: contents; }
  .page-home .hero-title { order: 1; }
  .page-home .masthead .hero-search { order: 2; }
  .hero-top .lede { order: 3; margin-top: 12px; font-size: .9375rem; line-height: 1.45; }
  .hero-meta { order: 4; flex-direction: column; align-items: flex-start; margin-top: 12px; }
  .hero-stats { flex: none; align-self: stretch; display: block; font-size: .8125rem; }
  .s-lg { display: none; } .s-sm { display: inline; }
  .hero-stats .updated { min-width: 0; margin-top: 1px; text-align: left; }
  .page-home .masthead .folders { order: 5; }
  .masthead { padding-top: 14px; }
  .hero-title { line-height: 1; }
}

/* library-card margin rule between the call-number gutter and the entry */
.card-face::before { content: ""; position: absolute; top: 0; bottom: 0; left: 122px; width: 1px; background: color-mix(in srgb, var(--secondary) 70%, transparent); }
@media (max-width: 767px) {
  .drawer-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "kind sort" "meta meta"; gap: 8px; margin-bottom: 10px; }
  .drawer-bar .chips { display: none; }
  .drawer-bar .drawer-meta { font-size: .8125rem; }
  .drawer-bar .kind-select { display: inline-flex; grid-area: kind; }
  .drawer-bar .select select { width: 100%; height: 44px; font-size: .9375rem; }
  .drawer-bar .select { width: 100%; }
  .drawer-bar .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; height: 38px; }
  .drawer-meta { align-self: center; }
  .drawer-bar .select-label { display: none; }
}
.drawer-results-papers { margin-top: 18px; }
[aria-busy="true"] .cards { opacity: .55; transition: opacity var(--t-base) var(--ease); }

/* ---------- start here: catalogue guide cards (the tabbed dividers in a card drawer) ---------- */
.guides { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 20px; padding-top: 14px; }
.guide { position: relative; display: flex; flex-direction: column; gap: 10px; height: 100%; min-height: 128px; padding: 22px 20px 16px;
  background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: 0 var(--r-card) var(--r-card) var(--r-card);
  box-shadow: 2px 2px 0 var(--sheet); color: var(--ink-strong); text-decoration: none; }
.guide-tab { position: absolute; left: -1px; top: -24px; height: 24px; padding: 5px 12px 0; background: var(--surface); border: 1px solid var(--line-strong);
  border-bottom: 0; border-radius: 6px 6px 0 0; font: 500 .72rem/1.2 var(--font-mono); letter-spacing: .05em; color: var(--callno); }
.guide-task { font: 500 1.5rem/1.15 var(--font-display); letter-spacing: -.01em; text-wrap: balance; }
.guide-count { margin-top: auto; font-size: .875rem; color: var(--ink-2); }
.guide:hover { color: var(--ink-strong); border-color: var(--ink-2); }
.guide:hover .guide-task { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.guide:hover .guide-tab { background: var(--secondary); color: var(--stamp-case-ink); }
@media (max-width: 899px) { .guides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 539px) { .guides { grid-template-columns: minmax(0, 1fr); gap: 34px; } .guide { min-height: 0; } .guide-task { font-size: 1.375rem; } }

/* ---------- featured ---------- */
.feats { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.feat { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 18px; background: var(--bg-raised);
  border: 1px solid var(--line-strong); border-radius: var(--r-card); box-shadow: 4px 4px 0 var(--sheet); }
.feat-kind { display: flex; align-items: center; gap: 10px; font-size: .8125rem; font-weight: 500; color: var(--ink-2); }
.feat-code { padding: 2px 6px; font: 500 .7rem/1.3 var(--font-mono); letter-spacing: .05em; color: var(--ink-strong); background: var(--surface);
  box-shadow: 0 0 0 1px var(--surface), 0 0 0 2px var(--bg-raised), 0 0 0 3px var(--callno); }
.feat-cases .feat-code { background: var(--stamp-case-bg); color: var(--stamp-case-ink); box-shadow: 0 0 0 1px var(--stamp-case-bg), 0 0 0 2px var(--bg-raised), 0 0 0 3px var(--label-case); }
.feat h3 { font-size: clamp(1.625rem, 1.4rem + .8vw, 2.125rem); line-height: 1.08; letter-spacing: -.015em; }
.feat h3 a { color: var(--ink-strong); text-decoration: none; }
.feat:hover h3 a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.feat-desc { color: var(--ink); }
.feat-repo { display: flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 6px; font: 400 .8125rem/1.3 var(--font-mono); color: var(--ink-2); }
.feat-repo .i { width: 16px; height: 16px; }
.feat:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.feat .stretch:focus-visible { outline: 0; }
@media (max-width: 899px) { .feats { grid-template-columns: minmax(0, 1fr); } }

/* ---------- latest: date-gutter feed + unreviewed scan finds ---------- */
.latest { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.lt-feed { list-style: none; border-top: 1px solid var(--line-strong); }
.lt-day { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.lt-day > time { font: 500 1.25rem/1.3 var(--font-display); color: var(--ink-strong); font-variant-numeric: lining-nums; }
.lt-day ul { list-style: none; display: grid; gap: 7px; }
.lt-day li { display: grid; grid-template-columns: 80px minmax(0, 1fr); align-items: baseline; gap: 12px; }
.lt-call { font: 500 .72rem/1 var(--font-mono); letter-spacing: .04em; color: var(--callno); }
.lt-day a { color: var(--ink-strong); text-decoration: none; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-day a:hover { text-decoration: underline; color: var(--brand-strong); }
.lt-more a { font-weight: 500; color: var(--brand-ink); font-size: .9375rem; }
.scans { padding: 18px 20px 20px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-panel); }
.scans h3 { font-size: 1.375rem; }
.scans-note { margin-top: 6px; font-size: .875rem; color: var(--ink-2-panel); }
.scans ul { list-style: none; display: grid; gap: 12px; margin: 14px 0 16px; }
.scans li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline; }
.scans li a { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 .875rem/1.4 var(--font-mono); color: var(--ink-strong); }
.sc-desc { grid-column: 2; font-size: .8125rem; color: var(--ink-2-panel); }
.stamp-info { display: inline-flex; align-items: center; gap: 4px; padding: 1px 6px; border-radius: 2px; background: var(--info-bg); color: var(--info-ink);
  font: 500 .6875rem/1.4 var(--font-body); white-space: nowrap; }
.stamp-info .i { width: 12px; height: 12px; }
.scans-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: .875rem; font-weight: 500; }
@media (max-width: 899px) { .latest { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
@media (max-width: 539px) { .lt-day { grid-template-columns: minmax(0, 1fr); gap: 8px; } .lt-day li { grid-template-columns: 72px minmax(0, 1fr); } }

/* ---------- browse by category (lib.rs-style index) ---------- */
.cats { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 40px; }
.cat h3 { font-size: 1.375rem; line-height: 1.2; }
.cat h3 a { color: var(--ink-strong); text-decoration: none; }
.cat h3 a:hover { color: var(--brand-strong); text-decoration: underline; text-decoration-thickness: 1px; }
.cat h3 .count { font: 400 .8125rem/1 var(--font-mono); color: var(--ink-2); margin-left: 4px; }
.cat-note { margin-top: 4px; font-size: .9375rem; color: var(--ink-2); }
.cat-items { margin-top: 10px; font-size: .9375rem; line-height: 1.7; color: var(--ink-2); }
.cat-items a { color: var(--brand-ink); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.cat-items a:hover { text-decoration-color: currentColor; color: var(--brand-strong); }
.cat-items .cat-more { color: var(--ink); }
@media (max-width: 1023px) { .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .cats { grid-template-columns: minmax(0, 1fr); gap: 28px; } }

/* ---------- papers ---------- */
.papers-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 48px; align-items: start; }
.papers { list-style: none; border-top: 1px solid var(--line-strong); }
.paper { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 18px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.pp-date { font: 400 .8125rem/1.6 var(--font-mono); color: var(--ink-2); padding-top: 3px; }
.pp-title { font: 500 1.3125rem/1.25 var(--font-display); letter-spacing: -.005em; }
.pp-title a { color: var(--ink-strong); text-decoration: none; }
.pp-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; color: var(--brand-strong); }
.pp-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 4px; font-size: .875rem; color: var(--ink-2); }
.pp-venue { font-family: var(--font-display); font-size: 1.0625rem; color: var(--ink); }
.pp-links { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: .875rem; font-weight: 500; }
.papers-side { position: sticky; top: calc(var(--header-h) + 24px); }
.side-h { margin: 28px 0 10px; font-size: 1.25rem; }
.topics { list-style: none; display: grid; gap: 6px; }
.topics .count { font: 400 .8125rem/1 var(--font-mono); color: var(--ink-2); }
.years { margin: 0; padding: 18px 18px 14px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-panel); }
.years, .scans, .howto, .contribute, .catcard, .drawer-results-papers, .code pre { --ink-2: var(--ink-2-panel); }
.drawer, .years, .scans, .howto, .contribute, .catcard, .folder[aria-current="true"]::before { border-color: var(--panel-edge); }
.year-links { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 30px; font-size: .9375rem; }
.year-links a { display: inline-block; min-height: 24px; font-weight: 500; }
.year-links .count { font: 400 .75rem/1 var(--font-mono); color: var(--ink-2-panel); }
.years figcaption { font: 500 1.25rem/1.2 var(--font-display); color: var(--ink-strong); margin-bottom: 14px; }
.yb-list { list-style: none; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); align-items: end; gap: 2px; height: 132px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border-input); position: relative; }
.yb-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.yb { position: relative; display: block; width: min(100%, 14px); height: var(--h); min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; }
.yb-col:hover .yb { background: var(--brand-ink); }
.yb-n { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); font: 500 .75rem/1 var(--font-mono); color: var(--ink-strong); }
.yb-y { position: absolute; top: calc(100% + 6px); font: 400 .6875rem/1 var(--font-mono); color: var(--ink-2-panel); white-space: nowrap; }
.yb-col[data-tip]:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; background: var(--ink-strong); color: var(--bg); font: 500 .75rem/1.2 var(--font-body); white-space: nowrap; border-radius: 3px; z-index: 3; pointer-events: none; }
@media (max-width: 899px) { .papers-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; } .papers-side { position: static; } }
@media (max-width: 539px) { .paper { grid-template-columns: minmax(0, 1fr); gap: 4px; } }

/* ---------- for agents & developers ---------- */
.devs { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.dev { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dev h3 { font-size: 1.375rem; }
.dev h3 a { color: var(--ink-strong); }
.dev > p { color: var(--ink-2); font-size: .9375rem; }
.code { position: relative; margin-top: 4px; }
.code pre { margin: 0; padding: 14px 16px; padding-right: 92px; overflow-x: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-panel);
  color: var(--ink-strong); font-size: .8125rem; line-height: 1.6; white-space: pre; tab-size: 2; }
.code pre code { font-size: inherit; }
.code-wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.copy { position: absolute; top: 8px; right: 8px; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  border: 1px solid var(--border-input); border-radius: var(--r-control); background: var(--bg-raised); color: var(--ink); font-size: .8125rem; font-weight: 500; cursor: pointer; }
.copy:hover { color: var(--ink-strong); border-color: var(--ink-2); }
.copy .i { width: 14px; height: 14px; }
.copy.is-done { color: var(--ok-fg); border-color: var(--ok-fg); }
@media (max-width: 767px) { .devs { grid-template-columns: minmax(0, 1fr); } }

/* ---------- contribute ---------- */
.contribute { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; padding: 32px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-panel); }
.contribute h2 { font-size: var(--step-h2); line-height: 1.1; letter-spacing: var(--tracking-h2); }
.contribute p { margin-top: 10px; max-width: 60ch; color: var(--ink); }
.contribute-links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-weight: 500; }
.contribute-links a { color: var(--brand-ink); }
.contribute-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 899px) { .contribute { grid-template-columns: minmax(0, 1fr); padding: 22px 18px; } }
@media (max-width: 479px) { .contribute-actions { grid-template-columns: minmax(0, 1fr); } }

/* ---------- page heads (listing, cases, detail) ---------- */
.page-head { padding-top: clamp(20px, 3vw, 36px); }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: .875rem; color: var(--ink-2); }
.crumbs li + li::before { content: "/"; margin: 0 6px 0 2px; color: var(--line-strong); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--brand-strong); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink-strong); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-top: 14px; }
.ph-row h1, .cases-intro h1 { font-size: clamp(2.5rem, 1.9rem + 2.4vw, 3.75rem); line-height: 1.02; letter-spacing: -.02em; }
.h-count { font: 400 1rem/1 var(--font-mono); color: var(--ink-2); letter-spacing: 0; vertical-align: .9em; margin-left: 4px; }
.ph-intro { margin-top: 12px; max-width: 70ch; color: var(--ink); }
.list-search { position: relative; display: flex; align-items: center; flex: 0 1 460px; height: 48px; padding: 0 10px 0 14px; gap: 10px;
  background: var(--bg-raised); border: 1px solid var(--border-input); border-radius: var(--r-input); box-shadow: 2px 2px 0 var(--sheet); }

.list-search .i { color: var(--ink-2); width: 19px; height: 19px; }
.list-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--ink-strong); font: 400 1rem/1 var(--font-body); }
.list-search input::placeholder { color: var(--ink-2); opacity: 1; }
.list-search input::-webkit-search-cancel-button { display: none; }
.page-head .folders { margin-top: 28px; }
@media (max-width: 767px) { .list-search { flex-basis: 100%; height: 50px; } .list-search input { font-size: 1.0625rem; } .list-search kbd { display: none; } }

/* ---------- listing: facets + results inside the drawer ---------- */
.listing { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 28px; padding-top: 24px; }
.facets { position: static; display: block; width: auto; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: none; color: inherit; }
.facets-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line-strong); }
.facets-head h2 { font-size: 1.375rem; }
.link-btn { padding: 4px 0; border: 0; background: none; color: var(--brand-ink); font-size: .875rem; font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sheet-close, .sheet-foot { display: none; }
.facet { margin: 0; padding: 14px 0 12px; border: 0; border-bottom: 1px solid var(--line-strong); min-width: 0; }
.facet legend { float: left; width: 100%; padding: 0; margin-bottom: 8px; font: 600 .8125rem/1.3 var(--font-body); color: var(--ink-strong); letter-spacing: .01em; }
.facet legend + * { clear: left; }
.opt { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 32px; padding: 3px 6px;
  margin: 0 -6px; border-radius: var(--r-control); font-size: .9063rem; color: var(--ink); cursor: pointer; }
.opt:hover { background: color-mix(in srgb, var(--bg-raised) 55%, transparent); color: var(--ink-strong); }
.opt input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; left: 6px; cursor: pointer; }
.opt-box { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border: 1px solid var(--border-input); border-radius: 3px; background: var(--bg-raised); }
.opt input[type="radio"] + .opt-box { border-radius: 50%; }
.opt-box .i { width: 13px; height: 13px; stroke-width: 2.4; opacity: 0; color: var(--btn-ink); }
.opt input:checked + .opt-box { background: var(--btn-bg); border-color: var(--btn-bg); }
.opt input:checked + .opt-box .i { opacity: 1; }
.opt input[type="radio"]:checked + .opt-box .i { opacity: 0; }
.opt input[type="radio"]:checked + .opt-box { background: var(--bg-raised); box-shadow: inset 0 0 0 4px var(--btn-bg); }
.opt input:focus-visible + .opt-box { outline: 2px solid var(--focus); outline-offset: 2px; }
.opt input:checked ~ .opt-l { color: var(--ink-strong); font-weight: 600; }
.opt-l { min-width: 0; overflow-wrap: anywhere; line-height: 1.3; }
.opt-n { font: 500 .8125rem/1 var(--font-mono); color: var(--ink-2-panel); font-variant-numeric: tabular-nums; }
.opt.is-zero { color: var(--ink-2-panel); }
.opt-more summary { min-height: 32px; display: flex; align-items: center; padding: 4px 0; color: var(--brand-ink); font-size: .875rem; font-weight: 500; cursor: pointer; list-style: none; }
.opt-more summary::-webkit-details-marker { display: none; }
.opt-more summary::after { content: ""; width: 7px; height: 7px; margin-left: 8px; border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: translateY(-2px) rotate(45deg); }
.opt-more[open] summary { display: none; }
.results { min-width: 0; }
.results-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 14px; }
.results-meta { margin-right: auto; font-size: .9375rem; color: var(--ink-2-panel); }
.results-meta strong { color: var(--ink-strong); font-weight: 600; font-variant-numeric: tabular-nums; }
.filters-btn { display: none; min-height: 38px; padding: 0 12px; font-size: .875rem; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-ink); font: 600 .72rem/1 var(--font-body); }
.active { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.active[hidden] { display: none; }
.active .chip { height: 30px; gap: 6px; background: var(--stamp-case-bg); color: var(--stamp-case-ink); border-color: var(--focus); font-size: .8125rem; }
.active .chip .i { display: block; width: 13px; height: 13px; }
.empty { padding: 32px 24px; text-align: center; background: var(--bg-raised); border: 1px dashed var(--border-input); border-radius: var(--r-card); color: var(--ink); }
.empty p + p { margin-top: 8px; }
.empty .near { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 26px; }
.pager ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.pager a, .pager .gap, .pg-step { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 40px; padding: 0 10px;
  border-radius: var(--r-control); font: 500 .875rem/1 var(--font-body); color: var(--ink); text-decoration: none; }
.pager a { border: 1px solid transparent; }
.pager a:hover { background: var(--bg-raised); border-color: var(--border-input); color: var(--ink-strong); }
.pager a[aria-current="page"] { background: var(--btn-bg); color: var(--btn-ink); }
.pg-step[aria-disabled="true"] { color: var(--ink-2-panel); opacity: .7; }
.pager .gap { min-width: 20px; padding: 0; color: var(--ink-2-panel); }
@media (max-width: 1023px) and (min-width: 900px) { .listing { grid-template-columns: 220px minmax(0, 1fr); gap: 22px; } }
@media (max-width: 899px) {
  .listing { grid-template-columns: minmax(0, 1fr); }
  .filters-btn { display: inline-flex; }
  .facets:not([open]) { display: none; }
  .facets[open] { position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 86vh; margin: 0; padding: 0 0 0; overflow: auto;
    background: var(--bg-pop); border-top: 1px solid var(--line-strong); border-radius: 14px 14px 0 0; box-shadow: var(--shadow-pop); }
  .facets::backdrop { background: rgb(20 14 16 / .45); }
  .facets[open] .facets-head { position: sticky; top: 0; z-index: 1; padding: 16px var(--gutter) 12px; background: var(--bg-pop); }
  .facets[open] .facets-form { padding: 0 var(--gutter); }
  .facets[open] .facet { border-bottom-color: var(--line); }
  .facets[open] .opt-n { color: var(--ink-2); }
  .sheet-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: -8px -10px -8px 0; border: 0; background: none; color: var(--ink); cursor: pointer; }
  .facets-head .link-btn { margin-left: auto; }
  .sheet-foot { display: block; position: sticky; bottom: 0; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: var(--bg-pop); border-top: 1px solid var(--line); }
  .sheet-foot .btn { width: 100%; justify-content: center; }
  .opt { min-height: 44px; }
}

/* ---------- cases: the case-file shelf ---------- */
:root[data-site="rea"] { --band-1: #9D8189; --band-2: #F4ACB7; --band-3: #93A69B; --band-4: #C2AFAB; --band-5: #8C4D59; --band-6: #747A89; }
:root[data-site="rea"][data-theme="dark"] { --band-1: #CDB6BE; --band-2: #F4ACB7; --band-3: #A9BDB2; --band-4: #8F7A7F; --band-5: #D98E9B; --band-6: #9EA3B0; }
@media (prefers-color-scheme: dark) { :root[data-site="rea"]:not([data-theme="light"]) { --band-1: #CDB6BE; --band-2: #F4ACB7; --band-3: #A9BDB2; --band-4: #8F7A7F; --band-5: #D98E9B; --band-6: #9EA3B0; } }
.cases-intro { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; margin-top: 14px; }
.cases-intro .list-search { margin-top: 22px; max-width: 520px; }
.cases-intro .hs-count { margin-left: auto; }
.howto { padding: 18px 20px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-panel); }
.howto h2 { font-size: 1.25rem; margin-bottom: 10px; }
.howto dl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.howto dt { font-size: .8125rem; font-weight: 600; color: var(--ink-strong); }
.howto dd { margin-top: 2px; font-size: .8125rem; line-height: 1.45; color: var(--ink-2-panel); }
.subject-nav { margin-top: 26px; }
.subject-nav .chip .count { color: var(--ink-2); }
.case-section { padding-top: 56px; }
.case-section > .section-head { border-bottom: 1px solid var(--line-strong); padding-bottom: 10px; }
.method-nav { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 24px; margin: 0 0 8px; }
.method-nav a { display: flex; align-items: center; gap: 10px; min-height: 36px; color: var(--ink); text-decoration: none; font-size: .9375rem; }
.method-nav a:hover { color: var(--brand-strong); text-decoration: underline; }
.method-nav .count { margin-left: auto; font: 400 .75rem/1 var(--font-mono); color: var(--ink-2); }
.mn-band { width: 14px; height: 14px; flex: none; background: var(--band); border: 1px solid color-mix(in srgb, var(--ink-strong) 25%, transparent); }
.method { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line-strong); }
.method:first-of-type { border-top: 0; }
.method-head { display: flex; align-items: baseline; gap: 10px; }
.method-head h3 { font-size: 1.5rem; }
.method-head .count { font: 400 .8125rem/1 var(--font-mono); color: var(--ink-2); }
.method-note { margin: 4px 0 14px; max-width: 72ch; color: var(--ink-2); font-size: .9375rem; }
.shelf { list-style: none; display: grid; gap: 5px; }
.shelf li { width: calc(100% - var(--w-cut, 0%)); min-width: 0; --tone: var(--bg-raised); }
.shelf .w1 { --w-cut: 1%; } .shelf .w2 { --w-cut: 2%; } .shelf .w3 { --w-cut: 3%; } .shelf .w4 { --w-cut: 4%; } .shelf .w5 { --w-cut: 5%; }
.shelf .w6 { --w-cut: 6%; } .shelf .w7 { --w-cut: 7%; } .shelf .w8 { --w-cut: 8%; } .shelf .w9 { --w-cut: 9%; } .shelf .w10 { --w-cut: 10%; }
.shelf .w11 { --w-cut: 11%; } .shelf .w12 { --w-cut: 12%; }
.shelf .t1 { --tone: var(--surface-2); } .shelf .t2 { --tone: var(--secondary-soft); } .shelf .t4 { --tone: var(--bg); }
.b1 { --band: var(--band-1); } .b2 { --band: var(--band-2); } .b3 { --band: var(--band-3); } .b4 { --band: var(--band-4); } .b5 { --band: var(--band-5); } .b6 { --band: var(--band-6); }
.shelf a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: baseline; gap: 14px; min-height: 54px; padding: 14px 18px 13px 20px;
  background: var(--tone); border: 1px solid var(--line-strong); border-left: 7px solid var(--band); border-radius: 1px 2px 2px 1px;
  color: var(--ink); text-decoration: none; transition: transform var(--t-base) var(--ease); }
.shelf a:hover, .shelf a:focus-visible { transform: translateX(10px); border-color: var(--border-input); border-left-color: var(--band); box-shadow: 3px 3px 0 var(--sheet); }
.shelf a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.shelf a:hover .sp-lead { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sp-lead { font: 500 1.3125rem/1.15 var(--font-display); color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30ch; }
.sp-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; color: var(--ink); }
.sp-meta { font: 400 .72rem/1 var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.shelf li[hidden] { display: none; }
.method[hidden], .case-section[hidden] { display: none; }
@media (max-width: 1023px) { .cases-intro { grid-template-columns: minmax(0, 1fr); } .method-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .shelf li { width: 100%; }
  .shelf a { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 12px 11px 14px; }
  .sp-lead { max-width: none; white-space: normal; font-size: 1.1875rem; }
  .sp-what { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .sp-meta { margin-top: 4px; }
  .shelf a:hover, .shelf a:focus-visible { transform: none; }
  .method-nav { grid-template-columns: minmax(0, 1fr); }
  .howto dl { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- detail pages: record sheet + catalogue card ---------- */
.detail { padding-top: clamp(18px, 2.6vw, 30px); }
.record { margin-top: 18px; }
.sheet { position: relative; padding: clamp(22px, 3vw, 40px); background: var(--bg-raised); border: 1px solid var(--line-strong); border-radius: var(--r-card);
  box-shadow: 6px 6px 0 -1px var(--sheet), 6px 6px 0 0 var(--line-strong), 12px 12px 0 -1px var(--bg), 12px 12px 0 0 var(--line); margin-right: 12px; }
.sheet-call { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .875rem; color: var(--ink-2); }
.callno-inline { padding: 2px 7px; font: 500 .75rem/1.3 var(--font-mono); letter-spacing: .05em; color: var(--callno); background: var(--surface);
  box-shadow: 0 0 0 1px var(--surface), 0 0 0 2px var(--bg-raised), 0 0 0 3px var(--callno); }
.catcard .callno-inline { box-shadow: 0 0 0 1px var(--surface), 0 0 0 2px var(--surface), 0 0 0 3px var(--callno); background: var(--bg-raised); }
.sheet h1 { margin-top: 14px; font-size: clamp(2.5rem, 1.8rem + 2.6vw, 3.875rem); line-height: 1.02; letter-spacing: -.02em; }
.paper-record .sheet h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.875rem); line-height: 1.08; max-width: 26ch; }
.sheet-desc { margin-top: 14px; max-width: 66ch; font-size: clamp(1.0625rem, 1rem + .3vw, 1.25rem); line-height: 1.5; color: var(--ink); }
.sheet-zh { margin-top: 10px; max-width: 70ch; color: var(--ink-2); font-size: .9375rem; line-height: 1.6; }
.byline { margin-top: 12px; font: 400 1.0625rem/1.5 var(--font-body); color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 24px; }
.act-gap { flex: 1 1 12px; }
.act-quiet { display: flex; flex-wrap: wrap; gap: 4px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; margin-top: 44px; align-items: start; }
.detail-main > section + section { margin-top: 40px; }
.detail-main h2, .related h2 { font-size: clamp(1.5rem, 1.3rem + .7vw, 1.875rem); line-height: 1.15; }
.detail-main > section > h2 { margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line-strong); }
.sec-note { margin-top: 10px; font-size: .875rem; color: var(--ink-2); }
.detail-main p + p { margin-top: 10px; }
.zh-para { color: var(--ink-2); font-size: .9375rem; }
.reqs { list-style: none; counter-reset: req; display: grid; gap: 0; border-top: 1px solid var(--line); }
.reqs li { counter-increment: req; position: relative; padding: 12px 0 12px 44px; border-bottom: 1px solid var(--line); }
.reqs li::before { content: counter(req, decimal-leading-zero); position: absolute; left: 0; top: 14px; font: 500 .75rem/1.4 var(--font-mono); color: var(--callno); }
.sources { list-style: none; border-top: 1px solid var(--line-strong); }
.sources a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto 40px; align-items: center; gap: 4px 18px; min-height: 56px; padding: 10px 0;
  border-bottom: 1px solid var(--line-strong); color: var(--ink); text-decoration: none; }
.src-file { grid-row: 1; font-weight: 600; color: var(--ink-strong); overflow-wrap: anywhere; }
.src-repo { grid-row: 2; grid-column: 1; font: 400 .8125rem/1.3 var(--font-mono); color: var(--ink-2); overflow-wrap: anywhere; }
.src-rev { grid-row: 1 / span 2; grid-column: 2; font: 500 .75rem/1 var(--font-mono); color: var(--callno); white-space: nowrap; }
.src-kind { grid-row: 1 / span 2; grid-column: 3; font-size: .8125rem; color: var(--ink-2); white-space: nowrap; }
.src-arrow { grid-row: 1 / span 2; grid-column: 4; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid var(--border-input); border-radius: var(--r-control); color: var(--ink); }
.sources a:hover .src-file { text-decoration: underline; }
.sources a:hover .src-arrow { background: var(--btn-bg); border-color: var(--btn-bg); color: var(--btn-ink); }
.catcard { position: sticky; top: calc(var(--header-h) + 20px); padding: 18px 20px 34px; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-card); box-shadow: 3px 3px 0 var(--sheet); background-image: linear-gradient(to bottom, transparent 47px, color-mix(in srgb, var(--secondary) 70%, transparent) 47px, color-mix(in srgb, var(--secondary) 70%, transparent) 48px, transparent 48px); }
.catcard dl { display: grid; gap: 0; }
.catcard dl > div { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-bottom: 1px solid color-mix(in srgb, var(--line-strong) 70%, transparent); }
.catcard dl > div:first-child { padding-top: 2px; padding-bottom: 14px; }
.catcard dt { font-size: .8125rem; color: var(--ink-2-panel); }
.catcard dd { font-size: .875rem; color: var(--ink-strong); min-width: 0; overflow-wrap: anywhere; }
.catcard dd a { color: var(--brand-ink); }
.dd-note { color: var(--ink-2-panel); font-size: .8125rem; }
.dd-block { display: block; }
.stamp-reviewed { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 2px; background: var(--ok-bg); color: var(--ok-ink);
  font-size: .8125rem; font-weight: 600; box-shadow: 0 0 0 1px var(--ok-bg), 0 0 0 2px var(--surface), 0 0 0 3px var(--ok-fg); }
.stamp-reviewed .i { width: 13px; height: 13px; stroke-width: 2.4; }
.rod { position: absolute; left: 50%; bottom: 10px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-strong);
  box-shadow: inset 1px 1px 2px color-mix(in srgb, var(--ink-strong) 18%, transparent); }
.related { margin-top: 64px; }
.related .section-head { border-bottom: 1px solid var(--line-strong); padding-bottom: 10px; }
.related .cards { --card-ground: var(--bg); }
.paper-record .related .papers { margin-bottom: 8px; }
@media (max-width: 1023px) { .detail-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 28px; } }
@media (max-width: 899px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); margin-top: 32px; }
  .catcard { position: relative; top: 0; order: -1; }
  .sources a { grid-template-columns: minmax(0, 1fr) 40px; }
  .src-rev { grid-row: 3; grid-column: 1; }
  .src-kind { display: none; }
  .src-arrow { grid-column: 2; grid-row: 1 / span 3; }
}
@media (max-width: 599px) {
  .sheet { padding: 18px 16px 16px; }
  .sheet h1 { margin-top: 10px; }
  .sheet-desc { font-size: 1.0625rem; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
  .actions .btn { padding: 0 10px; font-size: .875rem; }
  .actions .btn-quiet { min-height: 40px; }
  .act-quiet { grid-column: 1 / -1; justify-content: space-between; }
  .detail-grid { margin-top: 24px; gap: 24px; }
  .sheet { margin-right: 6px; box-shadow: 3px 3px 0 -1px var(--sheet), 3px 3px 0 0 var(--line-strong), 6px 6px 0 -1px var(--bg), 6px 6px 0 0 var(--line); }
  .actions .btn { flex: 1 1 auto; justify-content: center; }
  .act-gap { display: none; }
  .actions .btn-quiet { flex: 0 1 auto; padding-inline: 6px; min-height: 40px; }
  .catcard dl > div { grid-template-columns: 96px minmax(0, 1fr); }
}

/* ---------- 404 ---------- */
.nf { padding-bottom: 8px; }
.nf-card { position: relative; width: min(100%, 340px); height: 150px; margin-bottom: 30px; padding: 16px 18px; background: var(--bg-raised); border: 1px solid var(--line-strong);
  box-shadow: 3px 3px 0 var(--sheet); transform: rotate(-1.5deg); }
.nf-call { font: 500 .75rem/1 var(--font-mono); color: var(--callno); letter-spacing: .05em; }
.nf-line { display: block; height: 1px; margin-top: 26px; background: var(--line); }
.nf-line.short { width: 60%; margin-top: 18px; }
.nf-stamp { position: absolute; right: 18px; bottom: 22px; padding: 4px 10px; border: 2px solid var(--label-case); color: var(--label-case); font: 600 .875rem/1 var(--font-body);
  letter-spacing: .04em; transform: rotate(-6deg); }
.nf-title { font-size: clamp(2.5rem, 1.7rem + 3vw, 4.25rem); line-height: 1.02; letter-spacing: -.02em; }
.nf .lede { max-width: 58ch; }
@media (max-width: 767px) { .nf-card { width: 230px; height: 104px; margin-bottom: 20px; } .nf-line { margin-top: 16px; } .nf-line.short { margin-top: 12px; } .nf-stamp { bottom: 14px; font-size: .75rem; } }
.nf-more { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 44px; }
.nf-more h2 { font-size: 1.5rem; margin-bottom: 10px; }
.nf-links { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.nf-links a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--border-input); border-radius: var(--r-control);
  background: var(--bg-raised); color: var(--ink-strong); text-decoration: none; font-weight: 500; }
.nf-links a:hover { border-color: var(--ink-2); }
.nf .folders { margin-top: 26px; }
.nf .folders::after { content: ""; flex: 1; border-bottom: 1px solid var(--line-strong); }
@media (max-width: 767px) { .nf-more { grid-template-columns: minmax(0, 1fr); margin-top: 32px; } .nf .folders::after { display: none; } }

/* ---------- no-JS ---------- */
.no-js [data-kind-chips], .no-js [data-sort], .no-js .select, .no-js .filters-btn, .no-js .hs-count { display: none; }
.no-js .facets { display: none; }
.no-js .listing { grid-template-columns: minmax(0, 1fr); }

/* ---------- motion & media ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 767px) {
  .cards { gap: 8px; }
  .hero-search { height: 54px; margin-top: 24px; }
  .hero-search input { font-size: 1.0625rem; padding: 0 10px; }
  .hero-search > .i { margin-left: 14px; }
  .hs-kbd { display: none; }
  .folders { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 16px 0 0; padding: 0; overflow: visible; }
  .folder { flex-direction: column; justify-content: center; gap: 1px; height: 46px; padding: 0 2px; margin: 0; font-size: .875rem; line-height: 1.15; }
  .folder::before { transform: none; border: 1px solid var(--line-strong); border-radius: var(--r-control); }
  .folder .i { display: none; }
  .folder .count { font-size: .75rem; }
  .folder[aria-current="true"]::after { left: 10px; right: 10px; top: auto; bottom: 3px; }
  .masthead .folders + * { margin-top: 0; }
  .drawer { padding: 12px 12px 16px; margin-inline: calc(-1 * var(--gutter) + 6px); border-radius: var(--r-panel); }
  .drawer-wrap { margin-top: 10px; }
}

/* ---------- tablets (768–1099): folder tabs without icons; kind as a select under 920 ---------- */
@media (min-width: 768px) and (max-width: 1099px) {
  .folder { padding: 2px 11px 0; gap: 5px; font-size: .9063rem; }
  .folder .i { display: none; }
}
@media (min-width: 768px) and (max-width: 919px) {
  .drawer-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "kind sort" "meta meta"; }
  .drawer-bar .chips { display: none; }
  .drawer-bar .select.kind-select { display: inline-flex; grid-area: kind; width: 100%; }
  .drawer-bar .select.kind-select select { width: 100%; }
  .drawer-bar .select:not(.kind-select) { justify-self: end; }
}

/* ==========================================================================================================
   Round 3 art direction: "the archive's specimen drawer". Section-scoped; nothing above was renamed.
   New classes: .art .xv .guide-art .caseband .cb-* .devband .colophon-word. New tokens: --art-line --cab.
   ========================================================================================================== */
/* drafted line art */
.art { display: block; width: 100%; height: auto; overflow: visible; fill: none; stroke: var(--art-line); stroke-width: 1.2; stroke-linecap: square; }
.art .p { fill: var(--art-ground, var(--bg)); }
.art .a { fill: var(--secondary); }
.art .thin { stroke-width: .8; }
.art .dash { stroke-dasharray: 3 3; stroke-width: .8; }
.art .ink { stroke: #212632; }
.art .dot { fill: var(--art-line); stroke: none; }
.art text { fill: var(--art-line); stroke: none; font: 500 9px/1 var(--font-mono); }
.art text.i { fill: #212632; }
.art text .b { font-weight: 500; fill: var(--ink-strong); }
.art text.cap { font-size: 8.5px; letter-spacing: .04em; }
.art text.m { opacity: .85; }

/* hero: Fig. 1 at the top right, the standfirst moves under the search so the search stays high */
.xv { display: none; }
@media (min-width: 900px) {
  .page-home .masthead { --xv-w: clamp(230px, 27vw, 340px); }
  .page-home .hero-top { display: contents; }
  .page-home .hero-title { order: 1; }
  .page-home .masthead .hero-search { order: 2; width: calc(100% - var(--xv-w) - 24px); margin-top: 26px; }
  .page-home .hero-top .lede { order: 3; width: calc(100% - var(--xv-w) - 24px); max-width: none; margin: 16px 0 0; padding: 0; font-size: 1rem; }
  .page-home .hero-meta { order: 4; width: calc(100% - var(--xv-w) - 24px); margin-top: 12px; }
  .page-home .masthead .folders { order: 5; margin-top: 18px; }
  .xv { display: block; position: absolute; top: -22px; right: 0; z-index: 0; width: var(--xv-w); pointer-events: none; }
  .xv .art text { font-size: 10.5px; }
  .xv .art text.cap { font-size: 9.5px; }
}

/* rows: one line of description on wide rows, so every row has the same height */
@container (min-width: 901px) { .card-desc { -webkit-line-clamp: 1; line-clamp: 1; } }

.page-home .section { padding-top: clamp(48px, 5vw, 68px); }

/* start here: each sheet carries a small blueprint of its target */
.page-home .guide { display: grid; grid-template-columns: minmax(0, 1fr) 116px; grid-template-rows: 1fr auto; column-gap: 16px; row-gap: 8px; min-height: 136px; padding: 18px 14px 14px 20px; }
.page-home .guide-task { grid-column: 1; grid-row: 1; }
.page-home .guide-count { grid-column: 1; grid-row: 2; margin-top: 0; }
.guide-art { grid-column: 2; grid-row: 1 / 3; align-self: center; --art-ground: var(--bg-raised); padding: 4px; background-color: var(--bg-raised);
  background-image: linear-gradient(to right, var(--grid) 1px, transparent 1px), linear-gradient(to bottom, var(--grid) 1px, transparent 1px); background-size: 12px 12px; border: 1px solid var(--line); }
.guide:hover .guide-art { border-color: var(--line-strong); }

/* featured: two benches, compact */
.page-home .feats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-home .feat { padding: 18px 22px 16px; gap: 6px; }

/* case files: the page's main colour moment. The band keeps its rose and ink in both themes. */
.caseband { --ink-strong: #212632; --ink: #212632; --ink-2: #212632; --brand-ink: #212632; --brand-strong: #212632; --focus: #212632;
  margin-top: clamp(56px, 6vw, 84px); padding: clamp(32px, 4vw, 56px) 0 clamp(44px, 5vw, 72px); background: #F4ACB7; color: #212632; }
.cb-kicker { font: 500 .8125rem/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.cb-head { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: end; gap: 12px 40px; margin-top: 6px; }
.cb-head h2 { font-family: "EB Garamond Accent", var(--font-display); font-style: italic; font-weight: 500; font-size: clamp(3.25rem, 8.1vw, 7.25rem); line-height: 1; letter-spacing: -.02em; }
.cb-head h2 a { color: inherit; text-decoration: none; }
.cb-head h2 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .1em; }
html:lang(zh-CN) .cb-head h2 { font-style: normal; font-family: var(--font-display); letter-spacing: 0; }
html:lang(zh-CN) .cb-n { font-family: "EB Garamond Accent", var(--font-display); font-style: italic; }
.cb-note { padding-bottom: .9em; font-size: 1rem; line-height: 1.45; }
.cb-folders { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 24px; margin-top: 52px; }
.cb-folder { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 18px; align-items: end; min-height: 158px; padding: 18px 20px 18px;
  background: #FFFAEB; border: 1px solid #212632; border-radius: 0 6px 6px 6px; box-shadow: 5px 5px 0 #E08C9B; transition: transform var(--t-base) var(--ease); }
.cb-folder:nth-child(1) { transform: rotate(-.7deg); }
.cb-folder:nth-child(2) { transform: translateY(6px) rotate(.5deg); }
.cb-folder:nth-child(3) { transform: rotate(-.3deg); }
.cb-folder:hover, .cb-folder:focus-within { transform: translateY(-5px); }
.cb-tab { position: absolute; left: -1px; top: -27px; height: 27px; padding: 7px 14px 0; background: #FFFAEB; border: 1px solid #212632; border-bottom: 0; border-radius: 6px 6px 0 0;
  font: 500 .75rem/1 var(--font-mono); letter-spacing: .05em; color: #212632; }
.cb-folder h3 { grid-column: 1 / -1; align-self: start; max-width: 15em; padding-right: 70px; font-size: 1.5rem; line-height: 1.12; letter-spacing: -.01em; }
.cb-folder h3 a { color: #212632; text-decoration: none; }
.cb-folder:hover h3 a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.cb-folder .stretch:focus-visible { outline: 0; box-shadow: none; }
.cb-folder:focus-within { outline: 2px solid #212632; outline-offset: 3px; }
.cb-stamp { position: absolute; top: 16px; right: 16px; padding: 3px 7px; color: #8C4D59; border: 2px solid #8C4D59; outline: 1px solid #8C4D59; outline-offset: 2px;
  font: 500 .8125rem/1 var(--font-mono); letter-spacing: .14em; transform: rotate(-7deg); }
.cb-count { margin-top: 10px; font: 500 3.75rem/.9 var(--font-display); font-variant-numeric: lining-nums; color: #212632; }
.cb-names { padding-bottom: 3px; font-size: .875rem; line-height: 1.35; color: #303542; }

/* latest: tighter log */
.page-home .lt-day { padding: 10px 0; }
.page-home .scans { padding: 14px 18px 16px; }
.page-home .scans ul { gap: 8px; margin: 10px 0 12px; }

/* browse by category: a cabinet of drawer fronts with label plates, large counts and pulls */
.page-home .cats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; background: var(--cab); border-radius: 4px; }
.page-home .cat { position: relative; padding: 12px 14px 24px; background: var(--bg-raised); border-radius: 2px; box-shadow: inset 0 0 0 1px var(--line-strong); transition: transform var(--t-base) var(--ease); }
.page-home .cat:hover, .page-home .cat:focus-within { transform: translateY(-3px); }
.page-home .cat::after { content: ""; position: absolute; left: calc(50% - 24px); bottom: 9px; width: 48px; height: 8px; border: 1.5px solid var(--art-line); border-top: 0; border-radius: 0 0 9px 9px; }
.page-home .cat h3 { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.page-home .cat h3 a { flex: 0 1 auto; min-width: 0; padding: 5px 15px; background-color: var(--secondary-soft);
  background-image: radial-gradient(circle, var(--art-line) 1.5px, transparent 2px), radial-gradient(circle, var(--art-line) 1.5px, transparent 2px);
  background-repeat: no-repeat; background-size: 8px 8px; background-position: 2px 50%, calc(100% - 2px) 50%; border: 1px solid var(--art-line); font-size: 1rem; line-height: 1.15; }
.page-home .cat h3 a::after { content: ""; position: absolute; inset: 0; z-index: 0; }
.page-home .cat h3 a:focus-visible { outline: 0; box-shadow: none; }
.page-home .cat:has(h3 a:focus-visible) { outline: 2px solid var(--secondary); outline-offset: 2px; }
.page-home .cat h3 .count { flex: none; margin: -3px 0 0; font: 500 2.875rem/.92 var(--font-display); font-variant-numeric: lining-nums; color: var(--ink-strong); }
.page-home .cat-note { margin-top: 8px; font-size: .8125rem; line-height: 1.4; }
.page-home .cat-items { position: relative; z-index: 1; margin-top: 6px; font-size: .8125rem; line-height: 1.5; }

/* papers: the chart leads, bars in mauve, on ruled paper */
.page-home .papers-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.page-home .papers-side { order: -1; position: static; }
.page-home .years { padding: 18px 20px 14px; background: var(--bg-raised); border-color: var(--line-strong); box-shadow: 3px 3px 0 var(--sheet); }
.page-home .years figcaption { font: 500 1.375rem/1.2 var(--font-display); color: var(--ink-strong); }
.page-home .yb-list { height: 236px; margin-top: 18px; background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px); background-size: 100% 25%; background-clip: content-box; }
.page-home .yb { width: 100%; max-width: 22px; border-radius: 2px 2px 0 0; background: var(--brand); }

/* developers: a warm dark panel in both themes; code in cream */
.devband { --bg: #1C1316; --bg-raised: #2F2227; --surface: #241A1E; --ink-strong: #FAF3DD; --ink: #E4DECC; --ink-2: #CDB6BE; --ink-2-panel: #CDB6BE;
  --brand-ink: #F4ACB7; --brand-strong: #FAF3DD; --line: #3B3232; --line-strong: #5A474D; --panel-edge: #46524B; --border-input: #876C74; --focus: #F4ACB7;
  --btn-bg: #F4ACB7; --btn-ink: #1C1316; --ok-fg: #B8F2E6; --sheet: #3A2C30; color-scheme: dark;
  margin-top: clamp(56px, 6vw, 84px); padding-bottom: clamp(40px, 4vw, 56px); background: #1C1316; color: var(--ink); border-block: 1px solid #46524B; }
.devband .dev:nth-child(-n+2) code::before { content: "$ "; color: #F4ACB7; }
.devband .contribute { margin-top: 0; padding: 24px 28px; background: #241A1E; }
.devband .contribute p { margin-top: 6px; }
.devband .section:last-child { padding-top: 32px; }

/* round 3, narrower layouts */
@media (max-width: 1099px) { .page-home .cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 899px) {
  .cb-head { grid-template-columns: minmax(0, 1fr); }
  .cb-note { padding-bottom: 0; }
  .cb-folders { grid-template-columns: minmax(0, 1fr); margin-top: 44px; }
  .cb-folder:nth-child(n) { transform: none; }
  .page-home .papers-grid { grid-template-columns: minmax(0, 1fr); }
  .page-home .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .page-home .feats { grid-template-columns: minmax(0, 1fr); }
  .page-home .cat-note { display: none; }
  .page-home .yb-list { height: 180px; }
  .devband .contribute { padding: 20px; }
}
@media (max-width: 539px) {
  .page-home .guide { grid-template-columns: minmax(0, 1fr) 96px; min-height: 0; padding-right: 12px; }
  .page-home .cat-items { display: none; }
  .page-home .cat { padding: 10px 10px 24px; }
  .page-home .cat h3 { flex-direction: column; gap: 8px; }
  .page-home .cat h3 a { padding: 4px 13px; font-size: .9375rem; }
}
@media (prefers-reduced-motion: reduce) { .cb-folder:hover, .cb-folder:focus-within, .page-home .cat:hover, .page-home .cat:focus-within { transform: none; } }

/* round 3, iteration 2: density without smaller type */
@media (min-width: 900px) {
  .page-home .hero-stats .s-lg { display: none; }
  .page-home .hero-stats .s-sm { display: inline; }
  .page-home .hero-top .lede { margin-top: 14px; }
}
.page-home .section { padding-top: clamp(44px, 4.2vw, 60px); }
.page-home .section-head { margin-bottom: 18px; }
.page-home .section-intro { margin: -10px 0 18px; }
/* featured: heading beside the two benches */
@media (min-width: 900px) {
  .page-home [aria-labelledby="featured-title"] { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .page-home [aria-labelledby="featured-title"] .section-head { margin: 0; }
  .page-home .feat h3 { font-size: 1.75rem; }
}
/* latest: three day columns, then the scan queue as a strip */
@media (min-width: 1000px) {
  .page-home .latest { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .page-home .lt-feed { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; border-top: 0; }
  .page-home .lt-day { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 0 12px; border-top: 1px solid var(--line-strong); border-bottom: 0; }
  .page-home .scans { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 4px 28px; align-items: start; }
  .page-home .scans ul { grid-column: 2; grid-row: 1 / 4; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; }
  .page-home .scans li { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  .page-home .scans-note { font-size: .8125rem; line-height: 1.4; }
  .page-home .scans-links { flex-direction: column; font-size: .8125rem; margin-top: 8px; }
}
/* cabinet fronts: label, count, pull, examples. The scope sentence lives on the category page. */
.page-home .cat-note { display: none; }
.page-home .cat-items { margin-top: 10px; }
/* papers: rows beside the chart, topics in one line under it */
.page-home .paper { padding-block: 12px; }
.page-home .pp-title { font-size: 1.1875rem; line-height: 1.2; text-wrap: pretty; }
.page-home .pp-meta { margin-top: 4px; }
.page-home .pp-links { margin-top: 4px; }
.page-home .side-h { margin-top: 16px; font-size: 1.125rem; }
.page-home .topics { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: .9375rem; }
.page-home .year-links { margin-top: 26px; }
/* developers: heading and short snippets on the left, the tall citation on the right */
@media (min-width: 900px) {
  .devband > .section:first-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto auto auto; column-gap: 24px; row-gap: 0; }
  .devband > .section:first-child .section-head { grid-column: 1; grid-row: 1; }
  .devband > .section:first-child .section-intro { grid-column: 1; grid-row: 2; }
  .devband .devs { display: contents; }
  .devband .dev:nth-child(1) { grid-column: 1; grid-row: 3; }
  .devband .dev:nth-child(2) { grid-column: 1; grid-row: 4; margin-top: 16px; }
  .devband .dev:nth-child(3) { grid-column: 2; grid-row: 1 / 3; }
  .devband .dev:nth-child(4) { grid-column: 2; grid-row: 3 / 5; margin-top: 16px; }
}
.devband .dev h3 { font-size: 1.25rem; }
.devband .contribute { gap: 14px 40px; padding: 18px 24px; }
.devband .contribute h2 { font-size: 1.75rem; }
.devband .contribute p { font-size: .9375rem; line-height: 1.45; }
.devband .contribute .btn { min-height: 44px; }
.devband .section:last-child { padding-top: 24px; }

/* round 3, iteration 3 */
.page-home .section { padding-top: clamp(40px, 3.4vw, 48px); }
.caseband, .devband { margin-top: clamp(44px, 3.9vw, 56px); }
.caseband { padding: clamp(28px, 3vw, 40px) 0 clamp(40px, 3.6vw, 52px); }
.cb-folders { margin-top: 44px; }
.cb-folder { min-height: 146px; }
/* start here: intro on the heading's line */
@media (min-width: 900px) {
  .page-home [aria-labelledby="start-title"] { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 20px; }
  .page-home [aria-labelledby="start-title"] .section-intro { margin: 0 0 18px; }
  .page-home [aria-labelledby="start-title"] .guides { flex: 0 0 100%; }
  .page-home .guide { min-height: 124px; padding-block: 14px 12px; }
  .page-home .feat-desc { font-size: .9375rem; line-height: 1.4; }
}
/* scans: stamp and name share a line, description below */
.page-home .scans li { grid-template-columns: auto minmax(0, 1fr); }
.page-home .scans li .sc-desc { grid-column: 1 / -1; }
.page-home .lt-day ul { gap: 4px; }
@media (min-width: 1000px) {
  .page-home .scans { grid-template-columns: 250px minmax(0, 1fr); padding-block: 12px; }
  .page-home .scans li { grid-template-columns: auto minmax(0, 1fr); }
  .page-home .scans-note { margin-top: 2px; }
  .page-home .scans-links { margin-top: 6px; gap: 2px; }
}
/* papers: paper links share the byline row */
.page-home .pp-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: baseline; }
.page-home .pp-title { grid-column: 1 / -1; }
.page-home .pp-meta, .page-home .pp-links { margin-top: 3px; }
.page-home .yb-list { height: 200px; margin-top: 12px; }
.page-home .year-links { margin-top: 24px; }
.page-home .years { padding-block: 14px 10px; }
.page-home .side-h { display: none; }
.page-home .topics { margin-top: 14px; font-size: .875rem; }
/* contribute: one line of buttons */
@media (min-width: 900px) {
  .devband .contribute { grid-template-columns: minmax(0, 1fr); padding-block: 14px 16px; }
  .devband .contribute > div:first-child { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 28px; align-items: baseline; }
  .devband .contribute h2 { grid-row: 1; }
  .devband .contribute > div > p:not(.contribute-links) { margin-top: 0; max-width: none; }
  .devband .contribute-links { margin-top: 0; font-size: .875rem; }
  .devband .contribute-actions { display: flex; gap: 10px; }
  .devband .contribute-actions .btn { flex: 1; justify-content: center; }
}
.devband > .section:first-child { padding-top: 44px; }

/* round 3, iteration 4 */
.devband { padding-bottom: clamp(32px, 3vw, 44px); }
.page-home .topics { gap: 3px 13px; font-size: .8125rem; }
.page-home .topics .count { font-size: .75rem; }
@media (max-width: 539px) { .page-home .cat::after { left: auto; right: 12px; } }

/* round 3, iteration 5 and coordinator review */
.cb-folders { margin-top: 40px; }
.caseband { padding-bottom: clamp(36px, 3.2vw, 46px); }
.devband > .section:first-child { padding-top: 34px; }
.devband .section:last-child { padding-top: 20px; }
.page-home .cats { gap: 6px; padding: 6px; border-radius: 3px; }
.page-home .cat { padding-bottom: 28px; }
.page-home .scans-links a { display: inline-block; min-height: 24px; line-height: 24px; }
@media (min-width: 1000px) { .page-home .scans { padding-block: 10px; } .page-home .scans-links { gap: 0; margin-top: 4px; } }

/* Featured: the benchmark row, labelled, largest first. */
.promo { margin-top: clamp(40px, 5vw, 72px); margin-bottom: clamp(48px, 6vw, 88px); }
.promo-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin-bottom: 14px; }
.promo-label { margin: 0; font: 500 .8125rem/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); }
.promo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.promo-lead { grid-column: 1 / -1; }
.promo-card { display: flex; flex-direction: column; min-width: 0; padding: 24px; border: 1px solid var(--panel-edge); border-radius: 4px; background: var(--bg-raised); }
.promo-name { margin: 0; font: 500 1.75rem/1.1 var(--font-display); color: var(--ink-strong); }
.promo-question { margin: 8px 0 0; font-weight: 600; color: var(--ink); }
.promo-detail { margin: 8px 0 0; color: var(--ink-2); }
.promo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: auto 0 0; padding-top: 20px; }
.promo-actions .btn { min-height: 44px; padding: 0 14px; }
.promo-actions .i { width: 15px; height: 15px; }
.btn-count { padding-left: 8px; border-left: 1px solid currentColor; font: 500 .8125rem/1 var(--font-mono); }
.promo-lead { --ink-strong: #FAF3DD; --ink: #F3E9DC; --ink-2: #E9DCDF; --focus: #FFCAD4; color-scheme: dark; padding: clamp(28px, 3.4vw, 44px); border-color: #4A3740;
  background: #4A3740 linear-gradient(#54404A 1px, transparent 1px) 0 0 / 100% 28px; color: var(--ink); }
.promo-lead .promo-name { font-size: clamp(2.75rem, 5.4vw, 4.5rem); letter-spacing: -.01em; }
.promo-lead .promo-question { margin-top: 14px; font-size: clamp(1.0625rem, 1.5vw, 1.25rem); }
.promo-lead .promo-detail { max-width: 62ch; }
.promo-lead .btn { border-color: #C9B6BC; background: none; color: #FAF3DD; }
.promo-lead .btn:hover { border-color: #FAF3DD; background: rgba(250, 243, 221, .1); color: #FAF3DD; }
.promo-lead .btn-primary, .promo-lead .btn-primary:hover { border-color: #F4ACB7; background: #F4ACB7; color: #212632; }
.promo-lead .btn-primary:hover { border-color: #FFCAD4; background: #FFCAD4; color: #212632; }
.promo-lead .btn-primary { min-height: 48px; padding: 0 18px; font-weight: 700; }
@media (max-width: 767px) { .promo-grid { grid-template-columns: minmax(0, 1fr); } }

/* Home search: the selected result, its key hints, and scrolling that clears the sticky header. */
.page-home .card.is-active { outline: 2px solid var(--focus); outline-offset: 1px; }
.page-home .card.is-active .card-face { background: var(--secondary-soft); }
.page-home .card { scroll-margin: 96px 0 24px; }
.hs-keys { display: none; align-items: center; gap: 4px; font: 400 .75rem/1 var(--font-mono); color: var(--ink-2); white-space: nowrap; }
.hs-keys kbd { padding: 2px 5px; border: 1px solid var(--border-input); border-radius: 3px; font: inherit; }
.has-hits .hs-keys { display: inline-flex; }
@media (max-width: 899px) { .has-hits .hs-keys { display: none; } }
.empty .btn { margin-top: 12px; }

