/* Витрина в стиле Apple: системный шрифт, материалы (стекло), сгруппированные списки, шторки, пружины.
   Палитры светлой и тёмной темы приходят из админки (templates/ui.html → theme_vars): --bg, --surface, --accent…
   Вид сайта — атрибуты на <html>: data-theme (light | dark | нет — как в системе), data-font, data-radius,
   data-density, data-solid (без стекла), data-glow (свечение вверху). */

/* ------------------------------------------------------------ токены */
:root {
  --bg: #000000; --surface: #1c1c1e; --surface-2: #2c2c2e; --line: #38383a;
  --text: #ffffff; --muted: #8e8e93; --accent: #fa2d48; --accent-2: #ff4f66; --accent-ink: #ffffff;
  color-scheme: dark;

  /* системный шрифт: на устройствах Apple это SF Pro с оптическими размерами */
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --r-card: 22px; --r-art: 16px; --r-ctl: 12px; --r-group: 14px; --r-sheet: 34px; --r-btn: 999px;
  --card-min: 200px; --gap: 12px;
  --gutter: 16px; --maxw: 1280px; --nav-h: 56px; --tab-h: 64px;
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --spring: cubic-bezier(.2, .9, .25, 1.12);
  --blur: blur(22px) saturate(180%);
}

/* Цвета, которые зависят от темы, но не от палитры владельца: заливки, тени, «стекло». */
:root, .scheme-dark {
  --fill-a: 24%; --fill-b: 32%; --fill-c: 42%; --tint-a: 16%; --tint-b: 24%;
  --ok: #30d158; --warn: #ff9f0a; --bad: #ff453a; --scrim: rgba(0, 0, 0, .5);
  --sheet: var(--surface); --cell: var(--surface-2); --raised: var(--surface);
  --thumb: #636366; --thumb-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 3px 8px rgba(0, 0, 0, .2);
  --glass-k: 68%; --nav-k: 76%; --edge-hi: rgba(255, 255, 255, .12); --edge-lo: rgba(255, 255, 255, .06);
  --shadow-c: rgba(0, 0, 0, .55); --shadow-c2: rgba(0, 0, 0, .3);
}
:root[data-theme="light"], .scheme-light {
  --fill-a: 12%; --fill-b: 18%; --fill-c: 26%; --tint-a: 12%; --tint-b: 18%;
  --ok: #248a3d; --warn: #b25000; --bad: #d70015; --scrim: rgba(0, 0, 0, .28);
  --sheet: var(--bg); --cell: var(--surface); --raised: var(--surface);
  --thumb: #ffffff; --thumb-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 3px 8px rgba(0, 0, 0, .12);
  --glass-k: 72%; --nav-k: 80%; --edge-hi: rgba(255, 255, 255, .85); --edge-lo: rgba(255, 255, 255, .5);
  --shadow-c: rgba(0, 0, 0, .16); --shadow-c2: rgba(0, 0, 0, .06);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --fill-a: 12%; --fill-b: 18%; --fill-c: 26%; --tint-a: 12%; --tint-b: 18%;
    --ok: #248a3d; --warn: #b25000; --bad: #d70015; --scrim: rgba(0, 0, 0, .28);
    --sheet: var(--bg); --cell: var(--surface); --raised: var(--surface);
    --thumb: #ffffff; --thumb-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 3px 8px rgba(0, 0, 0, .12);
    --glass-k: 72%; --nav-k: 80%; --edge-hi: rgba(255, 255, 255, .85); --edge-lo: rgba(255, 255, 255, .5);
    --shadow-c: rgba(0, 0, 0, .16); --shadow-c2: rgba(0, 0, 0, .06);
  }
}
/* Производные цвета пересчитываются там, где задана палитра (на странице и в предпросмотре админки). */
:root, .theme-scope {
  --fill: color-mix(in srgb, var(--muted) var(--fill-a), transparent);
  --fill-2: color-mix(in srgb, var(--muted) var(--fill-b), transparent);
  --fill-3: color-mix(in srgb, var(--muted) var(--fill-c), transparent);
  --tint: color-mix(in srgb, var(--accent) var(--tint-a), transparent);
  --tint-2: color-mix(in srgb, var(--accent) var(--tint-b), transparent);
  --glass: color-mix(in srgb, var(--bg) var(--nav-k), transparent);
  --glass-2: color-mix(in srgb, var(--raised) var(--glass-k), transparent);
  --edge: inset 0 1px 0 var(--edge-hi), inset 0 0 0 .5px var(--edge-lo);
  --float: 0 14px 34px -12px var(--shadow-c), 0 2px 8px var(--shadow-c2);
  --hairline: color-mix(in srgb, var(--line) 90%, transparent);
}

