/* ─────────────────────────────────────────────────────────────
   CMEX.ai — layout.css
   Pixel-perfect translation of DNavBar (desktop.jsx 192-292)
   and DFooter (desktop.jsx 751-789). Classes prefixed .nav-*
   and .ft-* respectively.
   ───────────────────────────────────────────────────────────── */

/* ── Nav background tokens (kept off --bg to avoid color drag
   when switching themes — same trick as t.dark check in JSX) ── */
:root,
:root[data-theme="light"] {
  --nav-bg: rgba(255, 255, 255, 0.85);
  --nav-badge-border: #fff;
  --nav-accent-shadow: rgba(255, 107, 53, 0.25);
}

:root[data-theme="dark"] {
  --nav-bg: rgba(7, 14, 38, 0.85);
  --nav-badge-border: #070E26;
  --nav-accent-shadow: rgba(255, 107, 53, 0.25);
}

/* ── Nav bar container ───────────────────────────────────────── */
.nav-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--divider);
}

/* Inner wrapper — caps content width at 1440px, keeps side padding */
.nav-inner {
  max-width: 1440px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  height: 72px;
  padding-left: 60px;
  padding-right: 60px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 40px;
  flex: 1;
}

.nav-right {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
}

/* ── Logo ────────────────────────────────────────────────────── */
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
  line-height: 1;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.logo .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  transform: translateY(-1px);
}

.logo .ai {
  color: var(--accent);
  font-weight: 700;
}

/* ── Primary nav ─────────────────────────────────────────────── */
.nav-menu {
  display: flex;
  gap: 28px;
}

.nav-menu a {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-menu a.is-active {
  color: var(--text);
}

/* ── Search ──────────────────────────────────────────────────── */
.nav-search {
  width: 360px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  /* Drive the SVG stroke through `color`, not the markup's
     stroke="var(--text-dim)" presentation attribute: var() in SVG
     presentation attributes is unreliable in WebKit/Safari (iPad), so
     the icon renders invisible there. currentColor in a real CSS rule
     is fully supported everywhere — same pattern as .nav-theme. */
  color: var(--text-dim);
}
.nav-search svg { stroke: currentColor; }

.nav-search-placeholder {
  font-size: 13px;
  color: var(--text-dim);
  flex: 1;
}

.nav-search-input {
  flex: 1;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  padding: 0;
}

.nav-search-input::placeholder {
  color: var(--text-dim);
}

.nav-search-kbd {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--divider);
  font-family: ui-monospace, Menlo, monospace;
}

/* ── Language toggle ─────────────────────────────────────────── */
.nav-lang {
  background: transparent;
  border: 1px solid var(--divider);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
  text-decoration: none;
}

/* ── Theme toggle ────────────────────────────────────────────── */
.nav-theme {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Drive the SVG stroke through `color`, not the markup's
     stroke="var(--icon-stroke)" presentation attribute: var() in SVG
     presentation attributes is unreliable in WebKit/Safari (iPad), so
     the icon renders invisible there. currentColor in a real CSS rule
     is fully supported everywhere — same pattern as .nav-lang. */
  color: var(--icon-stroke);
}
.nav-theme svg { stroke: currentColor; }

/* Show only one of the two icons per current theme */
:root[data-theme="light"] .icon-sun { display: none; }
:root[data-theme="dark"]  .icon-moon { display: none; }

/* ── Guest actions ───────────────────────────────────────────── */
.nav-login {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.nav-register {
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 4px 12px var(--nav-accent-shadow);
}

/* ── Logged-in actions ───────────────────────────────────────── */
.nav-balance {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
}

.nav-balance .plus {
  opacity: 0.6;
  font-weight: 700;
}

.nav-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  /* Drive the SVG stroke through `color`, not the markup's
     stroke="var(--icon-stroke)" presentation attribute: var() in SVG
     presentation attributes is unreliable in WebKit/Safari (iPad), so
     the icon renders invisible there. currentColor in a real CSS rule
     is fully supported everywhere — same pattern as .nav-theme. */
  color: var(--icon-stroke);
}
.nav-bell svg { stroke: currentColor; }

