/* ═══════════════════════════════════════════════════════════════════════════
   Pricyfy — consumer app UI
   Trust-utility design system: one confident brand blue, deep navy, neutral
   grays, and green used ONLY to signal the lowest price. Flat surfaces,
   hairline borders, restrained shadows. App-shell layout: app bar · scrollable
   views · bottom tab bar. Phone-width frame on desktop, full-screen on mobile.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  /* Neutrals */
  --ink: #0f1b2d;
  --ink-2: #243244;
  --muted: #5a6678;
  --faint: #8b95a4;
  --line: #e4e8ef;
  --line-soft: #eef1f6;
  --page: #f4f6fa;
  --paper: #ffffff;
  --panel: #f3f6fb;

  /* Brand — confident blue → deep navy */
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-deep: #0b1f4d;
  --brand-soft: #eaf1ff;
  --brand-line: #cfe0fe;

  /* Semantic — green means "lowest price", nothing else */
  --pos: #167a45;
  --pos-soft: #e7f4ec;
  --pos-line: #bfe3cd;

  --warn: #9a6700;
  --warn-soft: #fdf3da;
  --warn-line: #f2e0b0;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 16px;

  /* Restrained, mostly hairline. No floaty drop shadows. */
  --shadow-card: 0 1px 2px rgba(15, 27, 45, 0.05);
  --shadow-raise: 0 4px 16px rgba(15, 27, 45, 0.08);
  --shadow-pop: 0 12px 30px rgba(15, 27, 45, 0.14);

  --appbar-h: 56px;
  --tabbar-h: 64px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
ol, ul { margin: 0; }

/* Language toggling */
.lang-en { display: none; }
body[data-lang="en"] .lang-sv { display: none; }
body[data-lang="en"] .lang-en { display: inline; }

.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;
}

/* ── App shell ──────────────────────────────────────────────────────────── */
.app {
  position: relative;
  width: min(100%, 460px);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--page);
  overflow: hidden;
}

