body {
  --accent: #256558;
  --selected: #e7f2ed;
  --raw: #aa7035;
  --prior: #8995a5;
  --rise: #096a60;
  --fall: #a5323b;
  --edge: var(--border);
  font-size: 0.92rem;
}
:root[data-theme='dark'] body {
  --accent: #8dd6bb;
  --selected: #203730;
  --raw: #ecaa66;
  --prior: #8593a6;
  --rise: #88d9cb;
  --fall: #ffa7a9;
}
.header-row {
  padding: 0.6rem clamp(14px, 1.5vw, 32px);
  align-items: center;
}
.workspace {
  display: grid;
  grid-template-columns: clamp(276px, 23vw, 405px) minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
body {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
.library {
  background: var(--surface-2);
  border-right: 1px solid var(--edge);
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.library-tools,
.apply,
.analysis {
  padding: clamp(12px, 1.25vw, 24px);
}
@font-face {
  font-family: "Catalog pictograms";
  src: url("catalog-icons.woff2") format("woff2");
  font-display: block;
}
.header-row.tool-header-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.6rem clamp(10px, 1vw, 18px);
}
#domains {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1px;
}
#domains button {
  display: inline-flex;
  align-items: center;
  gap: 0.34em;
  padding: 0.36rem 0.27rem;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
}
#domains button[hidden] { display: none; }
#domains button:hover { background: var(--surface-2); color: var(--text); }
#domains i, #recommendation-icon {
  font: normal 1.05rem/1 "Catalog pictograms";
}
#domains [aria-pressed='true'] {
  background: var(--selected);
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 1699px) {
  .header-row.tool-header-row { grid-template-columns: 1fr auto; }
  #domains { grid-row: 2; grid-column: 1 / -1; }
}
@media (min-width: 1180px) and (max-width: 1699px) {
  #domains { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; }
  #domains button { padding-inline: 0.17rem; gap: 0.26em; }
}
@media (max-width: 1179px) {
  #domains {
    display: grid;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    justify-items: start;
    column-gap: 0.35rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    padding: 2px;
  }
}
.filter-scope {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-block: 1px solid var(--edge);
  background: var(--surface-2);
}
.import {
  display: inline-block;
  position: relative;
  color: var(--primary);
  cursor: pointer;
  font-size: 0.78rem;
  text-decoration: underline;
}
.import input {
  position: absolute;
  inset: 0;
  opacity: 0;
  width: 100%;
  cursor: pointer;
}
.import:focus-within {
  outline: 2px solid var(--primary);
}
.section-line,
.catalog-tools,
.apply,
.analysis-head,
.detail-head,
.board-head,
.entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.section-line {
  margin: 0 0 0.45rem;
}
.section-line span,
.catalog-tools,
.entry-meta,
.board-head small,
#context,
#legend,
#formula,
.eyebrow,
footer,
#weights,
.evidence-note {
  color: var(--muted);
  font-size: 0.79rem;
}
#search,
select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.45rem;
  min-width: 0;
  max-width: 100%;
}
#search {
  width: 100%;
}
.catalog-tools {
  margin-top: 0.45rem;
}
input {
  accent-color: var(--accent);
}
.library-tools {
  padding-bottom: 0.6rem;
}
#shelves ul {
  min-height: 0;
  overflow: auto;
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--edge);
  background: var(--surface);
  scrollbar-gutter: stable;
}
.entry {
  padding: 0.55rem clamp(12px, 1.25vw, 24px);
  border-bottom: 1px solid var(--edge);
  line-height: 1.3;
}
.entry.rated {
  background: var(--selected);
  box-shadow: inset 3px 0 var(--accent);
}
.entry.catalog-highlight {
  background: var(--selected);
  box-shadow: inset 4px 0 var(--accent);
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}
.entry-head {
  align-items: baseline;
}
.entry-title {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: start;
  font-size: .87rem;
  line-height: inherit;
}
.entry-title:is(:hover, :focus-visible, [aria-current="true"]) {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: .15em;
}
.entry-meta {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.rating-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.26rem;
  flex-wrap: wrap;
}
.choices {
  display: flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}
.choice {
  flex: none;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  font-size: 0.78rem;
}
.choices label.choice:has(> input[type='radio']) {
  padding-block: 0;
}
.choice input {
  position: absolute;
  opacity: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}
