/* ---------------------------------------------------------------------------
   catalogue.css — the reading room: paper, ink and a fine rule system.

   The Wall is a dark room and the Couch a television; the Catalogue is the
   opposite of both, a desk in daylight. The only saturated colour belongs to
   the games themselves (each row's swatch, the band on a record), plus one
   accent that means "in your selection" wherever it appears: a bar, a column,
   a mark, the focus ring. Everything else is ink on paper.

   Type does the work: Newsreader for names and headings, Archivo for the
   interface, IBM Plex Mono where a value is literal (slugs, paths, queries),
   tabular figures wherever numbers stand in a column.
--------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  --paper: #f4f1ea;
  --paper-hi: #faf8f3;
  --paper-lo: #ebe6da;
  --ink: #1b1916;
  --ink-2: #4a453d;
  --ink-3: #6b6457;
  --rule: #d8d1c2;
  --rule-soft: #e6e0d4;
  --hover: #efeadf;
  --cursor: #e8e1d1;

  /* The one colour of the chrome: "in your selection". Validated against the
     paper with the dataviz checks (6.2:1, inside the lightness band). */
  --accent: #2c4fc4;
  --accent-ink: #ffffff;
  --accent-wash: rgba(44, 79, 196, 0.1);
  --accent-soft: #e4e8f5;

  /* The three layers of every bar and column. */
  --layer-total: #e1dacb;
  --layer-other: #a39b8b;
  --layer-selected: #4f483d;

  --problem: #a8431f;

  --serif: 'Newsreader', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --facets-w: 248px;
  --sheet-w: 384px;
  --pad: 20px;
  --row-h: 40px;
  --head-h: 34px;
  --group-h: 36px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  font-variation-settings: 'wdth' 100;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

body.is-playing {
  overflow: hidden;
}

/* With a query, the selection takes the accent; without one, the bars are ink. */
body.is-querying {
  --layer-selected: var(--accent);
}

h1,
h2,
h3,
p,
figure,
dl,
dd,
ol,
ul {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-align: inherit;
}

a {
  color: inherit;
}

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

code,
kbd {
  font-family: var(--mono);
  font-size: 0.92em;
}

[hidden] {
  display: none !important;
}

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

::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: absolute;
  inset-inline-start: -999px;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--paper);
}

.skip:focus {
  inset-inline-start: 0.5rem;
  top: 0.5rem;
}

/* Small capitals, set by hand: the face has none of its own. */
.label {
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.num {
  font-variant-numeric: tabular-nums;
}

.nil {
  color: var(--ink-3);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.42em 0.1em;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--paper-hi);
  color: var(--ink-2);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  vertical-align: 0.05em;
  white-space: nowrap;
}

/* --- the desk: three panes on a wide screen -------------------------------- */

@media (min-width: 1200px) {
  body {
    height: 100dvh;
    overflow: hidden;
    max-width: 2400px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: var(--facets-w) minmax(0, 1fr) var(--sheet-w);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      'mast mast mast'
      'sum sum sheet'
      'facets desk sheet';
  }

  body.is-playing {
    overflow: hidden;
  }
}

@media (max-width: 1499px) {
  :root {
    --facets-w: 228px;
    --sheet-w: 356px;
    --pad: 18px;
  }
}

@media (min-width: 1500px) {
  :root {
    --facets-w: 264px;
    --sheet-w: 404px;
    --pad: 24px;
  }
}

@media (min-width: 2000px) {
  :root {
    --facets-w: 288px;
    --sheet-w: 452px;
    --pad: 28px;
  }
}

/* --- masthead ------------------------------------------------------------------ */

.masthead {
  grid-area: mast;
  display: grid;
  grid-template-columns: var(--facets-w) minmax(0, 1fr) var(--sheet-w);
  align-items: start;
  padding: 16px 0 12px;
  border-bottom: 3px double var(--ink);
}

.masthead__mark {
  padding: 2px 0 0;
  padding-inline-start: var(--pad);   /* the mark may use the gutter; longer text wraps rather than slide under the search */
  min-width: 0;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.34em;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1;
  flex-wrap: wrap;   /* a longer name in another language wraps under "52in1" */
  row-gap: 4px;
}

.wordmark__hub {
  font-weight: 560;
  letter-spacing: -0.012em;
  font-variation-settings: 'opsz' 40;
}

.wordmark__dot {
  color: var(--ink-3);
  font-weight: 400;
}

