*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:   #16a34a;
  --yellow:  #d97706;
  --orange:  #ea580c;
  --red:     #dc2626;
  --gray-50: #f8fafc;
  --gray-100:#f1f5f9;
  --gray-200:#e2e8f0;
  --gray-400:#94a3b8;
  --gray-500:#64748b;
  --gray-700:#334155;
  --gray-900:#0f172a;
  --radius:  12px;
  --shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  min-height: 100dvh;
  padding-bottom: env(safe-area-inset-bottom, 2rem);
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ─────────────────────────────────────────────── */
.header {
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  padding: .75rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-logo { font-weight: 800; font-size: 1.1rem; letter-spacing: -.5px; color: var(--gray-900); text-decoration: none; }
.header-logo span { color: var(--green); }
.tm { font-size: .5em; vertical-align: super; font-weight: 400; letter-spacing: 0; }
.header-tag { font-size: .7rem; color: var(--gray-500); background: var(--gray-100); padding: 2px 7px; border-radius: 99px; }
.lang-switcher { margin-left: auto; }
.lang-select {
  font-size: .78rem; font-weight: 600; font-family: inherit;
  border: 1.5px solid var(--gray-200); border-radius: 8px;
  padding: .3rem .5rem; background: var(--gray-50);
  color: var(--gray-700); cursor: pointer;
  min-height: 36px; /* comfortable touch target */
}

/* ── Page wrapper ────────────────────────────────────────── */
.page { max-width: 480px; margin: 0 auto; padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }

/* ── Card ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}
.card-title {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: .75rem;
}

/* ── Status banner ───────────────────────────────────────── */
.status-banner {
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: .875rem;
}
.status-banner.authentic  { background: #f0fdf4; border: 1.5px solid #bbf7d0; }
.status-banner.claimed    { background: #fef9c3; border: 1.5px solid #fde047; }
.status-banner.inactive   { background: #f1f5f9; border: 1.5px solid var(--gray-200); }
.status-banner.invalid    { background: #fef2f2; border: 1.5px solid #fecaca; }

.status-icon { font-size: 2rem; line-height: 1; flex-shrink: 0; }
.status-text h2 { font-size: 1rem; font-weight: 700; margin-bottom: .2rem; }
.status-text p  { font-size: .82rem; color: var(--gray-500); line-height: 1.4; }

/* ── Trust scores ────────────────────────────────────────── */
.scores-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

.score-box { background: var(--gray-50); border-radius: 10px; padding: 1rem; text-align: center; }
.score-box .score-label { font-size: .68rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--gray-500); margin-bottom: .5rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.score-circle {
  width: 72px; height: 72px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0 auto .5rem;
  border: 3px solid currentColor;
}
.score-circle .num  { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.score-circle .denom { font-size: .65rem; color: var(--gray-400); }

.score-circle.green  { color: var(--green); }
.score-circle.yellow { color: var(--yellow); }
.score-circle.orange { color: var(--orange); }
.score-circle.red    { color: var(--red); }

.score-word { font-size: .78rem; font-weight: 600; white-space: nowrap; }
.score-word.green  { color: var(--green); }
.score-word.yellow { color: var(--yellow); }
.score-word.orange { color: var(--orange); }
.score-word.red    { color: var(--red); }

/* PIPE bar */
.pipe-bar-wrap { background: var(--gray-200); border-radius: 99px; height: 8px; margin: .5rem 0 .25rem; overflow: hidden; }
.pipe-bar { height: 100%; border-radius: 99px; transition: width .6s ease; }
.pipe-bar.green  { background: var(--green); }
.pipe-bar.yellow { background: var(--yellow); }
.pipe-bar.orange { background: var(--orange); }
.pipe-bar.red    { background: var(--red); }
.pipe-pct { font-size: .75rem; color: var(--gray-500); }

/* ── Supply chain timeline ───────────────────────────────── */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; align-items: flex-start; gap: .75rem; position: relative; }
.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 9px; top: 22px;
  width: 2px; height: calc(100% + 2px);
  background: var(--gray-200);
}
.timeline-dot {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  margin-top: 2px; border: 2px solid var(--gray-200);
  background: #fff; display: flex; align-items: center; justify-content: center;
}
.timeline-dot.done { background: var(--green); border-color: var(--green); }
.timeline-dot.done::after { content: ''; width: 6px; height: 6px; background: #fff; border-radius: 50%; }
.timeline-body { padding-bottom: 1rem; flex: 1; }
.timeline-stage { font-size: .82rem; font-weight: 600; text-transform: capitalize; }
.timeline-meta  { font-size: .75rem; color: var(--gray-500); margin-top: .1rem; }
.timeline-loc-badge {
  display: inline-block; font-size: .65rem; padding: 1px 6px;
  border-radius: 99px; margin-left: .35rem; font-weight: 600;
}
.timeline-loc-badge.gps  { background: #dcfce7; color: var(--green); }
.timeline-loc-badge.ip   { background: #fef9c3; color: #854d0e; }
.timeline-loc-badge.none { background: var(--gray-100); color: var(--gray-500); }

/* ── Product details ─────────────────────────────────────── */
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem .75rem; }
.detail-item {}
.detail-key   { font-size: .7rem; color: var(--gray-500); font-weight: 500; margin-bottom: .1rem; }
.detail-val   { font-size: .88rem; font-weight: 600; }

/* ── Manufacturer ────────────────────────────────────────── */
.manufacturer { display: flex; align-items: center; gap: .75rem; }
.mfr-avatar {
  width: 40px; height: 40px; border-radius: 10px; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
}
.mfr-name  { font-weight: 600; font-size: .9rem; }
.mfr-since { font-size: .74rem; color: var(--gray-500); }

/* ── Warnings ────────────────────────────────────────────── */
.warning-list { display: flex; flex-direction: column; gap: .5rem; }
.warning-item {
  border-radius: 8px; padding: .7rem .875rem;
  font-size: .8rem; line-height: 1.45;
  display: flex; gap: .5rem; align-items: flex-start;
}
.warning-item.HIGH, .warning-item.CRITICAL { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.warning-item.MEDIUM { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.warning-icon { font-size: 1rem; flex-shrink: 0; }

/* ── Location quality notice ─────────────────────────────── */
.loc-notice {
  background: #fefce8; border: 1px solid #fde047;
  border-radius: 8px; padding: .6rem .875rem;
  font-size: .78rem; color: #713f12; line-height: 1.4;
  display: flex; gap: .5rem; align-items: flex-start;
}

/* ── Burn button ─────────────────────────────────────────── */
.burn-section { display: flex; flex-direction: column; gap: .75rem; }
.btn-burn {
  width: 100%; padding: .9rem;
  background: var(--green); color: #fff;
  border: none; border-radius: 10px;
  font-size: .95rem; font-weight: 700; cursor: pointer;
  transition: opacity .15s, transform .1s;
}
.btn-burn:hover  { opacity: .92; }
.btn-burn:active { transform: scale(.98); }
.btn-burn:disabled { background: var(--gray-400); cursor: not-allowed; transform: none; opacity: 1; }
.burn-note { font-size: .74rem; color: var(--gray-500); text-align: center; line-height: 1.45; }

/* ── Success state ───────────────────────────────────────── */
.burn-success {
  text-align: center; padding: .5rem;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.burn-success .tick { font-size: 2.5rem; }
.burn-success h3 { font-size: 1rem; font-weight: 700; }
.burn-success p { font-size: .8rem; color: var(--gray-500); }

/* ── Disclaimer ──────────────────────────────────────────── */
.disclaimer {
  font-size: .72rem; color: var(--gray-400);
  text-align: center; line-height: 1.5; padding: 0 .5rem;
}

/* ── Loading / skeleton ──────────────────────────────────── */
.loading { text-align: center; padding: 3rem 1rem; color: var(--gray-400); }
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid var(--gray-200);
  border-top-color: var(--green); border-radius: 50%;
  animation: spin .7s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