.choice span {
  pointer-events: none;
  display: block;
  border: 1px solid var(--border);
  padding: 0.16rem 0.43rem;
  color: var(--muted);
}
.choice:first-child span {
  border-radius: 3px 0 0 3px;
}
.choice:last-child span {
  border-radius: 0 3px 3px 0;
}
.choice input:checked + span {
  font-weight: bold;
  color: var(--accent);
  background: var(--selected);
  border-color: var(--accent);
}
.choice input:focus-visible + span {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.star span {
  border: 0;
  border-radius: 0 !important;
  position: relative;
  overflow: hidden;
  width: 0.53em;
  height: 1.2em;
  padding: 0;
  font: 1.6rem/1.2 sans-serif;
  color: var(--muted);
}
.star span::before {
  content: '☆';
  position: absolute;
  left: 0;
  width: 1.06em;
  text-align: center;
}
.star:nth-child(even) span::before {
  left: -0.53em;
}
.whole-star span { width: 1.06em; }
.whole-star:nth-child(even) span::before { left: 0; }
.star.filled span::before {
  content: '★';
  color: var(--accent);
}
.choice.star input:checked + span {
  background: none;
}
.rating-readout,
.clear {
  font-size: 0.76rem;
  color: var(--accent);
}
.clear {
  padding: 0.02rem 0.25rem;
  background: transparent;
  border: 0;
  text-decoration: underline;
}
.apply {
  border-top: 1px solid var(--border);
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.83rem;
}
.jump {
  display: none;
}
.analysis {
  overflow: auto;
  min-width: 0;
  background: var(--bg);
  scrollbar-gutter: stable;
}
.analysis-head {
  align-items: end;
  flex-wrap: wrap;
}
.analysis-head h2 {
  font-size: clamp(1.35rem, 2vw, 1.85rem);
  letter-spacing: -0.035em;
}
#context {
  margin: 0.2rem 0 0;
}
.model-controls {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  grid-template-areas: ". . caption" "filters plot model";
  align-items: center;
  gap: .2rem .65rem;
  width: min(32.4rem, 100%);
}
.model-controls > button { font-size: .84rem; }
#facet { grid-area: filters; }
#scatter-toggle { grid-area: plot; }
#model-choice:not([hidden]) { display: contents; }
#model-choice > .choice-label { grid-area: caption; }
.model-field { grid-area: model; min-width: 0; overflow: clip; overflow-clip-margin: 3px; }
#model-scores {
  width: min(32.4rem, 100%);
  margin: .35rem 0 .55rem auto;
  font-size: .8rem;
}
#model-scores summary { cursor: pointer; }
#score-preview { margin-inline-start: .4rem; color: var(--muted); font-weight: normal; }
#score-details dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(8rem, 100%), 1fr));
  gap: .5rem .8rem;
  margin: .65rem 0;
}
#score-details dt, #score-details p { color: var(--muted); }
#score-details dd { margin: .1rem 0 0; font-size: .95rem; font-variant-numeric: tabular-nums; }
#score-details p { margin: .4rem 0; }
.model-controls:has(#model-choice[hidden]) { display: flex; justify-self: end; width: auto; }
@container (max-width: 30rem) {
  .model-controls { grid-template-areas: "filters plot ." "caption caption caption" "model model model"; }
}
.model-controls label {
  display: grid;
  font-size: 0.72rem;
  color: var(--muted);
  gap: 0.1rem;
}
.model-controls select {
  font-size: 0.83rem;
  color: var(--text);
}
#status:empty {
  display: none;
}
#status,
#pending {
  padding: 0.45rem 0.65rem;
  background: var(--warn-soft);
  color: var(--warn);
  margin: 0.5rem 0;
}
#boards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(7px, 0.85vw, 16px);
  margin: 0.85rem 0;
}
.board,
.inspector {
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.board-head {
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0.44rem 0.6rem;
  align-items: baseline;
}
h3 {
  font-size: 0.88rem;
  margin: 0;
}
.board-head small {
  font-size: 0.69rem;
}
.ranks {
  height: clamp(11rem, 23vh, 19rem);
  overflow: auto;
  scrollbar-width: thin;
}
.rank {
  border: 0;
  border-bottom: 1px solid var(--edge);
  border-radius: 0;
  display: grid;
  grid-template-columns: 1.4em minmax(0, 1fr) auto;
  align-items: baseline;
  width: 100%;
  gap: 0.23rem;
  text-align: left;
  line-height: 1.22;
  padding: 0.43rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 450;
}
.rank > :nth-child(2) {
  overflow-wrap: anywhere;
}
.rank:hover,
.rank[aria-pressed='true'] {
  background: var(--selected);
}
.rank[aria-pressed='true'] {
  box-shadow: inset 3px 0 var(--accent);
}
.rank-index {
  color: var(--muted);
  font-size: 0.7rem;
}
.score {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}
.note {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0.5rem 0.65rem;
  margin: 0;
}
.inspector {
  padding: 0.8rem clamp(10px, 1vw, 20px);
}
.detail-head {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--edge);
}
.detail-head h2 {
  font-size: 1.28rem;
}
.detail-head a {
  font-size: 0.78rem;
  white-space: nowrap;
}
.eyebrow {
  margin: 0 0 0.15rem;
}
.explanation {
  display: grid;
  grid-template-columns: 1.22fr 0.9fr 1.14fr;
  gap: clamp(12px, 1.2vw, 24px);
  padding-top: 0.65rem;
}
.explanation section {
  min-width: 0;
}
#legend {
  display: flex;
  gap: 0.2rem 0.65rem;
  flex-wrap: wrap;
  margin: 0.35rem 0;
}
.key:before {
  content: '';
  display: inline-block;
  width: 0.65em;
  height: 0.65em;
  background: var(--series);
  margin-right: 0.25rem;
}
.chart {
  height: 8.25rem;
  display: flex;
  align-items: stretch;
  gap: 3px;
}
.bin {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.bars {
  flex: 1;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  border-bottom: 1px solid var(--border);
}
.bar {
  flex: 1;
  background: var(--series);
}
.tick {
  text-align: center;
  font-size: 0.65rem;
  color: var(--muted);
}
.explanation details,
#validation {
  font-size: 0.8rem;
  margin: 0.5rem 0;
}
summary {
  cursor: pointer;
  color: var(--primary);
}
.metrics {
  margin: 0.45rem 0;
}
.metrics div {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--edge);
  gap: 0.5rem;
  padding: 0.22rem 0;
  font-size: 0.81rem;
}
.metrics dd {
  margin: 0;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
#comparison select {
  width: 100%;
  font-size: 0.78rem;
  margin: 0.35rem 0;
}
.heat {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  line-height: 1.1;
}
.heat td,
.heat th {
  padding: 1px 0;
  font-size: 0.68rem;
  text-align: center;
  border: 1px solid var(--surface);
  font-variant-numeric: tabular-nums;
}
.heat th {
  color: var(--muted);
  font-weight: 500;
}
.heat tr.observed {
  outline: 2px solid var(--accent);
  outline-offset: -1px;
}
.evidence-note,
#formula {
  margin: 0.4rem 0;
}
#weights:empty {
  display: none;
}
#validation table,
.distribution-table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
#validation td,
#validation th,
.distribution-table td,
.distribution-table th {
  padding: 0.15rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}
#validation caption {
  text-align: left;
  font-weight: bold;
  margin: 0.6rem 0 0.2rem;
}
footer {
  border-top: 1px solid var(--edge);
  padding-top: 0.5rem;
  margin-top: 0.75rem;
}
@media (max-width: 1150px) {
  .explanation {
    grid-template-columns: 1fr 1fr;
  }
  .explanation #comparison {
    grid-column: 1/-1;
    max-width: 32rem;
  }
  .board-head {
    display: block;
  }
  .board-head small {
    display: block;
  }
}
@media (max-width: 880px) {
  #boards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 690px) {
  body {
    height: auto;
  }
  .workspace {
    display: block;
  }
  .library {
    border: 0;
  }
  .library-tools {
    padding: 10px 14px;
  }
  .section-line {
    margin: 0.55rem 0 0.25rem;
  }
  #shelves {
    flex: auto;
    height: clamp(18rem, 50dvh, 28rem);
  }
  .apply {
    padding: 0.45rem 14px;
  }
  .jump {
    display: block;
    font-size: 0.8rem;
    margin: 0 14px 0.5rem;
  }
  .analysis {
    overflow: visible;
  }
  .ranks {
    height: 7rem;
  }
  .analysis-head {
    align-items: start;
  }
  .analysis-head h2 {
    font-size: 1.35rem;
  }
  .explanation {
    grid-template-columns: 1fr;
  }
  .board-head h3 {
    font-size: 0.81rem;
  }
  .rank {
    font-size: 0.76rem;
  }
  .model-controls {
    column-gap: .4rem;
  }
  .detail-head {
    flex-wrap: wrap;
  }
  .chart {
    height: 10rem;
  }
}

