* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* ===== Токены: светлая тема — «тёплая бумага» ===== */
:root {
  --n-0:  #ffffff;
  --n-25: #faf8f5;
  --n-50: #f4f1ec;
  --n-100:#eae5dd;
  --n-200:#ddd7cc;
  --n-300:#c2bbae;
  --n-500:#736c61;
  --n-700:#433e37;
  --n-900:#1a1815;

  --a-400:#ff8a4c;
  --a-500:#ff6a2c;
  --a-600:#e8530f;
  --a-700:#b93d08;
  --a-tint:#fff0e7;

  --ink:      #17150f;
  --ink-2:    #26221a;
  --ink-line: #38332a;
  --ink-text: #f7f3ec;
  --ink-muted:#a49a8b;

  --bg:        var(--n-25);
  --bg-side:   var(--n-50);
  --surface:   var(--n-0);
  --panel:     var(--n-50);
  --panel-2:   var(--n-100);
  --line:      var(--n-200);
  --line-soft: #e8e2d8;
  --line-strong: var(--n-300);
  --border:    var(--line);
  --text:      var(--n-900);
  --text-2:    var(--n-700);
  --muted:     var(--n-500);
  --accent:    var(--a-500);
  --accent-ink: var(--a-700);
  --accent-hover: var(--a-600);

  --sh-1: 0 1px 2px rgba(60,48,32,.06);
  --sh-2: 0 2px 4px rgba(60,48,32,.05), 0 8px 16px -6px rgba(60,48,32,.10);
  --sh-3: 0 4px 8px rgba(60,48,32,.06), 0 24px 48px -12px rgba(60,48,32,.16);
  --sh-a: 0 6px 16px -6px rgba(232,83,15,.35);

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --radius-pill: 999px;

  --ease: cubic-bezier(.32,.72,0,1);
  --ease-out: cubic-bezier(.2,0,0,1);
  --t-fast: .15s;
  --t: .22s;
  --t-slow: .35s;

  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Manrope', var(--font-ui);
}

/* ===== Токены: тёмная тема — тот же тёплый характер, инвертированный ===== */
:root[data-theme="dark"] {
  --n-0:  #16150f;
  --n-25: #100f0b;
  --n-50: #16150f;
  --n-100:#201e17;
  --n-200:#2e2b22;
  --n-300:#443f33;
  --n-500:#a39c8c;
  --n-700:#cdc6b8;
  --n-900:#f5f1e8;

  --a-500:#ff7f42;
  --a-600:#ff9560;
  --a-700:#ff9560;
  --a-tint:#2a1c12;

  --ink:      #0a0906;
  --ink-2:    #16150f;
  --ink-line: #2e2b22;
  --ink-text: #f5f1e8;
  --ink-muted:#8f8878;

  --line-soft: #262319;
  --accent-ink: var(--a-700);

  --sh-1: 0 1px 2px rgba(0,0,0,.5);
  --sh-2: 0 2px 6px rgba(0,0,0,.5), 0 10px 24px -8px rgba(0,0,0,.65);
  --sh-3: 0 8px 24px rgba(0,0,0,.55), 0 32px 64px -16px rgba(0,0,0,.75);
  --sh-a: 0 6px 20px -6px rgba(255,127,66,.4);
}

html {
  scrollbar-gutter: stable;
}
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease; /* мягкая смена тёмной/светлой темы */
}

body { display: flex; min-height: 100vh; position: relative; }

/* Зерно бумаги поверх всей страницы — убирает пластиковую плоскость */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  opacity: .055; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { opacity: .05; mix-blend-mode: overlay; }

.wrap { width: 100%; max-width: 1320px; margin-inline: auto; padding-inline: 40px; }
@media (max-width: 640px) { .wrap { padding-inline: 16px; } }

/* ===== Лёгкие анимации по умолчанию для всех интерактивных элементов ===== */
a, button, input, textarea, summary {
  transition: background-color .15s ease, border-color .15s ease, color .15s ease,
    opacity .15s ease, transform .15s ease, box-shadow .15s ease;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: inherit; }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s var(--ease-out), transform .5s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
}

/* Sidebar */
.sidebar {
  width: 264px;
  flex-shrink: 0;
  background: var(--bg-side);
  box-shadow: 1px 0 0 var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  padding: 4px 8px 20px;
}
.brand-logo { font-family: var(--font-display); font-size: 22px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; color: var(--text); }
.brand-locale { font-size: 12px; color: var(--muted); font-weight: 600; }

.nav { flex: 1; overflow-y: auto; }
.nav-group { margin-bottom: 6px; }

.nav-group-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 10px 8px;
  cursor: pointer;
  font-family: inherit;
}
.nav-group-title:hover { color: var(--text-2); }
.chevron { color: var(--muted); display: inline-flex; transition: transform .2s; }
.chevron svg { width: 14px; height: 14px; }
.nav-group.collapsed .chevron { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }

.nav-items { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px 0 8px;
  border-left: 3px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active { background: var(--a-tint); color: var(--accent-ink); border-left-color: var(--accent); }
.nav-item.active .ni-ico { color: var(--accent-ink); }
.nav-item.standalone { margin-top: 6px; }
.ni-ico { width: 18px; height: 18px; flex-shrink: 0; }

/* Иконки (SVG вместо эмодзи) */
.brand-logo { display: flex; align-items: center; gap: 9px; }
.brand-ico { width: 25px; height: 25px; color: var(--accent); }
.ngt { display: flex; align-items: center; gap: 10px; }
.ngt svg { width: 18px; height: 18px; }
.opt svg { width: 15px; height: 15px; }
.prompt-image-btn svg { width: 20px; height: 20px; display: block; }
.gs-ico svg { width: 15px; height: 15px; display: block; }
.generate-btn svg { width: 20px; height: 20px; }
.generate-btn.busy { opacity: .55; cursor: default; }
.lb-icon svg { width: 18px; height: 18px; }
.lb-nav svg { width: 20px; height: 20px; }
.lb-btn svg { width: 16px; height: 16px; }

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sidebar-locale {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 8px 2px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .05em;
  color: var(--muted);
}
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.theme-toggle:hover { background: var(--panel-2); color: var(--text); }
.theme-toggle svg { width: 18px; height: 18px; }
/* Светлая тема (дефолт): показываем луну (переключить на тёмную) */
.theme-toggle .ic-light { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-dark { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-light { display: block; }

.foot-link {
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px;
}
.foot-link:hover { color: var(--text); }
.btn-signup {
  text-align: center;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  box-shadow: var(--sh-a);
}
.btn-signup:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

#authLoggedOut { display: flex; flex-direction: column; gap: 10px; }
#authLoggedOut[hidden] { display: none; }
.auth-logged-in { display: flex; flex-direction: column; gap: 6px; }
.auth-logged-in[hidden] { display: none; }
.auth-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
}
.auth-user-btn:hover { border-color: var(--accent); }
.auth-user-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.auth-user-name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Main */
.main {
  flex: 1;
  min-width: 0;
  margin-left: 264px;
  padding: 60px 32px 48px;
  overflow-x: clip;
}

.hero { position: relative; margin: 0 auto 40px; text-align: center; z-index: 1; }
.hero .hero-sub { max-width: 780px; margin-inline: auto; }
.hero::before {
  content: '';
  position: absolute; z-index: -1;
  top: -40px; left: 50%; transform: translateX(-50%);
  width: 900px; height: 640px;
  background: radial-gradient(60% 50% at 50% 0%, #ffe4d2 0%, transparent 70%);
  pointer-events: none;
}
:root[data-theme="dark"] .hero::before {
  background: radial-gradient(60% 50% at 50% 0%, rgba(255,127,66,.16) 0%, transparent 70%);
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6.4vw, 72px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.02;
}
.hero h1 .hl { color: var(--accent-ink); }
.hero-sub {
  color: var(--muted);
  font-size: clamp(16px, 1.5vw, 19px);
  max-width: 56ch;
  margin: 14px auto 0;
  line-height: 1.55;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 12px;
  margin-bottom: 20px;
  box-shadow: var(--sh-1);
}
.eyebrow i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }

/* Бейджи под подзаголовком */
.hero-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.hero-badges li {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
}
.hero-badges--center { justify-content: center; margin-top: 28px; }

/* ===== Живая витрина работ ===== */
.showcase {
  margin-top: 44px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
/* На /fotosessiya затухание переезжает на саму ленту (ниже) — иначе под него
   попадали бы стрелки по краям, еле видные. */
.showcase--interactive { mask-image: none; -webkit-mask-image: none; }
.showcase-row { position: relative; display: flex; overflow: hidden; }
.showcase-track {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  animation: showcase-l 62s linear infinite;
}
.showcase-row--r .showcase-track { animation-name: showcase-r; animation-duration: 78s; }
@keyframes showcase-l { to { transform: translateX(-50%); } }
@keyframes showcase-r { from { transform: translateX(-50%); } to { transform: translateX(0); } }
.showcase-row:hover .showcase-track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .showcase-track { animation: none; } }

/* Только на /fotosessiya: ленту можно перелистывать — свайп на телефоне, колесо,
   перетаскивание мышью, стрелки по краям. Пока её не тронули, она едет сама, но не
   CSS-анимацией, как на остальных страницах, а прокруткой из JS (enableShowcaseTakeover):
   так авто-ход и рука двигают одно и то же и не спорят друг с другом. */
.showcase-track--interactive {
  /* Базовая .showcase-track — flex-shrink:0 и ширина по контенту (нужно для маркиза,
     который едет translateX по дорожке шире экрана). Тут наоборот: ширина ленты
     должна упираться в контейнер, чтобы контенту шире было куда прокручиваться. */
  width: 100%;
  flex-shrink: 1;
  animation: none; /* движение ведёт JS через scrollLeft, а не transform */
  transform: none;
  overflow-x: auto;
  /* Ни snap, ни smooth: первый возвращал позицию к ближайшей карточке, второй
     сглаживал каждое присваивание scrollLeft — вдвоём они убивали перетаскивание.
     Плавность нужна только стрелкам, они просят её сами через scrollBy. */
  scroll-behavior: auto;
  scrollbar-width: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-overflow-scrolling: touch;
  /* Затухание по краям — на самой ленте, а не на всём ряду, иначе под раздачу
     попадали бы и стрелки поверх неё. */
  mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent);
}
/* Перебивает .showcase-row--r .showcase-track выше — там селектор тяжелее,
   и без этого у нижней ленты оставалась своя transform-анимация поверх прокрутки. */
.showcase-row--r .showcase-track--interactive { animation: none; }
.showcase-track--interactive::-webkit-scrollbar { display: none; }
.showcase-track--interactive.is-dragging { scroll-behavior: auto; cursor: grabbing; }
.sc-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 2;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--sh-2);
  cursor: pointer;
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.sc-arrow svg { width: 16px; height: 16px; }
.sc-arrow--prev { left: 4px; }
.sc-arrow--next { right: 4px; }
.showcase-row:hover .sc-arrow { opacity: 1; }
/* На тач-устройствах стрелок нет: там листают пальцем, а сами стрелки только
   закрывают собой плитки. Что ленту можно тянуть, подсказывает покачивание
   в начале (см. WOBBLE в app.js). */
@media (hover: none), (max-width: 620px) {
  .sc-arrow { display: none; }
}
.sc-card {
  flex: 0 0 auto;
  width: 190px; height: 238px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  box-shadow: var(--sh-2);
  border: 1px solid var(--line);
  display: block;
  transition: transform .25s var(--ease), opacity .25s var(--ease);
}
.sc-card img { width: 100%; height: 100%; object-fit: cover; display: block; -webkit-user-drag: none; }
.showcase-row:hover .sc-card:not(:hover) { opacity: .55; }
.sc-card:hover { transform: scale(1.06); }

/* Плитки с готовым промтом (архив @lexygpt) — подпись видна всегда, не только на
   ховере: лента едет сама, и на тачскрине ховера просто не будет. */
