/* ═══════════════════════════════════════
   MOBILE NAV  (≤510px)
   ═══════════════════════════════════════ */
.m-nav {
  display: none;
  position: sticky;
  top: -27px;        /* half the height — нижняя половина всегда остаётся видна */
  left: 0; right: 0;
  height: 54px;
  background: var(--bg-card);
  z-index: 100;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  transition: background 0.3s;
  /* нет border-bottom ни в каком состоянии */
}

/* .scrolled больше не даёт видимой полосы */
.m-nav.scrolled { /* intentionally empty */ }

.m-nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.m-nav-burger {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--icon-color);
  border-radius: var(--r-xs);
  transition: opacity 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.m-nav-burger:active { opacity: 0.6; }

.m-nav-logo { display: flex; align-items: center; text-decoration: none; }
.m-nav-logo img { height: 30px; width: auto; display: block; }

.m-nav-actions {
  display: flex; align-items: center; gap: 6px;
}

.m-nav-icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-light);
  border: 1px solid var(--white-14);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--icon-color);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.m-nav-icon-btn:active { transform: scale(0.88); }

.m-nav-icon-btn.m-nav-add {
  background: var(--purple);
  border-color: var(--purple);
  color: #fff;
}
.m-nav-icon-btn.m-nav-add:active { background: var(--purple-dark); }

/* ═══════════════════════════════════════
   MOBILE HERO SECTION  (≤510px)
   ═══════════════════════════════════════ */
.m-hero {
  display: none;
  flex-direction: column;
  gap: 24px;
  padding-top: 20px;    /* отступ от хедера до логотипа */
  padding-bottom: 8px;
  position: relative;
}

/* Theme toggle — absolute top-right */
.m-theme-wrap {
  position: absolute;
  right: 0; top: 40px;
  display: flex; flex-direction: column;
  align-items: center; gap: 5px;
  cursor: pointer; user-select: none; z-index: 10;
  -webkit-tap-highlight-color: transparent;
}
.m-theme-label {
  font-size: 11px; font-weight: 600;
  color: var(--white-70); white-space: nowrap;
  transition: color 0.3s;
}

/* Logo area */
.m-logo-area {
  display: flex; align-items: center; justify-content: center;
  padding: 12px 0 0;
  margin-bottom: 12px;
}
.m-logo-area img { width: 128px; height: auto; display: block; }

/* Search row */
.m-search-row {
  display: flex; align-items: center; gap: 10px;
}

.m-search-pill {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: var(--r-xxl);
  padding: 10px 14px;
  display: flex; align-items: center;
  cursor: text;
  transition: border-color 0.3s, background 0.3s;
}
[data-theme="light"] .m-search-pill {
  border-color: rgba(26,26,46,0.3);
  background: #fff;
  box-shadow: 0 1px 4px rgba(26,26,46,0.08);
}
.m-search-pill:focus-within { border-color: var(--purple); }

.m-search-inner {
  display: flex; align-items: center; gap: 10px; width: 100%;
}
.m-search-icon { color: var(--white-40); flex-shrink: 0; }

.m-search-input {
  flex: 1; background: none; border: none; outline: none;
  color: var(--white); font-family: 'Inter', sans-serif;
  font-size: 15px; caret-color: var(--purple);
  min-width: 0; transition: color 0.3s;
}
.m-search-input::placeholder { color: var(--white-40); }

.m-search-sliders {
  background: none; border: none; cursor: pointer;
  color: var(--icon-color); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 0; -webkit-tap-highlight-color: transparent;
}
.m-search-sliders:active { opacity: 0.6; }

/* Mic button */
.m-mic-btn svg { display: block; position: relative; z-index: 1; }

