/* ═══════════════════════════════════════════════════
   ЛОВИИ — Design System v1.0
   Эталонный файл для всей экосистемы иiiии.рф
   ═══════════════════════════════════════════════════ */

/* ── Переменные ────────────────────────────────────── */
:root {
  /* Фоны */
  --bg-base:     #0d0d0b;
  --bg-surface:  #141412;
  --bg-elevated: #1c1c18;
  --bg-overlay:  #242420;

  /* Границы */
  --border-subtle:  rgba(255,255,255,0.05);
  --border-default: rgba(255,255,255,0.09);
  --border-strong:  rgba(255,255,255,0.16);

  /* Бренд-цвета */
  --olive:       #8a9a6a;
  --olive-light: #a8bc83;
  --olive-dark:  #6a7850;
  --sky:         #6ba3be;
  --sky-light:   #8fc0d8;
  --earth:       #b08060;
  --earth-light: #cda080;
  --grey:        #8a8a82;

  /* Текст */
  --text-primary:   #f0ede6;
  --text-secondary: #a0a098;
  --text-muted:     #60605a;

  /* Акцент */
  --accent:       var(--olive);
  --accent-hover: var(--olive-light);

  /* Радиусы */
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  24px;
  --r-2xl: 32px;

  /* Тени */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);

  /* Переходы */
  --t-fast:   .15s ease;
  --t-normal: .25s ease;

  /* Общий desktop-каркас */
  --site-shell-max: 1180px;
}

/* ── Светлая тема ──────────────────────────────────── */
[data-theme="light"] {
  --bg-base:     #f8f7f3;
  --bg-surface:  #ffffff;
  --bg-elevated: #f0ede6;
  --bg-overlay:  #e8e5de;

  --border-subtle:  rgba(0,0,0,0.05);
  --border-default: rgba(0,0,0,0.1);
  --border-strong:  rgba(0,0,0,0.18);

  --text-primary:   #1a1a18;
  --text-secondary: #4a4a42;
  --text-muted:     #8a8a7a;
}
[data-theme="light"] body { background: var(--bg-base); color: var(--text-primary); }
[data-theme="light"] .site-header { background: rgba(248,247,243,0.94); }
[data-theme="light"] .bottom-nav { background: rgba(255,255,255,.9); border-top-color: rgba(0,0,0,0.1); }

/* ── Сброс и база ──────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg-base);
  color: var(--text-primary);
  isolation: isolate;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Grain texture overlay — subtle film noise over dark bg */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: .028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px;
}

/* ── Glassmorphism helper ──────────────────────────── */
.glass {
  background: rgba(255,255,255,.04);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,.07);
}

/* ── Gradient text utility ─────────────────────────── */
.grad-text {
  background: linear-gradient(120deg, #a8ba78, #c8d89a, #a8ba78);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: grad-shift 4s linear infinite;
}
@keyframes grad-shift { to { background-position: 200% center; } }

/* ── Типографика ───────────────────────────────────── */
h1, h2, h3, h4 {
  margin: 0;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text-primary);
}
h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.05rem; }

p { margin: 0; color: var(--text-secondary); }
a { color: var(--olive-light); text-decoration: none; }
a:hover { color: var(--text-primary); }