.wordmark__name {
  font-size: 0.6em;
  font-weight: 560;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Narrower panes, a smaller mark, so it still fits over the facets. */
@media (max-width: 1499px) {
  .wordmark {
    font-size: 22px;
  }

  .wordmark__name {
    letter-spacing: 0.17em;
  }
}

.masthead__colophon {
  margin-top: 7px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
}

.masthead__views {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 2px var(--pad) 0;
}

/* The account sits on a line of its own under the switch: the column is narrow. */
.masthead__views .account {
  flex-basis: 100%;
  justify-content: flex-end;
  font-size: 12.5px;
}

.masthead__views .views {
  --views-bg: transparent;
  --views-line: var(--rule);
  --views-ink: var(--ink);
  --views-ink-dim: var(--ink-3);
  --views-on-bg: var(--ink);
  --views-on-ink: var(--paper);
  --views-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
}

/* --- the query bar ---------------------------------------------------------------- */

.query {
  position: relative;
  min-width: 0;
  min-height: 74px;
  padding: 0 4px;
}

.query__field {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  border: 1px solid #cbc2b0;
  border-radius: 8px;
  background: var(--paper-hi);
  transition:
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}

.query__field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.query__icon {
  flex: none;
  width: 17px;
  height: 17px;
  margin-inline-start: 13px;
  color: var(--ink-3);
}

.query__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 10px;
  border: 0;
  background: none;
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  outline: none;
}

.query__input::placeholder {
  color: var(--ink-3);
  opacity: 1;
}

.query__key {
  flex: none;
  margin-inline-end: 6px;
}

.query__field:focus-within .query__key {
  visibility: hidden;
}

.query__help-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-inline-end: 7px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
}

.query__help-toggle:hover,
.query__help-toggle[aria-expanded='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.query__suggest,
.query__help,
.menu {
  position: absolute;
  z-index: 30;
  background: var(--paper-hi);
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow:
    0 14px 36px rgba(27, 25, 22, 0.16),
    0 2px 6px rgba(27, 25, 22, 0.08);
}

.query__suggest {
  top: calc(100% + 6px);
  inset-inline-start: 30px;
  min-width: 280px;
  max-width: min(520px, 100%);
  padding: 5px;
}

.query__option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 9px;
  border-radius: 5px;
  cursor: pointer;
}

.query__option:hover,
.query__option[aria-selected='true'] {
  background: var(--accent-soft);
}

.query__option[aria-selected='true'] .query__option-text {
  color: var(--accent);
}

.query__option-text {
  font-size: 13px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.query__option-hint {
  flex: none;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.query__help {
  top: calc(100% + 6px);
  inset-inline-end: 0;
  width: min(820px, calc(100vw - 32px));
  padding: 18px 20px 16px;
}

.query__help-lede {
  font-family: var(--serif);
  font-size: 15.5px;
  color: var(--ink-2);
  margin-bottom: 14px;
}

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

.query__help-group .label {
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}

.example {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.example:hover {
  background: var(--accent-soft);
  color: var(--ink-2);
}

.example code {
  font-size: 12.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.query__help-foot {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--ink-3);
}

.query__help-foot code {
  color: var(--ink-2);
}

/* --- chips --------------------------------------------------------------------- */

.query__chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 6px;
  min-height: 24px;
  margin-top: 8px;
}

.query__empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13.5px;
  color: var(--ink-3);
}

.chip {
  display: inline-flex;
  align-items: stretch;
  height: 24px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper-hi);
  font-size: 12.5px;
  overflow: hidden;
}

.chip__edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-block: 0 0; padding-inline: 8px 4px;
}

