@import url("fonts.css");

/* ============================================================
   Translanguaging Bibliography
   A reading surface first: the citation is the interface.
   ============================================================ */
:root {
  /* paper and ink */
  --paper: #f7f4ee;
  --surface: #fffdf9;
  --ink: #1b2027;
  --ink-soft: #4a5560;
  --ink-faint: #626d78;          /* 4.8:1 on paper (was #6b7682, 4.2:1) */
  --rule: #e2dcd1;
  --rule-strong: #cfc7b8;
  --rule-ui: #928a7b;            /* controls and data marks: 3:1 or more on paper and surface */
  /* one accent, one counter-accent */
  --accent: #14615c;
  --accent-ink: #0e4a46;
  --accent-wash: #e8f0ee;
  --count: #9c4a17;
  --count-wash: #f6ebe1;

  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --measure: 74ch;
  --gutter: clamp(18px, 4vw, 40px);
  --rhythm: 1.55;
  --radius: 8px;
  --ease: cubic-bezier(.2, .7, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14181d;
    --surface: #191e24;
    --ink: #e9edf1;
    --ink-soft: #b3bec9;
    --ink-faint: #909cA8;
    --rule: #272e36;
    --rule-strong: #38414b;
    --rule-ui: #636e7a;
    --accent: #79c9bf;
    --accent-ink: #a6ded6;
    --accent-wash: #15302e;
    --count: #e79a67;
    --count-wash: #2e2118;
  }
}
:root[data-theme="dark"] {
    --paper: #14181d;
    --surface: #191e24;
    --ink: #e9edf1;
    --ink-soft: #b3bec9;
    --ink-faint: #909cA8;
    --rule: #272e36;
    --rule-strong: #38414b;
    --rule-ui: #636e7a;
    --accent: #79c9bf;
    --accent-ink: #a6ded6;
    --accent-wash: #15302e;
    --count: #e79a67;
    --count-wash: #2e2118;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rule-strong) transparent; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 17px/var(--rhythm) var(--serif);
  font-variant-numeric: oldstyle-nums proportional-nums;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-wash); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border: 4px solid var(--paper); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }
