/* ── Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
a, button, label, [role="button"] { touch-action: manipulation; }

/* ── Tokens ────────────────────────────────────────────────────────────── */
:root {
  --bg:          #0a0a0a;
  --surface:     #141414;
  --surface-2:   #1c1c1c;
  --border:      #242424;
  --border-hi:   #363636;
  --text:        #f0f0f0;
  --muted:       #4a4a4a;
  --muted-hi:    #888888;
  --gold:        #c9a227;
  --gold-bright: #f0c040;
  --gold-dim:    rgba(201, 162, 39, 0.12);
  --gold-border: rgba(201, 162, 39, 0.3);
  --font: -apple-system, 'SF Pro Text', Helvetica, sans-serif;
  --tracking: 0.08em;
  --radius: 12px;
  --radius-sm: 6px;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
body {
  font-family: var(--font);
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html {
  height: 100%;
}


/* ── Nav ────────────────────────────────────────────────────────────────── */
nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10,10,10,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10;
}

.nav-logo {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--gold-bright);
}

.nav-tabs {
  display: flex;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 3px;
}

.nav-tab {
  font: inherit;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted-hi);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  transition: background .2s, color .2s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text);
}

.nav-tab.is-active {
  background: var(--gold);
  color: #000;
  font-weight: 600;
}

/* ── Layout ─────────────────────────────────────────────────────────────── */
main {
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* ── Tab panels ─────────────────────────────────────────────────────────── */
.tab-panel { display: block; }

/* ── Header ─────────────────────────────────────────────────────────────── */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tagline {
  font-size: 11px;
  letter-spacing: var(--tracking);
  color: var(--muted-hi);
  text-transform: uppercase;
  font-weight: 400;
}

/* ── Dropzone ───────────────────────────────────────────────────────────── */
#dropzone,
#studio-dropzone {
  display: block;
  border: 1.5px dashed var(--border-hi);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--surface);
}

#dropzone:hover,
#dropzone:focus,
#dropzone.dragover,
#studio-dropzone:hover,
#studio-dropzone:focus,
#studio-dropzone.dragover {
  border-color: var(--gold);
  background: var(--gold-dim);
  outline: none;
}

.dropzone-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 5rem 2rem;
}

.dropzone-text {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: var(--tracking);
  color: var(--text);
  text-transform: uppercase;
}

.dropzone-hint {
  font-size: 10px;
  letter-spacing: var(--tracking);
  color: var(--muted-hi);
  text-transform: uppercase;
}

/* ── Preview ────────────────────────────────────────────────────────────── */
#preview,
#studio-preview {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.preview-frame {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  position: relative;
  box-shadow: 0 8px 40px rgba(201,162,39,0.1);
}

.preview-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 60%, var(--bg) 100%);
  pointer-events: none;
}

#preview-img,
#studio-preview-img {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  background: var(--surface);
}

/* ── Buttons ────────────────────────────────────────────────────────────── */
button {
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border-hi);
  padding: 0.55rem 1.25rem;
  background: transparent;
  color: var(--muted-hi);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  transition: border-color .15s, color .15s;
}

button:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  text-decoration: none;
  transition: background .15s, transform .1s;
  cursor: pointer;
}

.btn-gold:hover {
  background: var(--gold-bright);
  color: #000;
  transform: translateY(-1px);
}

.btn-primary {
  border-color: var(--gold);
  color: var(--gold);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted-hi);
  border: 1px solid var(--border-hi);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.85rem 2rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.btn-ghost:hover { border-color: var(--gold-border); color: var(--gold); }

.btn-camera {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.7rem 1.75rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  width: 100%;
}
.btn-camera:hover { background: var(--gold-dim); border-color: var(--gold); }

.camera-row {
  margin-top: 0.75rem;
}