.nav-bell .dot {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  border: 1.5px solid var(--nav-badge-border);
}

.nav-create {
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  text-decoration: none;
}

.nav-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--divider);
  cursor: pointer;
  display: inline-block;
  background-size: cover;
  background-position: center;
}
/* Нет аватара — кружок с иконкой человечка по центру (вместо пустого серого) */
.nav-avatar-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  color: var(--icon-stroke);
}
.nav-avatar-empty svg { width: 20px; height: 20px; }

/* ── Меню пользователя (dropdown под аватаром) ───────────────── */
/* inline-flex + align-items:center: иначе .nav-avatar (inline-block) садится
   на baseline строчного бокса обёртки и визуально стоит на пару пикселей выше
   соседей (.nav-create, колокол, кредиты). Flex-обёртка центрирует аватар по
   вертикали наравне с остальной правой группой на всех ширинах. */
.nav-user { position: relative; display: inline-flex; align-items: center; }
.nav-user-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--divider);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: none;
  z-index: 200;
}
.nav-user-menu.is-open { display: block; }
.nav-user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}
.nav-user-item:hover { background: var(--card); }
.nav-user-ico {
  display: inline-flex;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--text-dim);
}
.nav-user-ico svg { width: 18px; height: 18px; }
.nav-user-txt { flex: 1; min-width: 0; }
/* авторские табы — акцентная иконка (как .uc-nav-group.is-author в кабинете) */
.nav-user-tab--author .nav-user-ico { color: var(--accent); }
/* разделитель между группами */
.nav-user-sep { height: 1px; background: var(--divider); margin: 6px 6px; }
.nav-user-logout { color: var(--accent); }
.nav-user-logout .nav-user-ico { color: var(--accent); }
/* длинный список (автор: 11 табов + 2) — не вылезать за экран */
.nav-user-menu { max-height: calc(100vh - 80px); overflow-y: auto; }
/* Клиентский режим зрителя автора (localStorage cmex_author_viewmode → body.cmex-viewer-mode,
   тоглится в main.php). Прячем авторскую группу — меню как у обычного зрителя.
   Зеркало .uc-page.is-viewer-mode .uc-author-only в кабинете. */
body.cmex-viewer-mode .nav-user-author,
body.cmex-viewer-mode .m-menu-sublink--author { display: none; }

/* ── Footer ──────────────────────────────────────────────────── */
.ft {
  padding: 60px 0 32px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--divider);
}

/* Inner wrapper — caps content width at 1440px, keeps side padding */
.ft-inner {
  max-width: 1440px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 60px;
  padding-right: 60px;
  box-sizing: border-box;
}

.ft-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 40px;
}

.ft-tagline {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 280px;
}

.ft-col-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 14px;
}

.ft-col-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ft-col-list li,
.ft-col-list li a {
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
}

.ft-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--divider);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* ─────────────────────────────────────────────────────────────
   Hover / transition layer (nav + footer)
   All transitions uniform: 0.18s ease. Effects are subtle — never
   layout-shifting (only color, background, border-color, transform,
   filter, opacity, box-shadow change on hover).
   ───────────────────────────────────────────────────────────── */

/* Logo */
.logo {
  cursor: pointer;
  transition: opacity 0.18s ease;
}
.logo:hover { opacity: 0.85; }

/* Primary nav links */
.nav-menu a {
  transition: color 0.18s ease;
}
.nav-menu a:hover {
  color: var(--text);
}