.sc-card--try .sc-try-badge {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 22px 10px 8px;
  background: linear-gradient(transparent, rgba(0,0,0,.78));
  display: flex;
  flex-direction: column;
  gap: 2px;
  pointer-events: none;
}
.sc-card--try .sc-try-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
}
.sc-card--try .sc-try-badge b {
  font-weight: 700;
  font-size: 10.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .02em;
}
@media (max-width: 620px) {
  .sc-card--try .sc-try-badge { padding: 16px 8px 6px; font-size: 10.5px; }
  .sc-card--try .sc-try-badge b { font-size: 9.5px; }
}
@media (max-width: 620px) {
  /* Ровно две карточки в ширину экрана: считаем от ленты, а не фиксируем пиксели —
     иначе на узких телефонах вторая обрезается, на широких лезет третья.
     ТОЛЬКО для ленты, которую листают пальцем: у неё ширина задана экраном. У бегущей
     строки на остальных страницах ширина определяется содержимым, и процент от неё
     означал бы ссылку на самого себя — карточка раздувалась до натурального размера
     картинки (3686 px) и лезла размытым пятном во весь экран. */
  .showcase-track--interactive .sc-card { width: calc((100% - 12px) / 2); height: auto; aspect-ratio: 4 / 5; }
  .showcase { margin-top: 28px; }
}

/* ===== Оживить фото: режим внутри окна генерации ===== */
.animate-pane {
  scroll-margin-top: 64px;
  text-align: left; /* .hero задаёт center всей секции — здесь, как в .prompt-box, это лишнее */
}
.animate-pane[hidden] { display: none; }

/* Подсказка под верхним переключателем — какой из двух режимов «Оживить»/«Анимация» выбран */
.animate-mode-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }

/* Большое окно загрузки — основной элемент режима, поэтому во всю ширину и высокое */
.animate-drop {
  display: block;
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.animate-drop:hover, .animate-drop.is-over { border-color: var(--accent); background: var(--a-tint); }
/* Те же состояния для окон референса и «Попробовать» — перетаскивание работает и там */
.ref-picker-box.is-over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.try-upload.is-over { border-color: var(--accent); background: var(--a-tint); }
.animate-drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  min-height: 230px;
  padding: 28px 24px;
}
.animate-drop-inner[hidden] { display: none; }
.animate-drop-ico {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--sh-1);
  color: var(--accent);
}
.animate-drop-ico svg { width: 24px; height: 24px; }
.animate-drop-inner strong { font-size: 15.5px; font-weight: 700; }
.animate-drop-inner small { color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 46ch; }

.animate-drop-preview { position: relative; padding: 14px; }
.animate-drop-preview[hidden] { display: none; }
.animate-drop-preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius-md);
}

/* Поле загрузки аудио для «Поздравления» — компактнее окна фото, идёт следующим шагом */
.animate-audio-drop {
  display: block;
  position: relative;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  cursor: pointer;
  margin-top: 10px;
  transition: border-color .18s ease, background .18s ease;
}
.animate-audio-drop[hidden] { display: none; }
.animate-audio-drop:hover, .animate-audio-drop.is-over { border-color: var(--accent); background: var(--a-tint); }
.animate-audio-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  min-height: 110px;
  padding: 18px 24px;
}
.animate-audio-inner[hidden] { display: none; }
.animate-audio-inner strong { font-size: 14px; font-weight: 700; }
.animate-audio-inner small { color: var(--muted); font-size: 12.5px; line-height: 1.5; max-width: 46ch; }
.animate-audio-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
}
.animate-audio-preview[hidden] { display: none; }
.animate-audio-preview audio { flex: 1; min-width: 0; height: 40px; }

.animate-row { display: flex; gap: 10px; margin-top: 12px; }
.animate-prompt-input {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  color: var(--text);
}
.animate-prompt-input:focus { outline: none; border-color: var(--accent); }
.animate-row .try-generate { flex: none; width: auto; margin: 0; padding-inline: 26px; }
.animate-pane .try-result { margin-top: 12px; }
.animate-pane .try-result video { width: 100%; max-height: 340px; border-radius: var(--radius-md); display: block; }

.animate-examples { margin-top: 18px; }
.animate-examples-title { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.animate-examples-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.animate-examples-grid video {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface);
}

@media (max-width: 560px) {
  .animate-drop-inner { min-height: 180px; padding: 22px 16px; }
  .animate-row { flex-direction: column; }
  .animate-row .try-generate { width: 100%; }
  .animate-examples-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}

/* В режиме «Оживить фото» поле запроса и его настройки не нужны */
.prompt-box.is-animate .prompt-cost,
.prompt-box.is-animate .prompt-row,
.prompt-box.is-animate .ref-chip,
.prompt-box.is-animate .prompt-options { display: none; }
/* И витрина примеров тоже — она про генерацию из текста */
.hero.mode-animate .showcase { display: none; }

/* Результат генерации — крупно над полем ввода */
.result {
  margin-top: 28px;
}
.result-img { display: block; text-align: center; position: relative; }
.result-img img {
  max-width: 100%;
  max-height: 68vh;
  width: auto;
  display: inline-block;
  border-radius: 16px;
  border: 1px solid var(--border);
}
.result-cap {
  color: var(--muted);
  font-size: 14px;
  margin-top: 10px;
  text-align: center;
}

/* Кнопки под сгенерированной картинкой */
.img-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.ia-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.ia-btn svg { width: 17px; height: 17px; }
.ia-btn:hover { background: var(--border); }
.ia-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.ia-btn.primary:hover { background: var(--accent-hover); }

.refine-bar {
  display: flex;
  gap: 10px;
  max-width: 560px;
  margin: 14px auto 0;
}
.refine-input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.refine-input:focus { border-color: var(--accent); }
.refine-go {
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
}
.refine-go:hover { background: var(--accent-hover); }
.refine-bar[hidden] { display: none; }
.result-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 260px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  padding: 24px;
  text-align: center;
}
.result-loading small { font-weight: 400; font-size: 13px; color: var(--muted); opacity: .8; }
.result-loading.err { color: #d94f2b; }
.spinner {
  width: 30px; height: 30px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Скелетон вместо голого спиннера */
.result-skeleton {
  min-height: 320px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  /* на тон темнее панели — иначе светлой волне не от чего отталкиваться */
  background: var(--panel-2);
  position: relative;
  overflow: hidden;
}
/* Волна строится на --n-300, а не на белом: в тёмной теме --n-0 совпадает с фоном
   панели (оба #16150f), и анимации там не было видно вообще. --n-300 контрастен
   к --panel-2 в обеих темах: #c2bbae на светлом, #443f33 на тёмном. */
/* Тот же приём, пока догружается уже готовая картинка (см. renderResult в app.js) */
.result-img.is-loading {
  display: block;
  min-height: 220px;
  border-radius: var(--radius-lg);
  background: var(--panel-2);
  position: relative;
  overflow: hidden;
}
.result-img.is-loading img { opacity: 0; }
.result-skeleton::after,
.result-img.is-loading::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in srgb, var(--n-300) 45%, transparent) 38%,
    color-mix(in srgb, var(--n-300) 85%, transparent) 50%,
    color-mix(in srgb, var(--n-300) 45%, transparent) 62%,
    transparent);
  transform: translateX(-100%);
  animation: sk-sweep 1.6s linear infinite;
}
@keyframes sk-sweep { to { transform: translateX(100%); } }
.result-skeleton-cap {
  position: absolute; left: 16px; bottom: 14px; right: 16px;
  font-size: 13px; font-weight: 600; color: var(--muted);
}

.result-img { animation: res-in .35s var(--ease) both; }
@keyframes res-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.img-actions .ia-btn { animation: res-in .35s var(--ease) both; }
.img-actions .ia-btn:nth-child(1) { animation-delay: 60ms; }
.img-actions .ia-btn:nth-child(2) { animation-delay: 100ms; }
.img-actions .ia-btn:nth-child(3) { animation-delay: 140ms; }
.img-actions .ia-btn:nth-child(4) { animation-delay: 180ms; }
.img-actions .ia-btn:nth-child(5) { animation-delay: 220ms; }

.prompt-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 14px;
  margin-top: 30px;
  text-align: left;
  box-shadow: var(--sh-2);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.prompt-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--sh-3), 0 0 0 4px var(--a-tint);
}

/* Переключатель модели — сегментированный контрол с едущим бегунком */
.model-picker {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-bottom: 12px;
  background: var(--panel-2);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.model-thumb {
  position: absolute;
  top: 3px; left: 3px;
  width: 0; height: 0;
  background: var(--surface);
  border-radius: var(--radius-pill);
  box-shadow: var(--sh-1);
  transition: transform .22s var(--ease), width .22s var(--ease), height .22s var(--ease);
  z-index: 0;
}
.model-opt {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  border-radius: var(--radius-pill);
  padding: 9px 6px;
  cursor: pointer;
  color: var(--muted);
  transition: color .15s, transform .15s var(--ease);
}
.model-opt:active { transform: scale(.94); }
.model-opt.active { color: var(--text); }
.model-name { font-size: 13px; font-weight: 700; }

/* Четвёртый сегмент — другой режим работы, поэтому отделён чертой */
.model-sep {
  align-self: center;
  width: 1px; height: 20px;
  margin-inline: 6px;
  background: var(--line-strong);
  flex-shrink: 0;
}
.model-opt--animate { flex: none; padding-inline: 14px; }
.model-opt--animate .model-name { display: inline-flex; align-items: center; gap: 7px; }
.model-opt--animate svg { width: 15px; height: 15px; }
.model-opt--animate.active { color: var(--accent-ink); }

@media (max-width: 620px) {
  .model-sep { display: none; }
  .model-opt--animate { flex: 1 1 calc(50% - 2px); max-width: calc(50% - 2px); margin-top: 2px; }
  /* На телефоне не полагаемся на JS-позиционирование бегунка (мог «съезжать») —
     просто подсвечиваем текст активной кнопки, это никогда не рассинхронизируется. */
  .model-thumb { display: none; }
  .model-opt.active,
  .model-opt--animate.active {
    background: none;
    color: var(--accent);
    text-shadow: 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
  }
  .model-opt.active .model-hint { color: var(--accent); }
}
.model-hint { font-size: 11px; }
.model-opt.active .model-hint { color: var(--accent-ink); }

.prompt-cost {
  overflow: hidden;
  height: 17px;
  margin-bottom: 10px;
  padding-inline: 4px;
}
.prompt-cost-track { transition: transform .28s var(--ease); }
.prompt-cost-row {
  height: 17px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
}
.prompt-cost-row b { color: var(--text-2); font-weight: 600; margin-right: 4px; }

.prompt-row { display: flex; align-items: flex-start; gap: 10px; padding-inline: 4px; }
.prompt-row { position: relative; }
.prompt-ghost {
  position: absolute;
  left: 4px; right: 44px; top: 4px;
  font-size: 16px;
  line-height: 1.5;
  color: var(--muted);
  pointer-events: none;
  white-space: pre-wrap;
  overflow: hidden;
}
.prompt-ghost .car {
  display: inline-block;
  width: 1px;
  height: 1.1em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: caret-blink 1s step-end infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }
.prompt-row textarea {
  position: relative;
  z-index: 1;
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  resize: none;
  outline: none;
  line-height: 1.5;
  padding-top: 4px;
  min-height: 44px;
  overflow: hidden;
}
.prompt-row textarea::placeholder { color: transparent; }
.prompt-image-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.prompt-image-btn:hover { background: var(--panel-2); color: var(--text); }

.prompt-options {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 12px;
  padding-inline: 4px 0;
  border-top: 1px solid var(--line-soft);
  gap: 10px;
}
.opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 6px 7px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.opt:hover { background: var(--panel-2); color: var(--text); }
.opt.active {
  background: var(--a-tint);
  color: var(--accent-ink);
}
.opt-ratio {
  display: inline-block;
  width: 16px; height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 3px;
  transition: width .2s var(--ease), height .2s var(--ease);
}

/* Чип выбранного референса */
.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 6px 10px 6px 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted);
}
.ref-chip[hidden] { display: none; }
.ref-chip img { width: 34px; height: 34px; object-fit: cover; border-radius: 7px; }
.ref-chip button {
  background: none; border: none; color: var(--muted);
  font-size: 15px; cursor: pointer; padding: 2px 4px; line-height: 1;
}
.ref-chip button:hover { color: var(--text); }