.scan-identifies {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

/* Hide the "IDENTIFIES" chips once a scan is active */
#tab-scan:has(#preview:not([hidden])) .scan-identifies,
#tab-scan:has(#status:not([hidden])) .scan-identifies,
#tab-scan:has(#result:not([hidden])) .scan-identifies { display: none; }

.scan-identifies-label {
  font-size: 10px;
  letter-spacing: var(--tracking);
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.scan-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.scan-chip {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted-hi);
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 20px;
  padding: 0.35rem 0.75rem;
}

#camera-stream {
  width: 100%;
  border-radius: 12px;
  margin-top: 1rem;
  background: #000;
  max-height: 60vh;
  object-fit: cover;
}

#camera-controls {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  justify-content: center;
}

/* ── Status / Spinner ───────────────────────────────────────────────────── */
#status,
#studio-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 2.5rem;
  color: var(--muted-hi);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--border-hi);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  flex-shrink: 0;
}

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

/* ── Result section ─────────────────────────────────────────────────────── */
#result,
#studio-result {
  margin-top: 2.5rem;
}

/* ── ID Card ────────────────────────────────────────────────────────────── */
.id-card {
  background: linear-gradient(160deg, #1c1408 0%, #110e06 50%, #0a0a0a 100%);
  border: 1px solid rgba(201,162,39,0.18);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 40px rgba(201,162,39,0.06);
}

.id-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chip {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-hi);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.25rem 0.6rem;
  border-radius: 99px;
}

.chip.confidence-high   { color: var(--gold); border-color: var(--gold-border); background: var(--gold-dim); }
.chip.confidence-medium { color: var(--muted-hi); }
.chip.confidence-low    { color: var(--muted); }

.id-name {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1.25rem;
}

/* ── Deal badge hero (like "Collector's Choice") ────────────────────────── */
.deal-badge-hero {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  border: 1px solid var(--gold-border);
  background: var(--gold-dim);
  color: var(--gold-bright);
}

.deal-badge-hero.verdict-excellent {
  background: var(--gold-dim);
  border-color: var(--gold-border);
  color: var(--gold-bright);
}
.deal-badge-hero.verdict-good {
  background: rgba(255,255,255,0.04);
  border-color: var(--border-hi);
  color: var(--muted-hi);
}
.deal-badge-hero.verdict-fair {
  background: rgba(255,255,255,0.03);
  border-color: var(--border);
  color: var(--muted-hi);
}
.deal-badge-hero.verdict-overpriced {
  background: rgba(255,255,255,0.02);
  border-color: var(--border);
  color: var(--muted);
}

/* ── Sell / Hold verdict ────────────────────────────────────────────────── */
.sell-verdict {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  margin-bottom: 1.25rem;
}
.sell-verdict--sell { border-color: rgba(200,168,75,0.4); background: rgba(200,168,75,0.06); }
.sell-verdict-arrow {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  min-width: 1.5rem;
  text-align: center;
}
.trend-up   { color: #4caf7d; }
.trend-down { color: #e07070; }
.trend-flat { color: var(--muted-hi); }
.sell-verdict-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.sell-verdict-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg);
}
.sell-verdict-detail {
  font-size: 10px;
  color: var(--muted-hi);
  letter-spacing: 0.04em;
}

/* ── Value display (like "$960" in the coin app) ────────────────────────── */
.value-display {
  margin-bottom: 1.75rem;
}

.value-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-hi);
  margin-bottom: 0.4rem;
}

.value-main {
  font-size: 56px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--gold-bright);
}

.value-sub {
  font-size: 12px;
  color: var(--muted-hi);
  margin-top: 0.5rem;
  letter-spacing: 0.02em;
}

.value-sub .save {
  color: var(--gold-bright);
  font-weight: 600;
}

/* ── CTA button row ─────────────────────────────────────────────────────── */
.id-cta-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
  margin-bottom: 1.75rem;
}

.id-cta-row .btn-gold {
  width: 100%;
  justify-content: center;
  font-size: 14px;
  padding: 1rem 2rem;
  min-height: 54px;
  border-radius: 14px;
}