#scale-help:empty { display: none; }
#scale-help {
  margin: 0.1rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.77rem;
}
.skip {
  position: absolute;
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  overflow: hidden;
}
.skip:focus {
  position: static;
  clip-path: none;
  width: auto;
  height: auto;
  padding: 0.3rem 0.8rem;
}
@media (hover: hover) {
  .choices:has(.star:hover) .star:is(:hover, :has(~ .star:hover)) span::before {
    content: '★';
    color: var(--accent);
  }
}
@media (max-width: 690px) {
  .header-row h1 {
    font-size: 1.2rem;
  }
  .star span {
    font-size: 1.95rem;
  }
  .heat th,
  .heat td {
    font-size: 0.72rem;
  }
}

#scores,
#distribution {
  overflow-x: auto;
}
@media (hover: hover) {
  .choices:has(.star:hover) .star:hover ~ .star span::before {
    content: '☆';
    color: var(--muted);
  }
}

#shelves {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, var(--top, 65fr)) auto minmax(0, var(--bottom, 35fr));
}
#divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.15rem 1rem;
  background: var(--surface-2);
  border-block: 1px solid var(--edge);
  color: var(--muted);
  font-size: 0.8rem;
  cursor: row-resize;
  touch-action: none;
  user-select: none;
}
#divider:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
#divider b {
  font-size: 1.1rem;
}
#exchange {
  padding: 0.25rem 1rem 0.5rem;
  font-size: 0.8rem;
}
#exchange div,
#item-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
}
#item-links {
  justify-content: flex-end;
}
body {
  --taste-ink: #795294;
}
:root[data-theme='dark'] body {
  --taste-ink: #dab4ed;
}
.information {
  border-color: var(--taste-ink);
}
.information .board-head {
  background: color-mix(in srgb, var(--taste-ink) 16%, var(--surface));
}
.board-head small {
  white-space: nowrap;
}
.board-head:has(#threshold, .shift-directions) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  justify-content: flex-start;
}
.board-head small {
  margin-left: auto;
}
.cutoff-heading,
.cutoff-value {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.cutoff-heading {
  flex-wrap: wrap;
}
.cutoff-value {
  min-width: 0;
  max-width: 100%;
}
.cutoff-value > span:last-child {
  font-size: 0.77rem;
  color: var(--muted);
  font-weight: 500;
}
.information .board-head, .review-context .board-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 0.45rem;
}
.ranking-weight {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  justify-self: end;
  width: 14rem;
  max-width: 100%;
  white-space: nowrap;
  font-size: .72rem;
  line-height: 1.2;
  font-weight: 500;
  color: var(--muted);
}
.board .ranking-weight { width: clamp(9.9rem, 48cqi, 14rem); }
.ranking-weight output { font-variant-numeric: tabular-nums; color: var(--text); }
.weight-scale {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: .3rem;
}
.weight-scale button {
  border: 0;
  background: transparent;
  padding: .25rem 0;
  font: inherit;
  color: inherit;
}
.weight-scale button:is(:hover, :focus-visible) { color: var(--taste-ink); text-decoration: underline; }
.weight-scale input {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--taste-ink);
  cursor: pointer;
}
.review-context .weight-scale input { accent-color: var(--accent); }
.shift-directions {
  display: inline-grid;
  place-content: center;
  justify-items: center;
  gap: 2px;
  width: 1.65rem;
  height: 1.5rem;
  padding: 0;
}
.shift-directions .caret {
  border-inline: 4px solid transparent;
  opacity: 0.36;
}
.caret.up {
  border-bottom: 5px solid var(--muted);
}
.caret.down {
  border-top: 5px solid var(--muted);
}
[data-direction='up'] .caret.up {
  border-bottom-color: var(--rise);
  opacity: 1;
}
[data-direction='down'] .caret.down {
  border-top-color: var(--fall);
  opacity: 1;
}
#threshold {
  flex: none;
  max-width: 100%;
}
#threshold .star span {
  font-size: 1.32rem;
}
.shift-delta {
  white-space: nowrap;
}
.shift-delta.rise {
  color: var(--rise);
}
.shift-delta.fall {
  color: var(--fall);
}
.board {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
}
.ranks {
  flex: 1 1 auto;
  min-height: 0;
}
.cutoff-value #threshold {
  flex: 0 1 auto;
  min-width: 0;
}
@container (max-width: 12rem) {
  .cutoff-value #threshold .star span {
    font-size: 1.15rem;
  }
}
.board .choice:not(.star) span {
  padding-inline: clamp(0.18rem, 2cqi, 0.43rem);
}
.rating-chart {
  display: block;
  width: 100%;
  max-height: 18rem;
  background: var(--surface-2);
  border-radius: 4px;
}
.rating-chart text {
  font: 11px system-ui;
  fill: var(--text);
}
.gridline {
  stroke: var(--prior);
  stroke-width: 0.6;
}
.heat-key {
  display: flex;
  align-items: center;
  gap: 0.3em;
  font-size: 0.73rem;
  color: var(--muted);
  margin: 0.3em 0;
}
.heat-key i {
  width: 4rem;
  height: 0.7em;
  background: linear-gradient(to right, #edf6f9, #243794);
}
@media (max-width: 690px) {
  #shelves {
    flex: auto;
    min-height: 18rem;
  }
  .ranks {
    height: 10rem;
  }
  .board-head {
    display: flex;
    flex-wrap: wrap;
  }
  .library-tools {
    padding-bottom: 0.2rem;
  }
}
.info-note {
  font-size: 0.72rem;
  color: var(--muted);
  margin: 0.2rem 0.5rem;
}
#snapshot-body {
  max-height: 22rem;
  overflow: auto;
}
#snapshot-body td,
#snapshot-body th {
  padding: 0.2rem 0.4rem;
  font-size: 0.82rem;
  text-align: left;
}

