/* =====================================================================
   WorthIt — "Tonal" look (mobile-first, light + dark)
   ===================================================================== */
:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #e3e9f2;
  --text: #0f172a;
  --muted: #526072;
  --border: #d5dde8;
  --hero: #1e3a8a;          /* header block */
  --hero-2: #2b4aa3;        /* buttons on header */
  --hero-line: #4a64b8;
  --hero-muted: #c7d2fe;
  --primary: #1e3a8a;
  --primary-ink: #ffffff;
  --accent: #c2410c;        /* WorthIt */
  --accent-ink: #ffffff;
  --accent-soft: #fff1e8;
  --accent-soft-ink: #9a3412;
  --track: #c3ccd8;
  --chip-on: #1e3a8a;
  --radius: 20px;
  --radius-sm: 12px;
  --font: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #131c2e;
    --surface-2: #1c2740;
    --text: #e6ebf3;
    --muted: #a3b1c6;
    --border: #26324a;
    --hero: #172554;
    --hero-2: #22357a;
    --hero-line: #3a4f97;
    --primary: #93b4ff;
    --primary-ink: #0b1220;
    --accent: #c2410c;
    --accent-soft: #3a1d0e;
    --accent-soft-ink: #fdba8c;
    --track: #3a465e;
    --chip-on: #3a56b8;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Nov 3: nothing may make the page wider than the screen (a phone would zoom the whole page out and pan); clip, not hidden,
   so the sticky store headings keep working */
