:root {
  color-scheme: light;
  --paper: #fbfaf7;
  --ink: #27221f;
  --muted: #746c64;
  --line: #ded8cf;
  --panel: #ffffff;
  --accent: #d9543f;
  --accent-soft: #fff0eb;
  --mint: #dff1e7;
  --gold: #f7d36f;
  --shadow: 0 18px 42px rgba(54, 42, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  overflow-x: hidden;
}

.background-collage {
  --collage-gap: 22px;
  --collage-size: 150px;
  display: grid;
  gap: var(--collage-gap);
  grid-auto-rows: var(--collage-size);
  grid-template-columns: repeat(var(--collage-columns, 12), var(--collage-size));
  inset: -24vmax;
  min-height: calc(100vh + 48vmax);
  min-width: calc(100vw + 48vmax);
  opacity: 0.42;
  pointer-events: none;
  position: fixed;
  transform: rotate(-6deg);
  z-index: -2;
}

.background-collage::after {
  background:
    linear-gradient(180deg, rgba(251, 250, 247, 0.18), rgba(251, 250, 247, 0.52) 58%, rgba(251, 250, 247, 0.7)),
    radial-gradient(circle at 18% 10%, rgba(255, 240, 218, 0.44), transparent 32%),
    radial-gradient(circle at 86% 12%, rgba(223, 241, 231, 0.34), transparent 30%);
  content: "";
  inset: -20vh -20vw;
  position: fixed;
  transform: rotate(6deg);
}

.collage-tile {
  aspect-ratio: 1;
  background: #fff;
  border: 1px solid rgba(222, 216, 207, 0.9);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(54, 42, 34, 0.16);
  overflow: hidden;
  padding: 7px;
}

.collage-tile img {
  border-radius: 6px;
  display: block;
  filter: saturate(0.78) contrast(0.94);
  height: 100%;
  object-fit: cover;
  width: 100%;
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 250, 240, 0.58), rgba(251, 250, 247, 0.66) 360px, rgba(251, 250, 247, 0.78)),
    linear-gradient(90deg, rgba(255, 255, 255, 0.24), transparent 18%, transparent 82%, rgba(255, 255, 255, 0.24));
  content: "";
  inset: 0;
  pointer-events: none;
  position: fixed;
  z-index: -1;
}

.favorite-modal-open {
  overflow: hidden;
}

.favorite-modal {
  align-items: end;
  background: rgba(39, 34, 31, 0.34);
  display: grid;
  inset: 0;
  padding: 14px;
  position: fixed;
  z-index: 50;
}

.favorite-modal[hidden] {
  display: none;
}

.favorite-modal-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 240, 0.98)),
    #fff;
  border: 1px solid rgba(184, 154, 119, 0.46);
  border-radius: 12px;
  box-shadow: 0 20px 54px rgba(39, 34, 31, 0.24);
  display: grid;
  gap: 12px;
  max-height: min(76vh, 560px);
  overflow: auto;
  padding: 16px;
  width: 100%;
}

.favorite-modal-header {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.favorite-modal h2 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
}

.favorite-modal p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
}

.favorite-modal-close {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 24px;
  font-weight: 700;
  height: 36px;
  line-height: 1;
  padding: 0 0 3px;
  width: 36px;
}