input, select, button { font: inherit; color: inherit; caret-color: var(--accent); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
svg.i { width: 1em; height: 1em; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- masthead ---------- */
.masthead { padding-block: clamp(30px, 6vw, 62px) 26px; }
.masthead-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: clamp(20px, 5vw, 56px); align-items: end; }
h1 {
  margin: 0;
  font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -.021em;
  font-weight: 600;
  text-wrap: balance;
}
h1 .thin { font-weight: 400; font-style: italic; color: var(--accent); }
/* the title goes back to the start (all entries, no filters); it keeps the look of a title */
h1 a.home { color: inherit; text-decoration: none; }
h1 a.home:hover .thin { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 6px; }
.standfirst {
  margin: 14px 0 0;
  max-width: 58ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}
/* when the list was last published and how much is new: a quiet line under the standfirst */
.updated { margin: 10px 0 0; font-family: var(--sans); font-size: .8rem; color: var(--ink-faint);
  font-variant-numeric: lining-nums; }
.updated time { color: var(--ink-soft); }
.updated a, .updated .linklike { color: var(--accent-ink); text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.updated a:hover, .updated .linklike:hover { text-decoration-color: var(--accent); }
.linklike { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.tally { display: flex; gap: clamp(16px, 3vw, 30px); font-family: var(--sans); }
.tally div { text-align: right; }
.tally b {
  display: block; font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); font-weight: 600; line-height: 1.1;
  color: var(--ink); font-variant-numeric: tabular-nums lining-nums;
}
.tally span { font-size: .75rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); }

/* year histogram (from the earliest of Curator's 25): real data, and a filter */
.histogram { margin-top: 30px; display: flex; align-items: flex-end; gap: 1px; height: 62px; }
.histogram button {
  flex: 1; min-width: 0; background: none; border: 0; padding: 0; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; height: 100%;
  font-family: var(--sans); color: var(--ink-faint);
}
.histogram .bar {
  background: var(--rule-ui); border-radius: 2px 2px 0 0; width: 100%;
  transition: background .18s var(--ease), transform .18s var(--ease); transform-origin: bottom;
}
.histogram button:hover .bar { background: var(--accent); }
.histogram button[aria-pressed="true"] .bar { background: var(--count); }
.histogram .decade {
  font-size: .75rem; letter-spacing: .02em; margin-top: 5px; white-space: nowrap; min-height: 1.2em;
  overflow: visible; font-variant-numeric: tabular-nums;
}
.histogram button:hover .decade, .histogram button[aria-pressed="true"] .decade { color: var(--ink); }

/* ---------- controls ---------- */
.controls { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px) saturate(1.3); border-block: 1px solid var(--rule); }
.controls-inner { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-block: 14px; }
.search { position: relative; flex: 1 1 260px; min-width: 0; display: flex; align-items: center; }
.search .lead { position: absolute; left: 13px; color: var(--ink-faint); font-size: 1.05rem; pointer-events: none; }
.search input {
  width: 100%; padding: 11px 40px 11px 40px; font-family: var(--sans); font-size: .95rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search input::placeholder { color: var(--ink-faint); }
.search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); outline: none; }
.search .clear {
  position: absolute; right: 9px; border: 0; background: none; color: var(--ink-faint);
  cursor: pointer; padding: 5px; border-radius: 6px; display: none; font-size: 1rem;
}
.search input:not(:placeholder-shown) ~ .clear { display: block; }
.search .clear:hover { color: var(--ink); background: var(--rule); }
select {
  font-family: var(--sans); font-size: .87rem; padding: 11px 30px 11px 12px; border: 1px solid var(--rule);
  border-radius: var(--radius); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%237d8894' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center/12px;
  appearance: none; cursor: pointer; max-width: 100%; min-width: 0;
}

/* the filter drawer is a phone affordance; on a wide screen the facets simply stand in the margin */
.filterbox { border: 0; }
.filterbox > summary { display: none; }

