:root {
  --navy: #0b2d52;
  --navy-2: #133e6f;
  --ink: #101820;
  --muted: #62707d;
  --yellow: #ffd300;
  --yellow-dark: #e7b900;
  --red: #e53935;
  --cream: #f5f3ec;
  --blue-wash: #e9f0f7;
  --line: #dfe4e8;
  --white: #ffffff;
  --shadow-sm: 0 8px 24px rgba(17, 32, 47, 0.08);
  --shadow-lg: 0 26px 70px rgba(11, 45, 82, 0.2);
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 32px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #f8f9fa;
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.has-modal {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--white);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 3px solid rgba(229, 57, 53, 0.45);
  outline-offset: 3px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(11, 45, 82, 0.08);
  background: rgba(248, 249, 250, 0.92);
  backdrop-filter: blur(18px);
}

.topbar-inner {
  width: min(1180px, calc(100% - 40px));
  height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 14px rgba(11, 45, 82, 0.18);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.brand-copy strong {
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
}

.desktop-nav a,
.desktop-nav button {
  min-width: 78px;
  padding: 9px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.desktop-nav a.is-active,
.desktop-nav a:hover,
.desktop-nav button:hover {
  color: var(--white);
  background: var(--navy);
}

.saved-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.saved-button > span:first-child {
  color: var(--red);
  font-size: 18px;
}

.saved-count {
  display: grid;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  place-items: center;
  border-radius: 50%;
  color: var(--white);
  background: var(--navy);
  font-size: 12px;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(380px, 0.94fr);
  gap: clamp(44px, 7vw, 92px);
  align-items: center;
  min-height: 650px;
  padding: 66px 0 56px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
}

.eyebrow span {
  width: 22px;
  height: 4px;
  border-radius: 999px;
  background: var(--yellow);
  box-shadow: 8px 0 0 var(--red);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--navy);
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(45px, 5.4vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h1 em {
  position: relative;
  color: var(--red);
  font-style: normal;
}

h1 em::after {
  content: "";
  position: absolute;
  left: 2px;
  right: 0;
  bottom: -7px;
  height: 8px;
  border-radius: 999px;
  background: var(--yellow);
  transform: rotate(-1.5deg);
  z-index: -1;
}

.hero-description {
  max-width: 560px;
  margin-bottom: 26px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.search-box {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  max-width: 620px;
  padding: 7px 7px 7px 18px;
  border: 2px solid var(--navy);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.search-symbol {
  position: relative;
  width: 19px;
  height: 19px;
  margin-right: 11px;
  border: 2px solid var(--navy);
  border-radius: 50%;
}

.search-symbol::after {
  content: "";
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--navy);
  transform: rotate(45deg);
}

.search-box input {
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
}

.search-box input::placeholder {
  color: #929ca5;
}

.search-camera {
  display: none;
  width: 42px;
  height: 42px;
  margin-right: 5px;
  border: 0;
  border-radius: 12px;
  color: var(--navy);
  background: var(--blue-wash);
  font-weight: 900;
}

.search-submit,
.primary-button {
  border: 0;
  border-radius: 12px;
  color: var(--navy);
  background: var(--yellow);
  font-weight: 850;
  cursor: pointer;
}

.search-submit {
  height: 44px;
  padding: 0 20px;
}

.search-submit:hover,
.primary-button:hover {
  background: #ffdf45;
}

.quick-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
}

.quick-search button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid #b9c1c8;
  background: transparent;
  color: var(--navy);
  cursor: pointer;
}

.search-results {
  position: absolute;
  z-index: 20;
  width: min(620px, calc(100vw - 40px));
  max-height: 350px;
  margin-top: 10px;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.search-result-button {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result-button:hover,
.search-result-button:focus-visible {
  background: var(--blue-wash);
}

.search-result-button img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
}

.search-result-button strong,
.search-result-button small {
  display: block;
}

.search-result-button small {
  margin-top: 4px;
  color: var(--muted);
}

.empty-search {
  margin: 0;
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

.empty-search p {
  margin-bottom: 14px;
}

.empty-search .secondary-button {
  min-height: 40px;
}

.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13px;
}

.search-loading .progress-spinner {
  width: 22px;
  height: 22px;
}

.search-result-meta {
  padding: 8px 10px 10px;
  color: var(--muted);
  font-size: 11px;
}

.inventory-result {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
}

.inventory-result:hover {
  background: var(--blue-wash);
}

.inventory-result img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  background: #f4f6f8;
  object-fit: contain;
}

.inventory-result strong,
.inventory-result small {
  display: block;
}

.inventory-result strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-result small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.save-inline {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--red);
  background: var(--white);
  font-size: 17px;
  cursor: pointer;
}

.save-inline.is-saved {
  color: var(--white);
  border-color: var(--red);
  background: var(--red);
}

.scan-card {
  position: relative;
  display: flex;
  min-height: 500px;
  padding: 22px;
  overflow: hidden;
  flex-direction: column;
  border: 0;
  border-radius: var(--radius-lg);
  color: var(--white);
  background: var(--navy);
  box-shadow: var(--shadow-lg);
  text-align: left;
  cursor: pointer;
  isolation: isolate;
}

.scan-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.14;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.65) 3px, transparent 4px);
  background-size: 30px 30px;
  z-index: -1;
}

