/* Gift Sniper Mini App — фиксированная тёмная тема «NFT-люкс / глассморфизм».
   Тема НЕ зависит от --tg-theme-* (setHeaderColor/setBackgroundColor ставятся в app.js).
   Секции: токены → база/выстраданные хаки → компоненты → экраны. */

/* ============ 1. Токены ============ */
:root {
  --bg0: #0b0d14;                      /* фон-база, глубокий сине-чёрный */
  --glass: rgba(19, 23, 37, .82);      /* поверхность «стекла» (без блюра) */
  --glass-brd: rgba(255, 255, 255, .09);
  --text: #eef0f6;
  --hint: #8f96ab;
  --acc: #8b7bfd;                      /* фиолетовый акцент */
  --acc2: #4f8ef7;                     /* синий — только в градиентах */
  --grad-acc: linear-gradient(135deg, #7c5dfa, #4f8ef7);
  --ok: #34d399;
  --danger: #f4595f;
  --warn: #f5b544;
  --gold: #f0ab00;                     /* пилюля автопокупки */
  --mk-mrkt: #3390ec;
  --mk-portals: #8b5cf6;
  --mk-telegram: #2aabee;
  --r-lg: 18px;
  --r-md: 12px;
}

/* ============ 2. База + выстраданные хаки (не трогать!) ============ */
* { box-sizing: border-box; }
/* [hidden] должен побеждать наши display:flex/grid у .row/.statgrid и т.п. — иначе элементы,
   спрятанные атрибутом hidden (инпут бюджета, блок автопокупки, тост), остаются на экране. */
[hidden] { display: none !important; }
/* overflow-x:hidden on the ROOT ONLY. On BOTH html and body it makes EACH a scroll container,
   and Telegram Desktop's webview then swallows mouse-wheel scrolling (touch works, wheel doesn't).
   Keeping it on html alone still clips horizontal overflow; overscroll-behavior kills the mobile
   rubber-band. */
html { overflow-x: hidden; max-width: 100%; overscroll-behavior: none; }
body { max-width: 100%; }
body {
  margin: 0; padding: 0;
  background: var(--bg0); color: var(--text);
  font: 15px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* фон-свечение: fixed-слой под контентом (background-attachment:fixed глючит в iOS-вебвью) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(58% 34% at 50% -6%, rgba(124, 93, 250, .16), transparent 70%),
    radial-gradient(45% 30% at 88% 104%, rgba(79, 142, 247, .10), transparent 70%);
}
img { max-width: 100%; }
#app { max-width: 640px; margin: 0 auto; padding: 12px 12px 92px; width: 100%; }
#view { min-width: 0; }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.22em; flex: none; }
.num { font-variant-numeric: tabular-nums; font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
.muted { color: var(--hint); font-size: 13px; }
.prof-up { color: var(--ok); }
.prof-down { color: var(--danger); }

/* ============ 3. Типографика ============ */
h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; margin: 4px 0 12px; }
h2 {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .09em;
  color: var(--hint); margin: 20px 2px 8px; display: flex; align-items: center; gap: 6px;
}
h2 .icon { width: 13px; height: 13px; }

/* ============ 4. Карточки и раскладка ============ */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--glass-brd); border-radius: var(--r-lg);
  padding: 13px 15px; margin: 8px 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 8px 24px rgba(0, 0, 0, .35);
}
.card.tappable { cursor: pointer; }
.card.tappable:active { opacity: .75; }
.card.error { border-color: rgba(244, 89, 95, .4); background: rgba(64, 22, 28, .55); }
.card.error > b { color: var(--danger); display: flex; gap: 7px; align-items: center; }
.card.error .muted { margin-top: 5px; word-break: break-word; }
.row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.col.r { align-items: flex-end; text-align: right; }
.lbl { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--hint); }
.lbl .icon { width: 15px; height: 15px; }
.stat { display: flex; justify-content: space-between; padding: 3px 0; gap: 8px; }
.stat span { display: flex; align-items: center; gap: 6px; }
.stat b { font-variant-numeric: tabular-nums; }
.empty { text-align: center; color: var(--hint); padding: 24px 0; }
.warn { color: var(--danger); font-size: 13px; margin-top: 6px; }
.row2 { display: flex; gap: 8px; margin: 8px 0; }
.row2 > * { flex: 1; min-width: 0; }

