.collectibles-library {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.collectibles-library::before,
.collectibles-library::after {
  display: none;
}

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

/* Each line keeps one of the site's neon accents: the tab strip, its legend
   dots, and the line headings in the results all use it. */
.collectibles-library {
  --brand-skullpanda: var(--accent-cool);
  --brand-nommi: var(--accent-strong);
  --brand-sonny-angel: var(--accent-warm);
  --brand-pop-bean: var(--accent);
  --field-height: 2.6rem;
  --field-label: var(--muted);
}

.collectibles-hero h1 {
  max-width: 30ch;
  font-size: var(--step-3);
}

/* Above the results, so an open picker list or export menu covers them. */
.collectibles-form {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.8rem;
}

/* What to find: the line tabs, then search, year, and series in one row. */
.collectibles-controls {
  position: relative;
  z-index: 2;
  min-width: 0;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(5, 18, 32, 0.76);
  box-shadow: inset 0 1px 0 var(--surface-sheen-soft);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
}

.collectibles-lines {
  display: flex;
  gap: 0.15rem;
  min-width: 0;
  margin: 0;
  padding: 0 0.6rem;
  border: 0;
  box-shadow: inset 0 -1px 0 var(--glass-border);
  overflow-x: auto;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}

.collectibles-lines::-webkit-scrollbar {
  display: none;
}

.collectibles-line-tab {
  --tab-color: var(--ink);
  position: relative;
  display: flex;
  flex: none;
  margin: 0;
  cursor: pointer;
}

.collectibles-line-tab[data-brand="skullpanda"] { --tab-color: var(--brand-skullpanda); }
.collectibles-line-tab[data-brand="nommi"] { --tab-color: var(--brand-nommi); }
.collectibles-line-tab[data-brand="sonny-angel"] { --tab-color: var(--brand-sonny-angel); }
.collectibles-line-tab[data-brand="pop-bean"] { --tab-color: var(--brand-pop-bean); }

.collectibles-line-tab input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.collectibles-line-tab span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 3px 0.8rem 0;
  border-bottom: 3px solid transparent;
  color: var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  transition: color var(--motion-fast), border-color var(--motion-fast);
}

.collectibles-line-tab[data-brand] span::before {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--tab-color);
}

.collectibles-line-tab:hover span {
  color: var(--ink);
  border-bottom-color: color-mix(in srgb, var(--tab-color) 40%, transparent);
}

.collectibles-line-tab input:checked + span {
  border-bottom-color: var(--tab-color);
  color: var(--ink);
}

.collectibles-line-tab input:focus-visible + span {
  border-radius: 8px 8px 0 0;
  outline: 2px solid var(--accent-warm);
  outline-offset: -5px;
}

.collectibles-fields {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr) minmax(0, 1.3fr);
  align-items: start;
  gap: 0.6rem;
  padding: 0.75rem;
}

/* One field shape for every control: the label sits inside, before the value. */
.collectibles-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  min-height: var(--field-height);
  padding: 0.2rem 0.45rem 0.2rem 0.95rem;
  border: 1px solid var(--glass-border);
  border-radius: 1.3rem;
  background: var(--glass-tint);
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
}

.collectibles-field:hover {
  border-color: var(--line-strong);
}

.collectibles-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.12);
}

.collectibles-field-label {
  flex: none;
  margin: 0 0.25rem 0 0;
  color: var(--field-label);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: inherit;
}

.collectibles-search {
  position: relative;
  min-width: 0;
}

/* A magnifier drawn in CSS: the lens, then its handle. */
.collectibles-search::before,
.collectibles-search::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.collectibles-search::before {
  top: calc(var(--field-height) / 2 - 0.5rem);
  left: 1rem;
  width: 0.8rem;
  height: 0.8rem;
  border: 2px solid var(--field-label);
  border-radius: 50%;
}

.collectibles-search::after {
  top: calc(var(--field-height) / 2 + 0.28rem);
  left: 1.62rem;
  width: 0.42rem;
  height: 2px;
  border-radius: 1px;
  background: var(--field-label);
  transform: rotate(45deg);
  transform-origin: left center;
}

.collectibles-search input {
  width: 100%;
  min-width: 0;
  min-height: var(--field-height);
  padding: 0.4rem 1rem 0.4rem 2.5rem;
  border: 1px solid var(--glass-border);
  border-radius: 1.3rem;
  background: var(--glass-tint);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.3;
  transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
  -webkit-appearance: none;
  appearance: none;
}

