/* ==========================================================================
   ВЫГОДИН — каркас: шапка (hd-), мегаменю (mm-), лист «Поиск и разделы»
   на телефоне (hd-sheet-), окно аккаунта (hd-acc-), подвал (ft-),
   баннер cookie (ck-), тосты (tt-).
   Шаблоны: layout/header.html, footer.html, cookie_banner.html, base.html.
   Точки: <768 телефон · 768–1199 промежуточная · ≥1200 ПК.
   ========================================================================== */

/* --- «Перейти к содержанию» --------------------------------------------- */
.hd-skip {
  position: absolute; left: 16px; top: -64px; z-index: 120;
  height: 46px; padding: 0 16px; border-radius: var(--r-12);
  display: flex; align-items: center;
  background: var(--text); color: var(--bg); font-size: 15px; font-weight: 600;
  transition: top var(--dur-menu) var(--ease-std);
}
.hd-skip:focus { top: 8px; color: var(--bg); }

/* ==========================================================================
   Шапка
   ========================================================================== */
.hd {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.hd-top { height: 62px; display: flex; align-items: center; gap: var(--sp-24); }

/* лого: кот-знак + «Выгодин.ru» (Unbounded 700) */
.hd-logo { display: flex; align-items: center; gap: 9px; height: 46px; flex-shrink: 0; color: var(--text); }
.hd-logo:hover { color: var(--text); }
.hd-logo-t { font-family: var(--font-display); font-weight: 700; font-size: 21px; letter-spacing: -0.02em; white-space: nowrap; }
.hd-logo-t span { color: var(--warm-accent); }

/* поиск: серое поле, при фокусе — рамка 2px и мягкое кольцо, «Найти» зеленеет */
.hd-search {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: var(--sp-10);
  height: 46px; padding: 0 5px 0 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-12);
  transition: border-color .18s var(--ease-std), box-shadow .18s var(--ease-std), background-color .18s var(--ease-std);
}
.hd-search:focus-within { border: 2px solid var(--brand-text); padding: 0 4px 0 13px; box-shadow: 0 0 0 4px var(--brand-bg); background: var(--surface); }
.hd-search-ic { display: flex; color: var(--text-3); flex-shrink: 0; cursor: text; }
.hd-search input {
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0; border: 0; background: transparent;
  font-size: 15px; color: var(--text); outline: none;
}
.hd-search input::placeholder { color: var(--placeholder); }
.hd-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hd-search input:focus-visible { outline: none; }
.hd-search-go {
  height: 34px; padding: 0 14px; border: 0; border-radius: var(--r-8); flex-shrink: 0;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 600;
  transition: background-color var(--dur-hover) var(--ease-std);
}
.hd-search-go:hover { background: var(--dark-hover); color: var(--dark-hover-text); }
.hd-search:focus-within .hd-search-go { background: var(--brand); color: #FFFFFF; }

.hd-actions { display: flex; align-items: center; gap: var(--sp-8); flex-shrink: 0; }
.hd-icon-btn {
  width: 46px; height: 46px; flex-shrink: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: var(--r-12); background: var(--surface); color: var(--text);
  transition: background-color var(--dur-hover) var(--ease-std), border-color var(--dur-hover) var(--ease-std);
}
.hd-icon-btn:hover { background: var(--surface-2); border-color: var(--line-field); color: var(--text); }
.hd-search-link, .hd-login-m, .hd-msearch, .hd-avatar { display: none; }

/* тема: луна в светлой, солнце в тёмной; смена — поворот 240 мс (app.js ставит .is-turning) */
.hd-theme { position: relative; }
.hd-theme-ic { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; transition: transform .24s var(--ease-std), opacity .24s var(--ease-std); }
.hd-theme-sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
.hd-theme:hover .hd-theme-moon { transform: rotate(-20deg); }
:root[data-theme="dark"] .hd-theme-moon { opacity: 0; transform: rotate(90deg) scale(.4); }
:root[data-theme="dark"] .hd-theme-sun { opacity: 1; transform: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hd-theme-moon { opacity: 0; transform: rotate(90deg) scale(.4); }
  :root:not([data-theme="light"]) .hd-theme-sun { opacity: 1; transform: none; }
}

/* «Войти» — тёмная кнопка 46 */
.hd-login {
  height: 46px; padding: 0 18px 0 14px; border-radius: var(--r-12);
  display: flex; align-items: center; gap: var(--sp-8);
  background: var(--text); color: var(--bg); font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--dur-hover) var(--ease-std);
}
.hd-login:hover { background: var(--dark-hover); color: var(--dark-hover-text); }