/* ============ 5. Кнопки / инпуты ============ */
button {
  font: inherit; border: 0; border-radius: var(--r-md); padding: 12px 14px; width: 100%;
  background: var(--grad-acc); color: #fff; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 18px rgba(124, 93, 250, .28);
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
button:active { transform: scale(.98); opacity: .9; }
button.sec {
  background: rgba(255, 255, 255, .055); color: var(--text); font-weight: 500;
  border: 1px solid var(--glass-brd); box-shadow: none;
}
button.danger {
  background: transparent; color: var(--danger); font-weight: 500;
  border: 1px solid rgba(244, 89, 95, .4); box-shadow: none;
}
button.mini { width: auto; padding: 8px 14px; font-size: 13px; border-radius: 10px; }
button.iconbtn {
  width: 34px; height: 34px; padding: 0; border-radius: 10px; flex: none;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--glass-brd);
  color: var(--hint); box-shadow: none;
}
.btns { display: flex; gap: 8px; margin: 8px 0; }
.btns button { flex: 1; }
button:focus-visible, input:focus-visible, .chip:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }

input[type=text], input[type=number] {
  width: 100%; padding: 11px 12px; border-radius: var(--r-md); border: 1px solid var(--glass-brd);
  background: rgba(255, 255, 255, .04); color: var(--text); font: inherit;
  font-size: 16px;  /* >=16px or iOS zooms in on focus (the "search zooms & breaks" bug) */
  outline: none;
}
input[type=text]:focus, input[type=number]:focus { border-color: var(--acc); }
label.field { display: block; margin: 14px 2px 6px; font-size: 13px; color: var(--hint); }

/* ============ 6. Тумблеры / чипы / пилюли / статусы / прогресс ============ */
.toggle { display: flex; align-items: center; justify-content: space-between; margin: 2px 0; }
.toggle > span { display: flex; align-items: center; gap: 8px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; inset: 0; background: rgba(255, 255, 255, .12); border-radius: 999px; transition: .15s; }
.slider::before {
  content: ""; position: absolute; height: 22px; width: 22px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .15s;
}
.switch input:checked + .slider { background: var(--grad-acc); }
.switch input:checked + .slider::before { transform: translateX(18px); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; max-height: 190px; overflow: auto; }
.chip {
  padding: 6px 10px; border-radius: 16px; background: rgba(255, 255, 255, .05); color: var(--text);
  font-size: 13px; cursor: pointer; border: 1px solid var(--glass-brd); user-select: none;
}
.chip.on { background: var(--grad-acc); color: #fff; border-color: transparent; }
.chips.big { max-height: none; gap: 8px; }
.chips.big .chip { padding: 9px 13px; font-size: 14px; }

.pill {
  font-size: 12px; padding: 3px 9px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.pill .icon { width: 12px; height: 12px; }
.pill.on { background: rgba(139, 123, 253, .16); color: #b3a7ff; }
.pill.off { background: rgba(143, 150, 171, .14); color: var(--hint); }
.pill.buy { background: rgba(240, 171, 0, .15); color: var(--gold); }
.pill.sold { background: rgba(52, 211, 153, .14); color: var(--ok); }
.pills { display: flex; gap: 5px; flex: none; }
.pills.wrap { flex-wrap: wrap; margin: 6px 0; }
.chev { color: var(--hint); flex: none; }
.icon.chev { width: 17px; height: 17px; }

.statuschip {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  padding: 5px 11px; border-radius: 999px; border: 1px solid;
}
.statuschip i { width: 8px; height: 8px; border-radius: 50%; }
.statuschip.live { color: var(--ok); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.statuschip.live i { background: var(--ok); animation: pulse 2s ease-out infinite; }
.statuschip.stale { color: var(--warn); border-color: rgba(245, 181, 68, .35); background: rgba(245, 181, 68, .08); }
.statuschip.stale i { background: var(--warn); }
.statuschip.err { color: var(--danger); border-color: rgba(244, 89, 95, .4); background: rgba(244, 89, 95, .08); }
.statuschip.err i { background: var(--danger); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, .5); }
  70% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.progress { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: 10px 0 8px; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--grad-acc); }
.progress.green i { background: var(--ok); }

/* ============ 7. Хром: таббар / бэкбар / прибитый Save / тост ============ */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; justify-content: space-around;
  background: rgba(11, 13, 20, .82); border-top: 1px solid rgba(255, 255, 255, .07);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
#tabbar button {
  all: unset; cursor: pointer; flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--hint); padding: 4px 0; border-radius: 12px;
}
#tabbar button .ic { line-height: 0; }
#tabbar button .ic .icon { width: 21px; height: 21px; }
#tabbar button .lbl { font-size: 10.5px; }
#tabbar button.active { color: var(--acc); }
#tabbar button.active .ic .icon { filter: drop-shadow(0 0 7px rgba(139, 123, 253, .6)); }