/* ── Хедер ─────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,13,11,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  height: 56px;
  display: flex;
  align-items: center;
}
.site-header__inner {
  width: 100%;
  max-width: var(--site-shell-max);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-logo {
  display: flex;
  align-items: baseline;
  gap: 6px;
  text-decoration: none;
}
.site-logo__name {
  font-size: 1.32rem;
  font-weight: 900;
  letter-spacing: .01em;
  color: var(--text-primary);
}
.site-logo__ai {
  color: var(--olive-light);
  letter-spacing: 0;
  font-size: 1em;
  text-transform: lowercase;
}
.site-logo__dots {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: -1px;
  margin-bottom: 2px;
}
.site-logo__dot {
  width: 7px;
  height: 7px;
  background: var(--olive-light);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(169,188,129,.16);
}
.site-logo__tag {
  font-size: .7rem;
  color: var(--text-muted);
  letter-spacing: .04em;
}
.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-md);
  font-size: .82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  text-decoration: none;
}
.header-btn:hover { background: var(--bg-overlay); color: var(--text-primary); border-color: var(--border-strong); }
.header-btn--accent {
  background: var(--olive);
  border-color: var(--olive);
  color: #fff;
}
.header-btn--accent:hover { background: var(--olive-light); border-color: var(--olive-light); color: #fff; }
.header-balance {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 58px;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(138,154,106,.22);
  background: linear-gradient(180deg, rgba(138,154,106,.12), rgba(255,255,255,.035));
  color: var(--text-muted);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
}
.header-balance span {
  color: var(--earth-light);
  font-size: .92rem;
  font-weight: 950;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

/* ── Нижняя навигация ──────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(18, 18, 15, .92);
  border-top: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 -10px 30px rgba(0,0,0,0.34);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  height: calc(70px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  align-items: center;
}
.bottom-nav__inner {
  width: 100%;
  max-width: var(--site-shell-max);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 7px 10px 8px;
}
.nav-item {
  flex: 1 1 0;
  min-width: 0;
  max-width: 116px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  padding: 6px 3px 5px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: .6rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: .02em;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  position: relative;
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { color: var(--text-muted); }
.nav-item.active {
  color: var(--olive-light);
  background: transparent;
  box-shadow: none;
}
.nav-item__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display:flex;
  align-items:center;
  justify-content:center;
  color: currentColor;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition: width var(--t-fast), height var(--t-fast), background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast), color var(--t-fast);
  position: relative;
  overflow: hidden;
}
.nav-item.active .nav-item__icon {
  width: 38px;
  height: 38px;
  color: #14170f;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.34), transparent 32%),
    linear-gradient(145deg, var(--olive-light), var(--olive));
  box-shadow: 0 10px 20px rgba(138,154,106,.26);
  transform: translateY(-2px);
}
.nav-orb::before,
.nav-orb::after {
  content: '';
  position: absolute;
  display: block;
}
.nav-orb--avatar::before {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.7px solid currentColor;
  opacity: .9;
}
.nav-orb--avatar::after {
  display: none;
}
.nav-orb--templates::before,
.nav-orb--templates::after {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1.6px solid currentColor;
  opacity: .82;
}
.nav-orb--templates::before {
  transform: translate(-3px, -3px);
}
.nav-orb--templates::after {
  transform: translate(3px, 3px);
}
.nav-orb--ready::before {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.7px solid currentColor;
  opacity: .9;
}
.nav-orb--ready::after {
  display: none;
}
.nav-orb--create::before,
.nav-orb--create::after {
  width: 18px;
  height: 1.8px;
  border-radius: 999px;
  background: currentColor;
  opacity: .88;
}
.nav-orb--create::after {
  transform: rotate(90deg);
}
.nav-orb--editor::before {
  width: 18px;
  height: 1.6px;
  background: currentColor;
  border-radius: 999px;
  box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
  opacity: .82;
}
.nav-orb--editor::after {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -6px -5px 0 currentColor, 6px 5px 0 currentColor;
  opacity: .9;
}
@media (hover:hover) and (pointer:fine) {
  .nav-item:hover { color: var(--olive-light); }
  .nav-item:hover .nav-item__icon {
    box-shadow: none;
    transform: translateY(-1px);
  }
}
.nav-item--primary { color: var(--text-muted); }
.nav-item--primary .nav-item__icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: currentColor;
  background: transparent;
  box-shadow: none;
}
.nav-item--primary.active {
  color: var(--olive-light);
  background: transparent;
}
.nav-item--primary.active .nav-item__icon {
  width: 38px;
  height: 38px;
  color: #14170f;
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,.34), transparent 32%),
    linear-gradient(145deg, var(--olive-light), var(--olive));
  box-shadow: 0 10px 20px rgba(138,154,106,.26);
}

/* ── Основной контент ──────────────────────────────── */
.page-content {
  width: 100%;
  max-width: var(--site-shell-max);
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Секция ────────────────────────────────────────── */
.page-section {
  padding: 36px 0 0;
}
.section-label {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.section-sub {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* ── Карточка ──────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  transition: all var(--t-normal);
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
}
.card--interactive { cursor: pointer; }
.card--interactive:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ── Кнопки ────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--r-md);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--olive);
  color: #fff;
}
.btn-primary:hover { background: var(--olive-light); }
.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
}
.btn-secondary:hover { border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
}
.btn-ghost:hover { color: var(--text-primary); }
.btn--full { width: 100%; }
.btn--lg { padding: 16px 32px; font-size: 1rem; border-radius: var(--r-lg); }

/* ── Теги / Фильтры ────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: .78rem;
  font-weight: 500;
  border: 1px solid var(--border-default);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.tag:hover, .tag.active {
  background: var(--olive-dark);
  border-color: var(--olive);
  color: var(--text-primary);
}

/* ── Скроллируемые фильтры ─────────────────────────── */
.filters-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 20px;
}
.filters-row::-webkit-scrollbar { display: none; }

