/* VK Mini App — этап 10.1–10.6: переменные, темы, профиль */

:root,
html[data-theme="light"] {
  /* Фоны главного экрана: положите файлы в miniapp/images/ */
  --app-bg-fallback: #b8e8b0;
  --app-bg-image: url("../images/bg-day.png");
  --logo-glow: rgba(0, 0, 0, 0.1);
  --color-sky: #a8dff0;
  --color-sky-deep: #7ec8e3;
  --color-grass: #b8e986;
  --color-grass-deep: #89c764;
  --color-card: rgba(255, 255, 255, 0.92);
  --color-text: #1a2b3c;
  --color-text-muted: #5a6b7c;
  --color-nav-active: #4a9fe8;
  --color-nav-bg: rgba(255, 255, 255, 0.88);
  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 16px;
  --radius-pill: 999px;
  --font-heading: "Nunito", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font: var(--font-body);
  --bottom-nav-h: 64px;
  --header-h: 52px;
}

html.theme-dark,
html[data-theme="dark"] {
  --app-bg-fallback: #121212;
  --app-bg-image: url("../images/bg-night.png");
  --logo-glow: rgba(255, 255, 255, 0.1);
  --color-sky: #1a2332;
  --color-sky-deep: #243044;
  --color-grass: #2d4a38;
  --color-grass-deep: #3d6b4f;
  --color-card: rgba(36, 44, 58, 0.94);
  --color-text: #e8eef4;
  --color-text-muted: #9aacbc;
  --color-nav-active: #6ab8f0;
  --color-nav-bg: rgba(28, 36, 48, 0.92);
  --shadow-soft: 0 4px 16px rgba(0, 0, 0, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-body);
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
}

/* Заголовки: Nunito; основной текст и кнопки наследуют Inter с body */
h1,
h2,
h3,
.modal__title,
.popular__title,
.home-tile__label,
.catalog-card__name,
.product-modal__title,
.profile-head__name,
.profile-block__title,
.cart-success__title {
  font-family: var(--font-heading);
}

.catalog-card__btn,
.cart-checkout-btn,
.catalog-retry-btn,
.profile-btn-secondary,
.profile-btn-exit,
.profile-tabs__btn,
.bottom-nav__label,
.popular-card__price,
.catalog-card__price,
.catalog-card__badge,
.catalog-filter {
  font-family: var(--font-body);
}

body {
  overflow-x: hidden;
  background-color: var(--app-bg-fallback);
  background-image: var(--app-bg-image);
  /* Плитка как у старого луга; для «cover на весь экран» замените на: background-size: cover; background-repeat: no-repeat; */
  background-size: 480px auto;
  background-repeat: repeat;
  background-position: center top;
  background-attachment: fixed;
  position: relative;
}

html.theme-dark body,
html[data-theme="dark"] body {
  background: transparent;
}

html.theme-dark body::before,
html[data-theme="dark"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--app-bg-fallback);
  background-image: var(--app-bg-image);
  background-size: 480px auto;
  background-repeat: repeat;
  background-position: center top;
  background-attachment: fixed;
}

/* Декор SVG: слой скрыт; фон задаётся body / body::before */
html:not(.theme-dark) .app-bg-decor {
  display: none;
}

.app-bg-decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

html.theme-dark .app-bg-decor {
  display: none;
}

html[data-theme="light"] .app-bg-decor,
html[data-theme="dark"] .app-bg-decor {
  display: none;
}

.app-bg-decor__blob {
  position: absolute;
  border-radius: 50%;
}

.app-bg-decor__blob--a {
  width: 200px;
  height: 200px;
  top: 8%;
  left: -60px;
  background: radial-gradient(
    circle,
    rgba(255, 182, 193, 0.42) 0%,
    transparent 72%
  );
}

.app-bg-decor__blob--b {
  width: 160px;
  height: 160px;
  bottom: 22%;
  right: -40px;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.5) 0%,
    transparent 70%
  );
}

.app-bg-decor__blob--c {
  width: 140px;
  height: 140px;
  top: 42%;
  right: 10%;
  background: radial-gradient(
    circle,
    rgba(173, 216, 230, 0.45) 0%,
    transparent 68%
  );
}

.app-bg-decor__flower {
  position: absolute;
  opacity: 0.55;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.06));
}

.app-bg-decor__flower--1 {
  bottom: 12%;
  left: 8%;
  width: 72px;
  height: auto;
}

.app-bg-decor__flower--2 {
  top: 24%;
  right: 6%;
  width: 52px;
  height: auto;
}