/* шрифт */
[data-font="rounded"] {
  --ui: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
[data-font="serif"] { --display: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Georgia, "Times New Roman", serif; }
/* скругления */
[data-radius="medium"] { --r-card: 18px; --r-art: 13px; --r-ctl: 10px; --r-group: 12px; --r-sheet: 26px; }
[data-radius="small"] { --r-card: 12px; --r-art: 8px; --r-ctl: 8px; --r-group: 10px; --r-sheet: 16px; --r-btn: 10px; }
/* размер карточек */
[data-density="large"] { --card-min: 252px; --gap: 14px; }
[data-density="compact"] { --card-min: 164px; --gap: 10px; }

/* ------------------------------------------------------------ основа */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); -webkit-tap-highlight-color: transparent; scrollbar-gutter: stable; }
body {
  margin: 0; min-height: 100dvh; color: var(--text); background: var(--bg);
  font: 400 17px/1.47 var(--ui); letter-spacing: -.012em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  padding-bottom: calc(var(--tab-h) + 32px + env(safe-area-inset-bottom, 0px));
  position: relative; isolation: isolate;
}
/* мягкое свечение акцентом за большим заголовком */
[data-glow] body::before {
  content: ""; position: absolute; z-index: -1; left: 0; right: 0; top: 0; height: 560px; pointer-events: none;
  background: radial-gradient(70% 100% at 50% -10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 72%);
}
a { color: var(--accent-2); text-decoration: none; }
h1, h2, h3 { margin: 0; font-family: var(--display); }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button, a, [role="button"], .card { touch-action: manipulation; }
button, [role="button"], .tab, .chip, .filter-btn, .tag, .seg-btn, .grabber, .nav-btn { -webkit-user-select: none; user-select: none; }
svg { display: block; }
img { -webkit-user-drag: none; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--tint-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1em; height: 1em; flex: none; fill: none; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.price-btn, .gm-price, .pr-field input, .badge, .fb-n { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ кнопки и поля */
/* Нажатие видно сразу — :active срабатывает на касание, а не на отпускание */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 0; border-radius: var(--r-btn); font: 600 16px/1.2 var(--ui); letter-spacing: -.016em; text-align: center;
  text-decoration: none; transition: transform 160ms var(--ease-out), opacity 160ms ease, background-color 200ms ease;
}
.btn:active { transform: scale(.97); opacity: .86; transition-duration: 80ms; }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-gray { background: var(--fill); color: var(--text); }
.btn-tinted { background: var(--tint); color: var(--accent-2); }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 15px; }
.btn-lg { min-height: 50px; font-size: 17px; }
.btn-wide { width: 100%; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--text)); }
  .btn-gray:hover { background: var(--fill-2); }
  .btn-tinted:hover { background: var(--tint-2); }
}
.input {
  width: 100%; height: 44px; padding: 0 14px; border: 0; border-radius: var(--r-ctl);
  background: var(--fill); color: var(--text); font-size: 17px; outline: none;
  transition: box-shadow 160ms ease, background-color 160ms ease;
}
.input::placeholder { color: var(--muted); opacity: 1; }
.input:focus { box-shadow: 0 0 0 3.5px var(--tint-2); }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }

/* круглая серая кнопка «закрыть» — как xmark.circle.fill */
.x-btn {
  width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; padding: 0; display: grid; place-items: center;
  background: var(--fill); color: var(--muted); font-size: 12px; transition: transform 140ms var(--ease-out), background-color 160ms ease;
}
.x-btn .ico { width: 12px; height: 12px; }
.x-btn:active { transform: scale(.88); }
@media (hover: hover) and (pointer: fine) { .x-btn:hover { background: var(--fill-2); color: var(--text); } }

/* ------------------------------------------------------------ шапка */
/* Наверху страницы шапка прозрачная; как только контент уходит под неё — появляется стекло
   и мягкая граница (scroll edge), а не жёсткая линия. */
.navbar {
  position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top, 0px);
  background-color: transparent; box-shadow: 0 .5px 0 transparent;
  transition: background-color 250ms ease, box-shadow 250ms ease, -webkit-backdrop-filter 250ms ease, backdrop-filter 250ms ease;
}
.navbar.scrolled { background-color: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: 0 .5px 0 var(--hairline); }
.navbar-in { display: flex; align-items: center; gap: 10px; height: var(--nav-h); max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }

.brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0; margin-left: -4px; padding: 4px 12px 4px 4px; border-radius: 999px;
  color: var(--text); text-decoration: none; transition: transform 160ms var(--ease-out), background-color 200ms ease;
}
.brand:active { transform: scale(.97); }
.brand-ava { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; background: var(--fill); }
.brand-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-name { display: inline-flex; align-items: center; gap: 4px; min-width: 0; font: 600 15px/1.25 var(--ui); letter-spacing: -.015em; }
.brand-nick { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-check { width: 16px; height: 16px; flex: none; color: var(--accent); --ico-2: var(--accent-ink); }
.brand-meta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.brand-meta b { color: var(--text); font-weight: 600; }
.bm-star { width: 12px; height: 12px; color: #ff9f0a; }
.bm-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--muted); margin: 0 3px; }
@media (hover: hover) and (pointer: fine) { .brand:hover { background: var(--fill); } }

.nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.nav-btn {
  position: relative; display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 10px; border: 0; border-radius: 999px;
  background: var(--fill); color: var(--text); font: 600 13px/1 var(--ui); letter-spacing: .02em;
  transition: transform 150ms var(--ease-out), background-color 200ms ease;
}
.nav-btn:active { transform: scale(.9); }
@media (hover: hover) and (pointer: fine) { .nav-btn:hover { background: var(--fill-2); } }
.theme-btn { padding: 0; width: 36px; }
.theme-btn .ico { grid-area: 1 / 1; width: 18px; height: 18px; transition: transform 380ms var(--spring), opacity 220ms ease; }
/* в тёмной теме видна луна, в светлой — солнце; при смене одна уходит поворотом, другая выходит */
.theme-btn .ic-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
:root[data-theme="light"] .theme-btn .ic-sun, .scheme-light .theme-btn .ic-sun { opacity: 1; transform: none; }
:root[data-theme="light"] .theme-btn .ic-moon, .scheme-light .theme-btn .ic-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-btn .ic-sun { opacity: 1; transform: none; }
  :root:not([data-theme]) .theme-btn .ic-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
}
.lang-btn { min-width: 40px; }

/* сегментированный контрол: бегунок (seg-pill) едет пружиной — site.js */
.seg { position: relative; display: flex; align-items: center; padding: 2px; border-radius: 10px; background: var(--fill); isolation: isolate; }
.seg-pill { position: absolute; z-index: -1; top: 2px; bottom: 2px; left: 0; width: 0; border-radius: 8px; background: var(--thumb);
  box-shadow: var(--thumb-shadow); opacity: 0; will-change: transform, width; }
.seg.js .seg-pill { opacity: 1; }
.seg > a, .seg-btn {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; height: 30px; padding: 0 14px;
  border: 0; border-radius: 8px; background: none; color: var(--text); font: 500 14px/1 var(--ui); letter-spacing: -.01em;
  white-space: nowrap; text-decoration: none; transition: color 200ms ease;
}
.seg > a[aria-current="page"], .seg-btn[aria-pressed="true"] { font-weight: 600; }
.seg:not(.js) > a[aria-current="page"], .seg:not(.js) .seg-btn[aria-pressed="true"] { background: var(--thumb); box-shadow: var(--thumb-shadow); }
.topnav { display: none; }

/* ------------------------------------------------------------ заголовок и плашки */
.hero { padding: 6px 0 2px; }
.large-title { font: 700 34px/1.18 var(--display); letter-spacing: -.008em; margin: 0 0 14px; }
/* Плашка в духе TipKit — на всю ширину ленты подарков */
.trust {
  display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 14px; padding: 14px 16px;
  border-radius: calc(var(--r-group) + 4px); background: var(--surface);
}
.trust-ico { width: 30px; height: 30px; color: var(--accent); --ico-2: var(--accent-ink); }
.trust p { margin: 0; font-size: 14px; line-height: 1.42; letter-spacing: -.006em; color: var(--muted); }
.trust b { display: block; color: var(--text); font-weight: 600; font-size: 15px; margin-bottom: 1px; }
.note { margin: 0 0 14px; padding: 12px 16px; border-radius: calc(var(--r-group) + 2px); font-size: 14px; line-height: 1.42; color: var(--muted); background: var(--surface); }
.note-warn { color: var(--text); background: color-mix(in srgb, var(--warn) 15%, var(--surface)); }
.note-warn b { font-weight: 600; color: var(--warn); }

/* ------------------------------------------------------------ поиск и фильтры */
.toolbar { margin-bottom: 16px; }
.searchrow { display: grid; grid-template-columns: minmax(0, 1fr) 40px 40px; gap: 8px; align-items: center; }
.search { position: relative; display: block; }
.search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.search .input { height: 40px; padding: 0 36px; border-radius: var(--r-ctl); font-size: 17px; }
.search-clear {
  position: absolute; right: 9px; top: 0; bottom: 0; margin: auto 0; width: 19px; height: 19px; border: 0; border-radius: 50%; padding: 0;
  display: grid; place-items: center; background: var(--fill-3); color: var(--bg);
}
.search-clear .ico { width: 9px; height: 9px; }
.icon-btn {
  position: relative; width: 40px; height: 40px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: var(--fill); color: var(--text); transition: transform 150ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.icon-btn .ico { width: 20px; height: 20px; }
.icon-btn:active { transform: scale(.9); }
.icon-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.icon-btn[aria-pressed="true"] .ico { fill: currentColor; }
.badge:empty { display: none; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink); font: 700 11px/18px var(--ui); font-style: normal; letter-spacing: 0; text-align: center;
  box-shadow: 0 0 0 2px var(--bg);
}
.icon-btn[aria-pressed="true"] .badge { background: var(--text); color: var(--bg); }
.icon-btn .dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
@media (hover: hover) and (pointer: fine) { .icon-btn:hover { background: var(--fill-2); } .icon-btn[aria-pressed="true"]:hover { background: var(--accent); } }