/* in-page back button (Telegram Desktop has no native BackButton) — pinned at the top so it
   stays reachable while scrolling. Uses position:fixed (NOT sticky): our html/body has
   overflow-x:hidden, which breaks position:sticky, but fixed works — same as the tab bar and
   the Save button. #view gets top padding (body.has-back) so content clears the fixed bar. */
.backbar {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 15;
  width: 100%; max-width: 640px; background: rgba(11, 13, 20, .88); color: var(--acc);
  border: 0; border-bottom: 1px solid var(--glass-brd); border-radius: 0;
  padding: 12px; font-size: 15px; font-weight: 500; text-align: left;
  justify-content: flex-start; box-shadow: 0 5px 14px -4px rgba(0, 0, 0, .55);
}
/* ОБЯЗАТЕЛЬНО: у backbar/sticky свой :active-transform. Глобальный `button:active{transform:scale(.98)}`
   специфичнее их `.backbar{transform:translateX(-50%)}` и на mousedown сбрасывал центрирование —
   кнопка прыгала на пол-экрана, mouseup уходил мимо и КЛИК НЕ ЗАСЧИТЫВАЛСЯ (поймано тестом). */
.backbar:active { transform: translateX(-50%) scale(.99); }
body.has-back #view { padding-top: 48px; }

/* pinned Save — fixed above the tab bar so you never scroll to the bottom to save.
   (position:sticky on the LAST child does nothing — sticky only floats while more of
   the container is below it, and there is nothing below the button.) */
button.sticky {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: calc(100% - 24px); max-width: 616px; z-index: 15; margin: 0;
  box-shadow: 0 4px 18px rgba(124, 93, 250, .35), 0 0 24px 12px rgba(11, 13, 20, .8);
}
button.sticky:active { transform: translateX(-50%) scale(.99); }
/* reserve scroll space so the last row isn't hidden behind the fixed Save button */
.save-spacer { height: 64px; }

/* честный blur — ТОЛЬКО на трёх fixed-слоях; обычным .card блюр не давать никогда
   (на длинных списках он убивает скролл в вебвью) */
@supports (backdrop-filter: blur(4px)) {
  #tabbar { backdrop-filter: blur(14px); background: rgba(11, 13, 20, .62); }
  .backbar { backdrop-filter: blur(14px); background: rgba(11, 13, 20, .7); }
}

.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(11, 13, 20, .92); color: #fff; border: 1px solid var(--glass-brd);
  padding: 10px 16px; border-radius: var(--r-md); z-index: 30;
  max-width: 90%; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
}