.favorite-modal-options {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.favorite-modal-options .favorite-choice {
  border-radius: 8px;
  display: grid;
  gap: 6px;
  height: auto;
  padding: 5px;
  width: auto;
}

.favorite-modal-options .favorite-choice img {
  aspect-ratio: 1;
  border-radius: 7px;
}

.favorite-modal-options .favorite-choice span {
  color: var(--ink);
  display: block;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.topbar,
main {
  position: relative;
}

.topbar {
  display: grid;
  justify-items: center;
  margin: 0;
  max-width: none;
  padding: 38px 20px 14px;
  position: relative;
  text-align: center;
  width: 100%;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 8px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
  margin: 0;
}

main {
  margin: 0 auto;
  max-width: 1320px;
  padding: 0 20px 44px;
}

.catalog-layout {
  align-items: start;
  display: grid;
  gap: 22px;
  grid-template-columns: 260px minmax(0, 1fr);
}

.catalog-content {
  min-width: 0;
}

.sidebar-column {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 16px;
}

.sidebar-search,
.side-nav {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(54, 42, 34, 0.06);
}

.sidebar-search {
  align-content: center;
  display: grid;
  min-height: 112px;
  padding: 14px;
}

.side-nav {
  display: grid;
  gap: 6px;
  padding: 18px 14px;
}

.all-products-button,
.type-toggle,
.series-link {
  align-items: center;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) 24px;
  min-height: 38px;
  padding: 4px 0;
  text-align: left;
  width: 100%;
}

.mobile-section-control,
.mobile-section-toggle {
  display: none;
}

.mobile-collapsible-panel {
  display: block;
}

.all-products-button {
  display: block;
  margin-bottom: 8px;
}

.type-toggle .label,
.series-link .label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.type-toggle .symbol,
.series-link .symbol {
  color: #918c87;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
}

.type-toggle[aria-expanded="false"] {
  color: #8f8b87;
}

.all-products-button.active,
.type-toggle.active,
.series-link.active {
  color: var(--accent);
}

.series-list {
  display: grid;
  gap: 3px;
  margin: 0 0 8px 14px;
}

.series-link {
  color: #6f6a65;
  font-size: 14px;
  font-weight: 800;
  min-height: 32px;
}

.empty-series {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 0 8px;
}

.search {
  display: grid;
  gap: 8px;
}

.sidebar-search input {
  font-size: 15px;
}

label span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 7px;
}

input,
select {
  appearance: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  outline: none;
  padding: 10px 12px;
  width: 100%;
}

input[type="file"] {
  display: none;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(217, 84, 63, 0.16);
}

.backup-tools {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: -4px 0 10px;
  padding: 0 4px;
}

.backup-tools p {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  margin: 0;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.utility-button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  display: inline-grid;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  min-height: 32px;
  padding: 6px 10px;
}

.utility-button:hover {
  border-color: var(--ink);
}

.backup-message {
  grid-column: 1 / -1;
}

.backup-message:empty {
  display: none;
}

.passport-section {
  display: block;
  margin: 0 0 12px;
  max-width: none;
  padding: 0;
  position: relative;
}

.passport-shell {
  background:
    linear-gradient(135deg, rgba(255, 248, 237, 0.94), rgba(255, 255, 255, 0.86) 48%, rgba(250, 244, 234, 0.9)),
    rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(184, 154, 119, 0.46);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.66),
    0 18px 42px rgba(54, 42, 34, 0.12);
  display: grid;
  gap: 12px;
  grid-template-columns: 170px minmax(0, 1fr) minmax(280px, 0.92fr);
  overflow: hidden;
  padding: 14px;
  position: relative;
}

.passport-shell::before {
  border: 1px solid rgba(184, 154, 119, 0.22);
  border-radius: 6px;
  content: "";
  inset: 10px;
  pointer-events: none;
  position: absolute;
}

.passport-cover,
.passport-profile-page,
.passport-stamp-page {
  min-width: 0;
  position: relative;
  z-index: 1;
}

.passport-cover {
  align-content: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 241, 230, 0.88)),
    #fbf6ed;
  border: 1px solid rgba(184, 154, 119, 0.28);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  display: grid;
  justify-items: center;
  padding: 12px;
  text-align: center;
}

.passport-cover h2 {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 18px;
}

.cover-avatar {
  aspect-ratio: 1;
  background: #fff;
  border-radius: 4px;
  display: block;
  margin-bottom: 18px;
  object-fit: contain;
  padding: 8px;
  width: 86px;
}

.passport-cover strong {
  display: block;
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.passport-cover span {
  color: #111;
  display: block;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
}

.passport-profile-page {
  display: grid;
  gap: 10px;
}

.profile-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
}

.passport-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.15;
  margin: 0 0 3px;
  text-transform: uppercase;
}

.passport-shell h3 {
  margin: 0;
}

.passport-mini-avatar {
  align-items: center;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  display: grid;
  height: 64px;
  justify-items: center;
  overflow: hidden;
  width: 64px;
}

.passport-mini-avatar img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.passport-name {
  display: block;
  margin-top: 0;
}

.passport-name input {
  min-height: 34px;
  padding: 7px 10px;
}

.passport-shell h3 {
  font-size: 15px;
  line-height: 1.2;
}

.passport-shell h3 {
  align-items: center;
  display: flex;
  gap: 7px;
}

