:root {
  --site-content: 1720px;
}

.site-icp {
  margin: 34px 0 6px;
  color: #8c929b;
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.site-icp a {
  color: inherit;
  text-decoration: none;
}

.site-icp a:hover,
.site-icp a:focus-visible {
  color: #47505a;
  text-decoration: underline;
}

.series-shelf {
  width: 100%;
  margin: -8px 0 22px;
  padding: 12px 0 10px;
  border-bottom: 1px solid #e9ebef;
  background: #fff;
}

.page-heading .add-card {
  display: none;
}

.series-categories {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0 0 8px;
  scrollbar-width: none;
}

.series-categories::-webkit-scrollbar {
  display: none;
}

.series-languages {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 1px 0 10px;
  scrollbar-width: none;
}

.series-languages::-webkit-scrollbar {
  display: none;
}

.series-language {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 0 9px;
  border: 1px solid #e7e9ed;
  border-radius: 5px;
  background: #fff;
  color: #646b75;
  font-size: 11px;
  white-space: nowrap;
  cursor: pointer;
}

.series-language small {
  color: #9ba1aa;
  font-size: 9px;
}

.series-language.active {
  border-color: #292d33;
  background: #292d33;
  color: #fff;
}

.series-language.active small {
  color: #e0e2e5;
}

.series-category {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 0 2px;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #656b74;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.series-category small {
  color: #a0a5ad;
  font-size: 10px;
}

.series-category.active {
  border-color: #f1d500;
  color: #202328;
  font-weight: 650;
}

.series-category.active small {
  color: #6e747d;
}

.series-shelf-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 11px;
  color: #25282d;
  font-size: 13px;
}

.series-shelf-head span {
  color: #9096a0;
  font-size: 11px;
  font-weight: 400;
}

.series-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  padding: 0 0 6px;
  scrollbar-width: thin;
  scrollbar-color: #d4d7dc transparent;
}

.series-tile {
  display: flex;
  flex: 0 0 82px;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 2px 2px 5px;
  border-radius: 6px;
  background: transparent;
  color: #282b30;
  text-align: center;
  cursor: pointer;
}

.series-tile:hover,
.series-tile.active {
  background: #f3f4f6;
}

.series-tile.active .series-cover {
  outline: 2px solid #f0ce00;
  outline-offset: 2px;
}

.series-cover {
  display: grid;
  width: 50px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e2e4e7;
  border-radius: 50%;
  background: #fff;
}

.series-shelf {
  margin-bottom: 14px;
  padding-top: 7px;
  padding-bottom: 6px;
}

.series-categories {
  padding-bottom: 4px;
}

.series-category {
  min-height: 27px;
}

.series-shelf-head {
  margin-bottom: 7px;
}

.series-tile {
  gap: 3px;
  padding-top: 1px;
  padding-bottom: 3px;
}

.site-main .series-shelf + .page-heading {
  margin-bottom: 10px;
}

.series-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.series-cover img.series-logo { object-fit: contain; padding: 5px; background: #f8f9fa; }

.series-tile strong,
.series-tile small {
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-tile .series-name-zh {
  color: #282b30;
  font-size: 11px;
  font-weight: 650;
}

.series-tile .series-name-foreign {
  color: #737983;
  font-size: 10px;
  font-weight: 450;
}

.series-tile strong {
  font-size: 11px;
  font-weight: 600;
}

.series-tile small {
  color: #9298a1;
  font-size: 9px;
}

.site-main .series-shelf + .page-heading {
  margin-top: 0;
}


html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  background: #f6f7f9;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 68px auto;
  width: 100%;
  max-width: none;
  min-height: 100dvh;
  padding: 0;
  align-items: stretch;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  height: 68px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.desktop-brand {
  gap: 9px;
  padding: 0 10px;
  color: #17191d;
  font-size: 21px;
  white-space: nowrap;
}

.desktop-brand span {
  margin-left: 0;
  font-size: 8px;
  letter-spacing: 1px;
}

.desktop-brand .ball {
  width: 25px;
  height: 25px;
  color: #17191d;
  background: linear-gradient(#ffe527 0 46%, transparent 46%);
}

.site-header #tabbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.site-header #tabbar a {
  display: flex;
  flex: none;
  flex-direction: row;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 7px;
  color: #676d77;
  font-size: 13px;
  white-space: nowrap;
}

.site-header #tabbar a.active {
  background: #f3f4f6;
  color: #17191d;
  font-weight: 650;
}

.site-header #tabbar a.active:before {
  display: none;
}

