/* Главная (index.html) — мобильное меню + веб-версия */

body.home-page .bottom-nav,
body.home-page .copyright-bar {
  display: none !important;
}

@media (max-width: 640px) {
  body.home-page .header {
    display: none !important;
  }

  /* Горизонтальный отступ только у .home-shell — не дублировать с .content-wrapper */
  .home-shell.content-wrapper {
    padding-left: 0;
    padding-right: 0;
    max-width: none;
  }
}

body.home-page {
  padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px));
}

.home {
  max-width: 480px;
  margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 8px;
  box-sizing: border-box;
  overflow: visible;
}

/* ── Верхняя полоса ── */
.home-topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.home-topbar__actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.home-topbar--guest {
  grid-template-columns: 1fr auto;
}

.home-topbar--guest .home-brand {
  justify-self: start;
  justify-content: flex-start;
}

.home-topbar__login.login-btn {
  justify-self: end;
  min-width: auto;
  padding: 8px 18px;
  font-size: 14px;
  line-height: 1.2;
  border-width: 2px;
}

.home-topbar--sub {
  grid-template-columns: 40px 1fr 40px;
}

.home-topbar__title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.02em;
  color: #fff;
}

.home-topbar__spacer {
  width: 40px;
  height: 40px;
}

.home-topbar__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
}

.home-topbar__btn img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

.home-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  min-width: 0;
}

.home-brand__logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-brand__logo img {
  width: 28px;
  height: 28px;
}

.home-brand__name {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.home-wallet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-family: inherit;
  line-height: 1.2;
}

button.home-wallet {
  appearance: none;
  -webkit-appearance: none;
}

.home-wallet__icon {
  display: none;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.home-wallet__neuron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* ── Баннер «Создавай с Агентом» ── */
.home-hero {
  margin-bottom: 28px;
  padding: 16px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(155deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 42%,
    rgba(80, 40, 130, 0.28) 100%);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.18),
    inset 0 0 32px rgba(255, 255, 255, 0.16),
    inset 0 0 48px rgba(186, 130, 255, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.28);
}

.home-hero__title {
  margin: 0 0 14px;
  font-size: clamp(15px, 4vw, 22px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-align: center;
}

.home-hero__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-hero__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 8px 10px 8px 14px;
  border-radius: 18px;
  background: rgba(20, 10, 36, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.home-hero__input {
  flex: 1;
  min-width: 0;
  min-height: 24px;
  max-height: 120px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: clamp(12px, 3vw,15px);
  line-height: 1.45;
  resize: none;
  outline: none;
}

.home-hero__input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.home-hero__send {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 14px;
  background: #b230cc;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.home-hero__send:hover {
  background: #9a1fb3;
}

.home-hero__send:active {
  transform: scale(0.96);
}

.home-hero__send img {
  width: 22px;
  height: 22px;
}

/* ── Плитки меню (glassmorphism) ──
   ВАЖНО: селекторы только .home-*, без .menu-item / .menu-grid,
   чтобы не конфликтовать с продакшен-стилями главного меню сайта,
   где эти имена классов уже заняты. */

.home-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}

.home-tile {
  position: relative;
  aspect-ratio: 5 / 4.7;
  border-radius: 20px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;

  background: linear-gradient(160deg,
    rgba(255, 255, 255, 0.20) 0%,
    rgba(255, 255, 255, 0.04) 45%,
    rgba(60, 30, 100, 0.18) 100%);

  border: 1px solid rgba(255, 255, 255, 0.55);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),         /* тонкий контур, без растекания наружу */
    inset 0 0 26px rgba(255, 255, 255, 0.22),   /* свечение внутрь, от краёв к центру */
    inset 0 0 40px rgba(186, 130, 255, 0.18),   /* мягкий фиолетовый отблеск внутри */
    inset 0 1px 0 rgba(255, 255, 255, 0.5),     /* верхний блик */
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 8px 18px rgba(0, 0, 0, 0.3);              /* обычная тень под карточкой — это не свечение, просто объём */

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px 12px;

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-tile:active {
  transform: scale(0.96);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 24px rgba(255, 255, 255, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2),
    0 6px 16px rgba(0, 0, 0, 0.25);
}

.home-tile__icon {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.home-tile__icon img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.home-tile__label {
  position: relative;
  z-index: 1;
  font-size: clamp(12px,3.5vw,14px);
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.home-tile__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 0;
}

.home-tile__desc {
  display: none;
}

/* ── Тренды (каталог как на /templates) ── */
.home-trends {
  margin-bottom: 28px;
}

.home-trends__grid {
  margin-top: 0;
}

.home-trends .home-popular__head {
  margin-bottom: 14px;
}

/* ── Популярное (минишаблоны) — legacy, оставлено для совместимости ── */
.home-popular {
  margin-bottom: 24px;
}

.home-popular__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.home-popular__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.home-popular__all {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.home-popular__all:active {
  transform: scale(0.98);
}

.home-popular__scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-popular__scroll::-webkit-scrollbar {
  display: none;
}

.home-templates__scroll--featured {
  padding-bottom: 0;
}

.home-collections {
  margin-bottom: 24px;
}

.home-collections__title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.home-collections__scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-collections__scroll::-webkit-scrollbar {
  display: none;
}

.home-popular__scroll .home-collection-card {
  flex: 0 0 76px;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 6px 10px;
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  overflow: hidden;

  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);

  transition: transform 0.15s ease, background 0.15s ease;
}

.home-popular__scroll .home-collection-card:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.14);
}