.collectibles-search input:hover {
  border-color: var(--line-strong);
}

.collectibles-search input::placeholder {
  color: var(--field-label);
}

.collectibles-search input:focus-visible {
  border-color: var(--accent);
  background: var(--glass-tint-strong);
  box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.12);
  outline: 2px solid transparent;
  outline-offset: 3px;
}

.collectibles-picker {
  position: relative;
  min-width: 0;
}

.collectibles-picker-field {
  cursor: text;
}

.collectibles-picker-chips {
  display: contents;
}

.collectibles-picker-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 1.8rem;
  padding: 0 0.45rem 0 0.6rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: rgba(0, 245, 255, 0.14);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.collectibles-picker-chip::after {
  content: "\00d7";
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1;
}

.collectibles-picker-chip:hover::after,
.collectibles-picker-chip:focus-visible::after {
  color: var(--accent-warm);
}

.collectibles-picker-input {
  flex: 1 1 4rem;
  min-width: 3rem;
  min-height: 1.8rem;
  padding: 0 0.3rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.collectibles-picker-input:focus-visible {
  outline: none;
  box-shadow: none;
}

.collectibles-picker-input::placeholder {
  color: var(--ink-soft);
}

.collectibles-picker-options {
  position: absolute;
  top: calc(100% + 0.3rem);
  left: 0;
  z-index: 20;
  width: max(100%, 16rem);
  max-height: 18rem;
  margin: 0;
  padding: 0.3rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  list-style: none;
}

.collectibles-picker-options[hidden] {
  display: none;
}

.collectibles-picker-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 2.5rem;
  padding: 0.45rem 0.6rem 0.45rem 1.6rem;
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  position: relative;
}

.collectibles-picker-option:hover,
.collectibles-picker-option.is-active {
  background: rgba(0, 245, 255, 0.1);
}

.collectibles-picker-option[aria-selected="true"]::before {
  content: "\2713";
  position: absolute;
  left: 0.55rem;
  color: var(--accent);
  font-weight: 700;
}

.collectibles-picker-option[aria-selected="true"] .collectibles-picker-label {
  font-weight: 700;
}

.collectibles-picker-detail {
  flex: none;
  color: var(--ink-soft);
  font-size: 0.8rem;
}

.collectibles-picker-empty {
  padding: 0.6rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* How to view the results and what to do with them. */
.collectibles-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1.25rem;
  padding-inline: 0.15rem;
}

.collectibles-meta {
  display: grid;
  flex: 1 1 20rem;
  gap: 0.15rem;
  min-width: 0;
}

.collectibles-status,
.collectibles-meta-note {
  margin: 0;
}

.collectibles-status {
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
}

.collectibles-status-detail {
  display: block;
  margin-top: 0.1rem;
  color: var(--ink-soft);
  font-weight: 500;
}

.collectibles-status[data-tone="error"],
.collectibles-storage-status[data-saved="false"] {
  color: var(--accent-warm);
}

.collectibles-status[data-tone="empty"] {
  color: var(--ink-soft);
}

.collectibles-meta-note {
  color: var(--muted);
  font-size: 0.85rem;
}

.collectibles-view {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.collectibles-segmented {
  display: inline-flex;
  min-width: 0;
  margin: 0;
  padding: 0.2rem;
  border: 1px solid var(--glass-border);
  border-radius: 1.3rem;
  background: var(--glass-tint);
}

.collectibles-segment {
  position: relative;
  display: flex;
  margin: 0;
  cursor: pointer;
}

.collectibles-segment input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.collectibles-segment span {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: calc(var(--field-height) - 0.4rem - 2px);
  padding: 0 0.85rem;
  border-radius: 1.1rem;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--motion-fast), color var(--motion-fast), box-shadow var(--motion-fast);
}

.collectibles-segment:hover span {
  color: var(--ink);
}

.collectibles-segment input:checked + span {
  background: rgba(0, 245, 255, 0.16);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.collectibles-segment input:focus-visible + span {
  outline: 2px solid var(--accent-warm);
  outline-offset: 2px;
}

.collectibles-sort {
  position: relative;
  flex-wrap: nowrap;
  padding-right: 0.2rem;
}

.collectibles-sort select {
  min-width: 0;
  min-height: calc(var(--field-height) - 0.4rem - 2px);
  padding: 0 2rem 0 0.1rem;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.collectibles-sort select:focus-visible {
  outline: none;
  box-shadow: none;
}

.collectibles-sort option {
  background: var(--panel-solid);
  color: var(--ink);
}

/* Chevrons for the sort field and the export button. */
.collectibles-sort::after,
.collectibles-export-toggle::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.12rem) rotate(45deg);
  transition: transform var(--motion-fast);
  pointer-events: none;
}