.m-mic-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  position: relative; cursor: pointer;
  border-radius: 50%;
  background: none; border: none; padding: 0; outline: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  overflow: visible;
}
.m-mic-btn .mic-circle { fill: var(--lime); transition: fill 0.3s; }
.m-mic-btn .mic-icon   { stroke: #1e1e2a; fill: none; }
.m-mic-btn.active .mic-circle { fill: var(--purple); }
.m-mic-btn.active .mic-icon   { stroke: #fff; }

/* Wave rings — only visible when active */
.m-mic-btn::before, .m-mic-btn::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(139,93,246,0.55);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.m-mic-btn.active::before { animation: m-mic-wave 1.2s ease-out infinite; }
.m-mic-btn.active::after  { animation: m-mic-wave 1.2s ease-out 0.4s infinite; }
@keyframes m-mic-wave {
  0%   { transform: scale(0.9); opacity: 0.65; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Mobile banner */
.m-banner {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  overflow: hidden;
  position: relative;
  background: #252537;
  cursor: pointer;
  transition: filter 0.2s;
  flex-shrink: 0;
}
.m-banner:active { filter: brightness(0.92); }

.m-banner-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.m-banner-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  position: relative;
}

.m-banner-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.m-banner-dots {
  position: absolute;
  bottom: 18px;
  left: 0; right: 0;
  display: flex; gap: 8px; align-items: center;
  justify-content: center;
  z-index: 2;
}
.m-banner-dot { height: 10px; border-radius: 3px; transition: background 0.3s, width 0.3s; }
.m-banner-dot.active       { width: 40px; background: #fff; }
.m-banner-dot:not(.active) { width: 10px; background: rgba(255,255,255,0.38); }

/* ── SHOW ON ≤510px ── */
@media (max-width: 510px) {
  .m-nav  { display: flex; }
  .m-hero { display: flex; }
}

/* ══════════════════════════════════════════
   BURGER MENU — универсальный компонент
   ══════════════════════════════════════════ */
.burger-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.burger-overlay.open { opacity: 1; pointer-events: all; }

.burger-menu {
  position: fixed; top: 0; left: 0;
  width: 300px; height: 100%;
  background: var(--bg-card);
  z-index: 201;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1), background 0.3s;
  display: flex; flex-direction: column;
  padding: 52px 0 32px;
  overflow-y: auto;
  border-right: 1px solid var(--white-14);
}
.burger-menu.open { transform: translateX(0); }

.burger-menu-logo {
  padding: 0 28px 28px;
  border-bottom: 1px solid var(--white-14);
}
.burger-logo-img { height: 38px; width: auto; display: block; }

.burger-menu-close {
  position: absolute; top: 14px; right: 16px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0.5; color: var(--white);
  transition: opacity 0.15s; border-radius: var(--r-xs);
  background: none; border: none;
}
.burger-menu-close:hover { opacity: 1; }

.burger-nav { padding: 16px 0; flex: 1; }

.burger-nav-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  color: var(--white);
  font-size: 15px; font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.burger-nav-item:hover { background: var(--white-08); }
.burger-nav-item svg { flex-shrink: 0; opacity: 0.65; color: var(--white); transition: color 0.3s; }
.burger-nav-item.is-active { background: rgba(139,93,246,0.12); color: var(--purple); }
.burger-nav-item.is-active svg { opacity: 1; color: var(--purple); }

.burger-nav-sep { height: 1px; background: var(--white-14); margin: 8px 28px; }
.burger-menu-footer { padding: 16px 28px 0; font-size: 13px; color: var(--white-40); }

/* ── Тема ── */
.burger-nav-theme {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.burger-nav-theme:hover { background: var(--white-08); }
.burger-nav-theme-left {
  display: flex; align-items: center; gap: 14px;
  color: var(--white); font-size: 15px; font-weight: 500;
}
.burger-nav-theme-left svg { flex-shrink: 0; opacity: 0.65; color: var(--white); }
.burger-theme-track {
  width: 40px; height: 22px;
  border-radius: 11px;
  background: var(--purple);
  position: relative; flex-shrink: 0;
  transition: background 0.2s;
}
[data-theme="light"] .burger-theme-track { background: var(--white-40); }
.burger-theme-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%; background: #fff;
  transition: transform 0.2s;
}
[data-theme="dark"]  .burger-theme-thumb { transform: translateX(18px); }
[data-theme="light"] .burger-theme-thumb { transform: translateX(0); }

.m-nav-icon-btn img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--white-14);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: var(--white);
    flex-shrink: 0;
    transition: background 0.3s;
}