/* =========================================================
   KEYSHOP — core design system
   Общие токены, компоненты, шапка, подвал, карточка товара,
   корзина-дровер, тосты. Страничные стили — в отдельных файлах.
   ========================================================= */

:root {
  --bg: #f4f4f1;
  --bg-elev: #ffffff;
  --bg-sunk: #ebebe6;
  --ink: #0c0c0e;
  --ink-2: #3a3a40;
  --muted: #7a7a82;
  --line: rgba(12, 12, 14, 0.08);
  --line-strong: rgba(12, 12, 14, 0.16);
  --accent: #c8f53b;          /* лайм */
  --accent-ink: #0c0c0e;      /* текст на акценте */
  --accent-deep: #9fd11a;
  --violet: #6e56ff;
  --ok: #17b26a;
  --warn: #f5a524;
  --danger: #ef4444;
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --shadow-sm: 0 1px 2px rgba(12, 12, 14, .06), 0 2px 8px rgba(12, 12, 14, .04);
  --shadow: 0 10px 30px -12px rgba(12, 12, 14, .18);
  --shadow-lg: 0 30px 80px -24px rgba(12, 12, 14, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --header-h: 72px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --bg-elev: #151517;
  --bg-sunk: #1c1c1f;
  --ink: #f4f4f1;
  --ink-2: #c9c9cf;
  --muted: #8b8b94;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 80px -24px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- layout ---------- */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 880px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }

.section { padding: 88px 0; }
.section--tight { padding: 56px 0; }
@media (max-width: 760px) { .section { padding: 56px 0; } .section--tight { padding: 40px 0; } }

.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }

.h-display { font-size: clamp(42px, 7vw, 92px); line-height: .98; letter-spacing: -.045em; font-weight: 700; }
.h1 { font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -.035em; font-weight: 700; }
.h2 { font-size: clamp(28px, 3.4vw, 44px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; }
.h3 { font-size: 22px; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; }
.lead { font-size: clamp(17px, 1.4vw, 20px); color: var(--ink-2); line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.tiny { font-size: 12px; }
.mark { background: var(--accent); color: var(--accent-ink); padding: 0 .18em; border-radius: .18em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* ---------- buttons ---------- */
.btn {
  --h: 48px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: var(--h); padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; white-space: nowrap; letter-spacing: -.005em;
  transition: transform .15s var(--ease), background .2s, color .2s, box-shadow .2s, border-color .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn--sm { --h: 38px; padding: 0 16px; font-size: 14px; }
.btn--lg { --h: 58px; padding: 0 30px; font-size: 17px; }
.btn--block { width: 100%; }
.btn--ink { background: var(--ink); color: var(--bg); }
.btn--ink:hover { box-shadow: 0 10px 24px -10px var(--ink); }
.btn--accent { background: var(--accent); color: var(--accent-ink); }
.btn--accent:hover { background: var(--accent-deep); }
.btn--ghost { background: var(--bg-elev); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--line-strong); }
.btn--outline { border: 1.5px solid var(--line-strong); }
.btn--outline:hover { border-color: var(--ink); }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 999px; flex: none;
  display: grid; place-items: center; transition: background .2s;
}
.icon-btn:hover { background: var(--bg-sunk); }
.icon-btn svg { width: 21px; height: 21px; }

/* ---------- chips / badges / inputs ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--line); font-size: 14px; font-weight: 550; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s;
}
.chip:hover { border-color: var(--line-strong); }
.chip.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .count { font-size: 12px; opacity: .55; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 650; white-space: nowrap; }
.badge--hit { background: var(--accent); color: var(--accent-ink); }
.badge--new { background: var(--violet); color: #fff; }
.badge--sale { background: #ff4d4d; color: #fff; }
.badge--soft { background: var(--bg-sunk); color: var(--ink-2); }
.badge--glass { background: rgba(255,255,255,.18); color: #fff; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.22); }

.field { display: grid; gap: 8px; }
.field > label, .label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.input, .select, .textarea {
  width: 100%; height: 52px; padding: 0 18px; border-radius: 14px;
  background: var(--bg-elev); border: 1.5px solid var(--line); outline: 0;
  transition: border-color .2s, box-shadow .2s; font-size: 16px;
}
.textarea { height: auto; min-height: 110px; padding: 14px 18px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.input::placeholder { color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }

.card-surface { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 60; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(18px); -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 14px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; font-size: 21px; letter-spacing: -.04em; flex: none; }
.logo__mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--ink); color: var(--accent);
  display: grid; place-items: center; transform: rotate(-6deg); transition: transform .3s var(--ease);
}
.logo:hover .logo__mark { transform: rotate(0); }
.logo__mark svg { width: 20px; height: 20px; }

.catalog-btn { margin-left: 10px; }
.catalog-btn .burger-ico { width: 18px; height: 18px; }

.header-search { flex: 1; max-width: 520px; position: relative; }
.header-search input {
  width: 100%; height: 46px; padding: 0 18px 0 46px; border-radius: 999px; border: 1.5px solid var(--line);
  background: var(--bg-elev); outline: 0; font-size: 15px; transition: border-color .2s, box-shadow .2s;
}
.header-search input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); }
.header-search > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 19px; height: 19px; color: var(--muted); pointer-events: none; }
.search-pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; padding: 8px; border-radius: 20px;
  background: var(--bg-elev); border: 1px solid var(--line); box-shadow: var(--shadow-lg); max-height: 420px; overflow: auto;
}
.search-pop a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; }
.search-pop a:hover, .search-pop a.is-focus { background: var(--bg-sunk); }
.search-pop .mini-vis { width: 46px; height: 32px; border-radius: 8px; font-size: 13px; }
.search-pop b { font-weight: 600; font-size: 15px; display: block; }
.search-pop span { font-size: 13px; color: var(--muted); }
.search-pop .price { margin-left: auto; font-weight: 650; font-size: 14px; white-space: nowrap; }
.search-pop .empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; }

.header-nav { display: flex; gap: 4px; margin-left: auto; }
.header-nav a { padding: 10px 14px; border-radius: 999px; font-size: 15px; font-weight: 550; color: var(--ink-2); transition: background .2s, color .2s; }
.header-nav a:hover, .header-nav a.is-active { background: var(--bg-sunk); color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 2px; }
.cart-count {
  position: absolute; top: 2px; right: 0; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 99px;
  background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 750; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.cart-count.bump { animation: bump .4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.4); } }
.only-mobile { display: none !important; }

/* mega menu */
.mega {
  position: absolute; left: 0; right: 0; top: var(--header-h); z-index: 59;
  background: var(--bg-elev); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .2s, transform .25s var(--ease);
}
.mega.is-open { opacity: 1; transform: none; pointer-events: auto; }
.mega__inner { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; padding: 24px 24px 28px; }
.mega__col { padding: 18px; border-radius: 20px; transition: background .2s; }
.mega__col:hover { background: var(--bg-sunk); }
.mega__col > a:first-child { display: flex; align-items: center; gap: 10px; font-weight: 650; margin-bottom: 12px; }
.mega__col > a:first-child .cat-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ink); color: var(--accent); }
.mega__col > a:first-child .cat-ico svg { width: 18px; height: 18px; }
.mega__col ul { list-style: none; display: grid; gap: 4px; }
.mega__col li a { font-size: 14px; color: var(--muted); }
.mega__col li a:hover { color: var(--ink); }

/* mobile nav */
.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 58; background: var(--bg);
  padding: 20px 16px 40px; overflow: auto; transform: translateX(100%); transition: transform .35s var(--ease);
}
.mobile-nav.is-open { transform: none; }
.mobile-nav a { display: flex; align-items: center; justify-content: space-between; padding: 16px 4px; font-size: 20px; font-weight: 600; border-bottom: 1px solid var(--line); }