.chip__field {
  font-size: 9.5px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.chip__value {
  color: var(--ink);
  max-width: 28ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chip.is-not .chip__value {
  color: var(--ink-2);
}

.chip.is-problem {
  border-color: var(--problem);
}

.chip.is-problem .chip__value {
  text-decoration: underline wavy var(--problem);
  text-underline-offset: 3px;
}

.chip__remove {
  display: grid;
  place-items: center;
  width: 22px;
  color: var(--ink-3);
}

.chip__remove svg {
  width: 11px;
  height: 11px;
}

.chip__remove:hover,
.chip__edit:hover {
  background: var(--hover);
  color: var(--ink);
}

.query__clear {
  padding: 0 4px;
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--rule);
}

.query__clear:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* --- summary strip -------------------------------------------------------------- */

.summary {
  grid-area: sum;
  display: grid;
  grid-template-columns: 1fr 1fr 1.45fr 1fr 1.25fr 1fr;
  border-bottom: 1px solid var(--rule);
}

.tile {
  min-width: 0;
  padding: 11px var(--pad) 12px;
  border-inline-start: 1px solid var(--rule-soft);
}

.tile:first-child {
  border-inline-start: 0;
}

.tile__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile__value {
  margin-top: 3px;
  font-size: 24px;
  font-weight: 620;
  line-height: 1.1;
  letter-spacing: -0.015em;
  font-variation-settings: 'wdth' 94;
  white-space: nowrap;
}

.tile__value--date {
  font-size: 20px;
  line-height: 1.32;
}

.tile__unit {
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0;
  color: var(--ink-3);
  font-variation-settings: 'wdth' 100;
}

.tile__sub {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.xref {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.xref:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

/* The one ratio: original against inspired, as a meter of two buttons. */
.split {
  display: flex;
  gap: 2px;
  height: 10px;
  margin: 10px 0 7px;
}

.split__part {
  position: relative;
  min-width: 4px;
  padding: 0;
}

.split__part--original {
  flex: var(--share) 1 0;
}

.split__part--inspired {
  flex: calc(1 - var(--share)) 1 0;
}

/* A taller hit area than the bar it carries. */
.split__part::before {
  content: '';
  position: absolute;
  inset: -6px 0;
}

.split__bar {
  display: block;
  height: 100%;
  border-radius: 2px;
}

.split__part--original .split__bar,
.split__key--original {
  background: var(--ink-2);
}

.split__part--inspired .split__bar,
.split__key--inspired {
  background: #cfc6b4;
}

.split__part:hover .split__bar,
.split__part[aria-pressed='true'] .split__bar {
  background: var(--accent);
}

.split__legend {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.split__legend b {
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.split__key {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-inline-end: 5px;
  border-radius: 1.5px;
  vertical-align: 0;
}

/* --- facets ------------------------------------------------------------------------ */

.facets {
  grid-area: facets;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-inline-end: 1px solid var(--rule);
}

.facets__body {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px var(--pad) 28px;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.facets__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.facets__clear,
.facet__clear,
.facet__more {
  font-size: 11.5px;
  color: var(--ink-3);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.facets__clear:hover,
.facet__clear:hover,
.facet__more:hover {
  color: var(--ink);
  text-decoration-color: var(--ink);
}

.legend {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  font-size: 11px;
  color: var(--ink-3);
}

.legend li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.key {
  display: inline-block;
  flex: none;
  width: 10px;
  height: 8px;
  border-start-start-radius: 0; border-start-end-radius: 2px; border-end-end-radius: 2px; border-end-start-radius: 0;
}

.key--selected {
  background: var(--layer-selected);
}

.key--other {
  background: var(--layer-other);
}

.key--total {
  background: var(--layer-total);
}

.facet {
  padding: 14px 0 4px;
}

.facet + .facet {
  border-top: 1px solid var(--rule-soft);
}

.facet__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.facet.is-filtered .facet__title .label {
  color: var(--ink);
}

.facet:not(.is-open) .facet__option:nth-child(n + 9):not(.is-on) {
  display: none;
}

.facet__more {
  margin: 4px 0 0;
}

.bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(36px, 30%) 40px;
  align-items: center;
  gap: 8px;
  width: calc(100% + 12px);
  min-height: 23px;
  margin: 0 -6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 12.5px;
  line-height: 1.25;
  color: var(--ink-2);
}

.bar:hover {
  background: var(--hover);
  color: var(--ink);
}

.bar__label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar__track {
  position: relative;
  height: 8px;
}

.bar__track > span {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  border-start-start-radius: 0; border-start-end-radius: 2px; border-end-end-radius: 2px; border-end-start-radius: 0;
}

.bar__total {
  width: calc(var(--total, 0) * 100%);
  background: var(--layer-total);
}

.bar__other {
  width: calc(var(--other, 0) * 100%);
  background: var(--layer-other);
}

.bar__selected {
  width: calc(var(--selected, 0) * 100%);
  background: var(--layer-selected);
}

.bar__count {
  text-align: end;
  white-space: nowrap;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.bar__n {
  color: var(--ink);
}

.bar__of {
  color: var(--ink-3);
}

.bar.is-empty .bar__label,
.bar.is-empty .bar__n {
  color: var(--ink-3);
}

/* A picked value: an accent rule in the margin, and the label in ink. */
.bar[aria-pressed='true'] {
  color: var(--ink);
  font-weight: 600;
}

.bar[aria-pressed='true']::before,
.bar.is-excluded::before {
  content: '';
  position: absolute;
  inset-inline-start: -3px;
  top: 4px;
  bottom: 4px;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}

.bar.is-excluded::before {
  background: var(--ink-2);
}

.bar.is-excluded .bar__label {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: var(--ink-3);
}

.facets__done {
  display: none;
}

/* --- the desk: toolbar, figures and ledger ------------------------------------------ */

.desk {
  grid-area: desk;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  container: desk / inline-size;
}

.toolbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px var(--pad);
  border-bottom: 1px solid var(--rule);
}

.toolbar__start,
.toolbar__end {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.toolbar__end {
  justify-content: flex-end;
}

.tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}

.tool:hover {
  background: var(--hover);
  color: var(--ink);
}

.tool svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.tool__caret {
  width: 12px !important;
  height: 12px !important;
  margin-inline-end: -3px;
}

.tool--toggle[aria-pressed='true'] {
  background: var(--paper-lo);
  border-color: #c2b9a6;
  color: var(--ink);
}

.tool--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}

.tool--primary:hover {
  background: #2443ad;
  color: var(--accent-ink);
}

.tool--filters,
.tool--sort {
  display: none;
}

.tool__badge {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 650;
  line-height: 18px;
  text-align: center;
}

.tool--select {
  position: relative;
  padding: 0;
}

.toolbar__break {
  display: none;
}

.tool__select {
  appearance: none;
  height: 28px;
  padding-block: 0 0; padding-inline: 10px 28px;
  border: 0;
  background: transparent
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a453d' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat right 8px center / 12px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
}
.tool__select:dir(rtl) {
  background-position: left 8px center;
}


.tool__select:focus-visible {
  outline-offset: 0;
}

.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--rule);
  border-radius: 7px;
}

.seg__option {
  height: 24px;
  padding: 0 9px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-3);
}

.seg__option:hover {
  color: var(--ink);
}

.seg__option[aria-pressed='true'] {
  background: var(--ink);
  color: var(--paper);
}

.toolbar__marks {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-inline-end: 4px;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

.toolbar__unmark {
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.toolbar__unmark:hover {
  color: var(--ink);
}

.tool__menu {
  position: relative;
}

.menu {
  top: calc(100% + 6px);
  inset-inline-end: 0;
  min-width: 220px;
  padding: 5px;
}

.menu__item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 5px;
  font-size: 13px;
  color: var(--ink);
}

.menu__item:hover,
.menu__item:focus-visible {
  background: var(--accent-soft);
  outline: none;
}

.desk__scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rule) transparent;
}

.desk__status {
  padding: 40px var(--pad);
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink-3);
}