/* Стиль рисовки */
.style-pop { margin-top: 12px; }
.style-pop[hidden] { display: none; }
.style-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.style-chip {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}
.style-chip:hover { background: var(--panel-2); color: var(--text); }
.style-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
#styleCustom {
  width: 100%;
  margin-top: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
#styleCustom:focus { border-color: var(--accent); }

/* Строка «Исключено» */
.neg-row { margin-top: 12px; }
.neg-row[hidden] { display: none; }
.neg-row input {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.neg-row input:focus { border-color: var(--accent); }

/* Пикер референса */
.ref-picker {
  position: fixed; inset: 0; z-index: 65;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.7);
}
.ref-picker[hidden] { display: none; }
.ref-picker-box {
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  width: 100%; max-width: 640px;
  max-height: 82vh; overflow-y: auto;
}
.ref-picker-head { display: flex; align-items: center; justify-content: space-between; }
.ref-picker-head strong { font-size: 16px; }
.ref-picker-head button {
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.ref-picker-head button:hover { color: var(--text); }
.ref-upload-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
  cursor: pointer;
  color: var(--text);
  font-size: 14px; font-weight: 600;
  transition: border-color .15s ease, background .15s ease;
}
.ref-upload-btn:hover { border-color: var(--accent); background: var(--panel); }
.ref-upload-btn svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; }
.ref-upload-btn .spinner { display: none; width: 16px; height: 16px; border-width: 2px; }
.ref-upload-btn.is-loading { pointer-events: none; opacity: .7; }
.ref-upload-btn.is-loading .ref-upload-text { display: none; }
.ref-upload-btn.is-loading .spinner { display: block; }
.ref-hint { color: var(--muted); font-size: 13px; margin: 8px 0 16px; line-height: 1.5; }
.ref-picker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.ref-thumb {
  position: relative;
  padding: 0; border: 2px solid transparent; border-radius: 10px;
  overflow: hidden; cursor: pointer; background: var(--panel);
  aspect-ratio: 1/1;
}
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb:hover { border-color: var(--accent); }
.ref-thumb.is-gen { border-color: color-mix(in srgb, var(--accent) 50%, transparent); }
.ref-badge {
  position: absolute; left: 6px; bottom: 6px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
}
@media (max-width: 520px) { .ref-picker-grid { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 460px) {
  .generate-btn { width: 100%; }
}

.generate-btn {
  flex-shrink: 0;
  height: 44px;
  padding-inline: 22px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  border: none;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--sh-a);
  transition: background .15s, transform .15s, box-shadow .15s;
}
.generate-btn .gb-inner { display: inline-flex; align-items: center; gap: 8px; transition: transform .28s var(--ease); }
.generate-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
.generate-btn:active { transform: translateY(0) scale(.99); }
.generate-btn.busy { opacity: .75; cursor: default; box-shadow: none; }
.generate-btn.busy .gb-text::after { content: '…'; }
@media (hover:hover) and (pointer:fine) {
  .generate-btn:not(.busy):hover .gb-inner { transform: scale(1.03); }
}

/* Три категории — каждая своей строкой, картинки идут ГОРИЗОНТАЛЬНО */
.cats-section { margin-top: 96px; }
@media (max-width: 620px) { .cats-section { margin-top: 36px; } }
.cats { display: flex; flex-direction: column; gap: 40px; }
.cat-head {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cat-head h3 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; }
.cat-sub { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.cat-try {
  flex-shrink: 0;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 10px 20px;
  border-radius: 10px;
  cursor: pointer;
  /* у «Фотосессии» и «Открыток» это ссылка на свою страницу, а не кнопка */
  display: inline-block;
  text-decoration: none;
  line-height: 1.2;
}
.cat-try:hover { background: var(--accent-hover); }

/* Попап «Попробовать» */
.try-modal {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.6);
  opacity: 0; transition: opacity .16s ease;
}
.try-modal.is-open { opacity: 1; }
.try-modal[hidden] { display: none; }
.try-box {
  position: relative;
  width: 100%; max-width: 480px;
  background: var(--bg-side);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  transform: scale(.98);
  transition: transform .16s ease;
  max-height: 88vh; overflow-y: auto;
}
.try-modal.is-open .try-box { transform: scale(1); }
.try-close {
  position: absolute; top: 16px; right: 16px;
  width: 34px; height: 34px;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.try-close svg { width: 18px; height: 18px; }
.try-close:hover { color: var(--text); transform: rotate(90deg); }
.try-title { font-size: 20px; font-weight: 700; margin-bottom: 18px; padding-right: 40px; }

/* ===== Модалка входа: Яндекс + VK ID (VK/OK/Mail) ===== */
.auth-modal-box { max-width: 380px; text-align: center; padding: 32px 28px; }
.auth-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.auth-modal-hint { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.auth-modal-hint[hidden] { display: none; }
.auth-providers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.vkid-container { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
/* Кнопка Яндекса живёт внутри ряда VK ID SDK (см. placeYandexInOAuthRow), поэтому ряд
   раскладываем на равные доли — иначе четвёртый элемент не помещается по ширине. */
.vkid-container .VkIdSdk_oauth_list { gap: 10px; }
.vkid-container .VkIdSdk_oauth_list > * { flex: 1 1 0 !important; min-width: 0 !important; margin: 0 !important; }
.auth-provider-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  /* Тот же padding, что у ячеек SDK: при box-sizing: border-box он прибавляется поверх
     flex-basis, поэтому без него кнопка Яндекса выходила уже соседних. */
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .12);
  transition: border-color .15s ease, transform .15s ease;
}
.auth-provider-btn:hover { border-color: rgba(0, 0, 0, .28); transform: translateY(-1px); }

/* ===== Личный кабинет: не попап, а полноценная выезжающая панель ===== */
.cabinet-modal {
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
}
.cabinet-box {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: 100%;
  margin: 0;
  border-radius: 0;
  border-width: 0;
  overflow-y: auto;
  transform: translateY(14px);
  opacity: 0;
  transition: transform .24s ease, opacity .2s ease;
  padding: 40px 24px;
}
.cabinet-modal.is-open .cabinet-box { transform: translateY(0); opacity: 1; }
.cabinet-inner { max-width: 980px; margin: 0 auto; }

.cabinet-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  padding-right: 40px;
}
.cabinet-brand-block { display: flex; align-items: center; gap: 14px; }
.cabinet-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  padding-right: 14px;
  border-right: 1px solid var(--line);
}
.cabinet-brand .brand-ico { width: 21px; height: 21px; color: var(--accent); flex-shrink: 0; }
.cabinet-brand:hover { color: var(--accent); }
.cabinet-topbar h3 { font-size: 20px; font-weight: 700; }
@media (max-width: 560px) {
  .cabinet-brand-block { gap: 10px; }
  .cabinet-brand { padding-right: 10px; font-size: 16px; }
  .cabinet-topbar h3 { font-size: 17px; }
}
.cabinet-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 10px;
}
.cabinet-status-dot { width: 7px; height: 7px; border-radius: 50%; background: #2ecc71; flex-shrink: 0; }

/* ===== Раскладка: боковое меню + контент ===== */
.cabinet-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}
.cabinet-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
}
.cabinet-nav-item {
  text-align: left;
  padding: 11px 14px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.cabinet-nav-item:hover { background: var(--panel-2); color: var(--text); }
.cabinet-nav-item.is-active { background: var(--a-tint); color: var(--accent-ink); }

.cabinet-content { min-width: 0; }
.cabinet-panel { display: none; animation: cab-panel-in .22s ease both; }
.cabinet-panel.is-active { display: block; }
@keyframes cab-panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ===== Обзор: баланс ===== */
.cabinet-balance-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin-bottom: 28px;
  box-shadow: var(--sh-1);
}
.cabinet-credits-big { font-size: 34px; font-weight: 800; letter-spacing: -.5px; margin: 12px 0 4px; font-family: var(--font-display); }
.cabinet-credits-big::after { content: ' кредитов'; font-size: 14px; font-weight: 600; color: var(--muted); font-family: var(--font-ui); }
.cabinet-credits-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
  max-width: 280px;
  margin: 0 auto 18px;
}
.cabinet-credits-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--a-500), var(--a-400));
  border-radius: 999px;
  width: 0%;
  transition: width .6s var(--ease);
}
.cabinet-generate-btn { width: auto; margin-top: 0; padding: 12px 28px; box-shadow: var(--sh-a); }

.cabinet-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 12px; text-transform: uppercase; letter-spacing: .1em; }

.cabinet-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.cabinet-plan-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  text-align: center;
  transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease;
}
.cabinet-plan-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.cabinet-plan-card.is-current { border-color: var(--accent); background: var(--a-tint); }
.cp-name { font-size: 13.5px; font-weight: 700; margin-bottom: 4px; }
.cp-price { font-size: 12.5px; color: var(--text); margin-bottom: 2px; }
.cp-credits { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.cp-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 3px 10px;
}
.cp-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
  cursor: default;
}

.cabinet-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
/* Серия нейрофотосессии — отдельный блок на всю ширину ленты, со своим
   заголовком. Одиночные картинки вокруг остаются обычными плитками. */
.cab-series {
  grid-column: 1 / -1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
}
.cab-series-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.cab-series-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cab-series-date { font-size: 12px; color: var(--muted); }
.cab-series-again {
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  cursor: pointer;
}
.cab-series-again:hover { border-color: var(--accent); color: var(--accent-ink); }
.cab-series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.cab-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: block;
  background: var(--panel);
  border: 1px solid var(--line);
  transition: transform .2s var(--ease), box-shadow .2s ease;
  animation: cab-in .3s ease both;
  animation-delay: calc(var(--i, 0) * 25ms);
}
.cab-thumb:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.cab-thumb img, .cab-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cab-thumb-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
  background: rgba(0,0,0,.25);
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.cabinet-empty { color: var(--muted); font-size: 13.5px; text-align: center; padding: 20px 0; }

/* ===== Профиль ===== */
.cabinet-style-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.cabinet-style-chip {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
}
.cabinet-style-chip:hover { border-color: var(--accent); }
.cabinet-style-chip.is-active { background: var(--a-tint); border-color: var(--accent); color: var(--accent-ink); }
.cabinet-interests {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
}
.cabinet-interests:focus { outline: none; border-color: var(--accent); }
.cabinet-hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }

/* ===== История пополнений ===== */
.cabinet-ledger { display: flex; flex-direction: column; gap: 8px; }
.cabinet-ledger-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}
.cl-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  color: var(--accent);
  font-size: 15px;
}
.cl-text { flex: 1; min-width: 0; }
.cl-title { font-size: 13.5px; font-weight: 600; }
.cl-date { font-size: 12px; color: var(--muted); }
.cl-amount { font-size: 14px; font-weight: 700; color: var(--accent); white-space: nowrap; }

@keyframes cab-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* Два окна загрузки встают рядом, когда у сюжета есть второй герой (класс вешает JS) */
.try-uploads { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
.try-uploads.is-pair { grid-template-columns: 1fr 1fr; }
@media (max-width: 460px) {
  .try-uploads.is-pair { grid-template-columns: 1fr; }
}
.try-upload {
  display: block;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  overflow: hidden;
}
.try-upload[hidden] { display: none; }
.try-upload:hover { border-color: var(--accent); }
.try-upload-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 26px 16px; text-align: center; color: var(--muted);
}
.try-upload-inner[hidden] { display: none; }
.try-upload-inner svg { width: 26px; height: 26px; color: var(--accent); }
.try-upload-inner span { font-size: 14px; font-weight: 600; color: var(--text); }
.try-upload-inner small { font-size: 12px; }
.try-preview { position: relative; }
.try-preview[hidden] { display: none; }
.try-preview img { width: 100%; max-height: 300px; object-fit: cover; display: block; }
.try-preview-clear {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px;
}
.try-preview-clear:hover { background: rgba(0,0,0,.8); }

#tryPrompt {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  resize: none;
  outline: none;
}
#tryPrompt:focus { border-color: var(--accent); }
.try-generate {
  width: 100%;
  margin-top: 14px;
  background: var(--accent);
  border: none; color: #fff;
  font-size: 15px; font-weight: 700; font-family: inherit;
  padding: 14px; border-radius: 12px; cursor: pointer;
}
.try-generate:hover { background: var(--accent-hover); }
.try-generate:disabled { opacity: .6; cursor: default; }
.try-result { margin-top: 18px; }
.try-result[hidden] { display: none; }