.site-header #tabbar svg {
  width: 19px;
  height: 19px;
}

.header-action {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border-radius: 7px;
  background: #ffe527;
  color: #17191d;
  font-size: 13px;
  font-weight: 650;
}

.header-action:first-letter {
  font-size: 19px;
}

.site-main.phone {
  position: relative;
  z-index: auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: auto;
  max-height: none;
  min-height: calc(100dvh - 68px);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: #f6f7f9;
  box-shadow: none;
}

.site-main .mini-header {
  position: sticky;
  top: 0;
  z-index: 2;
  justify-content: flex-start;
  flex: 0 0 64px;
  height: 64px;
  padding: 0 max(30px, calc((100% - var(--site-content)) / 2));
  border-bottom: 1px solid #e8eaee;
  background: #fff;
  font-size: 16px;
  font-weight: 700;
}

.site-main .mini-header {
  display: none;
}

.site-main .capsule,
.site-main .home-indicator {
  display: none;
}

.site-main .screen {
  width: 100%;
  min-height: calc(100dvh - 68px);
  flex: 1 0 auto;
  overflow: visible;
}

.site-main .page {
  width: 100%;
  max-width: var(--site-content);
  min-width: 0;
  margin: 0 auto;
  padding: 28px 30px 56px;
}

.site-main .brand-row {
  display: none;
}

.site-main .home-search {
  margin-top: 0;
  padding: 13px 15px;
  border: 1px solid #e9ebef;
  font-size: 13px;
}

.site-main .feature-banner {
  height: 190px;
  margin-top: 18px;
}

.site-main .banner-copy {
  padding: 34px 30px;
}

.site-main .banner-copy strong {
  font-size: 28px;
}

.site-main .feature-banner img {
  height: 185px;
  width: 136px;
}

.site-main .banner-pika {
  right: 155px;
  top: 12px;
}

.site-main .banner-zard {
  right: 55px;
  top: 1px;
}

.site-main .banner-ball {
  right: 100px;
  width: 205px;
  height: 205px;
}

.site-main .quick-actions {
  justify-content: flex-start;
  gap: 36px;
  padding: 20px 8px;
}

.site-main .quick-actions > a,
.site-main .quick-actions > button {
  width: auto;
  min-width: 100px;
  flex-direction: row;
  gap: 9px;
  font-size: 12px;
}

.site-main .summary {
  padding: 22px;
  border: 1px solid #eceef1;
}

.site-main .summary-value {
  font-size: 34px;
}

.category-section {
  margin-top: 10px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 13px;
}

.category-card {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 142px;
  flex-direction: column;
  align-items: flex-start;
  padding: 15px;
  overflow: hidden;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease;
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: #c7cbd2;
}

.category-no {
  color: #676d77;
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 1px;
}

.category-card strong {
  margin-top: 23px;
  font-size: 16px;
}

.category-card small {
  margin-top: 6px;
  color: #676d77;
  font-size: 11px;
}

.category-arrow {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 18px;
}

.category-card.physical {
  background: #fff1e8;
}

.category-card.official {
  background: #eaf2ff;
}

.category-card.special {
  background: #e8f4ec;
}

.category-card.digital {
  background: #f0ebff;
}

.site-main .card {
  padding: 8px;
  border: 1px solid #e7e9ed;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 7px #17191b08;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.site-main .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px #17191b12;
}

.site-main .card-art {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  background: #eef0f3;
}

.site-main .card:nth-child(4n + 1) .card-art {
  background: #f3eee8;
}