/* ============ 8. Дашборд ============ */
.brandrow { display: flex; align-items: center; gap: 10px; margin: 2px 0 4px; }
.brandmark {
  width: 38px; height: 38px; border-radius: 13px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(139, 123, 253, .12); border: 1px solid rgba(139, 123, 253, .3);
  color: var(--acc);
}
.brandmark .icon { width: 21px; height: 21px; }
.brandname {
  font-size: 21px; font-weight: 800; letter-spacing: -.02em; margin-right: auto;
  color: var(--text); /* solid-фолбэк обязателен: без него старый вебвью покажет пустоту */
  background: var(--grad-acc); -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.pollago { margin: 0 2px 14px; display: flex; align-items: center; gap: 6px; }
.pollago .icon { width: 13px; height: 13px; }

.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.statgrid .card { margin: 0; }
.statgrid b.num { display: block; font-size: 19px; margin-top: 8px; font-weight: 700; }
.statgrid .muted { margin-top: 2px; display: block; }

.balrow { display: flex; gap: 8px; margin-top: 10px; }
.bal { flex: 1; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 0; }
.bal b { font-size: 14px; white-space: nowrap; }
.bal.off b { color: var(--hint); font-weight: 500; }

.feedcard { padding: 4px 15px; }
.feed-row {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.feed-row:last-child { border-bottom: 0; }
.feed-row .col { flex: 1; }
.feed-row b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.fi .icon { width: 17px; height: 17px; }
.fi-alert { background: rgba(139, 123, 253, .13); color: #b3a7ff; }
.fi-buy { background: rgba(52, 211, 153, .12); color: var(--ok); }
.fi-fail { background: rgba(244, 89, 95, .12); color: var(--danger); }

/* ============ 9. Подписки (билдер + список) ============ */
.nftsel { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.nftsel-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.nftsel-l b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nftsel-r { display: flex; align-items: center; gap: 6px; color: var(--hint); font-size: 13px; flex: none; }
.collfloor { margin-left: auto; color: var(--hint); font-size: 12px; flex: none; }

.fbtn {
  background: rgba(255, 255, 255, .055); color: var(--text); border: 1px solid var(--glass-brd);
  border-radius: var(--r-md); padding: 11px 12px; font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; width: 100%; box-shadow: none;
  display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fbtn > .icon:first-child { color: var(--acc); width: 16px; height: 16px; }
.fbtn .chev { margin-left: auto; }
.fbtn.full { margin: 4px 0 0; }
.filters { margin-top: 8px; }
.subrow .muted { display: flex; align-items: center; gap: 5px; margin-top: 4px; flex-wrap: wrap; }
.subrow .muted .icon { width: 13px; height: 13px; flex: none; }

/* строки коллекций в поиске NFT */
.collrow { display: flex; align-items: center; gap: 12px; }
.collimg {
  width: 40px; height: 40px; flex: none; object-fit: contain; border-radius: 10px;
  background: rgba(255, 255, 255, .05); display: flex; align-items: center; justify-content: center;
}
.collimg.noimg { background: radial-gradient(circle at 32% 28%, #5b4f9e, #2b2450); color: rgba(255, 255, 255, .75); }
.collimg.noimg .icon { width: 19px; height: 19px; }
.collname { font-weight: 600; }
.searchbox { position: relative; margin: 10px 0 4px; }
.searchbox .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--hint); pointer-events: none; }
.searchbox input { padding-left: 38px; }

/* menu rows (редактирование подписки) */
.menu-row { display: flex; align-items: center; justify-content: space-between; }
.menu-row .col span:first-child { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.menu-row .col span:first-child .icon { color: var(--acc); width: 16px; height: 16px; }

/* ============ 10. Модели ============ */
.rgroup { margin-top: 14px; }
.rghead { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.rghead b { font-size: 14px; }
.selall { color: var(--acc); font-size: 13px; cursor: pointer; }
.modelgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px; margin-top: 10px;
}
.modelchip {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 6px; border-radius: 14px; cursor: pointer; text-align: center; user-select: none;
  background: var(--glass); border: 1px solid var(--glass-brd);
}
.modelchip.on { border-color: var(--acc); background: rgba(124, 93, 250, .13); }
.modelchip.on::after {
  content: "✓"; position: absolute; top: -6px; right: -5px; z-index: 1;
  width: 19px; height: 19px; border-radius: 50%;
  background: var(--grad-acc); color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.modelimg {
  width: 46px; height: 46px; object-fit: contain; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .04);
}
.modelimg.noimg { background: radial-gradient(circle at 32% 28%, #5b4f9e, #2b2450); color: rgba(255, 255, 255, .75); }
.modelimg.noimg .icon { width: 22px; height: 22px; }
.modelname { font-size: 12px; line-height: 1.15; color: var(--text); word-break: break-word; }
.modelname .rar { color: var(--hint); }
.modelprice { font-size: 12px; font-weight: 700; color: var(--ok); }
.mpper { font-size: 9px; color: var(--hint); line-height: 1.3; }
.mprices { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.mprow { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text); }
.mprow.none { color: var(--hint); }
.mprow b { font-variant-numeric: tabular-nums; }
.mprow .sup { color: var(--hint); }
.cbadge {
  position: absolute; top: 2px; left: 4px; z-index: 1; min-width: 16px; text-align: center;
  background: rgba(52, 211, 153, .9); color: #fff; font-size: 10px; font-weight: 700; border-radius: 9px; padding: 0 4px;
}

/* ============ 11. Номер / паттерн ============ */
.ncats { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.ncat {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--glass); border: 1px solid var(--glass-brd);
  border-radius: var(--r-md); padding: 12px 14px; cursor: pointer;
}
.ncat > span { display: flex; align-items: center; gap: 9px; }
.ncat > span .icon { color: var(--acc); width: 16px; height: 16px; }
.ncat input { width: 20px; height: 20px; flex: none; accent-color: #7c5dfa; }
.ncat-all { border-color: rgba(139, 123, 253, .45); }

/* ============ 12. Живые цены (лоты) ============ */
.lotgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; margin-top: 10px; }
.lot {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: var(--glass); border: 1px solid var(--glass-brd);
  border-radius: 14px; padding: 8px 6px; text-align: center; min-width: 0;
}
.lot .mkbadge { position: absolute; top: 4px; left: 4px; }
.lotimg {
  width: 56px; height: 56px; object-fit: contain; border-radius: 10px; margin-top: 10px;
  display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .04);
}
.lotimg.noimg { color: rgba(255, 255, 255, .75); }
.lotimg.noimg .icon { width: 26px; height: 26px; }
.lotnum { font-size: 11px; color: var(--hint); }
.lotprice { font-size: 13px; font-weight: 700; color: var(--ok); }
.lotstars { font-size: 10px; color: var(--hint); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.lotstars .icon { width: 10px; height: 10px; color: var(--gold); }
.mkbadge {
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 6px; line-height: 1.4;
  color: #fff; letter-spacing: .4px;
}
.mk-mrkt { background: var(--mk-mrkt); }
.mk-portals { background: var(--mk-portals); }
.mk-telegram { background: var(--mk-telegram); }

/* Выбор маркетов для автопокупки: галочка + бейдж маркета + его собственный баланс */
.mkpick { display: flex; flex-direction: column; gap: 6px; margin: 6px 0 2px; }
.mkrow {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--glass-brd);
  border-radius: var(--r-md); cursor: pointer;
}
.mkrow input { width: 18px; height: 18px; accent-color: var(--acc); flex: none; }
.mkrow .num { margin-left: auto; }

/* ============ 13. Фоны (свотчи из реальных цветов) ============ */
.swatches { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.ghead { margin: 18px 2px 4px; font-size: 14px; font-weight: 600; }
.ghead .muted { font-weight: 400; font-size: 12px; }
.swatch-pct {
  position: absolute; top: 4px; left: 6px; font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(0, 0, 0, .42); padding: 1px 5px; border-radius: 999px; line-height: 1.4;
}
h1.tc { text-align: center; }
.selchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 2px 0; }
.selchip {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px 3px 3px;
  border-radius: 999px; background: rgba(128, 128, 128, .16);
}
.selchip img, .selchip .seldot {
  width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
}
.selchip .seldot.noimg { display: inline-flex; align-items: center; justify-content: center; }
.swatch {
  position: relative; min-width: 96px; height: 60px; border-radius: 14px; cursor: pointer;
  display: flex; align-items: flex-end; padding: 6px 8px; outline: 2px solid transparent;
  flex: 1 1 96px; max-width: 140px; border: 1px solid var(--glass-brd);
}
.swatch .swatch-label {
  font-size: 12px; color: #fff; font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .75); line-height: 1.15;
}
.swatch.on { outline-color: #fff; box-shadow: 0 0 0 2px var(--acc); }
/* monochrome preview: the model image composited on the backdrop colour */
.swatch.monotile { height: 104px; align-items: flex-end; padding: 0 8px 6px; }
.swatch.monotile .monogift {
  position: absolute; top: 6px; left: 0; right: 0; margin: 0 auto; z-index: 1;
  height: 70px; width: auto; max-width: 88%; object-fit: contain; pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .35));
}
.swatch.monotile .swatch-label, .swatch.monotile .swatch-pct { z-index: 2; }
.swatch.on::after {
  content: "✓"; position: absolute; top: 4px; right: 6px; color: #fff; font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
}

/* ============ 14. Подарки / История: карточки с цепочкой ============ */
.sechead { display: flex; align-items: center; gap: 8px; margin: 18px 2px 6px; }
.sechead .muted { margin-right: auto; }
.vaultl { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vaultl .col { min-width: 0; }
.vaultl .col b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vaultrow { padding: 11px 13px; }
.vaultrow .collimg { width: 34px; height: 34px; border-radius: 10px; }
.vaultrow .row b { font-size: 14px; }
.vaultrow .pill { font-size: 11px; padding: 2px 8px; }
.tl {
  margin: 9px 0 0 6px; padding-left: 13px; display: flex; flex-direction: column; gap: 5px;
  border-left: 2px solid rgba(255, 255, 255, .09);
}
.tl .trow { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--hint); }
.tl .trow .icon { width: 13px; height: 13px; flex: none; }
.tl .trow > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl .trow b { margin-left: auto; font-size: 12.5px; flex: none; }
.tl .trow.total { color: var(--text); }
.acts { display: flex; gap: 6px; margin-top: 9px; }
.acts button { flex: 1; padding: 7px 6px; font-size: 12px; border-radius: 10px; gap: 5px; }
.acts button .icon { width: 13px; height: 13px; }
.listform { margin-top: 10px; }
.listform .field { margin-top: 0; }
.listform #lphint { margin: 6px 0; }

/* ============ 15. Доступность / движение ============ */
/* respect users who asked the OS to reduce motion (пульс LIVE тоже гаснет) */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
