/* ===================================================================
   LIQUID GLASS
   Translucent frosted surfaces (blur + saturation), a light-catching
   gradient rim, a specular highlight on top and a soft drop shadow,
   floating over a slowly drifting colourful backdrop.
   All colours are tokens here; the rest of the file only uses them.
   =================================================================== */
:root {
  --bg: #e8ebf5;
  --text: #0e1020;
  --muted: rgba(14, 16, 32, .56);
  --line: rgba(14, 16, 32, .08);

  --glass: rgba(255, 255, 255, .30);
  --glass-strong: rgba(255, 255, 255, .60);
  --glass-rim-a: rgba(255, 255, 255, .95);
  --glass-rim-b: rgba(255, 255, 255, .10);
  --glass-shine: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, .12) 38%, rgba(255, 255, 255, 0) 60%);
  --glass-shadow: 0 12px 32px rgba(30, 34, 70, .14), 0 2px 6px rgba(30, 34, 70, .06);
  --glass-inset: inset 0 1px 1px rgba(255, 255, 255, .9), inset 0 -10px 20px rgba(255, 255, 255, .10);
  --blur: blur(24px) saturate(190%);
  --blur-soft: blur(14px) saturate(170%);

  --ink: rgba(14, 16, 32, .88);       /* primary buttons, selected chips */
  --ink-text: #ffffff;
  --accent: #0e1020;

  --success: #0f9f6e;
  --danger: #e0453f;
  --warning: #c98208;
  --reserved: #7c4dff;

  --blob-1: rgba(167, 139, 250, .75);  /* violet */
  --blob-2: rgba(96, 165, 250, .70);   /* sky */
  --blob-3: rgba(251, 146, 60, .55);   /* peach */
  --blob-4: rgba(52, 211, 153, .50);   /* mint */
  --blob-5: rgba(244, 114, 182, .55);  /* pink */
}

:root[data-theme="dark"] {
  --bg: #07080e;
  --text: #f3f5fb;
  --muted: rgba(243, 245, 251, .58);
  --line: rgba(255, 255, 255, .08);

  --glass: rgba(255, 255, 255, .07);
  --glass-strong: rgba(255, 255, 255, .16);
  --glass-rim-a: rgba(255, 255, 255, .45);
  --glass-rim-b: rgba(255, 255, 255, .04);
  --glass-shine: linear-gradient(180deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .03) 40%, rgba(255, 255, 255, 0) 60%);
  --glass-shadow: 0 14px 36px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .4);
  --glass-inset: inset 0 1px 1px rgba(255, 255, 255, .22), inset 0 -10px 20px rgba(255, 255, 255, .03);

  --ink: rgba(255, 255, 255, .92);
  --ink-text: #0b0c14;
  --accent: #ffffff;

  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;
  --reserved: #a78bfa;

  --blob-1: rgba(124, 58, 237, .55);
  --blob-2: rgba(37, 99, 235, .50);
  --blob-3: rgba(219, 39, 119, .38);
  --blob-4: rgba(13, 148, 136, .42);
  --blob-5: rgba(234, 88, 12, .30);
}

/* =================================================================== base */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; padding: 0; color: var(--text); }
body { background: transparent; }
body {
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- the living backdrop behind the glass ---------- */
body::before, .page::before {
  content: ""; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(28% 24% at 18% 16%, var(--blob-1), transparent 70%),
    radial-gradient(30% 26% at 86% 22%, var(--blob-2), transparent 70%),
    radial-gradient(26% 22% at 72% 70%, var(--blob-3), transparent 70%),
    radial-gradient(30% 26% at 22% 80%, var(--blob-4), transparent 70%),
    radial-gradient(22% 20% at 52% 46%, var(--blob-5), transparent 70%);
  animation: drift 28s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(4%, -3%, 0) rotate(8deg) scale(1.06); }
  100% { transform: translate3d(-4%, 3%, 0) rotate(-6deg) scale(1.02); }
}
@media (prefers-reduced-motion: reduce) { body::before, .page::before { animation: none; } }