/* подсказки поиска — всплывающее меню из того же материала, что и шапка */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  border-radius: calc(var(--r-ctl) + 4px); background: var(--glass-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--edge), var(--float); max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain;
}
.suggest li { display: flex; align-items: center; gap: 12px; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.suggest li[aria-selected="true"] { background: var(--fill); }
@media (hover: hover) and (pointer: fine) { .suggest li:hover { background: var(--fill); } }
.suggest img, .suggest .sg-ph { width: 38px; height: 38px; border-radius: 9px; object-fit: contain; padding: 2px; flex: none; background: var(--fill); }
.sg-txt { min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sg-txt b { font-weight: 500; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-txt span { font-size: 13px; color: var(--muted); letter-spacing: 0; }
.sg-pr { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; letter-spacing: 0; }

/* фильтры — капсулы-меню в одну строку с прокруткой */
.filterrow { display: flex; gap: 8px; margin: 12px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.filterrow::-webkit-scrollbar { display: none; }
.filter-btn, .tag {
  flex: none; display: inline-flex; align-items: center; gap: 6px; max-width: 230px; height: 34px; padding: 0 12px 0 14px;
  border: 0; border-radius: 999px; background: var(--fill); color: var(--text); font: 500 15px/1 var(--ui); letter-spacing: -.01em;
  transition: transform 150ms var(--ease-out), background-color 200ms ease, color 200ms ease;
}
.tag { padding: 0 14px; }
.filter-btn:active, .tag:active { transform: scale(.95); }
.filter-btn.on, .tag[aria-pressed="true"] { background: var(--tint); color: var(--accent-2); }
.fb-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-n:empty { display: none; }
.fb-n { flex: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink);
  font: 700 11px/18px var(--ui); font-style: normal; text-align: center; letter-spacing: 0; }
.fb-chev { width: 12px; height: 12px; opacity: .6; }
.fb-lead { flex: none; width: 20px; height: 20px; margin-left: -6px; border-radius: 6px; object-fit: contain; }
.fb-lead.round { border-radius: 50%; }
@media (hover: hover) and (pointer: fine) {
  .filter-btn:hover, .tag:hover { background: var(--fill-2); }
  .filter-btn.on:hover, .tag[aria-pressed="true"]:hover { background: var(--tint-2); }
}

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 6px 0 12px; border-radius: 999px; border: 0;
  background: var(--tint); color: var(--accent-2); font: 500 14px/1 var(--ui); letter-spacing: -.01em;
  transition: transform 150ms var(--ease-out), background-color 200ms ease;
}
.chip:active { transform: scale(.95); }
.chip i { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-2); }
.chip .ico { width: 8px; height: 8px; }
.chip-reset { padding: 0 12px; background: none; }

/* длина юзернейма */
.len-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.len-label { flex: none; color: var(--muted); font-size: 15px; }
.seg-len { flex: 1; min-width: 0; }
.seg-len .seg-btn { padding: 0 6px; }

/* ------------------------------------------------------------ лента и карточки */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
[data-density="compact"] .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  position: relative; display: flex; flex-direction: column; min-width: 0; padding: 8px; border-radius: var(--r-card);
  background: var(--surface); cursor: pointer; text-align: left;
  transition: transform 220ms var(--ease-out), box-shadow 260ms ease, background-color 260ms ease;
}
.card:active { transform: scale(.97); transition-duration: 90ms; }
.art {
  position: relative; aspect-ratio: 1; border-radius: var(--r-art); overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, var(--c1, #3a3a3c), var(--c2, #1c1c1e) 82%); isolation: isolate;
}
/* узор: значки-маски, залитые цветом узора фона */
.art .pat { position: absolute; inset: 0; opacity: 0; transition: opacity 300ms ease; pointer-events: none; }
.art .pat.on { opacity: 1; }
.art .pat i { position: absolute; transform: translate(-50%, -50%); background: var(--cp, rgba(0, 0, 0, .45));
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center; }
/* модель — по центру, без фона */
.art img.model, .art .lottie { position: absolute; left: 50%; top: 50%; width: 70%; height: 70%; transform: translate(-50%, -50%);
  object-fit: contain; -webkit-touch-callout: none; user-select: none; }
.art img.model { opacity: 0; transition: opacity 300ms ease, transform 420ms var(--ease-out); filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .28)); }
.art.ready img.model { opacity: 1; }
.art.animated img.model { visibility: hidden; }
/* запасной вариант — готовая картинка Fragment на всю карточку, свой узор не нужен */
.art.full .pat { display: none; }
.art.full img.model { left: 0; top: 0; width: 100%; height: 100%; transform: none; object-fit: cover; filter: none; }
.art .ph { width: 40%; height: 40%; color: rgba(255, 255, 255, .85); }
.art .lottie svg { width: 100% !important; height: 100% !important; }
.art .lottie.scene { left: 0; top: 0; width: 100%; height: 100%; transform: none; }

