/* Deal Check — look matches mock option A (clean grid). */
:root {
  --ink: #111111;
  --ink2: #3A3A3C;
  --muted: #6A6A6A;
  --line: #EBEBEB;
  --line2: #DDDDDD;
  --tile: #F4F4F4;
  --sale: #C2261D;
  --sale-dark: #A51F17;
  --sale-bg: #FDECEA;
  --chip: #F2F2F2;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: #FFFFFF; color: var(--ink); }
body {
  font-family: Inter, -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--ink); }
a:hover { color: var(--ink2); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; }
.wrap { max-width: 1100px; margin: 0 auto; min-height: 100vh; position: relative; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- lock ---------- */
.lock { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: calc(40px + var(--safe-t)) 28px 40px; max-width: 420px; margin: 0 auto; }
.lock-mark { width: 64px; height: 64px; border-radius: 18px; }
.lock h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 800; letter-spacing: -0.6px; }
.lock p { margin: 4px 0 0; color: var(--muted); font-size: 16px; line-height: 22px; }
.lock input { width: 100%; height: 58px; border-radius: 16px; border: 1px solid var(--line2); font-size: 26px; letter-spacing: 10px; text-align: center; font-weight: 700; outline: none; }
.lock input:focus { border-color: var(--ink); }
.lock .err { color: var(--sale); font-weight: 600; font-size: 15px; min-height: 20px; margin: -8px 0 0; }