/* ---------- the glass material ---------- */
.tabbar, .fab, .footer, .icon-btn, .segmented, .chip, .card, .list, .props, .desc, .profile-head, .stat,
.notice, .option, .rules, .preview-post, .receipt-drop, .add-photo, .btn, .toast, .paycard, .status {
  position: relative; isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur-soft); backdrop-filter: var(--blur-soft);
  box-shadow: var(--glass-shadow), var(--glass-inset);
}
.tabbar, .fab, .footer, .icon-btn, .toast { -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.tabbar, .fab, .footer, .toast { position: fixed; }

/* specular highlight */
.tabbar::before, .fab::before, .footer::before, .icon-btn::before, .segmented::before, .chip::before, .card::before, .list::before,
.props::before, .desc::before, .profile-head::before, .stat::before, .notice::before, .option::before, .rules::before,
.preview-post::before, .receipt-drop::before, .add-photo::before, .btn::before, .toast::before, .paycard::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: var(--glass-shine);
}
/* light-catching rim: a gradient border drawn with a mask */
.tabbar::after, .fab::after, .footer::after, .icon-btn::after, .segmented::after, .chip::after, .card::after, .list::after,
.props::after, .desc::after, .profile-head::after, .stat::after, .notice::after, .option::after, .rules::after,
.preview-post::after, .add-photo::after, .btn::after, .toast::after, .paycard::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none; padding: 1px;
  background: linear-gradient(140deg, var(--glass-rim-a) 0%, var(--glass-rim-b) 35%, var(--glass-rim-b) 65%, var(--glass-rim-a) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}

.boot { min-height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--glass-strong); border-top-color: var(--text); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =================================================================== layout */

.screen { padding: 14px 16px calc(116px + env(safe-area-inset-bottom)); max-width: 720px; margin: 0 auto; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 6px 2px 14px; }
.brand { font-weight: 800; font-size: 26px; letter-spacing: -.035em; flex: 1; }
.brand span { opacity: .45; }
.h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; margin: 6px 2px 14px; }
.h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 22px 2px 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.spacer { height: 12px; }

/* ---------- floating tab bar ---------- */
.tabbar {
  left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20;
  max-width: 520px; margin: 0 auto; padding: 6px; border-radius: 30px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 0 6px; border-radius: 24px; color: var(--muted); font-size: 11px; font-weight: 600; transition: color .25s, background .25s, transform .2s; }
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--text); background: var(--glass-strong); box-shadow: inset 0 1px 1px var(--glass-rim-a), 0 4px 14px rgba(20, 24, 60, .12); }
.tab:active { transform: scale(.94); }

.fab {
  right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 21;
  display: flex; align-items: center; gap: 6px; padding: 13px 20px; border-radius: 999px;
  background: var(--ink); color: var(--ink-text); font-weight: 700;
}
.fab svg { width: 20px; height: 20px; }
.fab:active, .btn:active, .chip:active, .icon-btn:active, .option:active { transform: scale(.97); }

/* =================================================================== controls */

.segmented { display: flex; border-radius: 20px; padding: 4px; gap: 4px; }
.segmented button { flex: 1; padding: 9px 10px; border-radius: 16px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: background .25s, color .25s; }
.segmented button.on { background: var(--glass-strong); color: var(--text); box-shadow: inset 0 1px 1px var(--glass-rim-a), 0 4px 12px rgba(20, 24, 60, .12); }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; white-space: nowrap; box-shadow: var(--glass-inset), 0 4px 12px rgba(20, 24, 60, .06); }
.chip.on { background: var(--ink); color: var(--ink-text); }
.chip .count { opacity: .55; font-size: 12px; margin-left: 4px; }

