/* ==========================================================================
   «ПОИСК ТЕХНИКИ» — оформление

   Мягкий рельеф, тот же, что у бухгалтерии: кнопки и карточки выдавлены
   из поверхности, поля и желобки вдавлены в неё, нажатие вдавливает
   кнопку. Цвета прежние — кость на тёплой темноте или уголь на небеленой
   бумаге, янтарь только там, где нужно привлечь внимание.

   Рельеф держится на двух тенях: светлой сверху-слева и тёмной
   снизу-справа. На чистом чёрном тёмной тени деваться некуда, поэтому
   тёмная тема — не #000, а тёплая темнота на ступень светлее.

   Названия классов остались от прежнего оформления: на них опираются
   скрипты страниц, менялся только внешний вид.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg:      #171612;
  --sh-hi:   #24221d;   /* свет — сверху слева */
  --sh-lo:   #080706;   /* тень — снизу справа */

  --ink:     #ece3d0;   /* кость — вместо белого */
  --ink-dim: #a39b88;
  --ink-far: #857d6b;
  --line:    rgba(236, 227, 208, .08);

  /* Единственный яркий акцент — янтарь */
  --amber:   #f2b33d;

  /* Красный говорит ровно одно: неизвестно, где стоит техника */
  --nogeo:   #d0614c;

  /* Вердикты различаются больше формой метки, чем цветом */
  --match:   #ece3d0;
  --better:  #9ec7d8;
  --near:    #d2b073;

  --fill-a:  #ece3d0;
  --fill-b:  #8c8471;


  --tap:  48px;
  --like: 44px;   /* сердечко в углу карточки — название обрывается до него */

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);

  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas,
          "Liberation Mono", monospace;
}

/* --------------------------------------------------------------------------
   Светлая тема — тот же рельеф на бумаге. Меняются только переменные.
   -------------------------------------------------------------------------- */

:root[data-theme="light"] {
  color-scheme: light;

  --bg:      #ebe7dc;   /* бумага на тон темнее, чтобы белому свету было куда лечь */
  --sh-hi:   #fffdf7;
  --sh-lo:   #c9c2b0;

  --ink:     #1c1a16;   /* уголь */
  --ink-dim: #665f53;
  --ink-far: #7a7366;
  --line:    rgba(28, 26, 22, .09);

  --amber:   #a06a12;   /* янтарь на бумаге слепит — берём охристый */
  --nogeo:   #b23a2b;

  --match:   #1c1a16;
  --better:  #2a6580;
  --near:    #8a6614;

  --fill-a:  #2b2822;
  --fill-b:  #7a7366;
}

/* --------------------------------------------------------------------------
   Рельеф как ткань, натянутая на форму

   Все тени умножаются на --rel — «высоту рельефа»: 1 — обычная, 0 —
   ровная поверхность. Анимируя --rel, кнопки и поля выдавливаются из
   фона или вдавливаются в него, а уходя со страницы — разглаживаются
   обратно. Объявлено на каждом элементе, чтобы блок со своей --rel
   поднимал или опускал всё, что внутри.
   -------------------------------------------------------------------------- */

@property --rel { syntax: '<number>'; inherits: true; initial-value: 1; }

*, *::before, *::after {
  --raise:    calc(6px * var(--rel)) calc(6px * var(--rel)) calc(14px * var(--rel)) var(--sh-lo),
              calc(-6px * var(--rel)) calc(-6px * var(--rel)) calc(14px * var(--rel)) var(--sh-hi);
  --raise-sm: calc(3px * var(--rel)) calc(3px * var(--rel)) calc(7px * var(--rel)) var(--sh-lo),
              calc(-3px * var(--rel)) calc(-3px * var(--rel)) calc(7px * var(--rel)) var(--sh-hi);
  --raise-lg: calc(14px * var(--rel)) calc(14px * var(--rel)) calc(30px * var(--rel)) var(--sh-lo),
              calc(-12px * var(--rel)) calc(-12px * var(--rel)) calc(28px * var(--rel)) var(--sh-hi);
  --press:    inset calc(4px * var(--rel)) calc(4px * var(--rel)) calc(9px * var(--rel)) var(--sh-lo),
              inset calc(-4px * var(--rel)) calc(-4px * var(--rel)) calc(9px * var(--rel)) var(--sh-hi);
  --press-sm: inset calc(2px * var(--rel)) calc(2px * var(--rel)) calc(5px * var(--rel)) var(--sh-lo),
              inset calc(-2px * var(--rel)) calc(-2px * var(--rel)) calc(5px * var(--rel)) var(--sh-hi);
}

/* Появление: из ровного фона проступают формы, ткань чуть перетягивается
   и садится на место */
@keyframes vydavit {
  0%   { --rel: 0; opacity: 0; }
  30%  { opacity: 1; }
  68%  { --rel: 1.16; }
  100% { --rel: 1; opacity: 1; }
}
/* Уход: формы разглаживаются обратно в фон */
@keyframes razgladit {
  0%   { --rel: 1; opacity: 1; }
  70%  { opacity: .55; }
  100% { --rel: 0; opacity: 0; }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  background: var(--bg);
  overscroll-behavior-y: none;   /* при оттягивании списка не проглядывает серое */
}

body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: tabular-nums;
  overscroll-behavior-y: contain;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--bg); }
[hidden] { display: none !important; }

/* Мелкие подписи над полями и разделами — моноширинным, как прежде */
.lbl, .label, .section > h2, .group-title, .field > label, .fact .k,
.dayline .d, .tbl th, .state {
  font-family: var(--mono);
}