.app,
.app-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  max-width: 100%;
  overflow-x: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: var(--header-h);
  padding: 8px 16px;
  padding-top: max(8px, env(safe-area-inset-top));
  background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

html.theme-dark .app-header {
  background: rgba(28, 36, 48, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

/* Компактная группа [←] название [→] сразу после аватара, без растягивания на весь экран */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 1 auto;
  min-width: 0;
}

.header-nav.header-nav-compact {
  gap: 12px;
}

.header-arrow {
  flex-shrink: 0;
  margin: 0;
  padding: 6px 6px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.35);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

html.theme-dark .header-arrow {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text);
}

.header-arrow:hover {
  background: rgba(74, 159, 232, 0.15);
}

html.theme-dark .header-arrow:hover {
  background: rgba(106, 184, 240, 0.14);
}

.header-arrow:active {
  transform: scale(0.96);
}

.header-arrow:focus-visible {
  outline: 2px solid var(--color-nav-active);
  outline-offset: 2px;
}

.header-title {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(62vw, 260px);
  padding: 0 4px;
  text-align: center;
  color: var(--color-text);
  line-height: 1.15;
  font-family: var(--font-heading);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  row-gap: 1px;
}

.header-title-main {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.01em;
}

.header-title-sub {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.header-user {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--color-card);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.header-user__ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text-muted);
  background: linear-gradient(135deg, #e8f4fc, #d8f0e8);
}

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

.header-user__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.header-user:focus-visible {
  outline: 2px solid var(--color-nav-active);
  outline-offset: 2px;
}

.user-pill {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-card);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-soft);
  max-width: 50vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-main {
  flex: 1;
  padding: 16px;
  padding-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card-surface {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

/* Логотип главной: квадратный PNG с прозрачным фоном, без круговой маски */
.home-banner {
  margin: 0 0 -20px;
  overflow: visible;
  line-height: 0;
  background: transparent;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Контейнер логотипа + 4 клешни по углам. Ширина увеличена, чтобы картинка
   уходила ближе к краям экрана; прозрачные поля PNG компенсируются ниже. */
.home-banner__stage {
  position: relative;
  width: min(560px, calc(100vw - 8px));
  height: min(560px, calc(100vw - 8px));
  flex-shrink: 0;
  overflow: visible;
}

.home-banner__logo-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
}

html.theme-dark .home-banner__logo-wrap {
  box-shadow: none;
}

/* Логотип «выпускаем» чуть за границы контейнера: PNG имеет ~5–7% прозрачных
   полей по краям, поэтому полезная часть так заполняет всю ширину, а воздух
   снизу до кнопки уходит. */
.home-banner__img--logo {
  display: block;
  width: 124%;
  height: auto;
  margin: -12% -12%;
  object-fit: contain;
  border-radius: 0;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.12));
}

html.theme-dark .home-banner__img--logo {
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.45));
}

/* TEMP: клешни временно скрыты до доработки позиционирования/анимации.
   Снять — убрать правило ниже. Код клешней и keyframes сохранён ниже. */
.home-banner__stage .claw {
  display: none !important;
}