/* ── Description ────────────────────────────────────────────────────────── */
.id-desc {
  color: var(--muted-hi);
  line-height: 1.65;
  font-size: 13px;
  margin-bottom: 1.5rem;
}

/* ── Pros / Cons ────────────────────────────────────────────────────────── */
.pros-cons {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
}

.pros-cons-col { flex: 1; min-width: 160px; }

.pros-cons-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-hi);
  margin-bottom: 0.6rem;
}

.pros-cons-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.pros-cons-list li {
  font-size: 11px;
  color: var(--muted-hi);
  line-height: 1.5;
  padding-left: 1em;
  position: relative;
}

.pros-cons-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--gold);
}

/* ── Listings section header ────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.section-heading {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  color: var(--text);
}

.section-sub {
  font-size: 10px;
  letter-spacing: var(--tracking);
  color: var(--muted-hi);
  text-transform: uppercase;
}

/* ── Price stats bar ────────────────────────────────────────────────────── */
.price-stats-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted-hi);
  text-transform: uppercase;
}

.price-stats-bar strong {
  color: var(--text);
  font-weight: 600;
}

.price-stats-bar--dim { color: var(--muted); }

.price-stats-icon { display: none; }

.stats-divider { color: var(--border-hi); }

/* ── Marketplace table ──────────────────────────────────────────────────── */
.marketplace-table {
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.marketplace-table-row {
  display: flex;
  align-items: center;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  background: var(--surface);
}

.marketplace-table-row:last-child { border-bottom: none; }

.marketplace-table-row.is-best { background: var(--gold-dim); }

.marketplace-source {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-hi);
  width: 60px;
  flex-shrink: 0;
}

.marketplace-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.marketplace-count {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

.marketplace-link {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.marketplace-link:hover { color: var(--gold-bright); }

.marketplace-best-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  padding: 2px 6px;
  border-radius: 99px;
}

/* ── Listings grid ───────────────────────────────────────────────────────── */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.listing {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: background .15s;
}

.listing:hover { background: var(--surface-2); }

.listing-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}

.listing-photo--empty {
  background: var(--surface-2);
}

/* ── Listings skeleton ──────────────────────────────────────────────────── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-bar,
.skeleton-card {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.4s infinite linear;
  border-radius: 8px;
}

.skeleton-bar {
  height: 18px;
  width: 180px;
  margin-bottom: 1rem;
}

.listings-skeleton {
  margin-top: 1.5rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
}

.skeleton-card {
  aspect-ratio: 0.85;
  border-radius: 0;
}

.listing--search {
  display: flex;
  align-items: stretch;
  min-height: 72px;
}

.listing-search-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  padding: 1rem 1.1rem;
  width: 100%;
  border: 1px dashed var(--gold-border);
  border-radius: inherit;
}

.listing-search-store {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold);
  text-transform: uppercase;
}

.listing-search-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted-hi);
  text-transform: uppercase;
}

.listing-body {
  padding: 0.75rem 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.listing-title {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.4;
  color: var(--muted-hi);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-price-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.listing-price {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}

.listing-condition {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.deal-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 99px;
  white-space: nowrap;
}

.deal-badge.verdict-excellent {
  background: var(--gold-dim);
  color: var(--gold-bright);
  border: 1px solid var(--gold-border);
}
.deal-badge.verdict-good {
  background: rgba(255,255,255,0.05);
  color: var(--muted-hi);
  border: 1px solid var(--border-hi);
}
.deal-badge.verdict-fair {
  color: var(--muted);
  border: 1px solid var(--border);
}
.deal-badge.verdict-overpriced {
  color: var(--muted);
  border: 1px solid var(--border);
}

.source-badge {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Alternatives ───────────────────────────────────────────────────────── */
.alternatives-section {
  margin-top: 2rem;
}

.alternatives-header {
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alt-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.alt-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}

.alt-name {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.alt-price-stat {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--muted-hi);
  text-transform: uppercase;
}

.alt-tier-badge {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--border);
  color: var(--muted-hi);
}

