/* Collection and binder. Loads after css/theme.css and css/counter.css; see
   DESIGN.md for the system. The collection is the set's checklist: the set's
   name as the shop's sign, one line of facts, your progress as a sentence over
   a thin rule, then the cards on the open page with nothing boxed. An owned
   card wears the white price tag a single gets in the case. The binder is the
   object you show off: nine clear sleeves on each page. Phone first. */

/* ---- Collection head -----------------------------------------------------
   One column, in the markup's order: the sign, the facts and progress
   (rendered into .bulk-pulse), then the actions. */
.bulk-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin: 10px 0 36px;
  container-type: inline-size;
}
.bulk-copy { display: contents; }
/* The sign: the size Home and Packs give a set's name, brought down only when
   a word would run out of the column (js measures it as --name-em). */
#view-collection .bulk-head h1 {
  margin: 0;
  font-size: clamp(56px, 9vw, 92px);
  font-size: min(clamp(56px, 9vw, 92px), calc(100cqw * 0.98 / var(--name-em, 4)));
  font-weight: 800;
  font-variation-settings: "opsz" 96, "wdth" 80;
  line-height: 0.9;
  letter-spacing: -0.02em;
  text-wrap: balance;
  color: var(--ink);
}
.bulk-pulse,
.bulk-head > .bulk-pulse {
  display: block;
  min-width: 0;
  max-width: 560px;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.bulk-facts { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.45; }
.bulk-found { margin: 10px 0 0; color: var(--ink); font-size: 16px; line-height: 1.45; font-variant-numeric: tabular-nums; }
/* The progress rule: a hairline the found share is drawn over in ink. */
.bulk-bar {
  height: 2px;
  margin-top: 12px;
  background: var(--line-2);
  overflow: hidden;
}
.bulk-bar span { display: block; height: 100%; background: var(--ink); }
.bulk-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  margin-top: 26px;
}
.bulk-cta .solid { min-height: 52px; padding-inline: 26px; font-size: 18px; font-weight: 700; }
.bulk-cta .ghost { min-height: 52px; padding-inline: 20px; }
/* Open binder is a way out, not an action: an underlined word. */
.bulk-cta [data-goto="binder"],
.bulk-cta [data-goto="binder"]:hover:not(:disabled) {
  min-height: 44px;
  margin-left: 8px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--ink-2);
  text-underline-offset: 3px;
}
.bulk-cta [data-goto="binder"]:hover { text-decoration-color: var(--ink); }
/* Under the tab bar the binder is one tap away, and a sale that cannot happen
   is not an action: the phone head keeps the rip and, when there are spares,
   the sale. */
@media (max-width: 719px) {
  .bulk-cta [data-goto="binder"], .bulk-cta #sell-duplicates:disabled { display: none; }
  .bulk-cta > * { flex: 1 1 auto; }
}

/* Signed out: the invitation sits where the progress would be, and it holds
   the one orange action on the page; ripping waits until there is an account. */