.collectibles-sort::after {
  position: absolute;
  top: 50%;
  right: 1rem;
  color: var(--field-label);
  transform: translateY(-65%) rotate(45deg);
}

.collectibles-export {
  position: relative;
}

.collectibles-export-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--field-height);
  padding: 0 1.05rem;
  border: 1px solid var(--line-strong);
  border-radius: 1.3rem;
  background: rgba(0, 245, 255, 0.08);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition: background var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast);
}

.collectibles-export-toggle:hover,
.collectibles-export-toggle[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(0, 245, 255, 0.16);
}

.collectibles-export-toggle[aria-expanded="true"]::after {
  transform: translateY(0.1rem) rotate(-135deg);
}

.collectibles-export-toggle[aria-busy="true"] {
  cursor: progress;
}

.collectibles-export-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 0.1rem;
  width: min(21rem, calc(100vw - 2.5rem));
  padding: 0.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel-solid);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.collectibles-export-menu[hidden] {
  display: none;
}

.collectibles-export-option {
  display: grid;
  gap: 0.15rem;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.collectibles-export-option:hover:not(:disabled),
.collectibles-export-option:focus-visible {
  background: rgba(0, 245, 255, 0.1);
}

.collectibles-export-option:focus-visible {
  outline-offset: -2px;
}

.collectibles-export-option:disabled {
  color: var(--muted);
  cursor: default;
}

.collectibles-export-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.collectibles-export-detail {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.collectibles-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.9rem;
  align-items: stretch;
}

.collectibles-results:empty {
  display: none;
}

.collectible-release-block {
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.7rem;
  border: 1px solid rgba(0, 245, 255, 0.2);
  border-radius: 10px;
  background: rgba(5, 16, 29, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.collectible-release-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.75rem;
  padding-inline: 0.1rem;
}

.collectible-release-title,
.collectible-release-status {
  margin: 0;
}

.collectible-release-title {
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.25;
}

/* How much of the set you own: a count on the title row, then a bar in the
   line's color once you own one. */
.collectible-release-owned {
  flex: none;
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.collectible-release-owned.is-started {
  color: var(--ink);
}

.collectible-release-owned.is-complete {
  font-weight: 750;
}

.collectible-release-meter {
  flex-basis: 100%;
  height: 3px;
  margin-top: 0.2rem;
  border-radius: 2px;
  background:
    linear-gradient(var(--line-brand, var(--accent)), var(--line-brand, var(--accent))) left / calc(var(--owned, 0) * 100%) 100% no-repeat,
    var(--glass-border);
}

.collectible-release-owned[hidden],
.collectible-release-meter[hidden] {
  display: none;
}

.collectible-release-status {
  flex-basis: 100%;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.35;
}

.collectible-release-block[data-roster-status="partial"] .collectible-release-status,
.collectible-release-block.is-unclassified .collectible-release-status {
  color: var(--accent-warm);
}

/* Brand: line sections, then release-year batches, then sets. */
.collectible-line {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  padding-top: 0.35rem;
}

.collectible-line + .collectible-line {
  margin-top: 0.6rem;
}

.collectible-line-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(1.02rem, 0.98rem + 0.3vw, 1.2rem);
  line-height: 1.2;
}

.collectible-line[data-brand="skullpanda"] { --line-brand: var(--brand-skullpanda); }
.collectible-line[data-brand="nommi"] { --line-brand: var(--brand-nommi); }
.collectible-line[data-brand="sonny-angel"] { --line-brand: var(--brand-sonny-angel); }
.collectible-line[data-brand="pop-bean"] { --line-brand: var(--brand-pop-bean); }

.collectible-line[data-brand] .collectible-line-title::before {
  content: "";
  flex: none;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--line-brand);
}

/* Sets in a row share one height, so the rows stay even. */
.collectible-year {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  min-width: 0;
  align-items: stretch;
}

/* A set left alone at the end of its year spans the row rather than leaving
   an empty slot beside it. Only visible sets count, so this holds under the
   Owned and Not owned views. */
.collectible-year > .collectible-release-block:nth-child(odd of .collectible-release-block:not([hidden])):nth-last-child(1 of .collectible-release-block:not([hidden])) {
  grid-column: 1 / -1;
}

.collectible-year-title {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.collectible-listings-heading {
  margin: 0;
  padding: 0.4rem 0.1rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.collectible-listings-heading:hover {
  color: var(--ink);
}

.collectible-listings-heading:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 2px;
}

.collectible-store-listings {
  grid-column: 1 / -1;
  min-width: 0;
  border-top: 1px solid rgba(0, 245, 255, 0.16);
}

.collectible-store-listings[open] {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 0.45rem 0.75rem;
}

.collectible-store-listings[open] > .collectible-listings-heading {
  grid-column: 1 / -1;
}

.collectible-identifiers {
  display: block;
  margin: 0;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.collectible-listing-kind {
  justify-self: start;
  margin: 0;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent-cool, var(--ink-soft));
  font-size: 0.75rem;
  font-weight: 700;
}

/* The set's own card spans the block; store listings share a grid beside it. */
.collectible-release-products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: 0.45rem;
  align-items: start;
}

.collectible-release-products > .is-set-card {
  grid-column: 1 / -1;
}

.collectible-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.45rem 0 0;
  border: 0;
  border-top: 1px solid rgba(0, 245, 255, 0.16);
  border-radius: 0;
  background: transparent;
}