/* значок крафта — в левом нижнем углу картинки: затемнённый круг цвета фона подарка и белая наковальня */
.craft {
  position: absolute; z-index: 2; left: 8px; bottom: 8px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .22);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14); cursor: help;
}
.craft .ico { width: 16px; height: 16px; }
.craft.mini, .craft-legend .craft { position: relative; left: auto; bottom: auto; display: inline-grid; vertical-align: -6px; cursor: default; }
.craft.mini { width: 22px; height: 22px; margin: 0 2px; }
.craft.mini .ico { width: 13px; height: 13px; }
.craft.mini.craftable, .craft-legend .craftable { background: #6a5cf0; }
.craft.mini.crafted, .craft-legend .crafted { background: #2f9e95; }

/* «В избранное» — стеклянная кнопка поверх картинки */
.fav-btn {
  position: absolute; top: 14px; right: 14px; z-index: 3; width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; color: #fff; background: rgba(0, 0, 0, .26);
  -webkit-backdrop-filter: blur(12px) saturate(160%); backdrop-filter: blur(12px) saturate(160%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .18); transition: background-color 200ms ease;
}
.fav-btn .ico { width: 16px; height: 16px; }
.fav-btn[aria-pressed="true"], .fav-btn.on { background: color-mix(in srgb, var(--accent) 88%, transparent); color: var(--accent-ink); }
.fav-btn[aria-pressed="true"] .ico, .fav-btn.on .ico { fill: currentColor; }

.card-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 10px 6px 2px; }
.c-title { display: flex; align-items: baseline; gap: 5px; min-width: 0; font: 600 15px/1.3 var(--ui); letter-spacing: -.016em; }
.c-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-title small { flex: none; color: var(--muted); font-weight: 400; font-size: 13px; letter-spacing: 0; }
.c-attr { display: flex; align-items: center; gap: 6px; min-width: 0; margin-top: 1px; color: var(--muted); font-size: 13px; line-height: 1.35;
  letter-spacing: -.006em; white-space: nowrap; }
.c-attr span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.c-attr .sw { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c1); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .3); }
/* цена — сама кнопка покупки, как «Загрузить» в App Store */
.price-btn {
  display: flex; align-items: center; justify-content: center; width: 100%; height: 36px; margin-top: auto; padding: 0 10px;
  border: 0; border-radius: var(--r-btn); background: var(--tint); color: var(--accent-2); font: 600 15px/1 var(--ui); letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: transform 120ms var(--ease-out), background-color 200ms ease;
}
.price-btn:active { transform: scale(.95); }
.price-btn.na { color: var(--muted); background: var(--fill); }
.card-body > :nth-last-child(2) { margin-bottom: 10px; }   /* отступ над кнопкой-ценой; сама кнопка прижата к низу */
@media (hover: hover) and (pointer: fine) {
  .card:hover { box-shadow: var(--float); transform: translateY(-3px); }
  .card:hover .art img.model { transform: translate(-50%, -50%) scale(1.06); }
  .card:hover .art.full img.model { transform: scale(1.04); }
  .card:active { transform: scale(.98); }
  .price-btn:hover { background: var(--tint-2); }
}
[data-density="compact"] .card { padding: 6px; }
[data-density="compact"] .card-body { padding: 8px 4px 2px; }
[data-density="compact"] .c-title { font-size: 14px; }
[data-density="compact"] .price-btn { height: 32px; font-size: 14px; }
[data-density="compact"] .fav-btn { top: 10px; right: 10px; width: 28px; height: 28px; }
[data-density="compact"] .craft { left: 6px; bottom: 6px; width: 22px; height: 22px; }
[data-density="compact"] .craft .ico { width: 13px; height: 13px; }

.skeleton { border-radius: var(--r-card); aspect-ratio: .7; background: var(--surface); position: relative; overflow: hidden; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--fill), transparent); animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

/* пустое состояние — как ContentUnavailableView */
.empty { margin: 24px 0; padding: 40px 20px; text-align: center; color: var(--muted); font-size: 15px; line-height: 1.42; }
.empty b { display: block; color: var(--text); font: 700 22px/1.25 var(--display); letter-spacing: -.02em; margin-bottom: 6px; }
.empty .btn { margin-top: 18px; }
/* индикатор загрузки — вращающиеся «спицы», как у iOS */
.more { display: flex; justify-content: center; padding: 26px; }
.more::before { content: ""; width: 22px; height: 22px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 12%, var(--muted) 100%);
  -webkit-mask: radial-gradient(circle, transparent 55%, #000 57%); mask: radial-gradient(circle, transparent 55%, #000 57%);
  animation: spin .8s steps(12) infinite; }
.sentinel { height: 1px; }

