/* Shelf Scout — warm paper, orange price tags, big thumb targets. */

:root {
  --paper: #f7f5f0;
  --paper-2: #efece4;
  --card: #ffffff;
  --ink: #17140f;
  --ink-2: #3d382f;
  --muted: #6f685c;
  --line: #e3ddd1;
  --line-2: #d3cbbb;
  --accent: #e8460f;
  --accent-dark: #c33406;
  --accent-soft: #fde9e1;
  --save: #0b7a4b;
  --save-soft: #e2f5ea;
  --clearance: #6b3fd4;
  --clearance-soft: #efe8ff;
  --gold: #b8860b;
  --gold-soft: #fbf1d6;
  --shadow: 0 1px 2px rgba(23, 20, 15, .05), 0 8px 24px rgba(23, 20, 15, .06);
  --shadow-lift: 0 2px 4px rgba(23, 20, 15, .06), 0 16px 40px rgba(23, 20, 15, .12);
  --radius: 16px;
  --radius-sm: 11px;
  --maxw: 1180px;
  --tabbar: 68px;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121110;
    --paper-2: #1a1816;
    --card: #1e1c19;
    --ink: #f4f1ea;
    --ink-2: #d8d2c6;
    --muted: #a39b8c;
    --line: #302c26;
    --line-2: #423c33;
    --accent: #ff5a22;
    --accent-dark: #ff7a4d;
    --accent-soft: #3a1d12;
    --save: #4cd18e;
    --save-soft: #123326;
    --clearance: #b79bff;
    --clearance-soft: #251a3f;
    --gold: #e0b34d;
    --gold-soft: #322811;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .28);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------------ header */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  height: 62px;
  padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; min-width: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  transform: rotate(-4deg);
}
.brand-mark svg { width: 19px; height: 19px; }
.brand-text { font-weight: 800; font-size: 19px; letter-spacing: -.035em; }
.brand-text span { color: var(--accent); }
.top-actions { display: flex; gap: 4px; align-items: center; }
.auth-btn {
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.auth-btn:hover { background: var(--paper-2); }
.auth-btn.signed-in { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--paper-2); }
.icon-btn svg { width: 22px; height: 22px; }
.dot-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 19px;
  text-align: center;
  border: 2px solid var(--paper);
}

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 9px max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  border-bottom: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
}
.banner > span { flex: 1 1 190px; min-width: 0; }
.banner b { font-weight: 750; }
.banner .banner-x { margin-left: auto; border: 0; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; padding: 6px 8px; }
.banner-btn {
  margin-left: auto;
  flex: 0 0 auto;
  height: 34px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: 9px;
  background: var(--card);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
  white-space: nowrap;
}
.plan-list { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); }
.plan-list li { margin: 3px 0; }

/* -------------------------------------------------------------------- main */

.main {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px max(16px, env(safe-area-inset-left)) 8px max(16px, env(safe-area-inset-right));
}
.view-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin: 2px 0 16px; }
.view-head h1 { font-size: clamp(24px, 5vw, 32px); line-height: 1.1; letter-spacing: -.035em; font-weight: 800; }
.view-head .sub { color: var(--muted); font-size: 14.5px; margin-top: 6px; max-width: 56ch; }
.storeline {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 10px; padding: 6px 11px;
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  font-size: 13px; color: var(--ink-2);
}
.storeline svg { width: 14px; height: 14px; color: var(--muted); }
.storeline b { font-weight: 700; }

/* ------------------------------------------------------------------ search */

.searchbar { display: flex; gap: 8px; margin-bottom: 12px; width: 100%; min-width: 0; }
.searchbox { position: relative; flex: 1 1 auto; min-width: 0; }
.searchbox svg {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: var(--muted); pointer-events: none;
}
.searchbox input {
  width: 100%; height: 52px; padding: 0 44px 0 44px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 16px;
}
.searchbox input::placeholder { color: var(--muted); }
.searchbox input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.searchbox .clear-q {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--muted);
  display: grid; place-items: center; font-size: 17px;
}
.btn-scan {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 18px; border: 0; border-radius: 14px;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 14.5px;
  box-shadow: var(--shadow);
}
.btn-scan svg { width: 19px; height: 19px; }
.btn-scan:hover { opacity: .9; }

