/* Shopster — clean, quiet, pastel. Brand: pastel red #FFADAD + light blue #D9EDF8 on white. */
:root {
  --red: #FFADAD; --red-2: #FF9A9A; --red-soft: #FFF1F1; --red-ink: #8F2D2D;
  --blue: #D9EDF8; --blue-2: #C3E1F3; --blue-ink: #16405A; --blue-mark: #4A8DB8;
  --ink: #1C2430; --muted: #5B6573; --fine: #67717E; --line: #E6E9ED; --surface: #F5F7F9; --bg: #FFFFFF;
  --alert: #D64545;
  --r: 16px; --r-lg: 22px;
  --shadow: 0 1px 2px rgba(28, 36, 48, .06), 0 4px 16px rgba(28, 36, 48, .06);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; }
#app { max-width: 560px; margin: 0 auto; padding: 0 16px calc(96px + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
.center { text-align: center; }
button { font: inherit; cursor: pointer; border: 0; color: inherit; background: none; }
input { font: inherit; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 10px; }
h2, h3 { margin: 0; letter-spacing: -.01em; }
.title { font-size: 26px; font-weight: 800; margin-top: 8px; }
.sub { color: var(--muted); margin: 2px 0 14px; }
.sect { font-size: 19px; font-weight: 700; margin: 28px 0 10px; }
.fine { color: var(--fine); font-size: 14px; font-weight: 500; }
.err { color: var(--red-ink); font-weight: 600; min-height: 1.2em; margin: 8px 0; }
.warn { color: var(--red-ink); }

/* ---------- buttons + fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px;
  border-radius: 14px; font-weight: 700; font-size: 17px; transition: transform .08s, background .15s; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--red); color: var(--ink); }
.btn.danger { background: var(--red-ink); color: #fff; }
.btn.primary:hover { background: var(--red-2); }
.btn.soft { background: var(--blue); color: var(--blue-ink); }
.btn.soft:hover { background: var(--blue-2); }
.btn.ghost { background: var(--bg); color: var(--ink); border: 1.5px solid var(--line); }
.btn.light { background: rgba(255, 255, 255, .92); color: var(--ink); }
.btn.wide { width: 100%; }
.btn.big { min-height: 58px; font-size: 18px; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; }
.iconbtn { position: relative; width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.iconbtn:hover { background: var(--surface); }
.field { display: block; font-weight: 600; font-size: 15px; margin: 14px 0 0; }
.field .opt { color: var(--fine); font-weight: 500; }
input[type=text], input[type=email], input[type=password], input:not([type]), input[inputmode] {
  display: block; width: 100%; margin-top: 6px; height: 50px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--bg); color: var(--ink); font-size: 17px; }
input:focus { outline: none; border-color: var(--blue-mark); box-shadow: 0 0 0 3px var(--blue); }
.typeit { display: flex; gap: 8px; margin-top: 10px; }
.typeit input { margin: 0; flex: 1; min-width: 0; }

/* ---------- auth ---------- */
.auth { padding-top: max(40px, env(safe-area-inset-top)); }
.brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.brand img { border-radius: 14px; }
.brand h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.tag { text-align: center; color: var(--muted); margin: 10px auto 22px; max-width: 340px; }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.card h2 { font-size: 22px; font-weight: 800; }
.card .btn { width: 100%; margin-top: 18px; }
.switch { text-align: center; color: var(--muted); margin: 14px 0 0; }
.switch a { color: var(--blue-ink); font-weight: 700; }

