:root {
  --app-bg: #f2f3f5;
  --card: #fff;
  --ink: #17191f;
  --muted: #72757d;
  --soft: #eceef2;
  --brand: #f23d4d;
  --brand-dark: #97094f;
  --gold: #d0aa5c;
  --gold-soft: #ead8b9;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--app-bg);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--app-bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-shell {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--app-bg);
}

.h5-screen {
  min-height: 100vh;
  padding: 76px 12px calc(100px + env(safe-area-inset-bottom));
}

.h5-screen.catalog-home {
  padding-top: 12px;
}

.h5-screen.detail {
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

.h5-screen.topic-detail-screen {
  padding-top: 76px;
  padding-bottom: 24px;
}

.h5-nav {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 30;
  width: min(100vw, 430px);
  height: 64px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(20, 26, 35, 0.06);
}

.mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.mark.slim {
  width: 12px;
  border-radius: 6px;
  font-size: 12px;
}

.nav-title strong {
  display: block;
  font-size: 18px;
  line-height: 20px;
}

.nav-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.compact-nav {
  grid-template-columns: 32px 1fr 32px;
  border-bottom: 1px solid #ebebeb;
  box-shadow: none;
}

.compact-nav .nav-title {
  text-align: center;
}

.compact-nav .nav-title strong {
  font-size: 16px;
}

.compact-nav .back-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.menu-btn,
.back-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f5f6f7;
  color: #333;
  font-size: 18px;
}

.search-card {
  display: grid;
  grid-template-columns: 16px 1fr 48px;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 4px 4px 4px 18px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20, 26, 35, 0.09);
}

.search-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  color: #6a6a6a;
}

.search-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-card input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 14px;
}

.search-card input::placeholder {
  color: #80848d;
}

.search-submit {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}

.chip-row {
  display: flex;
  gap: 8px;
  margin: 12px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  min-width: 42px;
  height: 34px;
  border: 1px solid #dedfe3;
  border-radius: 17px;
  background: #fff;
  color: #3b3d42;
  padding: 0 14px;
}

.chip.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
  font-weight: 700;
}

.feature-card,
.coin-card,
.result-item,
.photo-card,
.facts-card,
.variant-card,
.pattern-card,
.empty-card,
.filter-panel {
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(22, 28, 36, 0.08);
}

.feature-card {
  display: grid;
  grid-template-columns: 116px 1fr;
  align-items: start;
  gap: 12px;
  min-height: 136px;
  margin-top: 18px;
  padding: 10px;
}

.topic-title {
  margin-top: 18px;
}

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

.topic-card {
  min-height: 112px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(22, 28, 36, 0.08);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

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

.topic-card strong {
  margin-top: 12px;
  font-size: 17px;
  line-height: 22px;
}

.topic-card small {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  line-height: 18px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.topic-card-tag {
  background: #f23d4d;
}

.topic-hero-card,
.topic-stats-card,
.topic-related-card {
  background: #fff;
  box-shadow: 0 8px 18px rgba(22, 28, 36, 0.04);
}

.topic-hero-card {
  border-radius: 20px;
  padding: 14px 12px;
}

.topic-cover {
  position: relative;
  height: 128px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 22% 52%, rgba(255, 255, 255, 0.4) 0 18%, transparent 19%),
    linear-gradient(135deg, #ead8bb, #dec49b);
}

.topic-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topic-cover.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.08), rgba(0,0,0,0.18));
}

.topic-official-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  height: 24px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 24px;
}

.topic-hero-card h1 {
  margin: 10px 0 0;
  color: #222;
  font-size: 22px;
  line-height: 28px;
}

.topic-hero-card p {
  margin: 8px 0 0;
  color: #3f3f3f;
  font-size: 14px;
  line-height: 22px;
}

.topic-stats-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  border-radius: 14px;
  padding: 12px;
}

.topic-stat {
  min-height: 64px;
  border-radius: 12px;
  background: #f7f7f7;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
}

.topic-stat strong {
  color: #222;
  font-size: 20px;
  line-height: 26px;
}

.topic-stat span {
  color: #6a6a6a;
  font-size: 12px;
  line-height: 16px;
}

