/* ===== ПЕРЕМЕННЫЕ ===== */
:root {
  --bg: #faf6ef;
  --bg-alt: #f2ead8;
  --fg: #1c1410;
  --muted: #6b5c4e;
  --accent: #b8652a;
  --accent-hover: #9a5020;
  --accent-soft: #e8b88a;
  --line: rgba(28,20,16,0.12);
  --card: #ffffff;
  --dark: #221510;
  --serif: "Playfair Display", Georgia, serif;
  --radius: 16px;
  --shadow: 0 4px 24px rgba(28,20,16,0.10);
}

/* ===== СБРОС ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }

/* ===== КОНТЕЙНЕР ===== */
.container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ===== КНОПКИ ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary {
  background: var(--bg-alt);
  color: var(--fg);
  border: 1px solid var(--line);
}
.btn-secondary:hover { background: var(--bg); }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}
.btn-ghost:hover { background: var(--bg-alt); }
.btn-large { padding: 15px 26px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== ШАПКА ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250,246,239,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--fg);
}
.logo em {
  color: var(--accent);
  font-weight: 400;
  font-size: 1.3em;
}
nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-link {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s;
}
.nav-link:hover { color: var(--fg); }

/* Login button in header — dark pill */
.btn-login {
  background: var(--fg) !important;
  color: var(--bg) !important;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13px;
  gap: 8px;
}
.btn-login svg { flex-shrink: 0; }
.btn-login:hover { background: #3a2a20 !important; transform: none; }

.btn-sm { padding: 8px 16px; font-size: 13px; }

/* ===== АВТОРИЗАЦИЯ В ШАПКЕ ===== */
#authArea { display: flex; align-items: center; }

/* Дропдаун пользователя */
.user-menu { position: relative; display: flex; align-items: center; }
.user-menu-trigger { display: flex; align-items: center; gap: 8px; cursor: default; }
.user-menu-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  user-select: none;
}
.user-menu-avatar svg { stroke: #fff; display: block; }
.user-menu-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  padding-top: 10px;
  z-index: 1000;
  min-width: 220px;
}
.user-menu:hover .user-menu-dropdown { display: block; }
.user-menu-inner {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid rgba(0,0,0,0.07);
  overflow: hidden;
}
.user-menu-head {
  padding: 12px 16px;
  font-size: 13px;
  color: #888;
  background: #faf8f5;
  border-bottom: 1px solid #f0ece4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-menu-item {
  display: block;
  width: 100%;
  padding: 11px 16px;
  font-size: 14px;
  color: #2a2a2a;
  text-decoration: none;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
  transition: background 0.12s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(184,101,42,0.08);
}
.user-menu-item-admin { color: var(--accent); font-weight: 500; font-size: 13px; }
.user-menu-item:hover { background: #faf8f5; color: var(--accent); }
.user-menu-item-accent { color: var(--accent) !important; font-weight: 500; }
.user-menu-item-accent:hover { background: rgba(184,101,42,0.07) !important; }
.user-menu-item-logout { color: #999; }
.user-menu-item-logout:hover { color: #c0392b !important; background: rgba(192,57,43,0.05) !important; }
.user-menu-sep { height: 1px; background: #f0ece4; }
.user-menu-credits-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(184,101,42,0.05);
  border-bottom: 1px solid #f0ece4;
}

#userInfo { display: flex; align-items: center; gap: 12px; }
#userName {
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-name-link { color: inherit; text-decoration: none; font-weight: 500; }
.user-name-link:hover { color: var(--accent); }
.user-balance {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(184,101,42,0.1);
  color: var(--accent);
  border-radius: 99px;
  white-space: nowrap;
}
.user-balance.is-empty {
  background: rgba(179,51,51,0.1);
  color: #b33;
}

/* ===== ГЕРОЙ ===== */
.hero {
  padding: 80px 0 100px;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 56px;
  align-items: center;
}
.hero-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: rgba(250, 246, 239, 0.92);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 28px;
}
.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: var(--accent);
}
h1 {
  font-family: var(--serif);
  font-size: clamp(32px, 5vw, 64px);
  line-height: 0.97;
  letter-spacing: -2.2px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 24px;
}
h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}
.hero-desc {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 460px;
  margin-bottom: 34px;
}
.hero-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 44px;
}
.btn-accent-pill {
  background: var(--accent);
  color: #fff;
  padding: 15px 26px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
}
.btn-accent-pill:hover { background: var(--accent-hover); }
.btn-header-cta { padding: 9px 18px; font-size: 13px; }
.btn-outline-pill {
  border: 1px solid var(--line);
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  background: none;
  color: var(--fg);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  text-decoration: none;
}
.btn-outline-pill:hover { border-color: var(--accent); background: rgba(184,101,42,0.04); }