@media (max-width: 600px) {
  .cat-head { flex-wrap: wrap; }
  .cat-try { padding: 9px 16px; font-size: 13px; }
}

.cat-grid {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}
.cat-grid::-webkit-scrollbar { height: 8px; }
.cat-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.cat-grid .card {
  flex: 0 0 auto;
  height: 300px;
  position: relative;
  display: block;
  background: var(--panel);
  scroll-snap-align: start;
}
.cat-grid .card img { height: 100%; width: auto; display: block; transition: transform .4s var(--ease); }
.cat-grid .card:hover img { transform: scale(1.04); }
.cat-grid .card .cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 14px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  opacity: 0;
  transition: opacity .2s;
}
.cat-grid .card:hover .cap { opacity: 1; }
/* Плитка с готовым промтом: подпись видна всегда, иначе не догадаться, что по ней
   можно кликнуть и сразу получить результат (на тачскрине ховера просто нет). */
.cat-grid .card--try .cap { opacity: 1; }
.cat-grid .card--try .cap b {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .02em;
}
@media (hover: none) { .cat-grid .card .cap { opacity: 1; padding: 20px 12px 10px; background: linear-gradient(transparent, rgba(0,0,0,.65)); } }

@media (max-width: 700px) {
  .cat-grid .card { height: 220px; }
}

/* Блок «Точный контроль» */
.control-section {
  margin-top: 96px;
}
.control-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.15;
  margin-bottom: 48px;
}
.control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px 64px;
  max-width: 1040px;
  margin: 0 auto 32px;
}
.control-left h3 { font-size: 22px; font-weight: 700; margin-bottom: 20px; }
.btn-get-started {
  display: inline-block;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 10px;
}
.btn-get-started:hover { background: var(--panel); }
.control-list { list-style: none; display: flex; flex-direction: column; gap: 16px; }
.control-list li { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 15px; }
.ck { color: var(--accent); display: inline-flex; }
.ck svg { width: 16px; height: 16px; }
.menu-toggle svg { width: 18px; height: 18px; }

@media (max-width: 700px) {
  .control-title { font-size: 23px; }
  .control-grid { grid-template-columns: 1fr; gap: 24px; text-align: left; }
}

/* ===== Слайдер «до / после» ===== */
.ba-slider {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  touch-action: pan-y;
  cursor: ew-resize;
  user-select: none;
  --pos: 50%;
}
.ba-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ba-after-wrap {
  position: absolute; inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
  will-change: clip-path;
}
.ba-slider.ba-anim .ba-after-wrap { transition: clip-path .55s var(--ease); }
.ba-slider.ba-anim .ba-handle { transition: left .55s var(--ease); }
.ba-tag {
  position: absolute; top: 16px;
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: rgba(15,13,10,.55); backdrop-filter: blur(4px);
  padding: 5px 12px; border-radius: var(--radius-pill);
  pointer-events: none;
}
.ba-tag-before { left: 16px; }
.ba-tag-after { right: 16px; }
.ba-handle {
  position: absolute; top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  background: #fff;
  transform: translateX(-1px);
  box-shadow: 0 0 0 1px rgba(0,0,0,.15);
  pointer-events: none;
  transition: transform .15s var(--ease);
}
.ba-handle::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 40px; height: 40px;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 50%;
  box-shadow: var(--sh-2);
}
.ba-handle svg {
  position: absolute; top: 50%; left: 50%;
  width: 18px; height: 18px;
  transform: translate(-50%, -50%);
  color: var(--ink);
  z-index: 1;
}
.ba-slider.is-drag .ba-handle { transform: translateX(-1px) scale(1.08); }
.ba-range {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0;
  cursor: ew-resize;
  margin: 0;
}
@media (max-width: 700px) { .ba-slider { aspect-ratio: 4/3; } }

/* Блок «Любой стиль по запросу» */
.style-section {
  margin-top: 96px;
}
/* Пункты-галочки под заголовком секции: один центрированный ряд */
.sec-points {
  list-style: none;
  margin: 26px auto 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 12px;
}
.sec-points li {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 500;
}
/* ===== Один сюжет в 7 стилях: чипы + большое превью ===== */
.style-switch {
  margin: 44px auto 0;
  max-width: 1040px;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}
.style-switch-chips {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.ssc-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.ssc-chip:hover { background: var(--panel-2); color: var(--text); }
.ssc-chip.is-active { background: var(--a-tint); color: var(--accent-ink); }
.ssc-chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  opacity: 0; transform: scale(0);
  transition: opacity .15s, transform .15s var(--ease);
}
.ssc-chip.is-active .ssc-chip-dot { opacity: 1; transform: scale(1); }

.style-switch-preview { min-width: 0; }
.style-switch-stage {
  position: relative;
  aspect-ratio: 4/3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--sh-2);
}
.style-switch-stage img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.style-switch-stage img.is-active { opacity: 1; }
.style-switch-foot {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.style-switch-cap { color: var(--muted); font-size: 14px; margin: 0; }
.style-switch-go { flex-shrink: 0; }

@media (max-width: 720px) {
  .style-switch { grid-template-columns: 1fr; gap: 16px; }
  .style-switch-chips {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    margin: 0 -24px;
    padding: 0 24px 4px;
    background: none;
    border: 0;
    border-radius: 0;
    mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
  }
  .ssc-chip { white-space: nowrap; flex-shrink: 0; }
  .style-switch-foot { flex-direction: column; align-items: flex-start; }
}

/* Уведомление об использовании cookie */
.cookie-banner {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 70;
  width: 620px;
  max-width: calc(100vw - 40px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  padding: 24px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
  animation: cookie-in .3s var(--ease-out) both;
}
.cookie-banner[hidden] { display: none; }
@keyframes cookie-in { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%); } }
.cookie-banner-ico {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
.cookie-banner-ico svg { width: 19px; height: 19px; }
.cookie-banner p {
  flex: 1 1 220px;
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-muted);
}
.cookie-banner p a { color: var(--ink); text-decoration: underline; }
.cookie-banner-ok {
  flex-shrink: 0;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--sh-a);
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.cookie-banner-ok:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
@media (max-width: 640px) {
  .cookie-banner {
    left: 12px; right: 12px; bottom: 12px; width: auto; transform: none; padding: 20px 18px;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .cookie-banner p { flex: none; }
  .cookie-banner-ok { margin-left: 0; }
}
@keyframes cookie-in-mobile { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 640px) {
  .cookie-banner { animation-name: cookie-in-mobile; }
}

/* Попап просмотра фото */
.lightbox {
  position: fixed;
  inset: 0;
  /* Выше модалок (у них 70): из «Моих картинок» в кабинете просмотр открывался
     ПОД самим кабинетом, поэтому казалось, что клик по миниатюре не работает. */
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, .88);
  cursor: zoom-out; /* пустое место = закрыть */
  overflow-y: auto;
  opacity: 0;
  transition: opacity .16s ease;
}
.lightbox.is-open { opacity: 1; }
.lightbox[hidden] { display: none; } /* атрибут hidden должен реально прятать окно */
/* Кабинет и «Попробовать» на время просмотра картинки убираем из виду: класс
   вешает JS. Не display:none — иначе окно потеряет позицию прокрутки и при
   возврате из просмотра отмотается в начало. */
.is-under-lightbox { visibility: hidden; }

.lb-content {
  cursor: default;
  width: fit-content;
  /* Ширину кадра задаёт ТОЛЬКО это место. Раньше у картинки стояло своё
     max-width: 94vw, и горизонтальные фото шире 1040px вылезали за пределы
     этой коробки: кнопки под ними и крестик оставались по краям коробки, а
     фото уходило вправо — со стороны выглядело как съехавшая вёрстка. */
  max-width: min(94vw, 1280px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform: scale(.985);
  transition: transform .16s ease;
}
.lightbox.is-open .lb-content { transform: scale(1); }
.lb-stage {
  position: relative;
  background: transparent; /* без чёрных полос по бокам */
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Кнопки раньше сидели прямо в .lb-stage и в обычном режиме честно облегали
   картинку — сцена сама сжималась по контенту. В полноэкранном режиме браузер
   растягивает .lb-stage на весь экран (это делает Fullscreen API, не мы), а
   картинка внутри так и остаётся своего исходного размера по центру — кнопки же,
   привязанные к сцене, разъезжались к краям экрана, повисая в воздухе далеко от
   фото. .lb-frame — промежуточная обёртка, которая обтягивает ровно картинку
   (inline-flex сам ужимается по контенту) независимо от того, растянута сцена
   вокруг нею или нет. Кнопки теперь привязаны к рамке, а не к сцене — и остаются
   у краёв фото в обоих режимах. */
.lb-frame {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  max-height: 100%;
}
.lb-img {
  max-width: 100%; /* границу держит .lb-content, иначе фото выпадает из коробки */
  max-height: 84vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 14px;
}
.lb-icon {
  position: absolute;
  top: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: rgba(20, 20, 26, .7);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.lb-icon:hover { background: rgba(40, 40, 50, .9); }
.lb-full { right: 58px; }
.lb-close { right: 12px; }

.lb-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 20, 26, .6);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.lb-nav:hover { background: rgba(40, 40, 50, .9); }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }

/* Оверлей на время «Попробовать»/уточнения: раньше сама картинка гасла до 40%
   прозрачности и рядом всплывал текстовый тост «Обрабатываю…» — непонятно, что
   вообще происходит. Теперь фото остаётся как есть, а поверх него (не вместо)
   встаёт та же кисточка, что и на основной генерации — только без подписи снизу,
   она тут не нужна: сам кадр уже перед глазами. */
.lb-processing {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 16, 22, .74);
  border-radius: 14px;
}
.lb-processing[hidden] { display: none; }
.lb-processing .gen-progress { min-height: 0; border: none; background: transparent; padding: 0; }
.lb-processing .gen-phrase { color: #fff; }
.lb-processing .gen-step { color: rgba(255, 255, 255, .55); }
.lb-processing .gen-step.is-active,
.lb-processing .gen-step.is-done { color: #fff; }
@media (max-width: 640px) {
  .lb-processing .gen-progress { min-height: 0; padding: 0; }
}

.lb-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}
.lb-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lb-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  padding: 11px 16px;
  border-radius: 10px;
  cursor: pointer;
}
.lb-btn:hover { background: var(--border); }
.lb-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.lb-btn.primary:hover { background: var(--accent-hover); }
.lb-caption {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin-top: 14px;
}
.result-img, .gallery .card { cursor: zoom-in; }

/* Тост-уведомление */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.toast[hidden] { display: none; }

/* Mobile */
.menu-toggle {
  display: none;
  position: fixed;
  top: 14px; left: 14px;
  z-index: 40;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 10px;
  font-size: 18px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background .15s ease, border-color .15s ease;
}
.menu-toggle svg { position: absolute; }
.menu-toggle .mt-close { opacity: 0; transform: scale(.7); }
.menu-toggle.is-close .mt-open { opacity: 0; transform: scale(.7); }
.menu-toggle.is-close .mt-close { opacity: 1; transform: scale(1); }
.menu-toggle svg { transition: opacity .15s ease, transform .15s ease; }
/* Пока меню открыто, кнопка сама превращается в угол панели — без своей рамки поверх неё */
.menu-toggle.is-close { background: var(--bg-side); border-color: transparent; z-index: 31; }
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 25;
}

@media (max-width: 900px) {
  .menu-toggle { display: flex; }
  .sidebar {
    position: fixed;
    left: 0; top: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform .25s;
  }
  .sidebar.open { transform: translateX(0); }
  .overlay.show { display: block; }
  .main { margin-left: 0; padding: 70px 18px 40px; }
  .hero h1 { font-size: 26px; }
}
@media (max-width: 520px) {
  .cat-grid .card { flex-basis: 42%; height: 150px; }
  .cat-grid .card img { width: 100%; object-fit: cover; object-position: center; }
  /* Портретные фото — карточка выше, чтобы обрезалось по бокам, а не сверху (иначе теряется лицо) */
  .cat-clothing .cat-grid .card { height: 210px; }
  .cat-grid .card .cap { padding: 18px 10px 8px; font-size: 12px; }
}