.site-main .card:nth-child(4n + 2) .card-art {
  background: #e9eff3;
}

.site-main .card:nth-child(4n + 3) .card-art {
  background: #edf2e9;
}

.site-main .card:nth-child(4n) .card-art {
  background: #f1edf3;
}

.site-main .card-art img {
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px #0002);
}

.site-main .card-flag {
  border-radius: 4px;
  background: #ffffffed;
  color: #515761;
  font-size: 9px;
}

.site-main .card-name {
  min-height: 2.8em;
  margin-top: 9px;
  overflow: visible;
  white-space: normal;
  line-height: 1.4;
}

.site-main .price {
  margin-top: 4px;
  font-size: 13px;
}

.site-main .card-meta {
  margin-top: 5px;
}

.load-state {
  min-height: 44px;
  padding: 14px 0 24px;
  color: #9198a3;
  font-size: 12px;
  text-align: center;
}

.load-state button {
  padding: 8px 12px;
}

.site-main .grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 18px 14px;
}

.site-main .card-art {
  height: auto;
  aspect-ratio: 1 / 1.12;
  background: #eceff3;
}

.site-main .card-name {
  font-size: 13px;
}

.site-main .card-meta,
.site-main .source-count,
.site-main .catalog-selects select {
  font-size: 12px;
}

.site-main .scope-tabs {
  gap: 28px;
}

.site-main .scope-tabs button {
  font-size: 14px;
}

.site-main .search {
  padding: 13px;
}

.site-main .search input {
  font-size: 14px;
}

.site-main .catalog-selects select {
  padding: 11px 10px;
}

.site-main .catalog-selects select:first-child {
  width: 140px;
}

.site-main .chip {
  font-size: 12px;
}

.site-main .scan-stage {
  width: 100%;
  max-width: 820px;
  height: min(48vh, 520px);
  min-height: 300px;
}

.site-main .capture-actions {
  width: 100%;
  max-width: 820px;
}

.site-main .scan-disclaimer {
  width: 100%;
  max-width: 820px;
  text-align: center;
}

.site-main .card-profile {
  grid-template-columns: minmax(190px, 30%) minmax(0, 1fr);
  gap: 32px;
  margin: 22px 0 28px;
}

.site-main .profile-main .detail-name {
  font-size: 30px;
}

.site-main .profile-section,
.site-main .info {
  border: 1px solid #eceef1;
}

.site-main .metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.site-main .metric {
  border: 1px solid #eceef1;
}

.site-main .form-label,
.site-main .info .row,
.site-main .profile-section p {
  font-size: 14px;
}

.site-main .field {
  max-width: 620px;
  font-size: 15px;
}

.site-main .wide {
  max-width: 620px;
}

.site-main #toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
}

@media (min-width: 1500px) {
  :root {
    --site-content: 1840px;
  }
}