/* ---------- body layout ---------- */
.layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: clamp(24px, 4vw, 52px); padding-block: 26px 80px; align-items: start; }
.filters { position: sticky; top: 76px; font-family: var(--sans); }
.filters h2 { font: 600 .75rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 9px; }
.filters section + section { margin-top: 22px; }
.facet { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  font-family: var(--sans); font-size: .78rem; line-height: 1; padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: baseline; gap: 6px;
  transition: border-color .15s var(--ease), color .15s var(--ease), background .15s var(--ease);
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.chip .n { font-size: .75rem; color: var(--ink-faint); font-variant-numeric: tabular-nums lining-nums; }
.chip[aria-pressed="true"] .n { color: var(--accent-ink); opacity: .8; }

/* ---------- results ---------- */
.resultbar { display: flex; align-items: baseline; gap: 12px; font-family: var(--sans); font-size: .82rem;
  color: var(--ink-soft); padding-bottom: 12px; border-bottom: 1px solid var(--rule-strong); }
.resultbar .reset { border: 0; background: none; color: var(--accent); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 3px; }
ol.results { list-style: none; margin: 0; padding: 0; }
li.entry {
  position: relative; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 16px;
  padding: 17px 0 16px; border-bottom: 1px solid var(--rule);
}
li.entry:last-child { border-bottom: 0; }
.rank { font-family: var(--sans); text-align: right; padding-top: 3px; }
.rank .num { font-size: .95rem; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; color: var(--count); }
.rank .lbl { display: block; font-size: .75rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-faint); margin-top: 1px; }
.rank .tick { display: block; height: 2px; background: var(--count); opacity: .45; border-radius: 2px; margin-top: 6px; margin-left: auto; }
.rank.none .num { color: var(--ink-faint); font-weight: 400; }
.cite { margin: 0; max-width: var(--measure); text-indent: -1.1em; padding-left: 1.1em; }
.cite .t { font-weight: 600; }
.cite .who { color: var(--ink); }
.cite .where { font-style: italic; color: var(--ink-soft); }
.meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--sans); font-size: .75rem; }
.tagpill {
  border: 0; padding: 5px 10px; border-radius: 4px; background: var(--paper); color: var(--ink-soft);
  border: 1px solid var(--rule); cursor: pointer; font-family: var(--sans); font-size: .75rem;
}
.tagpill:hover { border-color: var(--accent); color: var(--ink); }
.kind { color: var(--ink-faint); letter-spacing: .045em; text-transform: uppercase; font-size: .75rem; }
.doi { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  display: inline-flex; align-items: center; gap: 4px; }
.doi:hover { border-bottom-color: var(--accent); }
/* open access: a repository copy is a link like the DOI; a publisher copy is a quiet mark beside the DOI link */
.oa { color: var(--accent); text-decoration: none; border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.oa:hover { border-bottom-color: var(--accent); }
.oafree { color: var(--accent-ink); letter-spacing: .045em; text-transform: uppercase; font-size: .75rem; }
.unverified { color: var(--ink-faint); border-bottom: 1px dotted var(--rule-strong); cursor: help; }
/* the tools are always there: copying a citation is the site's main job, and hover-only controls hide it from
   touch, keyboard and first-time readers. The rest of the row waits behind "more". */
.tools { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 9px; }
.tools .extra { display: contents; }
.tools .extra[hidden] { display: none; }
.tools .more .i { transition: transform .15s var(--ease); }
.tools .more[aria-expanded="true"] .i { transform: rotate(180deg); }
.tools button {
  font-family: var(--sans); font-size: .75rem; padding: 6px 11px; border: 1px solid var(--rule);
  border-radius: 6px; background: transparent; color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.tools button:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--surface); }
.abstract { margin: 10px 0 0; max-width: var(--measure); color: var(--ink-soft); font-size: .94rem;
  border-left: 1px solid var(--rule-strong); padding-left: 14px; }
mark { background: color-mix(in srgb, var(--count-wash) 85%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

/* provenance: every entry says where its metadata came from */
.prov {
  font-family: var(--sans); font-size: .75rem; letter-spacing: .045em; text-transform: uppercase;
  border: 0; background: none; padding: 5px 0; color: var(--ink-faint); cursor: pointer;
  border-bottom: 1px solid transparent;
}
.prov:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }
.prov.unverified { color: var(--count); }
.prov.unverified::after { content: " ·  unverified"; opacity: .75; }

/* connections drawer */
.drawer { display: none; margin-top: 10px; }
.drawer.open { display: block; }
.links { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; max-width: var(--measure); }
.links-label { font-family: var(--sans); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-faint); margin-right: 3px; }
a.reflink {
  font-family: var(--sans); font-size: .76rem; padding: 4px 9px; border-radius: 5px; text-decoration: none;
  background: var(--accent-wash); color: var(--accent-ink); border: 1px solid transparent;
}
a.reflink:hover { border-color: var(--accent); }
.printed { margin: 0; max-width: var(--measure); color: var(--ink-soft); font-size: .9rem;
  border-left: 2px solid var(--count); padding: 2px 0 2px 14px; }
.printed-label { font-family: var(--sans); font-size: .75rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-faint); display: block; }
/* a work's own reference list */
.refs { max-width: var(--measure); }
.refs-head { margin: 0 0 8px; font-family: var(--sans); font-size: .76rem; color: var(--ink-faint); }
.refs-head .links-label { display: block; margin-bottom: 2px; }
.refs-list { margin: 0; padding: 0 0 0 2.2em; border-left: 1px solid var(--rule-strong); max-height: 26rem; overflow-y: auto;
  color: var(--ink-soft); font-size: .86rem; line-height: 1.45; overflow-wrap: anywhere; }