/* Клешни: pop (translate+scale на .claw) — вылет из-под логотипа к углу; rotate+snap на .claw__inner */
.claw {
  position: absolute;
  z-index: 1;
  width: 92px;
  height: 92px;
  box-sizing: border-box;
  pointer-events: none;
  --claw-angle: 135deg;
  --angle: var(--claw-angle);
  --claw-pop-sx: 0px;
  --claw-pop-sy: 0px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.claw__inner {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(var(--angle));
  transform-origin: center center;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.claw__img {
  display: block;
  width: 100%;
  height: auto;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
}

/* Ближе к углам стейджа (и слегка наружу сверху), чтобы не прятались под непрозрачным кругом логотипа */
.claw--tl {
  top: -8px;
  left: -8px;
  --claw-angle: 135deg;
  --claw-pop-sx: 80px;
  --claw-pop-sy: 80px;
}
.claw--tr {
  top: 4px;
  right: 36px;
  left: auto;
  --claw-angle: -135deg;
  --claw-pop-sx: -80px;
  --claw-pop-sy: 80px;
}
.claw--bl {
  bottom: 10px;
  left: 10px;
  top: auto;
  --claw-angle: 45deg;
  --claw-pop-sx: 80px;
  --claw-pop-sy: -80px;
}
.claw--br {
  bottom: 10px;
  right: 10px;
  left: auto;
  top: auto;
  --claw-angle: -45deg;
  --claw-pop-sx: -80px;
  --claw-pop-sy: -80px;
}

/* Верхняя левая: отдельный PNG — блок ~17% крупнее базового 92px */
.claw--with-toy {
  width: 110px;
  height: 110px;
}
.claw--with-toy .claw__img {
  object-fit: contain;
}

.claw:not(.claw--popped) {
  opacity: 0;
  transform: translate(var(--claw-pop-sx), var(--claw-pop-sy)) scale(0.4);
  animation: none;
}

.claw:not(.claw--popped) .claw__inner {
  animation: none;
}

@keyframes claw-pop {
  0% {
    opacity: 0;
    transform: translate(var(--claw-pop-sx), var(--claw-pop-sy)) scale(0.4);
  }
  44% {
    opacity: 0;
    transform: translate(calc(var(--claw-pop-sx) * 0.14), calc(var(--claw-pop-sy) * 0.14))
      scale(0.88);
  }
  58% {
    opacity: 1;
    transform: translate(
        calc(var(--claw-pop-sx) * -0.14),
        calc(var(--claw-pop-sy) * -0.14)
      )
      scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
}

@keyframes claw-snap {
  0%,
  100% {
    transform: rotate(var(--angle)) scale(1, 1);
  }
  50% {
    transform: rotate(var(--angle)) scale(0.6, 0.8);
  }
}

.claw--popped {
  animation: claw-pop 0.6s cubic-bezier(0.34, 1.25, 0.55, 1) forwards;
}

.claw__inner.claw--snapping {
  animation: claw-snap 2s ease-in-out infinite;
}

/* Главная: кнопка «Обменять игрушки» над плитками (выше возможного overflow баннера) */
.home-exchange-wrap {
  position: relative;
  z-index: 5;
  padding: 0 2px 0;
  margin-top: -4px;
}

.home-action-btn {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 16px;
  border: none;
  border-radius: 16px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.25;
  text-align: center;
  color: #fff;
  cursor: pointer;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 8px 24px rgba(255, 152, 0, 0.35);
  background: linear-gradient(
    145deg,
    #ffb74d 0%,
    #ff9800 45%,
    #ffc107 100%
  );
  transition: transform 0.12s, box-shadow 0.12s;
}

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

html.theme-dark .home-action-btn,
html[data-theme="dark"] .home-action-btn {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  background: linear-gradient(
    145deg,
    #c77800 0%,
    #e65100 50%,
    #f9a825 100%
  );
}

.catalog-action-btn {
  box-shadow: 0 6px 20px rgba(255, 152, 0, 0.28);
}

html.theme-dark .catalog-action-btn,
html[data-theme="dark"] .catalog-action-btn {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.32);
}

.catalog-exchange-cta {
  padding: 12px 16px 14px;
}

.catalog-exchange-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px 12px;
}

.catalog-exchange-bar__text {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-text);
  flex: 1 1 12rem;
}

.catalog-exchange-bar__reset {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-nav-active);
  background: rgba(74, 159, 232, 0.15);
  cursor: pointer;
}

.catalog-exchange-bar__reset:active {
  opacity: 0.88;
}

html.theme-dark .catalog-exchange-bar__reset,
html[data-theme="dark"] .catalog-exchange-bar__reset {
  background: rgba(100, 181, 246, 0.18);
  color: #90caf9;
}

.exchange-modal-panel.modal__panel {
  max-width: 22rem;
}

.exchange-modal-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.exchange-modal__input {
  width: 100%;
  box-sizing: border-box;
}

.exchange-modal__hint {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-muted);
  line-height: 1.4;
}

.exchange-modal__submit {
  margin-top: 4px;
}

/* Главная: сетка 2×2 — контейнер без «карточки», плитки отдельно (п. 3.1) */
.home-quick.card-surface {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

.home-quick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 2px 14px;
}

