/* ============================================================
   Sneaker shop mini app — design tokens
   ============================================================ */
:root {
  --bg: #f3f3f5;
  --surface: #ffffff;
  --surface-2: #ececef;
  --surface-3: #e2e2e7;
  --text: #0d0d0f;
  --text-2: #3b3b42;
  --muted: #8b8b94;
  --line: rgba(13, 13, 15, .08);
  --accent: #0d0d0f;
  --on-accent: #ffffff;
  --lime: #d7ff3d;
  --on-lime: #0d0d0f;
  --sale: #ff3d2e;
  --ok: #1fae5b;
  --shadow-1: 0 1px 2px rgba(13, 13, 15, .04), 0 4px 14px rgba(13, 13, 15, .05);
  --shadow-2: 0 10px 40px rgba(13, 13, 15, .14);
  --glass: rgba(255, 255, 255, .78);
  --scrim: rgba(10, 10, 12, .42);

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 28px;

  --font: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", var(--font);

  --safe-top: max(var(--tg-content-safe-area-inset-top, 0px), 0px);
  --safe-bottom: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --tabbar-h: 68px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}

:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #161618;
  --surface-2: #1f1f22;
  --surface-3: #2a2a2e;
  --text: #f4f4f5;
  --text-2: #c9c9cf;
  --muted: #8e8e96;
  --line: rgba(255, 255, 255, .08);
  --accent: #d7ff3d;
  --on-accent: #0b0b0c;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, .03) inset;
  --shadow-2: 0 14px 50px rgba(0, 0, 0, .6);
  --glass: rgba(24, 24, 27, .78);
  --scrim: rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
  min-height: 100vh;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
.no-scroll { overflow: hidden; }

/* ============================================================ layout */
.view {
  padding: calc(var(--safe-top) + 14px) 16px calc(var(--tabbar-h) + var(--safe-bottom) + 36px);
  max-width: 640px;
  margin: 0 auto;
  animation: fadeIn .35s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.logo {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.02em;
  display: flex; align-items: center; gap: 8px;
}
.logo-mark {
  width: 30px; height: 30px; border-radius: 10px;
  background: var(--lime); color: var(--on-lime);
  display: grid; place-items: center;
}
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--shadow-1);
  display: grid; place-items: center; position: relative;
  transition: transform .15s var(--ease);
}
.icon-btn:active { transform: scale(.92); }
.dot-badge {
  position: absolute; top: -2px; right: -2px; min-width: 19px; height: 19px; padding: 0 5px;
  border-radius: 10px; background: var(--lime); color: var(--on-lime);
  font-size: 11px; font-weight: 800; display: grid; place-items: center;
  border: 2px solid var(--bg);
}

.h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  line-height: 1.1;
  letter-spacing: -.03em;
  margin: 0;
}
.h2 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.link-btn { color: var(--muted); font-weight: 600; font-size: 14px; }

/* ============================================================ hero */
.hello { color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.search-pill {
  margin-top: 16px; width: 100%; height: 52px; border-radius: 16px;
  background: var(--surface); box-shadow: var(--shadow-1);
  display: flex; align-items: center; gap: 10px; padding: 0 16px;
  color: var(--muted); font-weight: 600; text-align: left;
}
.search-pill .kbd {
  margin-left: auto; width: 34px; height: 34px; border-radius: 11px;
  background: var(--accent); color: var(--on-accent); display: grid; place-items: center;
}

.promo {
  margin-top: 16px; position: relative; overflow: hidden;
  border-radius: var(--r-lg); padding: 20px 20px 22px;
  background: var(--lime); color: var(--on-lime);
  display: block; width: 100%; text-align: left;
  transition: transform .2s var(--ease);
}
.promo:active { transform: scale(.985); }
.promo-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: rgba(13, 13, 15, .9); color: var(--lime); padding: 6px 10px; border-radius: 99px;
}
.promo-title { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -.03em; margin: 12px 0 4px; line-height: 1.1; }
.promo-text { font-weight: 600; opacity: .75; font-size: 14px; }
.promo-cta { margin-top: 14px; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; }
.promo-art { position: absolute; right: -24px; bottom: -30px; width: 150px; height: 150px; opacity: .95; }
.promo-ring { position: absolute; border-radius: 50%; border: 2px solid rgba(13,13,15,.12); }