.collectible-card-header {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0.65rem;
  align-items: start;
  min-width: 0;
}

.collectible-card-media,
.collectible-variant-media {
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--glass-border);
  border-radius: 0.75rem;
  background: var(--glass-tint);
}

.collectible-card-media.is-missing,
.collectible-variant-media.is-missing {
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 255, 255, 0.05) 8px 16px),
    var(--glass-tint);
}

/* Pictures show whole: a crop would cut off heads that sit off-center. */
.collectible-card-image,
.collectible-variant-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Some sets use a wide banner as box art; it gets a wide frame. */
.collectible-card-header.has-wide-media {
  grid-template-columns: 7.5rem minmax(0, 1fr);
}

.collectible-card-media.is-wide {
  aspect-ratio: 12 / 5;
}

.collectible-card[data-brand="sonny-angel"] :is(.collectible-card-image, .collectible-variant-image) {
  object-fit: contain;
  background: #fff;
}

.collectible-card-summary {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
}

.collectible-title {
  margin: 0;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.collectible-title:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
}

.collectible-price {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.collectible-price.is-unavailable {
  color: var(--ink-soft);
  font-weight: 600;
}

.collectible-release {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.collectible-source {
  justify-self: start;
  min-height: auto;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.collectible-variants {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.1rem;
  padding-top: 0.25rem;
  border-top: 0;
  min-width: 0;
}

.collectible-variants-title {
  margin: 0;
  font-size: inherit;
}

.collectible-variants-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 2rem;
  padding: 0 0.1rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--motion-fast), background var(--motion-fast);
}

.collectible-variants-toggle:hover {
  color: var(--ink);
}

.collectible-variants-toggle:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
}

.collectible-variants-count {
  min-width: 0;
}

.collectible-variants-icon {
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.2rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15rem) rotate(45deg);
  transition: transform var(--motion-fast);
}

.collectible-variants-toggle[aria-expanded="true"] .collectible-variants-icon {
  transform: translateY(0.1rem) rotate(-135deg);
}

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

.collectible-inventory-scroll {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--glass-border);
  border-radius: 0.8rem;
  background: var(--glass-tint);
  overscroll-behavior-inline: contain;
}

.collectible-inventory-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 0.9rem;
}

.collectible-inventory-table th,
.collectible-inventory-table td {
  padding: 0.2rem 0.55rem;
  border-bottom: 1px solid var(--glass-border);
  text-align: left;
  vertical-align: middle;
}