@media (min-width: 600px) {
  body { background: #e9edf3; }
  .app {
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border-radius: 24px;
    box-shadow: 0 1px 0 rgba(15, 27, 45, 0.04), 0 24px 60px rgba(15, 27, 45, 0.12);
    border: 1px solid var(--line);
  }
}

/* App bar — solid, hairline, no blur */
.appbar {
  flex: 0 0 auto;
  height: calc(var(--appbar-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-name { font-size: 19px; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; display: block; flex: 0 0 auto; }

.appbar-actions { display: flex; align-items: center; gap: 8px; }

/* Region segmented control */
.language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.language-switch button {
  min-width: 42px; min-height: 30px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px; font-weight: 700;
  transition: background .15s, color .15s;
}
.language-switch button.active { background: var(--brand); color: #fff; }

.install-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 700;
  transition: background .15s;
}
.install-btn:hover { background: var(--brand-strong); }

/* Scroll area */
.app-main {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  position: relative;
}

/* Views */
.view {
  padding: 20px 16px calc(var(--tabbar-h) + var(--safe-bottom) + 24px);
  animation: viewIn 220ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.view[hidden] { display: none; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Bottom tab bar — solid, hairline */
.tabbar {
  flex: 0 0 auto;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--paper);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tab {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 4px;
  color: var(--faint);
  font-size: 11px; font-weight: 650;
  transition: color .15s;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--brand); }
.tab:active { transform: scale(0.94); }

/* Center scan tab — raised, filled brand */
.tab-scan { position: relative; }
.tab-scan-ring {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  margin-top: -16px; margin-bottom: 2px;
  border-radius: 14px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}
.tab-scan-ring svg { width: 23px; height: 23px; }
.tab-scan.active .tab-scan-ring { background: var(--brand-strong); }
.tab-scan:active .tab-scan-ring { transform: scale(0.93); }

/* ── Home view — scan-first hero ───────────────────────────────────────── */
.scan-hero {
  margin: 0 -4px 0;
  padding: 28px 20px 24px;
  border-radius: var(--radius-lg);
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 72%);
  box-shadow: var(--shadow-raise);
}
.scan-hero-visual { display: flex; justify-content: center; margin-bottom: 18px; }
.scan-hero-frame {
  position: relative;
  display: grid; place-items: center;
  width: 112px; height: 112px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.scan-hero-corner {
  position: absolute; width: 22px; height: 22px;
  border-color: rgba(255, 255, 255, 0.9); border-style: solid;
}
.scan-hero-tl { top: 10px; left: 10px; border-width: 3px 0 0 3px; border-radius: 6px 0 0 0; }
.scan-hero-tr { top: 10px; right: 10px; border-width: 3px 3px 0 0; border-radius: 0 6px 0 0; }
.scan-hero-bl { bottom: 10px; left: 10px; border-width: 0 0 3px 3px; border-radius: 0 0 0 6px; }
.scan-hero-br { bottom: 10px; right: 10px; border-width: 0 3px 3px 0; border-radius: 0 0 6px 0; }
.scan-hero-icon { width: 44px; height: 44px; color: #fff; }
.scan-hero-title {
  margin: 0;
  font-size: 28px; font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.08;
}
.scan-hero-lead {
  margin: 10px auto 0;
  max-width: 34ch;
  font-size: 14.5px; line-height: 1.5;
  color: rgba(234, 241, 255, 0.88);
}
.scan-hero-actions {
  display: grid; gap: 10px;
  margin-top: 22px;
}
.scan-hero-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 54px;
  border-radius: 13px;
  font-size: 16px; font-weight: 750;
  transition: transform .12s, background .15s;
}
.scan-hero-btn svg { width: 22px; height: 22px; flex: 0 0 auto; }
.scan-hero-btn:active { transform: scale(0.98); }
.scan-hero-btn--primary {
  background: #fff; color: var(--brand-deep);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.scan-hero-btn--primary:hover { background: #f8faff; }
.scan-hero-btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.scan-hero-btn--secondary:hover { background: rgba(255, 255, 255, 0.18); }

.home-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 22px 2px 14px;
  color: var(--faint);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
}
.home-divider::before,
.home-divider::after {
  content: ""; flex: 1 1 auto; height: 1px; background: var(--line);
}

/* Floating scan button — always reachable on home */
.scan-fab {
  position: fixed;
  right: max(16px, calc(50% - 214px));
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  z-index: 25;
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 52px; padding: 0 18px 0 14px;
  border-radius: 999px;
  background: var(--brand); color: #fff;
  font-size: 14px; font-weight: 750;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.42);
  transition: transform .12s, background .15s;
}
.scan-fab svg { width: 22px; height: 22px; }
.scan-fab:active { transform: scale(0.96); }
.scan-fab:hover { background: var(--brand-strong); }
.scan-fab[hidden] { display: none; }
@media (min-width: 600px) {
  .scan-fab { right: calc(50% - 214px); }
}

/* Search — secondary */
.home-search {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  margin-top: 0;
  padding: 6px 6px 6px 14px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  transition: border-color .15s, box-shadow .15s;
}
.home-search:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.home-search-icon { flex: 0 0 auto; display: grid; place-items: center; color: var(--faint); }
.home-search input {
  flex: 1 1 auto; min-width: 0;
  border: 0; outline: none; background: none;
  font-size: 15px; padding: 12px 0;
}
.home-search input::placeholder { color: var(--faint); }
.home-search-btn {
  flex: 0 0 auto;
  min-height: 40px; padding: 0 18px;
  border-radius: 10px;
  background: var(--brand); color: #fff;
  font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s;
}
.home-search-btn:hover { background: var(--brand-strong); }
.home-search-btn:active { transform: scale(0.96); }

/* Type-ahead suggestions */
.suggestions {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  z-index: 40;
  padding: 6px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-pop);
}
.suggestions[hidden] { display: none; }
.suggestion {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 10px;
  border-radius: var(--radius-sm);
}
.suggestion:hover, .suggestion.active { background: var(--panel); }
.suggestion-mark {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
}
.suggestion-mark svg { width: 16px; height: 16px; }
.suggestion-text { min-width: 0; }
.suggestion-name { display: block; font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-cat { display: block; font-size: 12px; color: var(--muted); }

.search-status {
  margin: 10px 2px 0;
  text-align: center;
  font-size: 13px; font-weight: 600;
  color: var(--brand);
}

/* Home sections */
.home-section { margin-top: 26px; }
.home-section-label {
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 2px 11px;
  color: var(--muted);
  font-size: 12px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase;
}
.link-btn { color: var(--brand); font-size: 12px; font-weight: 700; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px; font-weight: 600;
  transition: border-color .12s, background .12s;
}
.chip:active { transform: scale(0.96); }
.chip:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.chip .chip-brand { color: var(--brand); font-weight: 750; }

.recent-list { display: grid; gap: 8px; }
.recent-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
}
.recent-item:active { transform: scale(0.99); }
.recent-item svg { width: 17px; height: 17px; color: var(--faint); flex: 0 0 auto; }
.recent-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item .recent-go { margin-left: auto; color: var(--faint); }

.trust-row {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 28px; padding: 0 2px;
}
.trust-row span {
  display: inline-flex; align-items: center; gap: 7px;
  color: var(--ink-2); font-size: 13px; font-weight: 600;
}
.trust-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); }

/* ── Results view ───────────────────────────────────────────────────────── */
.back-button {
  display: inline-flex; align-items: center; gap: 4px;
  min-height: 38px; margin-bottom: 14px;
  color: var(--ink-2); font-weight: 700; font-size: 14px;
}
.back-button:active { transform: scale(0.97); }

.results-topline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 0 12px;
  color: var(--muted); font-size: 12px; font-weight: 650;
}