.refs-list li { margin: 0 0 6px; padding-left: 2px; }
.refs-list li::marker { font-family: var(--sans); font-size: .75rem; color: var(--ink-faint); }
.refs-list .refs-wait { list-style: none; margin-left: -2.2em; padding-left: 14px; color: var(--ink-faint); }
a.refs-doi { color: var(--accent-ink); }
.refs-made { color: var(--ink-faint); font-style: italic; }

/* the reference list's own small toolbar: show, order, copy, find */
.refs-tools { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 0 0 10px; font-family: var(--sans); }
.refs-tools:empty { display: none; }
.refs-group { display: inline-flex; flex-wrap: wrap; gap: 3px; }
.refs-seg, .refs-copy, .refs-n {
  font-family: var(--sans); font-size: .75rem; padding: 4px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-soft); white-space: nowrap;
}
.refs-seg .n { margin-left: 5px; color: var(--ink-faint); font-variant-numeric: tabular-nums lining-nums; }
.refs-seg[aria-pressed="true"] { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.refs-seg[aria-pressed="true"] .n { color: var(--accent-ink); }
.refs-seg:hover, .refs-copy:hover, .refs-n:hover { border-color: var(--accent); color: var(--accent-ink); }
.refs-copy { border-radius: 6px; }
.refs-q {
  font-family: var(--sans); font-size: .8rem; padding: 5px 10px; min-width: 0; flex: 1 1 14rem; max-width: 22rem;
  border: 1px solid var(--rule-ui); border-radius: 6px; background: var(--surface); color: var(--ink);
}
.refs-q::placeholder { color: var(--ink-faint); opacity: 1; }
/* "3 others cite it" sits in the line of the reference, quieter than "held here" */
.refs-list .refs-n, .related .refs-n { padding: 1px 8px; color: var(--count); border-color: color-mix(in srgb, var(--count) 40%, var(--rule)); }
.refs-list .refs-n:hover, .related .refs-n:hover { border-color: var(--count); color: var(--count); background: var(--count-wash); }

/* related entries: a short bibliography-style list */
.rel-list { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--rule-strong);
  font-size: .88rem; line-height: 1.45; color: var(--ink-soft); }
.rel-list > li { margin: 0 0 7px; }
a.rel-t { font-family: var(--sans); font-size: .78rem; font-weight: 500; color: var(--accent-ink); text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
a.rel-t:hover { border-bottom-color: var(--accent); }
.rel-title { font-style: italic; }
.rel-why { margin: 5px 0 2px; padding-left: 1.1em; font-size: .82rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.rel-why li { margin-bottom: 3px; }
.rel-why .rel-more { list-style: none; color: var(--ink-faint); font-family: var(--sans); font-size: .75rem; }
.refs-list a.reflink { font-size: .75rem; padding: 1px 7px; white-space: nowrap; }
.tools button.on { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-wash); }
li.entry.flash { animation: flash 1.1s var(--ease); }
/* a landed entry takes focus: the ring shows for keyboard readers, the flash alone for pointer readers */
li.entry:focus:not(:focus-visible) { outline: none; }
/* a title with an abstract behind it opens it: a quiet cue on hover, nothing at rest */
.cite .t.opens { cursor: pointer; }
.alsoed { color: var(--ink-faint); font-size: .85em; }

li.sectionhead { list-style: none; font-family: var(--sans); font-size: .75rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint); padding: 34px 0 10px; border-bottom: 1px solid var(--rule); }
.cite .t.opens:hover { text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 3px; }
.activepill.suggest { background: transparent; border-color: var(--accent); }
@keyframes flash { 0%, 40% { background: var(--accent-wash); } 100% { background: transparent; } }