/* ------------------------------------------------------------ юзернеймы */
.u-art { background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--accent) 60%, var(--surface-2)), color-mix(in srgb, var(--accent) 18%, var(--surface-2)) 86%); }
.u-plate {
  max-width: 86%; padding: 8px 14px; border-radius: 12px; color: #fff;
  background: rgba(0, 0, 0, .26); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2);
  font: 600 15px/1.15 var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em;
}
.u-art-lg .u-plate { font-size: 22px; padding: 12px 18px; white-space: normal; word-break: break-all; text-align: center; }
.c-domain { color: var(--muted); font-size: 13px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------ шторки и окна (site.js двигает их пружиной и пальцем) */
.sheet, .modal { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop, .modal-backdrop { position: absolute; inset: 0; background: var(--scrim); opacity: 0; will-change: opacity; }
.sheet-panel, .modal-card {
  position: absolute; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  max-height: calc(100dvh - 56px - env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; gap: 14px; padding: 8px 16px 16px; border-radius: var(--r-sheet);
  background: var(--sheet); box-shadow: var(--edge), 0 -8px 40px var(--shadow-c2);
  transform: translate3d(0, 110%, 0); will-change: transform; overscroll-behavior: contain;
}
.modal-card { display: block; overflow-y: auto; padding: 8px 18px 18px; }
.sheet-compact { overflow-y: auto; }
.sheet-panel:not(.sheet-compact) { height: calc(100dvh - 56px - env(safe-area-inset-top, 0px) - 8px - env(safe-area-inset-bottom, 0px)); }
.grabber { position: relative; flex: none; width: 36px; height: 5px; margin: 0 auto 2px; border-radius: 3px; background: var(--fill-3); touch-action: none; cursor: grab; }
.grabber::before { content: ""; position: absolute; inset: -10px -40px -14px; }   /* зона хвата больше самой полоски */
[data-drag] { touch-action: none; }
.sheet-head { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; gap: 8px; min-height: 36px; }
.sheet-head h2 { grid-column: 2; text-align: center; font: 600 17px/1.3 var(--ui); letter-spacing: -.022em; }
.sheet-head .x-btn { grid-column: 3; }
.search-sm .input { height: 38px; }
.sheet-hint { margin: -4px 4px 0; font-size: 13px; line-height: 1.38; color: var(--muted); letter-spacing: 0; }

/* сгруппированные списки (inset grouped): строки на общей подложке, разделители с отступом */
.group-label { margin: 6px 16px -8px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.group { background: var(--cell); border-radius: var(--r-group); overflow: hidden; }
.opt-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 120px; overflow-y: auto; overscroll-behavior: contain; }
.opt-list > li { position: relative; }
.opt-list > li:not(:last-child)::after { content: ""; position: absolute; left: 66px; right: 0; bottom: 0; height: .5px; background: var(--hairline); pointer-events: none; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px; cursor: pointer; transition: background-color 150ms ease; }
.opt:active { background: var(--fill); }
.opt-lead { flex: none; width: 40px; height: 40px; border-radius: 10px; object-fit: cover; background: var(--fill); display: grid; place-items: center;
  font: 600 17px/1 var(--ui); color: var(--muted); }
img.opt-lead { object-fit: contain; padding: 3px; }
.opt-lead.round { width: 30px; height: 30px; margin: 0 5px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .2); }
.opt-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.opt-txt b { font-weight: 400; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-txt span { font-size: 13px; color: var(--muted); letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-meta { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; letter-spacing: 0; }
.opt-meta .rar { color: var(--muted); }
.opt-meta .pr { color: var(--text); }
/* выбор — круг с галочкой справа, как в режиме выбора iOS */
.opt input { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; margin: 0; border-radius: 50%;
  border: 1.5px solid var(--fill-3); display: grid; place-items: center; transition: background-color 150ms ease, border-color 150ms ease; }
.opt input:checked { background: var(--accent); border-color: var(--accent); }
.opt input:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--accent-ink); border-width: 0 2.4px 2.4px 0; transform: translateY(-1px) rotate(45deg); }
.opt-empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: 15px; }
.sheet-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }

/* сортировка: строка с галочкой у выбранной */
.radio-list { display: flex; flex-direction: column; }
.radio { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px;
  border: 0; background: none; color: var(--text); font-size: 17px; text-align: left; transition: background-color 150ms ease; }
.radio:active { background: var(--fill); }
.radio:not(:last-child)::before { content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: .5px; background: var(--hairline); }
.radio::after { content: ""; flex: none; width: 7px; height: 13px; margin-right: 4px; border: solid var(--accent); border-width: 0 2.5px 2.5px 0;
  transform: translateY(-2px) rotate(45deg); opacity: 0; transition: opacity 150ms ease; }
.radio[aria-checked="true"]::after { opacity: 1; }
.price-range { display: flex; flex-direction: column; gap: 14px; }
.pr-row { display: flex; align-items: center; gap: 8px; }
.pr-field { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: var(--r-group);
  background: var(--cell); cursor: text; transition: box-shadow 160ms ease; }
.pr-field:focus-within { box-shadow: 0 0 0 3.5px var(--tint-2); }
.pr-field span { color: var(--muted); font-size: 15px; }
.pr-field input { flex: 1; min-width: 0; width: 100%; border: 0; background: none; outline: none; font-size: 17px; font-weight: 500; caret-color: var(--accent); }
.pr-field input::placeholder { color: var(--muted); font-weight: 400; }
.pr-dash { flex: none; width: 8px; height: 1.5px; background: var(--muted); border-radius: 2px; }