.panel-icon {
  align-items: center;
  border-radius: 999px;
  display: inline-grid;
  flex: 0 0 auto;
  height: 28px;
  justify-items: center;
  line-height: 1;
  position: relative;
  width: 28px;
}

.heart-icon {
  background: var(--accent);
  color: #fff;
}

.heart-icon::before {
  color: #fff;
  content: "♥";
  font-size: 16px;
  font-weight: 900;
  left: 50%;
  line-height: 1;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -52%);
}

.badge-icon {
  display: none;
}

.panel-image-icon {
  border-radius: 8px;
  display: block;
  flex: 0 0 auto;
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.passport-grid {
  display: contents;
}

.passport-progress,
.passport-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(184, 154, 119, 0.28);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(54, 42, 34, 0.04);
  min-width: 0;
  padding: 9px;
}

.passport-progress {
  display: grid;
  gap: 0;
  grid-template-columns: 1.2fr 0.82fr 0.82fr;
}

.passport-progress div {
  border-bottom: 0;
  border-right: 1px solid rgba(222, 216, 207, 0.72);
  padding: 7px 10px;
}

.passport-progress div:last-child {
  border-right: 0;
}

.passport-progress strong {
  display: block;
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}

.passport-progress-main {
  grid-column: auto;
}

.passport-progress-main strong {
  font-size: 44px;
  letter-spacing: 0;
}

.passport-progress small {
  font-size: 0.67em;
  font-weight: 900;
  margin-left: 0.14em;
}

.passport-progress span,
.passport-panel-title span {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 900;
  margin-top: 5px;
}

.passport-panel {
  display: grid;
  gap: 8px;
  align-content: start;
}

.passport-panel-title {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.mobile-panel-hint {
  display: none;
}

.favorite-strip {
  display: grid;
  gap: 8px;
  grid-template-columns: 1fr;
}

.favorite-selector {
  min-width: 0;
}

.favorite-selector summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  list-style: none;
}

.favorite-selector summary::-webkit-details-marker {
  display: none;
}