/* ============================================================ chips */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 18px -16px 0; padding: 0 16px 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 40px; padding: 0 16px; border-radius: 99px;
  background: var(--surface); color: var(--text-2); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; box-shadow: var(--shadow-1);
  transition: background .2s, color .2s, transform .15s;
  white-space: nowrap;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--accent); color: var(--on-accent); }
.chip .count { font-size: 12px; opacity: .55; font-weight: 700; }

.toolbar { display: flex; align-items: center; gap: 8px; margin: 16px 0 14px; }
.tool-btn {
  height: 40px; padding: 0 14px; border-radius: 12px; background: transparent;
  border: 1.5px solid var(--line); font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 7px;
}
.tool-btn .pill-n { background: var(--lime); color: var(--on-lime); border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 800; }
.toolbar .found { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; }

/* ============================================================ 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 {
  background: var(--surface); border-radius: var(--r-md); overflow: hidden;
  box-shadow: var(--shadow-1); cursor: pointer; position: relative;
  transition: transform .2s var(--ease);
  animation: cardIn .45s var(--ease) both;
}
.card:active { transform: scale(.97); }
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.card-media { position: relative; aspect-ratio: 1 / 1.04; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.card-media img.loading { opacity: 0; }
.badges { position: absolute; top: 10px; left: 10px; display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.badge {
  font-size: 11px; font-weight: 800; letter-spacing: .02em; padding: 4px 8px; border-radius: 8px;
  background: var(--surface); color: var(--text);
}
.badge.sale { background: var(--sale); color: #fff; }
.badge.new { background: var(--lime); color: var(--on-lime); }
.badge.hit { background: #0d0d0f; color: #fff; }
:root[data-theme="dark"] .badge.hit { background: #fff; color: #0d0d0f; }

.fav-btn {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: grid; place-items: center; color: var(--text);
  transition: transform .2s var(--ease), color .2s;
}
.fav-btn:active { transform: scale(.85); }
.fav-btn.on { color: var(--sale); }
.fav-btn.on svg path { fill: currentColor; }
.fav-btn.pop { animation: pop .4s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }

.card-body { padding: 11px 12px 13px; }
.card-brand { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card-title { font-weight: 700; font-size: 14.5px; margin-top: 3px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 36px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 6px; }
.price { font-weight: 800; font-size: 16px; letter-spacing: -.01em; white-space: nowrap; }
.price.sale { color: var(--sale); }
.old { color: var(--muted); text-decoration: line-through; font-size: 12.5px; font-weight: 600; margin-left: 6px; white-space: nowrap; }
.dots { display: flex; gap: 3px; align-items: center; }
.dots i { width: 11px; height: 11px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.dots span { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: 2px; }

/* skeleton */
.skel { background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============================================================ empty states */
.empty { text-align: center; padding: 48px 24px 24px; }
.empty-art {
  width: 120px; height: 120px; margin: 0 auto 18px; border-radius: 36px;
  background: var(--surface); box-shadow: var(--shadow-1); display: grid; place-items: center; color: var(--text);
  position: relative;
}
.empty-art::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--lime); top: 14px; right: 14px; }
.empty h3 { font-size: 20px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.02em; }
.empty p { color: var(--muted); margin: 0 auto 20px; max-width: 280px; }

/* ============================================================ buttons */
.btn {
  height: 56px; border-radius: 18px; padding: 0 22px; width: 100%;
  background: var(--accent); color: var(--on-accent); font-weight: 800; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform .15s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.lime { background: var(--lime); color: var(--on-lime); }
.btn.ghost { background: var(--surface-2); color: var(--text); }
.btn.small { height: 46px; border-radius: 14px; font-size: 15px; width: auto; }
.btn .spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ tabbar */
.tabbar {
  position: fixed; z-index: 30; left: 12px; right: 12px;
  bottom: calc(var(--safe-bottom) + 10px);
  max-width: 520px; margin: 0 auto;
  height: var(--tabbar-h); border-radius: 24px; padding: 6px;
  background: var(--glass); backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
  box-shadow: var(--shadow-2), inset 0 0 0 1px var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px;
  transition: transform .35s var(--ease), opacity .3s;
}
.tabbar.hidden { transform: translateY(140%); opacity: 0; pointer-events: none; }
.tab {
  border-radius: 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10.5px; font-weight: 700; position: relative;
  transition: background .25s var(--ease), color .25s;
}
.tab.on { background: var(--lime); color: var(--on-lime); }
.tab .dot-badge { top: 4px; right: calc(50% - 22px); border-color: var(--surface); }
.tab.on .dot-badge { background: var(--on-lime); color: var(--lime); border-color: var(--lime); }
.tab .dot-badge.bump { animation: pop .45s var(--ease); }

/* ============================================================ pages (stacked screens) */
.page {
  position: fixed; inset: 0; z-index: 40; background: var(--bg);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  animation: pageIn .38s var(--ease) both;
}
.page.leaving { animation: pageOut .28s var(--ease) both; }
@keyframes pageIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes pageOut { from { transform: none; } to { transform: translateX(100%); } }
.page-inner { padding: calc(var(--safe-top) + 12px) 16px calc(var(--safe-bottom) + 120px); max-width: 640px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.page-head .h1 { font-size: 24px; }
.back-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-1); display: grid; place-items: center; flex-shrink: 0; }
.back-btn:active { transform: scale(.92); }