#view-collection:has(.need-account) #bulk-rip { background: transparent; border-color: var(--line-2); color: var(--ink); }
#view-collection:has(.need-account) #bulk-rip:hover { background: transparent; border-color: var(--ink-2); }
.need-account {
  display: grid;
  gap: 12px;
  justify-items: start;
  max-width: 460px;
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
/* On the collection, the binder and the sealed shelf the invitation is plain
   words and two buttons on the wall, not a box. */
.bulk-pulse .need-account, #binder-body .need-account, .vt-page .need-account {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
#binder-body .need-account, .vt-page .need-account { margin: 6px 0 0; }
.need-account p {
  margin: 0;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
}
.need-account .account-hero-actions { margin-top: 2px; gap: 8px; }

/* ---- Browsing sets ------------------------------------------------------------
   Two rows of words. The eras with a hairline under the row and an ink line
   under the open one, like the header nav; under them the era's sets, each
   with how many of its cards you have in small figures. Both rows scroll
   sideways on a phone; the sets wrap on a laptop. */
.bulk-browse {
  display: grid;
  gap: 4px;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.bulk-eras {
  position: relative;
  display: flex;
  gap: 24px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.bulk-eras::-webkit-scrollbar { display: none; }
.bulk-eras .bulk-era {
  position: relative;
  flex: none;
  min-width: 0;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: color 0.15s ease;
}
.bulk-eras .bulk-era:hover { color: var(--ink); background: transparent; }
.bulk-eras .bulk-era.on { color: var(--ink); background: transparent; box-shadow: none; }
.bulk-eras .bulk-era.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
}
.bulk-shelf {
  position: relative;
  display: flex;
  gap: 22px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.bulk-shelf::-webkit-scrollbar { display: none; }
.bulk-set,
.bulk-set:hover:not(:disabled) {
  flex: none;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 13px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 560;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: color 0.15s ease;
}
.bulk-set:hover:not(:disabled) { color: var(--ink); }
.bulk-set.active, .bulk-set.active:hover:not(:disabled) { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.bulk-set:disabled { opacity: 0.45; cursor: default; }
.bulk-set.is-queued, .bulk-set.is-queued:hover { color: var(--faint); }
.bulk-set-count {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.bulk-set.active .bulk-set-count { color: var(--ink-2); }
.bulk-era-empty {
  margin: 0;
  padding: 12px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ---- Toolbar ----------------------------------------------------------------
   The search, a square segmented control for what to show, and the rarity
   filter as a row of words with an ink line under the one that is on. */
.bulk-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
}
.bulk-toolbar .search {
  flex: 1 1 100%;
  min-width: 0;
  padding: 10px 14px;
  font-size: 16px;
}
/* The square segmented control from css/theme.css, stretched to the row. */
#view-collection .bulk-seg {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  border-radius: var(--r-sm);
}
#view-collection .bulk-seg .seg-btn {
  flex: 1 1 0;
  min-height: 40px;
  padding: 6px 8px;
  font-size: 14px;
  text-align: center;
}
#view-collection .bulk-rarities {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  margin: 0 calc(-1 * var(--gutter)) 16px;
  padding: 0 var(--gutter);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.bulk-rarities::-webkit-scrollbar { display: none; }
#view-collection .rarity-chip {
  position: relative;
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
  padding: 10px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: color 0.15s ease;
}
#view-collection .rarity-chip:hover { background: transparent; color: var(--ink); }
#view-collection .rarity-chip.on { background: transparent; color: var(--ink); }
#view-collection .rarity-chip.on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--ink);
}
.rarity-marks {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
.bulk-result {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

/* ---- The grid -----------------------------------------------------------------
   Cards on the open page: no slot boxes. An owned card wears a white price
   tag on its lower corner, the way a shop prices a single; a missing card is
   a ghost with its value in plain figures. Copies and the sale sit under the
   name, small and plain. */
.binder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 10px;
  align-items: stretch;
}
.binder-slot,
.binder-slot:hover {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  transition: none;
}
.slot-art { position: relative; }
.bulk-card .slot-face {
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
  border-radius: 3.97% / 2.84%;
}
.bulk-card .slot-face:empty { background: rgb(255 255 255 / 0.04); }
/* The tag hangs a little off the card's lower edge, at the angle a hand leaves it. */
.slot-tag {
  position: absolute;
  z-index: 3;
  left: -3px;
  bottom: -9px;
  font-size: 13px;
  --tilt: -2deg;
  pointer-events: none;
}
.slot-meta { margin-top: 15px; min-height: 0; }
.slot-meta b {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--ink);
}
.slot-meta > span {
  display: flex;
  flex-wrap: wrap;
  gap: 0 5px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}
.slot-num { flex: 0 0 100%; }
.slot-dot { display: none; font-style: normal; }
.slot-rarity { min-width: 0; }
.slot-meta .pip { font-size: 11px; }
.slot-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  margin-top: auto;
}
.slot-foot:empty { display: none; }
.slot-price, .slot-qty {
  padding-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.bulk-card.missing .slot-price { color: var(--muted); font-weight: 500; }
/* Sell is an underlined word with a full-size target. */
.sell-btn, .slot-graded {
  position: relative;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  margin: 0 0 -6px auto;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: var(--line-2);
  text-underline-offset: 3px;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}
.sell-btn:hover, .slot-graded:hover { background: none; color: var(--ink); text-decoration-color: var(--ink); border-color: transparent; }
.bulk-card.missing .tcg {
  opacity: 0.3;
  filter: grayscale(0.7) brightness(0.8);
}
.bulk-card.missing:hover .tcg {
  opacity: 0.62;
  filter: grayscale(0.2) brightness(0.92);
}
.bulk-card.missing .slot-meta b { color: var(--ink-2); }

.bulk-empty {
  grid-column: 1 / -1;
  padding: 18px 0 12px;
  border: 0;
  border-radius: 0;
  background: none;
}
.bulk-empty p { margin: 0; max-width: 56ch; color: var(--ink-2); font-size: 15px; line-height: 1.5; }

/* ---- Binder ----------------------------------------------------------------------
   The page around the binder is plain: the title, one line of what is on show,
   two outline buttons, and the page controls. The binder is the object. */
#view-binder .section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 4px 16px;
  margin-bottom: 18px;
}
#view-binder .section-head > div:first-child { display: contents; }
#view-binder .section-head h2 { grid-column: 1 / -1; margin: 0 0 4px; }
#view-binder .section-head p { grid-column: 1; margin: 0; font-size: 16px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.binder-worth { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; }
#view-binder .binder-actions { grid-column: 2; grid-row: 2; }
#view-binder .view-intro { margin: 0 0 22px; max-width: 52ch; font-size: 15px; color: var(--muted); }
#view-binder .view-intro .link-btn { color: var(--ink-2); font-weight: 560; text-underline-offset: 3px; }
.binder-actions { display: flex; flex: none; gap: 8px; }
#binder-body { display: flex; flex-direction: column; }
#view-binder .binder-sharing-note {
  display: block;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}