.scan-card::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -100px;
  width: 280px;
  height: 280px;
  border: 58px solid var(--yellow);
  border-radius: 50%;
  opacity: 0.95;
  z-index: -1;
}

.scan-card-top,
.scan-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.scan-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.scan-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #66e2a3;
  box-shadow: 0 0 0 4px rgba(102, 226, 163, 0.13);
}

.scan-arrow {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 20px;
  transition: transform 180ms ease;
}

.scan-card:hover .scan-arrow {
  transform: translate(3px, -3px);
}

.figure-stage {
  position: relative;
  display: grid;
  min-height: 350px;
  flex: 1;
  place-items: center;
}

.figure-stage img {
  position: relative;
  z-index: 2;
  width: min(210px, 57%);
  max-height: 310px;
  object-fit: contain;
  filter: drop-shadow(0 25px 22px rgba(0, 0, 0, 0.25));
  transition: transform 250ms ease;
}

.scan-card:hover .figure-stage img {
  transform: translateY(-5px) rotate(1deg);
}

.figure-halo {
  position: absolute;
  width: 285px;
  height: 285px;
  border-radius: 50%;
  background: var(--yellow);
}

.focus-corner {
  position: absolute;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-color: var(--white);
  border-style: solid;
}

.corner-a {
  top: 40px;
  left: 45px;
  border-width: 2px 0 0 2px;
}

.corner-b {
  top: 40px;
  right: 45px;
  border-width: 2px 2px 0 0;
}

.corner-c {
  bottom: 38px;
  left: 45px;
  border-width: 0 0 2px 2px;
}

.corner-d {
  right: 45px;
  bottom: 38px;
  border-width: 0 2px 2px 0;
}

.scan-line {
  position: absolute;
  z-index: 4;
  top: 23%;
  left: 50%;
  width: 66%;
  height: 2px;
  background: #79e3ff;
  box-shadow: 0 0 10px rgba(121, 227, 255, 0.85);
  transform: translateX(-50%);
  animation: scan 3s ease-in-out infinite;
}

@keyframes scan {
  0%,
  100% {
    top: 23%;
    opacity: 0.4;
  }
  50% {
    top: 74%;
    opacity: 1;
  }
}

.scan-card-bottom {
  position: relative;
  z-index: 3;
  gap: 16px;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(4, 25, 46, 0.76);
  backdrop-filter: blur(10px);
}

.scan-card-bottom strong,
.scan-card-bottom small {
  display: block;
}

.scan-card-bottom strong {
  font-size: 16px;
}

.scan-card-bottom small {
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
}

.camera-pill {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 10px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 850;
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 108px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
}

.value-strip div {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 18px 26px;
}

.value-strip div + div {
  border-left: 1px solid var(--line);
}

.value-strip strong {
  color: var(--red);
  font-size: 22px;
}