/* ===== Общие заголовки нижних секций ===== */
.sec-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.028em;
  line-height: 1.1;
}
.sec-sub {
  text-align: center;
  color: var(--muted);
  font-size: 16px;
  max-width: 60ch;
  margin: 12px auto 0;
  line-height: 1.6;
}

/* ===== Единая карточка ===== */
.card-base {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: clip;
  transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease;
}
.card-base:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--sh-2); }

/* ===== Что умеет Канвас ===== */
.tools-section { margin-top: 96px; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 44px;
}
.tool-card { padding: 22px; }
.tool-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.tool-card p { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ===== Как это работает ===== */
.how-section { margin-top: 96px; position: relative; }
.how-section::before {
  content: '';
  position: absolute; inset: -20px -24px auto -24px; height: 420px; z-index: -1;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 28px 28px;
  opacity: .5;
  mask-image: radial-gradient(ellipse 60% 100% at 50% 30%, #000 40%, transparent 90%);
}
.how-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 44px;
  counter-reset: none;
}
.how-steps { position: relative; }
.how-steps li {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px 22px 22px;
  transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease;
}
.how-steps li:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--sh-2); }
.how-num {
  display: block;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  color: color-mix(in srgb, var(--accent) 22%, transparent);
  margin-bottom: 6px;
}
.how-steps h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.how-steps p { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* ===== Вопросы и ответы ===== */
.faq-section { margin-top: 96px; }
.faq-list {
  max-width: 1080px;
  margin: 40px auto 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 48px;
}
.faq-item {
  border-bottom: 1px solid var(--line);
  break-inside: avoid;
}
.faq-q {
  cursor: pointer;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 20px 30px 20px 0;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  position: relative;
}
.faq-q::before,
.faq-q::after {
  content: '';
  position: absolute;
  right: 2px;
  top: 50%;
  width: 11px;
  height: 1.5px;
  background: var(--muted);
  transition: transform .25s var(--ease);
}
.faq-q::after { transform: rotate(90deg); }
.faq-q[aria-expanded="true"]::after { transform: rotate(0deg); }
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .3s var(--ease);
}
.faq-item.is-open .faq-a { grid-template-rows: 1fr; }
.faq-a-inner { overflow: hidden; min-height: 0; }
.faq-a-inner p {
  padding: 0 30px 20px 0;
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .22s var(--ease) 0s, transform .22s var(--ease) 0s;
}
.faq-item.is-open .faq-a-inner p {
  opacity: 1;
  transform: none;
  transition: opacity .25s var(--ease) .1s, transform .25s var(--ease) .1s;
}

/* ===== Тарифы ===== */
.pricing-section { margin-top: 96px; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: 44px;
  align-items: stretch;
}
.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: transform .2s var(--ease), border-color .2s ease, box-shadow .2s ease;
}
.pricing-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: var(--sh-2); }
.pricing-card--featured {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-text);
  transform: scale(1.035);
  box-shadow: 0 20px 44px -18px rgba(0,0,0,.35);
}
.pricing-card--featured:hover { transform: scale(1.035) translateY(-3px); }
.pricing-badge {
  position: absolute;
  top: -13px;
  left: 24px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  box-shadow: var(--sh-a);
}
.pricing-head { margin-bottom: 22px; }
.pricing-name { display: block; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }
.pricing-card--featured .pricing-name { color: var(--ink-muted); }
.pricing-price { display: flex; align-items: baseline; gap: 4px; }
.pricing-amount { font-family: var(--font-display); font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.pricing-period { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.pricing-card--featured .pricing-period { color: var(--ink-muted); }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 13px; margin: 0 0 26px; flex: 1; }
.pricing-features li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
.pricing-card--featured .pricing-features li { color: var(--ink-text); opacity: .92; }
.pricing-features svg { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; color: var(--accent); }
.pricing-card--featured .pricing-features svg { color: var(--a-300, var(--accent)); }
.pricing-cta {
  display: block;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-radius: var(--radius-sm);
  box-shadow: var(--sh-a);
  transition: background .15s var(--ease), border-color .15s var(--ease), opacity .15s ease;
}
.pricing-cta:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.pricing-cta--outline { background: transparent; color: var(--text); border-color: var(--border); box-shadow: none; }
.pricing-cta--outline:hover { background: var(--panel-2); border-color: var(--border); }
.pricing-card--featured .pricing-cta--outline { color: var(--ink-text); border-color: rgba(255,255,255,.25); }
.pricing-card--featured .pricing-cta--outline:hover { background: rgba(255,255,255,.08); }
.pricing-cta[disabled] { cursor: not-allowed; opacity: .55; }
.pricing-cta[disabled]:hover { background: var(--accent); border-color: var(--accent); }
.pricing-card--featured .pricing-cta[disabled]:hover { background: var(--accent); }
.pricing-note { max-width: 620px; margin: 28px auto 0; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
@media (max-width: 900px) {
  .pricing-grid { grid-template-columns: 1fr 1fr; }
  .pricing-card--featured { transform: none; }
  .pricing-card--featured:hover { transform: translateY(-3px); }
}
@media (max-width: 620px) {
  .pricing-section { margin-top: 64px; }
  .pricing-grid { grid-template-columns: 1fr; }
}

/* ===== Инверсный низ: CTA + подвал одним тёмным массивом ===== */
.ink-block {
  margin-top: 96px;
  border-radius: 32px 32px 0 0;
  overflow: clip;
  position: relative;
}
.on-ink {
  --bg: var(--ink); --surface: var(--ink-2); --panel: var(--ink-2);
  --panel-2: var(--ink-line); --line: var(--ink-line); --line-strong: #4a4438;
  --text: var(--ink-text); --text-2: #ded7cb; --muted: var(--ink-muted);
  --accent-ink: #ff9560;
  background: var(--ink); color: var(--ink-text);
}
.on-ink::before {
  content: '';
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000 0%, transparent 75%);
}

/* ===== Финальный призыв ===== */
.cta-section {
  position: relative; z-index: 1;
  text-align: center;
  padding-block: 88px 64px;
}
.cta-section h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.cta-section p { color: var(--ink-muted); font-size: 16px; margin: 14px 0 28px; }
.btn-get-started--ink {
  background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: var(--sh-a);
}
.btn-get-started--ink:hover { background: var(--accent-hover); }
.cta-peek { display: flex; justify-content: center; gap: 0; margin-top: 48px; }
.cta-peek img {
  width: 108px; height: 135px; object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--sh-3);
  border: 4px solid var(--ink-2);
}
.cta-peek img:nth-child(1) { transform: rotate(-7deg) translateY(10px); margin-right: -18px; z-index: 1; }
.cta-peek img:nth-child(2) { transform: translateY(-6px); z-index: 2; }
.cta-peek img:nth-child(3) { transform: rotate(6deg) translateY(10px); margin-left: -18px; z-index: 1; }
@media (max-width: 620px) { .cta-peek { display: none; } }

/* ===== Подвал сайта ===== */
.site-footer {
  position: relative; z-index: 1;
  padding-block: 44px 24px;
  border-top: 1px solid var(--line);
}
.site-footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr));
  gap: 32px;
}
.site-footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 14px;
}
.site-footer-col a {
  display: block;
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
  margin-bottom: 10px;
}
.site-footer-col a:hover { color: var(--text); }
.site-footer-logo { display: block; font-family: var(--font-display); font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; color: var(--text); }
.site-footer-brand p { color: var(--muted); font-size: 13.5px; line-height: 1.55; max-width: 320px; }
.site-footer-bottom {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.site-footer-copy { color: var(--muted); font-size: 13px; }

@media (max-width: 860px) {
  .site-footer-grid { grid-template-columns: 1fr 1fr; gap: 28px 32px; }
  .site-footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .site-footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .site-footer-brand { grid-column: auto; }
}

@media (max-width: 900px) {
  .tools-grid, .how-steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .control-section, .style-section, .tools-section, .how-section, .faq-section, .cta-section { margin-top: 64px; }
  .tools-grid, .how-steps { grid-template-columns: 1fr; }
  .faq-list { grid-template-columns: 1fr; }
  .sec-title { font-size: 23px; }
  .sec-sub, .cta-section p { font-size: 15px; }
  .cta-section { padding: 38px 20px; }
  .cta-section h2 { font-size: 22px; }
}

/* ===== Страницы документов (оферта / политика / правила) ===== */
body.legal-shell {
  display: block; /* body{display:flex} в базовых стилях — для раскладки sidebar+main, тут её нет */
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}
.legal-header {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.legal-brand { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; color: var(--text); text-decoration: none; }
.legal-back { color: var(--muted); font-size: 14px; text-decoration: none; }
.legal-back:hover { color: var(--text); }
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  line-height: 1.65;
}
.legal-page h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 6px; }
.legal-page .legal-updated { color: var(--muted); font-size: 13.5px; margin-bottom: 32px; }
.legal-page h2 { font-size: 19px; font-weight: 700; margin: 32px 0 12px; }
.legal-page p { margin-bottom: 14px; color: var(--text); }
.legal-page ul, .legal-page ol { margin: 0 0 14px 22px; }
.legal-page li { margin-bottom: 6px; }
.legal-page a { color: var(--accent); }
.legal-page strong { font-weight: 700; }
.legal-nav {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px 24px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13.5px;
}
.legal-nav a { color: var(--muted); text-decoration: none; }
.legal-nav a.active { color: var(--accent); font-weight: 600; }
.legal-nav a:hover { color: var(--text); }
.legal-todo {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 28px;
  font-size: 13.5px;
  color: var(--muted);
}
@media (max-width: 600px) {
  .legal-page h1 { font-size: 23px; }
}

/* ===== Страница 404 ===== */
.nf-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 64px 20px 100px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.nf-code {
  font-family: var(--font-display);
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #ffb37a));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nf-ico {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  margin: 8px 0 20px;
}
.nf-ico svg { width: 28px; height: 28px; }
.nf-wrap h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 10px; }
.nf-wrap p { color: var(--muted); font-size: 15px; line-height: 1.6; max-width: 420px; margin-bottom: 28px; }
.nf-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 36px; }
.nf-btn {
  display: inline-block;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.nf-btn:active { transform: scale(.96); }
.nf-btn-primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); box-shadow: var(--sh-a); }
.nf-btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.nf-btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.nf-btn-outline:hover { background: var(--panel-2); }
.nf-links { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; font-size: 13.5px; }
.nf-links a { color: var(--muted); text-decoration: none; }
.nf-links a:hover { color: var(--accent); }
@media (max-width: 480px) {
  .nf-code { font-size: 84px; }
  .nf-wrap { padding: 48px 20px 72px; }
}

@media (max-width: 720px) {
  .cabinet-box { padding: 24px 16px; }
  .cabinet-layout { grid-template-columns: 1fr; gap: 18px; }
  .cabinet-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 4px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .cabinet-nav-item { white-space: nowrap; flex-shrink: 0; }
  .cabinet-plans { grid-template-columns: repeat(2, 1fr); }
}


/* ===== Ожидание генерации: сканирующая иконка, фраза и шаги ===== */
.gen-progress {
  min-height: 320px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
}
/* Кисть ведёт знак бесконечности, за ней тянется след, тающий с хвоста.
   Приём: короткий видимый сегмент штриха бежит по контуру (stroke-dashoffset), а кисть
   едет по тому же пути через offset-path и опережает сегмент ровно на его длину —
   поэтому краска будто ложится из-под кисти.
   LEN = 276.4 — реальная длина пути (212.6 у исходного контура × 1.3, весь узор
   увеличен, чтобы кисть можно было нарисовать крупнее и разборчивее).
   От LEN зависит бесшовность петли: при неверном числе на стыке цикла виден рывок. */
.gen-brush {
  position: relative;
  width: 156px;
  height: 78px;
  margin-top: 4px;
}
.gen-brush-art { width: 156px; height: 78px; display: block; overflow: visible; }
.gb-trail {
  stroke: var(--accent);
  stroke-dasharray: 67.6 208.8;
  stroke-dashoffset: 0;
  animation: gb-run 2.8s linear infinite;
  filter: drop-shadow(0 0 3px color-mix(in srgb, var(--accent) 35%, transparent));
}
@keyframes gb-run { to { stroke-dashoffset: -276.4; } }