.home-tile {
  --home-tile-icon-max: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-height: 142px;
  padding: 10px 8px 12px;
  border: none;
  border-radius: 20px;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Те же оттенки, полупрозрачные (альфа ещё −15% к предыдущему шагу) */
.home-tile--catalog {
  background: linear-gradient(
    165deg,
    rgba(126, 200, 227, 0.61) 0%,
    rgba(74, 159, 216, 0.66) 100%
  );
}

.home-tile--cart {
  background: linear-gradient(
    165deg,
    rgba(255, 143, 171, 0.61) 0%,
    rgba(240, 98, 146, 0.66) 100%
  );
}

.home-tile--orders {
  background: linear-gradient(
    165deg,
    rgba(174, 213, 129, 0.61) 0%,
    rgba(124, 179, 66, 0.66) 100%
  );
}

.home-tile--help {
  background: linear-gradient(
    165deg,
    rgba(255, 204, 128, 0.61) 0%,
    rgba(255, 152, 0, 0.66) 100%
  );
}

html.theme-dark .home-tile--catalog {
  background: linear-gradient(
    165deg,
    rgba(53, 107, 140, 0.64) 0%,
    rgba(42, 85, 112, 0.7) 100%
  );
}

html.theme-dark .home-tile--cart {
  background: linear-gradient(
    165deg,
    rgba(184, 77, 104, 0.64) 0%,
    rgba(142, 58, 82, 0.7) 100%
  );
}

html.theme-dark .home-tile--orders {
  background: linear-gradient(
    165deg,
    rgba(90, 122, 63, 0.64) 0%,
    rgba(61, 86, 40, 0.7) 100%
  );
}

html.theme-dark .home-tile--help {
  background: linear-gradient(
    165deg,
    rgba(184, 122, 46, 0.64) 0%,
    rgba(143, 92, 31, 0.7) 100%
  );
}

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

/* PNG с прозрачным фоном — без круга и белой подложки */
.home-tile__media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex: 1;
  min-height: 0;
  background: transparent;
}

.home-tile__media img {
  max-width: 100%;
  max-height: var(--home-tile-icon-max);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.12));
}

/* menu-help визуально мельче — ровно +10% к лимиту остальных */
.home-tile--help .home-tile__media img {
  max-height: calc(var(--home-tile-icon-max) * 1.1);
}

.home-tile__label {
  font-size: calc(17px * 1.15);
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
}

.home-tile:focus-visible {
  outline: 2px solid var(--color-nav-active);
  outline-offset: 2px;
}

/* Главное меню: горизонтальные карточки (иконка + текст + шеврон) */
.home-menu {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 2px 14px;
  margin-top: 10px;
}

.home-menu__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  color: var(--color-text);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.home-menu__item:active {
  transform: scale(0.99);
  background: rgba(255, 255, 255, 0.92);
}

.home-menu__item:focus-visible {
  outline: 2px solid var(--color-nav-active);
  outline-offset: 2px;
}

.home-menu__icon {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
}

.home-menu__icon img {
  max-width: 44px;
  max-height: 44px;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

.home-menu__icon--catalog {
  background: linear-gradient(165deg, rgba(126, 200, 227, 0.36), rgba(74, 159, 216, 0.42));
}
.home-menu__icon--cart {
  background: linear-gradient(165deg, rgba(255, 143, 171, 0.36), rgba(240, 98, 146, 0.42));
}
.home-menu__icon--orders {
  background: linear-gradient(165deg, rgba(174, 213, 129, 0.36), rgba(124, 179, 66, 0.42));
}
.home-menu__icon--help {
  background: linear-gradient(165deg, rgba(255, 204, 128, 0.4), rgba(255, 152, 0, 0.46));
}

.home-menu__text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  row-gap: 2px;
}

.home-menu__title {
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-menu__sub {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.2;
  opacity: 0.65;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-menu__chev {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 2px;
  background: linear-gradient(145deg, #ffb74d 0%, #ff9800 45%, #ffc107 100%);
  box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3);
}

html.theme-dark .home-menu__item {
  background: rgba(30, 36, 45, 0.68);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

html.theme-dark .home-menu__item:active {
  background: rgba(30, 36, 45, 0.85);
}

html.theme-dark .home-menu__icon {
  background: rgba(255, 255, 255, 0.05);
}

html.theme-dark .home-menu__sub {
  opacity: 0.75;
}

/* Популярное */
#screen-home .popular.card-surface {
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
}

html.theme-dark #screen-home .popular.card-surface {
  background: rgba(36, 44, 58, 0.72);
}

.popular {
  padding: 14px 0 14px 14px;
  overflow: hidden;
}

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

.popular__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
}

.popular__more {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-nav-active);
  cursor: pointer;
  padding: 4px 0;
}

.popular__scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.popular__scroll:focus-visible {
  outline: 2px solid var(--color-nav-active);
  outline-offset: 4px;
}