/* ---------- header + tabs ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px); margin: 0 -16px; padding: calc(8px + env(safe-area-inset-top)) 12px 8px 16px; border-bottom: 1px solid var(--line); }
.logo { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.logo-mark { height: 26px; width: auto; display: block; }
.pts { background: var(--blue); color: var(--blue-ink); font-weight: 700; font-size: 14px; padding: 6px 10px; border-radius: 999px; margin-right: 4px;
  font-variant-numeric: tabular-nums; }
.dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--alert);
  color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; box-shadow: 0 0 0 2px #fff; }
.iconbtn.ring svg { animation: ring .8s ease-in-out 2; }
@keyframes ring { 20%, 60% { transform: rotate(-14deg); } 40%, 80% { transform: rotate(14deg); } }
.tab { padding-top: 14px; }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: center; background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(10px); }
.tabs button { flex: 1; max-width: 112px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0;
  color: var(--fine); font-size: 12px; font-weight: 600; border-radius: 12px; }
.tabs button svg { width: 24px; height: 24px; padding: 2px 10px; box-sizing: content-box; border-radius: 999px; transition: background .15s; }
.tabs button.on { color: var(--ink); }
.tabs button.on svg { background: var(--red); }

/* ---------- scanner (always on) ---------- */
.scanner { position: relative; height: clamp(170px, 27vh, 260px); border-radius: var(--r-lg); overflow: hidden; background: #11161d; }
.scanner video, .camwrap video { width: 100%; height: 100%; object-fit: cover; display: block; }
.frame { position: absolute; left: 14%; right: 14%; top: 24%; bottom: 30%; pointer-events: none; }
.frame i { position: absolute; width: 26px; height: 26px; border: 3px solid #fff; border-radius: 0; }
.frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.laser { position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; background: var(--red); border-radius: 2px;
  box-shadow: 0 0 10px var(--red); animation: sweep 2.2s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: translateY(-22px); } to { transform: translateY(22px); } }
.scanner.paused .laser, .scanner.busy .laser { animation-play-state: paused; opacity: .35; }
.scanner.hit .frame i { border-color: var(--red); }
.scanstate { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); background: rgba(255, 255, 255, .94); color: var(--ink);
  font-weight: 600; font-size: 15px; padding: 8px 14px; border-radius: 999px; white-space: nowrap; box-shadow: var(--shadow); }