.home-popular__scroll .home-collection-card__preview {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.2);
  border: none;
}

.home-collection-card__preview img,
.home-collection-card__preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-collection-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(172, 75, 255, 0.25));
}

.home-collection-card__title {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.home-collection-card__count {
  font-size: 9px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
}

/* ── Быстрые действия ── */
.home-quick {
  margin-bottom: 28px;
  position: relative;
  z-index: 4;
  overflow: visible;
}

.home-section-heading {
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.home-quick__track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  overflow-x: auto;
  overflow-y: visible;
  padding-top: 6px;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-quick__track::-webkit-scrollbar {
  display: none;
}

.home-quick-card {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: min(120px, 72vw);
  padding: 8px 6px 8px 6px;
  border-radius: 14px;
  text-decoration: none;
  color: #fff;
  position: relative;
  z-index: 1;

  background: linear-gradient(160deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.06) 50%,
    rgba(60, 30, 100, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 12px rgba(0, 0, 0, 0.18);

  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-quick-card:active {
  transform: scale(0.97);
}

.home-quick-card__media {
  width: 35px;
  height: 35px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-quick-card__media img {
  width: 80%;
  height: 80%;
  object-fit: cover;
}

.home-quick-card__title {
  flex: 1;
  min-width: 0;
  font-size: clamp(10px,2.5vw,12px);
  font-weight: 600;
  text-align: left;
  line-height: 1.25;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Профиль в шапке (десктоп home) ── */
.header-container--home {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: clamp(8px, 1.2vw, 16px);
}

.header-container--home .header-left-cluster {
  grid-column: 1;
}

.header-container--home .header-settings-btn {
  grid-column: 2;
  justify-self: start;
}

.header-container--home .nav {
  grid-column: 3;
  flex: initial;
  width: 100%;
  justify-self: center;
  justify-content: center;
  gap: clamp(8px, 1vw, 40px);
}

.header-container--home .header-right-cluster {
  grid-column: 4;
  justify-self: end;
  margin-left: 0;
}

/* Гость: без иконки настроек — навигация по центру между логотипом и «Войти» */
.header-container--home.header-container--home-guest {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.header-container--home-guest .header-left-cluster {
  grid-column: 1;
}

.header-container--home-guest .nav {
  grid-column: 2;
}

.header-container--home-guest .header-right-cluster {
  grid-column: 3;
}

.header-settings-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.header-settings-btn img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  opacity: 0.88;
}

.header-settings-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.header-settings-btn:hover img {
  opacity: 1;
}

.header-settings-btn--active {
  background: rgba(178, 48, 204, 0.32);
}

.header-settings-btn--active img {
  opacity: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 14px);
  margin-left: 0;
  flex-shrink: 0;
  position: relative;
  z-index: 1002;
}

.header-profile-menu {
  position: relative;
}

.header-profile-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(200px, 28vw);
  padding: 4px 8px 4px 4px;
  border: none;
  background: transparent;
  color: #fff;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.header-profile-trigger:hover,
.header-profile-trigger[aria-expanded="true"] {
  background: transparent;
  border: none;
  box-shadow: none;
  opacity: 0.92;
}

.header-profile-trigger__avatar {
  width: clamp(28px, 2.2vw, 34px);
  height: clamp(28px, 2.2vw, 34px);
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.1);
}

.header-profile-trigger__name {
  font-size: clamp(12px, 1.1vw, 14px);
  font-weight: 600;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.header-profile-trigger__chevron {
  flex-shrink: 0;
  opacity: 0.85;
  transition: transform 0.2s ease;
}

.header-profile-trigger[aria-expanded="true"] .header-profile-trigger__chevron {
  transform: rotate(180deg);
}

.header-profile-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(300px, calc(100vw - 32px));
  z-index: 1100;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #2e1a4d;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-profile-dropdown[hidden] {
  display: none !important;
}

.header-profile-dropdown .profile-info-block {
  width: 100%;
  min-width: 0;
  max-width: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
  background: #2e1a4d;
}

.header-profile-dropdown .profile-info-block::before {
  display: none;
}

.header-profile-dropdown .profile-identity-card--compact.profile-info-block {
  padding: 16px;
}

.header-profile-dropdown .profile-info-block:hover {
  transform: none;
  box-shadow: none;
}

.header-profile-dropdown .profile-identity-card--compact .block-action-btn {
  min-width: auto;
  width: auto;
  max-width: none;
  padding: 5px 10px;
  font-size: 11px;
  gap: 5px;
  background: #b230cc;
  border-radius: 10px;
  box-shadow: none;
}

.header-profile-dropdown .profile-identity-card--compact .block-action-btn:hover {
  background: #9a1fb3;
  transform: none;
  box-shadow: none;
}

.header-profile-dropdown .profile-identity-card--compact .block-action-btn-icon {
  width: 12px;
  height: 12px;
}

.header-profile-dropdown__full {
  display: block;
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  background: #2e1a4d;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s ease, color 0.2s ease;
}

.header-profile-dropdown__full:hover {
  background: #3a2260;
  color: #fff;
}

.header-actions .login-btn {
  min-width: clamp(72px, 5vw, 110px);
  padding-left: clamp(12px, 2vw, 24px);
  padding-right: clamp(12px, 2vw, 24px);
}

/* ── Блок шаблонов ── */
.home-templates__title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -0.02em;
}

.home-templates__scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.home-templates__scroll::-webkit-scrollbar {
  display: none;
}

.home-templates__featured {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
  width: calc(100% - 4px);
  min-width: 280px;
}

.home-template-card {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.home-template-card--large {
  width: 52%;
  min-height: 200px;
}

.home-template-card--small-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: calc(48% - 10px);
}

.home-template-card--small {
  flex: 1;
  min-height: 95px;
}

.home-template-card__media {
  position: absolute;
  inset: 0;
}

.home-template-card__media img,
.home-template-card__media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-template-card__placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.5), rgba(172, 75, 255, 0.3));
}