.catalog-tools select {
  flex: 1;
  font-size: 0.76rem;
}
.rated-shelf-head {
  display: flex;
  align-items: stretch;
  background: var(--surface-2);
  border-block: 1px solid var(--edge);
}
#divider {
  flex: 1;
  border: 0;
  gap: 0.6rem;
}
#rated-count {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-left: 0.25rem;
}
#clear-all {
  font-size: 0.75rem;
  background: transparent;
  color: var(--accent);
  border: 0;
  padding-inline: 0.55rem;
}
#clear-all:disabled {
  color: var(--muted);
}
#quick-session {
  font-size: 0.79rem;
  padding: 0.25rem 0.7rem;
}
.model-controls select {
  max-width: min(16rem, 100%);
  width: 100%;
}
.model-controls label {
  min-width: 0;
  /* WebKit counts the closed native select’s longest option toward page overflow. */
  overflow: clip;
  overflow-clip-margin: 3px;
}
.analysis {
  container-type: inline-size;
}
@container (max-width: 53rem) {
  #boards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@container (max-width: 35rem) {
  #boards {
    grid-template-columns: minmax(0, 1fr);
  }
}
.info-row {
  border-bottom: 1px solid var(--edge);
  display: block;
  min-height: 3.25rem;
  overflow: hidden;
}
.info-row .rank {
  border: 0;
  min-width: 0;
  padding-bottom: 0.06rem;
}
.info-row .choices {
  margin-left: auto;
  padding: 0 0.5rem 0.2rem 0;
  min-height: 1.45rem;
  align-content: center;
}
.info-row .star span {
  font-size: 1.32rem;
}
.info-row.departing {
  pointer-events: none;
  min-height: 0;
  background: var(--selected);
}
.info-row .choice input {
  z-index: 1;
}
.forecast-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--edge);
}
.forecast-row:has(.rank[aria-pressed='true']) {
  background: var(--selected);
}
.forecast-row .rank {
  grid-template-columns: 1.4em minmax(0, 1fr);
  border-bottom: 0;
}
.forecast-row .quick-rate {
  position: relative;
  align-self: stretch;
  padding: 0.22rem 0.48rem;
  min-width: 3em;
  text-align: right;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.8rem;
}
.quick-rate .rate-cue {
  position: absolute;
  right: 0.48rem;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  color: var(--accent);
  font-weight: 650;
}
.quick-rate:is(:focus-visible, [aria-expanded='true']) .rate-cue {
  opacity: 1;
}
.quick-rate:is(:focus-visible, [aria-expanded='true']) .score {
  opacity: 0;
}
@media (hover: hover) {
  .quick-rate:hover .rate-cue {
    opacity: 1;
  }
  .quick-rate:hover .score {
    opacity: 0;
  }
}
@media (hover: none) {
  .quick-rate .score {
    text-decoration: underline dotted var(--muted);
    text-underline-offset: 0.22em;
  }
}
#recommendation-rating {
  position: fixed;
  inset: auto;
  margin: 0;
  padding: 0.35rem 0.5rem;
  max-width: calc(100vw - 12px);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 12px #0004;
}
@container (max-width: 19rem) {
  .forecast-row:has(.shift-delta) {
    grid-template-columns: 1fr;
  }
  .forecast-row:has(.shift-delta) .quick-rate {
    justify-self: end;
    padding-block: 0.12rem;
  }
}
#annotations, #record-count {
  font-size: .78rem;
  color: var(--muted);
}
#annotations {
  flex: 1 1 12rem;
  margin: 0;
}
#taste {
  margin-top: 1rem;
}
.fingerprint-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem 0.9rem;
  border-bottom: 1px solid var(--edge);
  padding-bottom: 0.55rem;
}
#projection-title {
  margin: 0;
  font-size: 1.28rem;
  letter-spacing: -0.02em;
}
#profile-count,
.class-stats span,
.axis-summary small,
.axis-ends,
.projection-key,
#profile-method {
  font-size: 0.76rem;
  color: var(--muted);
}
.taste-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(0, 1fr) minmax(0, 0.98fr);
  gap: clamp(12px, 1.4vw, 24px);
  padding: 0.7rem 0;
}
.taste-layout section {
  min-width: 0;
}
.taste-layout h3,
#axes h3 {
  margin: 0 0 0.42rem;
  font-size: 0.85rem;
}
#taste-plot {
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
#taste-plot .rating-chart {
  width: 100%;
  max-height: 13.2rem;
  background: none;
}
#taste-plot .gridline {
  stroke: var(--edge);
  stroke-width: 1;
}
.axis-line {
  stroke: var(--prior);
  stroke-dasharray: 3 3;
}
#taste-plot .class-number {
  font-weight: 750;
  paint-order: stroke;
  stroke: var(--surface);
  stroke-width: 2.5px;
}
.projection-key {
  padding: 0.12rem 0.4rem;
  margin: 0;
  text-align: center;
  color: var(--accent);
}
.class-weight {
  display: grid;
  grid-template-columns: 1.2rem minmax(0, 1fr) auto;
  gap: 1px 0.35rem;
  align-items: center;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  padding: 0.12rem 0;
}
.class-weight {
  width: 100%;
  color: var(--text);
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
}
.class-weight.inspected,
.class-weight[aria-pressed='true'] {
  background: var(--surface-2);
  border-color: var(--class-color);
}
#taste-plot [role='button'] {
  cursor: pointer;
}
#taste-plot .inspected circle:nth-of-type(2) {
  stroke: var(--text);
  stroke-width: 2.6;
}
#map-axes,
.map-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.3rem;
  font-size: 0.74rem;
  color: var(--muted);
}
#map-axes:not(:empty) {
  margin-bottom: 0.4rem;
}
#map-axes .center-classes {
  flex-basis: 100%;
  cursor: pointer;
}
#map-axes label {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
#map-axes select {
  font-size: inherit;
  padding: 0.12rem;
}
.map-caption {
  padding: 0.18rem 0.4rem;
}
.map-caption button {
  background: transparent;
  border: 0;
}
#class-signature h4 {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
}
.component-id {
  grid-row: span 2;
  width: 1.16rem;
  line-height: 1.16rem;
  text-align: center;
  background: var(--class-color);
  color: white;
  border-radius: 50%;
  font-size: 0.66rem;
  font-weight: 700;
}
.component-name {
  overflow-wrap: anywhere;
}
.class-weight b {
  text-align: right;
  font-weight: 550;
}
.weight-rail {
  grid-column: 2/-1;
  display: block;
  background: var(--surface-2);
  height: 3px;
  border-radius: 2px;
}
.weight-rail i {
  display: block;
  height: 100%;
  background: var(--class-color);
}
#class-signature {
  border-left: 1px solid var(--edge);
  padding-left: clamp(10px, 1.2vw, 20px);
}
.match-name {
  font-size: clamp(1rem, 1.35vw, 1.25rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  display: block;
}
#class-signature p {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.22rem 0 0.45rem;
}
.class-stats {
  display: flex;
  gap: 0.4rem 1.2rem;
  flex-wrap: wrap;
  margin: 0.65rem 0;
}
.class-stats div {
  display: grid;
}
.class-stats b {
  font-size: 1.05rem;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.fingerprint-axes { padding: .6rem 0 .8rem; }
.fingerprint-axes-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap;
  gap: .25rem .8rem;
}
.fingerprint-axes-head label, #axis-guide { font-size: .76rem; color: var(--muted); }
.fingerprint-axes-head input { accent-color: var(--accent); vertical-align: middle; }
#axis-guide { margin: .25rem 0 .55rem; }
#axes { display: block; }
.axis-row {
  display: grid; grid-template-columns: 3.5ch minmax(4rem, 1fr) minmax(5rem, 2fr) minmax(4rem, 1fr) 4.5ch;
  gap: 0 .65rem; align-items: center; position: relative; min-height: 2rem;
  border-top: 1px solid var(--edge);
}
.axis-number, .axis-fraction { color: var(--muted); font: .67rem/1.2 var(--mono, monospace); }
.axis-fraction { text-align: right; }
.axis-pole { font-size: .82rem; line-height: 1.25; overflow-wrap: anywhere; }
.axis-number + .axis-pole { text-align: right; }
.axis-track { height: 1.85rem; position: relative; }
.axis-track::before, .axis-track::after { content: ''; position: absolute; top: 50%; border-radius: .3rem; }
.axis-track::before { left: 0; right: 0; height: 3px; background: var(--edge); transform: translateY(-50%); }
.axis-track::after { left: var(--band-start); width: var(--band-width); height: 4px; background: var(--accent); transform: translateY(-50%); }
.axis-track i { z-index: 1; position: absolute; left: var(--position); top: 50%; width: .65rem; height: .65rem; border: 2px solid var(--accent); border-radius: 50%; background: var(--surface); transform: translate(-50%, -50%); }
.axis-track input {
  appearance: none; position: absolute; z-index: 2; inset: 0; margin: 0; height: 100%; width: 100%;
  border: 0; padding: 0; background: linear-gradient(var(--muted),var(--muted)) center/1px .7rem no-repeat;
  cursor: crosshair;
}
.axis-track input::-webkit-slider-thumb { appearance: none; width: 2px; height: .9rem; background: transparent; }
.axis-track input::-moz-range-thumb { width: 2px; height: .9rem; border: 0; background: transparent; }
.axis-track input:is(:hover,:focus)::-webkit-slider-thumb { background: var(--text); }
.axis-track input:is(:hover,:focus)::-moz-range-thumb { background: var(--text); }
.axis-examples {
  grid-column: 2 / 5; position: absolute; top: calc(100% - .2rem); z-index: 3; justify-self: center;
  max-width: 100%; padding: .38rem .65rem; border: 1px solid var(--edge); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-size: .78rem; box-shadow: 0 2px 6px #0003; pointer-events: none;
}
#axes:has(.axis-row:nth-child(25)) { max-height: 38rem; overflow-y: auto; }
#axes:has(.axis-row:nth-child(25)) .axis-row:last-child .axis-examples { top: auto; bottom: 100%; }
@media (max-width: 540px) {
  .axis-row { gap: 0 .28rem; grid-template-columns: 3.2ch minmax(3.3rem,1fr) minmax(4rem,1fr) minmax(3.3rem,1fr) 4ch; }
  .axis-pole { font-size: .75rem; }
  .axis-examples { grid-column: 1 / -1; }
}
#profile-method {
  margin-top: 0.6rem;
}
#profile-method p {
  margin: 0.35rem 0;
  max-width: 100ch;
}
@media (max-width: 1050px) and (min-width: 691px), (max-width: 600px) {
  .taste-layout {
    grid-template-columns: 1fr 1fr;
  }
  #class-signature {
    grid-column: 1/-1;
    border-left: 0;
    border-top: 1px solid var(--edge);
    padding: 0.45rem 0 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 1rem;
    align-content: start;
  }
  #class-signature h3,
  #class-signature .match-name,
  #class-signature p {
    grid-column: 1;
  }
  .class-stats {
    grid-column: 2;
    grid-row: 1 / span 3;
    margin: 0;
  }
}
@media (max-width: 440px) {
  .taste-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  #taste-plot .rating-chart {
    max-height: 11.7rem;
  }
  #memberships {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.12rem 0.65rem;
  }
  #memberships h3 {
    grid-column: 1/-1;
  }
  .class-weight {
    grid-template-columns: 1rem minmax(0, 1fr) auto;
    font-size: 0.71rem;
    gap: 1px 0.2rem;
  }
  .component-id {
    width: 1rem;
    line-height: 1rem;
  }
  #class-signature {
    grid-column: 1;
  }
}