/* --------------------------------------------------------------------------
   Движение: мягко и коротко
   -------------------------------------------------------------------------- */

@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes shine { from { background-position: -200% 0; }
                   to   { background-position: 200% 0; } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes nudge { 0%, 100% { transform: translateY(0); }
                   50%      { transform: translateY(3px); } }

.anim {
  animation: vydavit .6s cubic-bezier(.25, .8, .3, 1) both;
  animation-delay: var(--d, 0ms);
}

/* --------------------------------------------------------------------------
   Каркас
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   Каркас как у приложения: окно не прокручивается, прокручивается только
   область с содержимым, а меню снизу стоит на месте. Раньше двигалось всё
   окно, и на айфоне, открытом с экрана «Домой», меню могло уезжать вместе
   со страницей и пружинить при оттягивании.
   -------------------------------------------------------------------------- */

html { height: 100%; }      /* без этого «высота 100 %» у тела ни от чего не считается */
html:has(body.shell) { overflow: hidden; }
body.shell { height: 100%; overflow: hidden; position: relative; }

.app {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(104px + var(--safe-bottom));
}
body.shell .app {
  height: 100%; min-height: 0;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.topbar {
  position: sticky; top: 0; z-index: 40;
  padding: calc(14px + var(--safe-top)) calc(20px + var(--safe-right))
           12px calc(20px + var(--safe-left));
  background: var(--bg);
}
.topbar .row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.topbar .row > div:first-child { min-width: 0; flex: 1; }
.topbar h1 {
  margin: 0; font-size: 26px; font-weight: 500; letter-spacing: -.01em;
  line-height: 1.15; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .sub {
  color: var(--ink-dim); font-size: 14px; margin-top: 3px;
}
.topbar .sub:empty { display: none; }

.wrap {
  padding: 14px calc(20px + var(--safe-right)) 24px calc(20px + var(--safe-left));
  max-width: 880px; margin: 0 auto;
}
/* --------------------------------------------------------------------------
   Появление и уход страницы — «ткань на форме»

   Голова страницы ещё до отрисовки ставит на <html> класс .poyavlenie
   (через полторы секунды app.js его снимает). Пока он стоит, блоки
   выдавливаются из ровного фона по очереди — это делает оформление само,
   поэтому большая страница не успевает мелькнуть готовой до анимации.
   Уходя (body.leaving), блоки разглаживаются обратно.

   На время этих движений маленькие переходы теней у кнопок и карточек
   выключены: иначе каждая из сотен карточек каждый кадр запускала бы
   свою анимацию тени, и всё дёргалось.
   -------------------------------------------------------------------------- */

.poyavlenie .wrap *, .poyavlenie .topbar *, .poyavlenie .tabbar *,
body.leaving *, .v-dvizhenii, .v-dvizhenii *, .tiho-vnutri * { transition: none !important; }
@keyframes gasnet { to { opacity: 0; } }

/* Смена раздела «Поиск ↔ Бухгалтерия»: плашка меню той же формы стоит на
   месте, а пункты в ней утопают и выдавливаются новые; шапка — так же */
@keyframes vypuklost {
  0%   { --rel: 0; opacity: 0; transform: scale(.82); }
  45%  { opacity: 1; }
  70%  { --rel: 1.2; transform: scale(1.06); }
  100% { --rel: 1; opacity: 1; transform: none; }
}

.poyavlenie .wrap > * { animation: vydavit .6s cubic-bezier(.25, .8, .3, 1) both; }
.poyavlenie .wrap >:nth-child(2) { animation-delay: 60ms; }
.poyavlenie .wrap >:nth-child(3) { animation-delay: 120ms; }
.poyavlenie .wrap >:nth-child(4) { animation-delay: 180ms; }
.poyavlenie .wrap >:nth-child(5) { animation-delay: 240ms; }
.poyavlenie .wrap >:nth-child(6) { animation-delay: 300ms; }
.poyavlenie .wrap >:nth-child(7) { animation-delay: 360ms; }
.poyavlenie .wrap >:nth-child(8) { animation-delay: 420ms; }
.poyavlenie .wrap >:nth-child(9) { animation-delay: 480ms; }
.poyavlenie .wrap >:nth-child(10) { animation-delay: 540ms; }
/* длинные ленты: дальше десятого блока — уже за краем экрана, их не трогаем */
.poyavlenie .wrap > :nth-child(n+11) { animation: none; }
/* список «Поиска» целиком не анимируем — 300 карточек; выдавливаются первые,
   что видно на экране, каскадом */
.poyavlenie .wrap > #list { animation: none; }
.poyavlenie #list > section:first-of-type > h2,
.poyavlenie #list > .empty { animation: vydavit .6s cubic-bezier(.25, .8, .3, 1) .2s both; }
.poyavlenie #list > section:first-of-type > .item:nth-of-type(-n+6) {
  animation: vydavit .6s cubic-bezier(.25, .8, .3, 1) both;
}
.poyavlenie #list > section:first-of-type > .item:nth-of-type(1) { animation-delay: 260ms; }
.poyavlenie #list > section:first-of-type > .item:nth-of-type(2) { animation-delay: 320ms; }
.poyavlenie #list > section:first-of-type > .item:nth-of-type(3) { animation-delay: 380ms; }
.poyavlenie #list > section:first-of-type > .item:nth-of-type(4) { animation-delay: 440ms; }
.poyavlenie #list > section:first-of-type > .item:nth-of-type(5) { animation-delay: 500ms; }
.poyavlenie #list > section:first-of-type > .item:nth-of-type(6) { animation-delay: 560ms; }

body.leaving .wrap > :not(#list) { animation: razgladit .26s ease-in forwards; }
body.leaving .wrap > #list { animation: gasnet .26s ease-in forwards; }
body.leaving #list .vidno { animation: razgladit .26s ease-in forwards; }

/* смена раздела: шапка и пункты меню */
body.smena-uhod .topbar .row, body.smena-uhod .tabbar > * { animation: razgladit .26s ease-in forwards; }
.smena-razdela .topbar .row { animation: vydavit .55s cubic-bezier(.25, .8, .3, 1) both; }
.smena-razdela .tabbar > * { animation: vypuklost .55s cubic-bezier(.25, .8, .3, 1) both; }
.smena-razdela .tabbar >:nth-child(2) { animation-delay: 45ms; }
.smena-razdela .tabbar >:nth-child(3) { animation-delay: 90ms; }
.smena-razdela .tabbar >:nth-child(4) { animation-delay: 135ms; }
.smena-razdela .tabbar >:nth-child(5) { animation-delay: 180ms; }
.smena-razdela .tabbar >:nth-child(6) { animation-delay: 225ms; }

/* --------------------------------------------------------------------------
   Состояние бота в шапке
   -------------------------------------------------------------------------- */

.state {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 34px; padding: 0 13px 0 calc(13px + .08em); border-radius: 999px;
  font-size: 11.5px; font-weight: 600; color: var(--ink-dim);
  /* отступ слева больше на величину разрядки: она добавляет место и после
     последней буквы, и без этого слово сидело бы левее середины */
  text-transform: uppercase; letter-spacing: .08em; white-space: nowrap;
  box-shadow: var(--press-sm);
}
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-far); }
.dot.on   { background: var(--amber); animation: pulse 2.4s ease-in-out infinite; }
.dot.warn { background: var(--near); }
.dot.off  { background: var(--ink-far); }

/* --------------------------------------------------------------------------
   Крупные счётчики
   -------------------------------------------------------------------------- */

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.stats.two { grid-template-columns: repeat(2, 1fr); }
.stat {
  padding: 16px 14px 14px; min-width: 0; border-radius: 22px;
  background: var(--bg); box-shadow: var(--raise);
}
.stat .num {
  font-size: 30px; font-weight: 300; letter-spacing: -.02em; line-height: 1.05;
}
.stat .lbl {
  margin-top: 6px; font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-dim);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.stat.match  .num { color: var(--match); }
.stat.better .num { color: var(--better); }
.stat.near   .num { color: var(--near); }

/* --------------------------------------------------------------------------
   Кнопки
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 12px; width: 100%;
  border: 0; border-radius: 17px;
  background: var(--bg); color: var(--ink);
  font-size: 15px; font-weight: 500; line-height: 1.2; text-align: center;
  box-shadow: var(--raise);
  transition: box-shadow .18s ease, color .18s ease, transform .18s ease;
}
.btn:hover { color: var(--amber); transform: translateY(-1px); }
.btn:active { box-shadow: var(--press); transform: none; }
.btn:disabled { color: var(--ink-far); box-shadow: var(--raise-sm); cursor: default; transform: none; }

.btn.primary { color: var(--amber); font-weight: 600; }
.btn.ghost  { box-shadow: none; }
.btn.ghost:hover { box-shadow: var(--raise-sm); }
.btn.ghost:active { box-shadow: var(--press-sm); }
.btn.danger { color: var(--nogeo); }

.btn-row { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 24px; }
.btn-row.two   { grid-template-columns: 1fr 1fr; }
.btn-row.three { grid-template-columns: 1.2fr 1fr 1fr; }

/* --------------------------------------------------------------------------
   Разделы
   -------------------------------------------------------------------------- */

.section { margin-bottom: 30px; }
.section > h2, .group-title {
  display: flex; align-items: center; gap: 10px;
  margin: 0 4px 14px; font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .16em; color: var(--ink-dim);
}
.section > h2::before, .group-title::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--amber); flex: none;
}
.section > h2 .count {
  margin-left: auto; color: var(--ink-far); letter-spacing: 0;
}
.group-title { margin-top: 34px; }