.value-strip span {
  color: var(--muted);
  font-size: 13px;
}

.content-section {
  margin-bottom: 112px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-heading h2,
.collector-copy h2 {
  margin-bottom: 0;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.06;
  letter-spacing: -0.04em;
}

.section-kicker {
  margin-bottom: 9px;
  color: var(--red);
}

.text-button,
.back-label {
  padding: 0 0 4px;
  border: 0;
  border-bottom: 2px solid var(--yellow);
  background: transparent;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

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

.series-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: 0 4px 14px rgba(17, 32, 47, 0.04);
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.series-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.series-card .image-wrap {
  position: relative;
  aspect-ratio: 1.22 / 1;
  overflow: hidden;
  background: var(--cream);
}

.series-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 260ms ease;
}

.series-card:hover img {
  transform: scale(1.035);
}

.series-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  border-radius: 8px;
  color: var(--white);
  background: rgba(11, 45, 82, 0.9);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.series-card-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px;
}

.series-card-copy strong {
  display: block;
  overflow: hidden;
  color: var(--navy);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.series-card-copy small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.series-card-copy > span:last-child {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--yellow);
  font-weight: 900;
}

.collector-section {
  display: grid;
  grid-template-columns: 0.82fr 1.18fr;
  gap: 74px;
  align-items: center;
  margin-bottom: 112px;
  padding: 68px;
  border-radius: var(--radius-lg);
  color: var(--white);
  background: var(--navy);
}

.collector-copy .section-kicker,
.collector-copy h2 {
  color: var(--white);
}

.collector-copy p:not(.section-kicker) {
  margin: 22px 0 28px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.75;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 0 18px;
}

.primary-button span {
  margin-left: 7px;
}

.how-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.how-list li:first-child {
  padding-top: 0;
}

.how-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.how-list li > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 14px;
  color: var(--navy);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 900;
}

.how-list strong {
  font-size: 16px;
}

.how-list p {
  margin: 7px 0 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  line-height: 1.65;
}

.saved-grid,
.catalog-grid,
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.saved-card,
.catalog-card,
.match-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--white);
}

.saved-card[role="button"],
.catalog-card[role="button"],
.match-card[role="button"],
.inventory-result[role="button"] {
  cursor: pointer;
}

.saved-card[role="button"],
.catalog-card[role="button"],
.match-card[role="button"] {
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.saved-card[role="button"]:hover,
.catalog-card[role="button"]:hover,
.match-card[role="button"]:hover,
.saved-card[role="button"]:focus-visible,
.catalog-card[role="button"]:focus-visible,
.match-card[role="button"]:focus-visible {
  border-color: #aebdc9;
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

.saved-card img,
.catalog-card img,
.match-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f4f6f8;
}

.saved-card-copy,
.catalog-card-copy,
.match-card-copy {
  padding: 15px;
}

.saved-card strong,
.saved-card small,
.catalog-card strong,
.catalog-card small,
.match-card strong,
.match-card small {
  display: block;
}

.saved-card strong,
.catalog-card strong,
.match-card strong {
  overflow: hidden;
  color: var(--navy);
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.saved-card small,
.catalog-card small,
.match-card small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}

.card-detail-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
}

.remove-saved,
.save-result {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: var(--red);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.12);
  font-size: 18px;
  cursor: pointer;
}

.save-result.is-saved {
  color: var(--white);
  background: var(--red);
}

.disclaimer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: start;
  margin-bottom: 70px;
  padding: 22px 26px;
  border-left: 5px solid var(--yellow);
  border-radius: 0 16px 16px 0;
  background: #fff9da;
}

.disclaimer strong {
  color: var(--navy);
  font-size: 14px;
}

.disclaimer p {
  margin: 0;
  color: #6c684f;
  font-size: 13px;
  line-height: 1.65;
}

footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
}

footer p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.footer-brand img {
  width: 36px;
  height: 36px;
  border-radius: 11px;
}

.mobile-nav {
  display: none;
}