@media (max-width: 690px) {
  .info-row .star span,
  #threshold .star span {
    font-size: 1.4rem;
  }
}
@media (max-width: 360px) {
  #memberships {
    grid-template-columns: minmax(0, 1fr);
  }
}

#choice-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.25rem 0;
}

#taste-patterns p,
#taste-patterns small,
.scale-ends {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.4rem 0;
}
.taste-example {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.15rem 0.5rem;
  align-items: baseline;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--edge);
  padding: 0.35rem 0;
}
.taste-example small {
  grid-column: 1 / -1;
}
#taste-patterns .taste-example small {
  margin: 0;
}
.answer-distribution {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 2.5rem;
  margin-top: 0.7rem;
  border-bottom: 1px solid var(--edge);
}
.answer-distribution span {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: end;
}
.answer-distribution i {
  width: 100%;
  background: var(--accent);
}
.scale-ends {
  display: flex;
  justify-content: space-between;
}
#memberships {
  max-width: 34rem;
  margin-block: 0.6rem;
}
@media (max-width: 1050px) {
  .answer-distribution,
  .scale-ends {
    grid-column: 1 / -1;
  }
}

#detail .detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.3rem 1rem;
}
.detail-actions {
  justify-self: end;
}
.detail-meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 0.35rem 1rem;
  flex-wrap: wrap;
}
.detail-meta:has(details[open]) {
  display: block;
}
#annotations:empty {
  display: none;
}
#more-metadata {
  font-size: 0.78rem;
}
#more-metadata dl {
  display: flex;
  gap: 0.5rem 1.75rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
#more-metadata dt {
  color: var(--muted);
}
#more-metadata dd {
  margin: 0.12rem 0;
}
.explanation > section {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
#distribution {
  display: flex;
  flex-direction: column;
  flex: 1;
}
#distribution .chart {
  flex: 1 0 8rem;
  min-height: 8rem;
}
#distribution .bars {
  min-height: 0;
}
#metrics {
  display: flex;
  flex-direction: column;
  flex: 1;
}
#metrics div {
  flex: 1;
  align-items: center;
}
#comparison {
  max-width: none;
  /* Keep long option text in WebKit’s native co-rating selector inside its panel. */
  overflow-x: clip;
  overflow-clip-margin: 3px;
}
#comparison select {
  width: 100%;
}
@container (max-width: 37rem) {
  #detail .detail-head {
    grid-template-columns: 1fr;
  }
  .detail-actions {
    grid-row: 3;
    justify-self: start;
  }
  .detail-meta {
    grid-column: 1;
  }
}

