:root {
  --bg: #ECEFE7; --surface: #FFFFFF; --raised: #F6F7F3; --ink: #18211B; --muted: #5A665E; --line: #D7DDD5;
  --kraft: #E9D5A0; --kraft-ink: #3B2E10; --best: #12764A; --best-soft: #D8EFE1; --old: #A86B12; --est: #87919A; --warn: #B3371D; --warn-soft: #F7E0D9;
  --c-dairy: #E1ECF8; --c-bakery: #F4E6D6; --c-staples: #F1E9D2; --c-spices: #F8E1D0; --c-drinks: #E5E3F5; --c-snacks: #F9E2DD; --c-produce: #DDEFDA; --c-home: #DFECEE; --c-added: #E9EAE6;
  --paper: #FFFEF7; --paper-ink: #1E1D1A; --paper-muted: #6B675C;
  --display: 'Big Shoulders Display', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --sans: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --nav-h: 62px;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101512; --surface: #18201B; --raised: #1E2721; --ink: #E6EDE8; --muted: #9AA79F; --line: #2B3630;
    --kraft: #D9C083; --kraft-ink: #2B210A; --best: #5CCB93; --best-soft: #173727; --old: #E2A84B; --est: #8C979F; --warn: #F0937C; --warn-soft: #3A1E17;
    --c-dairy: #1C2733; --c-bakery: #2D241B; --c-staples: #2B2719; --c-spices: #31221A; --c-drinks: #24223A; --c-snacks: #33201D; --c-produce: #1B2D1C; --c-home: #1A2A2D; --c-added: #252825;
    --paper: #ECEAE2; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #101512; --surface: #18201B; --raised: #1E2721; --ink: #E6EDE8; --muted: #9AA79F; --line: #2B3630;
  --kraft: #D9C083; --kraft-ink: #2B210A; --best: #5CCB93; --best-soft: #173727; --old: #E2A84B; --est: #8C979F; --warn: #F0937C; --warn-soft: #3A1E17;
  --c-dairy: #1C2733; --c-bakery: #2D241B; --c-staples: #2B2719; --c-spices: #31221A; --c-drinks: #24223A; --c-snacks: #33201D; --c-produce: #1B2D1C; --c-home: #1A2A2D; --c-added: #252825;
  --paper: #ECEAE2; color-scheme: dark;
}
*, *::before, *::after { box-sizing: inherit; }
html { height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--sans); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: 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(--best); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 760px; margin: 0 auto; padding: 14px 14px calc(var(--nav-h) + 90px); }