/* Search bar — accent border on hover */
.nav-search {
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.nav-search:hover {
  border-color: var(--accent);
}

/* Language toggle */
.nav-lang {
  transition: border-color 0.18s ease, color 0.18s ease;
}
.nav-lang:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Theme toggle — round hover background.
   Negative margin compensates padding → no layout shift. */
.nav-theme {
  padding: 4px;
  margin: -4px;
  border-radius: 50%;
  transition: background-color 0.18s ease;
}
.nav-theme:hover {
  background: var(--bg-elevated);
}

/* Guest: Login link */
.nav-login {
  border-radius: 8px;
  transition: background-color 0.18s ease;
}
.nav-login:hover {
  background: var(--bg-elevated);
}

/* Guest: Register button (accent) */
.nav-register {
  transition: filter 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.nav-register:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--nav-accent-shadow);
}

/* Logged-in: balance pill */
.nav-balance {
  transition: filter 0.18s ease;
}
.nav-balance:hover {
  filter: brightness(1.05);
}

/* Logged-in: notifications bell — round hover background */
.nav-bell {
  padding: 4px;
  margin: -4px;
  border-radius: 50%;
  transition: background-color 0.18s ease;
}
.nav-bell:hover {
  background: var(--bg-elevated);
}

/* Logged-in: Create button (accent) */
.nav-create {
  transition: filter 0.18s ease, transform 0.18s ease;
}
.nav-create:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Logged-in: avatar */
.nav-avatar {
  transition: border-color 0.18s ease;
}
.nav-avatar:hover {
  border-color: var(--accent);
}

/* Footer links */
.ft-col-list li {
  transition: color 0.18s ease;
}
.ft-col-list li:hover,
.ft-col-list li:hover a {
  color: var(--text);
}
.ft-col-list li a {
  transition: color 0.18s ease;
}

/* ─────────────────────────────────────────────────────────────
   Mobile search bar (separate block under header, inside <main>).
   Hidden on desktop, shown below 768px. Inline-styled via class —
   matches HSearch in data/_disign/hybrid.jsx (lines 283-298).
   ───────────────────────────────────────────────────────────── */
.m-search {
  display: none;
}

/* ─────────────────────────────────────────────────────────────
   Mobile TabBar (fixed bottom navigation).
   Hidden on desktop, shown below 768px. Markup: <nav.m-tabbar>
   with 5 <a.m-tab> children. "Создать" tab uses .m-tab-create
   for the accent square in the middle.
   ───────────────────────────────────────────────────────────── */
.m-tabbar {
  display: none;
}

/* ─────────────────────────────────────────────────────────────
   Mobile menu sheet (slide-up overlay opened from TabBar "Меню").
   Hidden by default (display:none). JS toggles display:block + a
   .is-open class to trigger transitions. Styles live outside @media
   so JS can rely on them at any viewport (although the button that
   opens it is only visible on mobile).
   ───────────────────────────────────────────────────────────── */
.m-menu-sheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
}

.m-menu-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.m-menu-sheet.is-open .m-menu-overlay {
  opacity: 1;
}

.m-menu-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  border-radius: 16px 16px 0 0;
  max-height: 85vh;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

.m-menu-sheet.is-open .m-menu-panel {
  transform: translateY(0);
}

.m-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--divider);
}

.m-menu-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.m-menu-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.m-menu-content {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.m-menu-section {
  margin-bottom: 20px;
}

.m-menu-section-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 20px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.m-menu-section:first-child .m-menu-section-title {
  margin-top: 0;
}

.m-menu-link {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--divider);
}

.m-menu-section .m-menu-link:last-child {
  border-bottom: none;
}

/* быстрые таб-ссылки кабинета в секции «Account» — подчинённый вид */
.m-menu-sublink {
  padding-left: 14px;
  font-size: 14px;
  color: var(--text-muted);
}