html, body { overflow-x: clip; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 var(--font); }
a { color: var(--primary); }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
button { font: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hero :focus-visible { outline-color: #ffffff; }

/* ---------- header block ---------- */
.hero { background: var(--hero); color: #ffffff; border-radius: 0 0 28px 28px; }
.hero-inner { padding-top: 14px; padding-bottom: 16px; display: grid; gap: 12px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #ffffff; }
.brand-mark { width: 30px; height: 30px; border-radius: 999px; background: #ffffff; display: grid; place-items: center; }
.brand-mark svg { width: 16px; height: 16px; stroke: #1e3a8a; stroke-width: 3.2; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.icon-btn { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--hero-2); color: #ffffff; display: grid; place-items: center; cursor: pointer; }
.icon-btn[aria-expanded="true"] { background: #ffffff; color: #1e3a8a; }

/* location toggle */
.loc-toggle { width: 100%; min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: #ffffff; text-align: left; cursor: pointer; }
.loc-text { display: grid; min-width: 0; }
.loc-kicker { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--hero-muted); }
.loc-label { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-chev { margin-left: auto; width: 32px; height: 32px; border-radius: 999px; background: var(--hero-2); display: grid; place-items: center; }
.loc-chev svg { width: 16px; height: 16px; stroke-width: 2.4; transition: transform .2s; }
.loc-toggle[aria-expanded="true"] .loc-chev svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .loc-chev svg { transition: none; } }

.loc-panel { display: grid; gap: 10px; }
.loc-panel[hidden] { display: none; }
.loc-row { display: flex; gap: 8px; }
.loc-row .input { flex: 1; min-width: 0; }
.postal { letter-spacing: .01em; }   /* no uppercase: the box takes city names too (Oct 7) */
.postal::placeholder { text-transform: none; letter-spacing: 0; }
.loc-status { margin: 0; min-height: 18px; font-size: 13px; color: var(--hero-muted); }
.radius-row { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.radius-row label { font-size: 13px; font-weight: 600; color: var(--hero-muted); }
.radius-row input[type=range] { flex: 1; min-width: 0; height: 32px; accent-color: #ffffff; cursor: pointer; }
.radius-row output { min-width: 52px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (min-width: 640px) {
  .loc-panel { grid-template-columns: 1fr auto; align-items: center; }
  .loc-panel .radius-row { grid-column: 1 / -1; max-width: 480px; }
  .loc-panel .loc-status { grid-column: 1 / -1; }
}

/* ---------- inputs & buttons ---------- */
.input, select.input {
  font: inherit; font-size: 15px; color: var(--text); background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0 14px; min-height: 44px; width: 100%;
}
.hero .input { border-color: transparent; background: #ffffff; color: #0f172a; }
.input.compact { min-height: 40px; padding: 0 12px; width: auto; border-radius: 999px; }
.btn {
  border: 1px solid var(--primary); background: var(--primary); color: var(--primary-ink); font-weight: 700;
  border-radius: var(--radius-sm); padding: 0 18px; min-height: 44px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-outline-light { background: transparent; border-color: var(--hero-line); color: #ffffff; font-weight: 600; }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--surface); font-weight: 600; }
.btn.compact { min-height: 40px; padding: 0 14px; border-radius: 999px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.link { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 4px 0; text-decoration: underline; }

.card { background: var(--surface); border-radius: var(--radius); padding: 14px; }
main > section { margin-top: 12px; }

/* search (inside header) */
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #526072; width: 18px; height: 18px; }
.search .input { padding-left: 42px; border-radius: 999px; }

/* ---------- settings ---------- */
.settings { margin-top: 14px; }
.setting label { display: grid; gap: 2px; }
.range-row { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.range-row input[type=range] { flex: 1; accent-color: var(--accent); min-height: 32px; }

/* ---------- filters ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips-sub { padding-top: 4px; }
.chip {
  flex: none; font-size: 14px; font-weight: 600; white-space: nowrap; border: 0; background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 0 16px; min-height: 40px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.chip .count { color: var(--muted); font-size: 12px; font-weight: 500; }
.chip[aria-pressed="true"] { background: var(--chip-on); color: #ffffff; }
.chip[aria-pressed="true"] .count { color: var(--hero-muted); }
.chips-sub .chip { min-height: 34px; font-size: 13px; padding: 0 12px; background: transparent; border: 1px solid var(--border); }
.chips-sub .chip[aria-pressed="true"] { background: var(--chip-on); border-color: var(--chip-on); color: #ffffff; }
.chips-sub .chip[aria-pressed="true"] .count { color: var(--hero-muted); }
.stores .chips { flex-wrap: wrap; overflow: visible; }
.stores .chip { background: var(--bg); }
.stores .chip[aria-pressed="true"] { background: var(--chip-on); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.stores { margin-top: 10px; }
.stores-head { display: grid; gap: 2px; margin-bottom: 8px; }
.stores-actions { margin-top: 6px; display: flex; gap: 16px; flex-wrap: wrap; }

.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.summary { margin: 0; color: var(--muted); font-size: 14px; }
.summary strong { color: var(--text); }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; user-select: none; font-size: 14px; font-weight: 600; white-space: nowrap; position: relative; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-ui { width: 40px; height: 24px; border-radius: 999px; background: var(--track); position: relative; transition: background .15s; }
.toggle-ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.toggle input:checked + .toggle-ui { background: var(--accent); }
.toggle input:checked + .toggle-ui::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-ui { outline: 2px solid var(--primary); outline-offset: 2px; }

.pill { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); font-size: 12px; font-weight: 700; }
.pill:empty { display: none; }
.pill-strong { background: var(--accent-soft); color: var(--accent-soft-ink); font-size: 14px; padding: 4px 10px; min-width: 52px; }

/* ---------- results: tile grid ---------- */
.results, .tile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
@media (min-width: 680px) { .results, .tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; } }
@media (min-width: 960px) { .results, .tile-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.results.grouped { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }

.deal { display: flex; flex-direction: column; gap: 8px; padding: 12px; min-width: 0; }
.thumb { width: 100%; height: 150px; padding: 6px; border: 0; border-radius: 14px; background: #ffffff; overflow: hidden; display: grid; place-items: center; position: relative; box-shadow: inset 0 0 0 1px var(--surface-2); cursor: zoom-in; }
@media (min-width: 680px) { .thumb { height: 170px; } }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.thumb > svg { color: var(--muted); width: 28px; height: 28px; }
.thumb.no-img { background: var(--surface-2); box-shadow: none; }
.off-pill { position: absolute; top: 8px; left: 8px; font-size: 12px; font-weight: 800; padding: 4px 8px; border-radius: 999px; background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.is-worthit .off-pill { background: var(--accent); color: var(--accent-ink); }
.deal-name { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.store { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.35; }
.store b { color: var(--text); font-weight: 600; }
/* Nov 3 (Charles: the tour was "super zoomed in" on his parents' iPhone): "+3 more No Frills stores nearby" no longer stays on
   one line in a tile; on a narrow phone it was wider than the tile, made the page wider than the screen, and the phone then
   showed everything (the tour included) zoomed and cut off */
.store .more { white-space: normal; }
.store .more::before { content: "· "; }
.price-block { margin-top: auto; }
.price { font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 1px; }
.per, .reg { font-size: 12px; color: var(--muted); }
.reg s { text-decoration-thickness: 1px; }
/* Oct 13: shelf baseline explanation under the usual price in the deal detail */
.reg .baseline-note { display: block; font-size: 11px; color: var(--muted); opacity: .85; margin-top: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.tag-offer { background: var(--surface-2); color: var(--text); font-weight: 600; }
/* Oct 17: member price chip ("Scene+ member price") */
.tag-member { background: #dbeafe; color: #1e3a8a; font-weight: 700; }
@media (prefers-color-scheme: dark) { .tag-member { background: #1e3a8a; color: #dbeafe; } }
.badge { align-self: flex-start; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-soft-ink); }
.badge svg { width: 12px; height: 12px; stroke-width: 3.5; }

.empty { text-align: center; padding: 28px 16px; color: var(--muted); margin-top: 4px; }
.empty strong { color: var(--text); display: block; margin-bottom: 4px; }

/* loading skeleton */
.skeleton { height: 250px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

.footer { margin: 28px auto 40px; color: var(--text); font-size: 13px; }
.footer p { margin: 0 0 8px; }
.store-reg { font-size: 11px; color: var(--muted); }
.store-link { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 2px; }
.store-link:hover { text-decoration-color: currentColor; }

/* ---------- add a regular price ---------- */
.add-reg { align-self: stretch; margin-top: 2px; min-height: 36px; border: 1px dashed var(--border); border-radius: 10px; background: transparent; color: var(--primary); font-size: 12px; font-weight: 700; cursor: pointer; padding: 6px 8px; }
.add-reg:hover { border-style: solid; border-color: var(--primary); }
.reg-dialog { border: 0; border-radius: 20px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(15, 23, 42, .35); }
.reg-dialog::backdrop { background: rgba(15, 23, 42, .5); }
.reg-form { display: grid; gap: 10px; padding: 18px; }
.reg-title { margin: 0; font-size: 18px; }
.reg-name { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.reg-sale { margin: -6px 0 0; }
.reg-field { display: grid; gap: 6px; font-size: 13px; font-weight: 600; }
.reg-field .input { font-weight: 400; }
.reg-price-row { display: flex; align-items: center; gap: 8px; }
.reg-price-row .input { flex: 1; min-width: 0; }
.reg-dollar { font-weight: 800; font-size: 18px; color: var(--muted); }
.reg-units { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.reg-units[hidden] { display: none; }
.reg-units label { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; background: var(--surface-2); font-size: 14px; font-weight: 600; cursor: pointer; }
.reg-units input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.reg-units label:has(input:checked) { background: var(--chip-on); color: #ffffff; }
.reg-units label:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.reg-note, .reg-preview, .reg-status { margin: 0; }
.reg-note[hidden] { display: none; }
.reg-preview strong { color: var(--text); }
.reg-status.ok { color: #15803d; } .reg-status.err { color: #b91c1c; }
@media (prefers-color-scheme: dark) { .reg-status.ok { color: #4ade80; } .reg-status.err { color: #fca5a5; } }
.reg-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }

/* ---------- tiles are tappable ---------- */
.deal { cursor: pointer; }
.deal:hover { box-shadow: 0 0 0 2px var(--border); }
.off-pill { pointer-events: none; }

/* ---------- expanded tile ---------- */
.detail-dialog { border: 0; padding: 0; border-radius: 22px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgba(15, 23, 42, .4); overflow: auto; }
.detail-dialog::backdrop { background: rgba(15, 23, 42, .6); }
.detail-close { position: sticky; top: 10px; float: right; margin: 10px 10px -54px 0; z-index: 2; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; box-shadow: 0 1px 4px rgba(15, 23, 42, .25); }
.detail-body { display: grid; }
.detail-img { background: #ffffff; display: grid; place-items: center; padding: 16px; min-height: 200px; }
.detail-img img { width: 100%; height: auto; max-height: 62dvh; object-fit: contain; }
.detail-img.no-img { background: var(--surface-2); }
.detail-img > svg { width: 40px; height: 40px; color: var(--muted); }
.detail-info { display: grid; gap: 8px; padding: 16px 18px 20px; }
.detail-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-badges:empty { display: none; }
.off-pill.static { position: static; font-size: 13px; }
.is-worthit .off-pill.static { background: var(--accent); color: var(--accent-ink); }
.detail-name { margin: 0; font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.detail-info .store { font-size: 14px; }
.detail-info .price { font-size: 26px; }
.detail-info .per, .detail-info .reg { font-size: 14px; }
.detail-info .tag { font-size: 12px; }
.summary-wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; min-width: 0; }
.clear-filters { font-size: 13px; font-weight: 600; padding: 10px 0; }

/* ---------- toolbar: department · filters · sort ---------- */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.toolbar .btn svg { width: 18px; height: 18px; }
.dept-btn { font-weight: 800; }
.toolbar-sort { margin-left: auto; }
#filtersCount { background: var(--chip-on); color: #ffffff; }
.filters > .chips { margin-top: 10px; }
.summary-row { margin-top: 8px; }

/* ---------- sheets (bottom sheet on phones, centred panel on wider screens) ---------- */
.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 88dvh; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--text); display: none; flex-direction: column; box-shadow: 0 -10px 40px rgba(15, 23, 42, .3); }
.sheet[open] { display: flex; }
.sheet::backdrop { background: rgba(15, 23, 42, .55); }
@media (min-width: 680px) { .sheet { margin: auto; border-radius: 22px; max-height: 80dvh; } }
.sheet-small { max-width: 420px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px 18px; }
.sheet-head h2 { margin: 0; font-size: 18px; }
.icon-close { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surface-2); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.sheet-body { overflow-y: auto; padding: 0 18px 12px; overscroll-behavior: contain; }
.sheet-foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.sheet-section { padding: 12px 0; border-top: 1px solid var(--border); }
.sheet-section:first-child { border-top: 0; }
.sheet-h3 { margin: 0 0 2px; font-size: 15px; }
.sheet-note { margin: 0 0 8px; }
.sheet-toggle { width: 100%; justify-content: space-between; gap: 12px; white-space: normal; line-height: 1.3; }
.sheet-toggle .small { font-weight: 500; }

.cut-groups { display: grid; gap: 10px; }
.cut-group { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.cut-group legend { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding: 4px 0; grid-column: 1 / -1; }
.check { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; border-radius: 12px; background: var(--surface-2); cursor: pointer; font-size: 14px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--chip-on); flex: none; }
.check .count { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 500; }
.check:has(input:checked) { box-shadow: inset 0 0 0 2px var(--chip-on); }
.stores-chips { flex-wrap: wrap; overflow: visible; }
.stores-chips .chip { background: var(--surface-2); }
.stores-chips .chip[aria-pressed="true"] { background: var(--chip-on); color: #ffffff; }

.dept-list { display: grid; gap: 8px; padding-bottom: 8px; }
.dept-option { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 14px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: 16px; font-weight: 700; cursor: pointer; text-align: left; }
.dept-option[aria-checked="true"] { background: var(--chip-on); color: #ffffff; }
.dept-option[aria-checked="true"] .count { color: var(--hero-muted); }
.dept-option .count { font-size: 13px; font-weight: 500; color: var(--muted); }
.dept-option[disabled] { opacity: .55; cursor: default; }
.dept-soon { margin: 4px 2px 0; }
/* Oct 31: "Not covered yet" under the departments, and the red dot on the button until it's been opened once */
.dept-missing { margin-top: 10px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--border); }
.dept-missing h3 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
.dept-missing h3 .new-dot { display: inline-block; vertical-align: middle; margin-left: 4px; }
.dept-missing p { margin: 0 0 8px; }
.dept-missing ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.dept-missing li { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 5px 10px; }
.new-dot { width: 9px; height: 9px; border-radius: 999px; background: #dc2626; box-shadow: 0 0 0 2px var(--surface); flex: none; }
.brand-beta { margin-left: 2px; font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #ffffff;
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 2px 7px; }

/* ---------- shopping list ---------- */
.hero-actions { display: flex; gap: 8px; }
.list-btn { position: relative; }
.list-count { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #ffffff; font-size: 11px; font-weight: 800; line-height: 20px; text-align: center; box-shadow: 0 0 0 2px var(--hero); }
.list-count[hidden] { display: none; }
/* floating list button (Oct 10, Charles: "the list icon should always travel with the user when they are scrolling") */
button.list-fab { position: fixed; z-index: 30; top: calc(10px + env(safe-area-inset-top)); right: 14px; background: var(--hero); box-shadow: 0 4px 14px rgba(15, 23, 42, .32);
  opacity: 0; transform: translateY(-14px) scale(.9); pointer-events: none; transition: opacity .18s, transform .18s; }
.list-fab.show { opacity: 1; transform: none; pointer-events: auto; }
.list-fab .list-count { box-shadow: 0 0 0 2px var(--bg); }
/* "it went to your list": a dot flies from the card to the list button, the badge pops */
.fly-dot { position: fixed; z-index: 70; width: 40px; height: 40px; border-radius: 999px; background: var(--accent); color: #ffffff; display: grid; place-items: center;
  pointer-events: none; overflow: hidden; box-shadow: 0 4px 14px rgba(15, 23, 42, .3); }
.fly-dot img { width: 100%; height: 100%; object-fit: cover; }
.fly-dot svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.list-btn.bump { animation: list-bump .5s cubic-bezier(.2, 1.4, .4, 1); }
.list-count.bump { animation: badge-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes list-bump { 0% { transform: scale(1); } 40% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes badge-pop { 0% { transform: scale(.3); } 60% { transform: scale(1.35); } 100% { transform: scale(1); } }
.list-fab.bump { animation: none; }   /* the fab keeps its own transform; only its badge pops */
@media (prefers-reduced-motion: reduce) { .list-fab { transition: none; } .list-btn.bump, .list-count.bump { animation: none; } }

/* "+" on each tile (top-right of the picture) */
.deal { position: relative; isolation: isolate; }   /* Oct 19: the % off sticker and + button stay under the sticky store heading (the Oct 10 fix was on the photo box, gone since Oct 11) */
.add-list { position: absolute; top: 18px; right: 18px; z-index: 1; width: 40px; height: 40px; border-radius: 999px; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--primary); box-shadow: 0 1px 4px rgba(15, 23, 42, .28); }
.add-list svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.add-list[aria-pressed="true"] { background: var(--chip-on); color: #ffffff; }
.add-list:hover { transform: scale(1.05); }
.add-list-wide { width: 100%; }
.add-list-wide svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.add-list-wide.on { background: var(--surface-2); border-color: var(--surface-2); color: var(--text); }

/* the list itself */
.list-body { padding-top: 4px; }
.list-items { list-style: none; margin: 0; padding: 0; display: grid; }
.li { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.li-check { width: 22px; height: 22px; flex: none; margin: 0 2px; accent-color: var(--chip-on); cursor: pointer; }
.li-thumb { flex: none; width: 44px; height: 44px; padding: 2px; border: 0; border-radius: 10px; background: #ffffff; box-shadow: inset 0 0 0 1px var(--surface-2); display: grid; place-items: center; overflow: hidden; cursor: zoom-in; }
.li-thumb img { width: 100%; height: 100%; object-fit: contain; }
.li-thumb.no-img { background: var(--surface-2); box-shadow: none; }
.li-thumb > svg { width: 20px; height: 20px; color: var(--muted); }
.li-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.li-text { font: inherit; font-size: 15px; font-weight: 600; color: var(--text); background: transparent; border: 0; border-radius: 6px; padding: 4px 4px; margin: 0 -4px; width: 100%; min-height: 32px; }
.li-text:focus { outline: none; background: var(--surface-2); }
.li-meta { font-size: 12px; color: var(--muted); padding: 0 0 2px; overflow-wrap: anywhere; }
.li-expired { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; line-height: 1; padding: 3px 6px 2px; border-radius: 999px; color: #991b1b; background: #fee2e2; vertical-align: 1px; margin-right: 2px; }
.li.expired .li-thumb { opacity: .45; filter: grayscale(1); }
.li.expired .li-meta s { color: var(--muted); }
@media (prefers-color-scheme: dark) { .li-expired { color: #fecaca; background: #7f1d1d; } }
.li-del { flex: none; width: 40px; height: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.li-del svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.li-del:hover { background: var(--surface-2); color: var(--text); }
.li.done .li-text { text-decoration: line-through; color: var(--muted); font-weight: 500; }
/* Oct 19 (multi-item tiles): a deal's name on the list, split like its tile; tap to edit (the text box takes its place) */
.li-name { all: unset; box-sizing: border-box; display: grid; gap: 1px; cursor: text; padding: 4px 0; min-height: 32px; overflow-wrap: anywhere; }
.li-name:focus-visible { outline: 2px solid var(--accent); border-radius: 6px; }
.li-name-head { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.3; }
.li-also { font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.li.done .li-name-head { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.li.done .li-thumb { opacity: .5; }

.list-add { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.list-add > svg { width: 22px; height: 22px; flex: none; margin: 0 2px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.list-add-input { flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--text); background: transparent; border: 0; padding: 8px 0; min-height: 40px; }
.list-add-input:focus { outline: none; }
.list-add-input::placeholder { color: var(--muted); }
.list-add:focus-within { border-bottom-color: var(--primary); }
.list-empty { margin: 14px 0 4px; }
.list-empty[hidden] { display: none; }
.list-done { margin-top: 14px; }
.list-done[hidden] { display: none; }
.list-done summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--muted); padding: 8px 0; list-style-position: inside; }
.list-done .link { margin-top: 6px; }
.list-note { margin: 18px 0 4px; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: calc(104px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 14px;
  max-width: calc(100vw - 32px); padding: 10px 10px 10px 16px; border-radius: 14px; background: #0f172a; color: #ffffff; font-size: 14px; font-weight: 600; box-shadow: 0 8px 30px rgba(15, 23, 42, .35); white-space: nowrap; }
.toast[hidden] { display: none; }
.toast-action { border: 0; background: transparent; color: #fdba8c; font: inherit; font-weight: 800; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.toast-action[hidden] { display: none; }
@media (prefers-color-scheme: dark) { .toast { background: #e6ebf3; color: #0b1220; } .toast-action { color: #c2410c; } }

/* ---------- By store / All deals switch ---------- */
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface); flex: none; }
.seg button { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 700; padding: 0 12px; min-height: 34px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--chip-on); color: #ffffff; }

/* ---------- store groups ---------- */
.store-group { display: grid; gap: 8px; }
.sg-head { display: grid; gap: 1px; padding: 0 60px 0 2px; position: sticky; top: 0; z-index: 2; background: var(--bg); padding-top: 8px; padding-bottom: 6px; }
.sg-name { margin: 0; font-size: 18px; line-height: 1.25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sg-name .store-link { color: var(--text); text-decoration-color: var(--border); }
.sg-meta { margin: 0; font-size: 13px; color: var(--muted); }
.sg-meta .more-nearby { white-space: nowrap; }   /* "+3 more No Frills nearby" stays on one line */
.mine-pill { font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 999px; background: var(--chip-on); color: #ffffff; letter-spacing: .02em; }
.store-group .tile-grid { margin-top: 0; }
.grouped .deal .store { display: none; }          /* the group header already says which store */
.only-mine { margin-top: 8px; }
.only-mine:has(input:disabled) { opacity: .5; cursor: default; }
.empty-showall { margin-top: 12px; }

/* ---------- WorthIt dock (always visible, bottom of the screen) ---------- */
body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.wk-dock { position: fixed; z-index: 20; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 14px; padding: 6px 6px 6px 16px; border-radius: 999px;
  background: var(--surface); color: var(--text); box-shadow: 0 6px 24px rgba(15, 23, 42, .28), inset 0 0 0 2px var(--border); }
.wk-dock.on { box-shadow: 0 6px 24px rgba(15, 23, 42, .28), inset 0 0 0 2px var(--accent); }
.wk-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; min-height: 44px; position: relative; }
.wk-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wk-toggle { flex: none; width: 46px; height: 28px; }
.wk-toggle::after { width: 22px; height: 22px; }
.wk-input:checked + .wk-toggle { background: var(--accent); }
.wk-input:checked + .wk-toggle::after { transform: translateX(18px); }
.wk-input:focus-visible + .wk-toggle { outline: 2px solid var(--primary); outline-offset: 2px; }
.wk-label { display: grid; line-height: 1.15; }
.wk-label strong { font-size: 15px; font-weight: 800; }
.wk-dock.on .wk-label strong { color: var(--accent-soft-ink); }
.wk-hint { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.knob { position: relative; width: 68px; height: 68px; flex: none; border-radius: 999px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.knob:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.knob.turning { cursor: grabbing; }
.knob svg { width: 100%; height: 100%; display: block; }
.knob-face { fill: var(--surface-2); stroke: none; }
.knob-track { fill: none; stroke: var(--track); stroke-width: 6; stroke-linecap: round; }
.knob-fill { fill: none; stroke: var(--muted); stroke-width: 6; stroke-linecap: round; }
.knob-dot { fill: var(--surface); stroke: var(--muted); stroke-width: 2.5; }
.wk-dock.on .knob-fill { stroke: var(--accent); }
.wk-dock.on .knob-dot { stroke: var(--accent); }
.knob.turning .knob-dot { r: 5.5; }
.knob-val { position: absolute; inset: 0; display: grid; place-items: center; font-size: 16px; font-weight: 800; letter-spacing: -.02em; pointer-events: none; }
@media (min-width: 960px) { .wk-dock { left: auto; right: 24px; transform: none; } }

/* % bubble above the finger while turning the knob */
.knob-bubble { position: fixed; z-index: 60; transform: translate(-50%, -100%); pointer-events: none; display: grid; justify-items: center; gap: 0;
  min-width: 76px; padding: 8px 12px 7px; border-radius: 16px; background: var(--accent); color: #ffffff; box-shadow: 0 8px 24px rgba(15, 23, 42, .3); }
.knob-bubble[hidden] { display: none; }
.knob-bubble strong { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.knob-bubble span { font-size: 12px; font-weight: 700; opacity: .9; margin-top: 3px; white-space: nowrap; }
.knob-bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: var(--accent); transform: translateX(-50%) rotate(45deg); border-radius: 2px; }

/* ---------- My stores (inside the location panel, on the blue header) ---------- */
.my-stores { display: grid; gap: 8px; margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--hero-line); }
@media (min-width: 680px) { .my-stores { grid-column: 1 / -1; } }
.ms-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ms-title { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.ms-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #ffffff; color: var(--hero); font-size: 12px; font-weight: 800; display: inline-grid; place-items: center; }
.ms-count:empty { display: none; }
.ms-clear, .ms-more { border: 0; background: transparent; color: #ffffff; font: inherit; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; padding: 8px 0; justify-self: start; }
.ms-clear[hidden], .ms-more[hidden] { display: none; }
.ms-note { margin: -4px 0 0; font-size: 13px; color: var(--hero-muted); }
.ms-search { position: relative; }
.ms-search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: #526072; width: 18px; height: 18px; }
.ms-search .input { padding-left: 38px; min-height: 42px; }
.ms-list { display: grid; gap: 6px; max-height: min(46dvh, 360px); overflow-y: auto; overscroll-behavior: contain; padding: 2px; margin: 0 -2px; }
.ms-group { margin: 6px 0 0; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--hero-muted); }
.ms-group:first-child { margin-top: 0; }
.ms-empty { margin: 4px 0; font-size: 13px; color: var(--hero-muted); }
/* Oct 31 (Trello 265): the beta note, a supported store's "loading" line, "Suggest a store" */
.ms-beta { margin: 10px 0 0;font-size: 13px; color: var(--hero-muted); line-height: 1.4; }
.ms-beta strong { color: #ffffff; }
.ms-status { margin: -2px 4px 2px 46px; font-size: 12.5px; color: var(--hero-muted); line-height: 1.4; }
.ms-beta .link, .ms-status .link, .ms-suggest .link { color: #ffffff; font-size: inherit; padding: 0; font-weight: 700; }
.welcome .ms-beta, .welcome .ms-status, .welcome .ms-suggest { color: var(--muted); }
.welcome .ms-beta strong { color: var(--text); }
.welcome .ms-beta .link, .welcome .ms-status .link, .welcome .ms-suggest .link { color: var(--primary); }
#suggestList:empty { display: none; }
#storeReportNote { width: 100%; resize: vertical; min-height: 72px; }
.ms-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 12px; border: 0; border-radius: 14px; background: var(--hero-2); color: #ffffff; font: inherit; text-align: left; cursor: pointer; }
.ms-row:hover { background: var(--hero-line); }
.ms-row[aria-checked="true"] { background: #ffffff; color: #0f172a; }
.ms-star { flex: none; width: 24px; height: 24px; display: grid; place-items: center; }
.ms-star svg { width: 22px; height: 22px; stroke-width: 1.8; }
.ms-row[aria-checked="true"] .ms-star svg { fill: var(--accent); stroke: var(--accent); }
.ms-name { flex: 1; min-width: 0; display: grid; font-size: 14px; font-weight: 700; line-height: 1.25; }
.ms-sub { font-size: 12px; font-weight: 500; color: var(--hero-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-row[aria-checked="true"] .ms-sub { color: #526072; }
.ms-deals { flex: none; font-size: 12px; font-weight: 600; color: var(--hero-muted); }
.ms-row[aria-checked="true"] .ms-deals { color: #526072; }
.ms-only { justify-content: space-between; gap: 12px; white-space: normal; line-height: 1.3; color: #ffffff; }
.ms-only:has(input:disabled) { opacity: .55; cursor: default; }
.ms-hint { font-size: 12px; font-weight: 500; color: var(--hero-muted); }
.hero .toggle-ui { background: var(--hero-line); }

/* ---------- other stores fold-away bar (when you have My stores) ---------- */
.others-bar { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 2px dashed var(--border); border-radius: 16px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.others-bar:hover { border-style: solid; border-color: var(--primary); }
.others-bar.open { border-style: solid; background: var(--surface); }
.ob-plus { flex: none; width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; background: var(--chip-on); color: #ffffff; font-size: 22px; font-weight: 700; line-height: 1; }
.others-bar.open .ob-plus { background: var(--surface-2); color: var(--text); }
.ob-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ob-text strong { font-size: 15px; }
.ob-text span { font-size: 13px; color: var(--muted); }
.ob-chev { flex: none; color: var(--muted); }
.ob-chev svg { transition: transform .2s; }
.others-bar.open .ob-chev svg { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .ob-chev svg { transition: none; } }
.mine-empty { margin: 0; color: var(--muted); font-size: 14px; }
.seg.scope button { padding: 0 10px; }
.seg[hidden] { display: none; }

/* ---------- header search: magnifier that opens across the header row ---------- */
.hero-top { position: relative; min-height: 44px; }
.icon-btn { position: relative; }
.search-dot { position: absolute; top: 9px; right: 9px; width: 9px; height: 9px; border-radius: 999px; background: var(--accent); box-shadow: 0 0 0 2px var(--hero-2); }
.search-dot[hidden] { display: none; }
.hero-search { position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding: 0 4px 0 14px; border-radius: 999px; background: #ffffff; color: #0f172a;
  opacity: 0; pointer-events: none; transform: scaleX(.12); transform-origin: right center; transition: transform .22s ease, opacity .16s ease; }
.hero-search > svg { color: #526072; width: 18px; height: 18px; flex: none; }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 16px; color: #0f172a; min-height: 44px; outline: none; }
.hero-search input::-webkit-search-cancel-button { display: none; }
.hs-close { flex: none; width: 36px; height: 36px; border: 0; border-radius: 999px; background: #e3e9f2; color: #0f172a; display: grid; place-items: center; cursor: pointer; }
.hs-close svg { width: 16px; height: 16px; }
.brand, .hero-actions { transition: opacity .15s ease; }
.hero-top.searching .hero-search { opacity: 1; pointer-events: auto; transform: none; }
.hero-top.searching .brand, .hero-top.searching .hero-actions { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .hero-search, .brand, .hero-actions { transition: none; } }

/* ---------- row 1: one scrolling rail (department · filters · type chips) ---------- */
.rail { display: flex; align-items: center; gap: 8px; overflow-x: auto; margin: 4px -16px 0; padding: 2px 16px 4px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.rail::-webkit-scrollbar { display: none; }
.rail-chips { display: contents; }
.rail-dept { font-weight: 800; gap: 4px; padding: 0 12px 0 16px; }
.rail-dept svg { width: 16px; height: 16px; stroke-width: 2.4; }
.rail-filter { position: relative; width: 40px; padding: 0; justify-content: center; }
.rail-filter svg { width: 18px; height: 18px; }
.rail-filter.on { background: var(--chip-on); color: #ffffff; }
.rail-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #ffffff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; }
.rail-badge:empty { display: none; }
.rail-sep { flex: none; width: 1px; height: 24px; background: var(--border); }
.scope-chip[hidden] { display: none; }
.scope-chip[aria-pressed="true"] { background: var(--chip-on); color: #ffffff; }
.filters .summary-row { margin-top: 6px; }

/* "Safeway Beltline is My Store" / "3 of My Stores selected" under the location */
.loc-stores { font-size: 13px; font-weight: 600; color: var(--hero-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.loc-stores[hidden] { display: none; }

/* ---------- thank-you card after reporting a price ---------- */
.reg-thanks { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 26px 22px 20px; }
.reg-thanks[hidden], .reg-form[hidden] { display: none; }
.rt-burst { width: 64px; height: 64px; border-radius: 999px; background: var(--accent); color: #ffffff; display: grid; place-items: center; margin-bottom: 4px;
  box-shadow: 0 0 0 8px var(--accent-soft); animation: rt-pop .45s cubic-bezier(.2, 1.4, .4, 1) both; }
.rt-burst svg { width: 34px; height: 34px; stroke-width: 3.2; }
.rt-title { margin: 6px 0 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.rt-sub { margin: 0; font-size: 15px; color: var(--text); line-height: 1.45; max-width: 30ch; }
.rt-count { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.rt-done { width: 100%; margin-top: 10px; }
@keyframes rt-pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rt-burst { animation: none; } }

/* "Price is for [400] [g]" */
.reg-amount { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.reg-amount[hidden] { display: none; }
.reg-amount label:first-child { white-space: nowrap; }
.reg-amount input { flex: 1; min-width: 0; }
.reg-amount select { width: auto; flex: none; padding-right: 10px; }
.reg-units:has(> label:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reg-units label { text-align: center; padding: 0 6px; line-height: 1.2; }

/* shopping list: Copy / Share */
.list-head-actions { display: flex; gap: 6px; margin-left: auto; margin-right: 8px; }
.list-act { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.list-act svg { width: 18px; height: 18px; }
.list-act:disabled { opacity: .45; cursor: default; }
@media (max-width: 360px) { .list-act span { display: none; } .list-act { width: 40px; padding: 0; justify-content: center; } }

/* ---------- welcome / coverage dialog ---------- */
.welcome-body { display: grid; gap: 12px; padding: 20px 18px 18px; }
.welcome-body[hidden] { display: none; }
.welcome .loc-row { display: flex; gap: 8px; }
.welcome .loc-row .input { flex: 1; min-width: 0; }
.welcome-geo { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.welcome-geo svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.welcome-actions { display: grid; gap: 8px; }
.welcome-actions .btn { width: 100%; text-align: center; text-decoration: none; }
.welcome-actions [hidden] { display: none; }
.welcome .btn-ghost { border-color: var(--border); }

/* % off band along the bottom of the tile photo (Oct 6) — never covers the product */
.thumb.has-band { padding-bottom: 38px; }
.off-band { position: absolute; left: 0; right: 0; bottom: 0; height: 32px; display: flex; align-items: center; justify-content: center; gap: 5px;
  background: var(--hero); color: #fff; font-size: 14px; font-weight: 900; letter-spacing: .01em; white-space: nowrap; pointer-events: none; }
.off-band svg { width: 13px; height: 13px; stroke-width: 3.5; }
.off-band .ob-sep { opacity: .8; }
.is-worthit .off-band { background: var(--accent); color: var(--accent-ink); }
.thumb.has-band { container-type: inline-size; }
@container (max-width: 180px) { .off-band { font-size: 12.5px; gap: 3px; letter-spacing: 0; } .off-band .ob-sep { display: none; } .off-band svg { width: 12px; height: 12px; } }

/* % off sticker on the tile photo (Oct 6, Charles chose option B; replaces the band) */
.off-sticker { position: absolute; top: 6px; left: 6px; z-index: 2; display: flex; align-items: center; gap: 2px;
  padding: 5px 9px 5px 10px; border-radius: 12px; background: var(--hero); color: #fff; font-weight: 900; font-size: 24px;
  line-height: 1; letter-spacing: -.03em; border: 2px solid #fff; box-shadow: 0 3px 8px rgba(15, 23, 42, .35);
  transform: rotate(-4deg); pointer-events: none; }
.off-sticker small { font-size: 10px; line-height: 1; font-weight: 800; letter-spacing: .02em; text-align: left; }
.is-worthit .off-sticker { background: var(--accent); color: var(--accent-ink); }
@container (max-width: 180px) { .off-sticker { font-size: 21px; padding: 4px 8px 4px 9px; } }
.thumb { container-type: inline-size; isolation: isolate; }   /* keeps the sticker under sticky store headings (Oct 10) */

/* bulk / small size estimate chip (Oct 6) */
.tag-size { background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 700; }

/* report-a-price as a megaphone icon in the tile's bottom-right corner (Oct 6, Charles) */
.add-reg.add-reg-icon { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; min-height: 0; padding: 0;
  display: grid; place-items: center; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--primary); }
.add-reg.add-reg-icon:hover { border-color: var(--primary); background: var(--surface-2); }
.add-reg.add-reg-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.deal { padding-bottom: 12px; }
.deal > :nth-last-child(2):has(+ .add-reg-icon) { margin-right: 44px; min-height: 36px; align-items: center; align-content: center; }   /* the row beside the icon */

/* WorthIt check in front of the % on the sticker (Oct 6) */
.off-sticker .stk-check { display: grid; place-items: center; width: 20px; height: 20px; margin-right: 3px; border-radius: 50%;
  background: #fff; color: var(--accent); }
.off-sticker .stk-upto { margin-right: 3px; text-transform: uppercase; }   /* Oct 19: "UP TO 33% OFF" (free item = the cheapest one) */
.off-sticker .stk-check svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
@container (max-width: 180px) { .off-sticker .stk-check { width: 17px; height: 17px; } .off-sticker .stk-check svg { width: 12px; height: 12px; } }

/* deal ends today / tomorrow (Oct 6) */
.tag-hurry { background: #fde8e8; color: #b42318; font-weight: 700; white-space: nowrap; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag-hurry { background: #3b1414; color: #ffb4ab; } }
:root[data-theme="dark"] .tag-hurry { background: #3b1414; color: #ffb4ab; }

/* ---------- account (Oct 7) ---------- */
.acct-btn.signed-in svg { display: none; }
.acct-initial { width: 30px; height: 30px; border-radius: 999px; background: #ffffff; color: var(--hero, #1e3a8a); font-weight: 800; font-size: 15px; line-height: 30px; text-align: center; text-transform: uppercase; }
.acct-initial[hidden] { display: none; }
#authDialog .loc-row { display: flex; gap: 8px; }
#authDialog .loc-row .input { flex: 1; min-width: 0; }
#authDialog [data-close].btn { width: 100%; }
#authDialog a { color: var(--primary); }
.list-note .link { font-size: inherit; padding: 0; }

/* ---------- Terms & Privacy page (terms.html) ---------- */
.legal-head { background: var(--hero, #1e3a8a); color: #ffffff; padding: 14px 0; }
.legal-head .brand { color: #ffffff; text-decoration: none; }
.legal { max-width: 720px; padding-top: 20px; padding-bottom: 48px; line-height: 1.55; }
.legal h1 { font-size: 28px; margin: 8px 0 4px; }
.legal h2 { font-size: 21px; margin: 32px 0 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.legal h3 { font-size: 16px; margin: 18px 0 4px; }
.legal p, .legal li { font-size: 15px; }
.legal ul { padding-left: 20px; margin: 6px 0 10px; }
.legal li { margin: 4px 0; }
.legal a { color: var(--primary); }
.legal a.btn { color: #ffffff; text-decoration: none; display: inline-block; margin-top: 8px; }
.legal-toc { margin: 10px 0 0; font-size: 14px; }
.acct-btn[hidden] { display: none; }
#authDialog .auth-google { width: 100%; }
#authDialog form[hidden] { display: none; }

/* ---------- city autocomplete (Oct 7) ---------- */
.ac-host { position: relative; }
.ac-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; margin: 0; padding: 6px 0; list-style: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 12px 32px rgba(15, 23, 42, .18); }
.ac-list[hidden] { display: none; }
.ac-list li { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 10px 14px; cursor: pointer; font-size: 15px; }
.ac-list li[aria-selected="true"], .ac-list li:hover { background: var(--surface-2); }
.ac-list strong { font-weight: 800; }
.ac-prov { color: var(--muted, #64748b); font-size: 13px; }

/* first-visit store step: My Stores rows on the light pop-up (Oct 8) */
.welcome .ms-list { max-height: min(40dvh, 330px); }
.welcome .ms-row { background: var(--surface-2); color: var(--text); }
.welcome .ms-row:hover { background: var(--border); }
.welcome .ms-row[aria-checked="true"] { background: var(--accent-soft); color: var(--text); box-shadow: inset 0 0 0 2px var(--accent); }
.welcome .ms-sub, .welcome .ms-deals,
.welcome .ms-row[aria-checked="true"] .ms-sub, .welcome .ms-row[aria-checked="true"] .ms-deals { color: var(--muted); }
.welcome .ms-more { color: var(--primary); padding: 0; }
.welcome .ms-empty { color: var(--muted); }
.welcome-actions [hidden], .welcome .ms-more[hidden] { display: none; }
/* "☆ No stores selected" under the location line */
.loc-stores.none { font-weight: 500; }

/* ---------- text-only deal cards (Oct 11, Charles: "remove the images, just use text for now") ---------- */
.deal-top { display: flex; align-items: center; min-height: 34px; padding-right: 48px; }   /* room for the + button */
.off-sticker.static { position: static; font-size: 19px; padding: 3px 8px 3px 8px; transform: rotate(-2deg); border-width: 1.5px; margin-left: 2px; }
.off-sticker.static small { font-size: 9px; }
/* Nov 3 (Trello 311, Charles on an iPhone SE: "the 'Up to x %' covers the '+'"): on a phone under 371 px wide (the original
   SE, any iPhone with Display Zoom, 360 px Androids) the tiles are 139–159 px and a long sticker reached under the + button.
   There the sticker is set smaller, and an "UP TO" sticker drops its ✓ circle (orange already says WorthIt; screen readers
   still hear "WorthIt"). Wider screens unchanged. */
@media (max-width: 370px) {
  .off-sticker.static { font-size: 16px; padding: 3px 6px; gap: 1px; }
  .off-sticker.static small { font-size: 8px; }
  .off-sticker.static .stk-check { width: 15px; height: 15px; margin-right: 2px; }
  .off-sticker.static .stk-check svg { width: 10px; height: 10px; }
  .off-sticker.static .stk-upto { margin-right: 2px; }
  .off-sticker.static:has(.stk-upto) .stk-check { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0; }
}
.deal { gap: 6px; }
.deal .add-list { top: 10px; right: 10px; width: 36px; height: 36px; }
.deal .add-list svg { width: 20px; height: 20px; }
.deal-name { font-size: 14.5px; }
/* Oct 19 (multi-item tiles, docs/prototypes/multi-item-tile-mockup.html): bold headline (at most 3 lines), the size
   beside it, the other items on a quieter "Also: …" line close under it (at most 2 lines) */
.deal .deal-name { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.deal-name .dn-size, .li-name .dn-size, .up-name-view .dn-size { font-weight: 600; color: var(--muted); }
.deal-also { margin: -4px 0 0; font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.35;
  overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.detail-info { padding-top: 54px; }   /* keeps the close button clear now the picture is gone */

/* ---------- Oct 19: tap a tile -> detail pane; the usual-price box (docs/prototypes/detail-pane-usual-prices-mockup.html) ---------- */
.deal:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.store .store-name { color: var(--text); font-weight: 600; }
.detail-store .store { margin: 0; }
.detail-store .store-link { color: var(--primary); font-weight: 700; text-decoration: none; }
.detail-store .store-link::after { content: " \2197"; }
.detail-info .price-block .reg { font-size: 14px; }
.ub-box { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; margin: 4px 0 2px; }
.ub-box.ub-loading { color: var(--muted); font-size: 13px; }
.ub-head { font-size: 13px; font-weight: 700; margin: 0 0 4px; }
.ub-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 13px; }
.ub-head + .ub-row { border-top: 0; }
.ub-row[hidden] { display: none; }
.ub-store { min-width: 0; overflow-wrap: anywhere; }
.ub-price { font-weight: 700; text-align: right; white-space: nowrap; }
.ub-meta { grid-column: 1 / -1; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.ub-chip { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #e7f6ec; color: #166534; margin-left: 6px; vertical-align: 1px; white-space: nowrap; }
.ub-more { display: block; width: 100%; margin-top: 6px; padding: 8px; border: 0; border-radius: 10px; background: var(--surface); color: var(--primary); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ub-foot { font-size: 12px; color: var(--muted); margin: 8px 0 0; line-height: 1.4; }
.ub-foot.ub-only { margin: 0; }
.detail-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-btns .btn { flex: 1 1 auto; }
.detail-btns .add-reg { align-self: auto; margin: 0; border: 1px solid var(--surface-2); background: var(--surface-2); color: var(--text); font-size: 14px; border-radius: 12px; }
.li-usual { color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .ub-chip { background: #14341f; color: #86efac; } }
:root[data-theme="dark"] .ub-chip { background: #14341f; color: #86efac; }

/* Oct 24 (Trello 162): "(buy 2+)" in the price line and the Multi-buy chip (navy on light blue, like the member chip) */
.price small.terms { color: var(--text); font-weight: 700; margin-left: 4px; }
.terms-note { color: var(--text); }
.li-meta .tag-multi { font-size: 10.5px; padding: 1px 6px; margin-right: 2px; }

/* ---------- beta banner (Oct 31: yellow, closable; was the Oct 12 / Oct 28 maintenance banner) ---------- */
.maint-banner { background: #fef3c7; color: #713f12; border-bottom: 1px solid #fcd34d; }
.maint-banner[hidden] { display: none; }
.maint-inner { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; }
.maint-dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 999px; background: #d97706; }
.maint-banner p { margin: 0; font-size: 14px; line-height: 1.4; flex: 1; }
.maint-banner strong { font-weight: 700; }
.maint-close { flex: none; width: 28px; height: 28px; margin: -3px -4px 0 0; border: 0; border-radius: 999px; background: transparent;
  color: inherit; font-size: 20px; line-height: 1; cursor: pointer; }
.maint-close:hover, .maint-close:focus-visible { background: rgba(0, 0, 0, .08); }
:root[data-theme="dark"] .maint-banner { background: #3a2e0a; color: #fde68a; border-bottom-color: #5c4a12; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .maint-banner { background: #3a2e0a; color: #fde68a; border-bottom-color: #5c4a12; } }

/* ---------- welcome tour (Nov 2, Trello 292, option A: three cards) ---------- */
/* Nov 3 (iPhone): the full-screen tour is the visible screen's height (100dvh), not the page's, so Safari's toolbars never hide
   its top or its Next button */
.tour { border: 0; padding: 0; margin: auto; width: 100%; height: 100%; height: 100dvh; max-width: 100%; max-height: 100%; max-height: 100dvh; background: var(--bg); color: var(--text);
  display: none; flex-direction: column; overflow: hidden; }
.tour[open] { display: flex; }
.tour::backdrop { background: rgba(15, 23, 42, .55); }
/* Nov 2 (card 292, Cowork / Charles: "the tour looks stretched on big screens"): phones under ~600 px wide get the full
   screen; anything wider gets a centred 440 px card, up to 800 px tall, the app dimmed behind it. A short window shrinks the
   card and its content scrolls inside; Skip (top) and Next (bottom) stay visible. Nothing inside stretches with the window. */
@media (min-width: 600px) {
  .tour { width: 440px; height: min(800px, calc(100vh - 32px)); height: min(800px, calc(100dvh - 32px)); border-radius: 28px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, .4); }
}
.tour[data-step="1"] { background: var(--hero); color: #ffffff; }
.tour-bar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: calc(10px + env(safe-area-inset-top)) 12px 0 24px; min-height: 58px; }
.tour-brand { display: flex; align-items: center; gap: 8px; }
.tour[data-step="1"] .tour-brand { visibility: hidden; }
.tour-mark { width: 28px; height: 28px; border-radius: 8px; background: var(--hero); display: grid; place-items: center; }
.tour-mark svg { width: 18px; height: 18px; stroke: #ffffff; stroke-width: 3.2; }
.tour-name { font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: var(--primary); }
.tour-skip { min-height: 44px; min-width: 64px; padding: 0 12px; border: 0; background: transparent; color: var(--primary); font-size: 15px; font-weight: 700; cursor: pointer; }
.tour[data-step="1"] .tour-skip { color: #ffffff; }
.tour-card { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; display: flex; flex-direction: column; gap: 14px; padding: 4px 24px 8px; }
.tour-card[hidden] { display: none; }
/* Nov 3: centred with auto margins, not justify-content: center, so on a short screen the card scrolls from its top instead of
   cutting the badge off above the screen */
.tour-card[data-card="1"] { gap: 24px; padding: 0 28px 24px; }
.tour-card[data-card="1"] > :first-child { margin-top: auto; }
.tour-card[data-card="1"] > :last-child { margin-bottom: auto; }
.tour-badge { width: 84px; height: 84px; border-radius: 24px; background: var(--accent); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(0, 0, 0, .28); }
.tour-badge svg { width: 48px; height: 48px; stroke: #ffffff; stroke-width: 3.2; }
.tour-h1 { margin: 0; font-size: 34px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; color: #ffffff; }
.tour-lead { margin: 0; font-size: 18px; line-height: 1.45; color: #dbe4ff; }
.tour-h2 { margin: 0; font-size: 28px; line-height: 1.12; font-weight: 800; letter-spacing: -.02em; }
.tour-text { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.tour-card h2:focus { outline: none; }
/* card 2: the example */
.tour-example { background: var(--surface); border-radius: 18px; padding: 14px; display: grid; gap: 12px; box-shadow: 0 1px 3px rgba(15, 23, 42, .12); }
.tour-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 16px; }
.tour-tag { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 9px; }
.tour-bar-row { display: grid; gap: 4px; }
.tour-bar-label { font-size: 13px; font-weight: 600; color: var(--muted); }
/* Nov 3 (Trello 310, Charles): bar 2 is the store's sale price (blue), bar 3 the median price at stores in the area (orange) */
.tour-bar-label.sale { font-weight: 800; color: var(--primary); }
.tour-bar-label.median { font-weight: 800; color: var(--accent-soft-ink); }
.tour-bar-track { height: 32px; display: flex; }
.tour-bar-fill { border-radius: 8px; display: flex; align-items: center; justify-content: flex-end; padding-right: 10px; font-size: 15px; font-weight: 800; }
.tour-bar-fill.own { width: 100%; background: #94a3b8; color: #0f172a; }
.tour-bar-fill.sale { width: 50%; background: #1e3a8a; color: #ffffff; }
.tour-bar-fill.median { width: 59%; background: var(--accent); color: #ffffff; }
.tour-says { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding-top: 2px; }
.tour-say { border-radius: 14px; padding: 10px 12px; display: grid; gap: 1px; font-size: 12px; line-height: 1.3; }
.tour-say span:first-child { font-weight: 700; }
.tour-say strong { font-size: 28px; font-weight: 900; letter-spacing: -.02em; line-height: 1.15; }
.tour-say.flyer { background: var(--surface-2); color: var(--muted); }
.tour-say.flyer s { text-decoration-thickness: 2px; }
.tour-say.worthit { background: var(--accent-soft); color: var(--accent-soft-ink); box-shadow: 0 0 0 2px var(--accent); }
.tour-say.worthit strong { color: var(--accent); }
/* card 3: the dial (the app's own dial, bigger) */
.tour-dial-wrap { display: grid; justify-items: center; gap: 8px; padding-top: 4px; }
.tour-knob { width: 176px; height: 176px; }
.tour-card[data-card="3"] { gap: 12px; }
@media (max-height: 820px) { .tour-knob { width: 150px; height: 150px; } .tour-knob .knob-val { font-size: 34px; } }
.tour-knob .knob-face { fill: #1e3a8a; }
.tour-knob .knob-track { stroke: rgba(255, 255, 255, .25); stroke-width: 4.5; }
.tour-knob .knob-fill { stroke: #fb923c; stroke-width: 4.5; }
.tour-knob .knob-dot { fill: #ffffff; stroke: none; }
.tour-knob .knob-val { font-size: 40px; color: #ffffff; }
.tour-knob.untouched { box-shadow: 0 0 0 6px rgba(194, 65, 12, .35); }
.tour-hint { min-height: 22px; font-size: 16px; font-weight: 800; color: var(--accent-soft-ink); text-align: center; }
.tour-counts { margin: 0; text-align: center; font-size: 17px; font-weight: 700; }
.tour-tips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tour-tip { background: var(--surface); border-radius: 14px; padding: 12px; display: grid; gap: 2px; box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.tour-tip strong { font-size: 15px; color: var(--primary); }
.tour-tip span { font-size: 14px; line-height: 1.35; color: var(--muted); }
.tour-dock { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 999px; padding: 8px 10px 8px 16px; box-shadow: 0 2px 8px rgba(15, 23, 42, .18); }
.tour-dock strong { font-size: 15px; }
.tour-dock-sw { width: 40px; height: 24px; border-radius: 999px; background: var(--accent); position: relative; flex: none; }
.tour-dock-sw span { position: absolute; top: 3px; left: 19px; width: 18px; height: 18px; border-radius: 50%; background: #ffffff; }
.tour-dock-note { margin-left: auto; font-size: 13px; color: var(--muted); }
.tour-dock-dial { width: 40px; height: 40px; border-radius: 50%; background: #1e3a8a; color: #ffffff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }
/* footer: dots, Next, Back */
.tour-foot { flex: none; display: grid; gap: 10px; padding: 8px 24px calc(20px + env(safe-area-inset-bottom)); }
.tour-dots { display: flex; justify-content: center; gap: 8px; }
.tour-dots span { width: 8px; height: 8px; border-radius: 999px; background: var(--track); transition: width .2s ease; }
.tour-dots span.on { width: 22px; background: var(--primary); }
.tour[data-step="1"] .tour-dots span { background: rgba(255, 255, 255, .4); }
.tour[data-step="1"] .tour-dots span.on { background: #ffffff; }
.tour-next { min-height: 54px; border-radius: 16px; font-size: 17px; font-weight: 800; box-shadow: 0 6px 16px rgba(194, 65, 12, .35); }
.tour-back { min-height: 44px; border: 0; background: transparent; color: var(--primary); font-size: 15px; font-weight: 700; cursor: pointer; }
.tour[data-step="1"] .tour-back { visibility: hidden; }
.tour-replay { justify-self: center; align-self: center; font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .tour-dots span { transition: none; } }
/* Nov 3 (Charles's parents' iPhone screenshot: card 2 cut off at "Sale price this week" above Safari's bottom bar, and an
   iPhone shows no scroll bar): on a phone screen up to ~760 px tall every card is set tighter so it fits without scrolling;
   on a very short one it still scrolls inside the card */
@media (max-width: 599px) and (max-height: 760px) {
  .tour-bar { min-height: 48px; padding-top: calc(4px + env(safe-area-inset-top)); }
  .tour-card { gap: 10px; padding-top: 0; }
  .tour-card[data-card="1"] { gap: 18px; }
  .tour-badge { width: 68px; height: 68px; border-radius: 20px; }
  .tour-badge svg { width: 38px; height: 38px; }
  .tour-h1 { font-size: 30px; }
  .tour-lead { font-size: 17px; }
  .tour-h2 { font-size: 24px; }
  .tour-text { font-size: 14px; line-height: 1.4; }
  .tour-example { padding: 12px; gap: 8px; }
  .tour-bar-track { height: 26px; }
  .tour-bar-fill { font-size: 14px; }
  .tour-says { gap: 8px; }
  .tour-say { padding: 8px 10px; }
  .tour-say strong { font-size: 24px; }
  .tour-knob { width: 128px; height: 128px; }
  .tour-knob .knob-val { font-size: 30px; }
  .tour-card[data-card="3"] { gap: 8px; }
  .tour-tip { padding: 10px; }
  .tour-tip span { font-size: 13px; }
  .tour-foot { gap: 4px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); }
  .tour-next { min-height: 50px; }
  .tour-back { min-height: 40px; }
}
/* the smallest iPhones (original SE, 12 / 13 mini in Safari: 568–630 px visible) get one step tighter still */
@media (max-width: 599px) and (max-height: 640px) {
  .tour-bar { min-height: 44px; }
  .tour-h1 { font-size: 26px; }
  .tour-lead { font-size: 16px; }
  .tour-h2 { font-size: 21px; }
  .tour-text { font-size: 13px; }
  .tour-example { padding: 10px; gap: 6px; }
  .tour-ex-head { font-size: 15px; }
  .tour-bar-row { gap: 2px; }
  .tour-bar-label { font-size: 12px; }
  .tour-bar-track { height: 22px; }
  .tour-say strong { font-size: 21px; }
  .tour-knob { width: 104px; height: 104px; }
  .tour-knob .knob-val { font-size: 26px; }
  .tour-hint { min-height: 18px; font-size: 14px; }
  .tour-counts { font-size: 15px; }
  .tour-tip { padding: 8px; }
  .tour-next { min-height: 46px; }
  .tour-dots { display: none; }
}