/* header */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.brand { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand b { font: 800 34px/1 var(--display); letter-spacing: 0.01em; }
.brand span { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pin { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px 6px 4px 10px; }
.pin svg { width: 18px; height: 18px; color: var(--muted); }
.pin input { width: 5.6em; border: 0; background: transparent; font-weight: 700; font-size: 15px; letter-spacing: 0.03em; padding: 4px 0; }
.pin input:focus { outline: none; }
.pin:focus-within { outline: 3px solid var(--best); outline-offset: 2px; }

/* search */
.search { position: relative; margin-bottom: 10px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; height: 52px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); padding: 0 44px 0 46px; font-size: 17px; }
.search input:focus { outline: none; border-color: var(--ink); }
.search .clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; width: 40px; height: 40px; border-radius: 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 7px 13px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.bar select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 5px 8px; font-size: 13px; }
.datastate { display: inline-flex; align-items: center; gap: 6px; }
.linkish { border: 0; background: none; padding: 0; color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* status dots */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.real { background: var(--best); }
.dot.old { background: var(--old); }
.dot.est { border: 2px solid var(--est); }
.dot.demo { border: 2px dashed var(--est); }
.dot.oos { background: var(--warn); }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 8px 8px 10px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card.in { border-color: var(--ink); }
.hit { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tile { position: relative; aspect-ratio: 4 / 3; border-radius: 11px; display: grid; place-items: center; }
.tile .emo { font-size: 42px; line-height: 1; }
.tile .pack { position: absolute; left: 6px; bottom: 6px; background: var(--surface); border-radius: 6px; padding: 1px 6px; font-size: 12px; font-weight: 600; }
.tile .qtyb { position: absolute; right: 6px; top: 6px; background: var(--ink); color: var(--bg); border-radius: 99px; min-width: 24px; height: 24px; display: grid; place-items: center; font-size: 13px; font-weight: 700; padding: 0 7px; }
.card h3 { margin: 0; font-size: 14.5px; line-height: 1.25; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.c-dairy { background: var(--c-dairy); } .c-bakery { background: var(--c-bakery); } .c-staples { background: var(--c-staples); } .c-spices { background: var(--c-spices); }
.c-drinks { background: var(--c-drinks); } .c-snacks { background: var(--c-snacks); } .c-produce { background: var(--c-produce); } .c-home { background: var(--c-home); } .c-added { background: var(--c-added); }

/* the price tag: kraft hang-tag with a punched hole */
.tag { align-self: flex-start; display: inline-flex; align-items: baseline; gap: 1px; padding: 1px 10px 0 17px; color: var(--kraft-ink); font: 800 27px/1.15 var(--display);
  background: radial-gradient(circle at 8px 50%, var(--surface) 0 2.6px, transparent 3.2px), var(--kraft);
  clip-path: polygon(9px 0, 100% 0, 100% 100%, 9px 100%, 0 50%); }
.tag .rs { font: 700 0.62em var(--sans); margin-right: 1px; }
.tag.est { background: radial-gradient(circle at 8px 50%, var(--surface) 0 2.6px, transparent 3.2px), repeating-linear-gradient(135deg, var(--kraft) 0 6px, color-mix(in srgb, var(--kraft) 70%, var(--surface)) 6px 12px); }
.tag.none { font: 600 14px/1.9 var(--sans); }
.where { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; }
.where span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save { font-size: 12.5px; font-weight: 600; color: var(--best); min-height: 1.2em; }
.add { margin-top: auto; border: 1.5px solid var(--ink); background: transparent; border-radius: 10px; height: 38px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; }
.add svg { width: 18px; height: 18px; }
.stepper { margin-top: auto; display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; background: var(--ink); color: var(--bg); border-radius: 10px; height: 38px; }
.stepper button { border: 0; background: transparent; color: inherit; height: 38px; font-size: 20px; cursor: pointer; }
.stepper span { text-align: center; font-weight: 700; }

/* buttons, inputs */
.btn { border: 1.5px solid var(--ink); background: var(--ink); color: var(--bg); font-weight: 700; padding: 11px 16px; border-radius: 11px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 7px 11px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: progress; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
textarea, .field input, .field select, select.field { width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 11px; }
textarea { min-height: 140px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fields .wide { grid-column: 1 / -1; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.panel h2 { margin: 0 0 8px; font-size: 18px; }
.hint { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.status { color: var(--best); font-size: 14px; margin: 8px 0 0; min-height: 1.2em; }
.warn { color: var(--warn); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .big { font-size: 54px; display: block; margin-bottom: 6px; }
h1.page { font: 800 30px/1.05 var(--display); letter-spacing: 0.01em; margin: 4px 0 12px; }

/* switches */
input.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 26px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .15s; }
input.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: left .15s; }
input.switch:checked { background: var(--best); }
input.switch:checked::after { left: 19px; }
input.switch:disabled { opacity: .5; }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.opt:first-of-type { border-top: 0; }
.opt small { display: block; color: var(--muted); font-size: 13px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; }
.seg label { text-align: center; padding: 8px 4px; border-radius: 9px; font-weight: 600; font-size: 14px; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: var(--bg); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--best); }
details.more { border-top: 1px solid var(--line); padding: 10px 0 0; margin-top: 10px; }
details.more > summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: '+'; font-size: 20px; color: var(--muted); }
details.more[open] > summary::after { content: '\2212'; }
details.more > div { padding-top: 10px; }

/* app marks: neutral initials, not brand logos */
.mark { width: 34px; height: 34px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--raised); display: grid; place-items: center; font: 700 12px/1 var(--sans); letter-spacing: 0.02em; flex: none; }

/* bottom sheet */
.scrim { position: fixed; inset: 0; background: rgba(10, 14, 11, .42); z-index: 30; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 31; max-height: 88vh; max-height: 88dvh; overflow: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 8px 16px calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 620px; margin: 0 auto; }
.sheet.enter { animation: up 260ms cubic-bezier(.2, .8, .2, 1) both; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet.enter { animation: none; } }
.grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: 4px auto 10px; }
.sheet-head { display: grid; grid-template-columns: 76px 1fr 40px; gap: 12px; align-items: center; margin-bottom: 12px; }
.sheet-head .tile { aspect-ratio: 1; }
.sheet-head .tile .emo { font-size: 40px; }
.sheet-head h2 { margin: 0; font-size: 18px; line-height: 1.25; }
.sheet-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.x { border: 0; background: var(--raised); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.summary { background: var(--raised); border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.summary .big { font: 800 34px/1 var(--display); }
.summary .big .rs { font: 700 .6em var(--sans); }
.summary p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
ol.ladder { list-style: none; margin: 0 0 14px; padding: 0; }
.rung { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 8px; }
.rung.best { border-radius: 12px; }
.rung + .rung { border-top: 1px solid var(--line); }
.rung.best { background: var(--best-soft); border-top-color: transparent; }
.rung.best + .rung { border-top-color: transparent; }
.rung.off { opacity: .55; }
.rung-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.rung-top strong { font-size: 15px; }
.rung-top .p { font: 800 22px/1 var(--display); }
.rung-top .p .rs { font: 700 .62em var(--sans); }
.rung-track { height: 5px; border-radius: 99px; background: var(--line); margin: 6px 0 4px; overflow: hidden; }
.rung-track i { display: block; height: 100%; background: var(--warn); border-radius: 99px; }
.rung.best .rung-track i { background: var(--best); width: 100% !important; }
.rung-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.rung a.open { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--ink); }
.rung a.open svg { width: 18px; height: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.spark { width: 100%; height: 56px; }
.spark polyline { fill: none; stroke: var(--ink); stroke-width: 2; }
.sheet-foot { position: sticky; bottom: calc(-16px - env(safe-area-inset-bottom, 0px)); background: var(--surface); padding: 10px 0 0; display: grid; grid-template-columns: 130px 1fr; gap: 10px; }
.sheet-foot .stepper { margin: 0; }

/* cart bar and bottom nav */
.cartbar { position: fixed; z-index: 20; left: 12px; right: 12px; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 10px); max-width: 736px; margin: 0 auto; background: var(--ink); color: var(--bg); border: 0; border-radius: 15px; padding: 11px 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; text-align: left; }
.cartbar[hidden] { display: none; }
.cartbar small { display: block; opacity: .75; font-size: 12.5px; }
.cartbar strong { font: 800 22px/1.05 var(--display); }
.cartbar .go { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; }
nav.bottom { position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); }
nav.bottom .in { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, 1fr); height: var(--nav-h); }
nav.bottom button { border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 600; cursor: pointer; position: relative; }
nav.bottom button[aria-current="page"] { color: var(--ink); }
nav.bottom button[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--ink); }
nav.bottom .snap svg { background: var(--kraft); color: var(--kraft-ink); border-radius: 10px; padding: 4px; width: 32px; height: 28px; }
nav.bottom .badge { position: absolute; top: 6px; left: calc(50% + 6px); background: var(--warn); color: #fff; border-radius: 99px; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }

/* cart */
.verdict { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--ink); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; }
.verdict.v-clear, .verdict.v-safe, .verdict.v-split { border-left-color: var(--best); }
.verdict.v-close, .verdict.v-insufficient { border-left-color: var(--old); }
.verdict.v-demo { border-left-style: dashed; border-left-color: var(--est); }
.verdict .what { color: var(--muted); font-size: 14px; margin: 0; }
.verdict .app { font: 800 38px/1.02 var(--display); letter-spacing: 0.01em; margin: 2px 0; }
.verdict .total { font: 800 30px/1 var(--display); }
.verdict .total .rs { font: 700 .6em var(--sans); }
.verdict .range { color: var(--muted); font-size: 13px; margin-left: 6px; }
.pill { display: inline-block; border-radius: 99px; padding: 3px 10px; font-size: 13px; font-weight: 700; margin: 8px 6px 0 0; }
.pill.save { background: var(--best-soft); color: var(--best); }
.pill.conf { background: var(--raised); color: var(--muted); border: 1px solid var(--line); }
.verdict p.sub { margin: 10px 0 0; font-size: 14.5px; }
.verdict ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.ask { background: var(--raised); border-radius: 12px; padding: 10px 12px; margin-top: 12px; font-size: 14px; }
.ask p { margin: 0 0 4px; font-weight: 700; }
.ask ul { margin: 0 0 8px; padding-left: 18px; color: var(--ink); }
.ranges { display: grid; gap: 8px; margin: 4px 0 2px; }
.rg { display: grid; grid-template-columns: 92px 1fr 64px; gap: 8px; align-items: center; font-size: 13px; }
.rg .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rg .tr { position: relative; height: 20px; }
.rg .tr::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 2px; background: var(--line); }
.rg .span { position: absolute; top: 4px; height: 12px; border-radius: 99px; background: color-mix(in srgb, var(--est) 35%, transparent); }
.rg .pt { position: absolute; top: 4px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--ink); }
.rg.top .span { background: color-mix(in srgb, var(--best) 30%, transparent); }
.rg.top .pt { background: var(--best); }
.rg .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
ol.board { list-style: none; margin: 0; padding: 0; }
.board li button { width: 100%; border: 0; background: transparent; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); text-align: left; cursor: pointer; }
.board li:first-child button { border-top: 0; }
.board li button[aria-pressed="true"] { background: var(--raised); border-radius: 12px; }
.board .rk { font: 800 18px/1 var(--display); color: var(--muted); text-align: center; }
.board .nm strong { display: block; font-size: 15px; }
.board .nm small { color: var(--muted); font-size: 12.5px; }
.board .t { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.board .t small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.board .guess { color: var(--muted); }
ul.lines { list-style: none; margin: 0; padding: 0; }
ul.lines li { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
ul.lines li:first-child { border-top: 0; }
ul.lines .tile { aspect-ratio: 1; border-radius: 10px; }
ul.lines .tile .emo { font-size: 24px; }
ul.lines .nm { min-width: 0; }
ul.lines .nm button { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; font-size: 14.5px; cursor: pointer; }
ul.lines .nm small { display: block; color: var(--muted); font-size: 12.5px; }
ul.lines .stepper { width: 112px; grid-template-columns: 34px 1fr 34px; height: 34px; margin: 0; }
ul.lines .stepper button { height: 34px; }
.nudge { background: color-mix(in srgb, var(--kraft) 40%, var(--surface)); border-radius: 10px; padding: 8px 10px; font-size: 14px; margin-bottom: 6px; }
.unmatched li { grid-template-columns: 1fr auto !important; }
.unmatched select { margin-top: 6px; }

/* receipt */
.receipts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.receipt { background: var(--paper); color: var(--paper-ink); font-family: var(--mono); font-size: 13px; line-height: 1.55; padding: 18px 16px 30px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%; }
.r-head { text-align: center; margin-bottom: 10px; }
.r-head strong { display: block; font-size: 17px; }
.r-head span { color: var(--paper-muted); font-size: 12px; }
.r-row { display: flex; justify-content: space-between; gap: 12px; }
.r-row span:first-child { min-width: 0; overflow-wrap: anywhere; }
.r-row span:last-child { flex: none; font-variant-numeric: tabular-nums; }
.r-row.minus span:last-child { color: #17653F; }
.r-row.dim { color: var(--paper-muted); }
.r-rule { border-top: 1px dashed currentColor; opacity: .45; margin: 9px 0; }
.r-total { font-size: 17px; font-weight: 600; }
.r-note { color: var(--paper-muted); font-size: 12px; margin-top: 10px; }
.r-missing { color: #A33A26; font-size: 12px; margin-top: 8px; }
.tagline { font-size: 11px; color: var(--paper-muted); }
details.find { margin-top: 10px; font-size: 14px; }
details.find summary { cursor: pointer; font-weight: 700; }
details.find ul { margin: 8px 0 0; padding-left: 18px; }
details.find a { color: var(--ink); }

/* snap */
.snaphero { background: var(--kraft); color: var(--kraft-ink); border-radius: 18px; padding: 18px; margin-bottom: 14px; }
.snaphero h2 { font: 800 30px/1.05 var(--display); margin: 0 0 6px; }
.snaphero p { margin: 0 0 12px; font-size: 14.5px; }
.snaphero .pick { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--kraft-ink); color: var(--kraft); border-radius: 13px; padding: 14px; font-weight: 700; cursor: pointer; }
.snaphero .pick:focus-within { outline: 3px solid var(--kraft-ink); outline-offset: 3px; }
.snaphero .pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.snaphero select { margin-top: 10px; width: 100%; border: 0; border-radius: 10px; padding: 10px; background: color-mix(in srgb, var(--surface) 70%, var(--kraft)); color: var(--ink); }
.snaphero small { display: block; margin-top: 10px; opacity: .8; font-size: 12.5px; }
.review { border: 2px solid var(--ink); scroll-margin-top: 12px; }
.review li { display: grid; grid-template-columns: 26px 1fr; gap: 8px 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.review ul { list-style: none; margin: 0; padding: 0; }
.review .rv-name { font-weight: 600; overflow-wrap: anywhere; }
.review .rv-fields { grid-column: 2; display: grid; grid-template-columns: 1fr 7em; gap: 6px; align-items: center; }
.review .rv-fields select { grid-column: 1 / -1; }
.review input[type="checkbox"]:not(.switch) { width: 20px; height: 20px; accent-color: var(--best); margin-top: 2px; }
.bill { font-family: var(--mono); font-size: 13px; background: var(--paper); color: var(--paper-ink); padding: 12px; border-radius: 10px; margin: 12px 0; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 3px 12px; font-size: 14px; }
.kv span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cov { display: grid; gap: 7px; }
.cov .c { display: grid; grid-template-columns: 112px 1fr 70px; gap: 8px; align-items: center; font-size: 13px; }
.cov .c .t { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; display: flex; }
.cov .c .t i { display: block; height: 100%; }
.cov .c .t i.f { background: var(--best); } .cov .c .t i.o { background: var(--old); }
.cov .c span:last-child { text-align: right; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-top: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; border-top: 0; }
td.num, th.num { text-align: right; }
.scroll { overflow-x: auto; }
.icon-btn { border: 1px solid var(--line); background: transparent; width: 34px; height: 34px; border-radius: 9px; cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 16px; height: 16px; }
code { overflow-wrap: anywhere; font-size: 12.5px; }
textarea.csv { min-height: 110px; font-family: var(--mono); font-size: 12px; }
@media (min-width: 700px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); }
  .sheet { bottom: 50%; transform: translateY(50%); border-radius: 22px; }
  .sheet.enter { animation: none; }
}

.board-sub { font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 2px; }
.board .pick { color: var(--best); font-weight: 700; }

/* ---- v5 additions: real images, rails, multicart, offers, modal ---- */
.tile img { width: 82%; height: 82%; object-fit: contain; }
.rail { margin: 6px 0 18px; }
.rail h2 { font: 800 24px/1.1 var(--display); margin: 0 0 8px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; }
.rail h2 small { font: 600 13px var(--sans); color: var(--muted); flex-basis: 100%; order: 2; }
.rail h2 small:has(button) { flex-basis: auto; order: 0; }
.rail .track { display: grid; grid-auto-flow: column; grid-auto-columns: 160px; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.offerchip { flex: none; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--kraft); border-radius: 12px; padding: 10px 12px; width: 250px; font-size: 13.5px; }
.offerchip b { display: block; font-size: 13px; color: var(--muted); margin-bottom: 2px; }
.offerchip.yours { border-left-color: var(--best); }
.offers-track { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.headbtns { display: flex; gap: 6px; align-items: center; }
.bell { position: relative; border: 1px solid var(--line); background: var(--surface); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer; }
.bell .badge { position: absolute; top: -4px; right: -4px; background: var(--warn); color: #fff; border-radius: 99px; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }
nav.bottom .in { grid-template-columns: repeat(5, 1fr); }
.notice-line { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin: 0 0 12px; }
.rung .pick { border: 1.5px solid var(--ink); background: transparent; border-radius: 9px; padding: 4px 9px; font-weight: 700; font-size: 13px; cursor: pointer; margin-top: 6px; }
.rung .pick[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.appcart { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.appcart header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.appcart header strong { font-size: 17px; flex: 1; }
.appcart header .t { font: 800 24px/1 var(--display); }
.appcart .ln { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; }
.appcart .ln span:first-child { min-width: 0; overflow-wrap: anywhere; }
.appcart .sum { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; font-size: 13.5px; color: var(--muted); }
.appcart .sum .ln { padding: 2px 0; }
.appcart .minus { color: var(--best); }
.appcart .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.modes2 { display: grid; grid-template-columns: 1fr 1fr; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; margin-bottom: 12px; }
.modes2 button { border: 0; background: transparent; padding: 9px; border-radius: 9px; font-weight: 700; cursor: pointer; }
.modes2 button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.itemrow { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.itemrow:first-child { border-top: 0; }
.itemrow .tile { aspect-ratio: 1; border-radius: 10px; }
.itemrow .tile .emo { font-size: 22px; }
.itemrow select { margin-top: 4px; font-size: 13px; padding: 5px 6px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); max-width: 100%; }
.itemrow .stepper { width: 108px; grid-template-columns: 34px 1fr 34px; height: 34px; margin: 0; }
.itemrow .stepper button { height: 34px; }
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(10,14,11,.45); padding: 16px; }
.modal > div { background: var(--surface); border-radius: 18px; padding: 18px; max-width: 420px; width: 100%; }
.modal h2 { margin: 0 0 6px; font-size: 19px; }
.modal .row button { flex: 1 1 140px; }
.chipset { display: flex; flex-wrap: wrap; gap: 8px; }
.chipset label { border: 1px solid var(--line); border-radius: 99px; padding: 6px 12px; font-size: 14px; font-weight: 600; cursor: pointer; background: var(--surface); }
.chipset input { position: absolute; opacity: 0; pointer-events: none; }
.chipset label:has(input:checked) { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chipset label:has(input:focus-visible) { outline: 3px solid var(--best); }
.offerlist .o { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.offerlist .o:first-child { border-top: 0; }
.offerlist .o small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.offerlist .code { font-family: var(--mono); background: var(--raised); border: 1px dashed var(--line); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; }
.spin { display: inline-block; width: 12px; height: 12px; border: 2px solid var(--line); border-top-color: var(--ink); border-radius: 50%; animation: sp 0.8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation: none; } }
.legal { font-size: 12.5px; color: var(--muted); text-align: center; margin: 24px 0 8px; }
.legal a { color: var(--muted); }