/* ── Сетка шаблонов ────────────────────────────────── */
.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}
.template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--t-normal);
}
.template-card:hover {
  border-color: var(--olive);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.template-card__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--bg-elevated);
}
.template-card__body {
  padding: 10px 12px;
}
.template-card__name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.template-card__cat {
  font-size: .72rem;
  color: var(--text-muted);
}
.template-card__use {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(138,154,106,0.85);
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  font-weight: 700;
  color: #fff;
}
.template-card { position: relative; }
.template-card:hover .template-card__use { display: flex; }

/* ── Особые режимы ─────────────────────────────────── */
.special-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.special-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t-normal);
}
.special-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-elevated);
  transform: translateY(-2px);
}
.special-card__icon { font-size: 1.8rem; flex-shrink: 0; }
.special-card__body { flex: 1; min-width: 0; }
.special-card__title { font-size: .9rem; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.special-card__desc { font-size: .75rem; color: var(--text-muted); }
.special-card__arrow { color: var(--text-muted); font-size: 1rem; }

/* ── Подача задачи ─────────────────────────────────── */
#active-card-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: 24px;
  margin-top: 24px;
}
#model-selection-area {
  margin-top: 24px;
}
.input-area textarea, .input-area input[type="text"] {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-md);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: .9rem;
  resize: vertical;
  transition: border-color var(--t-fast);
  outline: none;
}
.input-area textarea:focus, .input-area input:focus { border-color: var(--olive); }
.input-area label { display: block; font-size: .8rem; color: var(--text-muted); margin-bottom: 6px; font-weight: 500; }
.btn-main-submit {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  background: var(--olive);
  color: #fff;
  border: none;
  border-radius: var(--r-lg);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--t-fast);
  margin-top: 20px;
  font-family: inherit;
}
.btn-main-submit:hover { background: var(--olive-light); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ── Hero анкеты ───────────────────────────────────── */
.create-hero {
  padding-top: 28px;
  padding-bottom: 8px;
}
.create-hero__title {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.03em;
  margin-bottom: 4px;
}
.create-hero__sub {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ── Подвал ────────────────────────────────────────── */
.site-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 18px 20px 88px;
  margin-top: 36px;
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}
.footer__col h4 {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.footer__col a {
  display: block;
  font-size: .82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  transition: color var(--t-fast);
}
.footer__col a:hover { color: var(--text-primary); }
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .78rem;
  color: var(--text-muted);
}
.footer__bottom a {
  color: var(--text-secondary);
  text-decoration: none;
}
.footer__bottom a:hover { color: var(--text-primary); }

/* ── Утилиты ───────────────────────────────────────── */
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-accent { color: var(--olive-light); }

/* ═══════════════════════════════════════════════════
   АДАПТИВ + НЕДОСТАЮЩИЕ КОМПОНЕНТЫ
   ═══════════════════════════════════════════════════ */

/* ── Toggle авто/ручной режим ──────────────────────── */
.toggle-switch {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border-default);
  border-radius: var(--r-lg);
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
}
.toggle-switch button {
  flex: 1;
  padding: 9px 14px;
  background: none;
  border: none;
  border-radius: var(--r-md);
  color: var(--text-muted);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
  font-family: inherit;
  white-space: nowrap;
}
.toggle-switch button:hover { color: var(--text-primary); }
.toggle-switch button.active {
  background: var(--bg-overlay);
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Список моделей ────────────────────────────────── */
#models-list-target .model-item,
.model-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--t-fast);
}
#models-list-target .model-item:hover,
.model-list-item:hover { border-color: var(--olive); }
#models-list-target .model-item.selected,
.model-list-item.selected { border-color: var(--olive); background: rgba(138,154,106,.1); }

/* ── Загрузка файла ────────────────────────────────── */
.file-upload-zone {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all var(--t-normal);
  margin-bottom: 16px;
}
.file-upload-zone:hover { border-color: var(--olive); color: var(--text-secondary); }
.file-upload-zone__icon { font-size: 2.2rem; margin-bottom: 8px; }
.file-upload-zone__text { font-size: .85rem; }

/* ── Уведомления ───────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%);
  background: var(--bg-overlay);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  padding: 12px 20px;
  font-size: .88rem;
  color: var(--text-primary);
  z-index: 9999;
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

/* ── Скроллбар ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-overlay); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--grey); }

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */

/* Планшет 601–900px */
@media (min-width: 601px) and (max-width: 900px) {
  .page-content { padding: 0 20px 80px; }
  .niche-grid { grid-template-columns: repeat(3, 1fr); }
  .sub-grid { grid-template-columns: repeat(3, 1fr); }
  .templates-grid { grid-template-columns: repeat(3, 1fr); }
  .footer__grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
}