/* --------------------------------------------------------------------------
   Карточка объявления
   -------------------------------------------------------------------------- */

.item {
  position: relative;
  display: flex; gap: 14px; padding: 14px;
  background: var(--bg); border-radius: 24px;
  box-shadow: var(--raise);
  margin-bottom: 16px;
  content-visibility: auto; contain-intrinsic-size: auto 132px;
  transition: box-shadow .18s ease;
}
.item:active { box-shadow: var(--press); }

/* По всей площади карточки лежит невидимая ссылка на объявление,
   а кнопки «Авито», «Дром» и сердечко — поверх неё */
.item .item-link { position: absolute; inset: 0; z-index: 0; border-radius: inherit; }
.item .thumb-box, .item .body { position: relative; z-index: 1; pointer-events: none; }
.item .origins { pointer-events: auto; }

.item .thumb-box {
  overflow: hidden; flex: none;
  width: 96px; height: 72px; border-radius: 16px;
  background: var(--bg); box-shadow: var(--press-sm);
}
.item .thumb-box img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  opacity: 0; transition: opacity .3s ease;
}
.item .thumb-box img.ready { opacity: 1; }
.item .thumb-box .none {
  position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; text-align: center;
  font-size: 12px; color: var(--ink-far); padding: 4px;
}
/* Пока фото грузится — по нему пробегает блик */
.item .thumb-box.skeleton::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, var(--line) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shine 1.4s linear infinite;
}