/* Кисть собрана из частей разного цвета — ручка, обойма, ворс. Одноцветная
   фигурка на 22px читалась как вертящаяся юла, отсюда и размер, и раскраска.
   Ворс обязан быть ШИРЕ обоймы: пока он просто сужался к острию, вся фигура
   читалась как пипетка — у той всё сужается монотонно, раструба нет. */
.gen-brush-tool {
  position: absolute;
  left: 0; top: 0;
  width: 34px;
  height: 46px;
  offset-path: path('M26 39 C26 14.3 57.2 14.3 78 39 C98.8 63.7 130 63.7 130 39 C130 14.3 98.8 14.3 78 39 C57.2 63.7 26 63.7 26 39Z');
  offset-rotate: 0deg;
  offset-anchor: 50% 100%; /* к пути прижат кончик ворса, а не центр картинки */
  /* Два движения сразу: ход по контуру и наклон кисти. У наклона тот же период и
     та же задержка, что у хода, — иначе он разъедется с положением на петле.
     Поворот идёт вокруг кончика (transform-origin), поэтому ворс не отрывается
     от следа — ведёт только ручка. */
  transform-origin: 50% 100%;
  animation: gb-tip 2.8s linear infinite, gb-daub 2.8s ease-in-out infinite;
  animation-delay: -0.685s, -0.685s;
}
.gb-handle  { fill: #c98a4e; }
.gb-ferrule { fill: #a9b0b9; }
.gb-band    { fill: #d3d9e0; }
.gb-hair    { fill: var(--accent); }
/* Три волоска: без них раструб выглядит просто каплей, а не пучком щетины */
.gb-bristle { stroke: var(--accent-ink); stroke-width: .8; stroke-linecap: round; opacity: .32; }
@keyframes gb-tip {
  from { offset-distance: 0%; }
  to   { offset-distance: 100%; }
}
/* На петле два разворота — по краям (0% и 50% пути) — и два прямых прохода через
   центр (25% и 75%). Кисть кренится только в разворотах, на прямой идёт ровно. */
@keyframes gb-daub {
  0%   { transform: rotate(28deg); }  /* левый разворот — кисть заваливается */
  12%  { transform: rotate(8deg); }
  22%  { transform: rotate(0deg); }
  30%  { transform: rotate(0deg); }   /* прямая через центр — идёт ровно */
  38%  { transform: rotate(-8deg); }
  50%  { transform: rotate(-28deg); } /* правый разворот */
  62%  { transform: rotate(-8deg); }
  72%  { transform: rotate(0deg); }
  80%  { transform: rotate(0deg); }   /* и обратно через центр */
  88%  { transform: rotate(8deg); }
  100% { transform: rotate(28deg); }
}



.gen-phrase {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.gen-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}
.gen-step {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: var(--muted);
  opacity: .55;
  transition: opacity .25s ease, color .25s ease;
}
.gen-step i {
  flex: 0 0 auto;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid currentColor;
  position: relative;
}
.gen-step.is-active { opacity: 1; color: var(--text); }
.gen-step.is-active i {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
  animation: gen-pulse 1.4s ease-in-out infinite;
}
@keyframes gen-pulse {
  0%, 100% { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
  50%      { box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 8%, transparent); }
}
.gen-step.is-done { opacity: 1; color: var(--text-2, var(--text)); }
.gen-step.is-done i {
  border-color: var(--accent);
  background: var(--accent);
}
.gen-step.is-done i::after {
  content: '';
  position: absolute;
  left: 3px; top: 0;
  width: 4px; height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.gen-caption {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .gen-progress { min-height: 260px; padding: 24px 16px; gap: 12px; }
  .gen-caption { max-width: 260px; }
}
/* ===== Счётчик символов промта ===== */

/* ===== Проявление готового кадра ===== */
/* Пока файл качается, на его месте идёт «волна», а картинка спрятана. Момент
   подмены был резким: волна пропадала и кадр возникал рывком. Теперь он коротко
   проявляется из размытия — как будто снимок доводится до резкости. */
.result-img img { animation: res-reveal .45s var(--ease) both; }
.result-img.is-loading img { animation: none; }
@keyframes res-reveal {
  from { opacity: 0; transform: scale(1.04); filter: blur(10px) saturate(.55); }
  60%  { opacity: 1; }
  to   { opacity: 1; transform: none; filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  .result-img img { animation: none; }
}

/* ===== Финальный мазок поверх готового кадра ===== */
/* Разметку строит playFinishStroke в app.js. Сцена 180x180 — та же система
   координат, что у путей внутри: кисть позиционируется offset-path в пикселях,
   поэтому viewBox обязан совпадать с размером в CSS один к одному. */
.gen-finish {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 2;
}
.gf-stage { position: relative; width: 180px; height: 180px; }
.gf-art {
  width: 180px; height: 180px; display: block; overflow: visible;
  /* кадр под галочкой может быть любой — тень держит её читаемой и на светлом */
  filter: drop-shadow(0 2px 12px rgba(20, 14, 6, .45));
}
.gf-ghost {
  /* тот же цвет, что у следа на прогрессе: это та же петля, а не новая фигура */
  stroke: var(--accent);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}
.gf-check {
  stroke: #fff;
  /* длина ломаной M52 96 L78 124 L132 56: 38.2 + 86.9 */
  stroke-dasharray: 125.1;
  stroke-dashoffset: 125.1;
}
.gf-splash circle {
  fill: #fff;
  opacity: 0;
  transform-box: fill-box;
  transform-origin: 50% 50%;
}
.gf-splash circle.is-paint { fill: var(--accent); }
.gf-brush {
  position: absolute;
  left: 0; top: 0;
  width: 34px; height: 46px;
  offset-path: path('M52 96 L78 124 L132 56');
  offset-rotate: 0deg;
  offset-anchor: 50% 100%;
  transform-origin: 50% 100%;
  opacity: 0;
  /* прилёт с прежнего места задаётся из JS отдельным свойством translate,
     чтобы не затирать transform — на нём висит наклон кисти */
}

.gen-finish.is-playing { animation: gf-wrap-out .45s ease-out 1.15s forwards; }
@keyframes gf-wrap-out { to { opacity: 0; } }

/* петля гаснет и подбирается к центру — её работа кончилась */
.gen-finish.is-playing .gf-ghost { animation: gf-ghost .32s ease-out both; }
@keyframes gf-ghost {
  0%   { opacity: .55; transform: scale(1); }
  100% { opacity: 0;   transform: scale(.8); }
}

.gen-finish.is-playing .gf-check { animation: gf-draw .5s cubic-bezier(.3, .7, .3, 1) .34s both; }
@keyframes gf-draw { to { stroke-dashoffset: 0; } }

.gen-finish.is-playing .gf-brush {
  animation:
    gf-ride .5s cubic-bezier(.3, .7, .3, 1) .34s both,
    gf-tilt .5s ease-in-out .34s both,
    gf-brush-in .2s ease-out both,
    gf-brush-out .28s ease-in .95s forwards;
}
@keyframes gf-ride { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes gf-brush-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes gf-brush-out { to { opacity: 0; } }
/* излом галочки приходится на 30% пути — там кисть и перекладывается */
@keyframes gf-tilt {
  0%   { transform: rotate(16deg); }
  28%  { transform: rotate(10deg); }
  34%  { transform: rotate(-14deg); }
  100% { transform: rotate(-8deg); }
}

/* всплеск: короткий, задержки у капель разные — иначе читается как одно кольцо */
.gen-finish.is-playing .gf-splash circle { animation: gf-splash .42s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes gf-splash {
  0%   { opacity: 0;   transform: translate(0, 0) scale(.2); }
  25%  { opacity: .95; }
  100% { opacity: 0;   transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* Кнопок под кадром стало пять («Оживить» и «Анимация» переехали сюда из ряда
   выбора модели). На телефоне они складывались рваной лесенкой — раскладываем
   ровной сеткой, главному действию отдаём всю ширину. */
@media (max-width: 520px) {
  .img-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .img-actions .ia-btn { width: 100%; padding-inline: 10px; }
}

/* ===== Ожидание прямо в панели ввода ===== */
/* Раньше блок ожидания вставал НАД панелью и на телефоне занимал пол-экрана вместе
   с чек-листом этапов. Этапы убраны совсем (они изображали ход работы, о котором
   провайдер ничего не сообщает), а кисточка переехала туда, куда человек смотрит
   в момент нажатия. */
.prompt-busy {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: var(--surface);
  border-radius: inherit;
}
.prompt-busy .gen-progress {
  min-height: 0;
  border: 0;
  background: none;
  padding: 0;
}

/* ===== Свой просмотр видео ===== */
/* Кнопки «Скачать» и «Поделиться» вынесены из меню плеера наружу — см. videoResultMarkup */
.video-result video {
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
  background: #000;
}
.video-result .img-actions { margin-top: 12px; }

/* ===== Открытки: собрать за 3 шага (только /otkrytka) ===== */
.card-wizard {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--sh-2);
}
.cw-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.cw-dots { display: flex; gap: 6px; flex-shrink: 0; }
.cw-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s, transform .15s;
}
.cw-dot:not(:disabled):hover { transform: scale(1.08); }
.cw-dot:disabled { cursor: default; opacity: .5; }
.cw-dot.is-done { background: var(--a-tint); border-color: var(--accent); color: var(--accent-ink); }
.cw-dot.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cw-step-title { font-size: 15px; font-weight: 700; color: var(--text); }
.cw-back {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
}
.cw-back:hover { color: var(--text-2); }

.cw-grid[hidden] { display: none; }
.cw-grid { display: grid; gap: 12px; }
/* Плитки с картинкой (повод, отрасль, деталь) — видно сразу 8 (4 в ряд × 2 ряда),
   сами плитки поменьше визуально, остальные не растягивают шаг в длинную простыню,
   а докручиваются стрелками .cw-grid-arrow или драгом (см. initCardWizard в app.js).
   Если опций ≤8, контент помещается целиком и скролл/стрелки сами не появляются. */
.cw-grid--img {
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 1fr);
  grid-auto-columns: calc((100% - 36px) / 4);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.cw-grid--img::-webkit-scrollbar { display: none; }
.cw-chip--img { scroll-snap-align: start; }
/* Текстовые таблетки (атмосфера) — своя, более плотная сетка, им картинка не нужна,
   и остаются обычной оборачивающейся сеткой без карусели. */
.cw-grid--pill { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }

.cw-grid-wrap { position: relative; }
.cw-grid-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text-2);
  box-shadow: var(--sh-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background .15s, color .15s, transform .15s;
}
.cw-grid-arrow:hover { background: var(--a-tint); color: var(--accent-ink); }
.cw-grid-arrow[hidden] { display: none; }
.cw-grid-arrow--prev { left: -8px; }
.cw-grid-arrow--next { right: -8px; }

/* Плитка-картинка: тот же приём, что у .cat-grid .card по всему сайту — фото на всю
   плитку, подпись поверх градиентом снизу, а не рамка вокруг маленькой картинки. */
.cw-chip--img {
  position: relative;
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  box-shadow: var(--sh-1);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .15s;
}
.cw-chip--img:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.cw-chip--img.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--a-tint); }
.cw-chip--img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s var(--ease);
}
.cw-chip--img:hover img { transform: scale(1.05); }
.cw-chip--img span {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 26px 12px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,.72));
}

/* Текстовая таблетка (атмосфера) — без картинки, просто крупная кнопка-пилюля */
.cw-chip--pill {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  cursor: pointer;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  transition: border-color .15s, transform .15s, background .15s;
}
.cw-chip--pill:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.cw-chip--pill.is-active { border-color: var(--accent); background: var(--a-tint); color: var(--accent-ink); }

@media (max-width: 620px) {
  .cw-grid--img { grid-auto-columns: calc((100% - 12px) / 2); }
  .cw-grid--pill { grid-template-columns: repeat(2, 1fr); }
  .cw-grid-arrow--prev { left: -4px; }
  .cw-grid-arrow--next { right: -4px; }
}

.cw-text-step[hidden] { display: none; }
.cw-text-step { text-align: center; }
.cw-text-input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  margin-bottom: 14px;
}
.cw-text-input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.cw-text-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.cw-preview { text-align: center; }
.cw-preview-text {
  font-size: 14px;
  color: var(--text-2);
  background: var(--panel);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin: 0 0 14px;
}
.cw-preview-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cw-restart {
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  cursor: pointer;
}
.cw-restart:hover { border-color: var(--muted); }
.cw-go { flex: 0 0 auto; }