@media (max-width: 1100px) and (min-width: 761px) {
  .site-header {
    grid-template-columns: minmax(190px, 1fr) auto minmax(140px, 1fr);
    padding-right: 22px;
    padding-left: 22px;
  }

  .site-header #tabbar {
    gap: 0;
  }

  .site-header #tabbar a {
    gap: 5px;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 12px;
  }

  .desktop-brand {
    gap: 7px;
    font-size: 19px;
  }

  .desktop-brand span {
    font-size: 7px;
  }

  .site-main .page {
    padding: 24px 22px 48px;
  }

  .site-main .grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 18px 12px;
  }

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

  .site-main .card-profile {
    grid-template-columns: minmax(150px, 34%) minmax(0, 1fr);
    gap: 22px;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100vw;
  }

  .workspace {
    display: block;
    width: 100%;
    max-width: 100vw;
    min-height: 100dvh;
    overflow-x: clip;
  }

  .site-header {
    position: static;
    display: contents;
  }

  .site-header .desktop-brand,
  .site-header .header-action {
    display: none;
  }

  .site-header #tabbar {
    position: fixed;
    z-index: 10;
    bottom: 0;
    left: 0;
    display: flex;
    width: 100vw;
    max-width: 100vw;
    right: auto;
    flex-direction: row;
    justify-content: space-around;
    gap: 0;
    height: calc(62px + env(safe-area-inset-bottom));
    margin: 0;
    padding: 5px 12px env(safe-area-inset-bottom);
    border-top: 1px solid #eaecf0;
    background: #fff;
  }

  .workspace:not(.has-tabbar) .site-header #tabbar {
    display: none;
  }

  .site-header #tabbar a {
    flex: 1;
    min-height: 0;
    padding: 2px 4px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    border-radius: 0;
    font-size: 10px;
  }

  .site-header #tabbar a.active {
    background: transparent;
  }

  .site-header #tabbar a.active svg {
    display: block;
    width: 25px;
    height: 25px;
    margin: -2px 0;
    padding: 3px;
    border-radius: 7px;
    background: #ffe527;
  }

  .site-main.phone {
    width: 100%;
    max-width: 100vw;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .site-main .mini-header {
    display: flex;
    position: sticky;
    top: 0;
  }

  .site-main .screen {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: calc(100dvh - 48px);
    flex: 1 0 auto;
    overflow: visible;
  }

  .site-main .mini-header {
    flex-basis: 48px;
    height: 48px;
    justify-content: center;
    padding: 0 50px;
    font-size: 12px;
  }

  .site-main .page {
    padding: 16px 16px calc(100px + env(safe-area-inset-bottom));
    width: 100%;
    max-width: 100%;
  }

  .series-shelf {
    margin-top: -5px;
    margin-bottom: 10px;
    padding-top: 5px;
    padding-bottom: 4px;
  }

  .series-categories {
    gap: 13px;
    margin-right: -16px;
    padding-right: 16px;
    padding-bottom: 2px;
  }

  .series-rail {
    gap: 5px;
    margin-right: -16px;
    padding-right: 16px;
  }

  .series-tile {
    flex-basis: 66px;
  }

  .series-cover {
    width: 46px;
  }

  .site-main .series-shelf + .page-heading {
    margin-bottom: 8px;
  }

  .site-main .feature-banner {
    height: 145px;
    margin-top: 13px;
  }

  .site-main .banner-copy {
    padding: 23px 18px;
  }

  .site-main .banner-copy strong {
    font-size: 23px;
  }

  .site-main .feature-banner img {
    height: 145px;
    width: 106px;
  }

  .site-main .banner-pika {
    right: 66px;
    top: 24px;
  }

  .site-main .banner-zard {
    right: 8px;
    top: 12px;
  }

  .site-main .banner-ball {
    right: 50px;
    width: 160px;
    height: 160px;
  }

  .site-main .quick-actions {
    justify-content: space-around;
    gap: 0;
    padding: 17px 0 15px;
  }

  .site-main .quick-actions > a,
  .site-main .quick-actions > button {
    width: 30%;
    min-width: 0;
    flex-direction: column;
    gap: 7px;
    font-size: 10px;
  }

  .site-main .summary {
    padding: 16px;
  }

  .site-main .grid {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    width: 100%;
    min-width: 0;
    gap: 14px 10px;
  }

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

  .category-card {
    min-height: 128px;
    padding: 12px;
  }

  .category-card strong {
    margin-top: 20px;
    font-size: 14px;
  }

  .category-card small {
    font-size: 10px;
  }

  .site-main .card {
    padding: 6px;
  }

  .site-main .card-art {
    aspect-ratio: 1 / 1.04;
  }

  .site-main .card-profile {
    grid-template-columns: minmax(110px, 36%) minmax(0, 1fr);
    gap: 14px;
    margin: 14px 0 20px;
  }

  .site-main .profile-main .detail-name {
    font-size: 21px;
  }

  .site-main .profile-tags span,
  .site-main .identity-tags b,
  .site-main .identity-tags span {
    font-size: 10px;
  }

  .site-main .profile-section {
    padding: 16px;
  }

  .site-main .scan-stage {
    width: 100%;
    height: min(54dvh, 460px);
    min-height: 280px;
  }

  .site-main .capture-actions {
    width: 100%;
  }

  .site-main .scan-disclaimer {
    width: 100%;
  }

  .site-main .metric-grid {
    gap: 8px;
  }

  .site-main .metric {
    min-width: 0;
    padding: 12px 9px;
  }

  .site-main .metric-value {
    font-size: 18px;
    overflow-wrap: anywhere;
  }

  .site-main #toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
    left: 50%;
    max-width: calc(100vw - 32px);
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .site-main .page {
    padding-right: 13px;
    padding-left: 13px;
  }

  .site-main .scope-tabs {
    gap: 15px;
  }

  .site-main .card-profile {
    grid-template-columns: minmax(100px, 34%) minmax(0, 1fr);
    gap: 11px;
  }

  .site-main .profile-main .detail-name {
    font-size: 19px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}


/* Card layout follows the supplied 342px reference; scales down on narrow screens. */
.site-main #catalog-results .grid,
.site-main .featured-grid .grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px 10px;
}
.site-main .card {
  container-type: inline-size;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  color: #171717;
}
.site-main .card .card-art {
  width: 100%;
  height: auto;
  aspect-ratio: 342 / 478;
  background: #fff;
  border-radius: 5cqw;
}
.site-main .card .card-art img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  transform: none;
  filter: none;
}
.site-main .card .card-name {
  margin: 5.85cqw 0 0;
  min-height: 0;
  font-size: 9.36cqw;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
}
.site-main .card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3.5cqw;
  margin-top: 3.5cqw;
  color: #999;
  font-size: 7.02cqw;
  font-weight: 400;
  line-height: 1.4;
}
.card-meta > span { min-width: 0; overflow-wrap: anywhere; }
.site-main .card .card-tricolor { width: 5.5cqw; height: 5.5cqw; flex: 0 0 5.5cqw; transform: none; }
.card-quotes { display: grid; gap: 2.8cqw; margin-top: 3.2cqw; }
.quote-line { display: flex; align-items: center; justify-content: space-between; gap: 3cqw; min-width: 0; }
.site-main .card .grade-logo, .raw-badge { width: 25cqw; max-width: 72px; height: 8.57cqw; max-height: 25px; flex-shrink: 0; transform: none; }
.grade-logo { display: block; object-fit: contain; }
.raw-badge { display: flex; align-items: center; justify-content: center; border: max(1px, .65cqw) solid #807b77; border-radius: 1cqw; font: 600 5.7cqw/1 Arial, sans-serif; }
.quote-line strong { min-width: 0; font: 700 7.2cqw/1.2 Arial, sans-serif; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.quote-line.psa10 { color: #c72731; }
.quote-line.raw { color: #807b77; }
.quote-line .quote-empty { font-family: inherit; font-size: 5.5cqw; font-weight: 500; }
.quote-source { display: block; margin-top: 3.2cqw; font-size: max(8px, 3cqw); line-height: 1.5; color: #999; overflow-wrap: anywhere; }

/* Keep primary navigation reachable at every viewport size. */
.site-header {
  grid-template-columns: minmax(0, 1fr) auto;
}

.site-header #tabbar {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  width: 100%;
  height: 84px;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 7vw, 100px);
  margin: 0;
  padding: 8px 20px 7px;
  border: 0;
  border-top: 1px solid #e6e8eb;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 -5px 20px #1c232b0c;
}

.site-header #tabbar a {
  display: flex;
  flex: 0 1 112px;
  min-width: 0;
  min-height: 56px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 5px;
  border-radius: 8px;
  color: #858b94;
  font-size: 11px;
}

.site-header #tabbar a.active {
  background: transparent;
  color: #17191d;
}

.site-header #tabbar a.active:before {
  display: none;
}