/* вошёл: ник → /me, «Подтвердить почту» (тёплая), «Выйти» (тихая) */
.hd-me {
  height: 46px; padding: 0 14px 0 6px; border: 1px solid var(--line); border-radius: var(--r-12);
  display: flex; align-items: center; gap: var(--sp-8);
  background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: background-color var(--dur-hover) var(--ease-std), border-color var(--dur-hover) var(--ease-std);
}
.hd-me:hover { background: var(--surface-2); border-color: var(--line-field); color: var(--text); }
.hd-me-ic { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; }
.hd-me-n { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.hd-verify, .hd-logout { display: flex; margin: 0; }
.hd-verify button {
  height: 46px; padding: 0 14px 0 12px; border: 0; border-radius: var(--r-12);
  display: flex; align-items: center; gap: var(--sp-10); text-align: left; white-space: nowrap;
  background: var(--warn-bg); color: var(--warn-text);
  transition: background-color var(--dur-hover) var(--ease-std);
}
.hd-verify button:hover { background: var(--warn-hover-bg); }
.hd-verify-t { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; font-size: 15px; font-weight: 600; line-height: 18px; }
.hd-verify-cap { font-size: 13px; font-weight: 500; line-height: 16px; color: var(--warn-text-2); }
.hd-logout button {
  height: 46px; padding: 0 12px; border: 0; border-radius: var(--r-12);
  display: flex; align-items: center; gap: var(--sp-8);
  background: transparent; color: var(--text-2); font-size: 15px; font-weight: 500; white-space: nowrap;
  transition: background-color var(--dur-hover) var(--ease-std);
}
.hd-logout button:hover { background: var(--surface-2); color: var(--text); }

/* --- Строка разделов ------------------------------------------------------ */
.hd-nav { height: 48px; display: flex; }
.hd-links { display: flex; align-items: stretch; gap: var(--sp-28); height: 48px; }
.hd-link {
  position: relative; height: 48px; display: flex; align-items: center; flex-shrink: 0;
  color: var(--text); font-size: 15px; font-weight: 500; white-space: nowrap;
}
.hd-link:hover { color: var(--brand-text); }
.hd-link[aria-current] { color: var(--brand-text); font-weight: 600; }
/* .hd-links и .hd-nav без position: панель мегаменю и полоска .hd-ul
   позиционируются от .hd (sticky), иначе панель ужмётся до ширины строки.
   подчёркивание активного: без JS — под самим пунктом; с JS (.js-ul) — одна
   полоска .hd-ul, которая едет к пункту под курсором/фокусом за 200 мс и возвращается */
.hd-link[aria-current]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  border-radius: 3px 3px 0 0; background: var(--brand-text);
}
.hd-ul { position: absolute; bottom: 0; left: 0; width: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand-text); opacity: 0; pointer-events: none; }
.hd-links.js-ul .hd-link[aria-current]::after { display: none; }
.hd-links.js-ul .hd-ul { opacity: 1; transition: left var(--dur-menu) var(--ease-std), width var(--dur-menu) var(--ease-std); }
.hd-links.js-ul .hd-ul.is-idle { opacity: 0; }

/* кнопка «Разделы»: пилюля 40 внутри строки 48, шеврон поворачивается */
.hd-mmw { display: flex; align-items: stretch; }
.hd-cats { height: 48px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; color: var(--text); white-space: nowrap; }
.hd-pill {
  display: flex; align-items: center; gap: 7px; height: 40px; padding: 0 10px; margin-left: -10px;
  border-radius: var(--r-10); font-size: 15px; font-weight: 600;
  transition: background-color var(--dur-hover) var(--ease-std);
}
.hd-cats:hover .hd-pill, .hd-mmw:hover .hd-pill, .hd-mmw:focus-within .hd-pill, .hd-mmw.is-open .hd-pill { background: var(--surface-2); }
.hd-chev { transition: transform .18s var(--ease-std); }
.hd-mmw:hover .hd-chev, .hd-mmw:focus-within .hd-chev, .hd-mmw.is-open .hd-chev { transform: rotate(180deg); }

/* ==========================================================================
   Мегаменю: без JS — :hover с задержкой 150 мс и :focus-within.
   Панель 180 мс со сдвигом 8px, строки каскадом через 20 мс, под панелью —
   затемнение страницы. Позиционируется от .hd (у .hd-nav/.hd-mmw нет position).
   ========================================================================== */
.mm {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 40;
  visibility: hidden; opacity: 0; transform: translateY(-8px);
  transition: opacity .18s var(--ease-out), transform .18s var(--ease-out), visibility 0s linear .18s;
  --mm-base: .15s;
}
.hd-mmw:hover .mm { visibility: visible; opacity: 1; transform: none; transition-delay: .15s, .15s, .15s; }
.hd-mmw:focus-within .mm, .hd-mmw.is-open .mm { visibility: visible; opacity: 1; transform: none; transition-delay: 0s, 0s, 0s; --mm-base: 0s; }
/* Esc (app.js): .is-shut прячет панель, даже если курсор/фокус ещё внутри */
.hd-mmw.is-shut .mm { visibility: hidden; opacity: 0; transform: translateY(-8px); transition-delay: 0s, 0s, 0s; }
.hd-mmw.is-shut .hd-chev { transform: none; }
/* затемнение под панелью — не ловит курсор, чтобы ховер не «застревал».
   Рисуется только у открытой панели: скрытое (visibility) оно всё равно удлиняло
   документ на 100vh от шапки, и на коротких страницах (вход, 429, 500) под подвалом
   оставалась белая полоса. */