.bottom-bar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  padding: 12px 16px calc(var(--safe-bottom) + 12px);
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}
.bottom-bar.entering { animation: pageIn .38s var(--ease) both; }
.bottom-bar.leaving { animation: pageOut .28s var(--ease) both; }
.bottom-bar-inner { max-width: 608px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }

/* ============================================================ product page */
.pd-gallery { position: relative; background: var(--surface-2); }
.pd-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1 / 1; }
.pd-track::-webkit-scrollbar { display: none; }
.pd-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.pd-dots { position: absolute; bottom: 38px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.pd-dots i { width: 6px; height: 6px; border-radius: 99px; background: rgba(13,13,15,.25); transition: width .3s var(--ease), background .3s; }
.pd-dots i.on { width: 20px; background: #0d0d0f; }
.pd-float { position: absolute; top: calc(var(--safe-top) + 12px); left: 16px; right: 16px; display: flex; justify-content: space-between; }
.pd-float .icon-btn { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.pd-float .icon-btn.on { color: var(--sale); }
.pd-float .icon-btn.on svg path { fill: currentColor; }

.pd-body {
  position: relative; margin-top: -24px; background: var(--bg);
  border-radius: 28px 28px 0 0; padding: 22px 16px calc(var(--safe-bottom) + 120px);
  max-width: 640px; margin-left: auto; margin-right: auto;
}
.pd-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.pd-meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.pd-title { font-family: var(--font-display); font-weight: 600; font-size: 26px; line-height: 1.12; letter-spacing: -.03em; margin: 8px 0 12px; }
.pd-price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-price .price { font-size: 24px; }
.pd-price .old { font-size: 16px; margin: 0; }
.save-pill { background: rgba(255, 61, 46, .12); color: var(--sale); font-weight: 800; font-size: 13px; padding: 4px 9px; border-radius: 99px; }

.block { margin-top: 24px; }
.block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.block-title { font-weight: 800; font-size: 15px; }
.block-title span { color: var(--muted); font-weight: 600; }

.swatches { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.swatches::-webkit-scrollbar { display: none; }
.swatch {
  flex-shrink: 0; width: 68px; height: 68px; border-radius: 18px; overflow: hidden; background: var(--surface-2);
  box-shadow: 0 0 0 1.5px var(--line); position: relative; transition: box-shadow .2s, transform .15s;
}
.swatch img { width: 100%; height: 100%; object-fit: cover; }
.swatch.on { box-shadow: 0 0 0 2.5px var(--text); }
.swatch:active { transform: scale(.94); }
.swatch i { position: absolute; bottom: 5px; right: 5px; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--surface); }

.sizes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.size {
  height: 50px; border-radius: 14px; background: var(--surface); font-weight: 800; font-size: 15px;
  box-shadow: inset 0 0 0 1.5px var(--line); transition: background .2s, color .2s, transform .15s;
  position: relative;
}
.size:active { transform: scale(.94); }
.size.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.size.off { color: var(--muted); background: transparent; cursor: not-allowed; overflow: hidden; }
.size.off::after { content: ""; position: absolute; left: 10%; right: 10%; top: 50%; height: 1.5px; background: var(--muted); transform: rotate(-24deg); opacity: .6; }
.sizes.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; display: flex; gap: 6px; align-items: center; }

.desc { color: var(--text-2); line-height: 1.6; white-space: pre-line; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.perks { display: grid; gap: 8px; }
.perk { display: flex; gap: 12px; align-items: center; background: var(--surface); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow-1); }
.perk-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.perk b { display: block; font-size: 14px; }
.perk span { color: var(--muted); font-size: 13px; }

.add-bar .price-col { flex-shrink: 0; padding-right: 4px; }
.add-bar .price-col small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.add-bar .price-col b { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }

/* ============================================================ cart */
.cart-list { display: grid; gap: 10px; }
.cart-item {
  display: grid; grid-template-columns: 92px 1fr; gap: 12px; background: var(--surface);
  border-radius: var(--r-md); padding: 10px; box-shadow: var(--shadow-1);
  animation: cardIn .35s var(--ease) both;
}
.cart-item.removing { animation: removeOut .3s var(--ease) both; }
@keyframes removeOut { to { opacity: 0; transform: translateX(-30px); } }
.cart-item .thumb { width: 92px; height: 92px; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.cart-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.ci-top { display: flex; justify-content: space-between; gap: 8px; }
.ci-title { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.ci-opts { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 3px; }
.ci-remove { color: var(--muted); width: 30px; height: 30px; margin: -4px -4px 0 0; display: grid; place-items: center; border-radius: 50%; }
.ci-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.ci-unavailable { color: var(--sale); font-size: 13px; font-weight: 700; margin-top: 6px; }
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 12px; height: 36px; }
.stepper button { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; }
.stepper button:active { background: var(--surface-3); }
.stepper button[disabled] { opacity: .3; }
.stepper span { min-width: 22px; text-align: center; font-weight: 800; font-size: 14px; }

.summary { background: var(--surface); border-radius: var(--r-md); padding: 16px; margin-top: 14px; box-shadow: var(--shadow-1); }
.sum-row { display: flex; justify-content: space-between; color: var(--text-2); font-weight: 600; padding: 4px 0; font-size: 14.5px; }
.sum-row.discount span:last-child { color: var(--sale); }
.sum-row.total { color: var(--text); font-weight: 800; font-size: 18px; border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 12px; }
.sum-note { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

.view.has-cta { padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 110px); }
.float-cta {
  position: fixed; z-index: 29; left: 16px; right: 16px;
  bottom: calc(var(--safe-bottom) + var(--tabbar-h) + 20px);
  max-width: 608px; margin: 0 auto;
}
.float-cta .btn { box-shadow: 0 10px 30px rgba(13, 13, 15, .25); }

/* ============================================================ forms */
.card-section { background: var(--surface); border-radius: var(--r-md); padding: 16px; box-shadow: var(--shadow-1); margin-bottom: 12px; }
.card-section h3 { margin: 0 0 14px; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.card-section h3 .num { width: 24px; height: 24px; border-radius: 8px; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; font-size: 12px; }
.field { display: block; margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 6px 4px; }
.input {
  width: 100%; height: 52px; border-radius: 14px; border: 1.5px solid transparent; background: var(--surface-2);
  padding: 0 14px; font-weight: 600; font-size: 16px; outline: none; transition: border-color .2s, background .2s;
}
textarea.input { height: 88px; padding: 14px; resize: none; line-height: 1.4; }
.input:focus { border-color: var(--text); background: var(--surface); }
.input.err { border-color: var(--sale); }
.input::placeholder { color: var(--muted); font-weight: 500; }
.err-text { color: var(--sale); font-size: 12.5px; font-weight: 600; margin: 6px 0 0 4px; }

.options { display: grid; gap: 8px; }
.option {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: 16px;
  background: var(--surface-2); text-align: left; width: 100%;
  box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .2s, background .2s;
}
.option.on { box-shadow: inset 0 0 0 2px var(--text); background: var(--surface); }
.option .radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--muted); flex-shrink: 0; transition: box-shadow .2s; }
.option.on .radio { box-shadow: inset 0 0 0 7px var(--text); }
.option b { display: block; font-size: 15px; }
.option span { color: var(--muted); font-size: 13px; font-weight: 600; }

.check { display: flex; align-items: center; gap: 12px; padding: 4px 2px; font-weight: 600; font-size: 14.5px; cursor: pointer; }
.check input { display: none; }
.check .box { width: 24px; height: 24px; border-radius: 8px; box-shadow: inset 0 0 0 2px var(--muted); display: grid; place-items: center; color: transparent; transition: background .2s, box-shadow .2s; flex-shrink: 0; }
.check input:checked + .box { background: var(--accent); box-shadow: none; color: var(--on-accent); }

.mini-items { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.mini-items img { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; background: var(--surface-2); flex-shrink: 0; }

/* ============================================================ success */
.success { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 24px calc(var(--safe-bottom) + 24px); max-width: 480px; margin: 0 auto; }
.success-badge { width: 112px; height: 112px; border-radius: 38px; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; animation: popIn .6s var(--ease) both; position: relative; }
.success-badge::before, .success-badge::after { content: ""; position: absolute; inset: -14px; border-radius: 48px; border: 2px solid var(--lime); opacity: 0; animation: ring 1.6s var(--ease) .3s infinite; }
.success-badge::after { animation-delay: .9s; }
@keyframes ring { 0% { opacity: .7; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes popIn { 0% { transform: scale(.4) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.08) rotate(3deg); opacity: 1; } 100% { transform: none; } }
.success-badge svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .5s .35s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.success h1 { font-family: var(--font-display); font-size: 26px; letter-spacing: -.03em; margin: 28px 0 8px; font-weight: 600; }
.success .order-no { display: inline-block; background: var(--surface); padding: 6px 12px; border-radius: 99px; font-weight: 800; box-shadow: var(--shadow-1); }
.success p { color: var(--muted); margin: 14px 0 28px; line-height: 1.5; }
.success .actions { width: 100%; display: grid; gap: 10px; }

/* ============================================================ profile / lists */
.profile-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.profile-card::after { content: ""; position: absolute; right: -56px; top: -56px; width: 128px; height: 128px; border-radius: 50%; background: var(--lime); }
.profile-card .who { padding-right: 56px; min-width: 0; }
.avatar { width: 60px; height: 60px; border-radius: 20px; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 800; font-size: 22px; overflow: hidden; flex-shrink: 0; position: relative; z-index: 1; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-card .who { position: relative; z-index: 1; }
.profile-card .who b { font-size: 19px; font-weight: 800; letter-spacing: -.02em; display: block; }
.profile-card .who span { color: var(--muted); font-weight: 600; font-size: 14px; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.stat { background: var(--surface); border-radius: var(--r-md); padding: 14px 16px; box-shadow: var(--shadow-1); text-align: left; }
.stat b { font-family: var(--font-display); font-size: 24px; font-weight: 600; display: block; letter-spacing: -.03em; }
.stat span { color: var(--muted); font-weight: 600; font-size: 13px; }

.group-title { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 26px 4px 10px; }
.list { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-1); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 14px 14px; width: 100%; text-align: left; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: 1px; background: var(--line); }
.row:active { background: var(--surface-2); }
.row-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-weight: 700; font-size: 15px; }
.row-main span { display: block; color: var(--muted); font-size: 13px; font-weight: 500; margin-top: 1px; }
.row-end { color: var(--muted); display: flex; align-items: center; gap: 6px; font-weight: 700; }
.row-end .n { color: var(--text); }

.switch { width: 50px; height: 30px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .25s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch.on { background: var(--ok); }
.switch.on::after { transform: translateX(20px); }

.order-card { background: var(--surface); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-1); display: block; width: 100%; text-align: left; margin-bottom: 10px; }
.order-top { display: flex; justify-content: space-between; align-items: center; }
.order-top b { font-size: 16px; font-weight: 800; }
.order-date { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 2px; }
.status { font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 99px; background: var(--surface-2); }
.status.new { background: rgba(255, 184, 0, .16); color: #b07d00; }
.status.work { background: rgba(42, 85, 201, .13); color: #2a55c9; }
.status.shipped { background: rgba(123, 79, 214, .14); color: #7b4fd6; }
.status.done { background: rgba(31, 174, 91, .14); color: #138a45; }
.status.canceled { color: var(--muted); }
:root[data-theme="dark"] .status.new { color: #ffc93d; }
:root[data-theme="dark"] .status.work { color: #8aa9ff; }
:root[data-theme="dark"] .status.shipped { color: #b99bff; }
:root[data-theme="dark"] .status.done { color: #4fd98a; }
.order-thumbs { display: flex; gap: 6px; margin: 12px 0; }
.order-thumbs img { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--surface-2); }
.order-thumbs .more { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--muted); }
.order-sum { display: flex; justify-content: space-between; font-weight: 700; }

.timeline { display: grid; gap: 0; margin-top: 4px; }
.tl { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-bottom: 16px; }
.tl:last-child { padding-bottom: 0; }
.tl::before { content: ""; position: absolute; left: 11px; top: 24px; bottom: 0; width: 2px; background: var(--line); }
.tl:last-child::before { display: none; }
.tl i { width: 24px; height: 24px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; flex-shrink: 0; color: var(--muted); }
.tl.done i { background: var(--lime); color: var(--on-lime); }
.tl b { font-size: 14.5px; }
.tl.todo b { color: var(--muted); font-weight: 600; }

.doc-text { background: var(--surface); border-radius: var(--r-md); padding: 18px; box-shadow: var(--shadow-1); line-height: 1.65; color: var(--text-2); white-space: pre-line; }

/* ============================================================ search */
.search-field { position: relative; margin-top: 16px; }
.search-field .input { height: 54px; padding-left: 46px; padding-right: 44px; background: var(--surface); box-shadow: var(--shadow-1); border-radius: 16px; }
.search-field .ic { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-field .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.brand-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.brand-tile { background: var(--surface); border-radius: var(--r-md); padding: 16px; text-align: left; box-shadow: var(--shadow-1); position: relative; overflow: hidden; min-height: 84px; }
.brand-tile b { font-family: var(--font-display); font-weight: 600; font-size: 16px; letter-spacing: -.02em; display: block; }
.brand-tile span { color: var(--muted); font-size: 13px; font-weight: 600; }
.brand-tile .big { position: absolute; right: -6px; bottom: -14px; font-family: var(--font-display); font-weight: 700; font-size: 54px; opacity: .06; letter-spacing: -.05em; }

/* ============================================================ sheets */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); animation: fade .25s both; }
.scrim.leaving { animation: fadeOut .25s both; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }
.sheet {
  position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; max-height: 88vh;
  background: var(--bg); border-radius: 28px 28px 0 0; display: flex; flex-direction: column;
  max-width: 640px; margin: 0 auto;
  animation: sheetIn .38s var(--ease) both; box-shadow: var(--shadow-2);
}
.sheet.leaving { animation: sheetOut .26s var(--ease) both; }
@keyframes sheetIn { from { transform: translateY(100%); } }
@keyframes sheetOut { to { transform: translateY(100%); } }
.sheet-grab { width: 40px; height: 5px; border-radius: 99px; background: var(--surface-3); margin: 10px auto 0; flex-shrink: 0; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 6px; }
.sheet-head h2 { font-size: 20px; font-weight: 800; margin: 0; letter-spacing: -.02em; }
.sheet-close { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; }
.sheet-body { overflow-y: auto; padding: 8px 16px 16px; overscroll-behavior: contain; }
.sheet-foot { padding: 12px 16px calc(var(--safe-bottom) + 14px); display: flex; gap: 10px; border-top: 1px solid var(--line); }
.sheet-foot .btn { height: 52px; }
.sheet-foot .btn.ghost { width: auto; flex: 0 0 auto; }
.f-group { margin-top: 18px; }
.f-group:first-child { margin-top: 6px; }
.f-label { font-weight: 800; font-size: 14px; margin-bottom: 10px; }
.wrap-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wrap-chips .chip { box-shadow: inset 0 0 0 1.5px var(--line); background: var(--surface); }
.wrap-chips .chip.on { box-shadow: none; background: var(--accent); color: var(--on-accent); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border-radius: 14px; padding: 4px; }
.seg button { height: 40px; border-radius: 11px; font-weight: 700; font-size: 14px; color: var(--text-2); transition: background .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.range .input { height: 48px; }
.sort-list .option { background: transparent; padding: 14px 4px; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--line); }
.sort-list .option:last-child { border-bottom: 0; }
.sort-list .option.on { background: transparent; box-shadow: none; }

.size-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.size-table th { text-align: left; color: var(--muted); font-weight: 700; font-size: 12px; padding: 8px 6px; }
.size-table td { padding: 10px 6px; border-top: 1px solid var(--line); font-weight: 600; }
.size-table td:first-child { font-weight: 800; }

/* ============================================================ toast */
.toast {
  position: fixed; z-index: 80; left: 50%; top: calc(var(--safe-top) + 14px); transform: translate(-50%, -150%);
  background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 16px; font-weight: 700; font-size: 14px;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-2); max-width: calc(100% - 32px);
  transition: transform .35s var(--ease); pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); }
.toast .t-ic { width: 22px; height: 22px; border-radius: 50%; background: var(--lime); color: var(--on-lime); display: grid; place-items: center; flex-shrink: 0; }
.toast.error .t-ic { background: var(--sale); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