.item .body { min-width: 0; flex: 1; }
.item .name {
  font-weight: 600; font-size: 15.5px; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  /* место под сердечко в правом верхнем углу карточки */
  padding-right: calc(var(--like) - 14px + 6px);
}
.item .price {
  margin-top: 4px; font-size: 20px; font-weight: 500; letter-spacing: -.01em;
  display: inline-block;
}
/* Скидка: новая цена и перечёркнутая прежняя рядом */
.item .price s {
  font-size: 13.5px; font-weight: 400; color: var(--ink-far); margin-left: 8px;
}
.item .facts {
  margin-top: 4px; font-size: 13.5px; color: var(--ink-dim);
  display: flex; flex-wrap: wrap; gap: 2px 12px;
}
.item .why  { margin-top: 8px; font-size: 13.5px; color: var(--near); line-height: 1.45; }
.item .plus { margin-top: 8px; font-size: 13.5px; color: var(--better); line-height: 1.45; }
/* Приписка площадки — не больше одной строки, иначе карточка пухнет */
.item .note {
  margin-top: 8px; font-size: 12.5px; color: var(--ink-far);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.item .meta {
  margin-top: 10px; display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
}

/* Метки различаются формой: подходит — залитая, дешевле — вдавленная,
   почти — пунктиром. Так видно даже краем глаза. */
.chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1;
}
.chip.match  { background: var(--ink); color: var(--bg); }
.chip.better { box-shadow: var(--press-sm); color: var(--better); }
.chip.near   { border-style: dashed; border-color: var(--near); color: var(--near); }
.chip.new    { background: var(--amber); color: var(--bg); }
.chip.src    { box-shadow: var(--press-sm); color: var(--ink-dim); font-weight: 500; }
.chip.sale   { background: var(--better); color: var(--bg); }
.chip.time   { box-shadow: var(--raise-sm); color: var(--ink); }
.chip.gone   { box-shadow: var(--press-sm); color: var(--ink-far); }
/* Метки из одних строчных букв («подходит», «дешевле», «почти», «новое»).
   Браузер ставит строку по середине полной высоты шрифта — с запасом под
   прописные, и строчные буквы оседали на 2 пикселя ниже середины.
   Приподнимаем их; у меток с прописными («ВТБ Лизинг») этого запаса нет. */
.chip.match, .chip.better, .chip.near, .chip.new, .chip.gone { padding-bottom: 3px; }

/* Первоисточник объявления: Авито, Дром */
.origins { display: flex; gap: 10px; margin-top: 12px; }
.origins a {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px; border-radius: 13px;
  background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 600;
  box-shadow: var(--raise-sm);
  transition: box-shadow .18s ease, color .18s ease;
}
.origins a:hover { color: var(--amber); }
.origins a:active { box-shadow: var(--press-sm); }

/* Место неизвестно: вердикт обычный, но съездить посмотреть, возможно,
   придётся дальше, чем кажется — поэтому пунктирная красная рамка */
.item.nogeo { outline: 1.5px dashed var(--nogeo); outline-offset: -6px; }
.item .nogeo-note { color: var(--nogeo); }

/* Снятое с продажи, но отложенное — не выкидываем молча */
.item.gone { opacity: .6; }

/* Сердечко лежит поверх ссылки на объявление — ему нужен свой слой */
.item .like {
  position: absolute; top: 2px; right: 2px; z-index: 2; pointer-events: auto;
  display: flex; align-items: center; justify-content: center;
  width: var(--like); height: var(--like); padding: 0;
  background: none; border: 0; border-radius: 50%;
  color: var(--ink-far);
  transition: color .18s ease, transform .12s ease;
}
.item .like svg { width: 20px; height: 20px; fill: none; }
.item .like:hover { color: var(--ink-dim); }
.item .like.on { color: var(--nogeo); }
.item .like.on svg { fill: currentColor; }
.item .like:active { transform: scale(.88); }

/* --------------------------------------------------------------------------
   Вкладки-фильтры над списком
   -------------------------------------------------------------------------- */

.tabs {
  display: flex; gap: 10px;
  margin: -8px -20px 14px; padding: 8px 20px 14px;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 40px; padding: 0 16px;
  display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--bg);
  font-size: 14.5px; font-weight: 500; color: var(--ink-dim); white-space: nowrap;
  box-shadow: var(--raise-sm);
  transition: box-shadow .18s ease, color .18s ease;
  cursor: pointer; user-select: none;
}
.tab:hover { color: var(--ink); }
.tab.active { box-shadow: var(--press-sm); color: var(--amber); font-weight: 600; }

#list { transition: opacity .16s ease; }
#list.swap { opacity: 0; }

/* --------------------------------------------------------------------------
   Карточки и формы
   -------------------------------------------------------------------------- */

.card {
  position: relative;
  padding: 20px; margin-bottom: 20px; border-radius: 26px;
  background: var(--bg); box-shadow: var(--raise);
}
.card h2, .card h3 {
  margin: 0 0 8px; font-size: 20px; font-weight: 600; letter-spacing: -.005em;
}
.card .hint { color: var(--ink-dim); font-size: 14.5px; margin: 0 0 16px; line-height: 1.5; }
.hint { font-size: 14.5px; color: var(--ink-dim); line-height: 1.5; }

.head-row {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; margin-bottom: 8px;
}
.head-row h2, .head-row h3 { margin: 0; }

.field { margin-bottom: 18px; }
.field > label {
  display: block; margin: 0 0 9px 4px;
  font-size: 11.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-dim);
}
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