.site-header #tabbar svg {
  display: block;
  width: 21px;
  height: 21px;
}

.site-header #tabbar .nav-scan {
  flex-basis: 100px;
  gap: 2px;
  color: #292d33;
  font-weight: 650;
}

.nav-pokeball {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  margin-top: -22px;
  border: 3px solid #282d34;
  border-radius: 50%;
  background: linear-gradient(to bottom, #e34e45 0 46%, #282d34 46% 54%, #fff 54% 100%);
  box-shadow: 0 3px 8px #14191e26;
  transition: transform .18s ease, box-shadow .18s ease;
}

.nav-pokeball:before,
.nav-pokeball:after,
.nav-pokeball i {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  content: "";
}

.nav-pokeball:before {
  width: 17px;
  height: 17px;
  border: 3px solid #282d34;
  background: #fff;
}

.nav-pokeball:after {
  width: 7px;
  height: 7px;
  background: #fff;
}

.nav-pokeball i {
  inset: 0;
  border: 1px solid #ffffff88;
  transform: none;
}

.site-header #tabbar .nav-scan:hover .nav-pokeball,
.site-header #tabbar .nav-scan:focus-visible .nav-pokeball {
  transform: translateY(-3px) rotate(-8deg);
  box-shadow: 0 6px 12px #14191e30;
}