/* entrance: one authored moment, on the result set only */
@media (prefers-reduced-motion: no-preference) {
  li.entry { animation: rise .32s var(--ease) both; animation-delay: calc(var(--i, 0) * 14ms); }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

/* ---------- states ---------- */
.skeleton { display: grid; gap: 22px; padding-top: 20px; }
.skeleton div { height: 15px; border-radius: 4px; background: linear-gradient(90deg, var(--rule) 25%, var(--surface) 50%, var(--rule) 75%);
  background-size: 300% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton div:nth-child(odd) { width: min(640px, 92%); }
.skeleton div:nth-child(even) { width: min(420px, 70%); }
@keyframes shimmer { to { background-position: -300% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton div { animation: none; } }
.empty { padding: 56px 0; color: var(--ink-faint); max-width: 46ch; }
.empty b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 6px; font-size: 1.05rem; }
.empty.more { padding: 30px 0 64px; }
.showmore {
  font: 600 0.9rem/1 var(--sans); letter-spacing: 0.01em; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: 2px;
  padding: 11px 20px; cursor: pointer; transition: background 140ms var(--ease), border-color 140ms var(--ease);
}
.showmore:hover { background: var(--accent-wash); border-color: var(--accent); }
.showmore:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

footer { border-top: 1px solid var(--rule); padding-block: 22px 46px; color: var(--ink-faint);
  font-family: var(--sans); font-size: .78rem; }
footer p { margin: 0 0 4px; max-width: 70ch; }
footer a { color: var(--accent); text-underline-offset: 3px; }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 14px); z-index: 60;
  background: var(--ink); color: var(--paper); padding: 9px 17px; border-radius: 999px;
  font-family: var(--sans); font-size: .82rem; opacity: 0; pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 9px 18px -11px rgba(0,0,0,.45);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- narrow ---------- */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 14px; }
  .filters { position: static; padding: 0; }
  .filters section + section { margin-top: 14px; }
  .filterbox { border: 1px solid var(--rule); border-radius: var(--radius); background: var(--surface); padding: 0 14px; }
  .filterbox[open] { padding-bottom: 14px; }
  .filterbox summary { cursor: pointer; padding: 12px 0; font-family: var(--sans); font-size: .82rem;
    color: var(--ink-soft); list-style: none; display: flex; justify-content: space-between; align-items: center; }
  .filterbox summary::-webkit-details-marker { display: none; }
  .filterbox summary::after { content: "＋"; color: var(--ink-faint); }
  .filterbox[open] summary::after { content: "−"; }
  .masthead-grid { grid-template-columns: 1fr; align-items: start; }
  .tally { justify-content: flex-start; }
  .tally div { text-align: left; }
  .tools { opacity: 1; }
  li.entry { grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
}
@media (max-width: 520px) {
  /* the sticky bar is two compact rows: search, then style, sort and theme together (was four rows, 234px) */
  .controls-inner { gap: 8px; padding-block: 10px; }
  .search { flex: 1 1 100%; }
  .search input { padding-block: 10px; }
  select { flex: 1 1 0; font-size: .82rem; padding: 10px 24px 10px 10px; background-position: right 7px center; }
  .themebtn { padding: 9px 11px; }

  .histogram { height: 46px; }
}


/* ---------- picker, export bar, theme button ---------- */
.pick {
  width: 15px; height: 15px; margin: 2px 0 7px auto; display: block; padding: 0;
  border: 1.5px solid var(--rule-ui); border-radius: 4px; background: var(--surface);
  cursor: pointer; transition: border-color .12s var(--ease), background .12s var(--ease);
}
.pick:hover { border-color: var(--accent); }
.pick[aria-checked="true"] { background: var(--accent); border-color: var(--accent); position: relative; }
.pick[aria-checked="true"]::after {
  content: ""; position: absolute; inset: 2px 3px 3px 2px;
  border-left: 2px solid var(--surface); border-bottom: 2px solid var(--surface);
  transform: rotate(-45deg) translate(1px, -1px);
}
li.entry.picked { background: color-mix(in srgb, var(--accent-wash) 55%, transparent); }