/* ------------------------------------------------------------ карточка подарка */
.modal-x { position: absolute; top: 14px; right: 14px; z-index: 4; }
.gm-stage { position: relative; width: min(100%, 320px); margin: 14px auto 18px; }
.gm-art { border-radius: calc(var(--r-art) + 10px); box-shadow: 0 28px 60px -28px var(--c1, rgba(0, 0, 0, .6)); }
.gm-art .craft { left: 12px; bottom: 12px; width: 32px; height: 32px; }
.gm-art .craft .ico { width: 18px; height: 18px; }
.gm-fav { top: 12px; right: 12px; width: 36px; height: 36px; }
.gm-title { text-align: center; font: 700 28px/1.15 var(--display); letter-spacing: -.022em; overflow-wrap: anywhere; }
.gm-title small { font: 400 17px var(--ui); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.gm-craft { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.gm-craft .craft { position: static; width: 22px; height: 22px; }
.gm-craft .craft .ico { width: 13px; height: 13px; }
.gm-craft.craftable .craft { background: #6a5cf0; }
.gm-craft.crafted .craft { background: #2f9e95; }
.um-domain { margin: 4px 0 0; text-align: center; color: var(--muted); font-size: 15px; }
.traits { margin: 18px 0 0; }
.traits div { position: relative; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 14px; }
.traits div:not(:last-child)::after { content: ""; position: absolute; left: 14px; right: 0; bottom: 0; height: .5px; background: var(--hairline); }
.traits dt { flex: none; width: 76px; color: var(--muted); font-size: 15px; }
.traits dd { flex: 1; min-width: 0; margin: 0; display: flex; align-items: center; gap: 8px; font-size: 17px; }
.traits dd span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.traits .sw { flex: none; width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .3); }
.traits .rar { flex: none; margin-left: auto; padding: 3px 8px; border-radius: 999px; font: 600 12px/1.2 var(--ui); letter-spacing: 0; font-style: normal;
  color: var(--accent-2); background: var(--tint); }
.gm-price-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.gm-price { margin: 0; font: 700 34px/1 var(--display); letter-spacing: -.025em; white-space: nowrap; }
.gm-status { display: inline-flex; align-items: center; gap: 6px; margin: 0; padding: 5px 10px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--muted); background: var(--fill); letter-spacing: 0; }
.gm-status:empty { display: none; }
.gm-status.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 15%, transparent); }
.gm-status.ok::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.gm-status.bad { color: var(--accent-2); background: var(--tint); }
.fee-note { margin: 8px 0 18px; font-size: 13px; color: var(--muted); letter-spacing: 0; }
.fee-note.center { text-align: center; margin: 4px 0 0; }
.lot-box { margin: -4px 0 16px; padding: 14px 16px; border-radius: var(--r-group); background: var(--cell); }
.lot-box.ok { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 45%, transparent); }
.lot-box.bad { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent); }
.lot-steps { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; font-size: 15px; color: var(--muted); }
.lot-steps li { display: flex; align-items: center; gap: 10px; }
.lot-steps li::before { content: ""; flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--fill-3); box-sizing: border-box; }
.lot-steps li.now { color: var(--text); }
.lot-steps li.now::before { border-color: var(--accent); border-top-color: transparent; animation: spin .8s linear infinite; }
.lot-steps li.done { color: var(--text); }
.lot-steps li.done::before { border: 0; background: var(--ok) no-repeat center / 11px 11px
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.lot-msg { margin: 0; font-size: 14px; line-height: 1.45; color: var(--muted); letter-spacing: -.005em; }
.lot-box.bad .lot-msg { color: var(--text); }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-actions { display: grid; gap: 10px; }

/* ------------------------------------------------------------ таб-бар: парящая стеклянная капсула */
.tabbar {
  position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 40;
  width: min(calc(100% - 32px), 420px); transform: translateX(-50%);
  display: flex; gap: 2px; padding: 4px; border-radius: 999px; isolation: isolate;
  background: var(--glass-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--edge), var(--float);
}
.tab-pill { position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 0; width: 0; border-radius: 999px; background: var(--fill); opacity: 0; will-change: transform, width; }
.tabbar.js .tab-pill { opacity: 1; }
.tab {
  position: relative; flex: 1 1 0; min-width: 0; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 999px; color: var(--text); text-decoration: none; font: 500 10px/1.2 var(--ui); letter-spacing: .01em;
  transition: transform 160ms var(--ease-out), color 200ms ease;
}
.tab:active { transform: scale(.93); }
.tab .ico { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent-2); font-weight: 600; }
.tabbar:not(.js) .tab[aria-current="page"] { background: var(--fill); }

/* уведомление — капсула сверху, въезжает пружиной */
.toast {
  position: fixed; left: 0; right: 0; top: calc(10px + env(safe-area-inset-top, 0px)); z-index: 90;
  width: fit-content; max-width: min(calc(100% - 32px), 460px); margin: 0 auto; padding: 12px 20px; border-radius: 24px; transform: translate3d(0, -150%, 0);
  background: var(--glass-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: var(--edge), var(--float); font-size: 15px; font-weight: 500; line-height: 1.3; letter-spacing: -.01em; text-align: center; will-change: transform;
}

/* ------------------------------------------------------------ «Как купить» */
.help-intro p { max-width: 62ch; margin: 0; color: var(--muted); font-size: 17px; }
.help-tabs { display: inline-flex; gap: 2px; margin-top: 16px; padding: 2px; border-radius: 10px; background: var(--fill); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.help-tabs a { flex: none; padding: 7px 14px; border-radius: 8px; color: var(--text); font-weight: 500; font-size: 14px; transition: background-color 150ms ease; }
.help-tabs a:active { background: var(--thumb); }
@media (hover: hover) and (pointer: fine) { .help-tabs a:hover { background: var(--fill); } }
.help-h { font: 700 22px/1.25 var(--display); letter-spacing: -.02em; margin: 32px 4px 10px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; counter-reset: step; background: var(--surface); border-radius: calc(var(--r-group) + 4px); overflow: hidden; }
.steps li { counter-increment: step; position: relative; padding: 14px 16px 14px 62px; }
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 62px; right: 0; bottom: 0; height: .5px; background: var(--hairline); }
.steps li::before { content: counter(step); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 600 15px/1 var(--ui); }
.steps h3 { font: 600 17px/1.3 var(--ui); letter-spacing: -.02em; margin-bottom: 2px; }
.steps p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.42; max-width: 62ch; letter-spacing: -.005em; }
.faq { background: var(--surface); border-radius: calc(var(--r-group) + 4px); }
.faq details { position: relative; padding: 0 16px; }
.faq details:not(:last-child)::after { content: ""; position: absolute; left: 16px; right: 0; bottom: 0; height: .5px; background: var(--hairline); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; font-size: 17px; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border: solid var(--muted); border-width: 0 2px 2px 0;
  transform: rotate(45deg) translateY(-2px); transition: transform 280ms var(--ease-out); }
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq details p { margin: 0 0 14px; color: var(--muted); font-size: 15px; line-height: 1.45; max-width: 62ch; }
.craft-legend { display: flex; align-items: center; gap: 12px; }
.craft-legend .craft { flex: none; width: 28px; height: 28px; }
.craft-legend .craft .ico { width: 16px; height: 16px; }