.alt-tier-badge.tier-cheaper {
  background: var(--gold-dim);
  color: var(--gold-bright);
  border-color: var(--gold-border);
}

.alt-reason {
  font-size: 11px;
  color: var(--muted-hi);
  margin-bottom: 0.75rem;
  line-height: 1.55;
}

.alt-pros-cons {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.alt-pros-cons-col { flex: 1; min-width: 140px; }

.alt-pros-cons-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-hi);
  margin-bottom: 0.35rem;
}

.alt-pros-cons-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.alt-pros-cons-list li {
  font-size: 10px;
  color: var(--muted-hi);
  line-height: 1.5;
  padding-left: 1em;
  position: relative;
}

.alt-pros-cons-list li::before {
  content: "·";
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* ── Studio Builder ─────────────────────────────────────────────────────── */
.studio-header-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
}

.studio-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.studio-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-hi);
  margin-bottom: 0.5rem;
}

.studio-value {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.studio-desc {
  font-size: 13px;
  color: var(--muted-hi);
  line-height: 1.65;
  max-width: 520px;
}

.studio-count-chip {
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
  border: 1px solid var(--gold-border);
  background: var(--gold-dim);
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  flex-shrink: 0;
  align-self: flex-start;
  font-weight: 600;
}

.studio-gear-list { margin-bottom: 2rem; }

.studio-gear-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.studio-gear-item:first-child { border-top: 1px solid var(--border); }

.studio-item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.studio-item-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.3rem;
}

.studio-item-category {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-hi);
}

.studio-item-confidence {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.studio-item-desc {
  font-size: 11px;
  color: var(--muted-hi);
  line-height: 1.5;
}

.studio-item-value { text-align: right; flex-shrink: 0; }

.studio-item-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.studio-item-listings {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
  justify-content: flex-end;
}

.studio-item-listing-link {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
  border: 1px solid var(--gold-border);
  padding: 2px 6px;
  border-radius: 99px;
  background: var(--gold-dim);
}

.studio-item-listing-link:hover { color: var(--gold-bright); }

.studio-recreate-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.studio-recreate-btn { margin-top: 1rem; }

/* ── Recreation Tiers ───────────────────────────────────────────────────── */
.recreation-section { margin-top: 2rem; }

.recreation-tier {
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.recreation-tier-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

.recreation-tier-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}

.recreation-tier-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.recreation-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}

.recreation-item-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem 1rem;
  align-items: start;
}

.recreation-item-header .recreation-original,
.recreation-item-header .recreation-replacement,
.recreation-item-header .recreation-reason {
  grid-column: 1;
}

.recreation-item-header .recreation-price {
  grid-column: 2;
  grid-row: 2;
}

.recreation-listings {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.recreation-listing-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  transition: border-color .15s;
}
.recreation-listing-link:hover { border-color: var(--gold-border); }

.rec-listing-source {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold);
  text-transform: uppercase;
  min-width: 60px;
}

.rec-listing-price {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.rec-listing-cta {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted-hi);
  text-transform: uppercase;
  margin-left: auto;
}

.recreation-item:last-child { border-bottom: none; }

.recreation-original {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.recreation-replacement {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.recreation-reason {
  font-size: 10px;
  color: var(--muted-hi);
  line-height: 1.5;
}

.recreation-price {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: right;
  flex-shrink: 0;
}

/* ── Recent Scans ───────────────────────────────────────────────────────── */
.recent-empty {
  padding: 4rem 0;
  text-align: center;
  color: var(--muted-hi);
  font-size: 11px;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.recent-card {
  background: var(--surface);
  cursor: pointer;
  transition: background .15s;
  text-align: left;
  border: none;
  padding: 0;
}

.recent-card:hover { background: var(--surface-2); border-color: transparent; }

.recent-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--surface-2);
  display: block;
}

.recent-card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.recent-card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-card-category {
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-hi);
}

.recent-card-price {
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
}

.recent-card-date {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

/* ── Notice ─────────────────────────────────────────────────────────────── */
.notice {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted-hi);
  text-transform: uppercase;
  background: var(--surface);
}

