/* Layout: a corner-shop signboard header over a shelf grid; sheets slide up for cart and orders.
   Colours: chili red signage, price-tag yellow, rice-paper neutral with a faint red bias. */
:root {
  --bg: #f7f3f1;
  --surface: #ffffff;
  --sunk: #efe8e5;
  --fg: #221a18;
  --muted: #76655f;
  --line: #e4d9d5;
  --accent: #c8261c;
  --accent-fg: #ffffff;
  --tag: #ffd84a;
  --tag-fg: #221a18;
  --sign: #c8261c;
  --sign-fg: #ffffff;
  --ok: #1f7a4a;
  --warn: #a35c00;
  --pre: #3346b8;
  --pre-fg: #ffffff;
  --pre-soft: #eef0fc;
  --shadow: 0 10px 30px rgba(40, 10, 5, .18);
  --f-cn: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --f-body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-num: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171211; --surface: #221b1a; --sunk: #1b1514; --fg: #f3ebe8; --muted: #a8968f; --line: #3a2f2c;
    --accent: #ff5a4c; --accent-fg: #1a0d0b; --tag: #f2c935; --tag-fg: #1a1412; --ok: #5cc98c; --warn: #f0a650; --pre: #8d9bff; --pre-fg: #111433; --pre-soft: #23263f;
    --shadow: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font: 15px/1.45 var(--f-body);
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap {
  max-width: 1080px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.cn { font-family: var(--f-cn); }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
h1, h2, h3 { margin: 0; text-wrap: balance; }

/* ---------- signboard header ---------- */
.sign {
  background: var(--sign); color: var(--sign-fg);
  position: sticky; top: 0; z-index: 20;
  padding-top: env(safe-area-inset-top, 0px);
}
.sign .wrap { display: flex; align-items: center; gap: 12px; padding-block: 12px; flex-wrap: wrap; }
.sign h1 { font-family: var(--f-cn); font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; flex: 1; min-width: 0; }
.sign h1 small { display: block; font-family: var(--f-body); font-weight: 600; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.sign .btn { background: rgba(255,255,255,.14); color: var(--sign-fg); border-color: rgba(255,255,255,.35); }
.sign .btn:hover { background: rgba(255,255,255,.24); }
.sign .btn.solid { background: var(--tag); color: var(--tag-fg); border-color: var(--tag); }
.who { font-size: .82rem; opacity: .95; display: flex; gap: 6px; align-items: center; min-width: 0; flex-wrap: wrap; }
.who b { word-break: break-all; }
@media (max-width: 640px) {
  .sign { position: relative; }
  .sign h1 { font-size: 1.1rem; }
  .sign h1 small { font-size: .62rem; letter-spacing: .06em; }
}
.who b { font-family: var(--f-num); font-weight: 600; }
.linkish { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font-size: inherit; }

/* ---------- buttons, fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--fg);
  border-radius: 8px; padding: 9px 14px; font-weight: 600; cursor: pointer; line-height: 1.2;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 10px; font-size: .85rem; }
.btn.block { width: 100%; padding: 13px 16px; font-size: 1rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible, .linkish:focus-visible {
  outline: 3px solid var(--tag); outline-offset: 2px;
}
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--tag); color: var(--tag-fg); font: 600 .75rem var(--f-num);
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.field > span .cn { text-transform: none; letter-spacing: 0; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px;
  padding: 11px 12px; font-size: 16px; /* 16px stops iOS zooming in */
}
.field textarea { resize: vertical; min-height: 64px; }
.hint { font-size: .82rem; color: var(--muted); }
.err { color: var(--accent); font-size: .88rem; font-weight: 600; }

/* ---------- login ---------- */
.login { display: grid; gap: 18px; max-width: 440px; margin: 40px auto; padding-inline: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.login h2 { font-size: 1.35rem; }
.wechat-box {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--sunk); border: 1px dashed var(--line); border-radius: 12px; padding: 14px;
}
.wechat-box .id { font: 600 1.15rem var(--f-num); letter-spacing: .02em; user-select: all; }

/* ---------- notices ---------- */
.strip { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-block: 12px; font-size: .86rem; color: var(--muted); }
.strip b { color: var(--fg); }
.notice { background: var(--tag); color: var(--tag-fg); border-radius: 10px; padding: 10px 14px; font-weight: 600; margin-top: 12px; }

/* ---------- shelf ---------- */
.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; padding-block: 8px 120px; }
@media (max-width: 440px) { .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.prod { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.prod .ph { aspect-ratio: 1; background: #fff; max-width: 100%; position: relative; }
.prod .ph img { width: 100%; height: 100%; object-fit: contain; }
.prod.soldout .ph img { opacity: .5; filter: grayscale(.6); }
.stock {
  position: absolute; left: 8px; top: 8px; font: 600 .72rem var(--f-body);
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px;
}
.stock.low { color: var(--warn); }
.stock.out { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.prod .info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; border-top: 1px solid var(--line); min-width: 0; }
.prod .n-cn { font-family: var(--f-cn); font-weight: 700; font-size: .95rem; line-height: 1.3; }
.prod .n-en { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.prod .meta { font-size: .74rem; color: var(--muted); }
.prod .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; flex-wrap: wrap; }
.tag { background: var(--tag); color: var(--tag-fg); font: 600 1rem var(--f-num); padding: 3px 9px; border-radius: 3px; font-variant-numeric: tabular-nums; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { border: 0; background: var(--sunk); width: 34px; height: 34px; font-size: 1.1rem; font-weight: 700; cursor: pointer; }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper span { min-width: 30px; text-align: center; font: 600 .95rem var(--f-num); }
.pre-chip { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pre); }

/* ---------- floating cart bar ---------- */
.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow);
}
.cartbar .inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.cartbar .sum { flex: 1; min-width: 0; }
.cartbar .sum b { font: 600 1.2rem var(--f-num); }

/* ---------- sheets ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 30; background: rgba(20, 8, 5, .5);
  display: flex; align-items: flex-end; justify-content: center;
  padding-top: max(24px, env(safe-area-inset-top, 0px));
}
@media (min-width: 720px) { .overlay { align-items: center; padding: 24px; } }
.sheet {
  background: var(--bg); width: min(560px, 100%); max-height: 100%; overflow: auto;
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column;
}
@media (min-width: 720px) { .sheet { border-radius: 16px; max-height: calc(100vh - 48px); } }
.sheet header { position: sticky; top: 0; background: var(--bg); display: flex; align-items: center; gap: 10px; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); z-index: 1; }
.sheet header h2 { flex: 1; font-size: 1.15rem; }
.sheet .body { padding: 16px 18px calc(20px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.x { border: 0; background: var(--sunk); width: 36px; height: 36px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; }

.lines { display: flex; flex-direction: column; gap: 10px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
.line img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 6px; }
.line .t { min-width: 0; }
.line .t .n-cn { font-family: var(--f-cn); font-weight: 700; font-size: .9rem; }
.line .t .sub { font-size: .78rem; color: var(--muted); }
.line .r { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.totalrow { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; }
.totalrow .num { font-size: 1.4rem; }
.pay {
  border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.pay .ways { display: flex; flex-wrap: wrap; gap: 6px; }
.pay .ways span { background: var(--sunk); border-radius: 6px; padding: 3px 8px; font-weight: 600; font-size: .85rem; }

/* ---------- orders ---------- */
.ord { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.ord .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ord .code { font: 700 1.05rem var(--f-num); letter-spacing: .05em; }
.ord ul { margin: 0; padding-left: 18px; font-size: .9rem; }
.status { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid currentColor; }
.status.new { color: var(--warn); }
.status.confirmed { color: var(--accent); }
.status.delivered { color: var(--ok); }
.status.cancelled { color: var(--muted); }
.done { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding-block: 8px; }
.done .code { font: 700 2rem var(--f-num); letter-spacing: .08em; background: var(--tag); color: var(--tag-fg); padding: 4px 14px; border-radius: 6px; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 40;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: var(--shadow);
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }
@media (prefers-reduced-motion: no-preference) {
  .sheet { animation: up .22s ease-out; }
  @keyframes up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* ---------- meal sets ---------- */
h2.sec { font-size: 1.05rem; margin: 14px 0 10px; display: flex; gap: 8px; align-items: baseline; }
h2.sec .cn { font-size: 1.15rem; }
.sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 8px; }
@media (max-width: 440px) { .sets { grid-template-columns: minmax(0, 1fr); } }
.set { background: var(--surface); border: 2px solid var(--tag); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.set.soldout { border-color: var(--line); opacity: .7; }
.set-imgs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #fff; border-bottom: 1px solid var(--line); }
.set-imgs img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.set .info { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.set .n-cn { font-family: var(--f-cn); font-weight: 700; font-size: 1rem; line-height: 1.35; }
.set .n-en { font-size: .8rem; color: var(--muted); }
.set .slots { margin: 2px 0 0; padding-left: 18px; font-size: .88rem; }
.set .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 8px; }
.gift { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; background: var(--ok); color: #fff; vertical-align: 1px; }

.slot { display: flex; flex-direction: column; gap: 8px; }
.slot-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.slot-head .count { margin-left: auto; font: 600 .85rem var(--f-num); color: var(--muted); }
.slot-head .count.done { color: var(--ok); }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opt {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px 6px 6px; width: 100%; font: inherit; color: inherit;
}
button.opt { cursor: pointer; }
.opt.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt.out { opacity: .45; }
.opt img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 6px; }
.opt .t { display: flex; flex-direction: column; min-width: 0; }
.opt .n-cn { font-family: var(--f-cn); font-weight: 700; font-size: .9rem; }
.opt .sub { font-size: .76rem; color: var(--muted); }
.opt:focus-visible { outline: 3px solid var(--tag); outline-offset: 2px; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); }
.radio.on { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
.parts { margin: 2px 0 0; padding-left: 16px; }
.area { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.ord ul ul { padding-left: 16px; }
.set .slots .choices { font-family: var(--f-cn); }
.price-wrap { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pricebox { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.wasline { display: inline-flex; align-items: center; gap: 5px; line-height: 1; }
.was { color: var(--muted, #888); font: 500 .8rem var(--f-num); text-decoration-thickness: 1.5px; text-decoration-color: #d33; }
.off { background: #d6262b; color: #fff; font: 700 .68rem var(--f-num); padding: 2px 5px; border-radius: 3px; }
.save { font-size: .78rem; font-weight: 700; color: var(--ok); }

/* several menus stacked on one price card */
.set .member .sn { font-family: var(--f-cn); font-weight: 600; font-size: .92rem; line-height: 1.35; }
.set .member.out { opacity: .55; }
.set .or { font-size: .72rem; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.set .or::before, .set .or::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }

/* single meal-set card */
.setall .slots li { font-family: var(--f-cn); }
.opt .t .save { display: block; margin-top: 2px; }
@media (min-width: 700px) {
  .sets:has(.setall) { grid-template-columns: minmax(0, 1fr); }
  .setall { flex-direction: row; }
  .setall .set-imgs { flex: 0 0 46%; border-bottom: 0; border-right: 1px solid var(--line); align-items: center; }
  .setall .info { padding: 18px 20px; }
}

/* meal-set picker, step 1: choose the set */
.setpick-list { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.setpick { display: flex; flex-direction: column; text-align: left; width: 100%; padding: 0; overflow: hidden; background: var(--surface); border: 2px solid var(--tag); border-radius: var(--r); color: inherit; font: inherit; cursor: pointer; }
.setpick:hover, .setpick:focus-visible { border-color: var(--accent); }
.setpick.out { border-color: var(--line); opacity: .55; cursor: default; }
.setpick-imgs { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: #fff; border-bottom: 1px solid var(--line); }
.setpick-imgs img { width: 100%; height: 110px; object-fit: contain; padding: 8px; }
.setpick-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; }
.setpick .n-cn { font-family: var(--f-cn); font-weight: 700; font-size: 1rem; line-height: 1.35; }
.setpick .n-en { font-size: .8rem; color: var(--muted); }
.setpick .slots { margin: 4px 0 0; padding-left: 18px; font-size: .88rem; }
.setpick-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.setpick-foot .go { margin-left: auto; font-weight: 700; color: var(--accent); }
/* step 2 */
.backbar { align-self: flex-start; background: none; border: 0; padding: 4px 0; font: 600 .95rem var(--f-cn, inherit); color: var(--accent); cursor: pointer; }
.opt.fixed { cursor: default; }
.opt .tickmark { font-weight: 800; color: var(--ok); font-size: 1.2rem; padding: 0 6px; }


/* ---------- preorder look: available to order ahead, not dead ---------- */
.prod.pre { border-color: var(--pre); box-shadow: inset 0 0 0 1px var(--pre); }
.stock.prebadge { display: inline-flex; align-items: center; gap: 5px; background: var(--pre); color: var(--pre-fg); border-color: var(--pre); }
.prenote { display: flex; gap: 7px; align-items: flex-start; margin-top: 4px; padding: 7px 9px; border-radius: 8px; background: var(--pre-soft); color: var(--pre); font-size: .76rem; line-height: 1.35; font-weight: 600; }
.prenote svg { flex: none; margin-top: 2px; }
.prenote b { font-weight: 800; }
.btn.prebtn { background: var(--pre); border-color: var(--pre); color: var(--pre-fg); font-weight: 700; }
.btn.prebtn:hover { filter: brightness(1.08); }

/* ---------- ad slots: small, labelled, only in spare space ---------- */
.adslot { text-align: center; margin: 22px auto 0; max-width: 100%; overflow: hidden; }
.adlabel { display: block; font-size: .64rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.adslot ins { max-width: 100%; }
.login .adslot { margin-top: 0; }
.shelf:has(+ .adslot:not([hidden])) { padding-bottom: 8px; }
.ad-bottom { margin-bottom: 120px; }
.adrail { display: none; }
@media (min-width: 1460px) {
  .adrail:not([hidden]) { display: block; position: fixed; top: 170px; width: 160px; text-align: center; z-index: 1; }
  .adrail.left { left: calc(50% - 540px - 190px); }
  .adrail.right { right: calc(50% - 540px - 190px); }
}

/* meal sets that can only be preordered */
.set.setall.pre { border-color: var(--pre); }
.setpick.pre { border-color: var(--pre); }
.setpick.pre .go { color: var(--pre); }
.setall .prenote, .setpick .prenote { margin-top: 6px; }
.opt .t .pre-chip { display: block; margin-top: 2px; text-transform: none; letter-spacing: 0; font-size: .74rem; }
#set-add.prebtn { background: var(--pre); border-color: var(--pre); color: var(--pre-fg); }

/* ---------- paused / closed: hard-to-miss bar + pop-up ---------- */
.statusbar { color: #fff; position: sticky; top: var(--hdr, 0px); z-index: 19; box-shadow: 0 4px 14px rgba(0,0,0,.2); }
.statusbar .wrap { flex-wrap: nowrap; }
.sb-body { flex: 1; }
@media (max-width: 560px) { .sb-sub { display: none; } .sb-msg { font-size: 1.05rem; } }
.statusbar.closed { background: #2b2140; }
.statusbar.paused { background: #b86e00; }
.statusbar .wrap { display: flex; gap: 12px; align-items: flex-start; padding-block: 10px; }
.sb-ico { font-size: 1.6rem; line-height: 1; }
.sb-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sb-body b { font-size: 1.05rem; font-family: var(--f-cn); }
.sb-msg { font-size: 1.15rem; font-weight: 700; line-height: 1.35; background: rgba(255,255,255,.14); border-radius: 8px; padding: 6px 10px; margin: 2px 0; overflow-wrap: anywhere; }
.sb-sub { font-size: .85rem; opacity: .9; }
.overlay.popup { align-items: center; padding: 20px; }
.popcard { background: var(--surface); color: var(--fg); width: min(400px, 100%); border-radius: 16px; padding: 24px 20px 20px; text-align: center; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.popcard .pop-ico { font-size: 2.6rem; line-height: 1; }
.popcard h2 { margin: 0; font-size: 1.25rem; font-family: var(--f-cn); }
.popcard .pop-msg { margin: 4px 0; font-size: 1.2rem; font-weight: 700; line-height: 1.4; padding: 12px; border-radius: 10px; background: var(--sunk); overflow-wrap: anywhere; }
.popup.paused .popcard { border-top: 6px solid #b86e00; }
.popup.closed .popcard { border-top: 6px solid #2b2140; }
.statusbar.open { background: var(--pre); color: var(--pre-fg); }
.popup.open .popcard { border-top: 6px solid var(--pre); }

/* ---------- section tabs ---------- */
.sections { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 16px 0 2px; margin-inline: -16px; padding-inline: 16px; scroll-padding-inline: 16px; }
.sections::-webkit-scrollbar { display: none; }
.sections button { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 99px; padding: 8px 14px; font: 600 .9rem var(--f-body); cursor: pointer; white-space: nowrap; }
.sections button .cn { font-family: var(--f-cn); }
.sections button .n { font: 600 .72rem var(--f-num); color: var(--muted); margin-left: 2px; }
.sections button[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.sections button[aria-selected="true"] .n { color: inherit; opacity: .7; }
/* the "all" tab: a round home button in the shop's red */
.sections { align-items: center; }
.sections button.home { width: 42px; height: 42px; padding: 0; border-radius: 50%; display: grid; place-items: center; background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 3px 10px color-mix(in srgb, var(--accent) 40%, transparent); }
.sections button.home[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--accent); }
.sections button.home:not([aria-selected="true"]) { background: var(--surface); color: var(--accent); border: 2px solid var(--accent); box-shadow: none; }
.sections { padding-top: 18px; padding-bottom: 6px; }

/* ---------- compact header: info + account drop-downs ---------- */
.sign .wrap { flex-wrap: nowrap; }
.hdr-actions { display: flex; gap: 6px; flex: none; }
.hbtn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 99px; border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.14); color: var(--sign-fg); font: 600 .85rem var(--f-body); cursor: pointer; }
.hbtn:hover, .hbtn[aria-expanded="true"] { background: rgba(255,255,255,.26); }
.hbtn b { font-family: var(--f-num); font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbtn .caret { opacity: .8; }
@media (max-width: 480px) { .hbtn .lbl { display: none; } .hbtn { padding: 0 9px; } }
.dropdown { position: absolute; top: calc(100% - 4px); right: max(16px, calc(50% - 524px)); z-index: 25; width: min(340px, calc(100vw - 32px));
  background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; }
.dropdown.menu { width: min(240px, calc(100vw - 32px)); padding: 6px; }
.info-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: var(--muted); }
.info-list b { color: var(--fg); }
.dropdown .who { display: block; padding: 8px 10px 6px; font-size: .78rem; color: var(--muted); }
.mitem { display: block; width: 100%; text-align: left; border: 0; background: none; color: var(--fg); font: 600 .95rem var(--f-body); padding: 10px; border-radius: 8px; cursor: pointer; }
.mitem:hover { background: var(--sunk); }
.mitem#logout { color: var(--accent); }
.sign h1 > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .sign h1 small { display: none; }
  .sign .wrap { padding-block: 10px; gap: 8px; }
  .hbtn b { max-width: 72px; }
}
@media (max-width: 480px) {
  .sign h1 { font-size: 1.02rem; letter-spacing: 0; }
  .hbtn .caret { display: none; }
  .hbtn { gap: 5px; padding: 0 8px; }
}

/* pack cards (e.g. 魔芋爽 3包): three pictures in one */
.packph { display: grid; grid-template-columns: repeat(3, 1fr); align-items: center; padding: 8px 4px; gap: 2px; }
.packph img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; }
.packcard .meta { font-family: var(--f-cn); }

/* ---------- product details ---------- */
.zoomable { position: relative; display: inline-flex; flex: none; cursor: zoom-in; }
.zoom-ico { position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; pointer-events: none; }
.prod .ph { cursor: zoom-in; }
.prod .ph .zoom-ico { right: 8px; bottom: 8px; width: 26px; height: 26px; }
.prod .ph .zoom-ico svg { width: 16px; height: 16px; }
.zoomlayer { position: fixed; inset: 0; z-index: 45; background: rgba(20, 8, 5, .62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.zoomcard { position: relative; background: var(--surface); color: var(--fg); width: min(420px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 16px; box-shadow: var(--shadow); }
.zoomcard .x { position: absolute; top: 10px; right: 10px; z-index: 1; }
.dt-img { background: #fff; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.dt-img img { width: 100%; max-height: 58vh; object-fit: contain; }
.dt-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.dt-body h3 { margin: 0; font-family: var(--f-cn); font-size: 1.15rem; line-height: 1.35; }
.dt-en { color: var(--muted); font-size: .9rem; }
.dt-meta { color: var(--muted); font-size: .85rem; }
.dt-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.ok-chip { font-size: .78rem; font-weight: 700; color: var(--ok); }
/* step 1: what's inside a set */
.setpick { cursor: pointer; }
.setpick[aria-disabled="true"] { cursor: default; }
.setpick-foot { justify-content: flex-start; }
.foot-btns { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; }
.inside { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); cursor: default; }
.inside-head { font-size: .88rem; }
.inside-head b { font-family: var(--f-cn); }
.inside-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 6px; }
.inside-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--fg); font: inherit; cursor: zoom-in; text-align: center; }
.inside-item img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 6px; }
.inside-item .nm { font-family: var(--f-cn); font-size: .74rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inside-item.dim img { opacity: .6; }
.setpick-imgs .zoomable { display: flex; }
.setpick-imgs .zoomable img { width: 100%; }