/* --- figures -------------------------------------------------------------------------- */

.figures {
  padding: 14px var(--pad) 10px;
  border-bottom: 1px solid var(--rule);
}

.figures__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.figures__head .legend {
  justify-content: flex-end;
}

.figures__row {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr);
  gap: 32px;
}

.figure {
  min-width: 0;
}

.figure__cap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 8px;
  min-height: 24px;
  margin-bottom: 4px;
}

.figure__no {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
}

.figure__title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 560;
  color: var(--ink);
}

.figure__note {
  font-size: 11.5px;
  color: var(--ink-3);
}

.figure__range {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.figure__range:empty {
  display: none;
}

.figure__range-text {
  padding-block: 1px 1px; padding-inline: 7px 4px;
  border-start-start-radius: 4px; border-start-end-radius: 0; border-end-end-radius: 0; border-end-start-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.figure__range-clear {
  padding-block: 1px 1px; padding-inline: 5px 7px;
  border-start-start-radius: 0; border-start-end-radius: 4px; border-end-end-radius: 4px; border-end-start-radius: 0;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  line-height: 18px;
}

.figure__range-clear:hover {
  background: var(--accent);
  color: var(--accent-ink);
}

.figure__toggle {
  margin-inline-start: auto;
  font-size: 11.5px;
  color: var(--ink-3);
  text-decoration: underline;
  text-decoration-color: var(--rule);
  text-underline-offset: 3px;
}

.figure__toggle:hover {
  color: var(--ink);
}

.figure__plot {
  position: relative;
  height: 126px;
  cursor: crosshair;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.figure__plot:focus-visible {
  outline-offset: 4px;
}

.figure__svg {
  overflow: visible;
}

.figure__svg .grid {
  stroke: var(--rule-soft);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.figure__svg .baseline,
.figure__svg .tick-mark {
  stroke: var(--rule);
  stroke-width: 1;
  shape-rendering: crispEdges;
}

.figure__svg .tick {
  font-family: var(--sans);
  font-size: 10.5px;
  fill: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.figure__svg .col--total {
  fill: var(--layer-total);
}

.figure__svg .col--other {
  fill: var(--layer-other);
}

.figure__svg .col--selected {
  fill: var(--layer-selected);
}

.figure__svg .spot {
  fill: rgba(27, 25, 22, 0.05);
}

.figure__svg .brush {
  fill: var(--accent-wash);
}

.figure__svg .extent {
  fill: var(--accent);
}

.figure__tip {
  position: absolute;
  top: -2px;
  z-index: 20;
  min-width: 150px;
  max-width: 240px;
  padding: 8px 10px;
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: var(--paper-hi);
  box-shadow:
    0 12px 28px rgba(27, 25, 22, 0.16),
    0 2px 5px rgba(27, 25, 22, 0.08);
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
}

.figure__tip-title {
  margin-bottom: 4px;
  font-family: var(--serif);
  font-size: 13.5px;
  font-weight: 560;
}

.figure__tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
}

.figure__tip-row b {
  min-width: 2ch;
  color: var(--ink);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  text-align: end;
}

.figure__tip-row .key {
  width: 10px;
  height: 2px;
  border-radius: 1px;
}

.figure__tip-names {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--rule-soft);
  font-family: var(--serif);
  font-size: 12.5px;
  color: var(--ink-2);
}

.figure__data {
  position: relative;
  height: 126px;
  overflow: auto;
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
}

.figure__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.figure__table th,
.figure__table td {
  padding: 3px 10px;
  border-bottom: 1px solid var(--rule-soft);
  text-align: start;
  font-weight: 400;
}

.figure__table thead th {
  position: sticky;
  top: 0;
  background: var(--paper);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.figure__table .num {
  text-align: end;
}

/* --- the ledger ---------------------------------------------------------------------- */

.records:focus {
  outline: none;
}

.ledger {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.ledger thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: var(--head-h);
  padding: 0 8px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  text-align: start;
  vertical-align: bottom;
  padding-bottom: 7px;
}

.ledger thead .num {
  text-align: end;
}

.ledger__sort {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
}

.ledger__sort:hover,
.is-sorted .ledger__sort {
  color: var(--ink);
}

.ledger__arrow {
  font-family: var(--sans);
  letter-spacing: 0;
}

.ledger td,
.ledger tbody th {
  height: var(--row-h);
  padding: 0 8px;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
  text-align: start;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger .num {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

/* Column widths. The name takes what is left. */
.ledger .c-mark {
  width: 36px;
  padding-block: 0 0; padding-inline: 14px 0;
}

.ledger .c-swatch {
  width: 22px;
  padding: 0 4px;
}

.ledger .c-thumb {
  width: 56px;
  padding-block: 0 0; padding-inline: 2px 6px;
}

.ledger .c-genre {
  width: clamp(84px, 8%, 128px);
}

.ledger .c-lineage {
  width: clamp(140px, 15%, 230px);
}

.ledger .c-model {
  width: clamp(96px, 10%, 160px);
}

.ledger .c-players {
  width: 64px;
}

.ledger .c-size {
  width: 112px;
}

.ledger .c-added {
  width: 102px;
}

.ledger .c-builds {
  width: 60px;
}

.ledger .c-fav {
  width: 34px;
  padding: 0 2px;
}

.ledger .c-play {
  width: 46px;
  padding-block: 0 0; padding-inline: 4px 12px;
}

.ledger__row {
  cursor: default;
  scroll-margin-top: calc(var(--head-h) + 2px);
  scroll-margin-bottom: 6px;
}

body:has(.ledger__group) .ledger__row {
  scroll-margin-top: calc(var(--head-h) + var(--group-h) + 2px);
}

.ledger__row:hover > * {
  background: var(--hover);
}

.ledger__row.is-marked > * {
  background: #ecedf2;
}

.ledger__row.is-cursor > * {
  background: var(--cursor);
}

/* The cursor: an ink bar in the margin, as a reader's ruler. */
.ledger__row.is-cursor > :first-child {
  box-shadow: inset 3px 0 0 var(--ink);
}

/* Keyboard focus draws the whole row, so it is never lost in a long list. */
.ledger__row:has(.ledger__name:focus-visible) > * {
  box-shadow:
    inset 0 2px 0 var(--accent),
    inset 0 -2px 0 var(--accent);
}

.ledger__row:has(.ledger__name:focus-visible) > :first-child {
  box-shadow:
    inset 3px 0 0 var(--accent),
    inset 0 2px 0 var(--accent),
    inset 0 -2px 0 var(--accent);
}

.ledger__row:has(.ledger__name:focus-visible) > :last-child {
  box-shadow:
    inset -2px 0 0 var(--accent),
    inset 0 2px 0 var(--accent),
    inset 0 -2px 0 var(--accent);
}

.ledger__name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 520;
  line-height: 1.15;
  letter-spacing: -0.003em;
  color: var(--ink);
  text-decoration: none;
}

.ledger__name:focus-visible {
  outline: none;
}

.ledger__tagline {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--ink-3);
}

.ledger__blurb {
  display: none;
}

.ledger .c-genre,
.ledger .c-model {
  color: var(--ink-2);
}

.lineage {
  color: var(--ink-3);
  font-size: 12px;
}

/* A title is set in italics, as the titles of works are. */
.lineage cite {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink);
}

.lineage__after {
  font-size: 11.5px;
}

.lineage__series {
  font-size: 11.5px;
}

.lineage.is-original {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.size {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Scaled to the largest file in view: a long bar is a heavy page. */
.size__bar {
  flex: 1;
  max-width: 44px;
  height: 5px;
  background: var(--rule-soft);
}

.size__fill {
  display: block;
  min-width: 1.5px;
  height: 100%;
  background: var(--ink-3);
  border-start-start-radius: 0; border-start-end-radius: 1.5px; border-end-end-radius: 1.5px; border-end-start-radius: 0;
}

.size__n {
  min-width: 50px;
  color: var(--ink-2);
}

.c-added time {
  color: var(--ink-2);
}

.ledger .c-builds {
  color: var(--ink-3);
}

.swatch {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(27, 25, 22, 0.14);
}

.ledger__thumb {
  width: 40px;
  height: 30px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--paper-lo);
  box-shadow: 0 0 0 1px rgba(27, 25, 22, 0.1);
}

.ledger__mark {
  appearance: none;
  display: block;
  width: 15px;
  height: 15px;
  margin: 0;
  border: 1.5px solid #b6ad9b;
  border-radius: 3.5px;
  background: var(--paper-hi);
  cursor: pointer;
}

.ledger__mark:hover {
  border-color: var(--ink-2);
}

.ledger__mark:checked {
  border-color: var(--accent);
  background: var(--accent)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}

.ledger__fav,
.ledger__play {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: var(--ink-3);
}

.ledger__fav svg {
  width: 16px;
  height: 16px;
}

.ledger__fav:hover {
  color: var(--ink);
  background: var(--paper-lo);
}

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

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

/* Unstarred stars stay out of the way until the row is looked at. */
.ledger__row:not(:hover, .is-cursor) .ledger__fav[aria-pressed='false'] {
  opacity: 0.38;
}

.ledger__play {
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  transform: scale(0.85);
  transition:
    opacity 0.12s var(--ease),
    transform 0.12s var(--ease);
}

.ledger__play svg {
  width: 11px;
  height: 11px;
  margin-inline-start: 2px;
}

.ledger__row:hover .ledger__play,
.ledger__row.is-cursor .ledger__play,
.ledger__play:focus-visible {
  opacity: 1;
  transform: none;
}

.ledger__play:hover {
  background: var(--accent);
}

.ledger__group th {
  position: sticky;
  top: var(--head-h);
  z-index: 2;
  height: var(--group-h);
  padding: 10px 14px 0;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  text-align: start;
  vertical-align: bottom;
  padding-bottom: 6px;
}

.ledger__group-label {
  font-family: var(--serif);
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink);
}

.ledger__group.is-rest .ledger__group-label {
  font-style: italic;
  font-weight: 500;
  color: var(--ink-2);
}

.ledger__group-meta {
  margin-inline-start: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* Comfortable: room for a bigger picture and the opening of the blurb. */
body[data-density='comfortable'] {
  --row-h: 66px;
}

body[data-density='comfortable'] .ledger__thumb {
  width: 56px;
  height: 42px;
}

body[data-density='comfortable'] .ledger .c-thumb {
  width: 72px;
}

body[data-density='comfortable'] .ledger__name {
  font-size: 16px;
}

body[data-density='comfortable'] .ledger__blurb {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  color: var(--ink-3);
  font-family: var(--serif);
  font-style: italic;
}

/* No records match. */
.ledger__empty {
  padding: 56px var(--pad) 64px;
}

.void {
  max-width: 34rem;
  margin: 0 auto;
  text-align: center;
}

.void__title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.void__query {
  margin: 10px 0 22px;
  color: var(--ink-3);
}

.void__query code {
  display: inline-block;
  max-width: 100%;
  padding: 3px 8px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: var(--paper-hi);
  color: var(--ink-2);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.void__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Columns give way as the desk narrows, least telling first. */
@container desk (max-width: 1240px) {
  .ledger .c-builds {
    display: none;
  }
}

@container desk (max-width: 1120px) {
  .ledger .c-players {
    display: none;
  }
}

@container desk (max-width: 1060px) {
  .ledger .c-model {
    display: none;
  }
}

@container desk (max-width: 900px) {
  .figures__row {
    gap: 22px;
  }

  .ledger .c-mark {
    width: 30px;
    padding-inline-start: 10px;
  }

  .ledger .c-swatch {
    width: 17px;
    padding: 0 3px;
  }

  .ledger .c-thumb {
    width: 50px;
  }

  .ledger .c-genre {
    width: 80px;
  }

  .ledger .c-size {
    width: 92px;
  }

  .size__bar {
    max-width: 26px;
  }

  .ledger .c-added {
    width: 92px;
  }

  .ledger .c-fav {
    width: 30px;
  }

  .ledger .c-play {
    width: 38px;
    padding-inline-end: 6px;
  }
}

@container desk (max-width: 760px) {
  .ledger .c-lineage {
    display: none;
  }
}

/* --- one column: tablets and phones ----------------------------------------------------- */

@media (max-width: 1199px) {
  :root {
    --pad: 16px;
  }

  .masthead {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'mark views'
      'query query';
    row-gap: 12px;
    padding: 14px 0 10px;
  }

  .masthead__mark {
    grid-area: mark;
  }

  .masthead__views {
    grid-area: views;
  }

  .query {
    grid-area: query;
    min-height: 0;
    padding: 0 var(--pad);
  }

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

  .tile:nth-child(4) {
    border-inline-start: 0;
  }

  .tile:nth-child(n + 4) {
    border-top: 1px solid var(--rule-soft);
  }

  .facets {
    display: none;
  }

  .sheet {
    display: none;
  }

  .tool--filters,
  .tool--sort {
    display: inline-flex;
  }

  .toolbar {
    position: sticky;
    top: 0;
    z-index: 12;
    background: var(--paper);
    flex-wrap: wrap;
  }

  .desk__scroll {
    overflow: visible;
  }

  .ledger thead th {
    top: 48px;
  }

  .ledger__group th {
    top: calc(48px + var(--head-h));
  }

  /* Fingers, not pointers: every target at least 32px tall. */
  .bar {
    min-height: 34px;
  }

  .chip {
    height: 30px;
  }

  .chip__remove {
    width: 30px;
  }

  /* The filters, as a sheet over everything. */
  body.is-filtering {
    overflow: hidden;
  }

  body.is-filtering .facets {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: var(--paper);
    border: 0;
  }

  body.is-filtering .facets__done {
    display: block;
    padding: 12px var(--pad) calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--rule);
    background: var(--paper);
  }

  .facets__done .btn {
    width: 100%;
    justify-content: center;
  }
}

/* Cards: the ledger as a list of record cards when the desk is a phone's width. */
@container desk (max-width: 699px) {
  .toolbar .seg {
    display: none;
  }

  .ledger,
  .ledger tbody {
    display: block;
  }

  .ledger thead {
    display: none;
  }

  .ledger__group {
    display: block;
  }

  .ledger__group th {
    display: block;
    position: sticky;
    top: 48px;
    height: auto;
    padding: 14px var(--pad) 6px;
  }

  .ledger__row {
    display: grid;
    grid-template-columns: 92px auto auto minmax(0, 1fr) 40px;
    grid-template-rows: auto auto 1fr;
    column-gap: 0;
    align-items: start;
    padding-block: 12px 12px; padding-inline: var(--pad) 6px;
    border-bottom: 1px solid var(--rule-soft);
    scroll-margin-top: 60px;
  }

  .ledger .ledger__row > * {
    display: none;
    height: auto;
    padding: 0;
    border: 0;
    background: none !important;
    box-shadow: none !important;
  }

  .ledger__row.is-cursor {
    background: var(--cursor);
  }

  .ledger .c-thumb,
  .ledger .c-name,
  .ledger .c-genre,
  .ledger .c-size,
  .ledger .c-added,
  .ledger .c-fav {
    display: block;
    width: auto;
  }

  .ledger .c-thumb {
    grid-column: 1;
    grid-row: 1 / 4;
    padding-inline-end: 14px;
  }

  .ledger__thumb,
  body[data-density='comfortable'] .ledger__thumb {
    width: 78px;
    height: 58px;
    border-radius: 3px;
  }

  .ledger .c-name {
    grid-column: 2 / 5;
    grid-row: 1;
    white-space: normal;
  }

  .ledger__name {
    font-size: 17.5px;
    line-height: 1.2;
    white-space: normal;
  }

  .ledger__tagline {
    margin-top: 2px;
    font-size: 12.5px;
    white-space: nowrap;
  }

  .ledger .c-genre,
  .ledger .c-size,
  .ledger .c-added {
    grid-row: 2;
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--ink-2);
    text-align: start;
  }

  .ledger .c-genre {
    grid-column: 2;
  }

  .ledger .c-size {
    grid-column: 3;
  }

  .ledger .c-added {
    grid-column: 4;
  }

  .ledger .c-size::before,
  .ledger .c-added::before {
    content: '·';
    padding: 0 6px;
    color: var(--ink-3);
  }

  .ledger .c-size .size {
    display: inline;
  }

  .ledger .size__bar {
    display: none;
  }

  .ledger .size__n {
    min-width: 0;
  }

  .ledger .c-fav {
    grid-column: 5;
    grid-row: 1 / 3;
    justify-self: center;
  }

  .ledger__row:not(:hover, .is-cursor) .ledger__fav[aria-pressed='false'] {
    opacity: 0.5;
  }
}

/* A phone's width: the toolbar in two rows, over the record cards. */
@media (max-width: 699px) {
  /* Two rows: what to show and what to do, then how to order it. */
  .toolbar {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px 6px;
  }

  .toolbar__start,
  .toolbar__end {
    display: contents;
  }

  .tool--filters {
    order: 1;
  }

  .tool--toggle {
    order: 2;
  }

  .toolbar__marks {
    order: 3;
  }

  .tool--primary {
    order: 4;
  }

  .tool__menu {
    order: 5;
    margin-inline-start: auto;
  }

  .tool__menu .tool__text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .toolbar__break {
    display: block;
    order: 6;
    flex-basis: 100%;
    height: 0;
  }

  .tool--sort,
  .tool--group {
    order: 7;
    flex: 1 1 0;
    min-width: 0;
  }

  .tool--select .tool__select {
    width: 100%;
    min-width: 0;
  }

  .seg {
    display: none;
  }

  /* Two rows are too tall to keep on screen; the group headings stick instead. */
  .toolbar {
    position: static;
  }

  .ledger .ledger__group th {
    top: 0;
  }
}

@media (max-width: 560px) {
  /* The strip becomes a row to swipe along, so the records start high. */
  .summary {
    position: relative;
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .summary::-webkit-scrollbar {
    display: none;
  }

  .tile,
  .tile:nth-child(n) {
    flex: 0 0 auto;
    min-width: 40%;
    padding: 9px var(--pad) 10px;
    border-top: 0;
    border-inline-start: 1px solid var(--rule-soft);
    scroll-snap-align: start;
  }

  .tile:first-child {
    border-inline-start: 0;
  }

  .tile:nth-child(3) {
    min-width: 62%;
  }

  .tile__value {
    font-size: 21px;
  }

  .tile__value--date {
    font-size: 17px;
    line-height: 1.38;
  }

  .wordmark {
    font-size: 22px;
  }

  .masthead__colophon {
    font-size: 12px;
  }

  /* The mark, the hub's controls and the query each take a line of their own. */
  .masthead {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      'mark'
      'views'
      'query';
  }

  .masthead__views {
    justify-content: flex-start;
  }

  .masthead__views .account {
    flex-basis: auto;
  }

  /* The themes button goes to its icon; its words stay for screen readers. */
  .masthead__views .views__label {
    display: inline;
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .query__key,
  .query__empty {
    display: none;
  }

  .query__chips:has(.query__empty) {
    display: none;
  }

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

  .figures__row {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .figures__head .legend {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