.product-card {
  display: grid; grid-template-columns: 66px 1fr; gap: 14px; align-items: center;
  padding: 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.product-image, .product-symbol {
  width: 66px; height: 66px; border-radius: 12px;
}
.product-image { object-fit: cover; background: var(--panel); }
.product-symbol {
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-family: ui-monospace, Menlo, monospace; font-size: 14px; font-weight: 800;
}
.product-name { margin: 0 0 5px; font-size: 17px; line-height: 1.2; font-weight: 750; }
.meta, .ean, .timestamp, .retailer-shipping, .data-disclaimer { color: var(--muted); }
.meta { margin: 0 0 6px; font-size: 13px; }
.ean { margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: 11px; }

.insight-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.insight-card {
  min-height: 78px; padding: 12px 11px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
}
.insight-card.strong { border-color: var(--pos-line); background: var(--pos-soft); }
.insight-card.strong strong { color: var(--pos); }
.insight-card span { color: var(--muted); font-size: 11px; font-weight: 700; }
.insight-card strong { font-size: 16px; font-weight: 800; }

.section-label {
  margin: 24px 2px 10px; color: var(--muted);
  font-size: 11px; font-weight: 750; letter-spacing: 0.07em; text-transform: uppercase;
}

.price-list { display: grid; gap: 9px; }
.retailer-card {
  width: 100%; padding: 14px; text-align: left;
  display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform .12s, border-color .12s;
}
.retailer-card:active { transform: scale(0.99); }
.retailer-card:hover { border-color: var(--brand-line); }
.retailer-card::after {
  content: "›"; grid-column: 2 / 3; justify-self: end;
  color: var(--faint); font-size: 22px; font-weight: 700; line-height: 1;
}
.retailer-card.best { border-color: var(--pos-line); background: var(--pos-soft); }
.retailer-name { min-width: 0; display: flex; align-items: center; gap: 8px; font-weight: 750; }
.badge {
  min-height: 21px; display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--pos); color: #fff;
  padding: 0 9px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.price-block { text-align: right; grid-row: span 2; }
.price { display: block; white-space: nowrap; font-size: 19px; font-weight: 800; }
.retailer-card.best .price { color: var(--pos); }
.score { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 650; }
.retailer-shipping { grid-column: 1 / 2; font-size: 13px; }
.retailer-meta {
  grid-column: 1 / 3; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px;
}
.store-rating { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); font-weight: 700; }
.stars { display: inline-flex; gap: 1px; color: #cfd6e0; font-size: 12px; }
.stars .filled { color: var(--warn); }

.timestamp, .data-disclaimer { margin: 10px 0 0; font-size: 11px; line-height: 1.45; }
.affiliate-disclosure-inline { margin: 6px 0 0; font-size: 11px; line-height: 1.4; color: var(--muted); }

.bottom-actions { display: grid; gap: 10px; margin-top: 18px; }

/* Warnings / banners */
.stale-warning {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px; padding: 11px 14px;
  border: 1px solid var(--warn-line); border-radius: var(--radius);
  background: var(--warn-soft); color: #6b4a00;
  font-size: 13px; font-weight: 600; line-height: 1.45;
}
.savings-banner {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--pos-soft); color: var(--pos);
  border: 1px solid var(--pos-line);
  font-size: 12.5px; font-weight: 700;
}
.ean-miss-banner {
  padding: 10px 14px; margin-bottom: 10px;
  background: var(--warn-soft); color: #6b4a00;
  border: 1px solid var(--warn-line); border-radius: var(--radius);
  font-size: 13px; font-weight: 600;
}