.modal {
  width: min(1040px, calc(100% - 30px));
  max-height: min(860px, calc(100dvh - 30px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  background: var(--white);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(5, 19, 33, 0.74);
  backdrop-filter: blur(7px);
}

.modal-shell {
  max-height: min(860px, calc(100dvh - 30px));
  padding: 30px;
  overflow: auto;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 26px;
}

.modal-header h2 {
  margin: 0;
  font-size: 32px;
  letter-spacing: -0.04em;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.model-status-card {
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f5f8fb;
}

.model-status-copy {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 11px;
  align-items: center;
}

.model-status-icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  border: 3px solid #b9c8d5;
  border-top-color: var(--navy);
  border-radius: 50%;
}

.model-status-card.is-loading .model-status-icon {
  animation: spin 0.9s linear infinite;
}

.model-status-card.is-ready .model-status-icon {
  border: 0;
  background: #2bae72;
}

.model-status-card.is-ready .model-status-icon::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  font-size: 14px;
  font-weight: 900;
}

.model-status-card.is-error {
  border-color: #f0b8b5;
  background: #ffefee;
}

.model-status-card.is-error .model-status-icon {
  border: 0;
  background: var(--red);
}

.model-status-card.is-error .model-status-icon::after {
  content: "!";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--white);
  font-weight: 900;
}

.model-status-copy strong,
.model-status-copy span {
  display: block;
}

.model-status-copy strong {
  color: var(--navy);
  font-size: 13px;
}

.model-status-copy div span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.model-status-copy b {
  color: var(--navy);
  font-size: 11px;
}

.model-progress-track {
  height: 5px;
  margin-top: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #dce5ec;
}

.model-progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow-dark);
  transition: width 180ms ease;
}

.model-status-card.is-ready .model-progress-track i {
  background: #2bae72;
}

.model-retry {
  margin-top: 10px;
  padding: 7px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--white);
  background: var(--red);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.recognizer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 18px;
}

.upload-panel {
  min-width: 0;
}