.camstart { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.camstart svg { width: 20px; height: 20px; }

/* ---------- results ---------- */
.results { margin-top: 16px; }
.result { border-radius: var(--r-lg); padding: 20px; border: 1.5px solid; animation: rise .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.result.ship { background: var(--blue); border-color: var(--blue-2); }
.result.skip { background: var(--red-soft); border-color: var(--red); }
.result.wait { background: var(--surface); border-color: var(--line); }
.verdict { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase;
  padding: 6px 12px 6px 8px; border-radius: 999px; }
.verdict svg { width: 18px; height: 18px; stroke-width: 2.6; }
.ship .verdict { background: #fff; color: var(--blue-ink); }
.skip .verdict { background: #fff; color: var(--red-ink); }
.result .name { font-weight: 700; font-size: 18px; margin: 12px 0 2px; overflow-wrap: anywhere; }
.result .upc { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.result .offer { font-size: clamp(44px, 14vw, 60px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin-top: 14px;
  font-variant-numeric: tabular-nums; }
.result .per { color: var(--blue-ink); font-weight: 600; }
.result .reason { font-size: 22px; font-weight: 700; margin-top: 12px; color: var(--red-ink); }
.result .facts { margin: 14px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.result .facts li { display: flex; gap: 8px; color: var(--ink); font-size: 15px; }
.result .facts li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .45; margin-top: 8px; flex: none; }
.result .actions { display: flex; gap: 8px; margin-top: 16px; }
.result .actions .btn { flex: 1; }
.result .added { color: var(--blue-ink); font-weight: 700; font-size: 15px; margin-top: 10px; min-height: 1.3em; }
.skel { height: 14px; border-radius: 7px; background: linear-gradient(90deg, #e9edf1 25%, #f5f7f9 50%, #e9edf1 75%); background-size: 200% 100%;
  animation: shimmer 1.1s linear infinite; margin-top: 12px; }
.skel.big { height: 46px; width: 55%; border-radius: 12px; margin-top: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.scrollhint { display: none; align-items: center; justify-content: center; gap: 6px; color: var(--fine); font-weight: 600; font-size: 14px;
  margin: 18px 0 0; padding-bottom: 32vh; }
.scrollhint svg { width: 18px; height: 18px; }
.tab.has-results .scrollhint { display: flex; }
.earlier h3 { font-size: 17px; font-weight: 700; margin: 26px 0 6px; }

/* ---------- generic list rows ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.list li > div:first-child { min-width: 0; flex: 1; }
.list .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .meta { color: var(--fine); font-size: 14px; margin-top: 2px; overflow-wrap: anywhere; }
.list .amt { font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.chip { display: inline-block; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px;
  margin-right: 6px; vertical-align: 1px; }
.chip.ship, .chip.good { background: var(--blue); color: var(--blue-ink); }
.chip.skip, .chip.bad { background: var(--red-soft); color: var(--red-ink); }
.chip.neutral { background: var(--surface); color: var(--muted); }
.trk { font-size: 14px; color: var(--muted); margin-top: 4px; }
.trk b { color: var(--ink); font-weight: 600; }
.trk.warn { color: var(--red-ink); font-weight: 600; }

/* ---------- ship tab ---------- */
.payoutcard { background: var(--blue); border-radius: var(--r-lg); padding: 20px; text-align: center; }
.payoutcard .l { color: var(--blue-ink); font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; }
.payoutcard .v { font-size: 46px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.payoutcard .v.bump { animation: bump .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes bump { 40% { transform: scale(1.06); } }
.payoutcard .s { color: var(--blue-ink); font-weight: 600; }
.step { margin-top: 26px; }
.step h3 { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.num { width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: var(--ink); font-size: 15px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center; }
.step .btn.wide { margin-top: 10px; }
.boxitems { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.boxitems li { border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.boxitems li.empty { display: block; color: var(--muted); text-align: center; border-style: dashed; }
.boxitems .nm { font-weight: 700; overflow-wrap: anywhere; }
.boxitems .meta { color: var(--fine); font-size: 14px; margin-top: 2px; }
.lock { color: var(--blue-ink); font-weight: 600; }
.ctl { display: flex; align-items: center; gap: 4px; }
.qbtn { width: 40px; height: 40px; border-radius: 12px; background: var(--surface); font-size: 22px; font-weight: 600; }
.qn { min-width: 28px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.cam-btn { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; border-radius: 12px;
  border: 1.5px dashed var(--line); color: var(--ink); font-weight: 600; font-size: 15px; }
.cam-btn.done { border: 0; background: var(--blue); color: var(--blue-ink); }
.cam-btn svg { width: 18px; height: 18px; }
.rowbtn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 0 16px; min-height: 56px; border-radius: var(--r);
  border: 1.5px solid var(--line); text-align: left; }
.rowbtn b { flex: 1; font-weight: 700; }
.rowbtn i { font-style: normal; font-size: 14px; font-weight: 700; color: var(--red-ink); }
.rowbtn.done { background: var(--blue); border-color: var(--blue); }
.rowbtn.done i { color: var(--blue-ink); }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 10px; font-size: 16px; }
.check input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--blue-ink); flex: none; }
.tracklist { display: flex; flex-wrap: wrap; gap: 8px; }
.tracklist span { display: inline-flex; align-items: center; gap: 4px; background: var(--surface); border-radius: 10px; padding: 6px 4px 6px 12px;
  font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; max-width: 100%; overflow-wrap: anywhere; }
.tracklist button { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); }
.payout-method { border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.payout-method.ready { background: var(--blue); border-color: var(--blue); color: var(--blue-ink); }
.payout-method.todo { background: var(--red-soft); border-color: var(--red); }
.payout-method .btn { margin-top: 12px; }
.missing { list-style: none; margin: 26px 0 12px; padding: 14px 16px; background: var(--surface); border-radius: var(--r); }
.missing li { padding: 3px 0 3px 22px; position: relative; color: var(--muted); font-weight: 500; }
.missing li::before { content: ""; position: absolute; left: 4px; top: 11px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--fine); }
.missing.ok { background: var(--blue); }
.missing.ok li { color: var(--blue-ink); font-weight: 700; }
.missing.ok li::before { background: var(--blue-ink); border-color: var(--blue-ink); }

/* ---------- map ---------- */
.seg { display: inline-flex; background: var(--surface); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg button { padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 15px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.mapbox { position: relative; isolation: isolate; z-index: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
#map { height: min(50vh, 420px); background: #eef1f4; }
.mapme { position: absolute; right: 10px; bottom: 10px; z-index: 600; background: #fff; box-shadow: var(--shadow); }
.mapempty { position: absolute; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
  background: rgba(255, 255, 255, .86); font-weight: 600; color: var(--muted); }
.legend { display: flex; align-items: center; gap: 8px; color: var(--fine); font-size: 13px; margin: 10px 2px 0; }
.legend i { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, rgba(224, 90, 90, .15), rgba(224, 90, 90, .85)); }
#tab-map h3 { font-size: 19px; font-weight: 700; margin: 24px 0 4px; }
.leaflet-container { font-family: var(--font); }
.leaflet-popup-content { margin: 12px 14px; font-size: 15px; line-height: 1.4; }
.leaflet-popup-content b { font-size: 16px; }
.leaflet-popup-content ul { margin: 6px 0 0; padding-left: 18px; }
.leaflet-control-attribution { font-size: 10px; }

/* ---------- game ---------- */
.levelbox { display: grid; grid-template-columns: 92px 1fr; gap: 16px; align-items: center; background: var(--surface); border-radius: var(--r-lg); padding: 16px; }
#heroBig { width: 92px; height: 92px; image-rendering: pixelated; background: #fff; border-radius: 16px; }
.lvwrap { min-width: 0; }
.lvl { font-size: 14px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lvtitle { font-size: 22px; font-weight: 800; margin: 2px 0 10px; }
.bar { height: 10px; border-radius: 5px; background: #fff; overflow: hidden; }
#xp { height: 100%; width: 0; background: var(--red); border-radius: 5px; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.lvwrap .fine { margin-top: 6px; }
.streak { margin: 12px 0 0; font-weight: 700; color: var(--red-ink); }
.streak:empty { display: none; }
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.badge { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 6px; text-align: center; }
.badge .i { font-size: 28px; line-height: 1.2; }
.badge .n { font-weight: 700; font-size: 14px; margin-top: 4px; }
.badge .h { color: var(--fine); font-size: 12px; margin-top: 2px; line-height: 1.3; }
.badge.on { background: var(--blue); border-color: var(--blue); }
.badge.off .i { filter: grayscale(1); opacity: .35; }
.badge.off .n { color: var(--muted); }
.badge.new { animation: pop .5s cubic-bezier(.2, 1.4, .4, 1); box-shadow: 0 0 0 3px var(--red); }
@keyframes pop { from { transform: scale(.85); opacity: .4; } }
.avatars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.avatars button { border: 1.5px solid var(--line); border-radius: 14px; padding: 8px 4px; font-size: 12px; font-weight: 600; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-transform: capitalize; }
.avatars canvas { width: 100%; max-width: 56px; aspect-ratio: 1; image-rendering: pixelated; }
.avatars button.on { border-color: var(--ink); color: var(--ink); background: var(--surface); }

/* ---------- me / stats ---------- */
.earned { text-align: center; padding: 8px 0 18px; }
.earned .l { color: var(--muted); font-weight: 600; }
.earned .hero { font-size: clamp(48px, 15vw, 64px); font-weight: 800; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.chartcard { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 16px 10px; margin-bottom: 16px; }
.charthead { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.charthead h3 { font-size: 17px; font-weight: 700; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; fill: initial; stroke: none; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--fine); font: 600 11px var(--font); }
.chart .col, .chart .zero { pointer-events: none; }
.chart .col { fill: var(--blue-mark); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + .col, .chart .col.on { fill: var(--blue-ink); }
.chart .zero { fill: var(--line); }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; border-radius: 10px; padding: 6px 10px; font-weight: 700;
  font-size: 14px; white-space: nowrap; transform: translate(-50%, -100%); }
.tip span { display: block; font-weight: 500; font-size: 12px; opacity: .8; }
.tableview { margin-top: 6px; color: var(--muted); font-size: 14px; }
.tableview summary { cursor: pointer; padding: 6px 0; font-weight: 600; }
.tableview table { width: 100%; border-collapse: collapse; }
.tableview td { padding: 5px 0; border-bottom: 1px solid var(--line); }
.tableview td:last-child { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border-radius: var(--r); padding: 14px; }
.stat .n { font-size: clamp(22px, 7vw, 28px); font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .l { color: var(--muted); font-size: 14px; font-weight: 600; }
#tab-me .field { margin-top: 24px; }
#logout { margin-top: 16px; }
.delacct { display: block; margin: 14px auto 0; color: var(--muted); font-size: 14px; }

/* ---------- camera overlay (ship tab: items + labels) ---------- */
.camwrap { position: fixed; inset: 0; z-index: 60; background: #000; }
.camwrap .frame { top: 36%; bottom: 36%; left: 8%; right: 8%; }
.camlabel { position: absolute; top: calc(24px + env(safe-area-inset-top)); left: 16px; right: 16px; text-align: center; color: #fff; font-weight: 700; font-size: 18px; }
.camclose { position: absolute; left: 16px; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); }

/* ---------- sheets, toasts, celebrations ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(28, 36, 48, .35); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 560px; max-height: 84vh; overflow-y: auto; background: #fff; border-radius: 24px 24px 0 0;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom)); animation: up .25s cubic-bezier(.2, .8, .2, 1); }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { font-size: 22px; font-weight: 800; }
.push-box { background: var(--blue); color: var(--blue-ink); border-radius: var(--r); padding: 14px; margin: 10px 0 14px; font-weight: 500; }
.push-box:empty { display: none; }
.push-box .btn { margin-top: 10px; }
.alert-list { list-style: none; margin: 0; padding: 0; }
.alert-list li { padding: 14px 2px; border-bottom: 1px solid var(--line); }
.alert-list li.new .t::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--alert); margin-left: 8px; vertical-align: 2px; }
.alert-list .t { font-weight: 700; }
.alert-list .b { color: var(--muted); font-size: 15px; margin-top: 2px; }
.alert-list .w { color: var(--fine); font-size: 13px; margin-top: 4px; }
.toasthost { position: fixed; left: 16px; right: 16px; top: calc(68px + env(safe-area-inset-top)); z-index: 70; display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; padding: 12px 16px; border-radius: 14px; max-width: 520px;
  box-shadow: var(--shadow); animation: up .25s cubic-bezier(.2, .8, .2, 1); }
.celebrate { position: fixed; inset: 0; z-index: 50; background: rgba(28, 36, 48, .4); display: flex; align-items: center; justify-content: center; padding: 16px; }
.celebrate-card { background: #fff; border-radius: 26px; padding: 28px 22px 22px; text-align: center; max-width: 380px; width: 100%;
  animation: pop .45s cubic-bezier(.2, 1.4, .4, 1); box-shadow: 0 20px 60px rgba(28, 36, 48, .25); }
.celebrate .burst { width: 96px; height: 96px; margin: 0 auto; border-radius: 50%; background: var(--blue); display: flex; align-items: center;
  justify-content: center; font-size: 48px; }
.celebrate .burst canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.celebrate .big { font-size: 28px; font-weight: 800; margin-top: 14px; letter-spacing: -.02em; }
.celebrate .sub { color: var(--muted); font-size: 17px; margin: 6px 0 20px; }
.celebrate .sub b { color: var(--ink); }
.confetti { position: fixed; top: -12px; z-index: 55; width: 8px; height: 12px; border-radius: 2px; pointer-events: none;
  animation: fall 1.8s cubic-bezier(.3, .6, .5, 1) forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); opacity: .2; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .confetti { display: none; }
}

/* ---------- shipping labels ---------- */
.readylist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 10px; }
.readylist li { border: 1.5px solid var(--red); background: var(--red-soft); border-radius: var(--r); padding: 14px; }
.readylist li.ok { border-color: var(--blue-2); background: var(--blue); }
.readylist .nm { font-weight: 700; }
.readylist .meta { color: var(--muted); font-size: 14px; margin: 2px 0 10px; }
.readylist .row2 { display: flex; gap: 8px; flex-wrap: wrap; }
.readylist .row2 .btn { flex: 1 1 140px; }
.boxhead { margin-top: 6px; }
.formgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.formgrid .full { grid-column: 1 / -1; }
.dims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.wt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet .field { margin-top: 12px; }
.sheet h4 { margin: 18px 0 2px; font-size: 16px; }
.rates { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.rates label { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; border: 1.5px solid var(--line);
  border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.rates input { width: 22px; height: 22px; accent-color: var(--blue-ink); margin: 0; }
.rates label:has(input:checked) { border-color: var(--blue-ink); background: var(--blue); }
.rates .svc { font-weight: 700; }
.rates .sub2 { color: var(--muted); font-size: 13px; }
.rates .p { font-weight: 800; font-variant-numeric: tabular-nums; }
.qrbox { text-align: center; padding: 8px 0; }
.qrbox img { width: min(280px, 80vw); height: auto; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 16px; padding: 12px; background: #fff; }
.qrbox .how { color: var(--muted); margin: 10px auto 0; max-width: 340px; }
.qrbox .trknum { font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 8px; overflow-wrap: anywhere; }
.sheet .btn + .btn, .sheet .btn.mt { margin-top: 10px; }
.linkbtn { color: var(--blue-ink); font-weight: 700; text-decoration: underline; padding: 10px 0; }

/* compact result so it fits under the (smaller) camera without the page moving */
.results { margin-top: 12px; min-height: 0; }
.result { padding: 14px 16px; }
.result .offer { font-size: clamp(36px, 11vw, 46px); margin-top: 8px; }
.result .name { font-size: 16px; margin: 8px 0 0; }
.result .upc { font-size: 13px; }
.result .facts { margin-top: 8px; gap: 2px; }
.result .facts li { font-size: 14px; }
.result .actions { margin-top: 10px; }
.result .actions .btn { min-height: 46px; }
.result .added { margin-top: 6px; }
.result .reason { font-size: 19px; margin-top: 8px; }
.result .fine { margin: 6px 0 0; }
.result .skel.big { margin-top: 10px; height: 38px; }
#tab-scan .typeit { margin-top: 12px; }
.scrollhint { display: none !important; }
.result .added:empty { display: none; }

/* quantity picker on a Ship result */
.result .actions { align-items: stretch; }
.qty { display: flex; align-items: center; background: #fff; border-radius: 14px; border: 1.5px solid var(--blue-2); flex: none; }
.qty button { width: 40px; height: 44px; font-size: 22px; font-weight: 700; color: var(--blue-ink); }
.qty button:disabled { opacity: .3; }
.qty input { width: 44px; height: 44px; margin: 0; padding: 0; border: 0; text-align: center; font-weight: 800; font-size: 18px;
  -moz-appearance: textfield; background: transparent; }
.qty input:focus { box-shadow: none; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.result .actions .btn { flex: 1; min-width: 0; }

.qbtn.rm { color: var(--red-ink); display: inline-flex; align-items: center; justify-content: center; margin-left: 4px; }
.qbtn.rm svg { width: 18px; height: 18px; }
.result .linkbtn { display: block; margin-top: 2px; padding: 6px 0 0; color: var(--red-ink); font-size: 15px; }
.result .linkbtn.hidden { display: none; }
/* Comp photo on a Ship result: big, tap to zoom, one line to learn more */
.result .match { margin: 14px 0 6px; }
.result .match-img { display: block; width: 100%; padding: 0; border: 1px solid var(--blue-2); border-radius: 16px; background: #fff; overflow: hidden; cursor: zoom-in; }
.result .match-img img { display: block; width: 100%; height: clamp(200px, 32vh, 300px); object-fit: contain; }
.result .match-link { display: block; margin-top: 8px; padding: 2px 0; background: none; border: 0; color: var(--blue-ink); font: inherit;
  font-weight: 700; font-size: 15px; text-decoration: underline; text-align: left; cursor: pointer; }
.match-why { color: var(--muted); line-height: 1.45; margin: 8px 0 10px; }
.match-list { margin: 0 0 16px; padding-left: 20px; line-height: 1.5; }
.match-list li + li { margin-top: 6px; }
.zoomer { position: fixed; inset: 0; z-index: 70; background: rgba(10, 12, 16, .94); display: flex; align-items: center; justify-content: center; cursor: zoom-out;
  animation: fade .18s ease; }
.zoomer img { max-width: 100vw; max-height: 100vh; object-fit: contain; touch-action: pinch-zoom; }
.zoomer .iconbtn { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 14px; background: rgba(255, 255, 255, .9); }
@keyframes fade { from { opacity: 0; } }
/* Terms: signup checkbox, first-open agree screen, help links on Me */
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 14px; font-size: 15px; color: var(--muted); }
.agree input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--blue-ink); }
.agree a { color: var(--blue-ink); font-weight: 700; }
.gate { position: fixed; inset: 0; z-index: 80; background: rgba(28, 36, 48, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.gate-card { width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto; background: #fff; border-radius: 24px; padding: 22px 20px 14px; box-shadow: var(--shadow); }
.gate-card h2 { font-size: 24px; font-weight: 800; }
.gate-list { margin: 6px 0 14px; padding-left: 20px; line-height: 1.5; }
.gate-list li + li { margin-top: 6px; }
.gate-read { display: block; color: var(--blue-ink); font-weight: 700; margin-bottom: 14px; }
.gate .linkbtn { display: block; margin: 0 auto; color: var(--muted); font-size: 15px; }
.helplinks { display: grid; gap: 10px; margin: 20px 0 14px; }
.helplinks a { display: block; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: var(--r); color: var(--ink); font-weight: 700; text-decoration: none; }
.helplinks a span { display: block; color: var(--muted); font-weight: 500; font-size: 14.5px; }
/* Watchlist */
.dot.soft { background: var(--blue-ink); }
.watchbtn { margin-top: 12px; }
.result .watching { display: flex; gap: 6px; align-items: center; color: var(--blue-ink); font-weight: 600; font-size: 14.5px; margin: 10px 0 0; }
.result .watching svg { width: 18px; height: 18px; }
.field-l { font-weight: 700; margin: 14px 0 8px; }
.storepick { display: grid; gap: 8px; margin: 10px 0; }
.storepick .store { text-align: left; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; }
.storepick .store b { display: block; }
.storepick .store span { display: block; color: var(--muted); font-size: 14px; }
.storepick .store.on { border-color: var(--blue-ink); background: var(--blue); }
.typebox { margin: 4px 0 14px; }
.typebox summary { color: var(--blue-ink); font-weight: 700; cursor: pointer; padding: 6px 0; }
.wstore { margin-top: 18px; }
.wstore-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.wstore-h b { display: block; font-size: 17px; }
.wstore-h span { display: block; color: var(--muted); font-size: 14px; }
.wstore-h .dir { color: var(--blue-ink); font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.witem { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.witem img, .witem .noimg { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: var(--surface); flex: none; display: grid; place-items: center; }
.wi-main { flex: 1; min-width: 0; }
.wi-main .nm { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-nums { color: var(--muted); font-size: 14.5px; margin: 2px 0 4px; }
.wi-nums b { color: var(--ink); }
.chip.good { background: var(--blue); color: var(--blue-ink); }
.chip.warn { background: #FFF4D6; color: #7A5300; }
.chip.bad { background: var(--red-soft); color: var(--red-ink); }
.chip:not(.good):not(.warn):not(.bad):not(.ship):not(.skip) { background: var(--surface); color: var(--muted); }
.wi-act { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.wi-act input { width: 0; flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 1.5px solid var(--line); border-radius: 12px; }
.wi-act .linkbtn { padding: 0; font-size: 14px; color: var(--muted); }
/* Bounty tab */
.bounty-tip { margin: -6px 0 6px; }
.bountylist { list-style: none; margin: 0; padding: 0; }
.bountylist .skel { height: 300px; margin: 14px 0; border-radius: 16px; }
.bounty { display: block; padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.bounty .b-photo { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 16px; background: #fff; overflow: hidden; }
.bounty .b-photo img, .bounty .b-photo .noimg { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.bounty .b-photo .noimg { background: var(--surface); }
.bounty .b-rank { position: absolute; top: 10px; left: 10px; min-width: 34px; padding: 4px 9px; border-radius: 999px;
  background: var(--ink, #1b1f2a); color: #fff; font-weight: 800; font-size: 15px; text-align: center; }
.bounty:nth-child(-n+3) .b-rank { background: var(--red-ink); }
.bounty .nm { margin-top: 12px; font-weight: 700; font-size: 17px; line-height: 1.3; }
.bounty .b-pay { font-weight: 800; font-size: 20px; margin-top: 4px; }
.bounty .b-pay span { font-weight: 500; font-size: 14px; color: var(--muted); }
.bounty .b-meta { color: var(--muted); font-size: 14px; margin-top: 2px; }
.bounty .b-store { display: inline-block; margin-top: 10px; padding: 8px 12px; border-radius: 10px; background: var(--blue);
  color: var(--blue-ink); font-weight: 700; font-size: 14px; text-decoration: none; }

/* ---------- watchlist banner (Bounty) ---------- */
.watchbanner { display: flex; align-items: center; gap: 12px; width: 100%; margin: 12px 0 6px; padding: 14px 14px; border-radius: var(--r-lg);
  background: var(--blue); color: var(--blue-ink); text-align: left; }
.watchbanner .wb-ic { width: 40px; height: 40px; border-radius: 12px; background: #fff; display: grid; place-items: center; flex: none; }
.watchbanner .wb-ic svg { width: 22px; height: 22px; }
.watchbanner .wb-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.watchbanner .wb-txt b { font-size: 16px; font-weight: 800; }
.watchbanner .wb-txt small { font-size: 13px; opacity: .8; }
.watchbanner .wb-count { background: var(--alert); color: #fff; font-weight: 800; font-size: 13px; min-width: 24px; height: 24px; line-height: 24px;
  padding: 0 7px; border-radius: 12px; text-align: center; }
.watchbanner .wb-chev { width: 18px; height: 18px; flex: none; opacity: .6; }

/* ---------- settings ---------- */
.setlist { list-style: none; padding: 0; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.setlist li + li { border-top: 1px solid var(--line); }
.setrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 14px; text-align: left; font-size: 16px; font-weight: 600; color: var(--ink); }
.setrow > svg:first-child { width: 22px; height: 22px; flex: none; }
.setrow .sr-label { flex: 1; }
.setrow .chev { width: 18px; height: 18px; opacity: .5; }
.dot.inline { position: static; box-shadow: none; }
.switch { width: 46px; height: 28px; border-radius: 14px; background: #cfd6de; position: relative; flex: none; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .15s; }
.setrow[aria-checked="true"] .switch { background: #3fae6a; }
.setrow[aria-checked="true"] .switch::after { transform: translateX(18px); }
.pwform { display: grid; gap: 10px; }

/* ---------- one box page ---------- */
.bv-sum { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: grid; gap: 8px; margin-bottom: 14px; }
.bv-row { display: flex; align-items: center; justify-content: space-between; }
.bv-amt { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.bv-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 4px 0; }
.bv-facts div { min-width: 0; }
.bv-facts dt { font-size: 12px; color: var(--muted); }
.bv-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.bv-items { list-style: none; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: #fff; }
.bv-items li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: baseline; padding: 12px 14px; }
.bv-items .bv-name { grid-column: 1 / -1; }
.bv-items li + li { border-top: 1px solid var(--line); }
.bv-items .bv-name { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.bv-items small { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 2px; }
.bv-items .bv-qty { white-space: nowrap; color: var(--muted); font-size: 14px; font-weight: 600; }
.bv-items .bv-tot { font-weight: 800; min-width: 56px; text-align: right; }
.bv-items .chip { font-size: 11px; padding: 1px 6px; }
.bv-facts .bv-trk { grid-column: 1 / -1; }
.bv-facts .bv-trk dd { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.bounty .b-photo:has(.noimg) { aspect-ratio: auto; height: 120px; }