input[type=text], input[type=password], input[type=number] {
  width: 100%; height: 50px; padding: 0 16px;
  border: 0; border-radius: 16px; background: var(--bg); color: var(--ink);
  font-size: 16px;                     /* меньше 16 — айфон зумит страницу */
  box-shadow: var(--press);
}
input::placeholder { color: var(--ink-far); }
input:focus { outline: none; box-shadow: var(--press), 0 0 0 2px var(--amber); }

/* Вход в бухгалтерию из «Ещё» — вся карточка нажимается */
a.card.buh-vhod { display: block; transition: box-shadow .18s ease; }
a.card.buh-vhod:active { box-shadow: var(--press); }
a.card.buh-vhod .chev { color: var(--amber); font-size: 20px; line-height: 1; }

/* --------------------------------------------------------------------------
   Нижнее меню — плавающая панель
   -------------------------------------------------------------------------- */

.tabbar {
  position: absolute; z-index: 50;   /* от окна, которое само не прокручивается */
  left: 50%; transform: translateX(-50%);
  bottom: calc(14px + var(--safe-bottom));
  width: min(560px, calc(100% - 24px)); height: 70px;
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: center;
  padding: 0 6px; border-radius: 35px;
  background: var(--bg); box-shadow: var(--raise-lg);
}
.tabbar.five { grid-template-columns: repeat(5, 1fr); }
.tabbar.four { grid-template-columns: repeat(4, 1fr); }
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; height: 100%; min-width: 0; padding: 0 2px;
  color: var(--ink-dim); font-size: 12px; font-weight: 500;
  transition: color .18s ease;
}
.tabbar a span {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tabbar a.active { color: var(--ink); }
.tabbar a.active svg { color: var(--amber); }
.tabbar svg { width: 22px; height: 22px; stroke-width: 2; }
/* Пять вкладок: «Ассортимент» должен влезть целиком и на 375 точках */
.tabbar.five { padding: 0 2px; }
.tabbar.five a { padding: 0; font-size: 11px; letter-spacing: -.01em; }

/* --------------------------------------------------------------------------
   Сообщения
   -------------------------------------------------------------------------- */

.toast {
  position: fixed; z-index: 60; left: 50%;
  bottom: calc(98px + var(--safe-bottom));
  transform: translate(-50%, 14px);
  width: max-content; max-width: min(500px, calc(100% - 32px));
  padding: 14px 18px; border-radius: 20px;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45;
  box-shadow: var(--raise-lg);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err  { color: var(--nogeo); }

.notice {
  padding: 15px 18px; margin-bottom: 20px; border-radius: 20px;
  box-shadow: var(--press);
  color: var(--ink-dim); font-size: 14.5px; line-height: 1.55;
}
.notice b { color: var(--ink); font-weight: 600; }
.notice .head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.notice .head .spin { color: var(--amber); }

/* Неполадки бота — видит только хозяин */
.notice.trevoga { box-shadow: var(--raise), inset 0 0 0 1.5px var(--amber); color: var(--ink); }
.notice.trevoga b { color: var(--amber); font-size: 15px; }
.notice.trevoga ul { margin: 8px 0; padding-left: 20px; }
.notice.trevoga li { margin-bottom: 4px; }
.notice.trevoga a { color: var(--amber); font-weight: 600; }

.empty {
  padding: 30px 20px; border-radius: 24px; box-shadow: var(--press);
  text-align: center; color: var(--ink-dim); font-size: 15px; line-height: 1.6;
}

.empty-state { padding: 22px 20px; border-radius: 24px; box-shadow: var(--press); }
.empty-state p { margin: 0 0 10px; font-size: 16px; }
.empty-state p:first-child { font-size: 18px; font-weight: 500; }
.empty-state p:last-child { margin-bottom: 0; }
.empty-state .hint { font-size: 14.5px; }

/* Плашка «фильтр изменён» */
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 12px 12px 18px; margin-bottom: 20px; border-radius: 20px;
  box-shadow: var(--raise), inset 0 0 0 1.5px var(--amber);
  font-size: 15px; font-weight: 500;
}
.banner .grow { flex: 1; min-width: 150px; }
.banner button {
  height: 40px; padding: 0 16px; flex: none; border: 0; border-radius: 14px;
  background: var(--bg); color: var(--amber); font-size: 14.5px; font-weight: 600;
  box-shadow: var(--raise-sm);
}
.banner button:active { box-shadow: var(--press-sm); }
.banner button:disabled { opacity: .6; }

/* --------------------------------------------------------------------------
   Список отчётов
   -------------------------------------------------------------------------- */

.file {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  margin-bottom: 14px; min-height: var(--tap); border-radius: 22px;
  background: var(--bg); box-shadow: var(--raise);
  transition: box-shadow .18s ease;
}
.file:active { box-shadow: var(--press); }
.file .body { min-width: 0; flex: 1; }
.file .name {
  font-size: 15.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.file .when { font-size: 13.5px; color: var(--ink-dim); margin-top: 2px; }
.file .arrow { color: var(--ink-far); flex: none; }

/* --------------------------------------------------------------------------
   Выбор варианта
   -------------------------------------------------------------------------- */

.choices { display: grid; gap: 12px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px 18px; min-height: var(--tap); text-align: left;
  border: 0; border-radius: 20px; background: var(--bg); color: var(--ink);
  box-shadow: var(--raise-sm);
  transition: box-shadow .18s ease;
}
.choice .t { font-size: 15.5px; font-weight: 600; }
.choice .d { font-size: 13.5px; color: var(--ink-dim); }
.choice.active { box-shadow: var(--press-sm); }
.choice.active .t { color: var(--amber); }

/* --------------------------------------------------------------------------
   Сворачиваемая карточка площадки
   -------------------------------------------------------------------------- */

.card.fold { padding: 0; overflow: hidden; }
.fold-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 64px; padding: 16px 20px;
  background: none; border: 0; text-align: left; color: inherit;
}
.fold-title {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  font-size: 16.5px; font-weight: 600;
}
.fold-sub { font-size: 13.5px; font-weight: 400; color: var(--ink-dim); }
.fold .chev {
  color: var(--ink-far); flex: none;
  transition: transform .24s ease, color .18s ease;
}
.fold.open .chev { transform: rotate(180deg); color: var(--amber); }
.fold .chev.nudge { animation: nudge .8s ease 2; color: var(--amber); }

.fold-body { max-height: 0; overflow: hidden; transition: max-height .28s ease; }
.fold-inner {
  padding: 4px 20px 20px;
  opacity: 0; transition: opacity .2s ease .05s;
}
.fold.open .fold-inner { opacity: 1; }

/* --------------------------------------------------------------------------
   Загрузка
   -------------------------------------------------------------------------- */

#progress {
  position: fixed; top: var(--safe-top); left: 0; z-index: 100;
  height: 3px; width: 0; border-radius: 0 3px 3px 0;
  background: var(--amber); opacity: 0; pointer-events: none;
  transition: width .25s ease, opacity .2s ease;
}
#progress.on { opacity: 1; }