.upload-zone {
  display: flex;
  min-height: 390px;
  padding: 35px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 2px dashed #9eb2c4;
  border-radius: 22px;
  background: #f5f8fb;
  text-align: center;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.upload-zone:hover,
.upload-zone.is-dragging {
  border-color: var(--navy);
  background: var(--blue-wash);
}

.upload-zone.is-model-loading {
  opacity: 0.58;
}

.upload-zone.is-model-loading .upload-choice {
  pointer-events: none;
}

.upload-zone input {
  display: none;
}

.upload-visual {
  display: grid;
  width: 74px;
  height: 74px;
  margin-bottom: 22px;
  place-items: center;
  border: 7px solid #ffe25c;
  border-radius: 24px;
  color: var(--navy);
  background: var(--yellow);
  box-shadow: 0 0 0 1px var(--navy);
  font-size: 30px;
  font-weight: 300;
  transform: rotate(-3deg);
}

.upload-zone strong {
  color: var(--navy);
  font-size: 19px;
}

.upload-zone > span:not(.upload-visual) {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.upload-choice-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: min(100%, 390px);
  margin-top: 24px;
}

.upload-choice {
  display: flex;
  min-height: 48px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.upload-choice:hover {
  transform: translateY(-2px);
}

.album-choice {
  background: var(--yellow);
}

.album-choice:hover {
  background: #ffdf45;
}

.camera-choice {
  border: 1px solid #b7c5d0;
  background: var(--white);
}

.camera-choice:hover {
  background: var(--blue-wash);
}

.upload-choice span {
  font-size: 18px;
}

.upload-zone small {
  margin-top: 18px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--navy);
  background: #fff3ad;
  font-size: 11px;
}

.photo-preview {
  min-height: 390px;
  padding: 16px;
  border-radius: 22px;
  background: #f4f6f8;
}

.preview-image-wrap {
  position: relative;
  display: grid;
  min-height: 305px;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background-color: #e8ecef;
  background-image:
    linear-gradient(45deg, #dce1e5 25%, transparent 25%),
    linear-gradient(-45deg, #dce1e5 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dce1e5 75%),
    linear-gradient(-45deg, transparent 75%, #dce1e5 75%);
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
  background-size: 20px 20px;
}

.preview-image-wrap img {
  width: 100%;
  height: 305px;
  object-fit: contain;
}

.preview-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--white);
  background: rgba(11, 45, 82, 0.9);
  font-size: 11px;
  font-weight: 800;
}

.preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.local-processing {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  color: var(--navy);
  background: var(--blue-wash);
  font-size: 11px;
  font-weight: 700;
}

.local-processing .progress-spinner {
  width: 20px;
  height: 20px;
}

.local-processing.is-complete {
  background: #e8f7ef;
  color: #17643e;
}

.local-processing.is-complete .progress-spinner {
  display: none;
}

.secondary-button {
  border: 1px solid #bfc8d0;
  border-radius: 12px;
  background: var(--white);
  color: var(--navy);
  font-weight: 750;
  cursor: pointer;
}

.primary-button:disabled,
.search-submit:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.photo-guide {
  padding: 24px;
  border-radius: 22px;
  color: var(--white);
  background: var(--navy);
}

.photo-guide strong {
  display: block;
  font-size: 16px;
}

.photo-guide ul {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.photo-guide li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 1.55;
}

.photo-guide li:last-child {
  border-bottom: 0;
}

.guide-good,
.guide-bad {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  color: var(--navy);
  background: var(--yellow);
  font-weight: 900;
}

.guide-bad {
  color: var(--white);
  background: var(--red);
}

.match-error {
  margin-top: 14px;
  padding: 17px;
  border-radius: 14px;
}

.progress-spinner {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  border: 3px solid #b6c8d7;
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.match-error {
  color: #8b2421;
  background: #ffebea;
  font-size: 13px;
  line-height: 1.6;
}

.match-results {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.results-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.results-heading h3 {
  margin: 0;
  font-size: 24px;
}

.results-heading > span {
  color: var(--muted);
  font-size: 12px;
}

.confidence-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.confidence-bar {
  height: 6px;
  flex: 1;
  overflow: hidden;
  border-radius: 999px;
  background: #e8ecef;
}

.confidence-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--yellow-dark);
}

.confidence-row b {
  color: var(--navy);
  font-size: 11px;
}

.catalog-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.back-label {
  margin-bottom: 14px;
}

.catalog-status {
  margin: 12px 0 20px;
}

.catalog-loading {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.skeleton {
  min-height: 300px;
  border-radius: 18px;
  background: linear-gradient(100deg, #eef1f3 20%, #f8f9fa 40%, #eef1f3 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

.catalog-empty {
  padding: 46px 20px;
  border: 1px dashed #b9c4ce;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.product-modal {
  width: min(980px, calc(100% - 30px));
}

.product-modal-header {
  align-items: center;
  margin-bottom: 22px;
}

.product-modal-header .back-label {
  margin-bottom: 0;
}

.product-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, 0.98fr);
  gap: 42px;
  align-items: start;
}

.product-detail-media {
  position: sticky;
  top: 0;
  display: grid;
  min-height: 590px;
  place-items: center;
  overflow: hidden;
  border-radius: 24px;
  background-color: #eef1f4;
  background-image: radial-gradient(circle, rgba(11, 45, 82, 0.08) 3px, transparent 4px);
  background-size: 28px 28px;
}

.product-detail-media img {
  width: 86%;
  height: 540px;
  object-fit: contain;
  filter: drop-shadow(0 22px 22px rgba(11, 45, 82, 0.14));
}

.detail-image-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--white);
  background: var(--navy);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.product-detail-copy {
  padding: 14px 6px 12px 0;
}

.product-detail-copy h2 {
  margin-bottom: 10px;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.detail-item-number {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 7px 11px;
  border-radius: 8px;
  color: var(--navy);
  background: #fff2a6;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.detail-sync-status {
  min-height: 20px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 11px;
}

.detail-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0 0 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.detail-facts div {
  min-width: 0;
  padding: 15px 13px;
}

.detail-facts div + div {
  border-left: 1px solid var(--line);
}

.detail-facts dt {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
}

.detail-facts dd {
  margin: 0;
  overflow: hidden;
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.appears-detail {
  margin-bottom: 24px;
}

.detail-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.detail-section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.detail-section-heading span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.set-chip-list {
  display: flex;
  max-height: 142px;
  padding-right: 4px;
  overflow: auto;
  flex-wrap: wrap;
  gap: 8px;
}

.set-chip-list span {
  padding: 7px 10px;
  border: 1px solid #c9d4dd;
  border-radius: 9px;
  color: var(--navy);
  background: #f5f8fa;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.no-set-data {
  margin-bottom: 24px;
  padding: 14px;
  border: 1px dashed #bcc8d2;
  border-radius: 12px;
  color: var(--muted);
  font-size: 12px;
}

.buyer-note {
  margin-bottom: 18px;
  padding: 16px;
  border-left: 4px solid var(--yellow);
  border-radius: 0 12px 12px 0;
  background: #fff9da;
}

.buyer-note strong {
  color: var(--navy);
  font-size: 12px;
}

.buyer-note p {
  margin: 6px 0 0;
  color: #716b4c;
  font-size: 11px;
  line-height: 1.65;
}

.detail-save-button {
  width: 100%;
}

.detail-save-button.is-saved {
  color: var(--white);
  background: var(--red);
}

.toast {
  position: fixed;
  z-index: 300;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100% - 44px));
  padding: 13px 16px;
  border-radius: 12px;
  color: var(--white);
  background: var(--navy);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 170ms ease,
    transform 170ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr 0.85fr;
    gap: 34px;
  }

  .series-grid,
  .saved-grid,
  .catalog-grid,
  .match-grid,
  .catalog-loading {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .collector-section {
    grid-template-columns: 1fr;
    gap: 44px;
    padding: 48px;
  }

  .recognizer-layout {
    grid-template-columns: 1fr;
  }

  .product-detail-layout {
    grid-template-columns: minmax(0, 0.9fr) minmax(340px, 1.1fr);
    gap: 28px;
  }

  .product-detail-media {
    min-height: 500px;
  }

  .product-detail-media img {
    height: 450px;
  }

  .photo-guide {
    display: none;
  }
}

@media (max-width: 700px) {
  html {
    scroll-padding-top: 72px;
  }

  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  .topbar-inner,
  main,
  footer {
    width: min(100% - 30px, 640px);
  }

  .topbar-inner {
    height: 66px;
  }

  .brand img {
    width: 39px;
    height: 39px;
    border-radius: 12px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .desktop-nav,
  .saved-label {
    display: none;
  }

  .saved-button {
    min-height: 38px;
    padding: 6px 7px 6px 10px;
  }

  .hero {
    display: flex;
    min-height: 0;
    padding: 38px 0 28px;
    flex-direction: column;
    align-items: stretch;
  }

  h1 {
    margin-bottom: 18px;
    font-size: clamp(42px, 13vw, 58px);
  }

  .hero-description {
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.7;
  }

  .search-box {
    grid-template-columns: auto 1fr auto;
    padding: 5px 5px 5px 15px;
    border-width: 1.5px;
    border-radius: 15px;
  }

  .search-submit {
    display: none;
  }

  .search-camera {
    display: block;
  }

  .quick-search {
    gap: 6px;
  }

  .search-results {
    left: 15px;
    width: calc(100vw - 30px);
  }

  .scan-card {
    min-height: 430px;
    border-radius: 26px;
  }

  .figure-stage {
    min-height: 288px;
  }

  .figure-stage img {
    width: min(180px, 55%);
    max-height: 255px;
  }

  .figure-halo {
    width: 240px;
    height: 240px;
  }

  .corner-a,
  .corner-c {
    left: 28px;
  }

  .corner-b,
  .corner-d {
    right: 28px;
  }

  .value-strip {
    margin-bottom: 78px;
  }

  .value-strip div {
    min-height: 92px;
    padding: 14px 10px;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    text-align: center;
  }

  .value-strip strong {
    font-size: 18px;
  }

  .value-strip span {
    font-size: 10px;
  }

  .content-section {
    margin-bottom: 80px;
  }

  .section-heading {
    margin-bottom: 20px;
  }

  .section-heading h2,
  .collector-copy h2 {
    font-size: 33px;
  }

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

  .series-card-copy {
    padding: 13px;
  }

  .series-card-copy strong {
    font-size: 13px;
  }

  .series-card-copy > span:last-child {
    width: 30px;
    height: 30px;
  }

  .collector-section {
    gap: 38px;
    margin-right: -15px;
    margin-bottom: 80px;
    margin-left: -15px;
    padding: 42px 24px;
    border-radius: 0;
  }

  .collector-copy p:not(.section-kicker) {
    font-size: 13px;
  }

  .how-list li {
    grid-template-columns: 46px 1fr;
    gap: 13px;
  }

  .disclaimer {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 42px;
  }

  footer {
    display: block;
    padding-bottom: 20px;
  }

  footer p {
    margin-top: 18px;
    line-height: 1.6;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 70;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(68px + env(safe-area-inset-bottom));
    padding: 7px 10px env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -8px 30px rgba(11, 45, 82, 0.1);
    backdrop-filter: blur(18px);
  }

  .mobile-nav a,
  .mobile-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-direction: column;
    border: 0;
    background: transparent;
    color: #75818c;
    font-size: 10px;
    font-weight: 700;
  }

  .mobile-nav a > span,
  .mobile-nav button > span {
    font-size: 20px;
    line-height: 1;
  }

  .mobile-nav .is-active {
    color: var(--navy);
  }

  .mobile-nav .recognize-tab {
    width: 58px;
    height: 58px;
    margin: -22px auto 0;
    border: 5px solid var(--white);
    border-radius: 20px;
    color: var(--navy);
    background: var(--yellow);
    box-shadow: 0 8px 18px rgba(11, 45, 82, 0.2);
  }

  .mobile-nav .recognize-tab span {
    font-size: 24px;
  }

  .modal {
    width: 100%;
    max-width: none;
    max-height: 94dvh;
    margin: auto 0 0;
    border-radius: 26px 26px 0 0;
  }

  .modal-shell {
    max-height: 94dvh;
    padding: 22px 16px calc(24px + env(safe-area-inset-bottom));
  }

  .modal-header {
    margin-bottom: 20px;
  }

  .modal-header h2 {
    font-size: 27px;
  }

  .product-modal-shell {
    padding-top: 16px;
  }

  .product-detail-layout {
    display: block;
  }

  .product-detail-media {
    position: relative;
    min-height: 360px;
    margin-bottom: 24px;
    border-radius: 20px;
  }

  .product-detail-media img {
    width: 90%;
    height: 340px;
  }

  .product-detail-copy {
    padding: 0;
  }

  .product-detail-copy h2 {
    font-size: 30px;
  }

  .detail-facts {
    grid-template-columns: 1fr 1fr;
  }

  .detail-facts div:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .icon-button {
    width: 40px;
    height: 40px;
  }

  .upload-zone {
    min-height: 330px;
    padding: 24px 16px;
  }

  .upload-choice-actions {
    grid-template-columns: 1fr;
    width: 100%;
    margin-top: 20px;
  }

  .photo-preview {
    min-height: 0;
  }

  .preview-image-wrap,
  .preview-image-wrap img {
    min-height: 260px;
    height: 260px;
  }

  .preview-actions {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
  }

  .match-grid,
  .catalog-grid,
  .saved-grid,
  .catalog-loading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .catalog-loading .skeleton {
    min-height: 240px;
  }

  .results-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .toast {
    right: 15px;
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: calc(100% - 30px);
  }
}

@media (max-width: 370px) {
  .topbar-inner,
  main,
  footer {
    width: calc(100% - 24px);
  }

  h1 {
    font-size: 39px;
  }

  .scan-card {
    min-height: 400px;
    padding: 17px;
  }

  .scan-card-bottom {
    padding: 12px;
  }

  .camera-pill {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