#rapid-rating, #film-check-dialog {
  width: min(42rem, calc(100% - 1.4rem));
  max-height: calc(100dvh - 1.4rem);
  overflow-y: auto;
  padding: clamp(0.9rem, 2.5vw, 1.6rem);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1rem 4rem #0005;
}
#rapid-rating::backdrop, #film-check-dialog::backdrop {
  background: #070b12a8;
}
.film-comparison-scroll { max-width:100%; overflow-x:auto; }
#film-comparison th:first-child { text-align:left; }
#film-comparison th[scope=row] { font-weight:500; }
#film-comparison thead th { vertical-align:bottom; }
#film-check { font-size:.85rem; margin:.65rem 0; }
#film-check-stars, .film-check-actions { display:flex; gap:.4rem; flex-wrap:wrap; margin:.8rem 0; }
#film-check-stars button, .film-check-actions button { min-height:2.5rem; }
@media (max-width:32rem) {
  #film-check-stars { display:grid; grid-template-columns:repeat(5, minmax(0, 1fr)); gap:.25rem; }
  #film-check-stars button { padding-inline:0; white-space:nowrap; }
}
#film-check-error:empty, #film-check-summary:empty { display:none; }
.rapid-head,
.rapid-nav,
.rapid-order {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.rapid-head,
.rapid-nav {
  justify-content: space-between;
}
.rapid-head h2 {
  margin: 0;
}
.rapid-order {
  font-size: 0.83rem;
  color: var(--muted);
  margin-block: 0.8rem;
}
.rapid-order select {
  flex: 1;
}
#rapid-card {
  outline-offset: 3px;
  border-block: 1px solid var(--edge);
  padding-block: 1rem;
}
#rapid-card:focus {
  outline: none;
}
.rapid-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
  min-height: 10.5rem;
}
.rapid-preview:has(figure:not([hidden])) {
  grid-template-columns: minmax(0, 1fr) minmax(5rem, 30%);
}
#rapid-title {
  font-size: clamp(1.18rem, 2.5vw, 1.65rem);
  line-height: 1.2;
}
#rapid-meta,
#rapid-description {
  font-size: 0.87rem;
  margin: 0.45rem 0;
}
#rapid-meta,
#rapid-instructions,
#rapid-progress {
  color: var(--muted);
}
#rapid-image {
  margin: 0;
  min-width: 0;
}
#rapid-image img {
  width: 100%;
  height: clamp(8rem, 24dvh, 14rem);
  object-fit: contain;
  border-radius: var(--radius-sm);
}
#rapid-image figcaption {
  font-size: 0.66rem;
  overflow-wrap: anywhere;
}
#rapid-article,
#rapid-instructions,
#rapid-progress {
  font-size: 0.78rem;
}
#rapid-values:not([hidden]) {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.7rem, 1fr));
  gap: 0.3rem;
  margin-top: 0.8rem;
}
#rapid-values button {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  padding: 0.42rem 0.1rem;
}
#rapid-values button[aria-pressed='true'] {
  color: var(--text);
  background: var(--selected);
  outline: 2px solid var(--accent);
}
#rapid-rating kbd {
  font:
    0.74rem ui-monospace,
    monospace;
  color: var(--muted);
}
#rapid-rating button.key-held, #rapid-rating button.key-held kbd {
  background: var(--accent);
  color: var(--surface);
}
#rapid-instructions {
  margin: 0.55rem 0 0;
}
.rapid-nav {
  margin-top: 0.85rem;
}
#rapid-progress {
  text-align: center;
}
@media (max-width: 550px) {
  #rapid-values:has(button:nth-child(10)):not([hidden]) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
  .rapid-nav {
    gap: 0.35rem;
  }
}
.model-controls select { max-width: 100%; }
@container (min-width: 49rem) {
  .analysis-head {
    display: grid;
    grid-template-columns: minmax(12rem, 1fr) minmax(0, 32.4rem);
    align-items: start;
  }
}
.rated-shelf-head {
  position: relative;
}
#divider b {
  position: absolute;
  left: 55%;
  transform: translateX(-50%);
}

.rapid-nav button {
  white-space: nowrap;
}

#recommendation-filters {
  width: min(32rem, calc(100% - 1.4rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1rem 4rem #0005;
}
#recommendation-filters[open] {
  display: flex;
  flex-direction: column;
}
#recommendation-filters::backdrop {
  background: #070b12a8;
}
#recommendation-filters header,
#recommendation-filters footer {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  flex: none;
}
#recommendation-filters h2 {
  margin: 0;
  font-size: 1.2rem;
}
#filter-close {
  font-size: 1.2rem;
  line-height: 1;
}
#filter-fields {
  padding: 0.1rem 1rem 0.65rem;
  overflow: auto;
}
#filter-fields details {
  border-top: 1px solid var(--edge);
}
#filter-fields summary {
  cursor: pointer;
  padding: 0.6rem 0.1rem;
  font-weight: 600;
}
.filter-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.15rem 0.75rem;
  max-height: 13rem;
  overflow: auto;
  padding: 0.2rem 0 0.7rem;
}
#filter-fields input[type='search'] { width: 100%; margin-bottom: 0.4rem; }
#filter-fields .more-options { margin-bottom: 0.5rem; }
.filter-options label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.84rem;
}
.filter-options small {
  margin-inline-start: auto;
  color: var(--muted);
}
#filter-fields fieldset {
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem 0.8rem;
  margin: 0 0 0.75rem;
}
#filter-fields legend {
  font-weight: 600;
}
.year-endpoints,
.year-endpoints label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.year-endpoints label {
  font-size: 0.82rem;
  color: var(--muted);
}
.year-endpoints input {
  width: 4.8rem;
}
.count-bounds { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.count-bounds label { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .82rem; }
.count-bounds input { width: 7rem; }
.year-track {
  position: relative;
  height: 1.5rem;
  margin-top: 0.4rem;
}
.year-track::before {
  content: '';
  position: absolute;
  inset: calc(50% - 2px) 0.5rem;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(
    to right,
    var(--edge) var(--lo),
    var(--accent) var(--lo),
    var(--accent) var(--hi),
    var(--edge) var(--hi)
  );
}
.year-track input {
  appearance: none;
  pointer-events: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.year-track input::-webkit-slider-thumb {
  appearance: none;
  pointer-events: auto;
  height: 1rem;
  width: 1rem;
  border-radius: 50%;
  background: var(--accent);
  border: 1px solid var(--surface);
  cursor: ew-resize;
}
.year-track input::-moz-range-thumb {
  pointer-events: auto;
  height: 1rem;
  width: 1rem;
  border-radius: 50%;
  background: var(--accent);
  cursor: ew-resize;
}
#recommendation-filters footer {
  border-top: 1px solid var(--edge);
}
#filter-matches {
  margin-inline-start: auto;
  font-size: 0.8rem;
  color: var(--muted);
}