.binder-spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* The page: an object in a well, nine sleeves. */
.binder-page,
.binder-spread .binder-page:last-child {
  position: relative;
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--well);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.binder-page-toolbar {
  margin: -6px 2px 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.binder-page-toolbar > span { color: var(--ink-2); font-weight: 600; }
/* Showing a page on the profile is a toggle in words: underlined, a full-size target. */
.binder-page .page-share {
  min-height: 44px;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
}
.binder-page .page-share:hover:not(:disabled) { background: none; color: var(--ink); }
.binder-page .page-share[aria-pressed="true"] { background: none; border: 0; color: var(--ink); }
.binder-page .page-share:disabled { opacity: 1; color: var(--faint); background: none; text-decoration: none; }
.binder-pockets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}
.binder-page-no { display: none; }

.pocket {
  position: relative;
  aspect-ratio: 63 / 88;
  min-width: 0;
  border-radius: 3.97% / 2.84%;
}
/* The sleeve: a still highlight across the top-left corner. Static by design. */
.pocket::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(158deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.035) 30%, transparent 52%);
}
.pocket.empty {
  display: grid;
  place-items: center;
  width: 100%;
  padding: 0;
  border: 1px dashed var(--line-2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.pocket.empty:hover { border-color: var(--ink-2); color: var(--ink); background: var(--surface); }
.pocket.empty:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pocket.filled { border: 0; }

/* On /binder each pocket is a clear sleeve a little bigger than a card: a
   welded edge, the open top of the front sheet, and the card resting at the
   bottom with plastic showing round it. :where() keeps these as light as the
   rules above, so the sleeve and page looks in css/binder/materials.css still
   win. (Profile pages keep their own pockets, css/card-displays.css.) */
:where(#view-binder) .pocket {
  aspect-ratio: 70 / 95;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.11);
}
:where(#view-binder) .pocket::before { /* the front sheet's open top edge */
  content: "";
  position: absolute;
  z-index: 3;
  left: 1px;
  right: 1px;
  top: 4.5%;
  height: 1px;
  background: rgba(255, 255, 255, 0.16);
  pointer-events: none;
}
:where(#view-binder) .pocket.filled { padding: 6% 5% 4%; }
:where(#view-binder) .pocket.empty {
  border: 0;
  background: rgba(255, 255, 255, 0.03);
  color: var(--faint);
  font-size: 26px;
}
:where(#view-binder) .pocket.empty:hover { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
:where(#view-binder) .pocket-card:hover { transform: none; }
.pocket-card {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.16s ease;
}
.pocket-card:hover { transform: translateY(-3px); }
.pocket-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Taking a card out: a small round button, with a target the size of a thumb. */
.pocket-clear {
  position: absolute;
  top: -7px;
  right: -7px;
  z-index: 4;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: var(--wall-dark);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.pocket-clear::before { content: ""; position: absolute; inset: -10px; }
.pocket.filled:hover .pocket-clear,
.pocket-clear:focus-visible { opacity: 1; }
.pocket-clear:hover { color: var(--ink); border-color: var(--ink-2); }
@media (hover: none) {
  .pocket-clear { opacity: 0.9; }
  .pocket-card:hover { transform: none; }
}

.binder-nav {
  order: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.binder-nav span { text-align: center; }
.binder-nav .ghost { min-width: 96px; }
.binder-nav button:disabled { opacity: 0.4; cursor: default; }

/* ---- Card picker -------------------------------------------------------------------
   A sheet from the bottom on a phone, a floating surface on a laptop. */
.picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(6, 5, 8, 0.72);
}
.picker {
  --picker-bg: var(--wall-dark);
  position: fixed;
  z-index: 61;
  inset: auto 0 0 0;
  transform: none;
  width: auto;
  max-height: min(84vh, calc(100dvh - 48px));
  padding: 0 16px calc(20px + env(safe-area-inset-bottom));
  border: 1px solid var(--line-2);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--picker-bg);
  box-shadow: var(--shadow);
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
/* The title and the search box stay put while the cards scroll under them. */
.picker-top {
  position: sticky;
  top: 0;
  z-index: 2;
  padding-bottom: 10px;
  background: var(--picker-bg);
}
.picker-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 4px;
  padding: 18px 0 10px;
}
.picker-head::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--line-2);
  transform: translateX(-50%);
}
.picker-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.picker-head .ghost { min-height: 36px; padding: 6px 14px; font-size: 14px; }
/* Search, then the filters, then the sort words: the same few controls the casino's stake picker has. */
.picker-find { display: flex; gap: 8px; }
.picker-find .picker-search { flex: 1; min-width: 0; }
.picker-filter-toggle { position: relative; flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: var(--r-sm); background: var(--well); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); cursor: pointer; }
.picker-filter-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.picker-filter-toggle[aria-expanded="true"] { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.picker-filter-toggle[data-active]::after { content: ""; position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--ink); }
.picker-filter-toggle:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.picker-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 4px 0 12px;
  border-radius: var(--r-sm);
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted);
}
.picker-search:focus-within { box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink-2); }
.picker-search > svg, .picker-clear-x svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.picker-search input {
  flex: 1;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}