/* ------------------------------------------------------------------- chips */

.pills { display: flex; gap: 8px; overflow-x: auto; max-width: 100%; min-width: 0; padding: 2px 2px 8px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.pill:hover { border-color: var(--line-2); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.pill .count { font-size: 12px; opacity: .65; font-weight: 700; }
.pill .swatch { width: 8px; height: 8px; border-radius: 50%; }
.sortrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; flex-wrap: wrap; }
.sort-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-btn { position: relative; }
.filter-count {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 5px;
  border-radius: 9px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; line-height: 1;
}
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.filter-chip {
  height: 32px; padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-size: 12.5px; font-weight: 650;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent); }
.filter-chip.clear { border-style: dashed; color: var(--muted); }
.result-note { font-size: 13.5px; color: var(--muted); }
.select {
  height: 40px; padding: 0 34px 0 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  font-size: 13.5px; font-weight: 600; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath stroke='%236f685c' stroke-width='1.8' stroke-linecap='round' d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}

/* -------------------------------------------------------------------- grid */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; min-width: 0; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; } }

.card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--line-2); }
.card-media {
  position: relative; aspect-ratio: 4 / 3; display: grid; place-items: center;
  background: linear-gradient(140deg, var(--paper-2), color-mix(in srgb, var(--paper-2) 55%, var(--card)));
  overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .card-media img { mix-blend-mode: normal; background: #fff; } }
.card-media .glyph { font-size: clamp(38px, 9vw, 56px); opacity: .8; filter: grayscale(.2); }
.card-badges { position: absolute; inset: 8px 8px auto 8px; display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.badge-retailer {
  display: inline-flex; align-items: center; gap: 5px;
  height: 23px; padding: 0 8px; border-radius: 7px;
  background: var(--card); color: var(--ink); font-size: 10.5px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.badge-retailer .swatch { width: 7px; height: 7px; border-radius: 2px; }
.badge-pct {
  padding: 4px 8px; border-radius: 7px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 850; letter-spacing: -.01em; box-shadow: 0 2px 6px rgba(232,70,15,.3);
}
.badge-clear { background: var(--clearance); box-shadow: 0 2px 6px rgba(107,63,212,.3); }
.card-heart {
  position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--muted);
  box-shadow: 0 1px 4px rgba(0,0,0,.14);
}
.card-heart svg { width: 20px; height: 20px; }
.card-heart[aria-pressed="true"] { color: var(--accent); }
.card-heart[aria-pressed="true"] svg { fill: currentColor; }
.card-body { display: flex; flex-direction: column; gap: 7px; padding: 11px 12px 13px; }
.card-name {
  font-size: 14px; font-weight: 650; line-height: 1.3; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.6em; overflow-wrap: anywhere;
}
.price-row { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; margin-top: auto; }
.price-now { font-size: 19px; font-weight: 850; letter-spacing: -.03em; }
.price-was { font-size: 12.5px; color: var(--muted); text-decoration: line-through; }
.price-save { font-size: 11.5px; font-weight: 750; color: var(--save); }
.card-foot { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); }
.dot-live { width: 6px; height: 6px; border-radius: 50%; background: var(--save); flex: 0 0 auto; }
.dot-stale { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }

/* -------------------------------------------------------------- bf / hero */

.bf-hero {
  position: relative; overflow: hidden; margin-bottom: 18px;
  border-radius: 22px; padding: clamp(20px, 4vw, 34px);
  background:
    radial-gradient(900px 300px at 90% -20%, rgba(232,70,15,.55), transparent 60%),
    linear-gradient(135deg, #1b1712, #2a2118 60%, #191510);
  color: #fbf7ef; box-shadow: var(--shadow-lift);
}
.bf-hero::after {
  content: ""; position: absolute; right: -40px; bottom: -70px; width: 230px; height: 230px;
  border: 34px solid rgba(255,255,255,.06); border-radius: 50%;
}
.bf-kicker { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #ffb08a; }
.bf-hero h1 { margin: 10px 0 4px; font-size: clamp(30px, 6.5vw, 52px); line-height: .98; letter-spacing: -.045em; font-weight: 850; }
.bf-hero h1 em { font-style: normal; color: #ff7a45; }
.bf-sub { color: #c8bfb1; font-size: 14px; max-width: 46ch; }
.countdown { display: flex; gap: 10px; margin-top: 20px; }
.cd-block { min-width: 66px; padding: 9px 10px 8px; border-radius: 12px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); text-align: center; }
.cd-num { font-size: 25px; font-weight: 850; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.cd-lab { font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: #b8ae9f; margin-top: 1px; }
.bf-live { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; background: rgba(76,209,142,.16); color: #74e6ae; font-weight: 750; font-size: 14px; }
.bf-live .pulse { width: 8px; height: 8px; border-radius: 50%; background: #4cd18e; box-shadow: 0 0 0 0 rgba(76,209,142,.7); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(76,209,142,0); } 100% { box-shadow: 0 0 0 0 rgba(76,209,142,0); } }

.note-strip {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 13px;
  background: var(--card); color: var(--ink-2); font-size: 13.5px;
}
.note-strip svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--muted); margin-top: 1px; }
.note-strip.amber { background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 30%, var(--line)); }

/* -------------------------------------------------------------------- list */

.list-wrap { display: grid; gap: 16px; }
@media (min-width: 900px) { .list-wrap { grid-template-columns: 1fr 300px; align-items: start; } }
.list-group { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.list-group-head h3 { font-size: 14px; font-weight: 800; }
.list-group-head span { font-size: 12.5px; color: var(--muted); }
.list-row { display: flex; align-items: center; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.list-thumb { width: 46px; height: 46px; border-radius: 9px; background: var(--paper-2); display: grid; place-items: center; overflow: hidden; flex: 0 0 auto; font-size: 21px; }
.list-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
.list-info { min-width: 0; flex: 1; }
.list-name { font-size: 13.5px; font-weight: 650; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.qty button { width: 32px; height: 34px; border: 0; background: var(--card); font-size: 17px; color: var(--ink-2); }
.qty button:hover { background: var(--paper-2); }
.qty span { min-width: 26px; text-align: center; font-size: 13.5px; font-weight: 750; font-variant-numeric: tabular-nums; }
.line-total { min-width: 64px; text-align: right; font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; }
.row-x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; flex: 0 0 auto; }
.row-x:hover { background: var(--paper-2); color: var(--accent); }
.list-summary { position: sticky; top: 78px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.list-summary h2 { font-size: 15px; font-weight: 800; margin-bottom: 12px; }
.sum-row { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13.5px; color: var(--ink-2); }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px; font-size: 17px; font-weight: 850; color: var(--ink); }
.sum-row .muted { color: var(--muted); }

/* -------------------------------------------------------------------- scan */

.scan-grid { display: grid; gap: 16px; }
@media (min-width: 860px) { .scan-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel h2 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; }
.panel p.help { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.big-scan {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: 16px 0 12px;
  padding: 18px; border: 1.5px dashed var(--line-2); border-radius: 15px;
  background: var(--paper); color: var(--ink); text-align: left;
}
.big-scan:hover { border-color: var(--accent); background: var(--accent-soft); }
.big-scan .scan-ico { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--ink); color: var(--paper); flex: 0 0 auto; }
.big-scan .scan-ico svg { width: 23px; height: 23px; }
.big-scan b { display: block; font-size: 15.5px; }
.big-scan small { color: var(--muted); font-size: 12.5px; }

.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.field input, .field select, .field textarea {
  width: 100%; height: 46px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); color: var(--ink);
  font-size: 15px;
}
.field textarea { height: auto; padding: 10px 12px; min-height: 70px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field .hint { font-size: 11.5px; color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check { display: flex; align-items: center; gap: 9px; min-height: 44px; font-size: 14px; font-weight: 600; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--card); color: var(--ink); font-weight: 700; font-size: 14.5px;
}
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.small { min-height: 38px; padding: 0 13px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 9px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ sheets */

.overlay { position: fixed; inset: 0; background: rgba(12, 10, 8, .48); z-index: 60; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 70; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(720px, 100%); max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0;
  box-shadow: var(--shadow-lift); padding-bottom: max(18px, env(safe-area-inset-bottom));
  animation: rise .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translate(-50%, 30px); opacity: .5; } }
@media (min-width: 760px) {
  .sheet { bottom: auto; top: 5vh; border-radius: 22px; border-bottom: 1px solid var(--line); max-height: 90vh; }
  @keyframes rise { from { transform: translate(-50%, 18px); opacity: .5; } }
}
.sheet-grab { width: 42px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 9px auto 2px; }
.sheet-close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 38px; height: 38px; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--card) 88%, transparent); color: var(--ink-2); font-size: 20px; }
.sheet-close:hover { background: var(--paper-2); }
.sheet-hero { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--paper-2); overflow: hidden; border-radius: 22px 22px 0 0; }
.sheet-hero img { width: 100%; height: 100%; object-fit: contain; padding: 22px; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .sheet-hero img { background: #fff; mix-blend-mode: normal; } }
.sheet-hero .glyph { font-size: 74px; opacity: .75; }
.sheet-body { padding: 18px 20px 8px; }
.sheet-eyebrow { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.sheet-title { font-size: clamp(20px, 4vw, 26px); line-height: 1.15; letter-spacing: -.03em; font-weight: 800; margin: 8px 0 12px; }
.sheet-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sheet-price .now { font-size: 34px; font-weight: 850; letter-spacing: -.04em; }
.sheet-price .was { font-size: 16px; color: var(--muted); text-decoration: line-through; }
.sheet-price .off { font-size: 13px; font-weight: 800; color: var(--save); background: var(--save-soft); padding: 4px 9px; border-radius: 8px; }
.why { font-size: 13.5px; color: var(--ink-2); background: var(--paper); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; margin: 14px 0; }
.why b { font-weight: 750; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; margin: 12px 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.spark-wrap { margin: 16px 0 8px; }
.spark-wrap .lab { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-bottom: 4px; }
.spark { width: 100%; height: 56px; display: block; overflow: visible; }
.sheet-actions { display: flex; gap: 9px; flex-wrap: wrap; margin: 16px 0 6px; }
.watch-box { display: flex; gap: 8px; margin-top: 10px; }
.watch-box input { flex: 1; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font-size: 15px; }
.other-stores { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.other-stores h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.other-row { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); }
.other-row:last-child { border-bottom: 0; }
.other-row b { font-weight: 750; }

.modal {
  position: fixed; z-index: 70; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(640px, calc(100% - 24px)); max-height: 88dvh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-lift); padding: 22px;
}
.modal h1 { font-size: 22px; letter-spacing: -.03em; font-weight: 850; padding-right: 34px; }
.modal .sub { color: var(--muted); font-size: 14px; margin-top: 5px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--paper-2); color: var(--ink-2); font-size: 19px; }
.modal-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-section h2 { font-size: 15px; font-weight: 800; margin-bottom: 8px; }
.source-row { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13.5px; }
.source-row:last-child { border-bottom: 0; }
.source-row .swatch { width: 9px; height: 9px; border-radius: 3px; margin-top: 6px; flex: 0 0 auto; }
.source-row b { font-weight: 750; }
.source-row .tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--save-soft); color: var(--save); }
.source-row .tag.capture { background: var(--gold-soft); color: var(--gold); }
.store-pick { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.store-pick:last-child { border-bottom: 0; }
.store-pick .dist { margin-left: auto; color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.store-pick input { width: 18px; height: 18px; accent-color: var(--accent); }
.code { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12px; overflow-x: auto; white-space: pre; color: var(--ink-2); }

/* ------------------------------------------------------------------ states */

.empty { display: grid; place-items: center; text-align: center; padding: 48px 20px; border: 1px dashed var(--line-2); border-radius: var(--radius); background: var(--card); }
.empty .ico { font-size: 40px; margin-bottom: 10px; }
.empty h2 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.empty p { color: var(--muted); font-size: 14px; max-width: 42ch; margin: 6px 0 16px; }

.skel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.skel .sk-media { aspect-ratio: 4/3; background: linear-gradient(90deg, var(--paper-2) 25%, var(--line) 50%, var(--paper-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skel .sk-line { height: 11px; margin: 11px 12px; border-radius: 5px; background: var(--paper-2); }
.skel .sk-line.short { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.site-foot {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px max(16px, env(safe-area-inset-left)) calc(var(--tabbar) + 26px) max(16px, env(safe-area-inset-right));
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.site-foot span { font-weight: 750; color: var(--ink-2); }
.site-foot a { text-decoration: underline; text-underline-offset: 2px; }
.site-foot a:hover { color: var(--accent); }

.toast {  position: fixed; z-index: 90; left: 50%; bottom: calc(var(--tabbar) + 14px); transform: translateX(-50%);
  max-width: calc(100% - 28px); padding: 11px 16px; border-radius: 12px;
  background: var(--ink); color: var(--paper); font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow-lift); animation: rise2 .18s ease;
}
@keyframes rise2 { from { transform: translate(-50%, 8px); opacity: 0; } }

/* ------------------------------------------------------------------ tabbar */

.tabbar {
  position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(16px);
  border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: .01em; min-width: 0; }
.tab-icon { display: grid; place-items: center; width: 30px; height: 26px; border-radius: 9px; }
.tab-icon svg { width: 21px; height: 21px; }
.tab-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab[aria-current="page"] { color: var(--accent); }
.tab[aria-current="page"] .tab-icon { background: var(--accent-soft); }
@media (min-width: 760px) {
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); bottom: 14px; width: min(620px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 18px; height: 62px; padding-bottom: 0; box-shadow: var(--shadow-lift); }
  .main { padding-bottom: 8px; }
  .site-foot { padding-bottom: 100px; }
  .tab { flex-direction: row; gap: 7px; font-size: 12.5px; }
  .tab-icon { width: 24px; }
}

/* ------------------------------------------------------------------- misc */

.hidden { display: none !important; }
.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.spacer { height: 10px; }
.file-input { display: none; }
.video-wrap { position: relative; border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 4/3; }
.video-wrap video { width: 100%; height: 100%; object-fit: cover; }
.video-wrap .scan-line { position: absolute; left: 8%; right: 8%; height: 2px; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: scanline 2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 18%; } 50% { top: 82%; } }

.doc { max-width: 760px; margin: 0 auto; padding: 34px 20px 90px; }
.doc h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.05; letter-spacing: -.04em; font-weight: 850; margin: 6px 0 18px; }
.doc h2 { font-size: 17px; font-weight: 800; letter-spacing: -.02em; margin: 28px 0 8px; }
.doc p, .doc li { color: var(--ink-2); font-size: 14.5px; line-height: 1.62; }
.doc p { margin: 8px 0; }
.doc ul { padding-left: 20px; margin: 8px 0; }
.doc li { margin: 5px 0; }
.doc .meta { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.doc .back { margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); }
.doc a { text-decoration: underline; text-underline-offset: 2px; }

@media print {
  .topbar, .tabbar, .banner, .list-summary .btn, .row-x, .qty button, #toast { display: none !important; }
  body { background: #fff; }
  .main { padding: 0; max-width: none; }
  .list-wrap { display: block; }
  .list-group { box-shadow: none; border-color: #bbb; margin-bottom: 12px; break-inside: avoid; }
  .list-summary { position: static; box-shadow: none; }
}