/* ---------- buttons ---------- */
.btn { height: 50px; padding: 0 20px; border-radius: 999px; border: none; background: var(--ink); color: #FFFFFF; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { color: #FFFFFF; background: #2A2A2A; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.btn.full { width: 100%; }
.btn.ghost { background: #FFFFFF; color: var(--ink); border: 1px solid var(--line2); }
.btn.ghost:hover { background: #F7F7F7; color: var(--ink); }
.btn.sale { background: var(--sale); border-radius: 14px; height: 52px; font-weight: 700; }
.btn.sale:hover { background: var(--sale-dark); }
.btn.sq { border-radius: 14px; }
.btn.small { height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; }
.btn.danger { background: #FFFFFF; color: var(--sale); border: 1px solid var(--line2); }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 1px solid #E6E6E6; background: #FFFFFF; display: inline-flex; align-items: center; justify-content: center; padding: 0; text-decoration: none; flex: 0 0 auto; }
.icon-btn.float { border: none; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); width: 40px; height: 40px; }
.badge { position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--sale); color: #FFFFFF; font-size: 11px; line-height: 18px; font-weight: 700; text-align: center; box-shadow: 0 0 0 2px #FFFFFF; }
.dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--sale); box-shadow: 0 0 0 2px #FFFFFF; }

/* ---------- home header ---------- */
.home-head { padding: calc(20px + var(--safe-t)) 20px 0; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 700px) { .home-head { padding-top: calc(28px + var(--safe-t)); } }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.title-row h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 800; letter-spacing: -0.6px; }
.title-row .sub { margin: 2px 0 0; font-size: 15px; line-height: 20px; color: var(--muted); }
.title-row .sub b { color: var(--sale); font-weight: 600; }
.head-btns { display: flex; gap: 8px; }

.paste { display: flex; gap: 8px; margin: 0; }
.paste label { flex: 1; min-width: 0; height: 50px; border-radius: 999px; border: 1px solid var(--line2); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06); display: flex; align-items: center; gap: 10px; padding: 0 6px 0 16px; }
.paste input { flex: 1; min-width: 0; border: none; outline: none; font-size: 16px; background: transparent; }
.paste .clip { height: 38px; padding: 0 12px; border-radius: 999px; border: none; background: var(--chip); font-size: 14px; font-weight: 600; flex: 0 0 auto; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: #FFFFFF; font-size: 14px; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--ink); color: #FFFFFF; border-color: var(--ink); }
.chip.round { width: 36px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; position: relative; }
.quick { display: flex; gap: 8px; margin-top: -6px; flex-wrap: wrap; }
.qchip { height: 30px; padding: 0 12px; border-radius: 8px; border: none; background: var(--chip); font-size: 13px; font-weight: 600; }
.qchip.on { background: var(--ink); color: #FFFFFF; }
.qchip.sale { background: var(--sale-bg); color: var(--sale-dark); font-weight: 700; }
.qchip.sale.on { background: var(--sale); color: #FFFFFF; }
.store-filter { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 8px; background: var(--ink); color: #FFFFFF; font-size: 13px; font-weight: 600; border: none; }

.banner { margin: 0 20px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.banner p { margin: 0; font-size: 14px; line-height: 19px; color: var(--muted); }
.banner strong { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.banner .x { width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent; flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- grid ---------- */
.grid { padding: 20px 20px calc(40px + var(--safe-b)); display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); column-gap: 14px; row-gap: 22px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); column-gap: 20px; } }
.card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); min-width: 0; }
.card:hover { color: var(--ink); }
.tile { position: relative; display: block; aspect-ratio: 160 / 168; border-radius: 14px; background: var(--tile); overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: contain; padding: 14px; mix-blend-mode: multiply; }
.tile.out img { opacity: 0.45; }
.tile.noimg .ph { display: flex; }
.tile .ph { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: #B5B5B5; font-size: 28px; font-weight: 800; }
.pill { position: absolute; left: 8px; top: 8px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 700; display: flex; align-items: center; }
.pill.drop { background: #FFFFFF; color: var(--sale); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10); }
.pill.out { background: var(--ink); color: #FFFFFF; font-size: 12px; }
.meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.meta .store { font-size: 13px; line-height: 17px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .name { font-size: 15px; line-height: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prices { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; flex-wrap: wrap; }
.prices .now { font-size: 15px; line-height: 20px; font-weight: 700; }
.prices .now.sale { color: var(--sale); }
.prices .was { font-size: 13px; color: var(--muted); text-decoration: line-through; }
.codetag { align-self: flex-start; margin-top: 4px; min-height: 22px; padding: 2px 7px; border-radius: 6px; border: 1px dashed var(--ink); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn { font-size: 12px; color: var(--muted); margin-top: 2px; }

.skeleton .tile { animation: pulse 1.2s ease-in-out infinite; display: flex; align-items: center; justify-content: center; }
.skeleton .tile span { font-size: 13px; color: var(--muted); font-weight: 600; padding: 0 12px; text-align: center; }
.skeleton .bar { height: 12px; border-radius: 6px; background: var(--tile); margin-top: 4px; }
@keyframes pulse { 50% { opacity: 0.6; } }

.empty { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--muted); }
.empty h2 { color: var(--ink); font-size: 20px; margin: 0 0 6px; }
.empty p { margin: 0 auto; max-width: 320px; line-height: 21px; }

/* ---------- item ---------- */
.item { max-width: 560px; margin: 0 auto; padding-bottom: calc(110px + var(--safe-b)); }
.hero { position: relative; height: 300px; background: var(--tile); display: flex; align-items: center; justify-content: center; }
@media (min-width: 600px) { .hero { border-radius: 0 0 20px 20px; } }
.hero img { width: 62%; height: 72%; object-fit: contain; margin-top: calc(24px + var(--safe-t)); mix-blend-mode: multiply; }
.hero .back { position: absolute; left: 16px; top: calc(14px + var(--safe-t)); }
.hero .share { position: absolute; right: 16px; top: calc(14px + var(--safe-t)); }
.item-body { padding: 20px 20px 0; display: flex; flex-direction: column; gap: 14px; }
.item-body .storename { margin: 0; font-size: 14px; line-height: 18px; color: var(--muted); }
.item-body h1 { margin: 2px 0 0; font-size: 24px; line-height: 30px; font-weight: 700; letter-spacing: -0.3px; }
.price-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.price-row .big { font-size: 30px; line-height: 36px; font-weight: 800; }
.price-row .big.sale { color: var(--sale); }
.price-row .was { font-size: 17px; color: var(--muted); text-decoration: line-through; }
.save-pill { height: 28px; padding: 0 10px; border-radius: 999px; background: var(--sale-bg); color: var(--sale-dark); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; }
.out-pill { height: 28px; padding: 0 10px; border-radius: 999px; background: var(--ink); color: #FFFFFF; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; }
.coderow { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 14px; border-radius: 14px; border: 1.5px dashed var(--ink); }
.coderow .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.coderow .t1 { font-size: 15px; font-weight: 700; }
.coderow .t2 { font-size: 13px; color: var(--muted); }

.chart-head { display: flex; justify-content: space-between; align-items: baseline; }
.chart-head h2 { margin: 0; font-size: 17px; font-weight: 700; }
.ranges { display: flex; gap: 4px; font-size: 14px; }
.ranges button { border: none; background: transparent; padding: 0 6px; height: 32px; color: var(--muted); }
.ranges button.on { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.chart { width: 100%; height: 110px; display: block; overflow: visible; }
.chart-foot { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.chart-note { font-size: 13px; color: var(--muted); margin: 0; }

.box { border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; min-height: 50px; border-bottom: 1px solid var(--line); font-size: 15px; }
.row:last-child { border-bottom: none; }
.row .k { color: var(--muted); }
.row .v { font-weight: 600; text-align: right; }
.row select { border: none; background: transparent; font-weight: 600; text-align: right; height: 40px; padding: 0 4px; font-size: 15px; }
.row .err { color: var(--sale); font-weight: 500; font-size: 14px; }
.linkbtn { border: none; background: transparent; padding: 0; height: 40px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: 15px; }

.switch { flex: 0 0 51px; width: 51px; height: 31px; border-radius: 999px; border: none; background: #D6D6D6; position: relative; padding: 0; transition: background 0.15s; }
.switch::after { content: ''; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.15s; }
.switch[aria-checked="true"] { background: var(--ink); }
.switch[aria-checked="true"]::after { transform: translateX(20px); }

.bottombar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 20px calc(12px + var(--safe-b)); background: #FFFFFF; border-top: 1px solid var(--line); display: flex; gap: 10px; z-index: 5; }
.bottombar-in { max-width: 520px; margin: 0 auto; width: 100%; display: flex; gap: 10px; align-items: center; }
.bottombar .sqbtn { width: 52px; height: 52px; border-radius: 14px; border: 1px solid var(--line2); background: #FFFFFF; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.bottombar .grow { flex: 1; }
.bottombar .between { flex: 1; display: flex; flex-direction: column; }
.bottombar .between .t1 { font-size: 15px; font-weight: 700; }
.bottombar .between .t2 { font-size: 13px; color: var(--muted); }

/* ---------- stores ---------- */
.page { max-width: 560px; margin: 0 auto; padding-bottom: calc(110px + var(--safe-b)); }
.page-head { padding: calc(14px + var(--safe-t)) 20px 0; display: flex; flex-direction: column; gap: 12px; }
.page-head .back { margin-left: -8px; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.page-head h1 { margin: 0; font-size: 30px; line-height: 36px; font-weight: 800; letter-spacing: -0.6px; }
.page-head p { margin: 2px 0 0; font-size: 15px; line-height: 20px; color: var(--muted); }
.sec { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; }
.sec h2 { margin: 0; font-size: 17px; font-weight: 700; }
.salecard { padding: 14px; border-radius: 16px; border: 1px solid var(--line); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05); display: flex; flex-direction: column; gap: 10px; }
.salecard .top { display: flex; align-items: center; gap: 10px; }
.mono { flex: 0 0 40px; height: 40px; border-radius: 12px; background: var(--tile); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800; }
.salecard .who { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; border: none; background: transparent; padding: 0; }
.salecard .who b { font-size: 15px; }
.salecard .who span { font-size: 13px; color: var(--muted); }
.ends { height: 24px; padding: 0 9px; border-radius: 999px; background: var(--sale-bg); color: var(--sale-dark); font-size: 12px; font-weight: 700; display: flex; align-items: center; white-space: nowrap; }
.salecard .deal { margin: 0; font-size: 16px; line-height: 21px; font-weight: 700; }
.salecard .acts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dashbtn { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 1.5px dashed var(--ink); background: #FFFFFF; font-size: 14px; font-weight: 700; }
.graybtn { height: 36px; padding: 0 12px; border-radius: 10px; background: var(--chip); border: none; font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; }
.follow-list { list-style: none; margin: 0; padding: 0; }
.follow-list li button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 0; border: none; border-bottom: 1px solid var(--line); background: transparent; text-align: left; min-height: 56px; }
.follow-list .mono { flex: 0 0 36px; height: 36px; border-radius: 10px; font-size: 13px; }
.follow-list .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.follow-list .who b { font-size: 15px; font-weight: 600; }
.follow-list .who span { font-size: 13px; color: var(--muted); }
.textlink { border: none; background: transparent; padding: 0; height: 40px; font-size: 15px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.38); z-index: 20; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
@media (min-width: 700px) { .scrim { align-items: center; } }
.sheet { width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto; background: #FFFFFF; border-radius: 24px 24px 0 0; padding: 10px 20px calc(24px + var(--safe-b)); display: flex; flex-direction: column; gap: 14px; animation: up 0.2s ease-out; }
@media (min-width: 700px) { .sheet { border-radius: 24px; } }
.sheet .grab { align-self: center; width: 40px; height: 5px; border-radius: 999px; background: #D4D4D9; }
.sheet h2 { margin: 0; font-size: 21px; font-weight: 800; }
.sheet p { margin: 0; font-size: 15px; line-height: 21px; color: var(--muted); }
.sheet .opts { display: flex; flex-direction: column; }
.sheet .opt { display: flex; align-items: center; justify-content: space-between; min-height: 50px; border: none; border-bottom: 1px solid var(--line); background: transparent; font-size: 16px; text-align: left; padding: 0 2px; }
.sheet .opt.on { font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.field input { height: 48px; border-radius: 12px; border: 1px solid var(--line2); padding: 0 14px; font-size: 16px; font-weight: 500; outline: none; width: 100%; }
.field input:focus { border-color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--chip); }
.seg button { flex: 1; height: 42px; border: none; border-radius: 10px; background: transparent; font-weight: 600; font-size: 15px; }
.seg button.on { background: #FFFFFF; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.alert-row { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.alert-row b { font-size: 15px; }
.alert-row span { font-size: 14px; color: var(--muted); line-height: 19px; }
.alert-row time { font-size: 12px; color: var(--muted); }
.found { padding: 12px 14px; border-radius: 14px; background: var(--tile); font-size: 14px; line-height: 20px; }
.stack { display: flex; flex-direction: column; gap: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); transform: translateX(-50%) translateY(20px); background: var(--ink); color: #FFFFFF; padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; max-width: calc(100% - 40px); width: max-content; opacity: 0; pointer-events: none; transition: all 0.2s; z-index: 40; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.loading { padding: 80px 20px; text-align: center; color: var(--muted); }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