.topic-related-card {
  margin-top: 12px;
  border-radius: 14px;
  padding: 14px 12px;
}

.topic-related-card h2 {
  margin: 0 0 10px;
  color: #222;
  font-size: 20px;
  line-height: 24px;
}

.topic-coin-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr 10px;
  gap: 10px;
  width: 100%;
  min-height: 88px;
  border: 1px solid #ebebeb;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  padding: 8px;
  text-align: left;
}

.topic-coin-item + .topic-coin-item {
  margin-top: 10px;
}

.topic-coin-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
}

.topic-coin-item h3 {
  margin: 2px 0 0;
  color: #222;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
}

.topic-coin-item p {
  margin: 4px 0 0;
  color: #6a6a6a;
  font-size: 13px;
  line-height: 17px;
}

.topic-coin-item span {
  display: inline-flex;
  margin-top: 4px;
  height: 24px;
  align-items: center;
  border-radius: 12px;
  background: #f7f7f7;
  color: #6a6a6a;
  padding: 0 8px;
  font-size: 12px;
}

.topic-coin-item i {
  color: #6a6a6a;
  font-size: 18px;
  font-style: normal;
  line-height: 22px;
}

.topic-empty,
.topic-error {
  margin: 0;
  color: var(--muted);
  line-height: 22px;
}

.coin-art,
.coin-photo {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--gold-soft);
}

.coin-art img,
.coin-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.coin-art::before,
.coin-photo::before {
  content: "";
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    linear-gradient(76deg, transparent 51%, rgba(255,255,255,0.55) 52%, rgba(255,255,255,0.55) 59%, transparent 60%),
    radial-gradient(circle at 52% 50%, #efd58d 0 36%, var(--gold) 37% 100%);
}

.coin-art.has-image::before,
.coin-photo.has-image::before {
  display: none;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 12px;
  background: var(--brand-dark);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 0 8px;
}

.tag.light {
  background: #f8f0f4;
  color: var(--brand-dark);
}

.tag.outline {
  border: 1px solid #ebebeb;
  background: #fff;
  color: #222;
}

.tag.dark {
  background: #1d1f25;
}

.feature-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
}

.feature-copy h2,
.coin-card h3,
.result-item h3,
.photo-card h1 {
  margin: 0;
  overflow-wrap: anywhere;
}

.feature-copy h2 {
  font-size: 18px;
  line-height: 24px;
}

.feature-copy p,
.coin-card p,
.result-item p,
.photo-card p {
  margin: 0;
  color: var(--muted);
  line-height: 20px;
}

.primary-btn {
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
}

.feature-copy .primary-btn {
  width: 100%;
}

.load-more-hint {
  width: 100%;
  margin-top: 12px;
  padding: 14px 0 2px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
}

.section-title span,
.section-title button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}

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

.coin-card {
  min-width: 0;
  border: 0;
  padding: 8px;
  text-align: left;
}

.coin-card-art-wrap {
  position: relative;
}

.coin-card .coin-art {
  aspect-ratio: 1;
  height: auto;
}

.coin-variant-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: inline-flex;
  align-items: center;
  border-radius: 30px;
  background: rgba(20, 22, 28, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 17px;
  padding: 4px;
}

.feature {
  width: 116px;
  height: 116px;
}

.coin-card h3 {
  display: -webkit-box;
  margin-top: 8px;
  overflow: hidden;
  font-size: 15px;
  min-height: 40px;
  line-height: 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.coin-card p {
  margin-top: 6px;
  font-size: 12px;
}

.filter-panel {
  margin-top: 12px;
  padding: 12px;
}

.filter-panel h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

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

.filter-grid select {
  width: 100%;
  height: 38px;
  border: 1px solid #dedfe3;
  border-radius: 19px;
  background: #fff;
  color: #3b3d42;
  padding: 0 12px;
}

.result-list {
  display: grid;
  gap: 12px;
}

.result-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 104px;
  border: 0;
  padding: 10px;
  text-align: left;
}

.result-item .coin-art {
  width: 84px;
  height: 84px;
}