@container (min-width: 48rem) {
  #boards.activity-boards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.library-tools { display: grid; align-content: start; gap: .65rem; }
.library-tools :is(.section-line, .catalog-tools, #scale-help) { margin: 0; }
.library-tools #search { min-height: 2.1rem; }
.catalog-tools { display: grid; grid-template-columns: auto minmax(0,1fr); }
#sort { width: 100%; }
.choice-segments {
  display: grid; grid-auto-columns: minmax(0,1fr); grid-auto-flow: column;
  gap: 2px; padding: 2px; border: 1px solid var(--edge); border-radius: var(--radius);
  background: var(--surface);
}
.choice-segments > label {
  position: relative; display: flex; flex-direction: column; justify-content: center;
  align-items: center; gap: .15rem; min-width: 0; min-height: 2.15rem; margin: 0;
  padding: .28rem .3rem; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--muted); font-size: .78rem; font-weight: 550; line-height: 1.16; text-align: center;
  cursor: pointer;
}
.choice-segments input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-segments small { font-size: .69rem; font-weight: 450; }
.choice-segments > label:hover { color: var(--text); background: var(--surface-2); }
.choice-segments > label:has(input:checked) { color: var(--accent); background: var(--selected); border-color: var(--accent); }
.choice-segments > label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: -2px; }
#source-choices small { white-space: nowrap; }
#source-choices .choice-segments > label { min-height: 2.55rem; }
.choice-label, .minor-components { color: var(--muted); font-size: .76rem; }
.minor-components { cursor: pointer; }
@media (forced-colors: active) {
  .choice-segments > label:has(input:checked) { border-color: Highlight; color: Highlight; }
}
#library .rating-row, #library .entry.deferred::after { min-height: 1.6rem; }
#library .entry.deferred::after { content: ""; display: block; }

.recommendations-heading { display: flex; align-items: center; gap: .55rem; }
#recommendation-icon { color: var(--accent); font-size: 1.45rem; }
#about-open {
  display: grid; place-content: center; padding: 0; width: 1.5rem; height: 1.5rem;
  border-radius: 50%; font-size: .85rem; color: var(--muted);
}
#about-recommendations {
  width: min(35rem, calc(100% - 1.4rem)); max-height: calc(100dvh - 2rem); overflow: auto;
  padding: 1.2rem; border: 1px solid var(--edge); border-radius: var(--radius);
  color: var(--text); background: var(--surface); line-height: 1.45;
}
#about-recommendations::backdrop { background: #070b12a8; }
#about-recommendations header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#about-recommendations h2 { margin: 0; font-size: 1.25rem; }
#about-recommendations h3 { margin: 1rem 0 .25rem; }
#about-recommendations p { margin: .35rem 0; }
#about-recommendations > a { display: inline-block; margin-top: .75rem; }
#detail {
  --art-connector: clamp(.75rem, 1.3vw, 1.4rem);
  padding: 0;
  border: 0;
  background: transparent;
}
.detail-content, #detail-image {
  min-width: 0;
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  background: var(--surface);
}
.detail-content { padding: .8rem clamp(10px, 1vw, 20px); }
#detail:has(#detail-image:not([hidden])) {
  display: grid;
  grid-template: "picture connector info" auto / clamp(8.5rem, var(--artwork-width, 20cqi), 31cqi) var(--art-connector) minmax(0, 1fr);
}
#detail:has(#detail-image:not([hidden]))::before {
  content: "";
  grid-area: connector;
  align-self: center;
  border-top: 1px solid var(--muted);
}
#detail .detail-content { grid-area: info; }
#detail-image { grid-area: picture; min-height: 0; position: relative; margin: 0; overflow: hidden; background: var(--surface-2); }
#detail-image.landscape-art { align-self: center; aspect-ratio: var(--image-ratio); }
#detail-image > a { position: absolute; inset: 0; display: block; }
#detail-image > a:focus-visible { outline-offset: -3px; }
#detail-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
#detail-image figcaption { position: absolute; bottom: 0; width: 100%; margin: 0; padding: .2rem .35rem; font-size: .65rem; line-height: 1.25; background: var(--surface); overflow-wrap: anywhere; }
.rapid-order { flex-wrap: wrap; }
#rapid-balance { margin-left: auto; }
@container (max-width: 48rem) {
  #detail:has(#detail-image:not([hidden])) {
    grid-template: "picture connector heading" auto "charts charts charts" auto / clamp(5rem, 24cqi, 10rem) var(--art-connector) minmax(0, 1fr);
    row-gap: .6rem;
  }
  #detail:has(#detail-image:not([hidden])) .detail-content { display: contents; }
  #detail:has(#detail-image:not([hidden])) :is(.detail-head, .explanation) {
    min-width: 0;
    padding: .7rem;
    border: 1px solid var(--edge);
    border-radius: var(--radius);
    background: var(--surface);
  }
  #detail .detail-head { grid-area: heading; }
  #detail .explanation { grid-area: charts; }
  #detail-image { min-height: 0; aspect-ratio: var(--image-ratio); align-self: center; }
}