.site-main .page {
  padding-bottom: calc(148px + env(safe-area-inset-bottom));
}

.workspace:not(.has-tabbar) .site-header #tabbar {
  display: flex;
}

@media (max-width: 1100px) and (min-width: 761px) {
  .site-header #tabbar {
    gap: 44px;
  }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .site-main #catalog-results .grid, .site-main .featured-grid .grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 24px 14px;
  }
}
@media (min-width: 961px) and (max-width: 1100px) {
  .site-main #catalog-results .grid, .site-main .featured-grid .grid {
    grid-template-columns: repeat(8, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .site-header #tabbar {
    left: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: calc(70px + env(safe-area-inset-bottom));
    justify-content: space-around;
    gap: 0;
    padding: 7px 14px calc(7px + env(safe-area-inset-bottom));
    transform: none;
    border-top: 1px solid #e7e9ed;
  }

  .site-header #tabbar a {
    flex: 1 1 0;
    min-height: 54px;
    font-size: 10px;
  }

  .site-header #tabbar .nav-scan {
    flex-basis: 31%;
  }

  .nav-pokeball {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
    margin-top: -17px;
  }

  .site-main .page {
    padding-bottom: calc(106px + env(safe-area-inset-bottom));
  }

  .workspace:not(.has-tabbar) .site-header #tabbar {
    display: flex;
  }

  .site-main #catalog-results .grid, .site-main .featured-grid .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 10px;
  }
}