.popular-card {
  flex: 0 0 42%;
  max-width: 160px;
  scroll-snap-align: start;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

html.theme-dark .popular-card {
  background: rgba(36, 44, 58, 0.92);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.popular-card__img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  margin-bottom: 8px;
  background-size: cover;
  background-position: center;
}

.popular-card__img--1 {
  background-image: linear-gradient(145deg, #c8e6f5 0%, #a8d8f0 100%);
}

.popular-card__img--2 {
  background-image: linear-gradient(145deg, #e8d4f0 0%, #c8b8e8 100%);
}

.popular-card__img--3 {
  background-image: linear-gradient(145deg, #d8f0d0 0%, #b8e8a8 100%);
}

.popular-card__img--4 {
  background-image: linear-gradient(145deg, #f5e8c8 0%, #f0d8a0 100%);
}

.popular-card__photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  margin-bottom: 8px;
  object-fit: cover;
  display: block;
  background: #eef2f4;
}

.popular__hint {
  margin: 0;
  padding: 12px 14px 12px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.popular-card__name {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.popular-card__price {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-grass-deep);
}

.popular-item {
  cursor: pointer;
  outline: none;
}

.popular-item:focus-visible {
  outline: 2px solid var(--color-nav-active);
  outline-offset: 3px;
}

/* Модалка карточки товара (главная → каталог) */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
}

.product-modal[hidden] {
  display: none !important;
}

.product-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 43, 60, 0.5);
  backdrop-filter: blur(4px);
}

.product-modal__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: min(88vh, 640px);
  margin-bottom: 10px;
  padding: 16px 16px 20px;
  overflow-y: auto;
  z-index: 1;
  animation: modalUp 0.22s ease;
}

.product-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text);
}

.product-modal__body {
  padding-top: 8px;
}

.product-modal__photo {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 14px;
  margin-bottom: 12px;
  background: #eef2f4;
  cursor: zoom-in;
}

.product-modal__ph {
  width: 100%;
  aspect-ratio: 1;
  max-height: 220px;
  border-radius: 14px;
  margin-bottom: 12px;
  background: linear-gradient(145deg, #e8eef2, #d8e8ec);
}

.product-modal__title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.25;
  padding-right: 36px;
}

.product-modal__price {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-grass-deep);
}

.product-modal__desc {
  margin: 0 0 14px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  white-space: pre-wrap;
}

.product-modal__loading,
.product-modal__err {
  margin: 0;
  padding: 24px 8px;
  text-align: center;
  font-weight: 700;
  color: var(--color-text-muted);
}

.product-modal__cart {
  width: 100%;
  margin-top: 4px;
}

/* Лайтбокс фото товара */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.92);
}

.image-lightbox[hidden] {
  display: none !important;
}

.image-lightbox__backdrop {
  position: absolute;
  inset: 0;
}

.image-lightbox__frame {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 12px 56px;
  box-sizing: border-box;
}

.image-lightbox__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-drag: none;
}

.image-lightbox__close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 4;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 44px;
  height: 72px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox__nav--prev {
  left: 8px;
}

.image-lightbox__nav--next {
  right: 8px;
}

/* Модалка «Помощь» */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
}

.modal[hidden] {
  display: none !important;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 43, 60, 0.45);
  backdrop-filter: blur(4px);
}

.modal__panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: min(70vh, 480px);
  margin-bottom: 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  z-index: 1;
  animation: modalUp 0.22s ease;
}

@keyframes modalUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.modal__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-heading);
}

.help-modal__title {
  font-size: 1.12rem;
  line-height: 1.3;
}

html.theme-dark .modal__head,
html[data-theme="dark"] .modal__head {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.modal__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text);
}

.modal__body {
  padding: 12px 16px 20px;
  overflow-y: auto;
  font-size: 0.92rem;
  line-height: 1.55;
  font-family: var(--font-body);
  color: var(--color-text);
}

/* «Помощь»: карточки шагов */
.help-modal-body {
  padding-top: 8px;
}

.help-modal-panel.modal__panel {
  max-height: min(78vh, 560px);
}

.help-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.help-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