.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 15px 16px; border-radius: 20px; font-weight: 700; font-size: 16px;
  background: var(--ink); color: var(--ink-text); transition: transform .15s;
}
.btn.secondary { background: var(--glass-strong); color: var(--text); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn.ghost::before, .btn.ghost::after { display: none; }
.btn.danger { background: var(--glass); color: var(--danger); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn + .btn { margin-top: 8px; }

.field { display: block; margin-bottom: 16px; }
.field > .label { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 4px 7px; }
.input, .textarea, .select {
  width: 100%; padding: 13px 16px; border-radius: 18px; outline: none;
  background: var(--glass); border: 1px solid var(--glass-rim-a);
  -webkit-backdrop-filter: var(--blur-soft); backdrop-filter: var(--blur-soft);
  box-shadow: inset 0 2px 6px rgba(20, 24, 60, .06);
  appearance: none; -webkit-appearance: none;
}
:root[data-theme="dark"] .input, :root[data-theme="dark"] .textarea, :root[data-theme="dark"] .select { border-color: rgba(255, 255, 255, .14); }
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:focus, .textarea:focus { background: var(--glass-strong); }
.textarea { min-height: 100px; resize: vertical; }
.select option { color: #0e1020; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); z-index: 1; }
.search-box .input { padding-left: 42px; }

/* =================================================================== product grid */

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: block; width: 100%; text-align: left; padding: 6px; border-radius: 26px; transition: transform .15s; }
.card .ph { position: relative; aspect-ratio: 3 / 4; border-radius: 20px; overflow: hidden; background: var(--glass-strong); }
.card .ph img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 9px 8px 6px; }
.card .price { font-weight: 800; font-size: 16px; letter-spacing: -.01em; }
.card .title { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.badges { position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.badge, .num {
  font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 999px; letter-spacing: .03em; color: #fff;
  -webkit-backdrop-filter: blur(14px) saturate(180%); backdrop-filter: blur(14px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .35); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .4), 0 2px 8px rgba(0, 0, 0, .15);
}
.badge.top { background: rgba(14, 16, 32, .55); }
.badge.res { background: rgba(124, 77, 255, .6); }
.badge.sold { background: rgba(0, 0, 0, .55); }
.num { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, .28); }
.page-head .badge { color: var(--ink-text); background: var(--ink); }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty .big { font-size: 44px; margin-bottom: 8px; }
.more { margin: 16px 0; }

/* =================================================================== lists */

.list { border-radius: 26px; overflow: hidden; padding: 4px; }
.li, .menu-li { display: flex; gap: 12px; align-items: center; padding: 10px; width: 100%; text-align: left; border-radius: 22px; }
.li + .li, .menu-li + .menu-li { box-shadow: 0 -1px 0 var(--line); }
.li .thumb { width: 58px; height: 74px; border-radius: 16px; object-fit: cover; background: var(--glass-strong); flex: none; }
.li .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 13px; color: var(--muted); }
.li .chev, .chev { color: var(--muted); }
.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; color: var(--muted); box-shadow: inset 0 1px 1px var(--glass-rim-a); }
.status.ok { color: var(--success); background: color-mix(in srgb, var(--success) 16%, var(--glass)); }
.status.wait { color: var(--warning); background: color-mix(in srgb, var(--warning) 16%, var(--glass)); }
.status.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, var(--glass)); }
.status.res { color: var(--reserved); background: color-mix(in srgb, var(--reserved) 16%, var(--glass)); }

/* =================================================================== overlay pages */

.page { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow-y: auto; isolation: isolate; animation: rise .28s cubic-bezier(.2, .8, .2, 1); }
@keyframes rise { from { transform: translateY(18px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.page .inner { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(160px + env(safe-area-inset-bottom)); }
.page-head { display: flex; align-items: center; gap: 10px; padding: 4px 0 12px; }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.footer { left: 10px; right: 10px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 41; padding: 10px; border-radius: 30px; max-width: 700px; margin: 0 auto; }
.footer .btn { font-size: 15px; padding: 14px; }

.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 30px; scrollbar-width: none; box-shadow: var(--glass-shadow); background: var(--glass-strong); }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; scroll-snap-align: center; }
.dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 0; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--glass-strong); box-shadow: inset 0 0 0 1px var(--line); }
.dots i.on { background: var(--text); width: 18px; border-radius: 4px; transition: width .2s; }

.item-price { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 16px 2px 0; }
.item-title { font-size: 18px; font-weight: 600; margin: 2px 2px 10px; }
.props { border-radius: 26px; padding: 4px 18px; }
.prop { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; }
.prop + .prop { box-shadow: 0 -1px 0 var(--line); }
.prop .k { color: var(--muted); }
.prop .v { font-weight: 600; text-align: right; }
.desc { white-space: pre-wrap; border-radius: 24px; padding: 14px 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 2px 0; }
.tag { font-weight: 600; font-size: 14px; padding: 5px 11px; border-radius: 999px; background: var(--glass); box-shadow: inset 0 1px 1px var(--glass-rim-a); -webkit-backdrop-filter: var(--blur-soft); backdrop-filter: var(--blur-soft); }

.notice { border-radius: 22px; padding: 13px 16px; font-size: 14px; }
.notice.warn { background: color-mix(in srgb, var(--warning) 12%, var(--glass)); }
.notice.bad { background: color-mix(in srgb, var(--danger) 12%, var(--glass)); }
.notice b { font-weight: 700; }