.account-gate {
  width: min(100%, 440px);
  margin: clamp(24px, 8vh, 72px) auto 0;
  padding: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.account-copy,
.account-userline {
  color: #737984;
  font-size: 13px;
  line-height: 1.6;
}

.account-copy { margin: 8px 0 22px; }
.account-gate form { display: grid; gap: 10px; }
.account-gate .field { width: 100%; min-width: 0; }
.account-gate .primary { margin-top: 8px; }
.account-switch { margin-top: 16px; padding: 8px 0; color: #3565a8; }
.account-userline { margin: -8px 0 14px; overflow-wrap: anywhere; }
.account-logout { flex: 0 0 auto; padding: 8px 10px; color: #686e78; }
.collection-label { color: #22262c; font-weight: 650; }

@media (max-width: 760px) {
  .account-gate { margin-top: 20px; padding: 20px 16px; }
  .site-main .page-heading { gap: 10px; }
  .account-logout { padding: 8px 4px; font-size: 12px; }
}

@media (max-width: 390px) {
  .account-gate { padding: 18px 14px; }
}

/* Tighten the catalog's first screen so the series rail and card grid appear sooner. */
@media (min-width: 761px) {
  .workspace { grid-template-rows: 56px auto; }
  .site-header { height: 56px; grid-template-columns: minmax(0, 1fr); }
  .site-main.phone { min-height: calc(100dvh - 56px); }
  .site-main .screen { min-height: calc(100dvh - 56px); }
  .site-main .screen[data-route="home"] > .page { padding-top: 10px; }
}

.site-main .series-shelf {
  margin-bottom: 8px;
  padding-top: 4px;
  padding-bottom: 3px;
}

.site-main .series-shelf-head { margin-bottom: 4px; }
.site-main .series-rail { gap: 8px; padding-bottom: 2px; }
.site-main .series-cover { width: 44px; }
.site-main .series-tile { flex-basis: 74px; }
.site-main .series-shelf + .page-heading { margin-bottom: 4px; }
.site-main .screen[data-route="home"] .scope-tabs button { padding-top: 9px; padding-bottom: 7px; }
.site-main .screen[data-route="home"] .search { margin: 9px 0; padding: 10px; }
.site-main .screen[data-route="home"] .catalog-selects { margin-top: 7px; }
.site-main .screen[data-route="home"] .catalog-selects select { padding-top: 8px; padding-bottom: 8px; }
.site-main .screen[data-route="home"] .source-count { margin-top: 7px; }

@media (max-width: 760px) {
  .site-main .screen[data-route="home"] > .page { padding-top: 8px; }
  .site-main .series-shelf { margin-top: -5px; }
}

@media (max-width: 390px) {
  .site-main .screen[data-route="home"] > .page { padding-top: 6px; }
  .site-main .screen[data-route="home"] .catalog-selects { flex-wrap: wrap; }
  .site-main .screen[data-route="home"] .catalog-selects .catalog-series { flex: 1 0 100%; }
}

.site-main .screen[data-route="album"] > .page {
  max-width: 1180px;
  padding-top: clamp(20px, 4vh, 42px);
}

.album-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 auto 22px;
  max-width: 1040px;
  min-width: 0;
}

.album-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  place-items: center;
  overflow: hidden;
  border: 1px solid #dfe2e8;
  border-radius: 50%;
  background: #fff;
  color: #8c929d;
  font-size: 22px;
  font-weight: 700;
}

.album-avatar svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.album-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.album-avatar.has-account { border-color: #ffe527; background: #fff7bd; color: #282b30; }
.album-profile-copy { display: grid; min-width: 0; gap: 4px; }
.album-profile-copy strong { overflow: hidden; color: #22262c; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.album-profile-copy small { color: #8d939e; font-size: 12px; }
.album-profile .account-logout { margin-left: auto; }

.album-hero {
  position: relative;
  width: min(100%, 1040px);
  min-height: 250px;
  margin: 0 auto;
  padding: clamp(20px, 3vw, 30px);
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(125deg, #222831 0%, #303945 65%, #3b4652 100%);
  color: #fff;
  isolation: isolate;
}

.album-hero:before,
.album-hero:after {
  position: absolute;
  z-index: -1;
  width: 280px;
  height: 360px;
  border: 1px solid #ffffff12;
  border-radius: 18px;
  content: "";
  transform: rotate(25deg);
}

.album-hero:before { top: -125px; right: 74px; background: #ffffff06; }
.album-hero:after { top: -95px; right: 5px; background: #ffffff05; }
.album-hero-brand { display: flex; align-items: center; gap: 12px; color: #d6dbe2; font-size: 10px; letter-spacing: 2px; }
.album-hero-brand i { color: #ffe527; font-size: 17px; font-style: normal; }
.album-hero h1 { margin: 14px 0 6px; font-size: clamp(24px, 3vw, 34px); line-height: 1.2; letter-spacing: -.7px; }
.album-hero > p { max-width: 500px; margin: 0; color: #c0c6ce; font-size: 14px; line-height: 1.7; }
.album-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.album-hero-action,
.album-hero-secondary {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: #ffe527;
  color: #202328;
  font-size: 13px;
  font-weight: 700;
}
.album-hero-secondary { border-color: #ffffff4a; background: #ffffff0a; color: #fff; }
.album-stats { display: flex; flex-wrap: wrap; gap: 0; margin-top: 28px; }
.album-stats > div { display: grid; min-width: 104px; gap: 4px; padding: 0 24px; border-left: 1px solid #ffffff24; }
.album-stats > div:first-child { padding-left: 0; border-left: 0; }
.album-stats b { font-size: 22px; font-variant-numeric: tabular-nums; }
.album-stats span { color: #c0c6ce; font-size: 11px; }
.album-hero > .album-hero-action { margin-top: 24px; }

.album-hero .account-gate {
  position: relative;
  z-index: 1;
  width: min(100%, 400px);
  margin: 16px 0 0;
  padding: 16px 18px;
  border: 0;
  border-radius: 9px;
  background: #fff;
  color: #22262c;
}
.album-hero.is-authing { min-height: 0; padding: 18px 22px; }
.album-hero.is-authing > h1,
.album-hero.is-authing > p { display: none; }
.album-hero .account-gate .title { font-size: 18px; }
.album-hero .account-gate .account-copy { margin: 4px 0 12px; font-size: 12px; line-height: 1.45; }
.album-hero .account-gate form { gap: 6px; }
.album-hero .account-gate .form-label { margin: 8px 0 4px; font-size: 12px; }
.album-hero .account-gate .field { min-height: 40px; padding: 9px 11px; border-color: #dfe3e8; background: #fff; font-size: 14px; }
.album-hero .account-gate .primary { min-height: 40px; margin-top: 6px; padding: 9px 10px; }
.album-hero .account-gate .account-switch { margin-top: 8px; padding: 4px 0; font-size: 12px; }
.account-close { padding: 2px 8px; background: none; color: #727985; font-size: 24px; line-height: 1; }
.album-library { max-width: 1040px; margin: 28px auto 0; }
.album-library-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.album-library-heading strong { font-size: 17px; }
.album-library-heading span { color: #8d939e; font-size: 12px; }
.album-library .scope-tabs { gap: 18px; }

@media (max-width: 760px) {
  .site-main .screen[data-route="album"] > .page { padding: 20px 16px calc(106px + env(safe-area-inset-bottom)); }
  .album-profile { gap: 11px; margin-bottom: 18px; }
  .album-avatar { width: 48px; height: 48px; flex-basis: 48px; }
  .album-profile-copy strong { font-size: 14px; }
  .album-profile-copy small { font-size: 11px; }
  .album-hero { min-height: 230px; padding: 20px 18px; border-radius: 12px; }
  .album-hero:before,
  .album-hero:after { right: -115px; }
  .album-hero h1 { margin-top: 14px; font-size: 27px; }
  .album-hero > p { max-width: 290px; font-size: 13px; }
  .album-stats { margin-top: 24px; }
  .album-stats > div { min-width: 84px; padding: 0 13px; }
  .album-stats b { font-size: 19px; }
  .album-stats span { font-size: 10px; }
  .album-hero-actions { margin-top: 20px; }
  .album-hero.is-authing { padding: 16px; }
  .album-hero .account-gate { width: 100%; padding: 14px 15px; }
  .album-library { margin-top: 22px; }
  .album-library .search { margin-top: 10px; }
}

@media (max-width: 390px) {
  .site-main .screen[data-route="album"] > .page { padding-right: 13px; padding-left: 13px; }
  .album-profile { margin-bottom: 14px; }
  .album-hero { min-height: 218px; padding: 18px 15px; }
  .album-stats > div { min-width: 76px; padding-right: 10px; padding-left: 10px; }
  .album-hero-actions { gap: 8px; }
  .album-hero-action,
  .album-hero-secondary { min-height: 42px; padding: 0 12px; font-size: 12px; }
}

/* Scanner's camera composition owns the full touch viewport.  This is kept here
   so it wins over general responsive scan-stage sizing above. */
@media (max-width: 1100px) {
  .site-main .screen[data-route="scan"] .scan-mobile .scan-stage {
    height: calc(100dvh - 56px);
    min-height: 490px;
  }
}

@media (max-width: 760px) {
  .site-main .screen[data-route="scan"] .scan-mobile .scan-stage {
    height: calc(100dvh - 48px);
    min-height: 470px;
  }
}