.favorite-selector-hint {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.featured-favorites {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.favorite-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 5px;
  text-align: left;
}

.favorite-tile img {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  object-fit: cover;
  width: 100%;
}

.favorite-tile span {
  color: var(--ink);
  display: block;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

.favorite-picker-inline {
  border-top: 1px solid rgba(222, 216, 207, 0.72);
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-top: 8px;
}

.favorite-choice {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  flex: 0 0 auto;
  height: 34px;
  overflow: hidden;
  padding: 2px;
  width: 34px;
}

.favorite-choice.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(217, 84, 63, 0.18);
}

.favorite-choice img {
  border-radius: inherit;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.favorite-choice span {
  display: none;
}

.passport-stamp-page {
  display: grid;
  min-height: 0;
}

.stamp-panel {
  align-content: stretch;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 100%;
  padding: 9px 0 0;
}

.badge-strip {
  align-content: stretch;
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  height: 100%;
  min-height: 0;
}

.series-badge {
  align-content: center;
  background: rgba(255, 249, 242, 0.72);
  border: 2px solid rgba(191, 84, 58, 0.72);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(191, 84, 58, 0.18);
  color: #b64f37;
  display: grid;
  justify-items: center;
  min-height: 0;
  padding: 7px;
  position: relative;
  text-align: center;
  transform: rotate(-1.5deg);
}

.series-badge:nth-child(even) {
  transform: rotate(1.2deg);
}

.series-badge:nth-child(3n) {
  transform: rotate(-0.8deg);
}

.series-badge:nth-child(4n) {
  transform: rotate(1.8deg);
}

.series-badge:nth-child(5n) {
  transform: rotate(-1.9deg);
}

.series-badge::before {
  border: 1px solid rgba(191, 84, 58, 0.28);
  border-radius: 4px;
  content: "";
  inset: 4px;
  pointer-events: none;
  position: absolute;
}

.series-badge.is-locked {
  background: rgba(245, 244, 242, 0.76);
  border-color: rgba(128, 124, 119, 0.46);
  box-shadow: inset 0 0 0 1px rgba(128, 124, 119, 0.12);
  color: #77716b;
}

.series-badge.has-hidden {
  border-color: rgba(191, 84, 58, 0.72);
  box-shadow: inset 0 0 0 1px rgba(191, 84, 58, 0.18);
}

.series-badge.has-all-hidden {
  background: rgba(255, 249, 242, 0.72);
  border-color: rgba(191, 84, 58, 0.72);
  box-shadow: inset 0 0 0 1px rgba(191, 84, 58, 0.18);
}

.series-badge.is-coming-soon {
  align-content: center;
  background: rgba(245, 244, 242, 0.72);
  border-color: rgba(128, 124, 119, 0.34);
  box-shadow: inset 0 0 0 1px rgba(128, 124, 119, 0.1);
  color: rgba(116, 108, 100, 0.78);
  min-height: 74px;
}

.series-badge.is-coming-soon strong {
  font-size: 12px;
  letter-spacing: 0;
}

.series-badge-stamp,
.series-title-stamp {
  aspect-ratio: 1;
  border-radius: 999px;
  display: block;
  overflow: hidden;
  position: relative;
}

.series-badge-stamp {
  margin-bottom: 5px;
  width: min(46px, 100%);
}

.series-badge-stamp::after,
.series-title-stamp::after {
  border-radius: inherit;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.series-badge-stamp img,
.series-title-stamp img {
  border-radius: inherit;
  display: block;
  filter: saturate(1.08);
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  width: 100%;
}

.series-badge.has-hidden .series-badge-stamp::after,
.series-title-stamp.has-hidden::after {
  border: 4px solid #fbbc04;
}

.series-badge.has-all-hidden .series-badge-stamp::after,
.series-title-stamp.has-all-hidden::after {
  background:
    conic-gradient(
        from 28deg,
        #ffffff 0deg,
        #96e4ff 46deg,
        #fff3ad 92deg,
        #ffffff 138deg,
        #d7c8ff 184deg,
        #78cfff 232deg,
        #ffd54f 286deg,
        #ffffff 360deg
      )
      border-box;
  border: 4px solid transparent;
  mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  -webkit-mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
}

.series-badge.is-locked .series-badge-stamp img,
.series-title-stamp.is-locked img {
  filter: grayscale(1) contrast(0.88) opacity(0.52);
}

.series-badge strong,
.series-badge span {
  display: block;
}

.series-badge strong {
  font-size: 10px;
  line-height: 1.2;
  position: relative;
  text-transform: uppercase;
}

.series-badge span {
  color: rgba(182, 79, 55, 0.74);
  font-size: 9px;
  font-weight: 900;
  margin-top: 4px;
  position: relative;
}

.series-badge.is-locked span {
  color: rgba(119, 113, 107, 0.82);
}

.passport-empty,
.collection-message {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}

.favorite-strip .passport-empty,
.badge-strip .passport-empty {
  align-self: center;
  grid-column: 1 / -1;
  max-width: 100%;
}

.collection-message {
  color: var(--accent);
  margin-top: 10px;
}

.collection-message:empty {
  display: none;
}

.collection-toast {
  background: var(--ink);
  border-radius: 8px;
  bottom: 18px;
  box-shadow: 0 12px 28px rgba(39, 34, 31, 0.2);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  left: 50%;
  margin: 0;
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 14px;
  position: fixed;
  text-align: center;
  transform: translateX(-50%);
  z-index: 40;
}

.collection-toast:empty {
  display: none;
}

.stats {
  align-items: stretch;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 10px 24px rgba(54, 42, 34, 0.05);
  display: grid;
  gap: 8px;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  margin: 0 0 10px;
  padding: 6px;
}

.filter-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(222, 216, 207, 0.9);
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 40px;
  padding: 8px 10px;
  text-align: left;
}

.filter-button:hover,
.filter-button.active {
  border-color: var(--ink);
  box-shadow: 0 8px 20px rgba(54, 42, 34, 0.1);
}

.filter-button.active {
  background: var(--ink);
  color: #fff;
}

.stats strong {
  display: block;
  font-size: 22px;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 0;
}

.filter-button.active span {
  color: rgba(255, 255, 255, 0.76);
}

.summary {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: #fff;
  cursor: default;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 40px;
  min-width: 88px;
  padding: 8px 10px;
  pointer-events: none;
}

.summary:hover {
  box-shadow: none;
}

.summary span {
  color: rgba(255, 255, 255, 0.78);
}

.filter-menu,
.sort-menu {
  position: relative;
}

.filter-menu {
  grid-column: 2;
}

.sort-menu {
  grid-column: 4;
  justify-self: end;
  min-width: 132px;
}

.filter-menu summary,
.sort-menu summary {
  align-items: center;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  font-size: 13px;
  font-weight: 900;
  height: 100%;
  list-style: none;
  min-height: 40px;
  padding: 8px 34px 8px 12px;
  position: relative;
}

.filter-menu summary::-webkit-details-marker,
.sort-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary::after,
.sort-menu summary::after {
  color: var(--muted);
  content: "⌄";
  font-size: 18px;
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.filter-menu[open] summary,
.sort-menu[open] summary {
  border-color: var(--ink);
  box-shadow: 0 8px 20px rgba(54, 42, 34, 0.1);
}

.filter-options,
.sort-options {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 34px rgba(54, 42, 34, 0.16);
  display: grid;
  gap: 0;
  left: 0;
  min-width: 220px;
  overflow: hidden;
  padding: 8px 0;
  position: absolute;
  top: calc(100% + 8px);
  z-index: 15;
}

.filter-options {
  grid-template-columns: 1fr;
}

.sort-options {
  left: auto;
  right: 0;
}

.filter-options .filter-button,
.sort-options button {
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  display: block;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  min-height: 0;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
}

.filter-options .filter-button {
  border-radius: 0;
}

.filter-options .filter-button:hover,
.filter-options .filter-button.active {
  background: rgba(217, 84, 63, 0.08);
  box-shadow: none;
  color: var(--accent);
}

.sort-options button:hover,
.sort-options button.active {
  background: rgba(217, 84, 63, 0.08);
  color: var(--accent);
}

.catalog-grid {
  display: grid;
  gap: 28px;
}

.series-section {
  display: grid;
  gap: 16px;
}

.series-divider {
  align-items: center;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(54, 42, 34, 0.12);
  color: #fff;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 10px 16px;
}

.series-heading {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
}

.series-title-stamp {
  aspect-ratio: 1;
  width: 52px;
}

.series-divider h2 {
  font-size: 20px;
  line-height: 1.2;
  margin: 0;
}

.series-divider span {
  color: rgba(255, 255, 255, 0.72);
  display: block;
  font-size: 13px;
  font-weight: 900;
}

.series-divider .count {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #fff;
  padding: 7px 10px;
  text-align: right;
}

.series-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  min-width: 0;
  overflow: hidden;
}

.card.is-rare {
  border-color: transparent;
  box-shadow:
    0 0 8px 2px rgba(255, 235, 0, 0.42),
    0 0 14px 3px rgba(255, 235, 0, 0.2),
    0 18px 42px rgba(88, 64, 18, 0.16);
}

.image-wrap {
  aspect-ratio: 1;
  background: #f1eee8;
  position: relative;
}

.image-wrap img {
  display: block;
  height: 100%;
  object-fit: cover;
  transition: filter 160ms ease, opacity 160ms ease;
  width: 100%;
}

.card.is-muted .image-wrap img {
  filter: grayscale(1);
  opacity: 0.55;
}

.card.is-muted .image-wrap::after {
  background: rgba(27, 24, 22, 0.34);
  content: "";
  inset: 0;
  position: absolute;
}

.badge-row {
  display: flex;
  gap: 8px;
  left: 10px;
  position: absolute;
  right: 102px;
  top: 10px;
  z-index: 1;
}

.mark-actions {
  display: flex;
  gap: 6px;
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
}

.mark-button {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(39, 34, 31, 0.12);
  border-radius: 999px;
  color: #8f8780;
  cursor: pointer;
  display: grid;
  font: inherit;
  font-size: 22px;
  font-weight: 900;
  height: 38px;
  line-height: 1;
  padding: 0;
  width: 38px;
}

.heart-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.star-button {
  font-size: 20px;
}

.star-button.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

.badge {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(39, 34, 31, 0.12);
  border-radius: 7px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 5px 7px;
}

.badge.rare {
  background: #ffeb00;
  border-color: rgba(39, 34, 31, 0.12);
  box-shadow: none;
  color: var(--ink);
}

.card-body {
  padding: 14px;
}

.card-title {
  font-size: 18px;
  line-height: 1.28;
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.meta {
  display: grid;
  gap: 5px;
  margin: 0 0 14px;
}

.meta div {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 4px;
  grid-template-columns: 70px 1fr;
}

.meta dt {
  font-weight: 900;
}

.meta dd {
  margin: 0;
}

.status-picker {
  display: grid;
  gap: 10px;
}

.status-group {
  display: grid;
  gap: 7px;
}

.status-group-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.status-buttons {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.status-button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  min-height: 38px;
  padding: 8px;
}

.status-button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.status-button[data-ownership="owned"].active {
  background: #24765a;
  border-color: #24765a;
}

.empty-state {
  background: var(--panel);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
  padding: 28px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar {
    display: grid;
    padding-top: 28px;
  }

  .background-collage {
    --collage-gap: 14px;
    --collage-size: 118px;
    inset: -30vmax;
    min-height: calc(100vh + 60vmax);
    min-width: calc(100vw + 60vmax);
  }

  .catalog-layout {
    display: flex;
    flex-flow: row wrap;
    gap: 14px;
  }

  .catalog-content,
  .sidebar-column {
    display: contents;
  }

  .passport-section {
    flex: 0 0 100%;
    order: 1;
  }

  .sidebar-search {
    flex: 0 0 100%;
    order: 2;
  }

  .side-nav {
    flex: 0 0 min(42%, 188px);
    order: 3;
  }

  .side-nav:has(.mobile-section-control:checked) {
    flex-basis: 100%;
  }

  .stats {
    flex: 1 1 0;
    min-width: 0;
    order: 3;
  }

  .backup-tools {
    flex: 0 0 100%;
    order: 4;
  }

  .catalog-grid {
    flex: 0 0 100%;
    order: 5;
  }

  .empty-state {
    flex: 0 0 100%;
    order: 6;
  }

  .passport-section {
    margin-bottom: 16px;
    padding: 0;
  }

  .passport-shell {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .passport-shell::before {
    display: none;
  }

  .passport-cover {
    align-content: center;
    min-height: 240px;
  }

  .passport-cover h2 {
    font-size: 34px;
    letter-spacing: 0;
    margin-bottom: 22px;
  }

  .passport-cover strong {
    font-size: 34px;
  }

  .cover-avatar {
    width: 112px;
  }

  .passport-mini-avatar {
    height: 62px;
    width: 62px;
  }

  .passport-mini-avatar img {
    height: 100%;
    width: 100%;
  }

  .passport-name {
    margin-top: 0;
  }

  .passport-name input {
    min-height: 38px;
  }

  .side-nav {
    position: static;
  }

  .sidebar-search {
    min-height: 0;
    width: 100%;
  }

  .side-nav {
    padding: 0;
    width: auto;
  }

  .mobile-section-toggle {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--ink);
    cursor: pointer;
    display: grid;
    font: inherit;
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 900;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 76px;
    padding: 14px;
    text-align: left;
    width: 100%;
  }

  .mobile-section-toggle::after {
    content: "+";
    color: #918c87;
    font-size: 28px;
    font-weight: 400;
    line-height: 1;
    text-align: right;
  }

  .mobile-section-control:checked + .mobile-section-toggle::after {
    content: "-";
  }

  .mobile-collapsible-panel {
    display: none;
    padding: 0 18px 18px;
  }

  .mobile-section-control:checked + .mobile-section-toggle + .mobile-collapsible-panel {
    display: block;
  }

  .type-nav {
    border-top: 1px solid rgba(222, 216, 207, 0.74);
    padding-top: 12px;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  .filter-menu,
  .sort-menu {
    grid-column: auto;
    min-width: 0;
    width: 100%;
  }

  .filter-menu summary,
  .summary,
  .sort-menu summary {
    min-width: 0;
    padding: 8px;
    width: 100%;
  }

  .stats strong {
    font-size: clamp(20px, 7vw, 26px);
  }

  .stats span {
    font-size: clamp(10px, 3vw, 12px);
    line-height: 1.15;
    overflow-wrap: anywhere;
  }

  .summary {
    grid-template-columns: 1fr;
    min-height: 76px;
  }

  .filter-menu summary,
  .sort-menu summary {
    font-size: clamp(10px, 3vw, 12px);
    min-height: 76px;
    padding-right: 22px;
  }

  .filter-menu summary::after,
  .sort-menu summary::after {
    font-size: 14px;
    right: 8px;
  }

  .filter-options,
  .sort-options {
    left: auto;
    min-width: min(220px, calc(100vw - 28px));
    right: 0;
  }

  .backup-tools {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: -6px;
    padding: 0;
  }

  .backup-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

  .backup-tools p {
    font-size: 10px;
    line-height: 1.25;
  }

  .utility-button {
    font-size: 11px;
    min-height: 30px;
    padding: 5px 8px;
  }

  .passport-progress {
    grid-template-columns: 1fr 1.08fr 1fr;
  }

  .passport-progress div {
    border-bottom: 0;
    border-right: 1px solid rgba(222, 216, 207, 0.72);
    padding: 0 12px;
  }

  .passport-progress div:first-child {
    padding-left: 0;
    padding-right: 18px;
  }

  .passport-progress div:nth-child(2),
  .passport-progress div:nth-child(3) {
    padding-left: 20px;
  }

  .passport-progress div:last-child {
    border-right: 0;
  }

  .passport-progress-main {
    grid-column: auto;
  }

  .passport-progress-main strong {
    font-size: 36px;
  }

  .passport-progress strong {
    font-size: 18px;
  }

  .passport-progress small {
    margin-left: 0.2em;
  }

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

  .favorite-selector-hint {
    display: none;
  }

  .featured-favorites {
    gap: 10px;
    grid-template-columns: repeat(3, 74px);
    justify-content: start;
  }

  .favorite-panel {
    cursor: pointer;
  }

  .favorite-strip {
    grid-template-columns: 1fr;
  }

  .favorite-tile span {
    display: none;
  }

  .favorite-tile {
    height: 74px;
    padding: 5px;
    width: 74px;
  }

  .favorite-tile img {
    height: 100%;
  }

  .favorite-picker-inline {
    display: none;
  }

  .badge-strip {
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stamp-panel {
    grid-column: auto;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(184, 154, 119, 0.28);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(54, 42, 34, 0.04);
    padding: 9px;
  }

  .passport-panel {
    gap: 8px;
  }

  .passport-panel-title {
    display: flex;
  }

  .passport-panel-title h3 {
    font-size: 14px;
  }

  .mobile-panel-hint {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 900;
    margin-top: 2px;
    white-space: nowrap;
  }

  .series-badge {
    align-content: center;
    display: grid;
    justify-items: center;
    min-height: 96px;
    padding: 6px;
  }

  .series-badge::before,
  .series-badge .series-badge-stamp::after {
    display: none;
  }

  .series-badge-stamp {
    aspect-ratio: 1;
    border-radius: 0;
    display: block;
    height: 74px;
    margin: 0;
    opacity: 1;
    overflow: visible;
    width: 74px;
  }

  .series-badge-stamp img {
    border-radius: 0;
    display: block;
    filter: saturate(1.08);
    height: 100%;
    object-fit: contain;
    opacity: 1;
    transform: none;
    width: 100%;
  }

  .series-badge.is-locked .series-badge-stamp img {
    filter: grayscale(1) contrast(0.95);
    opacity: 0.72;
  }

  .series-badge.is-unlocked .series-badge-stamp img {
    filter: saturate(1.08);
    opacity: 1;
  }

  .series-badge strong {
    display: none;
  }

  .series-badge > span:not(.series-badge-stamp) {
    display: none;
  }

  .series-badge.is-coming-soon strong {
    display: block;
    font-size: 13px;
  }

}

@media (max-width: 460px) {
  main,
  .topbar {
    padding-left: 14px;
    padding-right: 14px;
  }

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

  .filter-menu summary,
  .summary,
  .sort-menu summary {
    justify-self: stretch;
    width: 100%;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .series-grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card-body {
    padding: 10px;
  }

  .card-title {
    font-size: 15px;
  }

  .meta div {
    font-size: 11px;
    grid-template-columns: 42px 1fr;
  }

  .status-buttons {
    gap: 6px;
  }

  .status-button {
    font-size: 12px;
    min-height: 34px;
    padding: 6px;
  }

  .series-divider {
    grid-template-columns: 1fr;
  }

  .series-heading {
    gap: 9px;
  }

  .series-title-stamp {
    width: 42px;
  }

  .series-divider .count {
    text-align: left;
  }

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