/* CardScanR experimental web beta surface */
.web-beta-page .beta-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.55rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(214, 168, 75, 0.45);
  background: rgba(214, 168, 75, 0.12);
  color: var(--gold-soft, #f0d58a);
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.web-beta-hero .lede {
  max-width: 42rem;
}

.web-beta-auth,
.web-beta-grid {
  max-width: 1120px;
}

.web-beta-auth__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.web-beta-auth .link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--gold-soft, #f0d58a);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.web-beta-auth .link-button:hover {
  color: var(--text, #f4f1ea);
}

.web-beta-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.web-beta-toolbar h2 {
  margin: 0;
  font-family: var(--font-display, "Sora", sans-serif);
}

.web-beta-grid {
  display: grid;
  gap: 1.25rem;
}

.card-detail-anchor:not([hidden]) {
  margin-top: 0.5rem;
}

.card-detail-anchor .card-detail {
  margin-top: 0;
}

@media (min-width: 920px) {
  .web-beta-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
    align-items: start;
  }
}

.search-results {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.search-result {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid var(--line, #2a3544);
  background: var(--bg-panel, #161d27);
  color: inherit;
  cursor: pointer;
}

.search-result:hover,
.search-result:focus-visible,
.search-result.is-selected {
  border-color: rgba(214, 168, 75, 0.55);
  outline: none;
}

.search-result.is-selected {
  background: rgba(214, 168, 75, 0.1);
  box-shadow: inset 0 0 0 1px rgba(214, 168, 75, 0.35);
}

.search-result:focus-visible {
  box-shadow: 0 0 0 2px rgba(214, 168, 75, 0.28);
}

.status-banner {
  max-width: 42rem;
}

.search-result img {
  width: 64px;
  height: 88px;
  object-fit: contain;
  background: #0d1218;
  border-radius: 8px;
}

.search-result img.is-missing,
.card-detail img.is-missing {
  background:
    linear-gradient(135deg, rgba(214, 168, 75, 0.12), transparent 55%),
    #0d1218;
  border: 1px dashed rgba(154, 168, 184, 0.35);
}

.search-result__image-missing {
  color: var(--muted, #9aa8b8);
  font-size: 0.85em;
}

[hidden] {
  display: none !important;
}

.search-result__meta {
  color: var(--muted, #9aa8b8);
  font-size: 0.92rem;
}

.card-detail img {
  width: min(100%, 220px);
  height: auto;
  margin-bottom: 0.85rem;
  border-radius: 12px;
  background: #0d1218;
}

.card-detail dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.85rem;
  margin: 0;
}

.card-detail dt {
  color: var(--muted, #9aa8b8);
}

.card-detail dd {
  margin: 0;
}

.planned-panel .eyebrow {
  margin-bottom: 0.35rem;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}

.modal__dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 32rem);
  max-height: min(90vh, 44rem);
  overflow: auto;
  padding: 1.35rem 1.4rem 1.5rem;
  border-radius: 16px;
  border: 1px solid var(--line, #2a3544);
  background: var(--bg-panel, #161d27);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  border: 0;
  background: transparent;
  color: var(--muted, #9aa8b8);
  font-size: 1.4rem;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .search-result,
  .modal__dialog {
    transition: none !important;
  }
}

@media (max-width: 480px) {
  .web-beta-auth__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .web-beta-auth__actions .btn,
  .web-beta-auth__actions button {
    width: 100%;
  }

  .web-beta-page input,
  .web-beta-page select,
  .web-beta-page textarea {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
}

.account-chip {
  display: inline-flex;
  align-items: center;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(214, 168, 75, 0.35);
  color: #f3e6c5;
  font-size: 0.85rem;
}

.search-result__price {
  color: #d6a84b;
  font-weight: 650;
}

.collection-panel {
  margin-top: 1.6rem;
}

.collection-binders {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.6rem 0 1rem;
}

.collection-overview {
  display: grid;
  gap: 0.7rem;
  margin: 0.7rem 0 0.85rem;
}

.collection-overview__stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.collection-stat {
  display: flex;
  flex-direction: column;
  gap: 0.16rem;
  min-width: 0;
  padding: 0.7rem 0.75rem;
  border: 1px solid rgba(154, 168, 184, 0.24);
  border-radius: 10px;
  background: rgba(13, 18, 24, 0.46);
}

.collection-stat span,
.collection-stat small,
.collection-overview__meta,
.collection-recent {
  color: var(--muted, #9aa8b8);
  font-size: 0.82rem;
}

.collection-stat strong {
  color: var(--text, #f4f1ea);
  font-size: 1.15rem;
  line-height: 1.2;
}

.collection-stat small {
  line-height: 1.3;
}

.collection-overview__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
}

.collection-overview__meta strong,
.collection-recent strong {
  color: var(--text, #f4f1ea);
}

.collection-recent {
  padding: 0.6rem 0.75rem;
  border-left: 2px solid rgba(214, 168, 75, 0.55);
  background: rgba(214, 168, 75, 0.06);
}

.collection-recent ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0.3rem 0 0;
  padding-left: 1.1rem;
}

.collection-item__body h3 {
  margin: 0;
  overflow: hidden;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 0.9rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-item__meta {
  margin: 0.24rem 0 0;
  color: var(--muted, #9aa8b8);
  font-size: 0.76rem;
  line-height: 1.3;
}

.collection-item__price {
  color: #d6a84b;
}

.collection-empty {
  grid-column: 1 / -1;
  margin: 0;
}

@media (min-width: 640px) {
  .collection-overview__stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.binder-chip {
  border: 1px solid rgba(214, 168, 75, 0.4);
  background: rgba(214, 168, 75, 0.08);
  color: inherit;
  border-radius: 999px;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
}

.binder-chip.is-selected {
  background: rgba(214, 168, 75, 0.22);
  border-color: rgba(214, 168, 75, 0.85);
}

.slot-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.35rem 0 0.7rem;
}

.slot-filter__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid #3a4450;
  background: #2a313a;
  color: #9aa8b8;
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  cursor: pointer;
  font-weight: 500;
}

.slot-filter__chip.is-selected {
  border: 1.6px solid #d6a84b;
  background: rgba(214, 168, 75, 0.18);
  color: #d6a84b;
  font-weight: 700;
}

.slot-filter__check {
  flex: 0 0 auto;
  color: #d6a84b;
}

.binder-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.15rem 0 0.85rem;
}

.binder-pager__label {
  min-width: 7.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.02rem;
}

.binder-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  border-radius: 999px;
}

.binder-pager__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.collection-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
}

.binder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.binder-grid[data-cols="3"],
.binder-pockets[data-cols="3"] .binder-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.binder-grid[data-cols="4"],
.binder-pockets[data-cols="4"] .binder-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.collection-item,
.binder-pocket {
  border: 1px solid var(--line, #2a3544);
  border-radius: 12px;
  padding: 0.45rem 0.5rem 0.55rem;
  background: rgba(13, 18, 24, 0.55);
  min-height: 4.5rem;
}

.collection-item img {
  width: 100%;
  max-width: 7.5rem;
  height: auto;
  aspect-ratio: 63 / 88;
  object-fit: contain;
  display: block;
  margin: 0 auto 0.4rem;
  background: #0d1218;
  border-radius: 8px;
}

.binder-pocket {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.binder-pocket.is-filled {
  padding: 0;
  background: transparent;
  border: none;
}

.binder-pocket.is-filled img.binder-pocket__art {
  width: 100%;
  max-width: none;
  height: auto;
  aspect-ratio: 63 / 88;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: 0;
  background: #0d1218;
  border-radius: 10px;
}

.binder-pocket.is-needed,
.binder-pocket.is-blank {
  padding: 0;
  background: transparent;
  border: none;
}

.binder-pocket__plate {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 63 / 88;
  min-height: 0;
  padding: 0.55rem 0.4rem 0.6rem;
  border-radius: 12px;
  border: 1.5px dashed rgba(154, 168, 184, 0.55);
  background: rgba(18, 24, 32, 0.72);
  overflow: hidden;
  text-align: center;
}

.binder-pocket__silhouette {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  margin: 0;
  object-fit: contain;
  object-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: grayscale(1) brightness(0.82) contrast(1.2);
  opacity: 0.9;
  mix-blend-mode: luminosity;
  pointer-events: none;
}

.binder-pocket__silhouette.is-missing,
.collection-item img.is-missing,
.binder-pocket img.is-missing {
  background:
    linear-gradient(135deg, rgba(214, 168, 75, 0.12), transparent 55%),
    #0d1218;
}

.binder-pocket__plate::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.54);
  pointer-events: none;
}

.binder-pocket__add,
.binder-pocket__status,
.binder-pocket__identity {
  position: relative;
  z-index: 1;
}

.binder-pocket__add {
  color: #d6dbe3;
  display: flex;
  margin-bottom: 0.15rem;
}

.binder-pocket__status {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #c9d2dc;
}

.binder-pocket__identity {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.68rem;
  font-weight: 600;
  color: #9aa8b8;
  padding: 0 0.25rem;
}

.binder-pocket__number {
  display: block;
  margin-top: 0.28rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  color: #c9d2dc;
}

.binder-pocket.is-unused {
  padding: 0;
  background: transparent;
  border: none;
  min-height: 0;
}

.binder-pocket.is-unused::before {
  content: "";
  display: block;
  width: 100%;
  aspect-ratio: 63 / 88;
}

.binder-pockets h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display, "Sora", sans-serif);
  font-size: 1.15rem;
  text-align: center;
}

@media (min-width: 1280px) {
  .web-beta-page .nav-toggle {
    display: none !important;
  }

  .web-beta-page .site-nav {
    display: flex !important;
    position: static;
    inset: auto;
    width: auto;
    height: auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
    flex: 1 1 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 1rem;
  }

  .web-beta-page .site-nav__links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.1rem;
  }

  .web-beta-page .site-nav__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
  }

  .web-beta-auth,
  .web-beta-grid {
    max-width: 1280px;
  }

  .binder-pockets {
    max-width: 52rem;
    margin: 0 auto;
  }

  .binder-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .binder-grid[data-cols="3"],
  .binder-pockets[data-cols="3"] .binder-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .binder-grid[data-cols="4"],
  .binder-pockets[data-cols="4"] .binder-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .slot-filter {
    justify-content: center;
  }
}

.binder-pockets:not([hidden]) ~ .collection-items {
  display: none;
}


/* Isolate binder chrome only — do not hide catalogue search / detail (CS-014-D2). */
body.web-beta-binder-open #collection-items,
body.web-beta-binder-open #collection-status,
body.web-beta-binder-open .collection-panel > h2,
.binder-pockets:not([hidden]) ~ #collection-items {
  display: none !important;
}
body.web-beta-binder-open .web-beta-hero,
body.web-beta-binder-open #auth-panel,
body.web-beta-binder-open #photo-scan-preview {
  display: none !important;
}