.spin {
  width: 16px; height: 16px; flex: none; display: inline-block; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.spin.sm { width: 12px; height: 12px; }

.btn.loading { cursor: default; }
.btn.loading:disabled { color: var(--ink); }
.btn.primary.loading:disabled { color: var(--amber); }

/* Строка «бот сейчас работает» — по нижнему краю бежит блик */
.working {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 12px;
  padding: 15px 18px; margin-bottom: 20px; border-radius: 20px;
  box-shadow: var(--press);
  font-size: 14.5px; color: var(--ink-dim); line-height: 1.5;
}
.working .spin { color: var(--amber); }
.working b { color: var(--ink); font-weight: 600; }
.working::after, .notice.progress::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--amber), transparent);
  background-size: 50% 100%; background-repeat: no-repeat;
  animation: shine 2.2s linear infinite;
}
.notice.progress { position: relative; overflow: hidden; }

/* Заглушки списка */
.skel {
  background: linear-gradient(100deg, transparent 30%, var(--line) 50%, transparent 70%);
  background-size: 200% 100%; border-radius: 10px;
  box-shadow: var(--press-sm);
  animation: shine 1.4s linear infinite;
}
.skel-row {
  display: flex; gap: 12px; padding: 12px; margin-bottom: 14px; border-radius: 22px;
  box-shadow: var(--raise);
}
.skel-row .skel.pic { width: 88px; height: 66px; flex: none; border-radius: 14px; }
.skel-row .lines { flex: 1; display: flex; flex-direction: column; gap: 9px; padding-top: 3px; }
.skel-row .skel.l1 { height: 13px; width: 62%; }
.skel-row .skel.l2 { height: 17px; width: 42%; }
.skel-row .skel.l3 { height: 11px; width: 78%; }

/* --------------------------------------------------------------------------
   Кабинет: показатели, графики, таблицы
   -------------------------------------------------------------------------- */

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fact { padding: 12px 14px; min-width: 0; border-radius: 18px; box-shadow: var(--press-sm); }
.fact .k {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  color: var(--ink-dim); margin-bottom: 5px;
}
.fact .v { font-size: 15.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.fact .v.good { color: var(--amber); }
.fact .v.warn { color: var(--near); }
.fact .v.off  { color: var(--ink-far); }

/* Переключатель «люди / действия»: желобок, выбранное выпирает */
.switch {
  display: inline-flex; flex: none; gap: 4px; padding: 4px; border-radius: 999px;
  box-shadow: var(--press-sm);
}
.switch button {
  border: 0; background: none; color: var(--ink-dim);
  height: 32px; padding: 0 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: box-shadow .18s ease, color .18s ease;
}
.switch button.on { box-shadow: var(--raise-sm); color: var(--ink); }

/* График: столбики в желобках */
.chart {
  display: flex; align-items: flex-end; justify-content: flex-start; gap: 5px;
  height: 170px; padding: 6px 8px; margin: 6px -8px 10px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
}
.chart::-webkit-scrollbar { display: none; }
.chart .bar {
  flex: 1 1 0; min-width: 14px; max-width: 48px; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  align-items: center; gap: 4px; padding: 3px 2px; border-radius: 12px;
  cursor: pointer; transition: box-shadow .18s ease;
}
.chart .bar:hover { box-shadow: var(--raise-sm); }
.chart .bar.on { box-shadow: var(--raise-sm); }
.chart .bar .num { font-size: 12px; color: var(--ink-dim); height: 15px; line-height: 15px; }
.chart .bar.on .num { color: var(--amber); font-weight: 600; }
.chart .stack {
  flex: 1; width: 100%; min-height: 4px;
  display: flex; flex-direction: column-reverse; justify-content: flex-start;
  overflow: hidden; border-radius: 8px; box-shadow: var(--press-sm);
}
.chart .stack i { display: block; width: 100%; min-height: 2px; }
.chart .bar .lbl { font-size: 11px; color: var(--ink-far); white-space: nowrap;
                   height: 13px; line-height: 13px; }
.chart .bar .num:empty, .chart .bar .lbl:empty { visibility: hidden; }
.chart-empty {
  width: 100%; align-self: center; text-align: center;
  color: var(--ink-far); font-size: 14px; padding: 0 10px; line-height: 1.6;
}

.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-dim); }
.legend .li { display: inline-flex; align-items: center; gap: 7px; }
.legend .li i { width: 10px; height: 10px; border-radius: 50%; flex: none; }