.mm::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 100vh;
  background: var(--dim); pointer-events: none; display: none;
}
.hd-mmw:hover .mm::after, .hd-mmw:focus-within .mm::after, .hd-mmw.is-open .mm::after { display: block; }
.hd-mmw.is-shut .mm::after { display: none; }
.mm-panel { position: relative; z-index: 2; background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--sh-menu); }
.mm-grid {
  padding-top: 28px; padding-bottom: 32px;
  display: grid; grid-template-columns: 330px 430px minmax(0, 1fr); gap: var(--sp-40); align-items: stretch;
}
.mm-grid--noshops { grid-template-columns: minmax(0, 1fr) 360px; }
.mm-grid--noshops .mm-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.mm-col { display: flex; flex-direction: column; gap: var(--sp-12); min-width: 0; }
.mm-col--shops { padding-left: 40px; margin-left: -40px; border-left: 1px solid var(--line-soft); }
.mm-head { display: flex; flex-direction: column; gap: var(--sp-4); padding: 0 10px; }
.mm-h { font-family: var(--font); font-size: 13px; line-height: 16px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-2); }
.mm-sub { font-size: 13px; line-height: 16px; color: var(--text-3); }
.mm-cats { display: flex; flex-direction: column; gap: 2px; }
.mm-row {
  height: 44px; display: flex; align-items: center; gap: var(--sp-12); padding: 0 10px;
  border-radius: var(--r-10); color: var(--text);
  transition: background-color var(--dur-hover) var(--ease-std);
}
.mm-row:hover { background: var(--surface-2); color: var(--text); }
.mm-row[aria-current] { background: var(--brand-bg); color: var(--brand-on-bg); }
.mm-row[aria-current]:hover { background: var(--brand-bg-hover); }
.mm-ic {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--warm-bg); color: var(--warm-big);
}
.mm-row[aria-current] .mm-ic { background: var(--surface); color: var(--brand-text); }
.mm-n { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-num { font-size: 14px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.mm-row[aria-current] .mm-num { color: var(--brand-on-bg); }
/* стрелка строки: место занято всегда — колонка чисел не двигается */
.mm-arr { opacity: 0; transition: opacity var(--dur-hover) var(--ease-std), transform var(--dur-hover) var(--ease-std); }
.mm-row:hover .mm-arr, .mm-row:focus-visible .mm-arr, .mm-row[aria-current] .mm-arr { opacity: 1; transform: translateX(2px); }
.mm-shops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.mm-shop { height: 52px; border-radius: var(--r-12); }
/* логотип магазина в меню: белая плашка 36 с рамкой, внутри 26; нет логотипа — одна буква */
.mm-logo {
  width: 36px; height: 36px; border-radius: var(--r-10); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: #FFFFFF; border: 1px solid var(--line);
}
.mm-logo img { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.mm-logo-mono { font-size: 14px; font-weight: 700; color: #444A55; }
.mm-logo:has(.mm-logo-mono) { background: var(--surface-3); border-color: var(--surface-3); }
.mm-logo:has(.mm-logo-mono) .mm-logo-mono { color: var(--text-2); }
.mm-all { align-self: flex-start; margin-left: 6px; height: 40px; }
.mm-note {
  position: relative; overflow: hidden; align-self: start;
  border-radius: var(--r-20); padding: 24px 16px 0 24px;
  display: flex; flex-direction: column; gap: var(--sp-12);
}
.mm-note-h { font-family: var(--font); font-size: 19px; line-height: 1.3; font-weight: 700; color: var(--text); letter-spacing: 0; }
.mm-note-p { font-size: 15px; line-height: 1.5; color: var(--text-2); }
.mm-note-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-12); }
.mm-note-foot .btn { margin: 4px 0 24px; }
.mm-note .cat, .hd-sheet-note .cat { display: block; }
/* каскад строк при открытии */
@keyframes mm-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hd-mmw:hover .mm-row, .hd-mmw:focus-within .mm-row, .hd-mmw.is-open .mm-row {
  animation: mm-in .18s var(--ease-out) both;
  animation-delay: calc(var(--mm-base, 0s) + var(--i, 0) * 20ms);
}

/* ==========================================================================
   Полоса «Почта не подтверждена» — под шапкой на узких экранах
   ========================================================================== */
.hd-warn { display: none; background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); }
.hd-warn-in { padding-top: 12px; padding-bottom: 12px; display: flex; align-items: center; gap: var(--sp-16); }
.hd-warn-t { display: flex; align-items: flex-start; gap: var(--sp-10); font-size: 14px; line-height: 1.45; color: var(--warn-text); flex: 1 1 auto; }
.hd-warn-t svg { margin-top: 1px; }
.hd-warn form { margin: 0; display: flex; }
.hd-warn-btn { border-color: var(--warn); color: var(--warn-text); background: var(--surface); }
.hd-warn-btn:hover { border-color: var(--warn-text-2); color: var(--warn-text); background: var(--surface); }

/* ==========================================================================
   Промежуточная ширина 768–1199: поиск ужимается, подпись «почты» — полосой
   ========================================================================== */
@media (max-width: 1199px) {
  .hd-top { gap: var(--sp-16); }
  .hd-links { gap: var(--sp-20); }
  .hd-verify-cap { display: none; }
  .hd-logout span { display: none; } /* «Выйти» — иконкой, подпись в aria-label */
  .hd-logout button { width: 46px; padding: 0; justify-content: center; }
  .hd-warn { display: block; }
  .hd-warn form { display: none; } /* кнопка уже есть в шапке */
  .mm-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--sp-32); }
  .mm-col--shops { padding-left: 32px; margin-left: -32px; }
  .mm-note { grid-column: 1 / -1; flex-direction: row; align-items: center; padding: 16px 16px 0 24px; }
  .mm-note-p { flex: 1; }
  .mm-note-foot .btn { margin: 0 0 16px; }
  .mm-grid--noshops { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 899px) {
  .hd-logo-t { display: none; }
  .hd-search { display: none; }
  .hd-search-link { display: flex; }
  .hd-top { justify-content: space-between; }
  .hd-links { gap: var(--sp-16); }
  .hd-me-n { max-width: 110px; }
  .mm-grid { grid-template-columns: minmax(0, 1fr); }
  .mm-col--shops { padding-left: 0; margin-left: 0; border-left: 0; }
}