#scatter-toggle[aria-pressed=true] { background: var(--selected); color: var(--accent); border-color: var(--accent); }
#boards.scatter-mode { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.scatter-mode [data-panel=information] { grid-area: 1 / 1; }
.scatter-mode [data-panel=ratingChange] { grid-area: 2 / 1; }
.recommendation-plot { grid-area: 1 / 2 / 3 / 3; display: flex; flex-direction: column; overflow: hidden; }
.plot-head, .surprise-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .35rem .75rem; }
.plot-head { padding: .45rem .65rem; border-bottom: 1px solid var(--edge); background: var(--surface-2); }
.plot-head select, .surprise-head select { width: auto; font-size: .78rem; }
.plot-area { position: relative; flex: 1; min-height: 16rem; }
.plot-area canvas { position: absolute; width: 100%; height: 100%; cursor: crosshair; }
.plot-area canvas:focus-visible { outline-offset: -3px; }
.plot-marker { position: absolute; width: 13px; height: 13px; border: 2px solid var(--accent); border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.hover-marker { border: 1px solid var(--text); width: 17px; height: 17px; }
.plot-tip { position: absolute; pointer-events: none; padding: .42rem .58rem; border-radius: var(--radius-sm); border: 1px solid var(--edge); background: var(--surface); max-width: min(19rem, 88%); box-shadow: 0 2px 9px #0002; font-size: .8rem; }
.plot-tip small,.plot-readout small { display: block; font-size: .74rem; color: var(--muted); }
.plot-footer { display:grid; grid-template-columns: auto minmax(0,1fr) auto; gap:.3rem; align-items:center; border-top:1px solid var(--edge); padding:.38rem .6rem; }
.plot-footer > button { min-height:2.35rem; }
.plot-footer .plot-readout { border:0; background:transparent; line-height:1.35; }
.plot-readout strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }
#rating-surprises { border-top:1px solid var(--edge); padding:.7rem 0; }
#rating-surprises p { font-size:.8rem; color:var(--muted); margin:.3rem 0; }
#rating-surprises ol { list-style:none; padding:0; margin:0; }
#rating-surprises .surprise-columns, #rating-surprises li button { display:grid; grid-template-columns:minmax(0,1fr) 7rem 6rem 5rem 8rem; align-items:baseline; gap:.45rem; width:100%; padding:.38rem .6rem; text-align:right; font-variant-numeric:tabular-nums; }
#rating-surprises li button { color:var(--text); font-weight:normal; background:transparent; border:0; border-top:1px solid var(--edge); border-radius:0; }
#rating-surprises li button:hover, #rating-surprises li button:focus-visible { background:var(--selected); }
#rating-surprises .surprise-columns { color:var(--muted); font-size:.72rem; }
#rating-surprises .surprise-columns[hidden], #rating-surprises li small { display:none; }
.surprise-columns span:first-child, #rating-surprises li strong { text-align:left; }
@container (max-width: 39rem) {
  #rating-surprises .surprise-columns, #rating-surprises li button > span { display:none; }
  #rating-surprises li button { grid-template-columns:1fr auto; text-align:left; gap:.12rem .45rem; }
  #rating-surprises li small { display:block; grid-column:1/-1; color:var(--muted); font-size:.73rem; }
}
#rating-surprises .rise { color:var(--rise); } #rating-surprises .fall { color:var(--fall); }
@container (max-width: 45rem) {
  #boards.scatter-mode { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .recommendation-plot { grid-area: 1 / 1 / 2 / 3; }
  .scatter-mode [data-panel=information] { grid-area: 2 / 1; }
  .scatter-mode [data-panel=ratingChange] { grid-area: 2 / 2; }
  .plot-area { min-height: 17rem; }
}
@container (max-width: 35rem) {
  #boards.scatter-mode { grid-template-columns: minmax(0,1fr); }
  .recommendation-plot { grid-area: 1 / 1; }
  .scatter-mode [data-panel=ratingChange] { grid-area: 3 / 1; }
}
.plot-meta,.plot-key { display:flex; align-items:center; flex-wrap:wrap; gap:.3rem .75rem; }
.plot-meta { justify-content:space-between; padding:.45rem .7rem 0; font-size:.72rem; color:var(--muted); }
.plot-key span::before { content:''; display:inline-block; width:.48rem; height:.48rem; margin-right:.25rem; border-radius:50%; background:var(--muted); }
.plot-key .rise::before { background:var(--rise); }
.plot-key .fall::before { background:var(--fall); }

.rating-actions, .group-tools, #group-members, .group-chip, .group-threshold { display:flex; align-items:center; flex-wrap:wrap; gap:.45rem; }
.rating-actions { justify-content:flex-end; }
#group-open { font-size:.79rem; padding:.25rem .7rem; }
#group-dialog { width:min(60rem,calc(100% - 1.25rem)); max-height:90dvh; padding:0; color:var(--text); background:var(--surface); border:1px solid var(--edge); border-radius:var(--radius); }
#group-dialog::backdrop { background:#080c12a9; }
#group-dialog .rapid-head { padding:.75rem 1rem; border-bottom:1px solid var(--edge); position:sticky; top:0; z-index:1; background:var(--surface); }
.group-body { padding:1rem; }
.group-tools { justify-content:space-between; }
.group-tools label, .group-tools select, .group-threshold { min-width:0; max-width:100%; }
#group-cutoff { max-width:100%; overflow-x:auto; padding:2px; }
.group-tools label, .group-threshold, #group-count { font-size:.85rem; }
#group-members { margin:.6rem 0; }
.group-chip { border:1px solid var(--edge); border-inline-start:4px solid; border-radius:var(--radius); padding:.15rem .4rem; }
.group-chip input { width:10ch; font:inherit; border:0; background:var(--surface); color:var(--text); }
.group-chip button { background:transparent; border:0; padding:.2rem; }
#group-results section { padding-block:.7rem; border-top:1px solid var(--edge); }
.group-table-scroll { overflow:auto; max-height:clamp(12rem,36dvh,24rem); }
#group-dialog table { border-collapse:collapse; width:100%; font-variant-numeric:tabular-nums; }
#group-dialog td, #group-dialog th { text-align:right; border-bottom:1px solid var(--edge); padding:.25rem .45rem; }
#group-dialog th { position:sticky; top:0; background:var(--surface); white-space:nowrap; }
#group-dialog td:first-child, #group-dialog th:first-child { text-align:left; }
.group-title { border:0; padding:0; background:none; color:var(--primary); text-align:left; }
.group-axis { display:grid; grid-template-columns:minmax(4rem,1fr) minmax(5rem,2fr) minmax(4rem,1fr); gap:.18rem .5rem; align-items:center; padding-block:.3rem; }
.group-axis > :first-child { text-align:right; }
.group-axis small { grid-column:1/-1; text-align:center; color:var(--muted); }
.group-rail { position:relative; background:linear-gradient(var(--edge),var(--edge)) center/100% 2px no-repeat,linear-gradient(var(--muted),var(--muted)) center/1px 100% no-repeat; }
.group-dot { position:absolute; width:.62rem; height:.62rem; border-radius:50%; transform:translate(-50%,-50%); }
.group-differences { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,16rem),1fr)); gap:1rem; }
.group-differences ol { list-style:none; margin:0; padding:0; }
.group-differences li { padding:.3rem 0; border-bottom:1px solid var(--edge); }
.group-differences li span { display:block; color:var(--muted); font-size:.8rem; }
#catalog-limit { border-inline-start:3px solid var(--edge); padding:.4rem .65rem; margin:.55rem 0; }