.paycard { border-radius: 28px; padding: 20px; color: #fff; background: linear-gradient(135deg, rgba(20, 22, 40, .82), rgba(60, 50, 120, .62)); }
.paycard .n { font-size: 21px; font-weight: 700; letter-spacing: .07em; margin: 8px 0; font-variant-numeric: tabular-nums; }
.paycard .copy { margin-top: 10px; display: inline-flex; padding: 7px 14px; border-radius: 999px; color: #fff; font-weight: 600; font-size: 13px; background: rgba(255, 255, 255, .18); box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.total { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; padding: 14px 4px; }

/* =================================================================== sell form */

.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photo-slot { position: relative; aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--glass-strong); box-shadow: var(--glass-shadow); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .x { position: absolute; top: 5px; right: 5px; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 15px; line-height: 23px; text-align: center; background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .4); }
.photo-slot .busy { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0, 0, 0, .25); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.photo-slot .busy .spinner { width: 22px; height: 22px; border-width: 2px; border-color: rgba(255, 255, 255, .4); border-top-color: #fff; }
.photo-slot .first { position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--ink); color: var(--ink-text); }
.add-photo { aspect-ratio: 1; border-radius: 18px; display: grid; place-items: center; color: var(--muted); font-size: 12px; text-align: center; }
.add-photo svg { width: 24px; height: 24px; margin: 0 auto 2px; }
.option { display: flex; align-items: center; gap: 12px; padding: 15px 16px; border-radius: 24px; width: 100%; text-align: left; transition: transform .15s; }
.option + .option { margin-top: 10px; }
.option.on { background: var(--glass-strong); box-shadow: var(--glass-shadow), inset 0 0 0 2px var(--text); }
.option .radio { width: 22px; height: 22px; border-radius: 50%; flex: none; background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--muted); }
.option.on .radio { background: var(--text); box-shadow: inset 0 0 0 6px var(--glass-strong); }
.step-hint { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; margin: 0 4px; }

.preview-post { border-radius: 28px; overflow: hidden; padding: 6px; }
.preview-post .gallery { border-radius: 22px; box-shadow: none; }
.preview-post .txt { padding: 14px 14px 10px; white-space: pre-wrap; font-size: 14px; }

.receipt-drop { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px; border-radius: 24px; color: var(--muted); text-align: center; width: 100%; outline: 1.5px dashed var(--glass-rim-a); outline-offset: -8px; }
.receipt-drop svg { width: 32px; height: 32px; }
.receipt-drop.done { color: var(--success); outline-color: var(--success); outline-style: solid; }
.receipt-drop img { max-height: 160px; border-radius: 14px; }

/* =================================================================== profile */