@media (max-width: 620px) {
  .cw-head { flex-wrap: wrap; }
}

/* ===== Мастер: шаг с фото и/или описанием («combo»/«photo») ===== */
.cw-combo-step[hidden] { display: none; }
.cw-combo-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
/* Чисто фото-шаг (открытки): текстовая половина скрыта JS-ом, фото — на всю ширину */
.cw-combo-cols--photo-only { grid-template-columns: 1fr; max-width: 420px; margin-inline: auto; }

.cw-photo-drop {
  display: block;
  /* Фиксированное соотношение сторон — иначе рамка скачет по размеру пропорционально
     тому, что человек загрузил (портрет/альбом/квадрат), и мастер дёргается. */
  aspect-ratio: 16 / 9; /* пониже, чем 4:3 — юзер попросил уменьшить высоту блока */
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, background .15s;
}
.cw-combo-cols--photo-only .cw-photo-drop { aspect-ratio: 3 / 4; } /* открытки: фото человека — портретный кадр, тут высота уместна */
.cw-photo-drop:hover, .cw-photo-drop.is-over { border-color: var(--accent); background: var(--a-tint); }
.cw-photo-drop.is-loading { pointer-events: none; opacity: .7; }
.cw-photo-drop-inner {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; height: 100%; padding: 24px 16px; text-align: center; color: var(--muted);
}
.cw-photo-drop-inner[hidden] { display: none; }
.cw-photo-drop-inner svg { width: 26px; height: 26px; color: var(--accent); }
.cw-photo-drop-inner span { font-size: 14px; font-weight: 600; color: var(--text); }
.cw-photo-drop-inner small { font-size: 12px; }
.cw-photo-preview { position: relative; height: 100%; }
.cw-photo-preview[hidden] { display: none; }
.cw-photo-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cw-photo-preview .try-preview-clear {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px; border-radius: 8px; border: none;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 14px;
}
.cw-photo-preview .try-preview-clear:hover { background: rgba(0,0,0,.8); }

.cw-combo-textarea {
  width: 100%;
  height: 100%;
  min-height: 140px;
  resize: none;
  font-family: inherit;
}
.cw-combo-textarea[hidden] { display: none; }

@media (max-width: 620px) {
  .cw-combo-cols { grid-template-columns: 1fr; }
  .cw-combo-textarea { min-height: 110px; }
}

/* ===== Тату: «Примерить на себе» (только /tatu) ===== */
.tatu-tryon {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 22px;
  box-shadow: var(--sh-2);
}
.tatu-tryon-title { font-size: 18px; font-weight: 800; margin-bottom: 4px; }
.tatu-tryon-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.tatu-tryon-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.tatu-tryon-text {
  width: 100%;
  height: 100%;
  min-height: 180px;
  resize: none;
  font-family: inherit;
}
.tatu-tryon .cw-photo-drop { aspect-ratio: auto; height: 100%; min-height: 180px; }

@media (max-width: 760px) {
  .tatu-tryon-cols { grid-template-columns: 1fr; }
  .tatu-tryon .cw-photo-drop { min-height: 220px; }
  .tatu-tryon-text { min-height: 120px; }
}

/* ===== Поиск по готовым промтам на /fotosessiya (прототип) =====
   Ищет по подписи, скрытым тегам и тексту промта среди плиток витрины и
   категорий ниже — сам список строится в app.js (initPromptSearch). */
.ps-search { margin-top: 32px; }
.ps-search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  box-shadow: var(--sh-1);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.ps-search-box:focus-within {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--sh-2), 0 0 0 4px var(--a-tint);
}
.ps-search-box svg { flex-shrink: 0; width: 18px; height: 18px; color: var(--muted); }
.ps-search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  font-size: 15px;
  color: var(--text);
}
.ps-search-box input::placeholder { color: var(--muted); }
.ps-search-clear {
  flex-shrink: 0;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.ps-search-clear:hover { color: var(--text); }
.ps-search-clear[hidden] { display: none; }

.ps-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.ps-search-results[hidden] { display: none; }
/* .card-base даёт только рамку/скругление — позиционирование картинки и подписи
   у .cat-grid .card завязано на flex-режим ленты (height:100%, width:auto), тут
   своя обычная сетка, поэтому те же правила, но под object-fit:cover. */
.ps-search-results .card {
  position: relative;
  display: block;
  height: 200px;
}
.ps-search-results .card img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s var(--ease);
}
.ps-search-results .card:hover img { transform: scale(1.04); }
.ps-search-results .card .cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 28px 14px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
}
.ps-search-results .card .cap b {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .02em;
}

.ps-search-empty {
  margin: 16px 4px 0;
  color: var(--muted);
  font-size: 14px;
}
.ps-search-empty[hidden] { display: none; }

@media (max-width: 620px) {
  .ps-search-results { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .ps-search-results .card { height: 160px; }
}

/* ===== Нейрофотосессия: готовые альбомы вместо строки промпта (/fotosessiya) =====
   Заглушка от 08.09.2026. Раскладка: табы пола → карусель альбомов → сетка
   подкатегорий 3×2 → кадры внутри подкатегории → загрузка своего фото →
   липкая панель с ценой. Токены темы общие с остальным сайтом, свою тёмную
   палитру блок не вводит — иначе он не переживёт переключение темы. */
.nf[hidden] { display: none; }
.nf {
  margin-top: 26px;
  text-align: left;
}

/* Полоска «продолжить прошлый выбор» — над табами, тонкая, не перекрывает блок */
.nf-resume[hidden] { display: none; }
.nf-resume {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--a-tint);
}
.nf-resume-text { flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--text); }
.nf-resume-go, .nf-resume-no {
  flex: 0 0 auto;
  border: none;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 7px 15px;
}
.nf-resume-go { background: var(--accent); color: #fff; }
.nf-resume-no { background: none; color: var(--muted); padding-inline: 6px; }
.nf-resume-no:hover { color: var(--text-2); }

.nf-gender { display: flex; gap: 8px; margin-bottom: 18px; }
.nf-g {
  padding: 9px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.nf-g:not(:disabled):hover { border-color: var(--line-strong); }
.nf-g.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.nf-g:disabled { opacity: .45; cursor: not-allowed; }

.nf-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 12px;
}
.nf-head--sub { margin-top: 28px; }
.nf-step {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
/* Номер шага кружком: три шага читаются как один маршрут, а не как три
   независимых заголовка. Цифра — не текст «Шаг N», чтобы строка не съедала
   место у подписи справа. */
.nf-num {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--a-tint);
  color: var(--accent-ink);
  font-size: 11.5px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0;
}
.nf-hint { font-size: 13px; color: var(--muted); }
.nf-arrows { margin-left: auto; display: flex; gap: 6px; }
.nf-arrow {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  color: var(--text-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nf-arrow:hover { background: var(--a-tint); color: var(--accent-ink); }
.nf-back {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 2px;
}
.nf-back:hover { color: var(--text-2); }

/* Карусель альбомов — как ряд плиток мастера: горизонтальная прокрутка,
   листается стрелками, сама полоса прокрутки спрятана. */
.nf-albums {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 48px) / 4);
  gap: 16px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.nf-albums::-webkit-scrollbar { display: none; }
.nf-album {
  position: relative;
  display: block;
  text-align: left;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .15s;
}
.nf-album:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.nf-album.is-active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--a-tint); }
.nf-album img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ease);
}
.nf-album:hover img { transform: scale(1.04); }
/* Подпись лежит НА картинке под градиентом, а не отдельной полосой снизу:
   так карточка читается как обложка альбома, а ряд не разъезжается по высоте
   из-за разной длины названий. */
.nf-album-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: block;
  padding: 34px 12px 11px;
  background: linear-gradient(to top, rgba(0,0,0,.82) 35%, rgba(0,0,0,.35) 70%, transparent);
  pointer-events: none;
}
.nf-album-cap b {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.nf-album-cap span { font-size: 12px; color: rgba(255,255,255,.72); }
.nf-tick {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 1;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.85);
  background: rgba(0,0,0,.25);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  opacity: 0;
  transition: background .15s, border-color .15s, transform .15s var(--ease), opacity .15s;
}
/* Пустой кружок на каждой из пятнадцати плиток превращал сетку в ряды
   радиокнопок. Показываем его под курсором и у выбранных кадров. */
.nf-style:hover .nf-tick,
.nf-style.is-picked .nf-tick,
.nf-pick:focus-visible .nf-tick { opacity: 1; }
/* На тач-экранах наведения нет, и раньше кружок висел на каждой плитке. При трёх
   кадрах в ряд он вместе со значком «открыть» съедал полширины карточки —
   сетка превращалась в поле кнопок. Оставляем только у выбранных: там он несёт
   смысл, а для остальных достаточно рамки. */
@media (hover: none) {
  .nf-tick { opacity: 0; }
  .nf-style.is-picked .nf-tick { opacity: 1; }
}
/* Выбранный кадр: галочка заливается акцентом — видно с расстояния, не
   вглядываясь в тонкую рамку карточки. */
.nf-style.is-picked .nf-tick {
  background: var(--accent);
  border-color: #fff;
  transform: scale(1.08);
}

/* Кадры выбранной категории — выбираем до 6 штук */
.nf-styles-pane[hidden] { display: none; }
/* Ровно 15 кадров на категорию — три ряда по пять. Фиксированные колонки
   вместо auto-fill: с ним ширина карточки скакала от количества кадров
   (в тонких категориях становилась крупнее, чем в полных), и ряды не
   выравнивались по сетке друг под другом. */
.nf-styles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
/* Карточка кадра — контейнер с двумя кнопками: по картинке кадр выбирается,
   а «Открыть» слева сверху показывает его крупно, ничего не выбирая. */
.nf-style {
  position: relative;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--panel);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .15s;
}
.nf-pick {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}
.nf-pick:disabled { cursor: not-allowed; }
.nf-style img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  transition: transform .35s var(--ease);
}
.nf-style:hover img { transform: scale(1.05); }
.nf-style:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.nf-style.is-picked { border-color: var(--accent); box-shadow: 0 0 0 3px var(--a-tint); }
.nf-style.is-locked { opacity: .45; }
.nf-style.is-locked:hover { transform: none; box-shadow: none; }
.nf-style.is-locked:hover img { transform: none; }

/* Название кадра — только под курсором и у выбранных: постоянные подписи
   превратили бы сетку из пятнадцати картинок в стену текста. */
.nf-style-cap {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 26px 9px 8px;
  font-size: 11.5px;
  line-height: 1.25;
  color: #fff;
  text-align: left;
  background: linear-gradient(to top, rgba(0,0,0,.85) 30%, transparent);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nf-style:hover .nf-style-cap,
.nf-style.is-picked .nf-style-cap { opacity: 1; }

/* Пустая категория: честно говорим «скоро», а не показываем пустую сетку */
.nf-album.is-empty img { filter: grayscale(1); opacity: .5; }
.nf-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px 4px;
  color: var(--muted);
  font-size: 14px;
}

/* Кликабельная зона растянута на левый верхний угол карточки: сам значок
   маленький, а попадать в него пальцем нужно уверенно. Кнопка прозрачная,
   видно только .nf-open-ico внутри. */
.nf-open {
  position: absolute;
  top: 0; left: 0;
  z-index: 2;
  width: 58%;
  height: 38%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 8px;
  border: none;
  background: none;
  cursor: pointer;
}
.nf-open-ico {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  opacity: 0;
  transition: opacity .15s, background .15s, transform .15s;
}
.nf-open-ico svg { width: 15px; height: 15px; }
.nf-style:hover .nf-open-ico,
.nf-open:focus-visible .nf-open-ico { opacity: 1; }
.nf-open:hover .nf-open-ico { background: rgba(0, 0, 0, .8); transform: scale(1.06); }
/* На тач-устройствах ховера нет — значок показываем всегда, иначе до него не добраться */
@media (hover: none) { .nf-open-ico { opacity: 1; } }