.privacy-note {
  font-size: 13px;
  color: #888;
  margin-top: 8px;
  text-align: center;
}

.hero-counter {
  display: flex;
  align-items: center;
  gap: 14px;
}
.hero-avatars { display: flex; }
.hero-avatar {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  border: 2px solid var(--bg);
  margin-left: -9px;
}
.hero-avatars .hero-avatar:first-child { margin-left: 0; }
.hero-counter-text {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.hero-counter-text b { color: var(--fg); }

/* Hero visual: tilted frame */
.hero-visual { position: relative; }
.hero-frame {
  background: var(--card);
  padding: 14px;
  box-shadow: 0 28px 80px -20px rgba(40,20,10,0.28);
  transform: rotate(1.5deg);
  aspect-ratio: 4/5;
}
.hero-quote {
  font-family: var(--serif);
  font-style: italic;
  position: absolute;
  bottom: -26px;
  left: -24px;
  width: 170px;
  background: var(--bg-alt);
  padding: 12px 16px;
  font-size: 14px;
  transform: rotate(-3deg);
  box-shadow: 0 10px 30px rgba(40,20,10,0.14);
  line-height: 1.4;
}
.hero-time-badge {
  position: absolute;
  top: -16px;
  right: -16px;
  background: var(--fg);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.4px;
}

/* ===== СЛАЙДЕР (hero реальные фото) ===== */
.slider-container, .result-slider-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  user-select: none;
  cursor: col-resize;
}
.slider-hint {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 8px;
  font-style: italic;
}
.slider-after {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}
.slider-before {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
  clip-path: inset(0 0 0 50%);
}
.slider-handle {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: rgba(255,255,255,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.handle-circle {
  width: 38px;
  height: 38px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  flex-shrink: 0;
  color: var(--accent);
}
.slider-label {
  position: absolute;
  top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
.label-before { right: 12px; background: rgba(30,15,8,0.7); backdrop-filter: blur(4px); }
.label-after { left: 12px; background: rgba(184,101,42,0.88); }

/* Shimmer skeleton while images load */
.slider-container {
  background: linear-gradient(90deg, #e9dcc3 0%, #f0e6d4 50%, #e9dcc3 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
.slider-container.is-loaded {
  background: none;
  animation: none;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ===== ГАЛЕРЕЯ ===== */
.gallery { padding: 60px 0 80px; }
.gallery .container { margin-bottom: 36px; }
.gallery-track-wrap {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, black 80px, black calc(100% - 80px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, black 80px, black calc(100% - 80px), transparent 100%);
}
#galTrack {
  display: flex;
  gap: 32px;
  width: max-content;
  padding: 36px 48px;
  will-change: transform;
}
.gal-item {
  flex-shrink: 0;
  width: 300px;
  text-align: center;
}
.gal-stack {
  position: relative;
  width: 270px;
  height: 345px;
  margin: 0 auto;
}
.gal-card-back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  transform: rotate(-9deg) translate(-18px, -14px);
  box-shadow: 0 4px 20px rgba(28,20,16,0.16);
  background: var(--bg-alt);
}
.gal-card-front {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 10px 36px rgba(28,20,16,0.24);
  background: var(--card);
}
.gal-caption {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.4;
}
.gallery-title-row {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}
.gal-hint {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-family: var(--sans);
  color: #8B5E3C;
  pointer-events: none;
  transform: rotate(-3deg);
  letter-spacing: 0.3px;
  margin-left: 20px;
  margin-bottom: 4px;
  opacity: 0.85;
}
.gal-hint-arrow {
  position: absolute;
  left: calc(100% + 2px);
  top: -6px;
  width: 56px;
  height: 64px;
  overflow: visible;
  opacity: 0.9;
}

/* ===== КАК ЭТО РАБОТАЕТ ===== */
.how {
  background: var(--bg-alt);
  padding: 72px 0;
}
h2 {
  font-family: var(--serif);
  font-size: clamp(32px, 4vw, 54px);
  font-weight: 700;
  letter-spacing: -1.4px;
  margin-bottom: 12px;
}
h2 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 400;
}
.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.section-sub {
  color: var(--muted);
  font-size: 18px;
  margin-bottom: 64px;
}
.how-inner {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 52px;
  align-items: center;
}
.how-title {
  white-space: nowrap;
  margin-bottom: 32px;
}
.how-visual {
  aspect-ratio: 4/3;
  background: var(--dark);
  padding: 10px;
  border-radius: 16px;
  box-shadow: 0 24px 60px -20px rgba(40,20,10,0.35);
  overflow: hidden;
}
.how-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.how-steps { display: flex; flex-direction: column; }
.how-step {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}
.how-step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--accent);
  font-weight: 500;
  padding-top: 6px;
}
.how-step-title {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.how-step-desc {
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

/* ===== ЗАГРУЗКА ===== */
.upload-section {
  padding: 64px 0;
  background: var(--bg);
  scroll-margin-top: 64px;
}
.upload-section-header {
  text-align: center;
  margin-bottom: 28px;
}
.upload-section-header h2 {
  font-size: clamp(32px, 4vw, 54px);
}
.upload-area {
  max-width: 760px;
  margin: 0 auto;
  border: 2px dashed rgba(184,101,42,0.35);
  border-radius: 20px;
  background: var(--card);
  height: 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  padding: 28px;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--accent);
  background: #fffdf8;
}
.upload-area.has-preview {
  cursor: default;
  height: auto;
  min-height: 460px;
  align-items: flex-start;
  padding: 20px 28px 24px;
}
.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.upload-icon-wrap {
  width: 60px;
  height: 60px;
  border-radius: 30px;
  background: rgba(184,101,42,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}
.upload-text {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--fg);
}
.upload-sub { font-size: 14px; color: var(--muted); }
.upload-formats {
  display: inline-flex;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

/* ===== ПРЕВЬЮ ===== */
.upload-preview {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  position: relative;
}
.preview-wrap {
  width: 100%;
  height: 400px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}
.upload-result .preview-wrap { overflow: hidden; }
.canvas-frame {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  aspect-ratio: var(--canvas-ar, 1);
  line-height: 0;
}
#previewCanvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  cursor: zoom-in;
}

/* ===== РЕЗУЛЬТАТ ===== */
.upload-result {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.result-img-wrap {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  cursor: zoom-in;
}
.result-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 12px;
  display: block;
}

/* ===== СТРОКА ДЕЙСТВИЙ ===== */
.action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 20px;
  flex-wrap: wrap;
}
.rotate-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.btn-rotate {
  width: 48px; height: 48px;
  border: 1.5px solid rgba(184,101,42,0.3);
  background: var(--card);
  color: var(--muted);
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.btn-rotate-sm { width: 34px; height: 34px; }
.btn-rotate:hover { border-color: var(--accent); color: var(--accent); }
.btn-rotate:active { transform: scale(0.92); }

/* ===== ЛАЙК / ДИЗЛАЙК ===== */
.thumb-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  margin-top: 2px;
  width: 100%;
}
.thumb-label {
  font-size: 13px;
  color: var(--muted);
}
.thumb-btns { display: flex; gap: 8px; }
.thumb-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.thumb-btn:hover { border-color: var(--accent); color: var(--accent); background: rgba(184,101,42,0.06); }
.thumb-btn.active-up { border-color: var(--accent); background: var(--accent); color: #fff; }
.thumb-btn.active-down { border-color: var(--fg); background: var(--fg); color: #fff; }
.thumb-btn:disabled { opacity: 0.4; cursor: not-allowed; }
@keyframes thanksAppear {
  0%   { opacity: 0; transform: scale(0.7); }
  40%  { opacity: 1; transform: scale(1.15); }
  65%  { transform: scale(0.95); }
  80%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.85); }
}
.thumb-thanks {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  animation: thanksAppear 1.6s ease forwards;
}
/* ===== FEEDBACK MODAL ===== */
.feedback-modal-content {
  text-align: center;
}
.feedback-modal-content h3 {
  text-align: center;
}
.feedback-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 4px 0 16px;
}
.feedback-tag {
  padding: 8px 16px;
  border: 1.5px solid var(--border, #e0d8d0);
  border-radius: 20px;
  background: transparent;
  font-size: 13px;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.feedback-tag:hover:not(.selected) {
  border-color: var(--accent);
  color: var(--accent);
}
.feedback-tag.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
#feedbackText {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  background: var(--card);
  color: var(--fg);
  margin-bottom: 16px;
  display: block;
}
#feedbackText:focus { outline: none; border-color: var(--accent); }

.btn-link {
  display: inline-block;
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 8px 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-top: 10px;
}
.btn-link:hover { color: var(--accent-hover); }

/* ===== OVERLAY ОБРАБОТКИ ===== */
.proc-overlay {
  position: absolute; inset: 0;
  border-radius: 12px;
  overflow: hidden;
  pointer-events: none;
}
.proc-overlay-scan {
  position: absolute; left: 0; right: 0; top: -40px; height: 80px;
  background: linear-gradient(180deg, transparent, rgba(240,170,90,0.45) 50%, transparent);
  pointer-events: none;
  animation: uploadScan 2.2s linear infinite;
}
@keyframes uploadScan { 100% { transform: translateY(520px); } }
.proc-overlay-info {
  display: flex; align-items: center; gap: 8px;
  background: rgba(15,8,4,0.78); backdrop-filter: blur(6px);
  padding: 6px 14px; border-radius: 999px;
  color: #fff9ef; font-size: 12px; font-weight: 500;
  align-self: flex-start; position: relative; z-index: 1;
}
.proc-overlay-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #f0a860; box-shadow: 0 0 8px #f0a860;
  animation: pulse 1s infinite; flex-shrink: 0;
}
.proc-overlay-bar-wrap {
  height: 3px; background: rgba(255,245,225,0.2);
  border-radius: 2px; overflow: hidden; position: relative; z-index: 1;
}
.proc-overlay-bar {
  height: 100%; width: 5%;
  background: linear-gradient(90deg, #d98840, #f2c070);
  transition: width 1s cubic-bezier(.3,1,.5,1);
  border-radius: 2px;
}


/* ===== ОШИБКА ===== */
.error-box {
  max-width: 500px;
  margin: 0 auto;
  background: #fff0f0;
  border: 1px solid #ffcdd2;
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.error-box p { color: #c62828; font-size: 16px; }

/* ===== СПИННЕР ===== */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100%{opacity:.45}50%{opacity:1} }

/* ===== ПОДСКАЗКИ ЗАГРУЗКИ ===== */
.upload-tips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 760px;
  margin: 28px auto 0;
}
.tip {
  border: 1px dashed rgba(184,101,42,0.25);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
}
.tip-icon { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.tip h4 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  color: var(--fg);
}
.tip p { font-size: 13px; line-height: 1.55; color: var(--muted); margin: 0; }

/* ===== ПОПАП ПРОГРЕССА ===== */
.restore-popup {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 3;
  width: 360px;
  max-width: calc(100vw - 32px);
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(28,20,16,0.22), 0 4px 16px rgba(28,20,16,0.08);
  padding: 24px 28px 22px;
  line-height: 1.4;
  text-align: left;
}
.restore-popup.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}
.restore-popup-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.restore-popup-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(184,101,42,0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.restore-popup-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  color: var(--fg);
}
.restore-popup-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
}
.restore-popup-bar-wrap {
  height: 4px;
  background: rgba(184,101,42,0.12);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 18px;
}
.restore-popup-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #d98840, #f2c070);
  transition: width 1s cubic-bezier(.3,1,.5,1);
  border-radius: 2px;
}
.restore-popup-stages {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.restore-popup-stage {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(108,92,78,0.4);
  transition: color 0.3s;
}
.restore-popup-stage.active { color: var(--fg); font-weight: 500; }
.restore-popup-stage.done { color: var(--muted); }
.restore-popup-stage-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(184,101,42,0.18);
  transition: background 0.3s, box-shadow 0.3s;
}
.restore-popup-stage.active .restore-popup-stage-dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(184,101,42,0.55);
  animation: pulse 1s infinite;
}
.restore-popup-stage.done .restore-popup-stage-dot { background: #5a9e62; }

/* ===== ТАРИФЫ ===== */
.pricing {
  padding: 72px 0;
  background: var(--bg-alt);
}
.pricing-header {
  text-align: center;
  margin-bottom: 36px;
}
.pricing-header h2 { margin-bottom: 10px; }
.pricing-header .pricing-note { color: var(--muted); font-size: 15px; }
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  max-width: 980px;
  margin: 0 auto;
}
.plan-card {
  background: var(--card);
  padding: 34px 26px;
  border-radius: 18px;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.plan-card:hover {
  transform: scale(1.025);
  box-shadow: 0 24px 64px -16px rgba(40,20,10,0.22);
}
@keyframes planBtnPulseOutline {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,101,42,0); }
  50%       { box-shadow: 0 0 0 7px rgba(184,101,42,0.22); }
}
@keyframes planBtnPulseFill {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
  50%       { box-shadow: 0 0 0 7px rgba(255,255,255,0.28); }
}
.plan-btn.outline.pulsing {
  animation: planBtnPulseOutline 1.5s ease-in-out infinite;
}
.plan-btn.fill.pulsing {
  animation: planBtnPulseFill 1.5s ease-in-out infinite;
}
/* Прямое наведение на кнопку — устойчивое свечение вместо пульса */
.plan-btn.outline.pulsing:hover {
  animation: none;
  box-shadow: 0 0 0 6px rgba(184,101,42,0.28);
}
.plan-btn.fill.pulsing:hover {
  animation: none;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.3);
}
.plan-card.popular {
  background: var(--dark);
  color: #fff;
  border: none;
  box-shadow: 0 20px 60px -20px rgba(40,20,10,0.4);
  position: relative;
}
.plan-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  white-space: nowrap;
}
.plan-name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}
.plan-price {
  font-family: var(--serif);
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 4px;
}
.plan-period {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 22px;
}
.plan-card.popular .plan-period { color: rgba(255,255,255,0.55); }
.plan-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin-bottom: 18px;
}
.plan-card.popular .plan-divider { border-color: rgba(255,255,255,0.1); }
.plan-features { list-style: none; flex: 1; margin-bottom: 22px; }
.plan-features li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  align-items: flex-start;
}
.plan-features li::before {
  content: '';
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15' fill='none' stroke='%23b8652a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7.5l4 4 7-8'/%3E%3C/svg%3E") no-repeat center;
}
.plan-card.popular .plan-features li::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 15' fill='none' stroke='%23e8b88a' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M2 7.5l4 4 7-8'/%3E%3C/svg%3E") no-repeat center;
}
.plan-card.popular .plan-features li { color: rgba(255,255,255,0.82); }
.plan-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.plan-btn.outline { background: none; border: 1px solid var(--line); color: var(--fg); }
.plan-btn.outline:hover { background: var(--bg-alt); }
.plan-btn.fill { background: var(--accent); border: none; color: #fff; }
.plan-btn.fill:hover { background: var(--accent-hover); }

/* ===== FAQ ===== */
.faq { padding: 110px 0; background: var(--bg); }
.faq-header { text-align: center; margin-bottom: 56px; }
.faq-header h2 { margin-bottom: 0; }
#faqList { max-width: 740px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-q {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  cursor: pointer;
  user-select: none;
}
.faq-q-text {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.2px;
  color: var(--fg);
}
.faq-plus {
  width: 26px;
  height: 26px;
  border-radius: 13px;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s;
  color: var(--accent);
  flex-shrink: 0;
}
.faq-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(.3,1,.4,1);
}
.faq-body-inner {
  padding-bottom: 20px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}