.selbar {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 24px); z-index: 50;
  display: none; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center;
  background: var(--surface); border-radius: 999px;
  padding: 9px 14px; font-family: var(--sans); font-size: .8rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.10), 0 10px 20px -12px rgba(0,0,0,.42);
  max-width: min(94vw, 900px);
}
.selbar.show { display: flex; animation: riseBar .22s var(--ease) forwards; }
@keyframes riseBar { to { transform: translate(-50%, 0); } }
.selcount { color: var(--ink-soft); margin-right: 4px; font-variant-numeric: tabular-nums lining-nums; }
.selbar button {
  font-family: var(--sans); font-size: .78rem; padding: 7px 12px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer;
}
.selbar .short { display: none; }
.selbar select.selfile {
  font-family: var(--sans); font-size: .78rem; padding: 7px 10px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--paper); color: var(--ink); cursor: pointer;
}
.selbar button:hover, .selbar select.selfile:hover { border-color: var(--accent); color: var(--accent-ink); }
.selbar button.ghost { border-color: transparent; color: var(--ink-faint); }
.selbar button.ghost:hover { color: var(--ink); }

.themebtn { padding: 10px; border: 1px solid var(--rule); border-radius: var(--radius);
  background: var(--surface); color: var(--ink-soft); cursor: pointer; display: grid; place-items: center; }
.themebtn:hover { border-color: var(--accent); color: var(--accent-ink); }
.themebtn svg { width: 17px; height: 17px; display: none; }
.themebtn[data-theme="system"] .auto, .themebtn[data-theme="light"] .sun, .themebtn[data-theme="dark"] .moon { display: block; }

/* the citation carries its own navigation */
.inline { cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
  text-decoration-thickness: 1px; transition: text-decoration-color .15s var(--ease), color .15s var(--ease); }