/* Кнопка выбора внутри просмотра: выбранный кадр помечаем заливкой акцентом */
.lb-pick.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Липкая панель со счётчиком и ценой */
.nf-bar[hidden] { display: none; }
.nf-bar {
  position: sticky;
  bottom: 14px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--sh-3);
}
/* Выбранные кадры лежат стопкой внахлёст, как колода: шесть отдельных плиток
   съедали половину панели и оставляли кнопку без места. */
.nf-bar-thumbs { display: flex; flex-shrink: 0; padding-left: 4px; }
.nf-bar-thumbs img {
  width: 36px; height: 44px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin-left: -10px;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 4px rgba(0,0,0,.14);
  transition: transform .18s var(--ease), margin .18s var(--ease);
}
.nf-bar-thumbs:hover img { margin-left: -2px; }
.nf-bar-thumbs img:hover { transform: translateY(-3px); }
.nf-bar-text {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
  flex: 1 1 auto;
  min-width: 0;
}
.nf-bar-text strong { font-size: 14px; color: var(--text); }
.nf-bar-text span { font-size: 12.5px; color: var(--muted); }
/* .try-generate на сайте растянута на всю ширину — в панели это распирало
   кнопку до 513px при контейнере в 543 и она вылезала за край. */
.nf-go {
  width: auto;
  flex: 0 0 auto;
  margin-left: auto;
  padding: 12px 26px;
}

/* ===== Шаг 3 · Ваше фото =====
   Раньше здесь стояла одинокая пунктирная коробка на пол-экрана: понятно, что
   туда что-то кладут, но непонятно ЧТО именно и зачем. Теперь это карточка из
   двух половин — портретная зона загрузки слева (той же формы, что и кадры
   выше, чтобы глаз читал «сюда встанет ваше лицо») и требования к снимку
   справа. Требования тут не занудство: сходство во всей серии определяется
   исходником, и человеку честнее сказать это до оплаты, а не после. */
.nf-photo {
  display: grid;
  /* Зона загрузки нарочно небольшая: это кнопка, а не главный герой шага.
     Крупная портретная рамка растягивала карточку на пол-экрана и оставляла
     справа мёртвое поле. */
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.nf-photo.is-ready { border-color: var(--accent); box-shadow: 0 0 0 3px var(--a-tint); }

/* Слоты под фото. На вкладке «Пара» их два — нужны оба лица, иначе модель
   второго человека просто придумает. Подпись над каждым говорит, чьё фото
   куда: без неё непонятно, кто окажется слева, а кто справа в кадре. */
.nf-slots { display: flex; gap: 14px; }
.nf-slot { display: flex; flex-direction: column; gap: 7px; width: 184px; }
.nf-slot[hidden] { display: none; }
.nf-slot-cap {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  padding-left: 2px;
}

/* Зона загрузки: портрет, но приземистее кадров серии — 4:5 вместо 3:4 */
.nf-drop {
  aspect-ratio: 4 / 5;
  max-width: none;
  min-height: 0;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background:
    radial-gradient(120% 90% at 50% 0%, var(--a-tint) 0%, transparent 62%),
    var(--panel);
  transition: border-color .18s, background .18s, transform .18s var(--ease);
}
.nf-drop:hover { border-color: var(--accent); transform: translateY(-2px); }
.nf-drop.is-over {
  border-color: var(--accent);
  border-style: solid;
  transform: scale(1.015);
  box-shadow: 0 0 0 4px var(--a-tint);
}
/* Фото загружено — пунктир не нужен, он мешал снимку доходить до краёв */
.nf-photo.is-ready .nf-drop { border-style: solid; border-color: transparent; background: var(--panel); }
.nf-photo.is-ready .nf-drop:hover { transform: none; }
.nf-drop .cw-photo-drop-inner { gap: 8px; padding: 20px 14px; }
/* Иконка в кружке: без неё пустая зона выглядит как «поле не загрузилось» */
.nf-drop-ico {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  margin-bottom: 4px;
  border-radius: 50%;
  background: var(--a-tint);
  color: var(--accent-ink);
  transition: transform .25s var(--ease);
}
.nf-drop-ico svg { width: 24px; height: 24px; }
.nf-drop:hover .nf-drop-ico { transform: translateY(-3px) scale(1.06); }
.nf-drop .cw-photo-drop-inner span { font-size: 14.5px; text-wrap: balance; }
.nf-drop .cw-photo-drop-inner small { font-size: 12px; color: var(--muted); text-wrap: balance; }
/* Пока фото ужимается и уходит на сервер — бегущая волна вместо мёртвой заливки */
.nf-drop.is-loading { opacity: 1; }
.nf-drop.is-loading .cw-photo-drop-inner {
  background: linear-gradient(100deg, transparent 30%, var(--a-tint) 50%, transparent 70%);
  background-size: 220% 100%;
  animation: nf-wave 1.1s linear infinite;
}

/* Загруженное фото: подпись-плашка снизу и крестик сверху, оба поверх снимка */
.nf-photo-ok {
  position: absolute;
  left: 10px; bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 8px;
  border-radius: var(--radius-pill);
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(3px);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}
.nf-photo-ok::before {
  content: '✓';
  display: grid;
  place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  font-size: 10px;
}
.nf-drop .cw-photo-preview .try-preview-clear { border-radius: 50%; width: 28px; height: 28px; }

/* Правая половина — требования к снимку */
/* Правая половина всегда короче снимка — центрируем её по его высоте,
   иначе снизу зияет пустота. */
.nf-photo-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding-top: 2px;
}
.nf-photo.is-ready .nf-photo-note { margin-top: 6px; }
.nf-photo-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
}
.nf-photo.is-ready .nf-photo-title { color: var(--accent-ink); }
/* Четыре требования в две колонки: в одну они вытягивались узкой лентой вдоль
   всей ширины карточки, а справа оставалось пустое поле. */
.nf-tips {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 22px;
}
@media (max-width: 780px) { .nf-tips { grid-template-columns: 1fr; } }
.nf-tips li {
  position: relative;
  padding-left: 27px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-2);
}
.nf-tips li::before {
  content: '✓';
  position: absolute;
  left: 0; top: 1px;
  display: grid;
  place-items: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--a-tint);
  color: var(--accent-ink);
  font-size: 10px;
  font-weight: 700;
}
.nf-photo-note {
  margin: auto 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* Когда фото принято, требования уступают место наглядному «что получится»:
   ряд выбранных кадров с подписью. Список требований к этому моменту уже
   отработал — человек по нему выбирал снимок, а теперь ему важнее увидеть,
   во что этот снимок превратится. */
.nf-tips[hidden] { display: none; }
.nf-plan[hidden] { display: none; }
.nf-plan { display: grid; gap: 10px; }
.nf-plan-lead { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.nf-plan-row { display: flex; flex-wrap: wrap; gap: 8px; }
.nf-plan-row img {
  width: 62px; height: 78px;
  object-fit: cover;
  border-radius: 9px;
  display: block;
  border: 1px solid var(--line);
  /* Кадры «проявляются» по очереди — маленькая радость на последнем шаге */
  animation: nf-pop .32s var(--ease) both;
}
@keyframes nf-pop {
  from { opacity: 0; transform: translateY(6px) scale(.94); }
  to { opacity: 1; transform: none; }
}

/* Результаты серии. Общего сброса [hidden] в проекте нет, а display тут свой —
   без явного правила блок остался бы виден до первого запуска. */
.nf-results[hidden] { display: none; }
.nf-results { display: block; margin-top: 22px; }
/* Кнопка сборки коллажа — второстепенная, поэтому контурная, а не заливкой */
.nf-collage[hidden] { display: none; }
.nf-collage {
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--panel);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.nf-collage:hover { border-color: var(--accent); color: var(--accent-ink); }
.nf-collage:disabled { opacity: .5; cursor: default; }
.nf-results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.nf-res {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  background: var(--card, #14161c);
  border: 1px solid var(--line, rgba(255,255,255,.08));
  aspect-ratio: 3 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.nf-res.is-done { cursor: zoom-in; }
.nf-res img { width: 100%; height: 100%; object-fit: cover; }
.nf-res figcaption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 10px 8px;
  font-size: 12px;
  line-height: 1.25;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Пустая плитка «кадр ещё готовится» — та же бегущая волна, что на результате */
.nf-res-wait {
  width: 100%; height: 100%;
  background: linear-gradient(100deg, rgba(255,255,255,.03) 30%, rgba(255,255,255,.10) 50%, rgba(255,255,255,.03) 70%);
  background-size: 220% 100%;
  animation: nf-wave 1.4s linear infinite;
}
@keyframes nf-wave { from { background-position: 140% 0; } to { background-position: -40% 0; } }
.nf-res-err { padding: 14px; font-size: 12.5px; text-align: center; color: var(--muted); }
.nf-res.is-failed { border-color: rgba(255,120,120,.35); }

@media (max-width: 620px) {
  .nf-results-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1100px) {
  .nf-styles { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 900px) {
  .nf-albums { grid-auto-columns: calc((100% - 32px) / 3); }
  .nf-styles { grid-template-columns: repeat(3, 1fr); }
  .nf-photo { grid-template-columns: 190px minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 620px) {
  .nf-albums { grid-auto-columns: calc((100% - 16px) / 2); }
  /* Три кадра в ряд: плитка ~97 px, поэтому вся мелочь на ней тоже ужимается */
  .nf-styles { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .nf-style { border-width: 1.5px; }
  .nf-open { width: 52%; height: 40%; padding: 5px; }
  .nf-open-ico { width: 23px; height: 23px; }
  .nf-open-ico svg { width: 12px; height: 12px; }
  .nf-tick { top: 6px; right: 6px; width: 19px; height: 19px; border-width: 1.5px; font-size: 11px; }
  .nf-style-cap { padding: 18px 6px 5px; font-size: 10px; }
  /* На телефоне колонки не помещаются: зона загрузки становится невысокой
     полосой во всю ширину — иконка и текст в строку, как у кнопки, — а
     требования идут списком под ней. Портретная рамка тут занимала бы пол-экрана. */
  .nf-photo { grid-template-columns: 1fr; padding: 14px; gap: 16px; }
  /* На телефоне два слота встают в ряд по половине ширины, один — во всю */
  .nf-slots { gap: 10px; }
  .nf-slot { width: auto; flex: 1 1 0; min-width: 0; }
  .nf-drop { aspect-ratio: auto; height: 116px; }
  .nf-drop .cw-photo-drop-inner {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    padding: 14px;
    text-align: left;
    flex-wrap: wrap;
  }
  .nf-drop-ico { width: 42px; height: 42px; margin-bottom: 0; }
  .nf-drop .cw-photo-drop-inner span { font-size: 14px; }
  .nf-drop .cw-photo-drop-inner small { flex-basis: 100%; text-align: center; margin-top: -4px; }
  /* С загруженным фото полоса разворачивается обратно в портрет — снимок в
     ленте 116 px высотой не разглядеть. */
  .nf-photo.is-ready .nf-drop { aspect-ratio: 4 / 5; height: auto; max-width: 210px; }
  .nf-photo-note { margin-top: 0; }
  .nf-arrows { display: none; }
  .nf-bar { flex-wrap: wrap; }
  .nf-go { margin-left: 0; width: 100%; }
}

/* ===== Показательный пример «фото → открытка» (только /otkrytki) ===== */
.example-section { margin-top: 96px; }
.example-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-top: 28px;
}
.example-step { margin: 0; }
.example-step img {
  width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; display: block;
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface);
}
.example-step figcaption { margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.example-step figcaption b { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.example-arrow { color: var(--a-500); }
.example-arrow svg { width: 34px; height: 34px; display: block; }
.example-prompt { margin-top: 24px; padding: 20px 22px; }
.example-prompt-label {
  display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.example-prompt p { color: var(--text); font-size: 15px; line-height: 1.6; }
.example-prompt .btn-get-started { margin-top: 16px; }

@media (max-width: 720px) {
  .example-flow { grid-template-columns: 1fr; gap: 14px; }
  .example-arrow { justify-self: center; transform: rotate(90deg); }
}