.m-menu-footer {
  padding: 20px;
  border-top: 1px solid var(--divider);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

.m-menu-tagline {
  margin-top: 4px;
}

/* ═════════ COMPACT ≤1023px (mobile + tablet) ══════════════════
   Compact nav (no desktop menu/search/balance/create), footer
   hidden, mobile search/tabbar shown. Tablet-specific tweaks
   live in the TABLET block at the very end of this file — it
   comes AFTER this block so tablet overrides win at 768-1023. */
@media (max-width: 1023px) {

  /* ── NAV BAR — compact, no menu, no search, no balance ────── */
  .nav-inner {
    padding-left: 20px;
    padding-right: 16px;
    height: 56px;
  }
  .nav-bar { /* keep sticky + background */ }

  .nav-left { gap: 0; }
  .nav-menu { display: none; }
  .nav-search { display: none; }

  /* Logo a hair smaller on mobile */
  .logo { font-size: 20px; }

  .nav-right { gap: 10px; }

  /* Lang toggle — more compact */
  .nav-lang {
    padding: 4px 10px;
    font-size: 11px;
  }

  /* Theme toggle — slightly smaller area */
  .nav-theme svg {
    width: 22px;
    height: 22px;
  }

  /* Guest: hide Register, keep only compact Login as accent pill.
     Spec: "padding 6px 14px, fontSize 12, weight 800, accent background". */
  .nav-register { display: none; }
  .nav-login {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 800;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 4px 10px var(--nav-accent-shadow);
  }

  /* Logged-in: hide balance + create (Create lives in TabBar) */
  .nav-balance { display: none; }
  .nav-create  { display: none; }

  .nav-bell svg { width: 22px; height: 22px; }
  .nav-avatar { width: 30px; height: 30px; border-width: 1.5px; }

  /* ── MOBILE SEARCH BAR (visible below 768px) ────────────────── */
  .m-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 20px 16px;
    height: 44px;
    border-radius: 12px;
    background: var(--bg-elevated);
    padding: 0 14px;
    border: 1px solid transparent;
    color: var(--text-dim);
  }
  [data-theme="dark"] .m-search {
    border-color: rgba(255, 255, 255, 0.06);
  }
  .m-search-input {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    font: inherit;
    font-size: 14px;
    color: var(--text);
    padding: 0;
  }
  .m-search-input::placeholder {
    color: var(--text-dim);
  }
  .m-search-filter {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--icon-stroke);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* ── FOOTER — hidden on mobile (content lives in Menu sheet) ── */
  .ft { display: none; }

  /* ── BODY: padding-bottom so content clears the fixed TabBar ── */
  body {
    padding-bottom: 80px;
  }

  /* ── MOBILE TABBAR ──────────────────────────────────────────── */
  .m-tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    background: var(--tabbar);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--tabbar-border);
    box-shadow: var(--tabbar-shadow);
    padding-top: 10px;
    padding-bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    justify-content: space-around;
    align-items: flex-end;
  }
  .m-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    /* Button + link both used (Menu is <button>) — normalize. */
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-family: inherit;
  }
  .m-tab.is-active {
    color: var(--text);
    font-weight: 700;
  }
  .m-tab-label {
    font-size: 12px;
    font-weight: 600;
  }
  /* "Создать" — big accent plate, no label */
  .m-tab-create {
    align-self: flex-end;
  }
  .m-tab-create .m-tab-create-plate {
    width: 48px;
    height: 36px;
    border-radius: 12px;
    background: var(--accent);
    box-shadow: 0 8px 20px rgba(255, 107, 53, 0.45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ═════════ TABLET 768-1023px ══════════════════════════════════
   Tablet overrides on top of the ≤1023 base (mobile chrome).
   Tablet uses bigger padding, slightly smaller tab labels.
   Comes AFTER the ≤1023 block so it wins at 768-1023.
   ───────────────────────────────────────────────────────────── */
@media (min-width: 768px) and (max-width: 1023px) {
  .nav-inner {
    /* Mobile uses 20/16 — tablet wants 24/24 symmetric */
    padding-left: 24px;
    padding-right: 24px;
  }
  .m-tab-label {
    font-size: 11px;
  }
}

/* Узкий десктоп / iPad Pro (1024–1200): у залогиненного юзера полный
   навбар не помещался в ряд. Боковой padding шапки НЕ трогаем — он
   остаётся 60px, как у .catalog-page и контента, чтобы левый/правый
   край шапки и контента совпадали по вертикали. Умещаем элементы
   только за счёт сжатия поиска/гэпов и скрытия ⌘K. */
@media (min-width: 1024px) and (max-width: 1200px) {
  /* Боковые поля шапки = полям контента (.video-page/.catalog-page → 24px),
     иначе края шапки сдвинуты внутрь и она кажется уже страниц. */
  .nav-inner { padding-left: 24px; padding-right: 24px; }
  /* Лого+меню и правый блок — по контенту (не растягиваются на flex:1),
     поиск flex:1 заполняет середину между ними → не болтается фиксированным
     куском по центру с пустыми зазорами. */
  .nav-left  { flex: 0 1 auto; gap: 20px; }
  .nav-menu  { gap: 16px; }
  .nav-menu a { font-size: 13px; }
  .nav-search { flex: 1 1 auto; width: auto; min-width: 0; max-width: 420px; margin: 0 16px; }
  .nav-search-kbd { display: none; }
  .nav-right { flex: 0 1 auto; gap: 10px; }
  .nav-balance { padding: 6px 10px; }
  .nav-create { padding: 7px 12px; }
}

/* Средний десктоп (1201–1439): десктоп-база не достаёт сюда компрессией ≤1200,
   а search 360px + полные gap по бокам не оставляют зазора — поиск слипается
   с переключателем языка (RU), правый блок (кредиты/колокол/Создать) сжимается.
   Боковой padding шапки НЕ трогаем (остаётся 60px — края шапки совпадают с
   контентом). Сохраняем flex:1 у nav-left/nav-right (поиск по центру, правый
   блок прижат к краю), но даём поиску гарантированный margin и сужаем его,
   плюс поджимаем gap'ы. Десктоп 1440+ работает на базе и не затрагивается. */
@media (min-width: 1201px) and (max-width: 1439px) {
  .nav-left   { gap: 28px; }
  .nav-menu   { gap: 20px; }
  /* margin: 0 24px — жёсткий зазор поиска до nav-menu слева и до RU справа,
     не зависящий от схлопывания свободного места; ширина уменьшена с 360. */
  .nav-search { width: 300px; margin: 0 24px; }
  .nav-right  { gap: 14px; }
  /* кредиты не должны переноситься/деформироваться при сжатии */
  .nav-balance { white-space: nowrap; }
}

/* ════════ Cookie consent banner (GDPR) ════════
   Sticky-полоса снизу, не оверлей. Тема — через токены. z-index ниже сплеша
   (10000) и появляется уже после window.load → конфликта нет. */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9000;
  background: var(--bg-elevated);
  border-top: 1px solid var(--divider);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  color: var(--text);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cookie-banner.is-hiding {
  opacity: 0;
  transform: translateY(100%);
  pointer-events: none;
}
.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.cookie-banner-text {
  margin: 0;
  flex: 1;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}
.cookie-banner-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.cookie-banner-link:hover { text-decoration: underline; }
.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.cookie-banner-btn {
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.cookie-banner-btn--primary {
  background: var(--accent);
  color: #fff;
}
.cookie-banner-btn--primary:hover { opacity: 0.9; }
.cookie-banner-btn--secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--chip-border);
}
.cookie-banner-btn--secondary:hover { background: var(--accent-soft); }

/* Мобильный: над таб-баром (.m-tabbar fixed bottom), кнопки в столбик. */
@media (max-width: 1023px) {
  .cookie-banner { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .cookie-banner-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }
  .cookie-banner-btn { flex: 1; padding: 11px 16px; }
}