html.theme-dark .help-step,
html[data-theme="dark"] .help-step {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.help-step__num {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.help-step:nth-child(1) .help-step__num {
  background: linear-gradient(145deg, #5b86e5, #36d1dc);
}

.help-step:nth-child(2) .help-step__num {
  background: linear-gradient(145deg, #f857a6, #ff5858);
}

.help-step:nth-child(3) .help-step__num {
  background: linear-gradient(145deg, #f6d365, #fda085);
  color: #3d2914;
}

.help-step:nth-child(4) .help-step__num {
  background: linear-gradient(145deg, #667eea, #764ba2);
}

.help-step:nth-child(5) .help-step__num {
  background: linear-gradient(145deg, #11998e, #38ef7d);
}

.help-step__text {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--color-text);
  padding-top: 5px;
}

.help-modal__footer {
  margin: 16px 0 4px;
  padding: 14px 16px;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.35;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 214, 125, 0.45), rgba(255, 180, 120, 0.35));
  border: 1px solid rgba(255, 200, 100, 0.45);
  color: var(--color-text);
}

html.theme-dark .help-modal__footer,
html[data-theme="dark"] .help-modal__footer {
  background: linear-gradient(135deg, rgba(255, 200, 100, 0.18), rgba(255, 150, 80, 0.12));
  border-color: rgba(255, 200, 120, 0.2);
}

.screen {
  animation: fadeIn 0.2s ease;
}

.screen[hidden] {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.placeholder-card {
  background: var(--color-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 24px;
  max-width: 560px;
  margin: 0 auto;
}

.placeholder-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.placeholder-card p {
  margin: 0;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Нижняя навигация */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  min-height: var(--bottom-nav-h);
  padding: 6px 8px;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
  background: var(--color-nav-bg);
  backdrop-filter: blur(12px);
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
  border-radius: var(--radius) var(--radius) 0 0;
}

.bottom-nav__btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0 2px;
  padding: 6px 4px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: 12px;
  transition: background 0.15s, color 0.15s;
}

.bottom-nav__badge {
  position: absolute;
  top: 2px;
  right: 18%;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 18px;
  color: #fff;
  background: #e64646;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.bottom-nav__btn:active {
  transform: scale(0.97);
}

.bottom-nav__icon {
  font-size: 1.35rem;
  line-height: 1;
}

.bottom-nav__btn--active {
  color: var(--color-nav-active);
  background: rgba(74, 159, 232, 0.15);
}

.bottom-nav__btn--active .bottom-nav__icon {
  filter: saturate(1.2);
}

.bottom-nav__btn:focus-visible {
  outline: 2px solid var(--color-nav-active);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Каталог (10.3) */
.catalog-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.app-main > .screen:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.catalog-head {
  padding: 14px 16px 16px;
}

.catalog-search {
  display: block;
}

.catalog-search__input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  background: rgba(255, 255, 255, 0.85);
}

.catalog-search__input::placeholder {
  color: var(--color-text-muted);
  font-weight: 600;
}

.catalog-filters-outer {
  padding: 10px 0 10px 12px;
  overflow: hidden;
}

.catalog-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.catalog-filter {
  flex: 0 0 auto;
  scroll-snap-align: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.55);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.catalog-filter--active {
  color: var(--color-text);
  background: rgba(74, 159, 232, 0.2);
  border-color: rgba(74, 159, 232, 0.45);
}

.catalog-filter__icon {
  font-size: 1rem;
  line-height: 1;
}

.catalog-filter:focus-visible {
  outline: 2px solid var(--color-nav-active);
  outline-offset: 2px;
}

.catalog-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

.catalog-state--center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 16px;
  text-align: center;
}

/* display:flex у .catalog-state--center ломает скрытие через [hidden] — иначе висят и ошибка, и «пусто» */
.catalog-state[hidden],
.catalog-state--center[hidden] {
  display: none !important;
}

.catalog-state__text {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.catalog-retry-btn {
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--color-nav-active), #3a8fd8);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.catalog-retry-btn:active {
  transform: scale(0.98);
}

.catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-content: start;
}

.catalog-card {
  background: var(--color-card);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.catalog-card__img,
.catalog-card__photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  margin-bottom: 8px;
}

.catalog-card__photo {
  display: block;
  object-fit: cover;
  background: #eef2f4;
}

.catalog-card__img--1 {
  background-image: linear-gradient(145deg, #c8e6f5 0%, #a8d8f0 100%);
}
.catalog-card__img--2 {
  background-image: linear-gradient(145deg, #f0d8e8 0%, #e8b8d8 100%);
}
.catalog-card__img--3 {
  background-image: linear-gradient(145deg, #e8d8c8 0%, #d8c0a0 100%);
}
.catalog-card__img--4 {
  background-image: linear-gradient(145deg, #e8d4f0 0%, #c8b8e8 100%);
}
.catalog-card__img--5 {
  background-image: linear-gradient(145deg, #d0d8e8 0%, #b8c8e0 100%);
}
.catalog-card__img--6 {
  background-image: linear-gradient(145deg, #d8f0d0 0%, #b8e8a8 100%);
}
.catalog-card__img--7 {
  background-image: linear-gradient(145deg, #f5e8c8 0%, #e8d090 100%);
}
.catalog-card__img--8 {
  background-image: linear-gradient(145deg, #e0e8f8 0%, #c8d4f0 100%);
}

.catalog-card__name {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-card__price {
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--color-grass-deep);
}

.catalog-card__badge {
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.3;
}

.catalog-card__badge--ok {
  color: var(--color-grass-deep);
}

.catalog-card__badge--bad {
  color: var(--color-text-muted);
}

.catalog-card__btn {
  margin-top: auto;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(180deg, var(--color-grass) 0%, var(--color-grass-deep) 100%);
  cursor: pointer;
}

.catalog-card__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #b0b8c0;
}

.catalog-card__btn:not(:disabled):active {
  transform: scale(0.98);
}

/* Скелетон каталога */
.catalog-grid--skel {
  pointer-events: none;
}

.catalog-skel-card {
  background: var(--color-card);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.catalog-skel-card__img {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #e8eef2 0%, #f4f8fa 50%, #e8eef2 100%);
  background-size: 200% 100%;
  animation: catalogSkel 1.1s ease-in-out infinite;
}

.catalog-skel-card__line {
  height: 10px;
  border-radius: 6px;
  margin-bottom: 8px;
  background: #e4eaee;
  animation: catalogSkel 1.1s ease-in-out infinite;
}

.catalog-skel-card__line--title {
  width: 88%;
}

.catalog-skel-card__line--short {
  width: 45%;
  margin-bottom: 10px;
}

.catalog-skel-card__badge {
  height: 12px;
  width: 70%;
  border-radius: 6px;
  margin-bottom: 10px;
  background: #e8eef0;
}

.catalog-skel-card__btn {
  height: 32px;
  border-radius: 10px;
  background: #e4e8ec;
}

@keyframes catalogSkel {
  0%,
  100% {
    opacity: 0.65;
  }
  50% {
    opacity: 1;
  }
}

/* Корзина и оформление (10.5) */
.cart-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.cart-panel {
  margin: 0;
}

.cart-hint {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
}

.cart-lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.cart-line {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 10px;
}

.cart-line__media {
  width: 72px;
  flex-shrink: 0;
}

.cart-line__photo {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  background: #eef2f4;
}

.cart-line__ph {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  background: linear-gradient(145deg, #e8eef2, #d8e8ec);
}

.cart-line__name {
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 4px;
}

.cart-line__price {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.cart-line__controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.cart-line__qtybtn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 800;
  background: rgba(74, 159, 232, 0.2);
  color: var(--color-text);
  cursor: pointer;
  line-height: 1;
}

.cart-line__qtynum {
  min-width: 22px;
  text-align: center;
  font-weight: 800;
}

.cart-line__sub {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-grass-deep);
}

.cart-line__del {
  border: none;
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.75;
}

.cart-total {
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.cart-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  margin-bottom: 10px;
}

.cart-field__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text-muted);
}

.cart-field__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
}

.cart-field__hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.cart-order-err {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(230, 70, 70, 0.12);
  color: #b03030;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: pre-wrap;
}

.cart-checkout-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, var(--color-grass) 0%, var(--color-grass-deep) 100%);
  box-shadow: var(--shadow-soft);
}

.cart-checkout-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #a8b0b8;
}

.cart-checkout-btn:not(:disabled):active {
  transform: scale(0.99);
}

.cart-success {
  text-align: center;
  padding: 20px 16px;
}

.cart-success__title {
  margin: 0 0 16px;
  font-size: 1.15rem;
  font-weight: 800;
}

/* Профиль (10.6) */
.profile-screen {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.profile-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-head {
  padding: 14px 16px;
}

.profile-head__user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-head__avatar,
.profile-head__ph {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}

.profile-head__ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  background: linear-gradient(135deg, #e8f4fc, #d8f0e8);
  color: var(--color-text-muted);
}

/* display:flex у плейсхолдера перебивает атрибут hidden — без этого видны и фото, и круг */
.profile-head__ph[hidden] {
  display: none !important;
}

html.theme-dark .profile-head__ph {
  background: linear-gradient(135deg, #2a3848, #2a4038);
  color: var(--color-text-muted);
}

.profile-head__text {
  min-width: 0;
}

.profile-head__name {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
}

.profile-head__link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-nav-active);
  text-decoration: none;
  word-break: break-all;
}

.profile-head__link:active {
  opacity: 0.85;
}

.profile-tabs {
  display: flex;
  padding: 6px;
  gap: 6px;
}

.profile-tabs__btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.profile-tabs__btn--active {
  color: var(--color-nav-active);
  background: rgba(74, 159, 232, 0.18);
}

.profile-panel--orders {
  display: none;
}

#screen-profile[data-tab="orders"] .profile-panel--main {
  display: none;
}

#screen-profile[data-tab="orders"] .profile-panel--orders {
  display: block;
}

.profile-block {
  padding: 14px 16px;
  margin-bottom: 10px;
}

.profile-block__title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 800;
}

.profile-hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--color-text-muted);
  font-weight: 600;
}