/* ------------------------------------------------------------ переход между разделами */
.view { min-height: 60vh; }
/* полоска загрузки раздела — как в Safari, если ответ задержался */
.loadbar { position: fixed; z-index: 100; top: 0; left: 0; width: 100%; height: 2.5px; background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%; opacity: 0; pointer-events: none; }
.loadbar.on { opacity: 1; transform: scaleX(.8); transition: transform 2.6s cubic-bezier(.08, .6, .2, 1), opacity 120ms ease; }
.loadbar.done { opacity: 0; transform: scaleX(1); transition: transform 180ms ease-out, opacity 260ms ease 140ms; }

/* ------------------------------------------------------------ планшет и компьютер */
@media (min-width: 560px) {
  [data-density="large"] .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  [data-density="compact"] .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 720px) {
  :root { --gutter: 24px; }
  .grid, [data-density] .grid { grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 1fr)); gap: calc(var(--gap) + 4px); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .steps li:nth-last-child(2)::after { display: none; }
}
@media (min-width: 960px) {
  :root { --gutter: 32px; --nav-h: 64px; }
  body { padding-bottom: 56px; }
  .tabbar { display: none; }
  .topnav { display: flex; flex: none; margin-left: auto; }
  .topnav > a { height: 32px; padding: 0 16px; font-size: 14px; }
  .nav-actions { margin-left: 4px; }
  .hero { padding-top: 18px; }
  .large-title { font-size: 52px; line-height: 1.06; letter-spacing: -.026em; margin-bottom: 22px; }
  .trust { padding: 16px 20px; margin-bottom: 18px; }
  .trust b { display: inline; margin: 0 6px 0 0; }
  .toolbar { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 12px 16px; align-items: center; margin-bottom: 20px; }
  .filterrow { margin: 0; padding: 0; overflow: visible; flex-wrap: wrap; }
  .chips { grid-column: 1 / -1; }
  .len-row { margin-top: 0; max-width: 520px; }
  .toolbar .len-row + .filterrow { grid-column: 1 / -1; }
  /* шторки на компьютере — окно по центру, появляется «материализуясь» (масштаб + прозрачность) от кнопки */
  .sheet-panel, .modal-card { left: 0; right: 0; top: 0; bottom: 0; margin: auto; width: 440px; height: fit-content;
    max-height: min(720px, calc(100dvh - 64px)); border-radius: 28px; transform: none; opacity: 0; background: var(--raised); }
  .sheet-panel .group, .modal-card .group, .sheet-panel .pr-field, .modal-card .lot-box { background: var(--fill); }
  .sheet-panel:not(.sheet-compact) { height: min(660px, calc(100dvh - 64px)); }
  .modal-card { width: 460px; }
  .grabber { display: none; }
  [data-drag] { touch-action: auto; }
  /* карточка подарка — картинка слева, всё остальное справа */
  .gift-card { width: min(860px, calc(100vw - 64px)); display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: 32px; padding: 32px; align-items: start; }
  .gift-card .gm-stage { width: 100%; margin: 0; position: sticky; top: 0; }
  .gift-card .gm-title, .gift-card .gm-craft { text-align: left; justify-content: flex-start; padding-right: 40px; }
  .gift-card .gm-info { padding-top: 6px; }
  .steps { grid-template-columns: repeat(4, 1fr); }
  .steps li { padding: 64px 18px 18px; }
  .steps li::before { top: 18px; left: 18px; }
  .steps li::after { display: none; }
  .steps li:not(:last-child) { box-shadow: inset -.5px 0 0 var(--hairline); }
}
@media (min-width: 1240px) { .large-title { font-size: 56px; } }

/* ------------------------------------------------------------ доступность и «без стекла» */
[data-solid] .tabbar, [data-solid] .toast, [data-solid] .suggest { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--raised); }
[data-solid] .navbar.scrolled { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: var(--bg); }
[data-solid] .fav-btn, [data-solid] .u-plate { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, .42); }
@media (prefers-reduced-transparency: reduce) {
  .tabbar, .toast, .suggest { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--raised); }
  .navbar.scrolled { -webkit-backdrop-filter: none; backdrop-filter: none; background-color: var(--bg); }
  .fav-btn, .u-plate, .craft { -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(0, 0, 0, .5); }
}
@media (prefers-contrast: more) {
  :root { --fill-a: 30%; --hairline: var(--muted); }
  .card, .trust, .group, .steps, .faq, .note { box-shadow: inset 0 0 0 1px var(--hairline); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .lot-steps li.now::before { border-top-color: var(--accent); }
  .card:hover { transform: none; }
}