.faq-body-inner a { color: var(--accent); }

/* ===== ОЧЕРЕДЬ ФОТО ===== */
.queue-list {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 200px;
  width: 100%;
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 72px;
}
.queue-item-thumb { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.queue-item-name {
  flex-grow: 1;
  font-size: 14px;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.queue-badge {
  min-width: 100px;
  text-align: center;
  border-radius: 99px;
  padding: 4px 12px;
  font-size: 13px;
  flex-shrink: 0;
}
.queue-badge.pending   { background: var(--bg-alt); color: var(--muted); }
.queue-badge.processing { background: var(--bg-alt); color: var(--muted); }
.queue-badge.done      { background: rgba(42,122,58,0.1); color: #2a7a3a; }
.queue-badge.error     { background: rgba(179,51,51,0.1); color: #b33; }
.queue-badge.processing::after {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  margin-left: 6px;
  border: 2px solid rgba(99,85,65,0.3);
  border-top-color: var(--muted);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
.queue-item-remove {
  width: 32px; height: 32px;
  border: none; background: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  flex-shrink: 0;
}
.queue-item-remove:hover { background: var(--bg-alt); color: var(--fg); }
.queue-item-download {
  font-size: 14px;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}
.queue-summary { text-align: center; font-size: 14px; color: var(--muted); margin-top: 8px; }

/* ===== ГЛОБАЛЬНЫЙ ERROR TOAST ===== */
.global-error {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #b33;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  font-size: 14px;
  z-index: 99999;
  max-width: 92vw;
  text-align: center;
  display: none;
  animation: toastIn 0.25s ease-out;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== LIGHTBOX ===== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20,12,6,0.94);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: zoom-out;
  padding: 24px;
  animation: lightboxIn 0.15s ease-out;
}
@keyframes lightboxIn { from { opacity: 0; } to { opacity: 1; } }
.lightbox img {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.25); }
.lightbox-hint { color: rgba(255,255,255,0.7); font-size: 13px; margin: 0; }
.result-slider-container img { cursor: zoom-in; }

/* ===== ГАЛЕРЕЯ — ПОПАП ===== */
.gal-popup {
  position: fixed; inset: 0;
  background: rgba(15,8,4,0.82);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
  padding: 20px;
}
.gal-popup.visible { opacity: 1; pointer-events: auto; }
.gal-popup-inner {
  position: relative;
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  max-width: 92vw;
  width: auto;
  min-width: 300px;
  box-shadow: 0 32px 80px rgba(15,8,4,0.35);
  animation: popupIn 0.28s cubic-bezier(.3,1.4,.5,1) both;
}
.gal-popup:not(.visible) .gal-popup-inner { animation: none; }
@keyframes popupIn { from { transform: scale(0.93); opacity:0; } to { transform: scale(1); opacity:1; } }
.gal-popup-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  background: rgba(184,101,42,0.1);
  border: none; border-radius: 50%;
  font-size: 18px; line-height: 1;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.gal-popup-close:hover { background: var(--accent); color: #fff; }
.gal-popup-pair {
  display: flex; gap: 16px;
  align-items: flex-start;
}
.gal-popup-side {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.gal-popup-img-wrap {
  width: auto;
  max-width: 44vw;
  border-radius: 12px; overflow: hidden;
  background: rgba(0,0,0,0.04);
}
.gal-popup-img-wrap img {
  max-height: min(520px, 62vh);
  width: auto; max-width: 100%;
  display: block;
}
.gal-popup-label {
  font-size: 12px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--muted);
}
@media (max-width: 600px) {
  .gal-popup-pair { flex-direction: column; align-items: center; }
  .gal-popup-img-wrap { max-width: 85vw; }
  .gal-popup-img-wrap img { max-height: min(260px, 38vh); }
}
.result-hint { color: var(--muted); font-size: 13px; margin-bottom: 16px; text-align: center; font-style: italic; }

/* ===== МОДАЛКИ ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(28,20,16,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 40px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  position: relative;
  box-shadow: 0 8px 40px rgba(28,20,16,0.2);
}
.modal-content h3 {
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--fg);
}
.modal-content p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.5;
}
.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none; border: none;
  font-size: 28px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px; line-height: 1;
}
.modal-close:hover { color: var(--fg); }

/* ===== AUTH MODAL ===== */
.auth-modal { max-width: 420px; text-align: left; }
.auth-modal h3 { text-align: center; margin-bottom: 6px; }
.auth-modal-subtitle { text-align: center; color: #666; font-size: 14px; margin-bottom: 20px; }
.auth-modal .btn-login {
  width: 100%;
  justify-content: center;
  padding: 14px 20px;
  font-size: 15px;
  margin-bottom: 16px;
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 13px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.auth-email-form { display: flex; flex-direction: column; gap: 10px; }
.auth-email-form button[type="submit"] { align-self: center; justify-content: center; padding: 10px 48px; font-size: 14px; }
.auth-email-form input[type="email"],
.auth-email-form input[type="password"] {
  padding: 12px 14px;
  border: 1px solid rgba(184,101,42,0.25);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fffaf2;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.auth-email-form input:focus { border-color: var(--accent); background: #fff; }
.auth-status {
  margin-top: 12px;
  font-size: 14px;
  text-align: center;
  min-height: 20px;
  color: var(--muted);
}
.auth-status.is-error { color: #b33; }
.auth-status.is-success { color: #2a7a3a; }
.auth-consent-hint { font-size: 12px; color: #999; text-align: center; margin-top: -4px; }
.auth-links { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.auth-links a { color: var(--accent); font-size: 14px; }
.auth-links a:hover { text-decoration: underline; }
.auth-forgot-inline { font-size: 13px; color: #888; text-align: right; text-decoration: none; margin-top: -4px; }
.auth-forgot-inline:hover { color: var(--accent); text-decoration: underline; }

/* ===== ЧЕКБОКС СОГЛАСИЯ ===== */
.consent-label {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: #555; line-height: 1.5;
  margin: 16px 0; text-align: left;
}
.consent-label input[type="checkbox"] { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }
.consent-label a { color: var(--accent); text-decoration: underline; }

/* ===== ФУТЕР ===== */
.footer {
  background: var(--dark);
  color: #f0e4cc;
  padding: 64px 0 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-logo {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.footer-logo em { color: var(--accent-soft); font-weight: 400; font-size: 1.3em; }
.footer-tagline {
  font-size: 13px;
  color: rgba(240,228,204,0.6);
  line-height: 1.65;
  max-width: 280px;
}
.footer-col-title {
  font-size: 10px;
  color: var(--accent-soft);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 14px;
}
.footer-link {
  display: block;
  font-size: 13px;
  color: rgba(240,228,204,0.75);
  margin-bottom: 8px;
  cursor: pointer;
  transition: color 0.15s;
}
.footer-link:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(240,228,204,0.1);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(240,228,204,0.4);
}
.footer-bottom a { color: rgba(240,228,204,0.4); }

/* ===== ЛЕГАЛЬНЫЕ СТРАНИЦЫ ===== */
.legal { padding: 40px 0 80px; background: var(--bg); min-height: 60vh; }
.legal-container { max-width: 760px; }
.legal h1 { font-family: var(--serif); font-size: 40px; margin-bottom: 8px; }
.legal h2 { font-size: 22px; margin-top: 32px; margin-bottom: 12px; color: var(--fg); }
.legal h3 { font-size: 17px; margin-top: 20px; margin-bottom: 8px; }
.legal p, .legal li { line-height: 1.65; color: #444; margin-bottom: 10px; }
.legal ul { padding-left: 22px; margin-bottom: 14px; }
.legal a { color: var(--accent); }
.legal-meta { color: #777; font-size: 14px; }
.legal-tldr {
  background: #fff5e6;
  border: 1px solid #f0d8b0;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  padding: 18px 22px;
  margin: 24px 0 32px;
}
.legal-tldr h2 { font-size: 18px !important; margin: 0 0 10px !important; }
.legal-tldr ul { padding-left: 22px; margin: 0; }
.legal-tldr li { margin-bottom: 6px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 14px 0 20px; font-size: 14px; }
.legal-table th, .legal-table td { border: 1px solid #ddd; padding: 10px 12px; text-align: left; vertical-align: top; }
.legal-table th { background: #f0ebe3; font-weight: 600; }

/* ===== ФОКУС ===== */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.btn:focus-visible, a:focus-visible { outline-offset: 3px; }
input:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }

/* ===== ГАМБУРГЕР + МОБИЛЬНОЕ МЕНЮ ===== */
.mobile-account-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: var(--fg);
  flex-shrink: 0;
}
.nav-burger {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid var(--fg);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  flex-shrink: 0;
  color: var(--fg);
  gap: 0;
  line-height: 1;
}
.nav-burger svg { display: block; }

/* ===== TOP DROPDOWN МЕНЮ ===== */
.nav-drawer {
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 32px rgba(28,20,16,0.12);
  z-index: 99;
  padding: 8px 0 24px;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.3s ease;
  pointer-events: none;
}
.nav-drawer.is-open {
  clip-path: inset(0 0 0% 0);
  pointer-events: auto;
}
.nav-drawer-link {
  display: block;
  padding: 15px 0;
  font-size: 20px;
  font-family: var(--serif);
  font-weight: 500;
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  transition: color 0.15s;
}
.nav-drawer-link:hover { color: var(--accent); }
.nav-drawer-cta {
  display: flex;
  margin-top: 20px;
  width: 100%;
  justify-content: center;
  font-size: 15px;
  padding: 14px 20px;
  box-sizing: border-box;
}
.nav-drawer-sep { height: 1px; background: var(--line); margin: 8px 0; }
.nav-drawer-logout {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--line);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  color: #999;
  padding: 15px 0;
  transition: color 0.15s;
}
.nav-drawer-logout:hover { color: #c0392b; }

/* ===== АДАПТИВ ===== */
@media (max-width: 1024px) {
  .container { padding: 0 32px; }
  h1 { font-size: clamp(42px, 5vw, 66px); }
  .how-inner { grid-template-columns: 1fr; }
  .how-visual { max-width: 480px; margin: 0 auto; }
  .how-title { white-space: normal; }
}
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-desc { max-width: 100%; }
  .hero-btns { justify-content: center; }
  .hero-counter { justify-content: center; }
  .hero-visual { order: -1; max-width: 420px; margin: 0 auto; }
  .hero-quote { display: none; }
  .hero-time-badge { top: -12px; right: -12px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
}
@media (max-width: 600px) {
  .container { padding: 0 20px; }
  .hero { padding: 60px 0 60px; }
  .hero-desc { font-size: 17px; }
  .section-sub { font-size: 14px; }
  nav .nav-link { display: none; }
  .btn-header-cta { display: none; }
  .nav-burger { display: flex; }
  .logo { font-size: 18px; }
  .btn-large { padding: 14px 22px; font-size: 14px; }
  .upload-area { padding: 16px; height: 340px; border-radius: 16px; }
  .upload-area.has-preview { min-height: 340px; }
  .upload-text { font-size: 20px; }
  /* Карусель тарифов */
  .pricing .container { padding-left: 0; padding-right: 0; }
  .pricing-header { padding: 0 20px; }
  .pricing-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 10px;
    padding: 24px 12% 20px;
    max-width: none;
    margin: 0;
  }
  .pricing-grid::-webkit-scrollbar { display: none; }
  .plan-card {
    flex-shrink: 0;
    width: 76%;
    scroll-snap-align: center;
    padding: 22px 18px 18px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .plan-card:not(.is-active) { transform: scale(0.97); }
  .plan-card.is-active {
    transform: scale(1.04);
    box-shadow: 0 16px 48px -12px rgba(28,20,16,0.22);
  }
  .plan-card.popular.is-active {
    box-shadow: 0 20px 64px -16px rgba(40,20,10,0.45);
  }
  .plan-price { font-size: 34px; }
  .plan-features { margin-bottom: 14px; }
  .plan-features li { font-size: 13px; padding: 5px 0; }
  .upload-section { padding: 60px 0; }
  .upload-tips { grid-template-columns: 1fr; gap: 12px; }
  #userName { display: none; }
  .user-balance { font-size: 12px; padding: 3px 8px; }
  .btn-sm { padding: 6px 12px; font-size: 12px; }
  .preview-wrap { height: 280px; }
  .action-row { gap: 10px; width: 100%; }
  .btn-rotate { width: 48px; height: 48px; }
  .modal-content { padding: 24px 18px; max-width: 92vw; }
  .faq { padding: 60px 0; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 8px; }
  .gallery { padding: 40px 0 60px; }
  .how { padding: 60px 0; }
  .pricing { padding: 60px 0; }

  /* Hero на мобиле — вертикальный crop 4/5, компактный размер чтобы first-screen умещал и текст */
  .hero-visual { width: 100%; max-width: 240px; margin: 0 auto; }
  .hero-frame { transform: none; aspect-ratio: 4/5; height: auto; }
  .hero-time-badge { display: none; }

  /* Mobile account button: только когда залогинен (класс is-logged-in выставляет auth.js) */
  .mobile-account-btn { display: none; }
  .mobile-account-btn.is-logged-in { display: flex !important; }

  /* Section header centering */
  .gallery .container { text-align: center; }
  .how-title { text-align: center; }
  .section-label { text-align: center; }
  h2 { text-align: center; }

  /* Уплотнение вертикальных отступов — first-screen fit */
  .hero { padding: 16px 0 32px; }
  .hero-inner { gap: 20px; }
  .hero-badge-pill { margin-bottom: 8px; }
  h1 { margin-bottom: 10px; }
  .hero-desc { margin-bottom: 16px; }
  .hero-btns { margin-bottom: 20px; }
  .section-sub { margin-bottom: 32px; }
  .upload-section { padding: 48px 0; }
  .gallery { padding: 40px 0 48px; }
  .how { padding: 48px 0; }
  .how-step { padding: 12px 0; }
  .how-step-title { font-size: 18px; }
  .how-steps { gap: 0; }
  .pricing { padding: 48px 0; }
  .faq { padding: 48px 0; }
  .footer { padding: 48px 0 28px; }

  /* Хедер: убрать balance + avatar из шапки */
  .user-menu-trigger { display: none; }
  /* Dropdown от person-icon: fixed под хедером */
  .user-menu:hover .user-menu-dropdown { display: none; }
  .user-menu-dropdown {
    position: fixed;
    top: 64px;
    right: 12px;
    left: auto;
    min-width: 240px;
    padding-top: 0;
  }
  .user-menu-dropdown.is-open { display: block; }
  /* Бургер дальше от края */
  .nav-burger { margin-right: 4px; }
  /* Upload section: заголовок влево */
  .upload-section-header { text-align: left; }
}
@media (max-width: 380px) {
  .preview-wrap { height: 240px; }
  .upload-area { height: 440px; }
  .btn-rotate { width: 48px; height: 48px; }
}

/* ===== БАННЕР 9 МАЯ ===== */
.may9-banner {
  background: #1e0d00;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 60px 28px 20px;
  position: relative;
  overflow: hidden;
}
.may9-text {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 34px;
  font-style: italic;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.2;
}
.may9-star {
  font-style: normal;
  font-size: 28px;
  line-height: 1;
  color: #e32636;
  display: inline-block;
  animation: starPulse 2s ease-in-out infinite;
}
.may9-star-end {
  animation-delay: 1s;
}
@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.35); }
}
.may9-close {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.55);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.may9-close:hover { color: #fff; }

/* ===== ГЕОРГИЕВСКАЯ ЛЕНТА — фон за контентом ===== */
main {
  position: relative;
}
.ribbon-strip {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32vw;       /* достаточно, чтобы лента не обрезалась снизу */
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  line-height: 0;
}
.ribbon-strip img {
  width: 100%;
  height: auto;
  display: block;
  transform: translateY(-40%);  /* сдвиг вверх — лента в файле начинается примерно с 40% высоты */
}
main > *:not(.ribbon-strip):not(.modal-overlay):not(.lightbox) {
  position: relative;
  z-index: 1;
}
@media (max-width: 600px) {
  .may9-banner { padding: 18px 48px 18px 14px; }
  .may9-text { font-size: 18px; gap: 8px; }
  .may9-star { font-size: 16px; }
}