.home-template-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.1) 55%, transparent 100%);
  pointer-events: none;
}

.home-template-card__title {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  z-index: 1;
}

.home-templates__more {
  display: flex;
  align-items: stretch;
  flex: 0 0 120px;
}

.home-templates__more-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 16px;
  padding: 12px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.home-templates__empty {
  padding: 24px 16px;
  text-align: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Футер страницы ── */
.home-footer {
  margin-top: clamp(24px, 4vh, 40px);
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

@media (min-width: 641px) {
  body.home-page .home-footer {
    padding-bottom: clamp(28px, 4vh, 48px);
  }
}

.home-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px 20px;
  align-items: start;
}

.home-footer__brand {
  min-width: 0;
}

.home-footer__name {
  margin: 0 0 6px;
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.home-footer__tagline {
  margin: 0 0 8px;
  font-size: clamp(11px, 1vw, 13px);
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}

.home-footer__copy {
  margin: 0;
  font-size: clamp(10px, 0.95vw, 12px);
  color: rgba(255, 255, 255, 0.55);
}

.home-footer__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}

.home-footer__links {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  width: 100%;
}

.home-footer__links a {
  text-align: right;
}

.home-footer__links a,
.home-footer__support {
  font-size: clamp(10px, 0.95vw, 12px);
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.home-footer__links a {
  color: rgba(255, 255, 255, 0.72);
}

.home-footer__links a:hover {
  color: #fff;
}

.home-footer__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
  width: 100%;
  max-width: 100%;
}

.home-footer__support {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 4px 12px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.home-footer__support:hover {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.42);
}

.home-footer__social {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.home-footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.home-footer__social a:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.home-footer__social svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {
  .home-footer {
    margin-top: 20px;
    padding-top: 14px;
  }

  .home-footer__inner {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    gap: 10px 10px;
  }

  .home-footer__name {
    font-size: 13px;
  }

  .home-footer__tagline {
    font-size: 10px;
    line-height: 1.35;
    margin-bottom: 6px;
  }

  .home-footer__copy {
    font-size: 10px;
  }

  .home-footer__links a,
  .home-footer__support {
    font-size: 10px;
  }

  .home-footer__support {
    height: 26px;
    padding: 0 8px;
    flex-shrink: 0;
  }

  .home-footer__social {
    gap: 4px;
  }

  .home-footer__social a {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .home-footer__social svg {
    width: 14px;
    height: 14px;
  }
}

/* ── Нижнее меню (тот же glass, что у плиток) ── */
.home-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1002;
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  background: transparent;
  border: none;
  pointer-events: none;
  overflow: visible;
}

.home-bottom-nav__inner {
  max-width: 640px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  height: 52px;
  min-height: 52px;
  padding: 0 8px;
  border-radius: 0;
  overflow: visible;
  position: relative;
  pointer-events: auto;
  box-sizing: border-box;

  background: linear-gradient(160deg,
    rgba(255, 255, 255, 0.20) 0%,
    rgba(255, 255, 255, 0.04) 45%,
    rgba(60, 30, 100, 0.18) 100%);

  border: none;
  border-top: 1.5px solid rgba(255, 255, 255, 0.55);
  border-bottom: 1.5px solid rgba(255, 255, 255, 0.35);

  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);

  box-shadow:
    inset 0 0 26px rgba(255, 255, 255, 0.22),
    inset 0 0 40px rgba(186, 130, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 8px 18px rgba(0, 0, 0, 0.3);
}

.home-bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 40px;
  padding: 0 2px;
  border-radius: 10px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.home-bottom-nav__item:active {
  transform: scale(0.96);
}

.home-bottom-nav__item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 0 16px rgba(186, 130, 255, 0.15);
}

.home-bottom-nav__item img,
.home-bottom-nav__item svg {
  width: 22px;
  height: 22px;
  opacity: 0.9;
}

.home-bottom-nav__item.active img {
  filter: none;
  opacity: 1;
}

.home-bottom-nav__item:not(.active) img {
  filter: brightness(0) invert(1);
  opacity: 0.75;
}

.home-bottom-nav__item--center {
  position: relative;
  justify-content: center;
  align-items: center;
  min-height: 40px;
  padding: 0;
  gap: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.home-bottom-nav__item--center:active {
  transform: none;
}

.home-bottom-nav__item--center:active .home-bottom-nav__fab {
  transform: translateX(-50%) scale(0.96);
}

.home-bottom-nav__fab {
  position: absolute;
  left: 50%;
  top: -16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  margin-top: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #c93de6 0%, #9a1fb3 100%);
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 6px 18px rgba(0, 0, 0, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.home-bottom-nav__item--center .home-bottom-nav__fab img {
  width: 24px;
  height: 24px;
  filter: none !important;
  opacity: 1 !important;
}

.home-bottom-nav__item--center.active .home-bottom-nav__fab {
  background: linear-gradient(145deg, #d85af0 0%, #b230cc 100%);
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.28),
    0 8px 22px rgba(178, 48, 204, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.home-bottom-nav__label {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.05;
}

/* Веб-версия: шапка index, ширина content-wrapper, плитки в одну строку */
@media (min-width: 641px) {
  body.home-page {
    padding-bottom: 0;
  }

  .home-topbar {
    display: none;
  }

  .home-bottom-nav {
    display: none;
  }

  .home-shell.content-wrapper {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 clamp(16px, 5vw, 80px);
    box-sizing: border-box;
    overflow: visible;
  }

  .home {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 0 0 32px;
    min-height: auto;
    overflow: visible;
  }

  .home-hero {
    margin-top: clamp(15px, 3.5vh, 50px);
    margin-bottom: clamp(24px, 4vh, 48px);
    padding: clamp(14px, 1.6vh, 18px) clamp(10px, 1.2vw, 14px);
    border-radius: 20px;
  }

  .home-hero__title {
    margin-bottom: clamp(16px, 2vh, 22px);
    font-size: clamp(22px, 2.2vw, 32px);
    text-align: left;
  }

  .home-hero__form {
    gap: clamp(12px, 1.4vh, 16px);
  }

  .home-hero__input-wrap {
    align-items: center;
    min-height: clamp(56px, 5vh, 64px);
    padding: clamp(8px, 1vh, 10px) clamp(12px, 1.2vw, 14px) clamp(8px, 1vh, 10px) clamp(16px, 1.4vw, 20px);
    border-radius: 20px;
  }

  .home-hero__input {
    font-size: clamp(15px, 1.1vw, 17px);
  }

  .home-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(12px, 1.8vw, 24px);
    margin-top: 0;
    margin-bottom: clamp(24px, 4vh, 48px);
  }

  .home-tile {
    aspect-ratio: auto;
    min-height: 158px;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: clamp(16px, 1.8vh, 20px) clamp(10px, 1.2vw, 14px);
    text-align: center;
  }

  .home-tile:hover {
    transform: translateY(-4px);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.28),
      inset 0 0 26px rgba(255, 255, 255, 0.22),
      inset 0 0 40px rgba(186, 130, 255, 0.18),
      inset 0 1px 0 rgba(255, 255, 255, 0.5),
      inset 0 -1px 0 rgba(0, 0, 0, 0.25),
      0 12px 28px rgba(0, 0, 0, 0.32);
  }

  .home-tile__icon {
    width: 48px;
    height: 48px;
  }

  .home-tile__icon img {
    width: 48px;
    height: 48px;
  }

  .home-tile__body {
    align-items: center;
    flex: 1;
    gap: 6px;
    width: 100%;
  }

  .home-tile__label {
    text-align: center;
    font-size: clamp(13px, 1.1vw, 16px);
    font-weight: 600;
    line-height: 1.25;
  }

  .home-tile__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    max-height: calc(1.35em * 2);
    font-size: clamp(11px, 0.95vw, 13px);
    font-weight: 400;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.78);
    text-align: center;
  }

  .home-popular__head {
    margin-bottom: 16px;
  }

  .home-quick__track {
    gap: clamp(10px, 1.2vw, 14px);
    padding-bottom: 0;
  }

  .home-quick-card {
    width: min(200px, 18vw);
    padding: clamp(10px, 1vh, 12px) clamp(14px, 1.2vw, 16px) clamp(10px, 1vh, 12px) clamp(10px, 1vh, 12px);
    gap: clamp(10px, 1vw, 12px);
    border-radius: 16px;
  }

  .home-quick-card:hover {
    transform: translateY(-2px);
    z-index: 5;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.42),
      0 8px 20px rgba(0, 0, 0, 0.24);
  }

  .home-quick-card__media {
    width: clamp(35px, 3.6vw, 52px);
    height: clamp(35px, 3.6vw, 52px);
    border-radius: 12px;
  }

  .home-quick-card__title {
    font-size: clamp(12px, 0.95vw, 14px);
  }

  .home-section-heading {
    font-size: clamp(18px, 1.6vw, 22px);
    margin-bottom: clamp(14px, 1.8vh, 20px);
  }
}

@media (min-width: 801px) {
  .home-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* YooKassa neurons dialog (wallet / profile replenish) */
.yookassa-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  margin: 0;
  padding: 0;
  border: none;
  max-width: 92vw;
  width: min(420px, calc(100vw - 32px));
  max-height: min(90dvh, calc(100vh - 32px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: transparent;
  box-shadow: none;
  color: #1e293b;
}

.yookassa-dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}

.yookassa-dialog-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 20px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(59, 0, 49, 0.18);
}

.yookassa-dialog-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #6b7280;
  z-index: 2;
}

.yookassa-dialog-title {
  margin: 0 28px 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: #3b0031;
  flex-shrink: 0;
}

.yookassa-dialog-hint {
  margin: 0 0 12px;
  color: #475569;
  font-size: 14px;
  flex-shrink: 0;
}

.yookassa-dialog-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.yookassa-modal-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #B230CC;
  background: #B230CC;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.yookassa-modal-option:hover {
  background: #9a1fb3;
  border-color: #9a1fb3;
}