/* Мобилка 481–600px */
@media (max-width: 600px) {
  /* Хедер */
  .site-header { height: 50px; }
  .site-logo__tag { display: none; }
  .site-logo__name { font-size: 1.14rem; }
  .site-logo__dot { width: 6px; height: 6px; }
  .header-balance { min-width:50px; padding: 4px 7px; font-size:.66rem; }
  .header-balance span { font-size:.82rem; }
  .site-header__actions { gap: 6px; }
  .header-btn { padding: 5px 10px; font-size: .78rem; }
  .header-btn--accent { padding: 5px 12px; }

  /* Контент */
  .page-content { padding: 0 12px 72px; }
  .create-hero { padding-top: 16px !important; }
  .create-hero__title { font-size: 1.3rem !important; }
  .create-hero__sub { font-size: .82rem; }

  /* Секции */
  .page-section { padding-top: 28px; }
  .section-title { font-size: 1.05rem; }

  /* Грид ниш */
  .niche-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .niche-card { padding: 14px 10px; }
  .niche-icon { font-size: 1.5rem; margin-bottom: 6px; }
  .niche-name { font-size: .82rem; }
  .niche-desc { display: none; }

  /* Подниши */
  .sub-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .sub-preview { height: 90px; }
  .sub-name { font-size: .8rem; }
  .sub-desc { display: none; }

  /* Спорт */
  .sport-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .sport-card { padding: 9px 10px; font-size: .82rem; }

  /* Рекомендации */
  .rec-accept-btn { font-size: .88rem; padding: 13px; }

  /* Количество */
  .qty-presets { gap: 6px; }
  .qty-preset { padding: 9px; font-size: .88rem; }
  .qty-value { font-size: 1.6rem; }

  /* Особые режимы */
  .special-modes { grid-template-columns: 1fr; gap: 8px; }
  .special-card { padding: 14px; }
  .special-card__icon { font-size: 1.5rem; }
  .special-card__title { font-size: .85rem; }
  .special-card__desc { display: none; }

  /* Шаблоны */
  .templates-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .template-card__name { font-size: .78rem; }
  .template-card__cat { font-size: .68rem; }
  .template-card__body { padding: 8px 10px; }

  /* Кнопка сабмита */
  .btn-main-submit { padding: 14px; font-size: .9rem; }

  /* Подвал */
  .site-footer { padding: 16px 16px 82px; margin-top: 28px; }
  .footer__grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .footer__bottom { flex-direction: column; gap: 6px; text-align: center; }

	  /* Нижнее меню */
	  .bottom-nav { height: calc(64px + env(safe-area-inset-bottom, 0px)); }
	  .bottom-nav__inner { padding: 6px 7px 7px; gap: 2px; }
	  .nav-item { min-height: 50px; font-size: .55rem; border-radius: 14px; }
	  .nav-item__icon { width: 28px; height: 28px; }
	  .nav-item--primary .nav-item__icon { width: 28px; height: 28px; }
	  .nav-item.active .nav-item__icon,
	  .nav-item--primary.active .nav-item__icon { width: 36px; height: 36px; }

  /* Toggle */
  .toggle-switch button { padding: 8px 10px; font-size: .78rem; }
}

/* Маленькие телефоны ≤360px */
@media (max-width: 360px) {
  .page-content { padding: 0 10px 70px; }
  .niche-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .niche-card { padding: 12px 8px; }
  .niche-icon { font-size: 1.3rem; }
  .templates-grid { grid-template-columns: repeat(2, 1fr); gap: 7px; }
  .sub-grid { grid-template-columns: 1fr 1fr; }
  .header-user-btn { max-width: 82px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 5px 8px; }
}

/* ── Совместимость — главная страница ──────────────── */
.main-content {
  max-width: var(--site-shell-max);
  margin: 0 auto;
  padding: 16px 24px 80px;
}
.section-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: 20px;
  margin-bottom: 16px;
  cursor: pointer;
  transition: all var(--t-normal);
}
.section-card:hover { border-color: var(--border-strong); background: var(--bg-elevated); }
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.section-header h2 {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
.section-header .material-icons { font-size: 1.1rem; color: var(--text-muted); }
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.photo-item {
  aspect-ratio: 1;
  background: var(--bg-elevated);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border-default);
  border-top-color: var(--olive);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.icon-badge .material-icons { color: var(--text-muted); font-size: 1.4rem; }
.photo-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.4);
  align-items: center;
  justify-content: center;
}
.photo-overlay .material-icons { color: #fff; }
.photo-item:hover .photo-overlay { display: flex; }
.photo-item { position: relative; }

/* Material Icons совместимость */
.material-icons {
  font-family: 'Material Icons', sans-serif;
  font-size: 1.2rem;
  line-height: 1;
}
