/* Fonts (self-hosted): Space Grotesk for name, headings and prices; Inter for everything else */
@font-face { font-family: "Space Grotesk"; src: url("fonts/SpaceGrotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/Inter.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
:root { --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --font-head: "Space Grotesk", var(--font-body); }
:root {
  --bg: #f4f5f7; --card: #ffffff; --text: #16181d; --muted: #5d6470; --line: #e1e4e9; --soft: #eef0f3; --grid: #eceef2;
  --accent: #1f5fd6; --accent-text: #ffffff;
  --good: #137a3a; --good-bg: #e2f4e8; --bad: #b42318; --bad-bg: #fde8e6;
  --warn: #8a5a00; --warn-bg: #fff3d6; --warn-line: #f0c45a;
  --buy: #137a3a; --buy-bg: #dff3e6; --wait: #8a5a00; --wait-bg: #ffefc7; --watch: #4b5361; --watch-bg: #e8ebef;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #6250d6; --s8: #e34948;
  --other: #a3a9b3;
  --radius: 14px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216; --card: #1a1d23; --text: #e8eaee; --muted: #9aa2ae; --line: #2c3139; --soft: #242830; --grid: #252a31;
    --accent: #6d9eff; --accent-text: #0b1020;
    --good: #5fd38a; --good-bg: #13301f; --bad: #ff8a80; --bad-bg: #3a1714;
    --warn: #ffd27a; --warn-bg: #3a2c0c; --warn-line: #8a6a1c;
    --buy: #6fdc96; --buy-bg: #153823; --wait: #ffcf6e; --wait-bg: #3d2e0b; --watch: #b4bcc8; --watch-bg: #2a2f37;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c; --s7: #9085e9; --s8: #e66767;
    --other: #6b727d;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--accent); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.good { color: var(--good); font-weight: 600; }
.strong { font-weight: 700; }
.num { font-variant-numeric: tabular-nums; }
.pre { white-space: pre-line; }
.break { overflow-wrap: anywhere; }
.grow { flex: 1 1 auto; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- top bar ---------- */
.top { background: var(--card); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.top-in { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 750; font-size: 18px; color: var(--text); text-decoration: none; margin-right: auto; }
.logo { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-text); font-size: 16px; font-weight: 800; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 600; min-height: 34px; display: inline-flex; align-items: center; }
.tabs a.on { background: var(--soft); color: var(--text); }
.tools { padding-bottom: 10px; display: grid; gap: 8px; }
.track { display: grid; grid-template-columns: minmax(0, 1fr) 96px auto; gap: 8px; }
.track input { padding: 9px 11px; }
.statusline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; }
.statusline .st { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.statusline .k { color: var(--muted); }
.statusline button { margin-left: auto; }
.meter { display: inline-block; width: 48px; height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; vertical-align: middle; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.meter.wide { width: 70px; }
.meter.warn > i { background: var(--s4); }
.meter.bad > i { background: var(--bad); }
.runline { font-size: 14px; }
.bar { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.bar > i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
details.jobs > summary { font-size: 13px; font-weight: 600; cursor: pointer; display: flex; gap: 6px; align-items: center; min-height: 28px; }
details.jobs ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
details.jobs li { border-top: 1px solid var(--line); padding-top: 6px; min-width: 0; font-size: 14px; }
details.sum > summary { cursor: pointer; color: var(--muted); }

main.wrap { padding-top: 14px; padding-bottom: 48px; }
h1 { font-size: 22px; margin: 2px 0 4px; line-height: 1.25; overflow-wrap: anywhere; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); min-width: 0; }

/* ---------- forms + buttons ---------- */
input, select, textarea, button { font: inherit; font-size: 16px; color: inherit; }
input[type=text], input[type=url], select, textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); min-width: 0; }
textarea { min-height: 70px; resize: vertical; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--soft); color: var(--text); cursor: pointer; font-weight: 600; text-decoration: none; font-size: 15px; white-space: nowrap; }
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.good { background: var(--good-bg); color: var(--good); border-color: transparent; }
button.danger { background: transparent; color: var(--bad); border-color: var(--line); }
button.sm, .btn.sm { min-height: 32px; padding: 4px 11px; font-size: 14px; }
button:disabled { opacity: .55; cursor: default; }
label.chk { display: inline-flex; align-items: center; gap: 8px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.tight { gap: 6px; }
.row > .grow { flex: 1 1 200px; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: 13px; color: var(--muted); font-weight: 600; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- chips, pills, badges ---------- */
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; line-height: 1.5; }
.chip.running, .chip.queued { background: var(--warn-bg); color: var(--warn); }
.chip.done, .chip.trusted, .chip.confirmed { background: var(--good-bg); color: var(--good); }
.chip.failed, .chip.rejected { background: var(--bad-bg); color: var(--bad); }
.chip.unverified, .chip.candidate { background: var(--warn-bg); color: var(--warn); }
.chip.sale.s-good { background: var(--good-bg); color: var(--good); }
.chip.sale.s-neutral { background: var(--soft); color: var(--muted); border: 1px solid var(--line); }
.chip.tap { min-height: 28px; padding: 2px 10px; border: 0; cursor: pointer; font-size: 12px; }
.chip.sale.s-neutral.tap { border: 1px solid var(--line); }
.chipwrap { display: inline-flex; flex-direction: column; gap: 2px; max-width: 100%; }
.chipdetail { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.pill.amber { background: var(--warn-bg); color: var(--warn); border: 1px solid var(--warn-line); }
.pill.green { background: var(--good-bg); color: var(--good); }
.q { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 4px; border-radius: 50%; border: 1.5px dotted var(--warn); color: var(--warn); font-size: 11px; font-weight: 800; vertical-align: 2px; line-height: 1; cursor: help; }
.verdict { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 800; letter-spacing: .04em; padding: 3px 9px; border-radius: 7px; white-space: nowrap; }
.verdict .vdot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.verdict.v-buy { background: var(--buy-bg); color: var(--buy); }
.verdict.v-wait { background: var(--wait-bg); color: var(--wait); }
.verdict.v-watch { background: var(--watch-bg); color: var(--watch); }
.verdict.v-none { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 600; letter-spacing: 0; }
.verdict.big { font-size: 15px; padding: 6px 12px; border-radius: 9px; }
.verdict.big .vdot { width: 10px; height: 10px; }
.stock { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap; }
.stock > i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.stock.in > i { background: var(--good); }
.stock.out > i { background: transparent; border: 2px solid var(--bad); }
.stock.out { color: var(--bad); }
.stock.unk > i { background: var(--line); }
.stock.unk { color: var(--muted); }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }

/* ---------- pictures ---------- */
.thumb { width: 68px; height: 68px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); flex: none; }
.thumb.sm { width: 42px; height: 42px; border-radius: 9px; }
.thumb.lg { width: 112px; height: 112px; border-radius: 16px; }
.thumb.ph { display: grid; place-items: center; background: var(--soft); color: var(--muted); }

/* ---------- home: groups ---------- */
.group { margin-bottom: 28px; }
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 0 12px; }
.shelf .group { min-width: 0; display: flex; flex-direction: column; }
.shelf .cards { grid-template-columns: minmax(0, 1fr); flex: 1; }
.shelf .pcard { height: 100%; }
.ghead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }

.compare { padding: 6px 0; margin-bottom: 12px; }
.crow { display: grid; grid-template-columns: 42px minmax(0, 1fr) minmax(96px, 30%) 78px; gap: 10px; align-items: center; padding: 7px 14px; color: inherit; text-decoration: none; min-height: 56px; }
a.crow + a.crow { border-top: 1px solid var(--line); }
a.crow:hover { background: var(--soft); }
.crow.chead { min-height: 0; padding-top: 4px; padding-bottom: 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.c-name { display: flex; flex-direction: column; min-width: 0; }
.c-name .nm { font-weight: 650; font-size: 14px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-price { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.c-price .num { font-size: 16px; }
.vchip { display: block; margin-top: 2px; }
.vchip.good { color: #15803d; font-weight: 600; }
@media (prefers-color-scheme: dark) { .vchip.good { color: #4ade80; } }
.c-v { justify-self: end; }

.pcard { position: relative; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s; }
.pcard:hover { border-color: var(--accent); }
.pcard.paused { opacity: .65; }
.phead { display: flex; gap: 12px; align-items: flex-start; }
.ptitle { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pcard .name { font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--text); text-decoration: none; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.stretch::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.lift { position: relative; z-index: 1; }
.headline { margin: -2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.35; }
.dealrow { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 12px; padding: 10px 12px; border-radius: 11px; background: var(--soft); }
.lbl { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.big { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.big.muted { font-size: 18px; font-weight: 700; }
.mid { font-size: 20px; font-weight: 700; line-height: 1.2; margin-top: 4px; }
.at { font-size: 14px; overflow-wrap: anywhere; }
.shoplink { font-weight: 650; }
.avg { border-left: 1px solid var(--line); padding-left: 12px; min-width: 0; }
.stripbox { margin: 2px 0 0; position: relative; }
.strip { display: block; width: 100%; height: auto; overflow: visible; }
.strip .track { stroke: var(--line); stroke-width: 2; stroke-linecap: round; }
.strip .avgtick { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 3 2; }
.strip .slab { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.mini { display: grid; gap: 0; }
.mrow { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto 12px; gap: 8px; align-items: center; min-height: 32px; border-top: 1px solid var(--line); font-size: 14px; }
.mrow.best { font-weight: 700; }
.mshop { color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 32px; line-height: 32px; }
a.mshop:hover { text-decoration: underline; }
.mprice { text-align: right; white-space: nowrap; }
.mprice a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; display: inline-block; min-height: 32px; line-height: 32px; }
.msale .chip { font-size: 11px; padding: 1px 7px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.mrow .stock { justify-content: center; }
.more { padding-top: 4px; border-top: 1px solid var(--line); }
.pfoot { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; margin-top: auto; }

/* ---------- product page ---------- */
.back { display: inline-block; margin-bottom: 2px; text-decoration: none; font-weight: 600; font-size: 14px; min-height: 28px; }
.hero { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.herotxt { min-width: 0; flex: 1; }
.verdictp { border-left: 5px solid var(--line); display: grid; gap: 10px; margin-bottom: 12px; }
.verdictp.v-buy { border-left-color: var(--buy); }
.verdictp.v-wait { border-left-color: var(--wait); }
.verdictp.v-watch { border-left-color: var(--watch); }
.vtop { display: flex; gap: 12px; align-items: flex-start; }
.vhead { font-size: 17px; font-weight: 700; line-height: 1.3; padding-top: 3px; min-width: 0; overflow-wrap: anywhere; }
.reasons { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.reasons li { overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, auto)) minmax(0, 1fr); gap: 8px 18px; margin: 0; }
.fact dt { font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fact dd { margin: 2px 0 0; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; text-transform: none; }
.conf { display: inline-flex; align-items: center; gap: 6px; text-transform: capitalize; }
.cb { display: inline-flex; gap: 2px; align-items: flex-end; }
.cb i { width: 4px; border-radius: 1px; background: var(--line); }
.cb i:nth-child(1) { height: 6px; } .cb i:nth-child(2) { height: 9px; } .cb i:nth-child(3) { height: 12px; }
.cb i.on { background: var(--text); }
.vfoot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 10px; }
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.tile { display: flex; flex-direction: column; gap: 2px; }
.tile .tv { font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.2; }
.tile.best { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.chartcard { margin-bottom: 12px; }
.chead2 { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin-bottom: 4px; }
.chead2 h3 { margin: 0; }
.key { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); }
.key span { display: inline-flex; align-items: center; gap: 5px; }
.key i { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.key .k-best { width: 12px; height: 12px; border-radius: 50%; background: var(--muted); box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--text); margin: 0 3px; }
.key .k-unc { width: 12px; height: 12px; border-radius: 50%; border: 2px dashed var(--muted); }
.key .k-out { width: 12px; height: 12px; border-radius: 50%; background: var(--other); }
.key .k-avg { width: 0; height: 12px; border-left: 1.5px dashed var(--text); border-radius: 0; }
.chartbox { position: relative; }
.chartbox svg { display: block; width: 100%; height: auto; touch-action: pan-y; user-select: none; -webkit-user-select: none; overflow: visible; }
.chartbox .grid { stroke: var(--grid); stroke-width: 1; }
.chartbox .axis { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chartbox .target { stroke: var(--good); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chartbox .cursor { stroke: var(--muted); stroke-width: 1; }
.chartbox .blab { fill: var(--text); font-size: 12.5px; font-weight: 600; }
.chartbox .bval { fill: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.chartbox .bbest { fill: var(--text); font-size: 12px; font-weight: 800; }
.chartbox .avgline { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chartbox .alab { fill: var(--text); font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chartbox .rowline { stroke: var(--grid); stroke-width: 1; }
.chartbox g.hl { filter: drop-shadow(0 0 3px var(--muted)); }
.chartbox .hit { cursor: pointer; }
.tip { position: absolute; top: 6px; left: 0; z-index: 3; pointer-events: none; background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.16); max-width: min(280px, 90%); display: grid; gap: 2px; }
.tip[hidden] { display: none; }
.trow { display: flex; align-items: center; gap: 6px; }
.trow .tn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.note { margin-top: 6px; }
.hint { margin: -4px 0 8px; color: var(--warn); }
.empty { text-align: center; padding: 24px 14px; }

/* shop table: grid rows, header on wide screens */
.stable { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.srow { display: grid; grid-template-columns: minmax(0, 1.5fr) 120px minmax(0, 1.3fr) 120px minmax(0, 1.5fr) 80px; gap: 6px 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); }
.srow.shead { border-top: 0; background: var(--soft); font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 7px; padding-bottom: 7px; }
.srow.best { box-shadow: inset 4px 0 0 var(--good); }
.srow.rej { opacity: .6; }
.sshop { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sshop a, .sshop span.strong { color: var(--text); }
.sprice a { color: var(--text); font-size: 16px; }
.ssale { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.sstatus { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.c5 { justify-self: end; }
.sdetail { grid-column: 1 / -1; background: var(--soft); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; font-size: 14px; }
.sdetail[hidden] { display: none; }
.dk { font-size: 12px; font-weight: 700; color: var(--muted); }
.err { color: var(--bad); font-size: 13px; overflow-wrap: anywhere; }
details.fold { margin-bottom: 10px; padding: 0; }
details.fold > summary { padding: 12px 14px; cursor: pointer; font-weight: 650; min-height: 44px; }
details.fold > :not(summary) { margin: 0 14px 14px; }
ul.plain { list-style: none; padding: 0; display: grid; gap: 10px; }
ul.plain li { border-top: 1px solid var(--line); padding-top: 8px; }
.editgrid { display: grid; grid-template-columns: 200px 1fr; gap: 10px; align-items: end; }

/* retailers */
.rform { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, .8fr); gap: 8px; }
.rtable { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 12px 0; }
.rrow { display: grid; grid-template-columns: minmax(0, 1.6fr) 100px 110px 150px minmax(0, 1.4fr) auto; gap: 6px 12px; align-items: center; padding: 9px 14px; border-top: 1px solid var(--line); }
.rrow.rhead { border-top: 0; background: var(--soft); font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 7px; padding-bottom: 7px; }
.rrow.unv { background: var(--warn-bg); }
.rrow.rej { opacity: .6; }
.rshop { min-width: 0; }
.msel { font-size: 14px; padding: 5px 8px; min-height: 32px; }
.rnotes { grid-column: 1 / -1; }
.rnotes > summary { cursor: pointer; color: var(--muted); }

@media (max-width: 900px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(3, minmax(0, auto)); }
  .fact.wide { grid-column: 1 / -1; }
  .srow { grid-template-columns: minmax(0, 1fr) auto; padding: 10px 12px; }
  .srow.shead { display: none; }
  .srow .c2 { grid-column: 1; }
  .srow .c3 { justify-self: end; }
  .srow .c4 { grid-column: 1; }
  .srow .c5 { grid-column: 2; align-self: end; }
  .sprice { text-align: right; }
  .rrow { grid-template-columns: minmax(0, 1fr) auto; }
  .rrow.rhead { display: none; }
  .rrow .rerr { grid-column: 1 / -1; }
  .rrow .actions { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .track { grid-template-columns: minmax(0, 1fr) 76px auto; gap: 6px; }
  .track button { padding: 7px 12px; }
  .hide-sm { display: none !important; }
  .cards, .shelf { grid-template-columns: minmax(0, 1fr); }
  .crow { grid-template-columns: 42px minmax(0, 1fr) 92px; padding: 7px 12px; gap: 8px; }
  .crow .c-v { grid-column: 2 / 4; justify-self: start; margin-top: -4px; }
  .crow.chead .c-v { display: none; }
  .hero .thumb.lg { width: 84px; height: 84px; }
  h1 { font-size: 19px; }
  .big { font-size: 25px; }
  .tile .tv { font-size: 20px; }
  .tiles { gap: 8px; }
  .tile { padding: 11px 12px; }
  .editgrid, .rform { grid-template-columns: 1fr; }
  .vhead { font-size: 16px; }
  .facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .sstatus .chip.candidate { display: none; }
  .statusline { gap: 4px 12px; }
}

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100% - 32px); background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 10px; font-size: 14px; z-index: 20; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); color: #fff; }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); padding: 18px; width: min(420px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog form { display: grid; gap: 12px; }

/* Public link: view + track only */
body.guest #app button:not(.guest-ok), body.guest header button:not(.guest-ok), body.guest #app select,
body.guest #app details.card.fold, body.guest .msel { display: none !important; }

/* ---------- To enter ---------- */
.todo-tab b { display:inline-block; min-width:18px; margin-left:6px; padding:0 6px; border-radius:9px; background:var(--amber, #eda100); color:#000; font-size:12px; line-height:18px; text-align:center; }
.todo-steps ol { margin:0 0 12px; padding-left:20px; }
.todo-steps .row { display:flex; gap:8px; flex-wrap:wrap; }
.todo-list { padding:0; }
.todo-row { display:grid; grid-template-columns:48px 1fr; gap:10px 12px; padding:12px 14px; border-top:1px solid var(--line, rgba(127,127,127,.2)); align-items:start; }
.todo-row:first-child { border-top:0; }
.todo-row .thumb { width:48px; height:48px; }
.todo-main { min-width:0; }
.todo-title { display:flex; gap:8px; align-items:baseline; flex-wrap:wrap; }
.todo-prod { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.todo-inputs { grid-column:1 / -1; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.todo-price { width:120px; font-size:18px; padding:8px 10px; }
.todo-oos { display:flex; gap:4px; align-items:center; }
.todo-inputs .row { display:flex; gap:6px; margin-left:auto; }
.todo-row.is-skip, .todo-row.is-remove { opacity:.5; }
button.on { outline:2px solid currentColor; }
.todo-warn { color:#b45309; margin-top:4px; }
.todo-save { position:sticky; bottom:12px; display:flex; justify-content:flex-end; margin-top:12px; }
.todo-save button { box-shadow:0 2px 10px rgba(0,0,0,.2); }
.todo-done { text-align:center; padding:28px 16px; }
.todo-big { font-size:40px; color:#1baf7a; }
@media (min-width: 720px) {
  .todo-row { grid-template-columns:48px 1fr auto; }
  .todo-inputs { grid-column:auto; justify-content:flex-end; }
  .todo-inputs .row { margin-left:0; }
}
.todo-inputs input.todo-price { width:130px !important; max-width:130px; flex:none; }
@media (min-width: 720px) { .todo-inputs { flex-wrap:nowrap; } }
.tabs a { white-space:nowrap; }
@media (max-width: 440px) { .brand { font-size:16px; } .tabs a { padding:6px 7px; font-size:14px; } .todo-tab b { margin-left:3px; } }

.todo-note { grid-column:1 / -1; width:100%; min-height:38px; resize:vertical; font:inherit; font-size:14px; padding:8px 10px; box-sizing:border-box; }

.todo-saved { color:#1baf7a; font-weight:600; }
.todo-row.is-saved .todo-price { border-color:#1baf7a; }

.todo-row.is-current { background: color-mix(in srgb, #2a78d6 8%, transparent); box-shadow: inset 3px 0 0 #2a78d6; }
.todo-tab b[hidden] { display:none; }

.strip .tick { stroke: var(--muted); stroke-width: 1; }
.strip .avglab { fill: var(--text); font-weight: 600; }
.strip .cnt { fill: var(--text); font-size: 10px; font-weight: 600; }
.strip .dot { cursor: pointer; outline: none; }
.striptip { position: absolute; top: -6px; transform: translate(-50%, -100%); z-index: 5; background: var(--card); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; box-shadow: 0 4px 14px rgba(0,0,0,.25); font-size: 13px;
  white-space: nowrap; pointer-events: none; }
.striptip .tiprow { display: flex; gap: 6px; align-items: center; }
.striptip .tiprow b { margin-left: auto; padding-left: 10px; }
.striptip .tipbest { font-size: 11px; font-weight: 700; color: #15803d; }

.chip.sale.s-variant { background: color-mix(in srgb, #6250d6 16%, transparent); color: #6250d6; }
@media (prefers-color-scheme: dark) { .chip.sale.s-variant { color: #b3abf2; } }
.variantnote { flex-basis: 100%; color: #6250d6; margin-top: 2px; }
@media (prefers-color-scheme: dark) { .variantnote { color: #b3abf2; } }

/* ---------- To confirm ---------- */
.cq-prod { display:flex; gap:12px; align-items:center; padding:12px 14px; background:var(--soft); border-top:1px solid var(--line); }
.cq-prod:first-child { border-top:0; border-radius:12px 12px 0 0; }
.cq-prod .thumb { width:44px; height:44px; }
.cq-row { grid-template-columns: 110px 1fr; outline:none; }
.cq-row:focus { box-shadow: inset 3px 0 0 #2a78d6; }
.cq-shop { padding-top:2px; }
.cq-var { grid-column:1 / -1; width:100%; box-sizing:border-box; padding:8px 10px; font:inherit; }
.cq-note { grid-column:1 / -1; display:flex; gap:8px; align-items:flex-start; }
.cq-note .todo-note { flex:1; }
@media (min-width: 720px) { .cq-row { grid-template-columns: 140px 1fr auto; } }
button[hidden], .cq-var[hidden] { display: none !important; }
.cq-row .cq-why { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
.cq-row .cq-why.open { -webkit-line-clamp: unset; display: block; }

.strip .track.grad { stroke-width: 3; opacity: .9; }

/* ---------- category jump bar + collapsible groups ---------- */
.gjump { position: sticky; top: 0; z-index: 4; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding: 10px 0; margin: -6px 0 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.gchip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; }
.gchip:hover { border-color: var(--accent); }
.gchip b { font-size: 12px; color: var(--muted); font-weight: 600; }
.gall { margin-left: auto; display: flex; gap: 6px; }
.gtoggle { display: flex; align-items: baseline; gap: 10px; width: 100%; background: none; border: 0; padding: 4px 0; margin: 6px 0 10px;
  color: inherit; font: inherit; text-align: left; cursor: pointer; flex-wrap: wrap; }
.gtoggle h2 { margin: 0; }
.gtoggle .gsum { margin-left: auto; }
.gchev { display: inline-block; transition: transform .15s; color: var(--muted); font-size: 14px; }
.group.collapsed .gchev { transform: rotate(-90deg); }
.group.collapsed .gbody { display: none; }
.group.collapsed { margin-bottom: 8px; }
.group { scroll-margin-top: 64px; }
.group.flash > .gtoggle h2 { animation: gflash 1.2s ease; }
@keyframes gflash { 0%, 40% { color: var(--accent); } 100% { color: inherit; } }
@media (max-width: 600px) { .gall { margin-left: 0; width: 100%; } .gtoggle .gsum { margin-left: 0; width: 100%; } }
@media (max-width: 600px) {
  .top-in { flex-wrap: wrap; row-gap: 6px; }
  .tabs { width: 100%; display: flex; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: 1 0 auto; text-align: center; }
}

/* ---------- typography ---------- */
body, button, input, textarea, select { font-family: var(--font-body); }
h1, h2, h3, .brand, .big, .num, .c-price .num, .mprice, .sprice, .gchip, .verdict, .gtoggle h2, .todo-price, .strip text, .striptip b {
  font-family: var(--font-head); }
.brand { font-weight: 700; letter-spacing: -.01em; }
h1, h2 { letter-spacing: -.015em; font-weight: 700; }
.big { font-weight: 700; letter-spacing: -.025em; }

/* delete product */
.pcard { position: relative; }
.delbtn { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 8px; padding: 5px 7px; cursor: pointer; font: inherit; font-size: 13px; }
.delbtn:hover { color: #dc2626; border-color: #dc2626; }
.delbtn.oncard { position: absolute; top: 10px; right: 10px; z-index: 2; opacity: .55; }
.pcard:hover .delbtn.oncard, .delbtn.oncard:focus { opacity: 1; }
.pcard .ptitle { padding-right: 34px; }
@media (hover: none) { .delbtn.oncard { opacity: .8; } }

body.guest #tab-todo, body.guest #tab-confirm { display: none !important; }

.friendlink { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.friendlink a { word-break: break-all; }
body.guest .friendlink { display: none; }

.deleted { margin-top: 18px; }
.drow { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.drow .thumb { width: 40px; height: 40px; }
.dmain { flex: 1; min-width: 0; }

.stopbtn { color: #dc2626; border-color: color-mix(in srgb, #dc2626 40%, transparent); margin-left: 8px; }
.chip.stopping { background: var(--warn-bg); color: var(--warn); }
.chip.stopped, .chip.cancelled { background: var(--soft); color: var(--muted); }