/* ==========================================================================
   Телефон <768: «кот · Поиск и разделы · аккаунт», строки разделов нет
   ========================================================================== */
@media (max-width: 767px) {
  .hd-top { height: 56px; gap: var(--sp-6); padding: 0 4px 0 10px; justify-content: flex-start; }
  .hd-logo { width: 44px; height: 44px; justify-content: center; }
  .hd-logo .cat { width: 40px; height: 40px; }
  .hd-search-link, .hd-theme, .hd-login, .hd-me, .hd-verify, .hd-logout, .hd-nav { display: none; }
  .hd-msearch {
    flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 12px;
    display: flex; align-items: center; gap: var(--sp-10);
    border: 1px solid var(--line); border-radius: var(--r-12); background: var(--surface-2); color: var(--text);
  }
  .hd-msearch:hover { background: var(--surface-3); color: var(--text); }
  .hd-msearch-t { flex: 1; text-align: left; font-size: 15px; font-weight: 500; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hd-msearch-lens { display: flex; color: var(--text-2); animation: hd-lens 1.2s var(--ease-std) .9s 2; }
  .hd-login-m { display: flex; width: 44px; height: 44px; border: 0; background: transparent; }
  .hd-avatar { display: flex; width: 44px; height: 44px; border-radius: var(--r-12); align-items: center; justify-content: center; }
  .hd-avatar:hover { background: var(--surface-2); }
  .hd-actions { gap: 0; }
  .hd-warn-in { flex-direction: column; align-items: stretch; gap: var(--sp-10); }
  .hd-warn form { display: flex; }
  .hd-warn-btn { flex: 1; height: 44px; }
  html { scroll-padding-top: 72px; }
}
/* лупа в «Поиск и разделы» сканирует два раза и замирает */
@keyframes hd-lens { 0%, 100% { transform: none; } 25% { transform: translate(-1.5px, 1px); } 75% { transform: translate(1.5px, -1px); } }
.hd-avatar-l {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--warm-bg); color: var(--warm-on-bg);
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
}
.hd-avatar-dot { position: absolute; top: -3px; right: -3px; width: 11px; height: 11px; border-radius: 50%; background: var(--warn); border: 2px solid var(--surface); }

/* ==========================================================================
   Лист «Поиск и разделы» (телефон): опускается сверху за 240 мс,
   поле сразу в фокусе, фон не прокручивается (body.no-scroll)
   ========================================================================== */