.collectible-inventory-table thead th {
  color: var(--ink-soft);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.collectible-inventory-table tbody tr:last-child > * {
  border-bottom: 0;
}

.collectible-inventory-row[hidden],
.collectible-release-block[hidden],
.collectible-card[hidden] {
  display: none;
}

.collectible-inventory-row.is-secret .collectible-thumbnail-toggle {
  border-color: var(--accent-warm);
}

.collectible-inventory-thumbnail {
  width: 3.4rem;
}

.collectible-inventory-table.has-no-thumbnails :is(.collectible-inventory-thumbnail, thead th:first-child) {
  display: none;
}

.collectible-thumbnail-toggle {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  border-radius: 0.55rem;
  background: var(--glass-tint-strong);
  color: var(--ink-soft);
  font: inherit;
  cursor: zoom-in;
  transition: width var(--motion-fast), height var(--motion-fast), border-color var(--motion-fast), box-shadow var(--motion-fast);
}

.collectible-thumbnail-toggle:hover {
  border-color: var(--accent);
}

.collectible-thumbnail-toggle:focus-visible,
.collectible-inventory-quantity input:focus-visible,
.collectible-inventory-owned input:focus-visible {
  outline: 2px solid var(--accent-warm);
  outline-offset: 3px;
}

.collectible-thumbnail-toggle.is-expanded {
  width: 9rem;
  height: 9rem;
  cursor: zoom-out;
}

.collectible-thumbnail-toggle:disabled {
  cursor: default;
}

.collectible-thumbnail-toggle.is-missing,
.collectible-thumbnail-toggle.is-missing:disabled {
  background:
    repeating-linear-gradient(45deg, transparent 0 8px, rgba(255, 255, 255, 0.05) 8px 16px),
    var(--glass-tint);
}

.collectible-thumbnail-toggle .collectible-variant-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.collectible-card[data-brand="sonny-angel"] .collectible-thumbnail-toggle .collectible-variant-image {
  object-fit: contain;
  background: #fff;
}

.collectible-image-missing {
  padding: 0.15rem;
  font-size: 0.6rem;
  line-height: 1.1;
  text-align: center;
}

.collectible-inventory-name {
  min-width: 8rem;
}

.collectible-inventory-name > * {
  display: block;
}

.collectible-variant-name {
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.collectible-secret {
  width: max-content;
  margin-top: 0.2rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--accent-warm);
  border-radius: 999px;
  color: var(--accent-warm);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.collectible-variant-price {
  margin-top: 0.2rem;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 500;
}

.collectible-price-source {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

.collectible-inventory-owned,
.collectible-inventory-quantity {
  width: 4.25rem;
  text-align: center !important;
}

.collectible-inventory-owned-control {
  display: inline-grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.collectible-inventory-owned input {
  width: 1.2rem;
  height: 1.2rem;
  accent-color: var(--accent);
}

.collectible-inventory-quantity input {
  width: 3.5rem;
  min-height: 2.5rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--glass-border);
  border-radius: 0.5rem;
  background: var(--glass-tint-strong);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.collectible-inventory-quantity input[aria-invalid="true"] {
  border-color: var(--accent-warm);
}

.collectible-owned-print,
.collectible-quantity-print {
  display: none;
}

.collectibles-more {
  display: flex;
  justify-content: center;
}

.collectibles-more .button[disabled] {
  opacity: 0.7;
  cursor: progress;
}

/* Search takes its own row; year and series share the next. */
@media (max-width: 1000px) {
  .collectibles-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collectibles-search {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .collectible-year {
    grid-template-columns: minmax(0, 1fr);
  }

  .collectible-year-title {
    grid-column: 1;
  }
}

@media (max-width: 720px) {
  .hero.hero-compact {
    gap: 0.4rem;
    padding-block: 0.4rem 0.6rem;
  }

  .hero.hero-compact h1 {
    font-size: clamp(1.5rem, 6.4vw, 1.9rem);
    line-height: 1.08;
  }

  .hero.hero-compact .lede {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  /* The tab strip scrolls sideways; its fading edge says there is more. */
  .collectibles-lines {
    padding: 0 2rem 0 0.35rem;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 2.5rem), transparent);
  }

  .collectibles-line-tab span {
    min-height: 2.85rem;
    padding-inline: 0.65rem;
    font-size: 0.9rem;
  }

  .collectibles-fields {
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .collectibles-field {
    padding-left: 0.8rem;
  }

  .collectibles-view {
    flex: 1 1 100%;
  }

  .collectibles-segmented {
    flex: 1 1 100%;
  }

  .collectibles-segment {
    flex: 1 1 0;
  }

  .collectibles-sort {
    flex: 1 1 auto;
  }

  .collectibles-sort select {
    flex: 1 1 auto;
  }

  .collectible-inventory-owned,
  .collectible-inventory-quantity {
    width: 3.25rem;
  }

  .collectibles-picker-input {
    flex-basis: 1.5rem;
    min-width: 1.5rem;
  }

  /* With a choice made, the chip says enough; "Add…" would only be clipped. */
  .collectibles-picker-chips:not(:empty) + .collectibles-picker-input::placeholder {
    color: transparent;
  }

  .collectibles-field-label {
    margin-right: 0.1rem;
  }

  .collectibles-picker-options {
    width: min(20rem, calc(100vw - 3rem));
  }

  .collectibles-series-picker .collectibles-picker-options {
    right: 0;
    left: auto;
  }

  .collectible-release-block {
    padding: 0.6rem;
  }

  .collectibles-more .button {
    width: 100%;
  }
}

@page {
  size: letter portrait;
  margin: 0.45in;
}

@media print {
  /* Paper is white: the page's light-on-dark colors print as dark ink. */
  :root {
    color-scheme: light;
    --ink: #111;
    --ink-soft: #333;
    --muted: #555;
    --accent: #006d77;
    --accent-warm: #8a5a00;
    --line: #bbb;
    --glass-border: #bbb;
    --glass-tint: #fff;
    --glass-tint-strong: #fff;
  }

  body {
    color: #111;
    background: #fff;
    font-size: 9pt;
  }

  .site-header,
  .page-shell > footer,
  .collectibles-form,
  .collectibles-more,
  .hero-actions {
    display: none !important;
  }

  .hero {
    min-height: 0;
    padding-block: 0 0.2in;
    border: 0;
    background: none;
    box-shadow: none;
  }

  .hero::before,
  .hero::after {
    display: none;
  }

  .hero h1,
  .hero p,
  .collectible-card,
  .collectible-title,
  .collectible-variant-name {
    color: #111;
  }

  .collectibles-results {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.12in;
  }

  .collectible-release-block {
    break-inside: avoid;
    border-color: #999;
    background: #fff;
    box-shadow: none;
  }

  .collectible-release-title,
  .collectible-release-year,
  .collectible-line-title,
  .collectible-year-title {
    color: #111;
  }

  .collectible-line {
    break-before: page;
  }

  .collectible-line:first-child {
    break-before: auto;
  }


  .collectible-card {
    break-inside: avoid;
    padding: 0.1in;
    border: 1px solid #999;
    background: #fff;
    box-shadow: none;
  }

  .collectible-card-header {
    grid-template-columns: 0.75in minmax(0, 1fr);
  }

  .collectibles-results {
    align-items: start;
  }

  .collectible-variants {
    margin-top: 0;
    border-top-color: #ccc;
  }

  .collectible-variants-panel,
  .collectible-variants-panel[hidden] {
    display: block !important;
  }

  .collectible-store-listings,
  .collectible-store-listings > .collectible-card {
    display: block !important;
  }

  .collectible-variants-toggle {
    min-height: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #444;
  }

  .collectible-variants-action,
  .collectible-variants-icon {
    display: none;
  }

  .collectible-variant-price,
  .collectible-price-source {
    color: #222;
  }

  .collectible-inventory-scroll {
    overflow: visible;
    border-color: #999;
    background: #fff;
  }

  .collectible-inventory-table {
    min-width: 0;
    color: #111;
    font-size: 7.5pt;
  }

  .collectible-inventory-table th,
  .collectible-inventory-table td {
    padding: 0.035in 0.05in;
    border-bottom-color: #bbb;
  }

  .collectible-thumbnail-toggle,
  .collectible-thumbnail-toggle.is-expanded {
    width: 0.42in;
    height: 0.42in;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: #333;
    cursor: default;
  }

  .collectible-inventory-thumbnail {
    width: 0.5in;
  }

  .collectible-inventory-name {
    min-width: 0;
  }

  .collectible-inventory-owned-control,
  .collectible-inventory-quantity input {
    display: none !important;
  }

  .collectible-owned-print,
  .collectible-quantity-print {
    display: inline;
    color: #111;
    font-variant-numeric: tabular-nums;
  }
}

@media (max-width: 420px) {
  .collectible-card {
    padding: 0.45rem 0 0;
  }

  .collectible-card-header {
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: 0.6rem;
  }

  .collectible-card-header.has-wide-media {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }

  .collectible-inventory-table {
    min-width: 28rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .collectibles-search input,
  .collectibles-line-tab span,
  .collectibles-field,
  .collectibles-segment span,
  .collectibles-sort::after,
  .collectibles-export-toggle,
  .collectibles-export-toggle::after,
  .collectible-variants-toggle,
  .collectible-variants-icon,
  .collectible-thumbnail-toggle {
    transition: none;
  }
}