.result-item h3 {
  font-size: 16px;
  line-height: 22px;
}

.result-item p {
  margin-top: 4px;
  font-size: 12px;
}

.item-tags {
  display: flex;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.identify-screen {
  padding-top: 76px;
}

.identify-upload-card {
  display: flex;
  min-height: 328px;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  border-radius: 20px;
  background: #fff;
  padding: 20px 16px;
}

.identify-upload-card.pair {
  min-height: 0;
}

.identify-pair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.identify-preview {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 160px;
  height: 160px;
  border-radius: 14px;
  background: #ede2d1;
}

.identify-preview.side {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
}

.identify-preview strong,
.identify-preview small {
  position: absolute;
  left: 8px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(20, 22, 28, 0.72);
  color: #fff;
  padding: 3px 8px;
}

.identify-preview strong {
  top: 8px;
  font-size: 13px;
}

.identify-preview small {
  bottom: 8px;
  max-width: calc(100% - 16px);
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identify-preview input,
.identify-file-btn input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.identify-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.identify-coin-art {
  position: relative;
  width: 109px;
  height: 109px;
  border-radius: 50%;
  background:
    linear-gradient(82deg, transparent 47%, rgba(245, 230, 179, 0.86) 48%, rgba(245, 230, 179, 0.86) 58%, transparent 59%),
    radial-gradient(circle at 50% 50%, #e8cf91 0 34%, #c7a66a 35% 100%);
}

.identify-upload-card h1 {
  margin: 0;
  color: #222;
  font-size: 20px;
  line-height: 24px;
  text-align: center;
  overflow-wrap: anywhere;
}

.identify-upload-card p {
  margin: 0;
  color: #6a6a6a;
  font-size: 14px;
  line-height: 20px;
}

.identify-file-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 319px;
  height: 48px;
}

.identify-file-btn:disabled {
  background: #d9dde3;
  color: #7d8490;
}

.identify-title {
  margin-top: 12px;
}

.identify-results {
  display: grid;
  gap: 12px;
}

.identify-candidate {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 10px;
  width: 100%;
  min-height: 96px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  text-align: left;
}

.identify-candidate .coin-art {
  width: 76px;
  height: 76px;
  border-radius: 14px;
}

.identify-candidate h3 {
  margin: 2px 0 0;
  color: #222;
  font-size: 16px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.identify-candidate strong {
  display: block;
  margin-top: 6px;
  color: var(--brand);
  font-size: 14px;
  line-height: 20px;
}

.identify-candidate em {
  display: inline-flex;
  margin-top: 4px;
  border-radius: 999px;
  background: #fff0f0;
  color: var(--brand);
  font-size: 11px;
  font-style: normal;
  line-height: 18px;
  padding: 0 7px;
}

.identify-candidate p {
  margin: 6px 0 0;
  color: #6a6a6a;
  font-size: 13px;
  line-height: 17px;
  overflow-wrap: anywhere;
}

.identify-crop-screen {
  min-height: 100vh;
  padding-bottom: 24px;
  touch-action: none;
}

.crop-panel {
  border-radius: 20px;
  background: #fff;
  padding: 12px;
}

.crop-stage {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 16px;
  background: #17191f;
  touch-action: none;
  user-select: none;
}

.crop-image {
  position: absolute;
  left: 50%;
  top: 50%;
  max-width: none;
  object-fit: contain;
  transform-origin: center;
  will-change: transform;
  user-select: none;
  -webkit-user-drag: none;
}

.crop-mask {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, transparent 0 38%, rgba(0, 0, 0, 0.58) 38.4% 100%);
  pointer-events: none;
}

.crop-ring {
  position: absolute;
  left: 12%;
  top: 12%;
  width: 76%;
  height: 76%;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(238, 63, 77, 0.74), 0 0 18px rgba(0, 0, 0, 0.22);
  pointer-events: none;
}

.crop-control {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 46px;
  padding: 10px 2px 0;
}

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

.crop-control input {
  width: 100%;
  accent-color: var(--brand);
}

.crop-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.crop-actions button,
.crop-file-btn {
  display: grid;
  place-items: center;
  height: 48px;
  border-radius: 8px;
  font-weight: 700;
}

.crop-file-btn {
  position: relative;
}

.crop-file-btn input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.photo-card {
  padding: 10px;
}

.detail-image-grid {
  display: grid;
  gap: 10px;
}

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

.detail-image-grid.stack,
.detail-image-grid.single {
  grid-template-columns: 1fr;
}

.detail-image-tile {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 10px;
  background: var(--gold-soft);
  padding: 0;
}

.detail-image-grid.stack .detail-image-tile {
  aspect-ratio: 16 / 10;
}

.detail-image-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.detail-image-tile span {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 12px;
  background: rgba(20, 22, 28, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 0 8px;
}

.photo-card h1 {
  margin-top: 12px;
  font-size: 22px;
  line-height: 28px;
}

.photo-card p {
  margin-top: 4px;
}

.facts-card {
  margin-top: 12px;
  padding: 8px 12px;
  box-shadow: none;
}

.fact-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  min-height: 48px;
  align-items: center;
  border-bottom: 1px solid #f0f1f4;
}

.fact-row:last-child {
  border-bottom: 0;
}

.fact-row span:first-child {
  color: var(--muted);
}

.fact-row strong {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.variant-card,
.pattern-card,
.empty-card {
  margin-top: 12px;
  padding: 14px 12px;
  box-shadow: none;
}

.variant-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.variant-head h2,
.pattern-card h2 {
  margin: 0;
  font-size: 18px;
  line-height: 24px;
}

.variant-head span {
  color: var(--brand);
  font-size: 12px;
}

.variant-hint {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.variant-row {
  display: grid;
  grid-template-columns: 36px 1fr 10px;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  border: 1px solid #eceef2;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  padding: 8px 10px;
  margin-top: 8px;
  text-align: left;
}

.variant-row:hover,
.variant-row:focus-visible,
.variant-row:active {
  border-color: var(--brand);
  background: #fff6f7;
}

.mint-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f2f5;
  color: #333;
  font-weight: 800;
}

.variant-row:hover .mint-mark,
.variant-row:focus-visible .mint-mark,
.variant-row:active .mint-mark {
  background: var(--brand);
  color: #fff;
}

.variant-row h3 {
  margin: 0;
  font-size: 14px;
  line-height: 18px;
}

.variant-more-btn {
  width: 100%;
  height: 42px;
  margin-top: 8px;
  border: 1px solid #eceef2;
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  font-weight: 700;
}

.variant-row p,
.pattern-card p,
.empty-card p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.variant-detail {
  padding-top: 76px;
}

.variant-hero-card,
.variant-info-card,
.selected-coin-card {
  width: 100%;
  border: 0;
  background: #fff;
  box-shadow: none;
}

.variant-hero-card {
  display: grid;
  gap: 10px;
  border-radius: 20px;
  padding: 10px 10px 14px;
}

.variant-image-pair {
  display: grid;
  gap: 8px;
}

.variant-image-pair.side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.variant-image-pair.stack {
  grid-template-columns: 1fr;
}

.variant-image-card {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  min-width: 0;
  width: 100%;
  aspect-ratio: 1;
  border: 0;
  border-radius: 12px;
  background: #e6d4b6;
  padding: 0;
  color: #222;
  text-align: left;
}

.variant-image-pair.stack .variant-image-card {
  aspect-ratio: 16 / 10;
}

.variant-image-photo {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: #e6d4b6;
}

.variant-image-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.variant-image-card strong {
  position: absolute;
  left: 10px;
  top: 10px;
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: 12px;
  background: rgba(20, 22, 28, 0.72);
  color: #fff;
  font-size: 12px;
  line-height: 16px;
  padding: 0 8px;
}

.variant-coin-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background:
    linear-gradient(78deg, transparent 47%, rgba(245, 230, 179, 0.9) 48%, rgba(245, 230, 179, 0.9) 58%, transparent 59%),
    radial-gradient(circle at 50% 50%, #e8cf91 0 34%, #c7a66a 35% 100%);
}

.variant-coin-placeholder span {
  position: absolute;
  bottom: 14px;
  color: #222;
  font-size: 22px;
  font-weight: 800;
  line-height: 28px;
}

.variant-hero-copy {
  display: grid;
  gap: 6px;
  padding: 0 2px;
}

.variant-hero-copy h1 {
  margin: 0;
  color: #222;
  font-size: 20px;
  line-height: 26px;
  overflow-wrap: anywhere;
}

.variant-hero-copy p {
  margin: 0;
  color: #6a6a6a;
  font-size: 14px;
  line-height: 20px;
  overflow-wrap: anywhere;
}

.variant-tags {
  display: flex;
  gap: 6px;
  min-height: 24px;
}

.variant-info-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border-radius: 14px;
  padding: 14px 12px;
}

.variant-info-card h2 {
  margin: 0;
  color: #222;
  font-size: 16px;
  line-height: 24px;
}

.variant-identification {
  border: 1px solid #ebebeb;
  border-radius: 10px;
  background: #f7f7f7;
  padding: 10px;
}

.variant-identification p {
  margin: 0;
  color: #3f3f3f;
  font-size: 13px;
  line-height: 20px;
}

.selected-coin-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border-radius: 14px;
  padding: 10px;
  color: #222;
  text-align: left;
}

.selected-thumb {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}

.selected-coin-card h3 {
  margin: 0;
  font-size: 14px;
  line-height: 20px;
}

.selected-coin-card p {
  margin: 6px 0 0;
  color: #6a6a6a;
  font-size: 13px;
  line-height: 17px;
}

.other-variants {
  border-radius: 14px;
}

.bottom-tabs,
.bottom-cta {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  background: #fff;
  border-top: 1px solid #e6e7eb;
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-tabs {
  height: calc(80px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 64px;
  border-top: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -8px 24px rgba(20, 26, 35, 0.08);
  padding: 6px 34px env(safe-area-inset-bottom);
}

.tab {
  display: flex;
  width: 46px;
  height: 46px;
  place-items: center;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  flex: 0 0 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6a6a6a;
  font-size: 11px;
  line-height: 14px;
  padding: 2px 0 0;
}

.tab.active {
  background: #fff0f0;
  color: var(--brand);
  font-weight: 400;
}

.tab > span:last-child {
  display: block;
  width: 22px;
  text-align: center;
}

.tab-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: currentColor;
}

.tab.active .tab-icon {
  width: 24px;
  height: 24px;
}

.tab-icon svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tab.active .tab-icon svg {
  width: 24px;
  height: 24px;
}

.bottom-cta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  min-height: calc(72px + env(safe-area-inset-bottom));
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}

.bottom-cta button {
  height: 48px;
  border-radius: 8px;
  font-weight: 700;
}

.ghost-btn {
  border: 1px solid #dfe1e6;
  background: #fff;
  color: var(--ink);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 50;
  transform: translateX(-50%);
  max-width: 320px;
  border-radius: 20px;
  background: rgba(20, 22, 28, 0.88);
  color: #fff;
  padding: 9px 14px;
  font-size: 13px;
}

.image-viewer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.92);
  padding: 48px 12px 36px;
}

.image-viewer figure {
  width: 100%;
  margin: 0;
  text-align: center;
}

.image-viewer img {
  max-width: 100%;
  max-height: 82vh;
  object-fit: contain;
}

.image-viewer figcaption {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
}

.viewer-close,
.viewer-nav {
  position: fixed;
  z-index: 82;
  display: grid;
  place-items: center;
  border: 0;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.viewer-close {
  top: calc(14px + env(safe-area-inset-top));
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
}

.viewer-nav {
  top: 50%;
  width: 36px;
  height: 52px;
  transform: translateY(-50%);
  border-radius: 18px;
  font-size: 34px;
}

.viewer-nav.prev {
  left: 10px;
}

.viewer-nav.next {
  right: 10px;
}

.loading {
  padding: 32px 0;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 431px) {
  body {
    background: #dfe2e8;
  }

  .mobile-shell,
  .h5-nav,
  .bottom-tabs,
  .bottom-cta {
    box-shadow: 0 0 0 1px rgba(20, 26, 35, 0.04);
  }
}