.hd-sheet {
  position: fixed; inset: 0; z-index: 100;
  background: var(--surface); overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column;
}
.hd-sheet[hidden] { display: none; }
.hd-sheet.is-open { animation: hd-sheet-in .24s var(--ease-out) both; }
.hd-sheet.is-closing { animation: hd-sheet-out .2s var(--ease-std) both; }
@keyframes hd-sheet-in { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes hd-sheet-out { from { transform: none; } to { transform: translateY(-100%); } }
.hd-sheet-top {
  position: sticky; top: 0; z-index: 2; background: var(--surface);
  padding-top: env(safe-area-inset-top, 0px); border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 2px; min-height: 64px; padding-left: 16px; padding-right: 8px;
}
.hd-sheet-search { flex: 1 1 auto; min-width: 0; margin: 0; display: flex; }
.hd-sheet-field {
  flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 10px;
  display: flex; align-items: center; gap: var(--sp-8);
  border: 2px solid var(--brand-text); box-shadow: 0 0 0 4px var(--brand-bg); border-radius: var(--r-12);
  background: var(--surface); color: var(--text-3); cursor: text;
}
.hd-sheet-field input { flex: 1; min-width: 0; width: 100%; height: 38px; border: 0; padding: 0; background: transparent; font-size: 16px; color: var(--text); outline: none; }
.hd-sheet-field input:focus-visible { outline: none; }
.hd-sheet-field input::-webkit-search-cancel-button { -webkit-appearance: none; }
.hd-sheet-x { height: 44px; padding: 0 8px; border: 0; border-radius: var(--r-12); background: transparent; color: var(--brand-text); font-size: 16px; font-weight: 600; flex-shrink: 0; }
.hd-sheet-x:hover { background: var(--surface-2); }
.hd-sheet-body { padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: var(--sp-28); }
.hd-sheet-sec { display: flex; flex-direction: column; gap: var(--sp-12); }
.hd-sheet-sec--tight { gap: var(--sp-6); }
.hd-sheet-h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.25; letter-spacing: -0.02em; }
.hd-sheet-h3 { font-family: var(--font); font-size: 17px; line-height: 1.3; font-weight: 700; letter-spacing: 0; }
.hd-sheet-headrow { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); }
.hd-sheet-headrow .btn--text { min-height: 44px; }
.hd-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-8); }
.hd-tiles li { display: flex; }
.hd-tile {
  flex: 1; height: 56px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-14);
  display: flex; align-items: center; gap: var(--sp-10);
  background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600;
  transition: background-color var(--dur-hover) var(--ease-std);
}
.hd-tile:hover { background: var(--surface-2); color: var(--text); }
.hd-tile[aria-current] { border: 1.5px solid var(--brand-text); background: var(--brand-bg); color: var(--brand-on-bg); }
.hd-sheet-cats li { display: flex; }
.hd-sheet-row {
  flex: 1; min-height: 52px; padding: 0 8px; border-radius: var(--r-12);
  display: flex; align-items: center; gap: var(--sp-12);
  color: var(--text); box-shadow: inset 0 -1px 0 var(--line-soft);
}
.hd-sheet-row:hover { background: var(--surface-2); color: var(--text); }
.hd-sheet-row .mm-n { font-size: 16px; }
.hd-sheet-row .mm-num { font-size: 15px; }
.hd-sheet-row[aria-current] { background: var(--brand-bg); color: var(--brand-on-bg); }
.hd-sheet-row[aria-current] .mm-ic { background: var(--surface); color: var(--brand-text); }
.hd-sheet.is-open .hd-sheet-cats li { animation: mm-in .18s var(--ease-out) both; animation-delay: calc(.24s + var(--i, 0) * 20ms); }
.hd-sheet-shops {
  margin: 0 -16px; padding: 0 16px 4px; display: flex; gap: var(--sp-10);
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; scrollbar-width: none;
}
.hd-sheet-shops::-webkit-scrollbar { display: none; }
.hd-sheet-shops li { flex-shrink: 0; scroll-snap-align: start; }
.hd-sheet-shops a { width: 100px; min-height: 84px; display: flex; flex-direction: column; gap: var(--sp-8); color: var(--text); }
.hd-sheet-shops a > span:last-child { font-size: 13px; line-height: 16px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-sheet-logo {
  height: 56px; border-radius: var(--r-14); padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  background: #FFFFFF; border: 1px solid var(--line);
}
.hd-sheet-logo img { width: auto; max-width: 84px; height: 32px; object-fit: contain; }
.hd-sheet-logo:has(.hd-sheet-logo-mono) { background: var(--surface-3); border-color: var(--surface-3); }
.hd-sheet-logo-mono { font-size: 20px; font-weight: 700; color: var(--text); }
.hd-sheet-note { border-radius: var(--r-18); padding: 16px; display: flex; flex-direction: column; gap: var(--sp-12); }
.hd-sheet-note-top { display: flex; align-items: flex-end; gap: var(--sp-12); }
.hd-sheet-note-top > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-6); }
.hd-sheet-note-top p { font-size: 15px; line-height: 1.5; color: var(--text-2); }
.hd-sheet-how {
  min-height: 64px; padding: 10px 12px 10px 14px; border-radius: var(--r-14);
  display: flex; align-items: center; gap: var(--sp-12); background: var(--surface); color: var(--text);
}
.hd-sheet-how > svg:first-child { color: var(--brand-text); }
.hd-sheet-how:hover { color: var(--text); background: var(--surface-2); }
.hd-sheet-how > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hd-sheet-how b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.hd-sheet-theme { display: flex; flex-direction: column; gap: var(--sp-8); }
.hd-sheet-theme-l { display: flex; align-items: center; gap: var(--sp-8); font-size: 14px; font-weight: 600; color: var(--text-3); }
.th-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); height: 48px; padding: 2px; gap: 2px; }
.th-seg > button { height: 44px; min-width: 0; padding: 0 4px; border-radius: 10px; }
.th-seg > button svg { display: none; }