/* Таблица. Значения в ней не переносятся, поэтому на узком телефоне
   она прокручивается внутри своей карточки, а не растягивает страницу. */
#ploshchadki, #totals, #detail { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .11em; color: var(--ink-dim);
  padding: 0 8px 8px 0; white-space: nowrap;
}
.tbl td { padding: 10px 8px 10px 0; border-top: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { width: 44%; }
.tbl th:not(:first-child), .tbl td:not(:first-child) { text-align: right; white-space: nowrap; }
.tbl .ok  { color: var(--ink); }
.tbl .bad { color: var(--amber); font-weight: 600; }
.tbl .meh { color: var(--near); }
.tbl .why-row td {
  padding-top: 0; border-top: 0; color: var(--ink-dim); font-size: 13px;
  white-space: normal; text-align: left;
}

/* --------------------------------------------------------------------------
   Вход
   -------------------------------------------------------------------------- */

.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px calc(20px + var(--safe-right)) 24px calc(20px + var(--safe-left));
}
.login-card {
  width: 100%; max-width: 380px; padding: 30px 24px 26px; border-radius: 34px;
  background: var(--bg); box-shadow: var(--raise-lg);
  animation: vydavit .7s cubic-bezier(.25, .8, .3, 1) both;
}
.login-card .logo {
  width: 68px; height: 68px; margin: 0 auto 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--amber); box-shadow: var(--raise);
}
.login-card h1 { text-align: center; font-size: 25px; font-weight: 500; margin: 0 0 4px; }
.login-card .sub { text-align: center; color: var(--ink-dim); font-size: 15px; margin-bottom: 24px; }
.login-card .btn { margin-top: 6px; }
/* Ошибка входа — просто строка текста, а не плашка внутри карточки */
.login-card .notice {
  box-shadow: none; padding: 0; margin: -8px 0 18px;
  color: var(--nogeo); text-align: center; font-weight: 500;
}

/* --------------------------------------------------------------------------
   Тумблер: желобок, по которому катается выпуклый шарик
   -------------------------------------------------------------------------- */

.toggle {
  position: relative; flex: none;
  width: 60px; height: 34px; padding: 0; border: 0; border-radius: 999px;
  background: var(--bg); box-shadow: var(--press-sm);
}
.toggle .knob {
  position: absolute; top: 4px; left: 4px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--ink-far); box-shadow: var(--raise-sm);
  transition: transform .22s cubic-bezier(.2, .8, .2, 1), background .18s ease;
}
.toggle.on .knob { transform: translateX(26px); background: var(--amber); }

/* --------------------------------------------------------------------------
   Выбор региона, марки, формулы: из того, что бот встретил на площадках
   -------------------------------------------------------------------------- */

.regpick { border-radius: 18px; background: var(--bg); box-shadow: var(--raise-sm); }
.regpick.open { box-shadow: var(--raise); }

.regpick-head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; min-height: 50px; padding: 0 16px;
  background: none; border: 0; color: var(--ink); text-align: left;
  font-size: 15px;
}
.regpick-now { color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.regpick.chosen .regpick-now { color: var(--ink); font-weight: 500; }
.regpick-head .chev {
  flex: none; margin-left: 10px; color: var(--ink-far); font-size: 18px;
  transition: transform .2s ease;
}
.regpick.open .regpick-head .chev { transform: rotate(90deg); color: var(--amber); }

.regpick-body { padding: 4px 12px 14px; }
.regpick-find {
  width: 100%; height: 44px; margin-bottom: 12px; padding: 0 14px;
  border: 0; border-radius: 14px; background: var(--bg); color: var(--ink);
  font-size: 16px; box-shadow: var(--press-sm);
}
.regpick-find:focus { outline: none; box-shadow: var(--press-sm), 0 0 0 2px var(--amber); }

.regpick-list {
  display: flex; flex-wrap: wrap; gap: 9px; padding: 4px;
  max-height: 240px; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.regpick-item {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 13px; border: 1.5px solid transparent; border-radius: 999px;
  background: var(--bg); color: var(--ink-dim); font-size: 14px; line-height: 1;
  box-shadow: var(--raise-sm);
  transition: box-shadow .18s ease, color .18s ease;
}
.regpick-item:hover { color: var(--ink); }
.regpick-item.on { box-shadow: var(--press-sm); color: var(--amber); font-weight: 600; }
.regpick-item .c { font-size: 12px; color: var(--ink-far); }
.regpick-item.on .c { color: var(--amber); opacity: .7; }
/* Место, которого нет в справочнике: показываем как есть, но помечаем */
.regpick-item.unknown { border-style: dashed; border-color: var(--line); }
.regpick-empty { padding: 6px 4px; color: var(--ink-far); font-size: 14px; }
.regpick-clear {
  margin-top: 10px; height: 36px; padding: 0 14px; border: 0; border-radius: 12px;
  background: var(--bg); color: var(--ink-dim); font-size: 14px; font-weight: 500;
  box-shadow: var(--raise-sm);
}
.regpick-clear:hover { color: var(--amber); }
.regpick-clear:active { box-shadow: var(--press-sm); }

/* --------------------------------------------------------------------------
   Лента новинок: что нашлось по вашим условиям, день за днём
   -------------------------------------------------------------------------- */

.dayline {
  display: flex; align-items: center; gap: 12px; margin: 28px 4px 14px;
}
.dayline:first-of-type { margin-top: 6px; }
.dayline .d {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-dim);
}
.dayline .n { margin-left: auto; font-size: 13px; color: var(--ink-far); }

/* --------------------------------------------------------------------------
   Сердечко в шапке — вход в отложенное
   -------------------------------------------------------------------------- */

.topbar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.heart {
  position: relative; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--ink-dim); box-shadow: var(--raise);
  transition: box-shadow .18s ease, color .18s ease;
}
.heart svg { width: 19px; height: 19px; fill: none; }
.heart:hover { color: var(--ink); }
.heart:active { box-shadow: var(--press); }
.heart.active { color: var(--amber); box-shadow: var(--press); }
.heart.active svg { fill: currentColor; }
.heart .count {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
  border-radius: 999px; background: var(--amber); color: var(--bg);
  font-size: 11.5px; font-weight: 700;
}