/* ── Error ──────────────────────────────────────────────────────────────── */
.error {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border-hi);
  border-radius: var(--radius-sm);
  color: var(--muted-hi);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--surface);
}

/* ── Footer ─────────────────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 2rem;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  border-top: 1px solid var(--border);
}

/* ── Mobile optimisations ───────────────────────────────────────────────── */
@media (max-width: 600px) {

  * { -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
  input, textarea, select { -webkit-touch-callout: default; }

  /* Push content below Dynamic Island / status bar */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Nav — stack logo above tabs */
  nav {
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 1rem 0.5rem;
    gap: 0.5rem;
  }
  .nav-tabs { width: 100%; justify-content: stretch; }
  .nav-tab { flex: 1; font-size: 9px; padding: 0.4rem 0.25rem; letter-spacing: 0.04em; text-align: center; }

  /* Main — normal flow, no fixed positioning */
  main { padding: 1.5rem 1rem 2rem; }

  /* Typography */
  .value-main { font-size: 40px; }
  .id-name { font-size: 22px; line-height: 1.2; }
  .tagline { font-size: 10px; }

  /* Dropzone */
  .dropzone-inner { padding: 3.5rem 1.5rem; }
  .dropzone-text { font-size: 12px; }

  /* Buttons */
  .btn-gold, .btn-ghost, .btn-camera { width: 100%; min-height: 52px; font-size: 13px; justify-content: center; }
  button { min-height: 44px; }

  /* Listings */
  .listings-grid { grid-template-columns: 1fr 1fr; }

  /* ID card */
  .id-card { padding: 1.25rem 1rem; }
  .id-cta-row { flex-direction: column; align-items: stretch; gap: 0.6rem; }

  /* Marketplace table */
  .marketplace-table { font-size: 11px; }
  .marketplace-source { min-width: 70px; }

  /* Alternatives */
  .alt-block { padding: 1rem; }

  /* Camera */
  #camera-stream { max-height: 50vh; }
  #camera-controls { flex-direction: column; }
  #camera-controls .btn-gold, #camera-controls .btn-ghost { width: 100%; }

  .deal-badge-hero { font-size: 11px; padding: 0.45rem 1rem; }
  footer { display: none; }
}

/* ── Onboarding overlay ─────────────────────────────────────────────────── */
.onboarding {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 0) 0 env(safe-area-inset-bottom, 0);
  overflow: hidden;
}

.ob-slides {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.ob-slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem 1rem;
  text-align: center;
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.ob-slide.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.ob-slide.is-exiting {
  opacity: 0;
  transform: translateX(-60px);
}

.ob-icon {
  width: 96px;
  height: 96px;
  margin-bottom: 2.5rem;
}

.ob-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 24px rgba(201, 162, 39, 0.25));
}

.ob-headline {
  font-size: clamp(2rem, 8vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 1.25rem;
}

.ob-headline span {
  color: var(--gold-bright);
}

.ob-body {
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-hi);
  max-width: 300px;
}

.ob-cta {
  margin-top: 2.5rem;
  background: var(--gold);
  color: #000;
  border: none;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 1rem 3rem;
  border-radius: 99px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  width: 100%;
  max-width: 280px;
}

.ob-cta:active {
  background: var(--gold-bright);
  transform: scale(0.97);
}

.ob-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 2rem 2rem;
}

.ob-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.ob-dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--border-hi);
  transition: width 0.3s ease, background 0.3s ease;
}

.ob-dot.is-active {
  width: 20px;
  background: var(--gold);
}

.ob-next {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  padding: 0.6rem 1.5rem;
  border-radius: 99px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.ob-next:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.ob-skip {
  position: absolute;
  top: max(1.25rem, env(safe-area-inset-top, 1.25rem));
  right: 1.5rem;
  background: transparent;
  border: none;
  color: var(--muted-hi);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0.5rem;
}

.ob-skip:hover {
  color: var(--text);
}