.inline:hover { color: var(--accent-ink); text-decoration-color: var(--accent); }
.where .inline { font-style: italic; color: var(--ink-soft); }
.where .inline:hover { color: var(--accent-ink); }
.activefilters { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-left: 4px; }
.activepill {
  font-family: var(--sans); font-size: .75rem; padding: 4px 9px; border-radius: 999px;
  background: var(--accent-wash); color: var(--accent-ink); border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.activepill:hover { border-color: var(--accent); }
.activepill .x { opacity: .7; }
/* on a phone the bar is a full-width strip along the bottom edge, one line, clear of the entries (2026-11-17: centred
   with left: 50% it could never be wider than half the screen, and stacked into a column over the list) */
@media (max-width: 620px) {
  .selbar { left: 8px; right: 8px; bottom: 8px; max-width: none; transform: translateY(24px); border-radius: 12px;
    flex-wrap: nowrap; justify-content: space-between; gap: 6px; padding: 8px 10px; }
  .selbar.show { animation-name: riseBarEdge; }
  .selbar button, .selbar select.selfile { padding: 9px 9px; min-height: 40px; white-space: nowrap; }
  .selbar select.selfile { min-width: 96px; flex: 0 1 auto; }
  .selbar .long { display: none; }
  .selbar .short { display: inline; }
  .selcount { margin-right: 0; white-space: nowrap; }
}
@keyframes riseBarEdge { to { transform: translateY(0); } }


/* ---------- views: the list, the curator's selection, the themes ---------- */
.sprite { position: absolute; }
.viewswitch { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
/* "Random entry": an action, not a view, so a quiet text button at the right end of the row */
.randombtn {
  margin-left: auto; font-family: var(--sans); font-size: .8rem; padding: 7px 13px; border-radius: 999px;
  border: 1px solid transparent; background: transparent; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.randombtn:hover { color: var(--accent-ink); }
@media (max-width: 520px) { .randombtn { padding: 7px 11px; } }
.viewbtn {
  font-family: var(--sans); font-size: .8rem; padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--rule); background: transparent; color: var(--ink-soft); cursor: pointer;
}
.viewbtn:hover { border-color: var(--accent); color: var(--ink); }
.viewbtn { white-space: nowrap; }        /* four views: wrap whole buttons, never a label */
@media (max-width: 520px) {
  .viewbtn { padding: 7px 11px; }
  li.entry .pick { width: 20px; height: 20px; }   /* a target a thumb can hit; after .pick so it wins */
}
.viewbtn.on { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.curatornote {
  font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); background: var(--accent-wash);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; max-width: var(--measure);
}
.cloudpanel { padding: 4px 0 20px; }
.cloudhead { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-bottom: 14px;
  font-family: var(--sans); font-size: .8rem; color: var(--ink-soft); }
.cloudhead button { font-family: var(--sans); font-size: .76rem; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.cloudhead button.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent-ink); }
.cloud { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; max-width: 900px; }
.cloud button {
  border: 0; background: none; padding: 2px 0; cursor: pointer; color: var(--ink);
  font-family: var(--serif); line-height: 1.25; border-bottom: 1px solid transparent;
}
.cloud button:hover { color: var(--accent-ink); border-bottom-color: var(--accent); }
.cloud button .c { font-family: var(--sans); font-size: .75rem; color: var(--ink-faint); vertical-align: super; margin-left: 2px; }


/* the year as a column: present at a glance, never louder than the title */
/* 25px tall for a finger (WCAG 2.5.8) with the text where it was: the padding is taken back by the margins, and the
   top edge meets the select box's hit area without overlapping it */
.yearmark {
  display: block; width: 100%; margin: -2px 0 2px; padding: 2px 0 4px; border: 0; background: none; cursor: pointer;
  font-family: var(--sans); font-size: .78rem; font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: .015em; color: var(--ink-soft); text-align: right;
}
.yearmark:hover { color: var(--accent-ink); }
li.entry { grid-template-columns: 58px minmax(0, 1fr); }
.rank .num { font-size: .88rem; }
.rank .lbl { font-size: .75rem; letter-spacing: .01em; text-transform: none; }
@media (max-width: 860px) { li.entry { grid-template-columns: 52px minmax(0, 1fr); } }

/* hit areas of at least 24x24 (WCAG 2.5.8) for controls drawn smaller: an invisible expander, so nothing moves.
   Approved by Drew 2026-11-24 from the impeccable sample. */
.pick, .doi, .oa, .resultbar .reset { position: relative; }
.pick::before, .doi::before, .oa::before, .resultbar .reset::before { content: ""; position: absolute; }
.pick::before { inset: -5px; }                      /* drawn 15px on desktop -> 25px */
@media (max-width: 520px) { li.entry .pick::before { inset: -2px; } }   /* drawn 20px on phones -> 24px */
.doi::before, .oa::before { inset: -3px -2px; }     /* 19-20px tall -> 26px; the underline stays at the text */
.resultbar .reset::before { inset: -2px 0; }        /* "select all", 22px -> 26px */
.refs-n, a.rel-t { position: relative; }
.refs-n::before, a.rel-t::before { content: ""; position: absolute; }
.refs-n::before { inset: -2px 0; }                  /* "14 shared", 21px -> 25px */
a.rel-t::before { inset: -4px 0; }                  /* a related title, 17px -> 25px */
/* left alone: links inside running text (authors, venues, "About the counts"), which 2.5.8 exempts, and the
   histogram bars, which need a design decision of their own (a year control on phones) */

.themebtn { display: inline-flex; align-items: center; gap: 7px; padding: 10px 13px; }
.themename { font-family: var(--sans); font-size: .85rem; }
@media (max-width: 720px) { .themename { display: none; } }