/* --------------------------------------------------------------------------
   Объявление для всех: висит, пока человек сам не нажмёт «Понятно»
   -------------------------------------------------------------------------- */

.card.obyavlenie { box-shadow: var(--raise), inset 0 0 0 1.5px var(--amber); }
.card.obyavlenie h2, .card.obyavlenie h3 { display: flex; align-items: center; gap: 10px; }
.card.obyavlenie h2::before, .card.obyavlenie h3::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); flex: none;
}
.card.obyavlenie .hint { color: var(--ink); }
.card.obyavlenie .btn-row { margin-bottom: 14px; }
#obyavlenie-push-why { color: var(--near); margin: -4px 0 14px; }

/* --------------------------------------------------------------------------
   Экраны пошире: настольный вид
   -------------------------------------------------------------------------- */

@media (min-width: 760px) {
  .wrap { padding: 20px 28px 40px; }
  /* шапка выравнивается по той же колонке, что и содержимое */
  .topbar .row { max-width: 824px; margin: 0 auto; }
  .topbar h1 { font-size: 30px; }
  .item .thumb-box { width: 132px; height: 98px; }
  .item .name { font-size: 16.5px; }
  .item .price { font-size: 21px; }
  .stat .num { font-size: 36px; }
  .chart { height: 210px; }
  .tabs { margin-left: -28px; margin-right: -28px; padding-left: 28px; padding-right: 28px; }
}

/* Узкие экраны (iPhone SE и подобные) */
@media (max-width: 370px) {
  .topbar { padding-left: 14px; padding-right: 14px; }
  .wrap { padding-left: 14px; padding-right: 14px; }
  .topbar h1 { font-size: 25px; }
  /* На самом узком экране от плашки состояния остаётся цветная точка;
     слово скрыто только с глаз — экранный диктор его прочтёт */
  .state { font-size: 0; gap: 0; width: 34px; padding: 0; justify-content: center; }
  .stats { gap: 10px; }
  .stat { padding: 14px 10px 12px; border-radius: 18px; }
  .stat .num { font-size: 25px; }
  .stat .lbl { font-size: 11px; letter-spacing: .06em; }
  .btn { font-size: 14.5px; padding: 0 10px; }
  .btn-row { gap: 10px; }
  .tabbar a { font-size: 11px; }
  .tabbar.five a { font-size: 10px; }
  .item { gap: 12px; padding: 12px; }
  .item .thumb-box { width: 76px; height: 60px; border-radius: 14px; }
  .tabs { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
}

/* --------------------------------------------------------------------------
   Если в системе выключены анимации
   -------------------------------------------------------------------------- */

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

/* --------------------------------------------------------------------------
   Плавность

   Между страницами — «ткань на форме» (раздел выше, .poyavlenie и
   body.leaving). Здесь — то, что происходит внутри одной страницы.
   -------------------------------------------------------------------------- */

/* Смена темы в настройках: цвета перетекают из одной в другую */
@keyframes vt-gasnet { to { opacity: 0; } }
html.smena-temy::view-transition-old(root) { animation: vt-gasnet .3s ease both; }
html.smena-temy::view-transition-new(root) { animation: none; }

/* Внутри окна: что появилось — проявляется, а не выскакивает */
@keyframes vhod {
  0%   { opacity: 0; --rel: 0; transform: translateY(6px); }
  70%  { --rel: 1.12; }
  100% { opacity: 1; --rel: 1; transform: none; }
}
.regpick-body:not([hidden]), #custom-box:not([hidden]), .working:not([hidden]),
.notice.progress:not([hidden]), #detail-card:not([hidden]), #push-why:not([hidden]),
#obyavlenie-push-why:not([hidden]) {
  animation: vhod .26s cubic-bezier(.2, .8, .2, 1);
}

/* Переключатели: выбранный вариант отмечает выпуклая «таблетка», и она
   переезжает к новому выбору (app.js подкладывает её под кнопки) */
.s-polzunkom { position: relative; }
.s-polzunkom > .polzunok {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none;
  border-radius: 999px; background: var(--bg); box-shadow: var(--raise-sm);
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), width .3s cubic-bezier(.2, .8, .2, 1),
              height .3s ease, opacity .2s ease;
}
.s-polzunkom > :not(.polzunok) { position: relative; z-index: 1; }
.s-polzunkom > .on { box-shadow: none !important; }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) {
    animation: none !important;
  }
}