.profile-head { display: flex; align-items: center; gap: 14px; border-radius: 28px; padding: 18px; }
.avatar { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 24px; overflow: hidden; flex: none; background: var(--glass-strong); box-shadow: inset 0 1px 2px var(--glass-rim-a), 0 6px 16px rgba(20, 24, 60, .14); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat { border-radius: 22px; padding: 14px 8px; text-align: center; }
.stat b { display: block; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }
.menu-li { padding: 12px; }
.menu-li .grow { min-width: 0; }
.menu-li .ico { width: 34px; height: 34px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex: none; background: var(--glass-strong); box-shadow: inset 0 1px 1px var(--glass-rim-a); }
.menu-li .val { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.menu-li .segmented { box-shadow: var(--glass-inset); }

.rules { white-space: pre-wrap; border-radius: 26px; padding: 16px 18px; font-size: 14px; }
.lang-pick { display: grid; gap: 10px; margin-top: 16px; }

.toast {
  left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 20px; font-weight: 600; font-size: 14px;
  background: var(--glass-strong);
}
.li + .li, .menu-li + .menu-li { box-shadow: none; border-top: 1px solid var(--line); border-radius: 0; }

/* =================================================================== store / resale switch in the bottom bar */
.tabbar { display: block; padding: 6px; }
.modes { position: relative; display: grid; grid-template-columns: 1fr 1fr; margin: 0 2px 6px; padding: 3px; border-radius: 18px;
  background: rgba(14, 16, 32, .06); box-shadow: inset 0 1px 2px rgba(14, 16, 32, .08); }
:root[data-theme="dark"] .modes { background: rgba(255, 255, 255, .06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .4); }
.modes button { position: relative; z-index: 1; padding: 7px 6px; border-radius: 15px; font-size: 13px; font-weight: 700; color: var(--muted); transition: color .3s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modes button.on { color: var(--ink-text); }
.mode-lens { position: absolute; z-index: 0; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 15px;
  background: var(--ink); box-shadow: 0 4px 14px rgba(14, 16, 32, .25), inset 0 1px 1px rgba(255, 255, 255, .25);
  transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; }
.tab { position: relative; }
.tab-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.screen { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.fab { bottom: calc(136px + env(safe-area-inset-bottom)); }
.toast { bottom: calc(140px + env(safe-area-inset-bottom)); }

/* =================================================================== store pieces */
s.old, .old { opacity: .5; font-weight: 500; font-size: .8em; margin-left: 4px; }
.chip[disabled] { opacity: .35; text-decoration: line-through; pointer-events: none; }
.chip.size { min-width: 52px; text-align: center; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--glass); box-shadow: var(--glass-inset);
  -webkit-backdrop-filter: var(--blur-soft); backdrop-filter: var(--blur-soft); }
.stepper button { width: 36px; height: 36px; border-radius: 50%; font-size: 20px; font-weight: 600; background: var(--glass-strong); box-shadow: inset 0 1px 1px var(--glass-rim-a); }
.stepper button[disabled] { opacity: .35; }
.stepper b { min-width: 28px; text-align: center; font-size: 16px; }
.stepper.small button { width: 28px; height: 28px; font-size: 16px; }
.stepper .qty-in { width: 44px; text-align: center; border: 0; background: transparent; font-weight: 700; font-size: 16px; outline: none; }
.x-btn { width: 32px; height: 32px; border-radius: 50%; flex: none; font-size: 18px; color: var(--muted); background: var(--glass-strong); box-shadow: inset 0 1px 1px var(--glass-rim-a); }
.size-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.size-row .input { flex: 1; min-width: 0; }
.li .thumb[data-act] { cursor: pointer; }
.stat[data-act] { cursor: pointer; }
.stat:active { transform: scale(.97); }
/* floating bars need denser glass so labels stay readable over busy content */
.tabbar, .footer { background: rgba(255, 255, 255, .66); -webkit-backdrop-filter: blur(28px) saturate(200%); backdrop-filter: blur(28px) saturate(200%); }
:root[data-theme="dark"] .tabbar, :root[data-theme="dark"] .footer { background: rgba(20, 22, 32, .84); }

/* each bot has its own app: no store/resale switch, a slimmer bottom bar */
.single .screen { padding-bottom: calc(116px + env(safe-area-inset-bottom)); }
.single .fab { bottom: calc(96px + env(safe-area-inset-bottom)); }
.single .toast { bottom: calc(100px + env(safe-area-inset-bottom)); }
.add-photo > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* order progress ("где мой заказ") */
.steps { border-radius: 24px; padding: 14px 16px; background: var(--glass); box-shadow: var(--glass-shadow), var(--glass-inset);
  -webkit-backdrop-filter: var(--blur-soft); backdrop-filter: var(--blur-soft); }
.step { display: flex; align-items: center; gap: 12px; padding: 7px 0; color: var(--muted); position: relative; }
.step i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; font-weight: 800;
  background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--line); flex: none; position: relative; z-index: 1; }
.step + .step::before { content: ""; position: absolute; left: 12px; top: -9px; width: 2px; height: 18px; background: var(--line); }
.step.done { color: var(--text); }
.step.done i { background: var(--success); color: #fff; box-shadow: none; }
.step.done + .step::before { background: var(--success); }
.step.now { color: var(--text); font-weight: 700; }
.step.now i { background: var(--ink); color: var(--ink-text); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 18%, transparent); }
.option b:last-child:empty { display: none; }

/* infinite feed */
.sentinel { display: grid; place-items: center; padding: 22px 0 8px; }
.sentinel .spinner { width: 24px; height: 24px; border-width: 2px; }
/* filter button on the main screen */
.filter-btn.on { background: var(--ink); color: var(--ink-text); }
.topbar .icon-btn + .icon-btn { margin-left: 2px; }
/* categories in the search tab */
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cat-tile { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px;
  border-radius: 22px; text-align: left; background: var(--glass); box-shadow: var(--glass-shadow), var(--glass-inset);
  -webkit-backdrop-filter: var(--blur-soft); backdrop-filter: var(--blur-soft); }
.cat-tile .ico { font-size: 30px; line-height: 1; }
.cat-tile b { font-size: 15px; }
.cat-tile:active { transform: scale(.97); }
/* five tabs fit on a phone */
.tabs { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
.tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* room for footers with two or three buttons */
.page .inner { padding-bottom: calc(260px + env(safe-area-inset-bottom)); }

/* consent at checkout */
.consent { display: flex; gap: 12px; align-items: flex-start; padding: 12px 4px; font-size: 14px; color: var(--muted); }
.consent .box { width: 24px; height: 24px; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 800; color: var(--ink-text);
  background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--muted); }
.consent.on .box { background: var(--ink); box-shadow: none; }
.link { color: var(--text); text-decoration: underline; font-weight: 600; font-size: inherit; padding: 0; }
/* accessibility: visible keyboard focus, a bit more contrast for secondary text */
:focus-visible { outline: 2.5px solid var(--reserved); outline-offset: 2px; border-radius: 12px; }
:root { --muted: rgba(14, 16, 32, .62); }
:root[data-theme="dark"] { --muted: rgba(243, 245, 251, .66); }