.profile-stats__line {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.profile-stats__line:last-child {
  margin-bottom: 0;
}

.profile-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.profile-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.profile-toggle__slider {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #c8d4dc;
  flex-shrink: 0;
  transition: background 0.2s;
}

.profile-toggle__slider::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.profile-toggle__input:checked + .profile-toggle__slider {
  background: var(--color-nav-active);
}

.profile-toggle__input:checked + .profile-toggle__slider::after {
  transform: translateX(20px);
}

.profile-toggle__label {
  font-size: 0.95rem;
  font-weight: 700;
}

.profile-phone-line {
  margin: 0 0 10px;
  font-size: 0.92rem;
  font-weight: 600;
}

.profile-btn-secondary {
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-nav-active);
  background: rgba(74, 159, 232, 0.15);
  cursor: pointer;
}

.profile-btn-exit {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--color-text-muted);
  background: transparent;
  cursor: pointer;
}

html.theme-dark .profile-btn-exit {
  border-color: rgba(255, 255, 255, 0.15);
}

.profile-orders-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card {
  padding: 12px 14px;
}

.order-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.order-card__no {
  font-weight: 800;
  font-size: 0.95rem;
}

.order-card__status {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.order-card__status--new {
  background: rgba(245, 200, 80, 0.35);
  color: #8a6a10;
}

.order-card__status--in_progress {
  background: rgba(74, 159, 232, 0.3);
  color: #2a6ab0;
}

.order-card__status--done {
  background: rgba(137, 199, 100, 0.35);
  color: #2d6a30;
}

.order-card__status--cancelled {
  background: rgba(120, 130, 140, 0.35);
  color: #555;
}

html.theme-dark .order-card__status--new {
  color: #f0d080;
}

html.theme-dark .order-card__status--in_progress {
  color: #8ec8f8;
}

html.theme-dark .order-card__status--done {
  color: #a8e898;
}

html.theme-dark .order-card__status--cancelled {
  color: #a0a8b0;
}

.order-card__date {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.order-card__products {
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.4;
}

.order-card__total {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 800;
}

/* ─── Пункт плана 3: широкий экран / ПК (>768px) ─── */
@media (min-width: 768px) {
  .app-container {
    max-width: 960px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    /* нижняя панель «парит» с отступом — больше места под safe-area */
    padding-bottom: calc(var(--bottom-nav-h) + 20px + env(safe-area-inset-bottom, 0px));
  }

  .app-header {
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .bottom-nav {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(960px, calc(100% - 32px));
    max-width: 960px;
    border-radius: var(--radius);
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    padding-left: 12px;
    padding-right: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  }

  html.theme-dark .bottom-nav {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  }

  .bottom-nav__btn:hover {
    background: rgba(74, 159, 232, 0.1);
  }

  html.theme-dark .bottom-nav__btn:hover {
    background: rgba(106, 184, 240, 0.12);
  }

  /* Главная: четыре плитки в ряд */
  .home-quick {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding-bottom: 18px;
  }

  .home-tile {
    min-height: 150px;
  }

  /* Популярное: чуть шире карточки в горизонтальном скролле */
  .popular-card {
    flex: 0 0 22%;
    min-width: 150px;
    max-width: 200px;
  }

  /* Каталог: три колонки */
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  /* Модалка «Помощь»: по центру, не снизу */
  .modal {
    align-items: center;
    padding: 24px 16px;
  }

  .modal__panel {
    max-width: min(480px, 100%);
    max-height: min(80vh, 560px);
    margin-bottom: 0;
    border-radius: var(--radius);
  }

  .product-modal {
    align-items: center;
    padding: 24px 16px;
  }

  .product-modal__panel {
    margin-bottom: 0;
    max-height: min(88vh, 720px);
  }
}

@media (min-width: 1100px) {
  .app-container {
    max-width: 1040px;
  }

  .bottom-nav {
    width: min(1040px, calc(100% - 40px));
    max-width: 1040px;
  }

  .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