/* Empty / missing */
.missing-state {
  min-height: 56vh; display: flex; flex-direction: column;
  justify-content: center; align-items: center; text-align: center;
}
.missing-icon {
  width: 64px; height: 64px; margin: 0 auto 16px; border-radius: var(--radius);
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-size: 30px; font-weight: 800;
}
.missing-state h1 { margin: 0 0 8px; font-size: 22px; }
.missing-state p { margin: 0 0 20px; color: var(--muted); max-width: 34ch; }

/* In-app loading */
.loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 300px; color: var(--muted); font-size: 15px; font-weight: 600;
}
.loading-state::before {
  content: ""; width: 32px; height: 32px;
  border: 3px solid var(--brand-soft); border-top-color: var(--brand);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}

/* ── Summary view ───────────────────────────────────────────────────────── */
.summary-hero {
  margin: -20px -16px 16px;
  padding: 30px 20px 26px;
  border-radius: 0 0 20px 20px;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand-deep));
  color: #fff;
}
.hero-label, .card-label {
  margin: 0 0 10px; color: rgba(226, 235, 252, 0.85);
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.summary-hero h1 { margin: 0; color: #fff; font-size: 50px; line-height: 0.98; font-weight: 800; }
.summary-hero p { margin: 10px 0 8px; color: rgba(235, 241, 252, 0.92); }
.summary-hero span { color: rgba(226, 235, 252, 0.78); font-size: 13px; }
.summary-body { display: grid; gap: 14px; }
.summary-card {
  padding: 16px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.card-label { color: var(--muted); }
.price-table { display: grid; border-top: 1px solid var(--line); }
.price-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.price-row span { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 650; }
.price-row strong { white-space: nowrap; }
.price-row.best strong { color: var(--pos); }

/* ── About / settings view ─────────────────────────────────────────────── */
.about-title { margin: 4px 2px 6px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.about-lead { margin: 0 2px 18px; color: var(--muted); font-size: 14.5px; line-height: 1.55; }
.about-card {
  padding: 16px; margin-bottom: 14px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.about-card-label {
  margin: 0 0 12px; color: var(--muted);
  font-size: 11px; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase;
}
.market-options { display: grid; gap: 8px; }
.market-option {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--panel);
  transition: border-color .15s, background .15s;
}
.market-option .market-flag { font-size: 24px; line-height: 1; }
.market-text { display: flex; flex-direction: column; }
.market-text strong { font-size: 14.5px; font-weight: 750; }
.market-text span { font-size: 12.5px; color: var(--muted); }
.market-check { margin-left: auto; color: var(--brand); font-weight: 800; opacity: 0; }
.market-option.active { border-color: var(--brand); background: var(--brand-soft); }
.market-option.active .market-check { opacity: 1; }

.about-steps { list-style: none; padding: 0; display: grid; gap: 14px; counter-reset: step; }
.about-steps li { display: flex; flex-direction: column; gap: 2px; padding-left: 38px; position: relative; }
.about-steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-size: 12px; font-weight: 800;
}
.about-steps strong { font-size: 14.5px; }
.about-steps span { font-size: 13px; color: var(--muted); line-height: 1.45; }

.about-links { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 18px; }
.about-links a { color: var(--muted); font-size: 13.5px; font-weight: 650; }
.about-links a:hover { color: var(--brand); }
.about-foot { margin: 16px 2px 0; color: var(--faint); font-size: 12px; }

.affiliate-disclosure { margin-top: 20px; font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.main-button, .dark-button, .outline-button {
  min-height: 52px; border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-weight: 750; font-size: 15px;
  transition: transform .12s, background .15s;
}
.main-button:active, .dark-button:active, .outline-button:active { transform: scale(0.98); }
.main-button { background: var(--brand); color: #fff; }
.main-button:hover { background: var(--brand-strong); }
.dark-button { background: var(--brand-deep); color: #fff; }
.outline-button { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.outline-button:hover { border-color: var(--brand-line); }

/* Spinner */
.spinner {
  display: none; width: 18px; height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
.is-loading .spinner { display: inline-block; }
.is-loading .button-label { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.photo-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* ── Confidence badge ───────────────────────────────────────────────────── */
.confidence-badge {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 3px 11px;
  font-size: 11px; font-weight: 750; border: 1px solid transparent;
}
.confidence-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.confidence-badge.high { background: var(--pos-soft); color: var(--pos); border-color: var(--pos-line); }
.confidence-badge.medium { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.confidence-badge.low { background: #fdeaea; color: #b3261e; border-color: #f3c9c6; }

/* ═══ Camera overlay ════════════════════════════════════════════════════ */
.cam-overlay {
  position: fixed; inset: 0; z-index: 9000; background: #000;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
}
.cam-overlay[hidden] { display: none; }
.cam-feed { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; background: #000; }
.cam-flash {
  position: absolute; inset: 0; z-index: 6; background: #fff;
  opacity: 0; pointer-events: none;
}
.cam-flash.is-active { animation: camFlash .45s ease-out; }
@keyframes camFlash {
  0% { opacity: 0; }
  18% { opacity: .82; }
  100% { opacity: 0; }
}
.cam-canvas-hidden { display: none; }
.cam-frame {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -58%);
  width: min(88vw, 340px); height: min(28vw, 120px);
  pointer-events: none; z-index: 3;
  transition: transform .35s cubic-bezier(.2, .9, .2, 1), box-shadow .35s ease;
}
.cam-frame.cam-frame-locked {
  animation: frameSnapLock .48s cubic-bezier(.2, .9, .2, 1) forwards;
}
.cam-frame.cam-frame-locked .cam-corner { border-color: #4ade80; }
.cam-frame.cam-frame-locked .cam-scan-line { opacity: 0; animation: none; }
@keyframes frameSnapLock {
  0% { transform: translate(-50%, -58%) scale(1); box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
  45% { transform: translate(-50%, -58%) scale(.9); box-shadow: 0 0 0 6px rgba(74, 222, 128, .35); }
  100% { transform: translate(-50%, -58%) scale(.93); box-shadow: 0 0 0 14px rgba(74, 222, 128, 0); }
}
.cam-snap-burst {
  position: absolute; top: 50%; left: 50%;
  width: min(88vw, 340px); height: min(28vw, 120px);
  transform: translate(-50%, -58%);
  border: 2px solid rgba(74, 222, 128, 0);
  border-radius: 12px; pointer-events: none; z-index: 2; opacity: 0;
}
.cam-snap-burst.is-active { animation: snapBurst .55s ease-out forwards; }
@keyframes snapBurst {
  0% { opacity: 1; transform: translate(-50%, -58%) scale(.92); border-color: rgba(74, 222, 128, .95); box-shadow: 0 0 24px rgba(74, 222, 128, .45); }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(1.12); border-color: rgba(74, 222, 128, 0); box-shadow: 0 0 0 20px rgba(74, 222, 128, 0); }
}
.cam-overlay-hit { animation: overlayHit .35s ease-out; }
@keyframes overlayHit {
  0% { filter: brightness(1); }
  30% { filter: brightness(1.25); }
  100% { filter: brightness(1); }
}
.cam-corner { position: absolute; width: 26px; height: 26px; border-color: #fff; border-style: solid; }
.cam-tl { top: 0; left: 0; border-width: 3px 0 0 3px; border-radius: 8px 0 0 0; }
.cam-tr { top: 0; right: 0; border-width: 3px 3px 0 0; border-radius: 0 8px 0 0; }
.cam-bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; border-radius: 0 0 0 8px; }
.cam-br { bottom: 0; right: 0; border-width: 0 3px 3px 0; border-radius: 0 0 8px 0; }
.cam-scan-line {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: #4d8bff; box-shadow: 0 0 14px rgba(77, 139, 255, .8);
  animation: scanMove 2s linear infinite; border-radius: 2px;
}
@keyframes scanMove { 0% { top: 0; } 50% { top: calc(100% - 2px); } 100% { top: 0; } }
.cam-hint {
  position: relative; z-index: 2; margin-bottom: .65rem;
  color: rgba(255,255,255,.82); font-size: .78rem; font-weight: 500;
  text-align: center; max-width: 88%; line-height: 1.4;
}
.cam-status {
  position: absolute; top: 58%; left: 50%; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: .55rem;
  color: #fff; background: rgba(0,0,0,.62); padding: .55rem 1rem;
  font-size: .9rem; font-weight: 500; border-radius: 2rem;
  backdrop-filter: blur(6px); z-index: 4; max-width: 88%;
}
.cam-status[hidden] { display: none; }
.cam-status.is-loading { animation: statusFadeIn .25s ease; }
@keyframes statusFadeIn { from { opacity: 0; transform: translateX(-50%) translateY(6px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.cam-status-spinner {
  width: 18px; height: 18px; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.28); border-top-color: #fff;
  border-radius: 50%; animation: camSpin .7s linear infinite;
}
@keyframes camSpin { to { transform: rotate(360deg); } }
.cam-shutter {
  position: relative; z-index: 2; width: 70px; height: 70px; border-radius: 50%;
  background: rgba(255,255,255,.2); border: 3px solid #fff;
  margin-bottom: calc(1.5rem + var(--safe-bottom));
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.cam-shutter:active { transform: scale(.92); }
.cam-shutter.is-capturing { animation: shutterPulse .38s ease; }
@keyframes shutterPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,.45); }
  45% { transform: scale(.9); box-shadow: 0 0 0 10px rgba(255,255,255,0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}
.cam-shutter[hidden] { display: none; }
.cam-shutter-inner {
  width: 50px; height: 50px; border-radius: 50%; background: #fff;
  transition: transform .15s ease;
}
.cam-shutter.is-capturing .cam-shutter-inner { transform: scale(.82); }
.cam-error-box {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: rgba(0,0,0,.74); gap: 1rem; z-index: 3;
}
.cam-error-box[hidden] { display: none; }
.cam-error-msg { color: #fff; font-size: .95rem; text-align: center; max-width: 76%; line-height: 1.5; }
.cam-error-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.cam-retry-btn {
  padding: .6rem 1.5rem; background: var(--brand); color: #fff;
  border-radius: .7rem; font-size: .9rem; font-weight: 700;
}
.cam-upload-btn {
  padding: .6rem 1.5rem; background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.32); border-radius: .7rem; font-size: .9rem; font-weight: 600;
}
.cam-upload-btn:hover { background: rgba(255,255,255,.08); }
.cam-close {
  position: absolute; top: calc(.9rem + var(--safe-top)); right: .9rem;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(0,0,0,.5); color: #fff; font-size: 1rem; z-index: 4;
}

/* ═══ Cookie consent banner ═════════════════════════════════════════════ */
.cookie-banner {
  position: fixed; left: 50%; bottom: 16px;
  transform: translateX(-50%) translateY(160%);
  width: min(440px, calc(100% - 24px)); z-index: 9500;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem;
  padding: 1rem 1.15rem; background: var(--brand-deep); color: #eaf1ff;
  border: 1px solid rgba(255,255,255,.12); border-radius: 1rem;
  box-shadow: 0 18px 48px rgba(11, 31, 77, .45);
  opacity: 0; pointer-events: none; transition: transform .28s ease, opacity .28s ease;
}
.cookie-banner.is-visible { transform: translateX(-50%) translateY(0); opacity: 1; pointer-events: auto; }
.cookie-banner-text { flex: 1 1 240px; margin: 0; font-size: .82rem; line-height: 1.5; color: rgba(234,241,255,.9); }
.cookie-banner-link { color: #9cc1ff; text-decoration: underline; white-space: nowrap; }
.cookie-banner-actions { display: flex; gap: .5rem; flex: 0 0 auto; }
.cookie-btn { padding: .55rem 1.1rem; font-size: .82rem; font-weight: 700; border-radius: .6rem; border: 1px solid transparent; }
.cookie-btn-reject { background: transparent; color: #eaf1ff; border-color: rgba(255,255,255,.28); }
.cookie-btn-reject:hover { background: rgba(255,255,255,.08); }
.cookie-btn-accept { background: var(--brand); color: #fff; }
.cookie-btn-accept:hover { background: var(--brand-strong); }
@media (max-width: 520px) {
  .cookie-banner { bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px); width: calc(100% - 20px); }
  .cookie-banner-actions { flex: 1 1 100%; }
  .cookie-btn { flex: 1; }
}

/* ═══ Static legal pages (privacy/terms/cookies/about.html) ═════════════ */
.legal-page { width: min(760px, calc(100% - 32px)); margin: 0 auto; padding: 40px 0 72px; }
.legal-page .site-brand,
.legal-page .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; }
.legal-page h1 { margin: 34px 0 8px; color: #0f172a; font-size: clamp(32px, 6vw, 56px); line-height: 1; }
.legal-page h2 { margin: 30px 0 10px; color: #111827; font-size: 21px; }
.legal-page p, .legal-page li { color: #475467; line-height: 1.65; }
.legal-updated { color: var(--muted); font-size: 14px; }

/* ═══ App terms gate (first launch) ═══════════════════════════════════════ */
body.terms-locked .app,
body.terms-locked .scan-fab { pointer-events: none; user-select: none; }
.app-terms-gate {
  position: fixed; inset: 0; z-index: 1200;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(4, 10, 24, .55);
  backdrop-filter: blur(8px);
}
.app-terms-gate[hidden] { display: none; }
.app-terms-card {
  width: min(420px, 100%);
  padding: 24px 22px;
  border-radius: 18px;
  background: #fff;
  color: #111827;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.app-terms-card h2 { margin: 0 0 10px; font-size: 1.35rem; color: #0f172a; }
.app-terms-text { margin: 0 0 16px; font-size: .94rem; line-height: 1.55; color: #475467; }
.app-terms-text a { color: var(--brand); text-decoration: underline; }
.app-terms-check {
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px; font-size: .92rem; color: #111827;
}
.app-terms-check input { margin-top: 3px; }
.app-terms-accept {
  width: 100%; padding: .75rem 1rem; border-radius: .75rem;
  font-weight: 700; font-size: .92rem;
  background: var(--brand); color: #fff;
}
.app-terms-accept:disabled { opacity: .45; cursor: not-allowed; }

/* ═══ Admin dashboard ═════════════════════════════════════════════════════ */
.admin-page { width: min(1100px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 60px; }
.admin-card {
  margin-top: 18px; padding: 20px;
  border: 1px solid rgba(15,23,42,.08); border-radius: 16px;
  background: #fff; box-shadow: 0 8px 24px rgba(15,23,42,.05);
}
.admin-lead { color: #667085; margin: 0 0 14px; }
.admin-form { display: grid; gap: 10px; max-width: 360px; }
.admin-form input {
  padding: .75rem .9rem; border: 1px solid #d0d5dd; border-radius: .7rem;
}
.admin-btn {
  padding: .7rem 1rem; border-radius: .7rem; font-weight: 700;
  background: var(--brand); color: #fff; border: 0;
}
.admin-btn--ghost { background: #f2f4f7; color: #111827; }
.admin-error { color: #b42318; margin-top: 10px; }
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 16px 0; }
.admin-stat {
  padding: 14px; border-radius: 14px; background: #f8fafc; border: 1px solid #e4e7ec;
}
.admin-stat span { display: block; color: #667085; font-size: .82rem; }
.admin-stat strong { font-size: 1.4rem; color: #0f172a; }
.admin-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.admin-table-wrap { overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid #eaecf0; text-align: left; vertical-align: top; }
.admin-table th { color: #667085; font-weight: 700; }
.admin-uploads { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.admin-upload-card {
  border: 1px solid #eaecf0; border-radius: 12px; overflow: hidden; background: #fff;
}
.admin-upload-card img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #f2f4f7; }
.admin-upload-meta { padding: 10px; display: grid; gap: 4px; font-size: .78rem; color: #667085; }
.admin-upload-meta strong { color: #111827; font-size: .82rem; }

/* Small phones */
@media (max-width: 360px) {
  .home-title { font-size: 26px; }
  .product-card { grid-template-columns: 56px 1fr; }
  .product-image, .product-symbol { width: 56px; height: 56px; }
  .price { font-size: 18px; }
  .insight-card strong { font-size: 14px; }
}