.picker-search input::placeholder { color: var(--faint); }
.picker-search input::-webkit-search-cancel-button, .picker-search input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.picker-clear-x { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; }
.picker-clear-x[hidden] { display: none; }
.picker-clear-x:hover { color: var(--ink); }
.picker-filters { display: none; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.picker[data-filters="open"] .picker-filters { display: grid; }
.picker-filters .picker-select:first-child { grid-column: 1 / -1; }
.picker-select { position: relative; display: block; min-width: 0; }
.picker-select-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.picker-select select {
  width: 100%;
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background-color: var(--well);
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font: inherit;
  font-size: 16px;
  text-overflow: ellipsis;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.picker-select select:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.picker-select select:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.picker-select select:not(:has(option:first-child:checked)) { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.picker-select option { color: #111; background: #fff; }
.picker-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.picker-words { display: flex; gap: 18px; min-width: 0; }
.picker-words button { position: relative; min-height: 44px; padding: 10px 0 12px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.picker-words button[aria-pressed="true"] { color: var(--ink); }
.picker-words button[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 5px; height: 2px; background: var(--ink); }
.picker-words button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.picker-count { flex: none; margin: 0; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.picker-none { padding: 28px 0 24px; text-align: center; }
.picker-none p { margin: 0 0 6px; color: var(--ink-2); font-size: 15px; }
.picker-link { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); cursor: pointer; }
.picker-link:hover { text-decoration-color: var(--ink); }
.picker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 10px;
  padding: 12px 4px 8px;
}
.picker-card {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease;
}
.picker-card:hover { transform: translateY(-4px); }
.picker-card:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: var(--r-sm); }
.picker-face { display: block; aspect-ratio: 63 / 88; border-radius: 3.97% / 2.84%; }
.picker-face:empty { background: rgb(255 255 255 / 0.04); }
.picker-name {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker-meta {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.picker-price { color: var(--ink); font-weight: 650; }
.picker .panel-empty {
  margin: 0;
  padding: 8px 0 20px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
}

/* ---- Motion off ------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bulk-bar span { animation: none; }
  .pocket-card, .picker-card, .pocket-card:hover, .picker-card:hover { transition: none; transform: none; }
}
body.no-motion .bulk-bar span { animation: none; }

/* ---- Wider screens ---------------------------------------------------------------- */
@media (min-width: 560px) {
  .picker-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .picker-filter-toggle { display: none; }
  .picker-filters .picker-select:first-child { grid-column: auto; }
  .binder-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 14px; }
  .slot-tag { font-size: 15px; bottom: -10px; }
  .slot-meta { margin-top: 17px; }
  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 18px 14px; }
}
@media (min-width: 720px) {
  .bulk-toolbar { gap: 12px; margin-bottom: 12px; }
  .bulk-toolbar .search { flex: 1 1 280px; font-size: 15px; }
  #view-collection .bulk-seg { display: inline-flex; width: auto; margin-left: auto; }
  #view-collection .bulk-seg .seg-btn { flex: none; padding: 6px 16px; }
  #view-collection .bulk-rarities { flex-wrap: wrap; gap: 0 22px; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .bulk-eras { margin-inline: 0; padding-inline: 0; overflow: visible; flex-wrap: wrap; column-gap: 16px; }
  .bulk-eras .bulk-era { font-size: 13.5px; }
  .bulk-shelf { flex-wrap: wrap; gap: 0 26px; margin-inline: 0; padding-inline: 0; overflow: visible; }
  .slot-num { flex: none; }
  .slot-dot { display: inline; }
  .binder-page-toolbar { margin-bottom: 8px; }
  .binder-pockets { gap: 12px; }
  .picker {
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(900px, calc(100% - 40px));
    max-height: min(78vh, 780px);
    padding: 0 24px 24px;
    border-bottom: 1px solid var(--line-2);
    border-radius: var(--r-lg);
  }
  .picker-head { padding: 20px 0 12px; }
  .picker-head::before { content: none; }
}
@media (min-width: 860px) {
  .binder-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 26px 16px; }
  .slot-tag { font-size: 16px; }
  .binder-spread { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .binder-page, .binder-spread .binder-page:last-child { padding: 18px 18px 20px; }
  /* The page controls stand over the binder, at the right of the profile line. */
  #binder-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 24px; }
  #binder-body > .binder-object, #binder-body > .picker, #binder-body > .picker-backdrop, #binder-body > .need-account { grid-column: 1 / -1; }
  #view-binder .binder-sharing-note { margin: 0; }
  .binder-nav { order: 0; justify-content: flex-end; gap: 14px; margin: 0 0 16px; }
  .binder-nav span { min-width: 120px; }
}
@media (min-width: 900px) {
  .bulk-head { margin: 22px 0 40px; }
  #view-binder .section-head { gap: 0 24px; }
  #view-binder .section-head h2 { grid-column: 1; grid-row: 1; }
  #view-binder .section-head p { grid-row: 2; }
  #view-binder .binder-actions { grid-row: 1 / 3; align-self: end; }
  .binder-worth { display: inline; }
}
@media (min-width: 1120px) {
  .binder-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 28px 18px; }
}

/* ---- Graded copies (RIP Grading): a small ivory label plate on tiles that
   hold a slab, top right. ---- */
.grade-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px 3px 5px;
  border-radius: 3px;
  background: #f3eee3;
  color: #15171a;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.45);
  pointer-events: none;
}
.grade-badge i {
  font-style: normal;
  font-size: 8px;
  font-weight: 800;
  padding: 2px 3px;
  border-radius: 2px;
  background: #ff6b4a;
  color: #fff7f2;
}
.grade-badge.grade-10 { background: linear-gradient(135deg, #f3cf72, #e9b949); }
.grade-badge.grade-9 { background: linear-gradient(135deg, #e6e8ec, #c9ccd2); }
.slot-graded { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.slot-graded:hover { color: var(--ink); text-decoration: underline; }

/* Signed out there is nothing to sell or add: the invitation is the action. */
#view-collection:has(.need-account) #sell-duplicates,
#view-binder:has(.need-account) #binder-add-page { display: none; }

/* The card an inspector link jumped to: a short lift and the name underlined. */
.bulk-card.is-found .slot-art { animation: card-found 1.4s ease-out 1; }
.bulk-card.is-found .slot-meta b {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
@keyframes card-found {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.06); }
}
@media (prefers-reduced-motion: reduce) { .bulk-card.is-found .slot-art { animation: none; } }
body.no-motion .bulk-card.is-found .slot-art { animation: none; }