/* окно аккаунта (телефон) и затемнение под ним */
.hd-acc {
  position: fixed; top: calc(62px + env(safe-area-inset-top, 0px)); right: 8px; z-index: 95;
  width: min(318px, calc(100vw - 16px));
  background: var(--surface); border-radius: var(--r-20); box-shadow: var(--sh-menu);
  padding: 8px 10px 10px; display: flex; flex-direction: column; gap: var(--sp-8);
}
.hd-acc[hidden] { display: none; }
.hd-acc.is-open { animation: hd-pop .18s var(--ease-out) both; transform-origin: 90% 0; }
@keyframes hd-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
.hd-dim { position: fixed; left: 0; right: 0; bottom: 0; top: calc(57px + env(safe-area-inset-top, 0px)); z-index: 90; background: rgba(22,24,29,.48); animation: vg-fade .18s var(--ease-std) both; }
.hd-acc-me { min-height: 56px; padding: 0 10px; border-radius: var(--r-12); display: flex; align-items: center; gap: var(--sp-12); color: var(--text); }
.hd-acc-me:hover { background: var(--surface-2); color: var(--text); }
.hd-acc-av { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--warm-bg); color: var(--warm-on-bg); font-family: var(--font-display); font-weight: 600; font-size: 16px; }
.hd-acc-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hd-acc-t b { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.hd-acc-warn { background: var(--warn-bg); border-radius: var(--r-14); padding: 12px 14px; display: flex; flex-direction: column; gap: var(--sp-10); }
.hd-acc-warn p { display: flex; gap: var(--sp-10); align-items: flex-start; font-size: 14px; line-height: 1.45; color: var(--warn-text); }
.hd-acc-warn form, .hd-acc form { margin: 0; display: flex; }
.hd-acc-warn .btn { height: 44px; }
.hd-acc-out { flex: 1; height: 48px; padding: 0 10px; border: 0; border-radius: var(--r-12); display: flex; align-items: center; gap: var(--sp-12); background: transparent; font-size: 16px; font-weight: 500; color: var(--text-2); }
.hd-acc-out:hover { background: var(--surface-2); color: var(--text); }
@media (min-width: 768px) { .hd-acc, .hd-dim, .hd-sheet { display: none; } }

/* ==========================================================================
   Подвал — тёмный блок и в светлой теме; кольцо фокуса светло-зелёное
   ========================================================================== */
.ft { background: var(--footer-bg); color: var(--footer-link); margin-top: auto; }
.ft { border-top: 1px solid var(--footer-line-top, transparent); }
.ft :focus-visible { outline-color: var(--focus-dark); }
.ft-in { padding-top: 56px; padding-bottom: 40px; display: flex; flex-direction: column; gap: 36px; }
.ft-top { display: flex; gap: var(--sp-48); }
.ft-brand { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: var(--sp-12); }
.ft-logo { display: flex; align-items: center; gap: var(--sp-10); align-self: flex-start; height: 46px; }
.ft-logo > span { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; color: #FFFFFF; white-space: nowrap; }
.ft-logo > span span { color: var(--cat); }
.ft-tag { font-size: 15px; line-height: 1.5; color: var(--footer-muted); }
.ft-cols { flex: 1 1 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-24); }
.ft-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ft-h { font-family: var(--font); font-size: 15px; font-weight: 700; color: #FFFFFF; letter-spacing: 0; }
.ft-col ul { display: flex; flex-direction: column; gap: var(--sp-10); }
.ft-col a { color: var(--footer-link); font-size: 15px; line-height: 1.5; }
.ft-col a:hover { color: #FFFFFF; }
.ft-col a[aria-current] { color: #FFFFFF; font-weight: 600; }
.ft-aff { display: flex; flex-direction: column; gap: var(--sp-10); padding: 18px 20px; border-radius: var(--r-16); background: #1A1D23; border: 1px solid #2E333B; }
.ft-aff-mark { display: flex; align-items: center; gap: var(--sp-10); font-size: 13px; line-height: 16px; font-weight: 600; color: #FFB870; }
.ft-aff-ic { width: 28px; height: 28px; border-radius: var(--r-8); background: #2A2F37; color: #FFFFFF; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ft-aff-t { font-size: 15px; line-height: 1.5; color: var(--footer-link); }
.ft-aff-t a { color: var(--focus-dark); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.ft-aff-t a:hover { color: #8FE0B4; }
.ft-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-24); }
.ft-copy { font-size: 14px; line-height: 1.5; color: var(--footer-muted); }
.ft-theme { display: flex; align-items: center; gap: var(--sp-12); }
.ft-theme-l { font-size: 14px; color: var(--footer-muted); }
/* сегмент темы с ползунком: ползунок едет за 200 мс, цвета перетекают */
.ft-seg {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
  width: 432px; border-radius: var(--r-12); background: #22262D; border: 1px solid #2E333B; flex-shrink: 0;
}
.ft-knob {
  position: absolute; top: 4px; left: 4px; width: calc((100% - 16px) / 3); height: 40px; border-radius: 9px;
  background: #ECEEF2; transform: translateX(calc(200% + 8px));
  transition: transform var(--dur-menu) var(--ease-std);
}
.ft-seg[data-pos="light"] .ft-knob { transform: translateX(0); }
.ft-seg[data-pos="dark"] .ft-knob { transform: translateX(calc(100% + 4px)); }
.ft-seg > button {
  position: relative; height: 40px; min-width: 0; padding: 0 8px; border: 0; border-radius: 9px; background: transparent;
  display: flex; align-items: center; justify-content: center; gap: var(--sp-6);
  color: #B8BDC7; font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: color var(--dur-menu) var(--ease-std);
}
.ft-seg > button:hover { color: #FFFFFF; }
.ft-seg > button[aria-pressed="true"] { color: #16181D; }
.ft-seg > button:focus-visible { outline-offset: -2px; }

@media (max-width: 1199px) {
  .ft-top { flex-direction: column; gap: var(--sp-32); }
  .ft-brand { width: auto; }
}
@media (max-width: 767px) {
  .ft-in { padding-top: 40px; padding-bottom: 32px; gap: var(--sp-28); }
  .ft-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--sp-28); }
  .ft-col a { display: inline-flex; min-height: 34px; align-items: center; font-size: 16px; }
  .ft-bottom { flex-direction: column-reverse; align-items: stretch; gap: var(--sp-24); }
  .ft-theme { flex-direction: column; align-items: stretch; gap: var(--sp-8); }
  .ft-seg { width: 100%; }
  .ft-knob { height: 52px; }
  .ft-seg > button { height: 52px; flex-direction: column; gap: 2px; font-size: 13px; white-space: normal; line-height: 1.15; }
  .ft-copy { font-size: 13px; }
}

/* ==========================================================================
   Баннер cookie: выезжает снизу за 240 мс через 0,6 с после загрузки
   (consent.js ставит .is-open); после выбора — галочка на кнопке и уход вниз
   ========================================================================== */
.ck {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -10px 32px rgba(22,24,29,.10);
  transform: translateY(calc(100% + 24px)); visibility: hidden;
  transition: transform .24s var(--ease-std), visibility 0s linear .24s;
}
.ck.is-open { transform: none; visibility: visible; transition: transform .24s var(--ease-out) .6s, visibility 0s linear 0s; }
.ck.is-leaving { transform: translateY(calc(100% + 24px)); transition: transform .24s var(--ease-std) .35s; }
.ck-in { padding-top: 18px; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); display: flex; align-items: center; gap: var(--sp-24); }
.ck-ic { width: 48px; height: 48px; border-radius: 50%; background: var(--warm-bg); color: var(--warm-big); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ck-t { flex: 1 1 auto; min-width: 0; font-size: 15px; line-height: 1.5; color: var(--text); }
.ck-t a { font-weight: 600; color: var(--brand-text); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; white-space: nowrap; }
.ck-actions { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-10); width: 470px; flex-shrink: 0; }
.ck-b:not(.btn--dark):hover { border-color: var(--text); background: var(--surface); }
.ck-bic { position: relative; width: 18px; height: 18px; display: inline-flex; flex-shrink: 0; }
.ck-bic svg { position: absolute; inset: 0; transition: opacity .12s var(--ease-std); }
.ck-ok { opacity: 0; stroke-dasharray: 24; stroke-dashoffset: 24; }
.ck-b.is-chosen .ck-bic svg:first-child { opacity: 0; }
.ck-b.is-chosen .ck-ok { opacity: 1; animation: ck-draw .3s var(--ease-out) both; }
@keyframes ck-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.ck-b.is-chosen { transform: scale(.96); }
@media (max-width: 1199px) {
  .ck-in { flex-wrap: wrap; gap: var(--sp-16); }
  .ck-t { flex-basis: calc(100% - 72px); }
  .ck-actions { width: 100%; }
}
@media (max-width: 767px) {
  .ck { border-radius: 20px 20px 0 0; }
  .ck-in { padding-top: 16px; flex-direction: column; align-items: stretch; gap: var(--sp-14); position: relative; }
  .ck-ic { position: absolute; top: 18px; left: 16px; width: 24px; height: 24px; background: transparent; }
  .ck-ic svg { width: 22px; height: 22px; }
  .ck-t { padding-left: 32px; flex-basis: auto; font-size: 16px; }
  .ck-actions { grid-template-columns: minmax(0, 1fr); }
  .ck-actions .btn { height: 48px; }
}

/* ==========================================================================
   Тосты (window.vgToast). Справа снизу, 24px от края; пока виден баннер
   cookie — на 16px выше него (--ck-h ставит consent.js/app.js).
   Стек не больше двух: новый снизу, старый код сворачивается в строку.
   Появление 480 мс снизу, галочка рисуется, полоса до автоскрытия
   (6 с у кода, 4 с у строки), наведение/фокус/скрытая вкладка — пауза.
   ========================================================================== */
.tt-root {
  position: fixed; right: 24px; bottom: calc(24px + var(--ck-h, 0px)); z-index: 70;
  width: 430px; max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-8);
  pointer-events: none;
  transition: bottom var(--dur-menu) var(--ease-std);
}
.tt-root > * { pointer-events: auto; }
.tt {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-18); box-shadow: var(--sh-menu);
  padding: 12px 12px 16px 16px; display: flex; flex-direction: column; gap: var(--sp-12);
  animation: tt-in var(--dur-enter) var(--ease-out) both;
}
.tt.is-leaving { animation: tt-out .2s var(--ease-std) both; }
@keyframes tt-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes tt-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(6px); } }
.tt-head { display: flex; align-items: center; gap: var(--sp-10); }
.tt-badge { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--brand); color: #FFFFFF; }
.tt-badge svg path { stroke-dasharray: 24; animation: tt-draw .4s var(--ease-out) .25s both; }
@keyframes tt-draw { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.tt--error .tt-badge { background: #B42318; }
.tt--error .tt-badge svg path { animation: none; }
.tt-title { flex: 1 1 auto; min-width: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }
.tt-x { width: 40px; height: 40px; flex-shrink: 0; padding: 0; border: 0; border-radius: var(--r-10); background: transparent; color: var(--text); display: flex; align-items: center; justify-content: center; }
.tt-x:hover { background: var(--surface-3); }
.tt-body { display: flex; flex-direction: column; gap: var(--sp-12); padding-right: 4px; }
/* код на тёплой точечной подложке с пунктиром */
.tt-code {
  display: flex; align-items: center; gap: var(--sp-12); min-height: 60px; padding: 8px 8px 8px 16px;
  border-radius: var(--r-14); border: 1.5px dashed var(--cat);
  background-color: var(--warm-bg); background-image: var(--dots); background-size: var(--dots-size);
}
.tt-code-v { flex: 1 1 auto; min-width: 0; font-size: 24px; line-height: 1.2; font-weight: 600; letter-spacing: .08em; color: var(--text); overflow-wrap: anywhere; user-select: all; }
.tt-again { height: 40px; padding: 0 14px; border-radius: var(--r-10); font-size: 14px; }
.tt-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); min-height: 40px; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.tt-foot a { height: 40px; display: inline-flex; align-items: center; gap: var(--sp-4); font-size: 14px; font-weight: 600; color: var(--brand-text); white-space: nowrap; }
.tt-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }
/* ошибка копирования: настоящее поле readonly с выделенным кодом */
.tt-label { font-size: 14px; font-weight: 600; color: var(--text-2); }
.tt-input {
  height: 56px; width: 100%; padding: 0 16px; border: 2px solid var(--brand-text); box-shadow: 0 0 0 4px var(--brand-bg);
  border-radius: var(--r-12); background: var(--surface); color: var(--text);
  font-size: 24px; font-weight: 600; letter-spacing: .08em; outline: none;
}
.tt-hint { font-size: 14px; line-height: 1.45; color: var(--text-2); }
/* однострочный тост */
.tt--line { flex-direction: row; align-items: center; gap: var(--sp-10); min-height: 48px; padding: 12px 16px; border-radius: var(--r-14); font-size: 15px; line-height: 1.4; }
.tt--line .tt-ic { color: var(--brand-text); display: flex; flex-shrink: 0; }
.tt--line.tt--info .tt-ic { color: var(--text-3); }
.tt--line.tt--error .tt-ic { color: var(--risk); }
.tt--line .tt-text { flex: 1; min-width: 0; }
.tt--line .tt-meta { font-size: 13px; color: var(--text-3); white-space: nowrap; }
/* полоса до автоскрытия; пауза — .is-paused */
.tt-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--brand-text); opacity: .5; transform-origin: 0 50%; animation: tt-bar var(--tt-life, 6s) linear both; }
.tt.is-paused .tt-bar { animation-play-state: paused; }
@keyframes tt-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (max-width: 767px) {
  .tt-root { left: 12px; right: 12px; bottom: calc(12px + var(--ck-h, 0px) + env(safe-area-inset-bottom, 0px)); width: auto; max-width: none; }
  .tt-code-v, .tt-input { font-size: 22px; }
  .tt-foot { flex-wrap: wrap; }
}

/* кот — блочный рисунок (без зазора под строкой); моргает там, где есть .cat-blink */
.cat { display: block; }
.cat-blink { transform-box: fill-box; transform-origin: 50% 50%; animation: vg-blink 4s linear 1s infinite both; }
.hd-logo .cat-blink, .ft-logo .cat-blink { animation: none; }