@media (max-width: 1080px) {
  .header-nav { display: none; }
  .header-search { margin-left: auto; }
}
@media (max-width: 760px) {
  :root { --header-h: 64px; }
  .catalog-btn, .header-search, .hide-mobile { display: none !important; }
  .only-mobile { display: grid !important; }
  .header-actions { margin-left: auto; }
  .mega__inner { grid-template-columns: 1fr; }
}

/* ---------- product visual (gift-card look) ---------- */
.vis {
  --c1: #333; --c2: #111; --fg: #fff;
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 1.586; border-radius: 18px; color: var(--fg);
  background: linear-gradient(135deg, var(--c1), var(--c2));
  display: flex; flex-direction: column; justify-content: space-between; padding: 7% 8%;
}
.vis::before {  /* сетка-паттерн */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .16;
  background-image: radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0);
  background-size: 14px 14px;
  mask-image: linear-gradient(120deg, transparent 30%, #000 100%);
  -webkit-mask-image: linear-gradient(120deg, transparent 30%, #000 100%);
}
.vis::after {  /* блик */
  content: ""; position: absolute; z-index: -1; width: 120%; height: 120%; right: -60%; top: -70%; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.35), transparent);
  transition: transform .6s var(--ease);
}
.vis__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.vis__brand { font-weight: 700; font-size: clamp(12px, 1.1vw, 15px); letter-spacing: -.01em; opacity: .95; }
.vis__glyph {
  position: absolute; right: 7%; bottom: 8%; z-index: -1;
  font-weight: 800; font-size: clamp(44px, 5vw, 78px); line-height: .8; letter-spacing: -.06em; opacity: .95;
}
.vis__glyph svg { width: 1em; height: 1em; }
.vis__label { font-size: clamp(11px, .95vw, 13px); font-weight: 600; opacity: .8; }
.vis__value { font-size: clamp(18px, 1.8vw, 26px); font-weight: 750; letter-spacing: -.03em; line-height: 1.05; }
.vis--chip .vis__top::after { /* «чип» карты */
  content: ""; width: 28px; height: 20px; border-radius: 5px; opacity: .85;
  background: linear-gradient(135deg, #f4e3a1, #c9a74a); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}
.mini-vis {
  flex: none; display: grid; place-items: center; color: #fff; font-weight: 750; letter-spacing: -.04em;
  background: linear-gradient(135deg, var(--c1), var(--c2));
}

/* ---------- product card ---------- */
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
@media (max-width: 560px) { .p-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.pc {
  position: relative; display: flex; flex-direction: column; gap: 14px; padding: 10px 10px 16px;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 24px;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.pc:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.pc:hover .vis::after { transform: translate(-20%, 20%); }
.pc__body { padding: 0 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.pc__meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pc__meta > span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pc { min-width: 0; }
.pc__meta .auto { color: var(--ok); font-weight: 600; }
.pc__title { font-size: 17px; font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.pc { cursor: pointer; }
.pc__title button { font: inherit; text-align: left; letter-spacing: inherit; }
.pc__title button::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.pc__title button:focus-visible { outline: none; }
.pc:has(.pc__title button:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.pc__buy {
  height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 650; transition: background .2s, color .2s;
}
.pc:hover .pc__buy { background: var(--accent); color: var(--accent-ink); }
.pc__desc { font-size: 14px; color: var(--muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 8px 0; margin-top: auto; }
.pc__price { font-size: 19px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; }
.pc__price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.pc__price s { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 4px; }
.pc__add {
  position: relative; z-index: 2; width: 42px; height: 42px; border-radius: 999px; flex: none;
  display: grid; place-items: center; background: var(--bg-sunk); transition: background .2s, color .2s, transform .2s;
}
.pc__add:hover { background: var(--accent); color: var(--accent-ink); transform: rotate(90deg); }
.pc__add svg { width: 18px; height: 18px; }
@media (max-width: 560px) {
  .pc { padding: 6px 6px 12px; border-radius: 18px; gap: 10px; }
  .pc__body { padding: 0 4px; }
  .pc__foot { padding: 4px 4px 0; }
  .pc__title { font-size: 15px; }
  .pc__desc { display: none; }
  .pc__price { font-size: 16px; }
  .pc__add { width: 36px; height: 36px; }
  .pc__foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .pc__buy { justify-content: center; height: 36px; }
  .vis { border-radius: 13px; }
}

/* ---------- rating ---------- */
.stars { display: inline-flex; gap: 1px; color: #f5b301; }
.stars svg { width: 14px; height: 14px; }

/* ---------- footer ---------- */
.site-footer { margin-top: 80px; background: var(--ink); color: var(--bg); border-radius: 32px 32px 0 0; }
:root[data-theme="dark"] .site-footer { background: #151517; color: var(--ink); }
.site-footer__top { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 40px; padding: 64px 0 48px; }
.site-footer .logo__mark { background: var(--accent); color: var(--accent-ink); }
.site-footer p, .site-footer li a { color: color-mix(in srgb, currentColor 60%, transparent); }
.site-footer h4 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.site-footer ul { list-style: none; display: grid; gap: 10px; font-size: 15px; }
.site-footer li a:hover { color: inherit; }
.pay-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.pay-row span { height: 30px; padding: 0 12px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; border: 1px solid color-mix(in srgb, currentColor 20%, transparent); }
.site-footer__bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0 30px; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); font-size: 13px; }
.site-footer__bottom span { color: color-mix(in srgb, currentColor 50%, transparent); }
@media (max-width: 860px) { .site-footer__top { grid-template-columns: 1fr 1fr; } .site-footer__top > :first-child { grid-column: 1 / -1; } }

/* ---------- drawer (mini cart) ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.drawer__bg { position: absolute; inset: 0; background: rgba(8, 8, 10, .45); opacity: 0; transition: opacity .3s; }
.drawer__panel {
  position: absolute; top: 8px; right: 8px; bottom: 8px; width: min(440px, calc(100% - 16px));
  background: var(--bg-elev); border-radius: 28px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; transform: translateX(calc(100% + 16px)); transition: transform .4s var(--ease);
}
.drawer.is-open { pointer-events: auto; }
.drawer.is-open .drawer__bg { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 14px; }
.drawer__body { flex: 1; overflow: auto; padding: 4px 16px; display: grid; align-content: start; gap: 8px; }
.drawer__foot { padding: 18px 24px 24px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.drawer__total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.drawer__total b { font-size: 24px; letter-spacing: -.02em; }
.ci { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 18px; transition: background .2s; }
.ci:hover { background: var(--bg-sunk); }
.ci .mini-vis { width: 64px; height: 44px; border-radius: 10px; font-size: 15px; }
.ci__info { flex: 1; min-width: 0; }
.ci__info b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ci__info span { font-size: 13px; color: var(--muted); }
.ci__price { font-weight: 700; white-space: nowrap; }
.qty { display: inline-flex; align-items: center; gap: 2px; margin-top: 6px; background: var(--bg-sunk); border-radius: 999px; padding: 2px; }
.qty button { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; font-weight: 700; }
.qty button:hover { background: var(--bg-elev); }
.qty span { min-width: 22px; text-align: center; font-size: 14px; font-weight: 600; color: var(--ink) !important; }
.empty-state { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty-state .big { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 22px; background: var(--bg-sunk); display: grid; place-items: center; }
.empty-state .big svg { width: 32px; height: 32px; color: var(--ink); }
.empty-state b { display: block; color: var(--ink); font-size: 18px; margin-bottom: 4px; }

/* ---------- quick-buy sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 95; display: flex; align-items: flex-end; justify-content: center; }
.sheet__bg { position: absolute; inset: 0; background: rgba(8, 8, 10, .5); opacity: 0; transition: opacity .3s; }
.sheet__panel {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100% - 24px); overflow: auto; overscroll-behavior: contain;
  background: var(--bg-elev); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%); transition: transform .35s var(--ease);
}
.sheet.is-open .sheet__bg { opacity: 1; }
.sheet.is-open .sheet__panel { transform: none; }
.sheet__grip { width: 40px; height: 5px; border-radius: 9px; background: var(--line-strong); margin: 4px auto 12px; }
@media (min-width: 761px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet__panel { border-radius: 28px; padding: 24px 28px 28px; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .3s var(--ease), opacity .25s; }
  .sheet.is-open .sheet__panel { opacity: 1; }
  .sheet__grip { display: none; }
}
#bsContent { display: grid; gap: 18px; }
.bs-head { display: flex; align-items: center; gap: 14px; }
.bs-head .mini-vis { width: 64px; height: 44px; border-radius: 12px; font-size: 15px; }
.bs-head__t { flex: 1; min-width: 0; }
.bs-head h3 { font-size: 20px; letter-spacing: -.02em; line-height: 1.2; }
.bs-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.bs-meta span { display: inline-flex; align-items: center; gap: 4px; }
.bs-auto { color: var(--ok); font-weight: 600; }
.bs-label { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-bottom: -8px; }
.bs-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.bs-opts.is-single { grid-template-columns: 1fr; }
.bs-opt {
  position: relative; text-align: left; padding: 12px 14px; border-radius: 16px; border: 2px solid var(--line);
  background: var(--bg); display: grid; gap: 2px; min-height: 64px; transition: border-color .15s, background .15s;
}
.bs-opt b { font-size: 15px; font-weight: 650; }
.bs-opt span { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bs-opt i { position: absolute; top: 8px; right: 8px; font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); }
.bs-opt.is-active { border-color: var(--ink); background: var(--bg-elev); }
.bs-opt.is-active span { color: var(--ink); font-weight: 600; }
.bs-fields { display: grid; gap: 12px; }
.hint.is-err { color: var(--danger); }
.bs-need { font-size: 14px; color: var(--muted); padding: 12px 14px; border-radius: 14px; background: var(--bg-sunk); }
.bs-need b { color: var(--ink); font-weight: 600; }
.bs-note { color: var(--ink-2); }
.bs-foot { display: grid; gap: 12px; }
.bs-buy s { opacity: .55; font-weight: 500; font-size: 14px; }
.bs-links { display: flex; justify-content: center; gap: 10px; font-size: 14px; color: var(--muted); }
.bs-links button, .bs-links a { color: var(--ink-2); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.mobile-nav__theme { display: flex; width: 100%; justify-content: space-between; padding: 16px 4px; font-size: 20px; font-weight: 600; border-bottom: 1px solid var(--line); }
.mobile-nav__theme span { color: var(--muted); font-size: 16px; }

/* ---------- toast ---------- */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translateX(-50%); display: grid; gap: 8px; width: max-content; max-width: calc(100% - 32px); }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px 12px 12px; border-radius: 999px;
  background: var(--ink); color: var(--bg); font-weight: 550; font-size: 15px; box-shadow: var(--shadow-lg);
  animation: toastIn .35s var(--ease);
}
.toast__ico { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex: none; }
.toast__ico svg { width: 16px; height: 16px; }
.toast.is-out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- utils ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
.breadcrumbs { display: flex; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--muted); padding: 22px 0 8px; }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs span[aria-hidden] { opacity: .5; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .reveal { opacity: 1; transform: none; }
}
