@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Montserrat';
  src: url('/fonts/Montserrat-Italic-Variable.ttf') format('truetype');
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Bebas Neue';
  src: url('/fonts/BebasNeue-Regular.ttf') format('truetype');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
/* Фаза 3.6: манифестные шрифты (fonts/manifest.json — единый источник). */
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/Inter-Italic-Variable.ttf') format('truetype');
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fonts/Manrope-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: 'Golos Text';
  src: url('/fonts/GolosText-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Roboto Condensed';
  src: url('/fonts/RobotoCondensed-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: 'Oswald';
  src: url('/fonts/Oswald-Variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 200 700;
  font-display: swap;
}

:root {
  --bg-primary: #0A0A12;
  --bg-secondary: rgba(18, 18, 29, 0.75);
  --bg-tertiary: rgba(30, 30, 46, 0.9);
  --accent-color: #8A2BE2;
  --accent-gradient: linear-gradient(135deg, #7000FF 0%, #FF007A 100%);
  --accent-glow: 0 0 15px rgba(112, 0, 255, 0.5);
  /* === NEON PALETTE === */
  --neon-cyan: #00F0FF;
  --neon-magenta: #FF007A;
  --neon-purple: #B026FF;
  --neon-blue: #2D6BFF;
  --neon-line: rgba(0, 240, 255, 0.35);
  --neon-glow-cyan: 0 0 8px rgba(0, 240, 255, 0.7), 0 0 20px rgba(0, 240, 255, 0.4);
  --neon-glow-magenta: 0 0 8px rgba(255, 0, 122, 0.7), 0 0 22px rgba(255, 0, 122, 0.45);
  --neon-glow-purple: 0 0 8px rgba(176, 38, 255, 0.7), 0 0 22px rgba(176, 38, 255, 0.45);
  --neon-border: 1px solid rgba(0, 240, 255, 0.3);
  --neon-glass: rgba(10, 14, 26, 0.55);
  --text-main: #FFFFFF;
  --text-muted: #8E8EA0;
  --danger-color: #FF3B30;
  --border-radius: 14px;
  --glass-border: 1px solid rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  /* === PREMIUM DESIGN TOKENS (award-tier) === */
  --glass-strong: rgba(16, 20, 38, 0.72);
  --glass-highlight: inset 0 1px 0 0 rgba(255, 255, 255, 0.14);
  --glass-inner: inset 0 0 0 1px rgba(255, 255, 255, 0.06), inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
  --premium-radius: 20px;
  --premium-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.4);
  --premium-shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.45);
  --hairline: 1px solid rgba(255, 255, 255, 0.1);
  --hairline-cyan: 1px solid rgba(0, 240, 255, 0.28);
  --ambient-cyan: 0 0 30px rgba(0, 240, 255, 0.18);
  --ambient-magenta: 0 0 30px rgba(255, 0, 122, 0.16);
  --text-soft: #B8BCE8;
  --text-dim: #6E7299;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 240, 255, 0.12) 0%, transparent 38%),
    radial-gradient(circle at 88% 6%, rgba(255, 0, 122, 0.14) 0%, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(176, 38, 255, 0.16) 0%, transparent 45%),
    radial-gradient(circle at 50% 0%, #170F28 0%, #06060B 100%);
  color: var(--text-main);
  font-family: 'Outfit', 'Roboto', sans-serif;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}
/* Только сам body скроллится (активные экраны управляют собой) */
body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* Но экраны внутри — нет (каждый сам решает) */
#screen-editor { overflow: hidden; }

/* Reference Clone — мобильный мастер без публичных URL исходных ассетов. */
.dash-cta-bar { gap: 10px; }
.dash-cta-bar .btn-reference-clone {
  background: linear-gradient(90deg, #7c3aed, #0891b2);
  border: 1px solid rgba(103,232,249,.42);
  box-shadow: 0 8px 28px rgba(124,58,237,.28);
}
.reference-clone-screen {
  background: #020617; color: #e2e8f0; overflow-y: auto;
  flex-direction: column;
}
.reference-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: rgba(2,6,23,.9); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.reference-head button {
  width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: rgba(255,255,255,.07); color: #fff; font-size: 18px;
}
.reference-head div { display:flex; flex-direction:column; gap:2px; }
.reference-head strong { font-size: 16px; }
.reference-head span { font-size: 11px; color:#94a3b8; }
.reference-flow { display:flex; flex-direction:column; gap:12px; padding:16px 16px 36px; }
.reference-step, .reference-progress-card, .reference-quote {
  display:flex; gap:12px; padding:16px; border-radius:16px;
  background:rgba(15,23,42,.68); border:1px solid rgba(255,255,255,.09);
}
.reference-step.ready { border-color:rgba(34,211,238,.55); }
.reference-step-number {
  flex:0 0 30px; width:30px; height:30px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:rgba(6,182,212,.16); color:#67e8f9; font-weight:800;
}
.reference-step-body { flex:1; min-width:0; }
.reference-step h3 { margin:2px 0 5px; font-size:15px; }
.reference-step p, .reference-progress-card p { margin:0 0 10px; color:#94a3b8; font-size:12px; line-height:1.45; }
.reference-step button, .reference-quote button {
  width:100%; padding:11px 12px; border-radius:10px;
  border:1px solid rgba(34,211,238,.32); background:rgba(8,145,178,.16);
  color:#cffafe; font-weight:700;
}
.reference-rights { display:flex; gap:8px; margin-top:12px; font-size:11px; color:#cbd5e1; line-height:1.4; }
.reference-rights input { flex:0 0 auto; accent-color:#06b6d4; }
.reference-progress-card { flex-direction:column; gap:6px; }
.reference-progress-line { height:5px; border-radius:5px; overflow:hidden; background:#1e293b; }
.reference-progress-line span { display:block; width:0; height:100%; background:linear-gradient(90deg,#8b5cf6,#22d3ee); transition:width .35s; }
.reference-progress-card strong { font-size:14px; }
.reference-operations { display:flex; flex-direction:column; gap:5px; margin-top:4px; }
.reference-operation { display:flex; justify-content:space-between; gap:10px; color:#cbd5e1; font-size:11px; }
.reference-operation em { color:#67e8f9; font-style:normal; white-space:nowrap; }
.reference-quote { flex-direction:column; }
.reference-quote > div { display:flex; justify-content:space-between; gap:12px; font-size:13px; }
.reference-quote > div span { color:#94a3b8; }
.reference-quote > div strong { color:#67e8f9; }
.reference-quote #btnReferenceRender { background:linear-gradient(90deg,#7c3aed,#0891b2); color:#fff; }
.reference-result { width:100%; border-radius:16px; border:1px solid rgba(34,211,238,.35); }

.smart-inspector {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 220;
  height: min(72vh, 620px); display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform .25s ease;
  color: #e2e8f0; background: rgba(2,6,23,.98);
  border-top: 1px solid rgba(34,211,238,.3); border-radius: 20px 20px 0 0;
  box-shadow: 0 -18px 60px rgba(0,0,0,.65);
}
.smart-inspector.open { transform: translateY(0); }
.smart-inspector > header { display:flex; align-items:center; justify-content:space-between; padding:14px 16px 10px; }
.smart-inspector > header button { width:34px; height:34px; border:0; border-radius:9px; background:#172033; color:#fff; font-size:22px; }
.smart-inspector-actions { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; padding:0 14px 12px; }
.smart-inspector-actions button, .smart-inline-buttons button {
  min-height:34px; border:1px solid rgba(255,255,255,.1); border-radius:8px;
  color:#cbd5e1; background:#111b2e; font-size:11px;
}
.smart-inspector-scroll { overflow:auto; padding:0 14px 30px; -webkit-overflow-scrolling:touch; }
.smart-inspector section { margin-bottom:14px; padding:12px; border-radius:12px; background:rgba(15,23,42,.8); border:1px solid rgba(255,255,255,.07); }
.smart-inspector h4 { margin:0 0 9px; font-size:12px; color:#67e8f9; }
.smart-inspector input, .smart-inspector select {
  width:100%; min-height:34px; padding:6px 8px; border-radius:8px;
  border:1px solid #26344d; color:#e2e8f0; background:#08111f;
}
.smart-field-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.smart-field-grid label { display:flex; flex-direction:column; gap:4px; color:#94a3b8; font-size:10px; }
.smart-inline-buttons { display:grid; grid-template-columns:repeat(6,1fr); gap:5px; margin:10px 0 12px; }
.smart-layer-list { display:flex; flex-direction:column; gap:5px; margin-top:8px; }
.smart-layer-row { display:grid; grid-template-columns:1fr auto auto; align-items:center; gap:6px; padding:7px; border-radius:8px; background:#0b1527; border:1px solid transparent; }
.smart-layer-row.active { border-color:rgba(34,211,238,.55); background:rgba(8,145,178,.12); }
.smart-layer-row > button { min-width:30px; min-height:28px; border:0; border-radius:6px; background:#172033; color:#cbd5e1; }
.smart-layer-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#e2e8f0; font-size:11px; background:none!important; text-align:left; }
.smart-text-properties { margin-top:12px; }
@media (min-width: 760px) {
  .smart-inspector { left:auto; top:56px; width:360px; height:calc(100vh - 56px); border-radius:16px 0 0 0; border-left:1px solid rgba(34,211,238,.3); }
}

/* Ambient aurora layer — медленное «дыхание» неоновых пятен за контентом.
   Создаёт ощущение живого, премиального фона (уровень конкурсного концепта). */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 20%, rgba(0, 240, 255, 0.10) 0%, transparent 35%),
    radial-gradient(circle at 80% 30%, rgba(255, 0, 122, 0.10) 0%, transparent 35%),
    radial-gradient(circle at 50% 85%, rgba(176, 38, 255, 0.12) 0%, transparent 40%);
  filter: blur(20px);
  animation: ambient-drift 18s ease-in-out infinite alternate;
}

@keyframes ambient-drift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1); opacity: 0.8; }
  50%  { transform: translate3d(2%, 1%, 0) scale(1.05); opacity: 1; }
  100% { transform: translate3d(-1%, 2%, 0) scale(1.02); opacity: 0.85; }
}

.app-container { position: relative; z-index: 1; }

.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Glassmorphism Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background-color: var(--neon-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.22);
  box-shadow: 0 4px 24px rgba(0, 240, 255, 0.12), var(--glass-shadow);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo {
  font-weight: 800;
  font-size: 22px;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.5)) drop-shadow(0 0 14px rgba(255, 0, 122, 0.35));
  letter-spacing: 1px;
}

.badge {
  font-size: 9px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: var(--neon-cyan);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.5);
}

.live-cart {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: inset 0 0 10px rgba(0, 240, 255, 0.15), 0 0 12px rgba(0, 240, 255, 0.2);
  transition: all 0.2s ease;
}

.live-cart:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--neon-cyan);
  box-shadow: inset 0 0 12px rgba(0, 240, 255, 0.25), var(--neon-glow-cyan);
}

.stars-tag {
  color: #FFD700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* Рекламный баннер (ТЗ §3.6.4): пометка «Реклама» обязательна */
.adv-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 10px 0;
  padding: 8px 12px;
  background: rgba(255, 193, 7, 0.08);
  border: 1px solid rgba(255, 193, 7, 0.28);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.2;
}
.adv-badge {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1a1a1a;
  background: #FFC107;
  padding: 2px 6px;
  border-radius: 5px;
}
.adv-link {
  color: #FFE082;
  text-decoration: none;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adv-link:visited { color: #FFE082; }

/* Horizontal slide tabs */
/* ТЗ Шаг 1, Задача 3: Slide Tabs висят ПРЯМО НАД Tool Rail (плавающая
   панель снизу), чтобы Tool Rail их не перекрывал. z-index между viewport
   и tool-rail. */
.slide-tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(70px + env(safe-area-inset-bottom));
  z-index: 45;
  display: flex;
  overflow-x: auto;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(0, 240, 255, 0.18);
  border-bottom: 1px solid rgba(0, 240, 255, 0.18);
  padding: 8px 12px;
  gap: 8px;
  scrollbar-width: none; /* Firefox */
}

.slide-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

.slide-tab {
  background: rgba(0, 240, 255, 0.04);
  border: 1px solid rgba(0, 240, 255, 0.18);
  color: var(--text-muted);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slide-tab:hover {
  background: rgba(0, 240, 255, 0.1);
  color: #FFF;
  border-color: rgba(0, 240, 255, 0.4);
}

.slide-tab.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(255, 0, 122, 0.18));
  color: #FFF;
  border-color: var(--neon-cyan);
  box-shadow: var(--neon-glow-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

/* Viewport & Canvas styling */
.viewport {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  /* ТЗ Шаг 1, Задача 3: отступы от краёв >= 16px; снизу больше, чтобы холст
     не перекрывался плавающими Slide Tabs + Tool Rail. */
  padding: 16px 16px 132px;
}

.canvas-container-wrap {
  position: relative;
  box-shadow: var(--premium-shadow), var(--ambient-cyan);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 240, 255, 0.08), transparent 60%),
    #05060c;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}
.canvas-container-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  pointer-events: none;
  box-shadow: var(--glass-inner);
}

.bounds-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.bounds-overlay.active {
  display: block;
}

.bounds-overlay.wb::before,
.bounds-overlay.wb::after {
  content: "";
  position: absolute;
  width: 28%;
  height: 20%;
  border: 1.5px solid rgba(0, 240, 255, 0.55);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.08), rgba(255, 0, 122, 0.05));
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.3), inset 0 0 12px rgba(0, 240, 255, 0.12);
}
.bounds-overlay.wb::before { top: 0; left: 0; border-top-left-radius: 14px; }
.bounds-overlay.wb::after { bottom: 0; right: 0; border-bottom-right-radius: 14px; }

.bounds-overlay.ozon::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 12%;
  border-top: 1.5px solid rgba(0, 240, 255, 0.55);
  background: linear-gradient(0deg, rgba(0, 240, 255, 0.1), transparent);
  box-shadow: 0 -4px 14px rgba(0, 240, 255, 0.25);
}

.wb-safe-zone {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #EAFcff;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.6px;
  background: rgba(10, 16, 30, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 999px;
  text-align: center;
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
}

.bounds-overlay.active .wb-safe-zone {
  display: block;
}

.watermark-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  pointer-events: none;
  opacity: 0.15;
  transform: rotate(-15deg) scale(1.1);
  z-index: 5;
}

.watermark-grid span {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.5), rgba(255, 0, 122, 0.5));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.15));
}

/* Control Bar (Top panel) */
.control-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background-color: var(--glass-strong);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  padding: 12px 20px;
  border-bottom: var(--hairline-cyan);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.4), var(--ambient-cyan);
}

.seg-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.seg-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 800;
}

.segmented {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--glass-inner);
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 7px 16px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.seg-btn:hover {
  color: #FFF;
}

.seg-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(255, 0, 122, 0.22));
  color: #FFF;
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: var(--neon-glow-cyan);
}

/* Styled Upload Button */
.upload-product {
  flex: 1;
  min-width: 170px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.12), rgba(255, 0, 122, 0.12));
  border: 1px solid rgba(0, 240, 255, 0.35);
  color: #D6F8FF;
  margin-left: auto;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--glass-highlight), inset 0 0 14px rgba(0, 240, 255, 0.06);
}

.upload-product:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.22), rgba(255, 0, 122, 0.22));
  border-color: var(--neon-cyan);
  color: #FFF;
  transform: translateY(-1px);
  box-shadow: var(--glass-highlight), var(--neon-glow-cyan);
}

.upload-product:active {
  transform: translateY(1px);
}

/* Toolbar (Bottom controls) */
.toolbar {
  background: var(--neon-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-top: 1px solid rgba(0, 240, 255, 0.22);
  box-shadow: 0 -8px 32px 0 rgba(0, 240, 255, 0.1);
}

/* Custom Toggle Switch */
.toggle-bounds {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: color 0.2s ease;
}

.toggle-bounds:hover {
  color: #FFF;
}

.toggle-bounds input[type="checkbox"] {
  display: none;
}

.toggle-bounds::before {
  content: "";
  display: inline-block;
  width: 40px;
  height: 22px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  transition: background 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.6);
}

.toggle-bounds::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFF, #CFE9FF);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5), 0 0 8px rgba(0, 240, 255, 0.3);
}

.toggle-bounds:has(input[type="checkbox"]:checked)::before {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  border-color: rgba(0, 240, 255, 0.6);
  box-shadow: var(--neon-glow-cyan);
}

.toggle-bounds:has(input[type="checkbox"]:checked)::after {
  transform: translateX(18px);
  background: #FFF;
}

/* Tool Buttons grid */
.tool-buttons {
  display: flex;
  gap: 8px;
}

.btn-tool {
  flex: 1;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.22);
  color: #CFF8FF;
  padding: 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.3);
}

.btn-tool:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  color: #FFF;
  transform: translateY(-1px);
  box-shadow: var(--neon-glow-cyan);
}

.btn-tool:active {
  transform: translateY(1px);
}

.btn-draft {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--neon-cyan);
}

.btn-draft:hover {
  background: rgba(0, 240, 255, 0.16);
  border-color: rgba(255, 149, 0, 0.7);
  color: #FFE082;
  box-shadow: 0 0 10px rgba(255, 149, 0, 0.15);
}

/* Layer 3 triggers */
.layer3-row {
  display: flex;
  gap: 8px;
}

.layer3-trigger {
  background: linear-gradient(135deg, rgba(176, 38, 255, 0.14), rgba(0, 240, 255, 0.08));
  border-color: rgba(176, 38, 255, 0.4);
  color: #E3CFFB;
}

.layer3-trigger:hover {
  background: linear-gradient(135deg, rgba(176, 38, 255, 0.24), rgba(0, 240, 255, 0.14));
  border-color: rgba(176, 38, 255, 0.7);
  color: #FFF;
  box-shadow: 0 0 16px rgba(176, 38, 255, 0.4);
}

/* Context panel (Layer 2) */
.context-panel {
  background: linear-gradient(180deg, rgba(18, 22, 40, 0.86), rgba(10, 12, 24, 0.9));
  border: 1px solid rgba(0, 240, 255, 0.3);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--premium-shadow-sm), var(--ambient-cyan);
}

.context-panel .ctx-title {
  font-size: 12px;
  font-weight: 700;
  color: #E3CFFB;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: var(--hairline-cyan);
  padding-bottom: 8px;
  margin-bottom: 2px;
  letter-spacing: 0.4px;
}
.ctx-delete-btn {
  background: rgba(255,0,122,0.12);
  border: 1px solid rgba(255,0,122,0.3);
  color: var(--neon-accent-magenta);
  width: 32px; height: 32px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.ctx-delete-btn:active { background: rgba(255,0,122,0.25); transform: scale(0.93); }

.context-panel .ctx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-soft);
}

.context-panel .ctx-row label {
  min-width: 64px;
}

.context-panel input[type="range"] {
  flex: 1;
  accent-color: var(--neon-cyan);
  background: rgba(255, 255, 255, 0.12);
  height: 4px;
  border-radius: 2px;
  outline: none;
  box-shadow: inset 0 0 4px rgba(0, 240, 255, 0.2);
}

.context-panel input[type="color"] {
  width: 34px;
  height: 28px;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  background: none;
  cursor: pointer;
  box-shadow: var(--glass-highlight);
}

.context-panel .ctx-value {
  min-width: 38px;
  text-align: right;
  color: #FFF;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(0, 240, 255, 0.3);
}

/* Action Footer (Big Render Button) */
.action-footer {
  padding: 14px 20px;
  background: var(--neon-glass);
  border-top: 1px solid rgba(0, 240, 255, 0.22);
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-magenta) 100%);
  border: 1px solid rgba(0, 240, 255, 0.5);
  color: #FFF;
  padding: 15px;
  border-radius: var(--border-radius);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.45), 0 0 28px rgba(255, 0, 122, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.btn-submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.7), 0 0 40px rgba(255, 0, 122, 0.55);
  filter: brightness(1.1);
}

.btn-submit:active:not(:disabled) {
  transform: translateY(1px);
}

/* Drawers / Shutters */
.drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(18, 22, 40, 0.92), rgba(10, 12, 24, 0.96));
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  border-top: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 26px 26px 0 0;
  transform: translateY(110%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  max-height: 62vh;
  overflow-y: auto;
  box-shadow: 0 -16px 60px rgba(0, 0, 0, 0.6), 0 -2px 30px rgba(0, 240, 255, 0.2);
}

.drawer.open {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: var(--hairline-cyan);
  color: #E3CFFB;
  letter-spacing: 0.3px;
}

.drawer-close {
  background: rgba(255, 255, 255, 0.06);
  border: var(--hairline);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
}

.drawer-close:hover {
  background: rgba(255, 0, 122, 0.15);
  border-color: rgba(255, 0, 122, 0.5);
  color: #FFF;
  box-shadow: 0 0 12px rgba(255, 0, 122, 0.35);
}

.drawer-body {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  padding: 20px;
}

.drawer-item {
  background: rgba(255, 255, 255, 0.04);
  border: var(--hairline);
  color: #E2E2E9;
  padding: 16px 10px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  box-shadow: var(--glass-highlight);
}

.drawer-item:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.14), rgba(255, 0, 122, 0.1));
  border-color: rgba(0, 240, 255, 0.45);
  color: #FFF;
  transform: translateY(-3px);
  box-shadow: var(--neon-glow-cyan);
}

.drawer-item:active {
  transform: translateY(1px);
}

/* Compliance Gate */
.compliance-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 6, 11, 0.95);
  backdrop-filter: blur(8px);
  padding: 20px;
}

.compliance-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(138, 43, 226, 0.35);
  border-radius: 20px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
}

.compliance-title {
  font-size: 20px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  align-self: center;
  text-align: center;
  letter-spacing: 0.5px;
}

.compliance-text {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}

.compliance-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.2s ease;
}

.compliance-check:hover {
  color: #FFF;
}

.compliance-check input {
  margin-top: 3px;
  accent-color: #FF007A;
  flex-shrink: 0;
}

.compliance-check a {
  color: #D6A8FF;
  text-decoration: none;
  border-bottom: 1px dashed rgba(214, 168, 255, 0.4);
  transition: all 0.2s ease;
}

.compliance-check a:hover {
  color: #FFF;
  border-bottom-color: #FFF;
}

.btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(30, 30, 46, 0.6);
  border-color: rgba(0, 240, 255, 0.15);
  color: #6a7a88;
  box-shadow: none;
  text-shadow: none;
  transform: none !important;
  filter: none !important;
}

/* =====================================================================
   ONBOARDING WIZARD (регламент §2/§3)
   ===================================================================== */
.onboarding-wizard {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  /* Используем dvh, чтобы оверлей корректно учитывал сворачиваемую
     адресную строку браузера/Telegram и не обрезал контент снизу.
     vh — запасной вариант для старых браузеров. */
  height: 100vh;
  height: 100dvh;
  z-index: 99999;
  background-color: #0d0f12;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* ВАЖНО: не центрируем через justify-content:center — при переполнении
     на маленьких экранах верх карточки уходит за край и НЕ прокручивается
     (заголовок «Выберите режим генерации» обрезается сверху). Центровку
     даём через margin:auto на .wizard-card (см. ниже): когда контент
     помещается — он по центру, когда не помещается — сверху остаётся
     доступ к началу скролла. */
  justify-content: flex-start;
  gap: 18px;
  /* Отступы с учётом «чёлки»/жестов (safe-area) и базовый запас. */
  padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ГЛАВНОЕ ПРАВИЛО: пока мастер открыт, редактор холста физически скрыт
   (display:none) и не рендерится — страница не раздувается вниз, а мастер
   аппаратно занимает ровно 100% экрана Mini App. Редактор появляется только
   после finishWizard() (успешный Шаг 4). */
.app-container.wizard-open .app-header,
.app-container.wizard-open .slide-tabs,
.app-container.wizard-open .viewport,
.app-container.wizard-open .toolbar,
.app-container.wizard-open .action-footer,
.app-container.wizard-open .drawer {
  display: none !important;
}

.wizard-progress {
  display: flex;
  gap: 10px;
  /* Вертикальный auto-margin вместе с .wizard-step центрирует всю группу
     (прогресс + карточка) по вертикали, КОГДА контент помещается в экран.
     При переполнении (короткий телефон) auto-margin схлопывается и группа
     прижимается к началу скролла — верх (заголовок) остаётся видимым. */
  margin: auto 0;
}
.wizard-progress .wstep {
  width: 34px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.15);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}
.wizard-progress .wstep.active {
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
  box-shadow: var(--neon-glow-cyan);
  border-color: var(--neon-cyan);
}

.wizard-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  /* См. пояснение у .wizard-progress: совместно дают центровку при
     наличии места и доступ к началу скролла при переполнении. */
  margin: auto 0;
}

.wizard-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-tertiary);
  border: 1px solid rgba(138, 43, 226, 0.35);
  border-radius: 22px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.7);
}
.wizard-card-wide {
  max-width: 460px;
}

.wizard-title {
  font-size: 21px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
  letter-spacing: 0.5px;
  filter: drop-shadow(0 0 14px rgba(0, 240, 255, 0.35));
}
.wizard-text {
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.6;
}

.wizard-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-main);
  cursor: pointer;
  line-height: 1.4;
  transition: color 0.2s ease;
}
.wizard-check:hover { color: #FFF; }
.wizard-check input { margin-top: 3px; accent-color: #FF007A; flex-shrink: 0; }
.wizard-check a {
  color: #D6A8FF;
  text-decoration: none;
  border-bottom: 1px dashed rgba(214, 168, 255, 0.4);
}
.wizard-check a:hover { color: #FFF; border-bottom-color: #FFF; }

/* Неоновые карточки-кнопки (шаги 2 и 3) */
.wizard-cards {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.neon-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 22px 18px;
  border-radius: 18px;
  background: rgba(12, 14, 28, 0.85);
  border: 1.5px solid rgba(0, 240, 255, 0.3);
  color: #FFF;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: inset 0 0 18px rgba(0, 240, 255, 0.08);
}
.neon-card:hover {
  transform: translateY(-2px);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.5), 0 0 40px rgba(255, 0, 122, 0.3);
}
.neon-card:active { transform: translateY(0); }
.neon-card-ico { font-size: 34px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.neon-card-ico svg { display: block; filter: drop-shadow(0 2px 8px rgba(255, 59, 48, 0.35)); }
.neon-card-title { font-size: 17px; font-weight: 800; }
.neon-card-sub { font-size: 12px; color: var(--text-muted); }

/* Шаг 2: акцентный бейдж «БЕСПЛАТНО» на карточке одиночного рендера */
.free-badge {
  display: inline-block;
  align-self: center;
  margin-bottom: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF3B30, #FF6B5E);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.2px;
  box-shadow: 0 0 16px rgba(255, 59, 48, 0.55);
  animation: freeBadgePulse 1.8s ease-in-out infinite;
}
@keyframes freeBadgePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 16px rgba(255, 59, 48, 0.45); }
  50%      { transform: scale(1.04); box-shadow: 0 0 26px rgba(255, 59, 48, 0.75); }
}
/* Описание под карточкой выбора режима */
.mode-desc {
  display: block;
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted, #b9b9c9);
  white-space: pre-line;
  text-align: left;
}

/* Шаг 4: зона-мишень загрузки */
.upload-target {
  position: relative;
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  border-radius: 24px;
  border: 2px dashed rgba(112, 0, 255, 0.5);
  background: radial-gradient(circle at 50% 40%, rgba(112, 0, 255, 0.12), rgba(10, 10, 18, 0.6));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease;
}
.upload-target:hover {
  border-color: #FF007A;
  box-shadow: 0 0 26px rgba(112, 0, 255, 0.4);
  transform: translateY(-2px);
}
.upload-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 3px solid rgba(0, 240, 255, 0.18);
  border-top-color: var(--neon-cyan);
  border-right-color: rgba(255, 0, 122, 0.6);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.35), inset 0 0 12px rgba(255, 0, 122, 0.2);
  animation: wiz-spin 1.1s linear infinite;
}
@keyframes wiz-spin { to { transform: rotate(360deg); } }
.upload-label { font-size: 14px; font-weight: 700; text-align: center; padding: 0 16px; }
.upload-hint { font-size: 11px; color: var(--text-muted); }

/* Прогресс-бар ожидания ИИ-сегментации */
.wizard-loading {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(6, 6, 11, 0.92);
  backdrop-filter: blur(6px);
  padding: 24px;
}
.loading-title { font-size: 16px; font-weight: 700; color: #FFF; }
.loading-sub { font-size: 12px; color: var(--text-muted); }
.neon-progress {
  width: min(320px, 80vw);
  height: 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.neon-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.7);
  transition: width 0.18s linear;
}

/* Кнопка «Назад» на шагах мастера (возможность передумать) */
.wizard-back {
  margin-top: 6px;
  padding: 11px 22px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: rgba(0, 240, 255, 0.06);
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.wizard-back:hover {
  color: #FFF;
  border-color: rgba(0, 240, 255, 0.5);
  background: rgba(0, 240, 255, 0.12);
  box-shadow: var(--neon-glow-cyan);
}
.wizard-back:active { transform: translateY(1px); }

/* ===== Geo-DOM фильтрация (ТЗ Доп.№1 ч.1) =====
   По умолчанию (до применения класса гео) показываем всё, чтобы не сломать
   demo-режим без is_world_geo. Классы geo-cis / geo-world навешиваются в JS. */
/* Бурж (geo-world): прячем WB/Ozon, международные всегда видны. */
.onboarding-wizard.geo-world .geo-cis-only { display: none !important; }
.onboarding-wizard.geo-world #wizIntlCards { display: flex !important; }
/* СНГ (geo-cis): международные скрыты (#wizIntlCards управляется JS как none/flex).
   CIS-карточки видны по умолчанию. */

/* ===== Table Editor Modal (ТЗ: мастер смарт-таблиц) ===== */
.table-modal {
  position: fixed; inset: 0; z-index: 99998;
  display: flex; align-items: center; justify-content: center;
  background: rgba(6, 8, 16, 0.82); padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.table-modal-card {
  width: 100%; max-width: 420px; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, rgba(20, 24, 44, 0.94), rgba(12, 14, 28, 0.96));
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 22px; padding: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 40px rgba(0, 240, 255, 0.12);
  box-shadow: var(--premium-shadow), var(--ambient-cyan);
}
.table-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Outfit', sans-serif; font-weight: 800; font-size: 18px;
  color: #FFF; margin-bottom: 14px;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}
.table-modal-head .drawer-close {
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFF; font-size: 18px; cursor: pointer; width: 30px; height: 30px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
}
.table-modal-head .drawer-close:hover {
  background: rgba(255, 0, 122, 0.15); border-color: rgba(255, 0, 122, 0.5);
  box-shadow: 0 0 12px rgba(255, 0, 122, 0.35);
}
.table-preset-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
  font-family: 'Roboto', sans-serif; font-size: 14px; color: #c9c9d6;
}
.preset-btn {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,0.06); color: #FFF; border: 1px solid rgba(255,255,255,0.12);
  font-family: 'Outfit', sans-serif; font-weight: 600;
  transition: all 0.2s ease;
}
.preset-btn.active {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-purple));
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: var(--neon-glow-cyan);
}
.table-style-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
  font-family: 'Roboto', sans-serif; font-size: 14px; color: #c9c9d6;
}
.style-btn {
  flex: 0 0 auto; padding: 8px 14px; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,0.06); color: #FFF; border: 1px solid rgba(255,255,255,0.12);
  font-family: 'Outfit', sans-serif; font-weight: 600;
  transition: all 0.2s ease;
}
.style-btn.active {
  background: linear-gradient(135deg, var(--neon-cyan), var(--neon-magenta));
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: var(--neon-glow-cyan);
}
.table-grid {
  display: grid; gap: 6px; margin-bottom: 14px;
}
.table-cell {
  width: 100%; box-sizing: border-box; padding: 9px 10px; border-radius: 9px;
  background: rgba(255,255,255,0.05); color: #FFF; border: 1px solid rgba(255,255,255,0.1);
  font-family: 'Roboto', sans-serif; font-size: 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.table-cell:focus {
  outline: none;
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: var(--neon-glow-cyan);
}
.table-cell-head {
  background: rgba(0, 240, 255, 0.12); font-weight: 700;
}
.table-modal-foot { display: flex; justify-content: flex-end; }

/* ===== Buy Actions Bottom Sheet (Доп.№2 ч.4) ===== */
.buy-sheet {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(6, 8, 16, 0.7); padding: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.buy-sheet-card {
  width: 100%; max-width: 520px;
  background: linear-gradient(180deg, rgba(20, 24, 44, 0.95), rgba(12, 14, 28, 0.97));
  border-radius: 24px 24px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 -16px 60px rgba(0, 0, 0, 0.65), 0 -2px 30px rgba(0, 240, 255, 0.2);
  animation: sheet-up 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.buy-sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: 'Outfit', sans-serif; font-size: 19px; font-weight: 800; color: #FFF;
  margin-bottom: 4px;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}
.buy-sheet-sub { font-family: 'Roboto', sans-serif; font-size: 13px; color: #c9c9d6; margin: 0 0 14px; }
.buy-pack-list { display: flex; flex-direction: column; gap: 10px; }
.buy-pack {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-radius: 16px; cursor: pointer;
  border: 1px solid rgba(0, 240, 255, 0.22);
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.1), rgba(255, 0, 122, 0.08));
  color: #FFF; font-family: 'Outfit', sans-serif; font-weight: 700; font-size: 16px;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--glass-highlight);
}
.buy-pack:hover {
  border-color: rgba(0, 240, 255, 0.55);
  box-shadow: var(--neon-glow-cyan);
  transform: translateY(-2px);
}
.buy-pack:active { transform: scale(0.98); border-color: var(--neon-cyan); }
.buy-pack-stars { color: #FFD23F; font-weight: 800; }

/* ===== Мобильная адаптация мастера (ТЗ: видимость заголовка на телефонах) =====
   На узких/коротких экранах контент шага 2 (заголовок + 2 карточки с
   описаниями) может не помещаться. Правила ниже компактнее сжимают
   отступы и шрифты, чтобы заголовок «Выберите режим генерации» всегда
   оставался видимым сверху и прокручиваемым. */
@media (max-width: 480px) {
  .onboarding-wizard {
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    gap: 12px;
  }
  .wizard-progress { flex-shrink: 0; }
  .wizard-title {
    font-size: 18px;
    line-height: 1.2;
    letter-spacing: 0.2px;
  }
  .wizard-card { padding: 20px 18px; gap: 14px; border-radius: 18px; }
  .wizard-card-wide { max-width: 100%; }
  .neon-card { padding: 16px 14px; }
  .neon-card-title { font-size: 16px; }
  .mode-desc { font-size: 12px; margin-top: 8px; }
  .wizard-back { padding: 10px 18px; font-size: 13px; }
}

/* Очень короткие экраны (ландшафт / маленькие телефоны в альбомной
   ориентации): ещё сильнее ужимаем, чтобы ничего не резалось. */
@media (max-height: 560px) {
  .onboarding-wizard { gap: 8px; }
  .wizard-card { padding: 16px 16px; gap: 10px; }
  .wizard-title { font-size: 16px; }
  .neon-card { padding: 12px 12px; gap: 2px; }
  .neon-card-ico { font-size: 26px; }
  .neon-card-ico svg { width: 48px; height: 48px; }
  .mode-desc { font-size: 11px; margin-top: 6px; line-height: 1.35; }
  .free-badge { font-size: 11px; padding: 4px 10px; margin-bottom: 4px; }
}

/* =====================================================================
   ONBOARDING WELCOME HERO (ТЗ Доп.: #onboarding-welcome-hero)
   Приветственная верхняя зона Шага 1: премиальный «веер» слайдов в
   изометрии + продающие b2b-заголовки + бегущий тикер.
   Примечание: оригинальный ТЗ ссылался на assets/previews/*.png, которых
   в проекте нет — поэтому фоны карточек заменены на CSS-градиенты с
   номерами слайдов (самодостаточно, без внешних ресурсов). Шрифты
   Montserrat / Bebas Neue заменены на уже подключённые Outfit / Roboto.
   ===================================================================== */
#onboarding-welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 460px;
  padding: 8px 16px 0 16px;
  box-sizing: border-box;
  background: radial-gradient(circle at top, rgba(255, 0, 127, 0.08) 0%, transparent 60%);
}

/* Технологичный Badge */
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 100px;
  color: #a0a5b5;
  font-size: 11px;
  font-family: 'Outfit', sans-serif;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background: #ff007f;
  border-radius: 50%;
  box-shadow: 0 0 10px #ff007f;
  animation: hero-pulse 2s infinite;
}

/* Вьюпорт для трехмерного веера */
.funnel-spread-viewport {
  position: relative;
  width: 100%;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px; /* Эффект глубины для изометрии */
  margin-bottom: 20px;
}

/* Базовый класс для карт воронки */
.funnel-card {
  position: absolute;
  width: 96px;
  height: 128px;
  border-radius: 12px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  overflow: hidden;
}

/* Номер слайда на карточке (заглушка вместо отсутствующих PNG-превью) */
.fc-num {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 26px;
  color: #CFF8FF;
  padding: 8px 10px;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.7), 0 2px 6px rgba(0, 0, 0, 0.6);
}
.fc-num-main { font-size: 40px; align-self: center; justify-self: center; }

/* Матрица трансформации веера (Каскад).
   Фоны — градиенты (базовый + акцентный), т.к. assets/previews отсутствуют. */
.slide-bg-left-2 {
  transform: translateX(-104px) translateZ(-60px) rotateY(25deg) scale(0.85);
  background-image: linear-gradient(160deg, #0a2a3a 0%, #1a3a5a 100%);
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(0, 240, 255, 0.18);
  opacity: 0.45;
}
.slide-bg-left-1 {
  transform: translateX(-56px) translateZ(-30px) rotateY(15deg) scale(0.92);
  background-image: linear-gradient(160deg, #2a1a4a 0%, #4a2a6a 100%);
  border: 1px solid rgba(176, 38, 255, 0.3);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(176, 38, 255, 0.2);
  opacity: 0.72;
}
.slide-bg-right-1 {
  transform: translateX(56px) translateZ(-30px) rotateY(-15deg) scale(0.92);
  background-image: linear-gradient(160deg, #4a2a6a 0%, #6a2a4a 100%);
  border: 1px solid rgba(176, 38, 255, 0.3);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 16px rgba(255, 0, 122, 0.2);
  opacity: 0.72;
}
.slide-bg-right-2 {
  transform: translateX(104px) translateZ(-60px) rotateY(-25deg) scale(0.85);
  background-image: linear-gradient(160deg, #3a1a2a 0%, #5a2a3a 100%);
  border: 1px solid rgba(255, 0, 122, 0.25);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.5), 0 0 14px rgba(255, 0, 122, 0.18);
  opacity: 0.45;
}

/* Главная CTR-обложка по центру (В фокусе) */
.slide-main-focus {
  z-index: 10;
  transform: translateX(0) translateZ(20px) rotateY(0) scale(1.05);
  background-image: linear-gradient(160deg, var(--neon-cyan) 0%, var(--neon-magenta) 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.55), 0 0 48px rgba(255, 0, 122, 0.4);
  animation: hero-floating 4s ease-in-out infinite; /* Плавное покачивание */
  align-items: center;
  justify-content: center;
}

/* Шильдик на главной карточке */
.main-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #00F0FF, #FF007A);
  color: #fff;
  font-size: 8px;
  font-weight: bold;
  padding: 3px 6px;
  border-radius: 6px;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

/* Мягкое свечение главной карточки */
.main-card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

/* Текстовые блоки */
.hero-title {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  text-align: center;
  color: #ffffff;
  margin: 0 0 8px 0;
  padding: 0 16px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-magenta) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.45));
  background-clip: text;
}

.hero-subtitle {
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  color: #797c8b;
  margin: 0 0 16px 0;
  padding: 0 24px;
}

/* Бегущая строка (Маркетинговый тикер) */
.hero-ticker-wrap {
  width: 100%;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  padding: 6px 0;
}

.hero-ticker {
  display: flex;
  white-space: nowrap;
  animation: hero-ticker 15s linear infinite;
}

.hero-ticker span {
  font-size: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--neon-cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  margin-right: 32px;
}

/* Анимации */
@keyframes hero-floating {
  0% { transform: translateY(0px) translateZ(20px); }
  50% { transform: translateY(-6px) translateZ(20px); }
  100% { transform: translateY(0px) translateZ(20px); }
}

@keyframes hero-pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 0, 127, 0.7); }
  70% { box-shadow: 0 0 0 6px rgba(255, 0, 127, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 0, 127, 0); }
}

@keyframes hero-ticker {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

/* На коротких экранах чуть ужимаем hero, чтобы карточка compliance
   оставалась видимой без лишнего скролла. */
@media (max-height: 720px) {
  .hero-badge { margin-bottom: 12px; font-size: 10px; }
  .funnel-spread-viewport { height: 120px; margin-bottom: 14px; }
  .funnel-card { width: 78px; height: 104px; }
  .fc-num { font-size: 20px; }
  .fc-num-main { font-size: 32px; }
  .hero-title { font-size: 17px; }
}
@media (max-height: 560px) {
  #onboarding-welcome-hero { padding-top: 0; }
  .funnel-spread-viewport { height: 96px; }
  .funnel-card { width: 64px; height: 86px; }
  .hero-subtitle { margin-bottom: 10px; }
}

/* =====================================================================
   ЧАСТЬ 1.1 / 1.2: PHOTOSHOP-STYLE UI REFACTOR
   Top Bar + Render Bar + Tool Rail + Bottom Sheets + Menu Overlay
   ===================================================================== */

/* --- Top Bar --- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background-color: var(--neon-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.22);
  box-shadow: 0 4px 24px rgba(0, 240, 255, 0.12), var(--glass-shadow);
  z-index: 10;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.22);
  color: #CFF8FF;
  border-radius: 10px;
  font-size: 18px; font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.topbar-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  color: #FFF;
  box-shadow: var(--neon-glow-cyan);
}
.topbar-btn:active { transform: translateY(1px); }

/* Кнопка «Заменить товар» (🗑) — визуально выделяем как опасное действие. */
.topbar-btn-danger {
  background: rgba(255, 59, 48, 0.08);
  border-color: rgba(255, 59, 48, 0.35);
  color: #FF8A82;
}
.topbar-btn-danger:hover {
  background: rgba(255, 59, 48, 0.16);
  border-color: #FF3B30;
  color: #FFF;
  box-shadow: 0 0 12px rgba(255, 59, 48, 0.45);
}

/* Баланс (live cart) компактнее в Top Bar */
.live-cart {
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
}

/* --- Render Bar (финальная кнопка под Top Bar) --- */
.render-bar {
  padding: 8px 14px;
  background: var(--neon-glass);
  border-bottom: 1px solid rgba(0, 240, 255, 0.12);
}
.render-bar .btn-submit {
  padding: 11px;
  font-size: 14px;
}
.btn-adapt {
  padding: 6px 12px;
  margin-top: 6px;
  width: 100%;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--neon-accent-cyan), var(--neon-accent-magenta));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

/* --- Tool Rail (нижняя панель иконок 40x40) --- */
.tool-rail {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 40;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--neon-glass);
  backdrop-filter: blur(20px) saturate(150%);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 16px;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 240, 255, 0.15);
}
.rail-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E2E9;
  border-radius: 10px;
  font-size: 16px; font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.rail-btn:hover, .rail-btn.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18), rgba(255, 0, 122, 0.14));
  border-color: rgba(0, 240, 255, 0.5);
  color: #FFF;
  box-shadow: var(--neon-glow-cyan);
  transform: translateY(-2px);
}

/* --- Bottom Sheet (выезжающая шторка, 45% высоты) --- */
.bottom-sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  height: 45vh;
  background: linear-gradient(180deg, rgba(18, 22, 40, 0.94), rgba(10, 12, 24, 0.97));
  backdrop-filter: blur(28px) saturate(150%);
  -webkit-backdrop-filter: blur(28px) saturate(150%);
  border-top: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 26px 26px 0 0;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 60;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -16px 60px rgba(0, 0, 0, 0.6), 0 -2px 30px rgba(0, 240, 255, 0.2);
}
.bottom-sheet.open { transform: translateY(0); }

.sheet-grabber {
  width: 40px; height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  margin: 8px auto 4px;
  flex-shrink: 0;
}
.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 20px 12px;
  font-weight: 700;
  font-size: 15px;
  border-bottom: var(--hairline-cyan);
  color: #E3CFFB;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}
.sheet-close {
  background: rgba(255, 255, 255, 0.06);
  border: var(--hairline);
  color: var(--text-muted);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer;
  transition: all 0.25s ease;
}
.sheet-close:hover {
  background: rgba(255, 0, 122, 0.15);
  border-color: rgba(255, 0, 122, 0.5);
  color: #FFF;
  box-shadow: 0 0 12px rgba(255, 0, 122, 0.35);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-item {
  background: rgba(255, 255, 255, 0.04);
  border: var(--hairline);
  color: #E2E2E9;
  padding: 14px 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}
.sheet-item:hover {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.14), rgba(255, 0, 122, 0.1));
  border-color: rgba(0, 240, 255, 0.45);
  color: #FFF;
  box-shadow: var(--neon-glow-cyan);
}
.sheet-subtitle {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 800;
  margin-top: 6px;
}
.sheet-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-soft);
}
.sheet-row input[type="range"] {
  flex: 1; accent-color: var(--neon-cyan);
  background: rgba(255, 255, 255, 0.12); height: 4px;
  border-radius: 2px; outline: none;
}

/* Градиентные пресеты текста */
.gradient-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.grad-preset {
  width: 52px; height: 38px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  font-size: 0;
  transition: all 0.2s ease;
}
.grad-preset.active {
  border-color: var(--neon-cyan);
  box-shadow: var(--neon-glow-cyan);
  transform: scale(1.05);
}

/* Менеджер слоёв */
.layer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.layer-btn {
  background: rgba(0, 240, 255, 0.05);
  border: 1px solid rgba(0, 240, 255, 0.22);
  color: #CFF8FF;
  padding: 10px;
  border-radius: 10px;
  font-size: 12px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.layer-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--neon-cyan);
  color: #FFF;
}
.layer-list { display: flex; flex-direction: column; gap: 6px; }
.layer-item {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px; color: #E2E2E9;
  cursor: pointer;
  transition: all 0.2s ease;
}
.layer-item.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 240, 255, 0.1);
  color: #FFF;
}
.layer-del {
  margin-left: auto;
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color .15s;
}
.layer-del:hover, .layer-del:active { color: var(--neon-accent-magenta); }

/* Menu Overlay (бургер) */
.menu-overlay {
  position: fixed; inset: 0;
  z-index: 200;
  background: rgba(6, 8, 16, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 60px 14px;
}
.menu-card {
  width: 100%; max-width: 280px;
  background: linear-gradient(180deg, rgba(20, 24, 44, 0.96), rgba(12, 14, 28, 0.98));
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--premium-shadow), var(--ambient-cyan);
}
.menu-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; font-size: 17px; color: #FFF;
  margin-bottom: 14px;
}
.menu-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text-soft);
  padding: 10px 0; cursor: pointer;
}
.menu-row input[type="checkbox"] { accent-color: var(--neon-cyan); width: 18px; height: 18px; }
.menu-row-btn {
  width: 100%;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #CFF8FF;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  text-align: left;
  transition: all 0.2s ease;
}
.menu-row-btn:hover {
  background: rgba(0, 240, 255, 0.14);
  border-color: var(--neon-cyan);
  color: #FFF;
  box-shadow: var(--neon-glow-cyan);
}

/* Context panel теперь тоже выезжает как мини-шторка */
.context-panel {
  position: fixed;
  left: 0; right: 0;
  bottom: 64px;
  z-index: 35;
  margin: 0 12px;
  background: linear-gradient(180deg, rgba(18, 22, 40, 0.92), rgba(10, 12, 24, 0.94));
  border: 1px solid rgba(0, 240, 255, 0.3);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--premium-shadow-sm), var(--ambient-cyan);
}

/* Прячем старые toolbar / action-footer / drawer (заменены новыми) */
.toolbar, .action-footer, .drawer { display: none !important; }

/* App container: убираем flex-колонку для холста (он теперь 100%) */
.app-container {
  display: block;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Viewport занимает почти весь экран (Top Bar + Render Bar сверху) */
.viewport {
  position: absolute;
  top: 110px;
  /* ТЗ Шаг 1, Задача 3: нижний край поднят, чтобы холст не перекрывался
     плавающими Slide Tabs (fixed bottom ~70px) + Tool Rail. */
  bottom: 126px;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  padding: 16px;
}

/* === ТЗ Шаг 1, Задача 1: оверлей генерации (WebApp НЕ закрывается) === */
.generating-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;            /* JS переключает на flex */
  align-items: center;
  justify-content: center;
  background: rgba(5, 6, 12, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.generating-card {
  max-width: 80%;
  padding: 28px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(18, 22, 40, 0.96), rgba(10, 12, 24, 0.98));
  border: 1px solid rgba(0, 240, 255, 0.35);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.6), 0 0 24px rgba(0, 240, 255, 0.2);
  text-align: center;
}
.generating-spinner {
  width: 42px; height: 42px;
  margin: 0 auto 16px;
  border: 4px solid rgba(0, 240, 255, 0.25);
  border-top-color: var(--neon-cyan, #00F0FF);
  border-radius: 50%;
  animation: shotai-spin 0.9s linear infinite;
}
@keyframes shotai-spin { to { transform: rotate(360deg); } }
.generating-text {
  color: #E2E2E9;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

/* ===================================================================
   BACKGROUND CAROUSEL (шторка фонов)
   =================================================================== */
.bg-carousel {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #444 transparent;
  padding: 4px 0 8px;
}
.bg-carousel::-webkit-scrollbar { height: 4px; }
.bg-carousel::-webkit-scrollbar-thumb { background: #555; border-radius: 4px; }

.bg-carousel-track {
  display: flex;
  gap: 10px;
  padding: 0 16px;
}

.bg-thumb {
  flex: 0 0 90px;
  width: 90px;
  height: 120px;
  border-radius: 8px;
  border: 2px solid #333;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: border-color .2s, transform .15s;
  background: #1a1a2e;
}
.bg-thumb:hover, .bg-thumb:active {
  transform: scale(1.04);
}
.bg-thumb.active {
  border-color: #6C3CF0;
  box-shadow: 0 0 12px rgba(108,60,240,0.5);
}

.bg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bg-thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 4px 6px;
  background: rgba(0,0,0,0.7);
  font-size: 10px;
  color: #ccc;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-thumb-ai {
  flex: 0 0 90px;
  width: 90px;
  height: 120px;
  border-radius: 8px;
  border: 2px dashed #6C3CF0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1040, #0d1030);
  transition: border-color .2s, transform .15s;
}
.bg-thumb-ai:hover, .bg-thumb-ai:active { transform: scale(1.04); }
.bg-thumb-ai .ai-icon { font-size: 28px; opacity: 0.8; }

.sheet-hint {
  color: #888;
  font-size: 12px;
  text-align: center;
  margin: 8px 0 0;
  padding: 8px 16px;
  background: #1a1a2e;
  border-radius: 6px;
}

/* ===================================================================
   РЕКЛАМНЫЕ ПЛАШКИ (Glassmorphism) — Smart Studio Pixel
   =================================================================== */
.ad-plate {
  margin: 12px 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(30, 30, 46, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(108, 60, 240, 0.4);
  box-shadow: 0 0 20px rgba(108, 60, 240, 0.15), inset 0 1px 0 rgba(255,255,255,0.05);
  text-align: center;
  transition: border-color .25s, box-shadow .25s;
}
.ad-plate:hover {
  border-color: rgba(108, 60, 240, 0.7);
  box-shadow: 0 0 28px rgba(108, 60, 240, 0.25), inset 0 1px 0 rgba(255,255,255,0.08);
}
.ad-plate-text {
  color: #c8c8d8;
  font-size: 13px;
  line-height: 1.45;
  margin: 0 0 8px 0;
}
.ad-plate-btn {
  display: inline-block;
  padding: 8px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #6C3CF0, #9B5CF0);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
}
.ad-plate-btn:hover { opacity: 0.9; transform: scale(1.03); }
.ad-plate-btn:active { transform: scale(0.97); }

/* Плашка в оверлее рендера — фиксированная позиция снизу */
.ad-plate-overlay {
  position: absolute;
  bottom: 20px;
  left: 16px;
  right: 16px;
  margin: 0;
}

/* ===================================================================
   SCREEN #2: ИИ-Бриф + ИИ-Шпион (#screen-brief)
   =================================================================== */
#screen-brief {
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-core);
  overflow-y: auto;
  position: relative;
}
  padding-bottom: 80px;
}

/* --- BLOCK 1: Spy Module --- */
#spy-module {
  margin: 16px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(0,240,255,0.03);
  border: 1px dashed rgba(0,240,255,0.2);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color .3s;
}
#spy-module.scanning {
  border-style: solid;
  border-color: var(--neon-accent-cyan);
  animation: spy-laser 1.5s ease-in-out infinite;
}
@keyframes spy-laser {
  0%, 100% { box-shadow: 0 0 0 rgba(0,240,255,0); }
  50% { box-shadow: 0 0 20px rgba(0,240,255,0.3), inset 0 0 20px rgba(0,240,255,0.05); }
}
.spy-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--neon-accent-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.spy-input-wrap {
  position: relative;
}
#input-sku {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: rgba(13,15,18,0.6);
  border: 1px solid var(--glass-border);
  padding: 0 120px 0 16px;
  color: #fff;
  font-size: 14px;
  transition: all .2s;
  outline: none;
  box-sizing: border-box;
}
#input-sku:focus {
  border-color: var(--neon-accent-cyan);
  box-shadow: 0 0 8px rgba(0,240,255,0.15);
}
#input-sku:disabled {
  opacity: 0.6;
}
#btn-spy-scan {
  position: absolute;
  right: 6px; top: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  background: rgba(0,240,255,0.15);
  border: 1px solid rgba(0,240,255,0.3);
  color: var(--neon-accent-cyan);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
#btn-spy-scan:active { transform: scale(0.96); }
.spy-result {
  display: flex;
  gap: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
  animation: spy-reveal .4s ease-out;
}
@keyframes spy-reveal {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 200px; }
}
.spy-result-preview {
  width: 80px; height: 80px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  flex-shrink: 0;
}
.spy-result-preview img {
  width: 100%; height: 100%; object-fit: cover;
}
.spy-result-verdict {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.spy-result-verdict strong {
  color: var(--neon-accent-cyan);
  font-size: 13px;
}

/* --- BLOCK 2: Style Pills --- */
#step-atmosphere {
  padding: 0 16px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#step-atmosphere h3 {
  font-size: 15px; font-weight: 700; color: #fff; margin: 0;
}
.style-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.style-scroll::-webkit-scrollbar { display: none; }
.style-pill {
  flex: 0 0 110px;
  height: 130px;
  border-radius: 14px;
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: all .2s;
}
.style-pill.active {
  border-color: var(--neon-accent-cyan);
  box-shadow: 0 0 15px rgba(0,240,255,0.2);
  transform: scale(1.03);
}
.style-pill-img {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.style-pill span:last-child {
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  background: rgba(0,0,0,0.3);
}
.style-pill.active span:last-child { color: #fff; }

/* --- BLOCK 3: USP Tags --- */
#step-utp {
  padding: 0 16px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#step-utp h3 {
  font-size: 15px; font-weight: 700; color: #fff; margin: 0;
}
.usp-input-wrapper {
  position: relative;
}
#input-utp {
  width: 100%;
  height: 46px;
  border-radius: 12px;
  background: rgba(13,15,18,0.6);
  border: 1px solid var(--glass-border);
  padding: 0 16px;
  color: #fff;
  font-size: 14px;
  outline: none;
  box-sizing: border-box;
}
#input-utp:focus {
  border-color: var(--neon-accent-magenta);
}
.usp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.usp-tag {
  padding: 6px 12px;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.usp-tag:active {
  background: rgba(255,0,122,0.1);
  border-color: var(--neon-accent-magenta);
  color: #fff;
}

/* --- BLOCK 4: Marketplace --- */
#step-marketplace {
  padding: 0 16px;
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#step-marketplace h3 {
  font-size: 15px; font-weight: 700; color: #fff; margin: 0;
}
.marketplace-btns {
  display: flex;
  gap: 12px;
}
.mp-btn {
  flex: 1;
  height: 64px;
  border-radius: 16px;
  background: rgba(25,29,36,0.5);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all .2s;
}
.mp-btn.active {
  border: 2px solid var(--neon-accent-cyan);
  color: #fff;
  background: rgba(0,240,255,0.05);
}

/* --- BLOCK 5: CTA --- */
.brief-cta-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 16px;
  background: linear-gradient(180deg, rgba(13,15,18,0) 0%, var(--bg-core) 30%);
  z-index: 10;
  box-sizing: border-box;
}
#btn-to-upload {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--neon-accent-cyan), var(--neon-accent-magenta));
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  box-shadow: 0 4px 20px rgba(255,0,122,0.2);
  cursor: pointer;
  transition: opacity .25s, transform .15s;
}
#btn-to-upload:disabled {
  opacity: 0.5;
  pointer-events: none;
}
#btn-to-upload:not(:disabled):active { transform: scale(0.97); }

/* ===================================================================
   V3 DASHBOARD — Dark Cyber-Glassmorphism (ТЗ Экран №1)
   Добавлены Design Tokens поверх существующих переменных.
   =================================================================== */
:root {
  --bg-core: #0D0F12;
  --glass-surface: rgba(25, 29, 36, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --neon-accent-cyan: #00F0FF;
  --neon-accent-magenta: #FF007A;
  --text-main: #FFFFFF;
  --text-secondary: #94A3B8;
}

/* ===== SCREEN MANAGEMENT ===== */
.app-screen {
  display: none;
  width: 100%;
  min-height: 100vh;
  flex-direction: column;
  background: var(--bg-core);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.app-screen.active {
  display: flex;
}

/* ===== BLOCK 0: LEGAL GATE MODAL ===== */
#legal-gate-modal {
  position: fixed;
  z-index: 100000;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(13, 15, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
}
#legal-gate-modal.active {
  display: flex;
}
.legal-gate-card {
  width: 90%;
  max-width: 400px;
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  backdrop-filter: blur(10px);
}
.legal-gate-icon {
  width: 48px; height: 48px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--neon-accent-cyan), var(--neon-accent-magenta));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
}
.legal-gate-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px;
}
.legal-gate-text {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0 0 20px;
  line-height: 1.5;
}
.legal-gate-checks {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}
.legal-check {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
}
.legal-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 24px; height: 24px;
  min-width: 24px;
  border-radius: 6px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: border-color .25s, box-shadow .25s;
  position: relative;
}
.legal-check input[type="checkbox"]:checked {
  border-color: var(--neon-accent-cyan);
  box-shadow: 0 0 12px rgba(0,240,255,0.3);
  background: rgba(0,240,255,0.1);
}
.legal-check input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--neon-accent-cyan);
  font-size: 14px;
  font-weight: 700;
}
.legal-gate-btn {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  border: none;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background .3s, box-shadow .3s, transform .15s;
}
.legal-gate-btn:disabled {
  background: #1E232D;
  color: #4A5568;
  cursor: not-allowed;
}
.legal-gate-btn:not(:disabled) {
  background: linear-gradient(90deg, var(--neon-accent-cyan), var(--neon-accent-magenta));
  color: #fff;
  box-shadow: 0 0 20px rgba(0,240,255,0.4);
}
.legal-gate-btn:not(:disabled):active {
  transform: scale(0.97);
}

/* ===== BLOCK 1: TOP BAR ===== */
/* ===================================================================
   PREMIUM SCREEN 1 (reference: neon-glass dashboard)
   =================================================================== */

/* Фон Экрана 1: абсолютно чёрная подложка + плавные неоновые волны-дымка */
#screen-dashboard {
  position: relative;
  background: #04040A;
  overflow: hidden;
}
.dash-bg-waves {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.dash-bg-waves .wave {
  position: absolute;
  display: block;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  will-change: transform;
}
.dash-bg-waves .wave-teal {
  width: 360px; height: 360px;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.9), transparent 70%);
  top: -80px; left: -120px;
  animation: wave-drift-a 14s ease-in-out infinite alternate;
}
.dash-bg-waves .wave-violet {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.85), transparent 70%);
  top: 30%; right: -160px;
  animation: wave-drift-b 18s ease-in-out infinite alternate;
}
.dash-bg-waves .wave-cyan {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.7), transparent 70%);
  bottom: -100px; left: 20%;
  animation: wave-drift-a 16s ease-in-out infinite alternate-reverse;
}
@keyframes wave-drift-a {
  0%   { transform: translate(0, 0) scale(1); }
  100% { transform: translate(40px, 30px) scale(1.15); }
}
@keyframes wave-drift-b {
  0%   { transform: translate(0, 0) scale(1.05); }
  100% { transform: translate(-50px, 40px) scale(0.95); }
}
/* Декоративные неоновые пятна-дымка (точные параметры из ТЗ):
   - cyan w-72 (288px) слева сверху, blur 120px
   - purple w-96 (384px) справа по центру, blur 150px
   Абсолютные, не кликабельные — подсвечивают интерфейс изнутри. */
.neon-blob {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  display: block;
}
.neon-blob-cyan {
  width: 288px;            /* w-72 */
  height: 288px;
  top: 0;
  left: 0;
  background: rgba(6, 182, 212, 0.1);     /* bg-cyan-500/10 */
  filter: blur(120px);                    /* blur-[120px] */
  animation: wave-drift-a 18s ease-in-out infinite alternate;
}
.neon-blob-purple {
  width: 384px;            /* w-96 */
  height: 384px;
  top: 40%;
  right: 0;
  background: rgba(147, 51, 234, 0.1);    /* bg-purple-600/10 */
  filter: blur(150px);                    /* blur-[150px] */
  animation: wave-drift-b 22s ease-in-out infinite alternate;
}
/* Контент Экрана 1 — поверх волн */
#screen-dashboard > :not(.dash-bg-waves) {
  position: relative;
  z-index: 1;
}

/* ===== BLOCK 1: TOP BAR ===== */
.dash-topbar {
  height: 64px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 999;
  background: rgba(4, 4, 10, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.dash-logo {
  font-family: 'Bebas Neue', 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 700;
  background: linear-gradient(90deg, var(--neon-accent-cyan), var(--neon-accent-magenta));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dash-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon-accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
  animation: dash-pulse 2s ease-in-out infinite;
}
@keyframes dash-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}
/* Баланс: прямоугольная пилюля, полупрозрачный гласс + тонкая неон-cyan рамка */
.dash-balance {
  height: 38px;
  padding: 0 16px;
  border-radius: 12px;            /* rounded-xl */
  background: rgba(255, 255, 255, 0.08);          /* bg-white/10 */
  backdrop-filter: blur(12px);                    /* backdrop-blur-md */
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(6, 182, 212, 0.55);      /* тонкая неон-cyan рамка */
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, border-color .2s;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}
.dash-balance:active {
  transform: scale(1.04);
  box-shadow: 0 0 22px rgba(6, 182, 212, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.dash-balance-star {
  color: #FFD700;
  font-size: 16px;
  filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.5));
}

/* ===== BLOCK 2: HERO TITLE ===== */
.hero-title {
  text-align: center;
  padding: 18px 24px 4px;
}
.hero-title h2 {
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
  letter-spacing: 0.2px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6);
}

/* ===== BLOCK 3: 3D HERO SHOWCASE (стеклянные карточки-линзы) ===== */
.hero-showcase {
  width: 100%;
  height: 280px;
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  perspective: 1200px;
}
.hero-card {
  width: 130px;
  height: 180px;
  border-radius: 22px;                       /* закруглённые края «линзы» */
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02)),
    rgba(16, 20, 38, 0.55);                  /* объёмный стеклянный вид */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transition: all .5s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  cursor: pointer;
}
.hero-card img {
  width: 100%; height: 100%;
  object-fit: cover;
  background: rgba(255, 255, 255, 0.03);
}
.hero-card img[src=""] { visibility: hidden; }
/* Плейсхолдер-контент карточки: рисуется когда нет реального img (hero_slides
   из админки пустые). Показывает пример воронки, чтобы дашборд не выглядел
   пятью пустыми стеклянными прямоугольниками. */
.hero-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 10px 12px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(6, 182, 212, 0.18), transparent 65%),
    linear-gradient(180deg, rgba(10, 12, 24, 0.2) 0%, rgba(4, 6, 14, 0.85) 100%);
}
.hero-card-placeholder .ph-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 8px;
  opacity: 0.95;
}
.hero-card-placeholder .ph-title {
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.3px;
  margin-bottom: 3px;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}
.hero-card-placeholder .ph-sub {
  font-size: 9px;
  font-weight: 500;
  color: var(--text-soft);
  line-height: 1.3;
}
.hero-card:nth-child(1) { /* центр — активная, премиальный glassmorphism */
  left: 50%;
  transform: translate(-50%, -50%) scale(1.18);
  z-index: 5;
  /* Расширенный стеклянный слой (slider-card-active): объёмный градиент,
     глубокий blur, яркая внутренняя подсветка и неоновый ореол. */
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 30px rgba(6, 182, 212, 0.45),
    0 8px 32px 0 rgba(0, 0, 0, 0.55),
    inset 0 0 15px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  animation: levitate 3.5s ease-in-out infinite;
}
.hero-card:nth-child(2) { /* левая 1 — глубокий расфокус */
  left: calc(50% - 100px);
  transform: translate(-50%, -50%) scale(0.92) rotateY(16deg);
  z-index: 4;
  opacity: 0.5;
  filter: blur(2px);
}
.hero-card:nth-child(3) { /* правая 1 — глубокий расфокус */
  left: calc(50% + 100px);
  transform: translate(-50%, -50%) scale(0.92) rotateY(-16deg);
  z-index: 4;
  opacity: 0.5;
  filter: blur(2px);
}
.hero-card:nth-child(4) { /* крайняя левая — сильный расфокус */
  left: calc(50% - 180px);
  transform: translate(-50%, -50%) scale(0.78) rotateY(26deg);
  z-index: 3;
  opacity: 0.35;
  filter: blur(3px);
}
.hero-card:nth-child(5) { /* крайняя правая — сильный расфокус */
  left: calc(50% + 180px);
  transform: translate(-50%, -50%) scale(0.78) rotateY(-26deg);
  z-index: 3;
  opacity: 0.35;
  filter: blur(3px);
}
.hero-badge {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  border-radius: 12px;
  background: linear-gradient(90deg, var(--neon-accent-magenta), var(--neon-accent-cyan));
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
@keyframes levitate {
  0%, 100% { transform: translate(-50%, -50%) scale(1.18); }
  50% { transform: translate(-50%, calc(-50% - 7px)) scale(1.18); }
}

/* ===== BLOCK 4: PAGINATION DOTS ===== */
.hero-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 6px;
}
.hero-pagination .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all .25s;
}
.hero-pagination .dot.active {
  width: 22px;
  border-radius: 4px;
  background: #FFFFFF;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.7);
}

/* ===== BLOCK 5: MARKETING TEXT ===== */
.hero-marketing {
  padding: 4px 28px 0;
  text-align: center;
}
.hero-marketing p {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
  line-height: 1.55;
}

/* ===== BLOCK 6: STEP TIMELINE (вместо бегущей строки) ===== */
.dash-timeline {
  margin: 18px 16px 0;
  padding: 14px 16px;
  border-radius: 18px;                       /* rounded-2xl */
  /* Левитирующее стекло: более прозрачная подложка (не «серый кирпич») +
     мягкий внутренний блик для ощущения объёма. */
  background: rgba(0, 0, 0, 0.25);           /* прозрачнее прежнего bg-black/40 */
  backdrop-filter: blur(12px);               /* backdrop-blur-md */
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.05);  /* border-white/5 — тонкая */
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.timeline-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.45;                             /* неактивные шаги — приглушённые */
  transition: opacity .25s;
  flex: 0 0 auto;
}
.timeline-step.active {
  opacity: 1;
}
.timeline-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex: 0 0 auto;
}
.timeline-step.active .timeline-num {
  background: linear-gradient(135deg, #6D28D9, #06B6D4);  /* indigo → cyan */
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 14px rgba(6, 182, 212, 0.6);            /* неоновая подсветка активного */
}
.timeline-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
}
.timeline-connector {
  flex: 1 1 auto;
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  border-radius: 1px;
  min-width: 12px;
}

/* ===== BLOCK 5: PRESET CAROUSEL ===== */
.preset-section {
  margin-top: 16px;
  padding: 0 16px;
}
.preset-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 10px;
}
.preset-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.preset-carousel::-webkit-scrollbar { height: 0; }
.preset-card {
  flex: 0 0 260px;
  height: 110px;
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 12px;
  display: flex;
  gap: 12px;
  cursor: pointer;
  scroll-snap-align: start;
  transition: border-color .25s, box-shadow .25s;
}
.preset-card:active {
  border-color: var(--neon-accent-cyan);
  box-shadow: 0 0 12px rgba(0,240,255,0.2);
}
.preset-card-thumb {
  width: 86px; height: 86px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  overflow: hidden;
  flex-shrink: 0;
}
.preset-card-thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.preset-card-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.preset-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}
.preset-card-stat {
  font-size: 11px;
  color: var(--neon-accent-cyan);
}
.preset-card-cta {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--neon-accent-magenta);
}

/* ===== BLOCK 6: CATEGORY TILES ===== */
.category-section {
  margin-top: 16px;
  padding: 0 16px;
}
.category-section h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 10px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.category-tile {
  height: 80px;
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: border-color .25s, box-shadow .25s, transform .15s;
  text-align: center;
  padding: 8px;
}
.category-tile:active {
  border-color: var(--neon-accent-cyan);
  box-shadow: 0 0 12px rgba(0,240,255,0.25);
  transform: scale(0.97);
}

/* ===== BLOCK 7: SPONSOR BANNER ===== */
.sponsor-banner {
  margin: 16px;
  height: 84px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(0,240,255,0.08), rgba(255,0,122,0.06));
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 16px;
  position: relative;
  overflow: hidden;
}
.sponsor-left {
  flex: 1;
}
.sponsor-left h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.sponsor-left p {
  margin: 0;
  font-size: 11px;
  color: var(--text-secondary);
}
.sponsor-cta {
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--neon-accent-magenta);
  box-shadow: 0 0 15px rgba(255,0,122,0.3);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .15s;
}
.sponsor-cta:active { transform: scale(0.95); }
.sponsor-disclaimer {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 8px;
  color: rgba(255,255,255,0.4);
}

/* ===== BLOCK 8: CTA FOOTER ===== */
.dash-cta-bar {
  position: sticky;
  bottom: 0;
  z-index: 998;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(4, 4, 10, 0.92) 60%, transparent);
}
/* CTA: глубокий фиолетово-циановый градиент (indigo-600 → cyan-400) + неоновое свечение */
#btnStartWizard {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(90deg, #4F46E5 0%, #6D28D9 45%, #06B6D4 100%);  /* indigo-600 → violet → cyan-400 */
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .25s;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5), 0 8px 24px rgba(79, 70, 229, 0.35);  /* неоновое свечение в тон */
}
#btnStartWizard::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  animation: sheen 4s ease-in-out infinite;
}
#btnStartWizard:active {
  transform: scale(0.97);
  box-shadow: 0 0 28px rgba(6, 182, 212, 0.7), 0 8px 24px rgba(79, 70, 229, 0.5);
}
@keyframes sheen {
  0%, 100% { left: -100%; }
  50% { left: 150%; }
}

/* Переход между экранами */
@keyframes slideOutLeft {
  0% { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(-100%); opacity: 0; }
}
@keyframes slideInRight {
  0% { transform: translateX(100%); opacity: 0; }
  100% { transform: translateX(0); opacity: 1; }
}
.slide-out-left {
  animation: slideOutLeft .35s ease-in forwards;
}
.slide-in-right {
  animation: slideInRight .35s ease-out forwards;
}

/* Экран редактора — не скроллим (холст управляет собой сам) */
#screen-editor { overflow: hidden; }

/* Кнопка «Назад» внизу экранов — в стиле бота */
.back-btn-bottom {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all .15s;
}
.back-btn-bottom:active { background: rgba(255,255,255,0.1); color: #fff; }

/* Старая кнопка — удаляем (больше не используется) */
.back-btn { display: none; }

/* ===================================================================
   SCREEN #3: Фото-Студия Света и Теней (#screen-studio)
   =================================================================== */
#screen-studio {
  flex-direction: column;
  min-height: 100vh;
  background: #07080a;
  overflow-y: auto;
  position: relative;
}
}

/* --- BLOCK 1: Upload Zone --- */
#photo-upload-stage {
  position: relative;
  padding: 16px;
}
.upload-zone {
  width: 100%;
  height: 200px;
  border-radius: 20px;
  background: rgba(255,255,255,0.02);
  border: 2px dashed rgba(0,240,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .3s;
  box-sizing: border-box;
}
.upload-zone:active, .upload-zone.dragover {
  border-color: var(--neon-accent-cyan);
  background: rgba(0,240,255,0.04);
  box-shadow: 0 0 20px rgba(0,240,255,0.1);
}
.upload-zone-inner {
  text-align: center;
  color: var(--text-secondary);
}
.upload-camera-icon {
  font-size: 40px;
  margin-bottom: 10px;
}
.upload-zone-inner p {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}
.upload-zone-inner span {
  font-size: 11px;
  color: var(--text-secondary);
}
.upload-scan-line {
  position: absolute;
  top: 16px; left: 16px; right: 16px;
  height: 2px;
  background: var(--neon-accent-cyan);
  box-shadow: 0 0 15px rgba(0,240,255,0.6);
  animation: scan-vertical 1.8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes scan-vertical {
  0%, 100% { top: 16px; }
  50% { top: calc(16px + 200px - 2px); }
}

/* --- BLOCK 2: 3D Preview Scene --- */
#studio-viewport {
  width: 100%;
  height: 40vh;
  max-height: 380px;
  position: relative;
  background: #07080a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.studio-grid-bg {
  position: absolute;
  inset: 0;
  transform: rotateX(60deg);
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  transform-origin: center bottom;
  opacity: 0.7;
}
#target-product-layer {
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
  z-index: 10;
  filter: drop-shadow(0px 0px 0px rgba(0,0,0,0));
  transition: filter .05s linear;
  position: relative;
}
#contact-shadow-layer {
  position: absolute;
  z-index: 9;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 70%);
  border-radius: 50%;
  width: 60%;
  height: 40px;
  bottom: 20%;
  transform: translate(0px, 0px);
  transition: transform .05s linear;
}

/* --- BLOCK 3: Light Sliders --- */
#studio-controls {
  width: 100%;
  padding: 20px 16px;
  background: var(--glass-surface);
  border-top: 1px solid var(--glass-border);
  border-radius: 24px 24px 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}
.studio-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.studio-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.studio-slider-val {
  font-family: 'Roboto Mono', monospace;
  color: var(--neon-accent-cyan);
  font-size: 13px;
}
.studio-range {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #1E232D;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}
.studio-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  border-radius: 50%;
  cursor: pointer;
}
.cyan-range::-webkit-slider-thumb {
  background: var(--neon-accent-cyan);
  box-shadow: 0 0 10px var(--neon-accent-cyan);
}
.magenta-range::-webkit-slider-thumb {
  background: var(--neon-accent-magenta);
  box-shadow: 0 0 10px var(--neon-accent-magenta);
}

/* --- Sponsor widget --- */
.studio-sponsor {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,0,122,0.04);
  border: 1px solid rgba(255,0,122,0.15);
  font-size: 11px;
  color: var(--text-secondary);
}
.studio-sponsor-icon { font-size: 18px; flex-shrink: 0; }
.studio-sponsor-disclaimer {
  font-size: 8px;
  color: rgba(255,255,255,0.3);
  flex-shrink: 0;
  margin-left: auto;
}

/* --- BLOCK 5: CTA --- */
.studio-cta-bar {
  padding: 16px;
  background: #0D0F12;
  display: flex;
  justify-content: center;
  margin-top: auto;
}
#btn-studio-confirm {
  width: 100%;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(90deg, var(--neon-accent-cyan), var(--neon-accent-magenta));
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(255,0,122,0.2);
}

/* ===================================================================
   SCREEN #4: Загрузка фото и ИИ-удаление фона
   =================================================================== */
#screen-4 {
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 100vh;
  background: #0E0F12;
  position: relative;
  overflow: hidden;
}
.screen4-inner {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  box-sizing: border-box;
  flex: 1;
  justify-content: center;
}

#uploadTitle {
  font-size: 26px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0 0 8px;
  text-align: center;
}
#uploadSubtitle {
  font-size: 14px;
  color: #8A8E99;
  text-align: center;
  max-width: 290px;
  line-height: 1.4;
  margin: 0 0 32px;
}

/* Dropzone */
.dropzone {
  width: 100%;
  max-width: 342px;
  height: 380px;
  border: 2px dashed #1C2026;
  border-radius: 20px;
  background: #13161C;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all .3s ease;
  cursor: pointer;
  box-sizing: border-box;
}
.dropzone.drag-active {
  border-color: #00F0FF;
  box-shadow: 0 0 20px rgba(0,240,255,0.15);
  background: #161B24;
}
.dropzone.error-flash {
  border-color: #FF334B !important;
  box-shadow: 0 0 20px rgba(255,51,75,0.2) !important;
}
.upload-icon {
  font-size: 48px;
  margin-bottom: 16px;
  transition: transform .3s ease;
}
.drag-active .upload-icon { transform: scale(1.1); }
.dropzone-text {
  font-size: 15px;
  font-weight: 500;
  color: #FFFFFF;
  margin-bottom: 6px;
}
.dropzone-hint {
  font-size: 12px;
  color: #626773;
  margin-bottom: 4px;
}
.dropzone-quality-hint {
  font-size: 11px;
  color: #4a6;
  margin-bottom: 20px;
}
.dropzone-btn {
  padding: 12px 24px;
  background: #20242D;
  border-radius: 12px;
  border: 1px solid #2C323F;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.dropzone-btn:hover { background: #2A2F3B; }

/* Error block */
.upload-error {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(255,51,75,0.1);
  border: 1px solid rgba(255,51,75,0.3);
  color: #FF5568;
  font-size: 13px;
  text-align: center;
  max-width: 342px;
  width: 100%;
  box-sizing: border-box;
}

/* Fullscreen loader */
.upload-loader {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #0E0F12;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.loader-ring {
  width: 64px; height: 64px;
  border: 4px solid #1C2026;
  border-top-color: #00F0FF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loader-status {
  margin-top: 24px;
  font-size: 15px;
  color: #FFFFFF;
  font-weight: 500;
  text-align: center;
}

/* ===== ШАГ 3: Safe-zone collision ===== */
.canvas-container-wrap.safe-zone-danger {
  animation: sz-danger .6s ease-out;
}
@keyframes sz-danger {
  0% { box-shadow: 0 0 0 rgba(255,51,75,0); }
  50% { box-shadow: 0 0 30px rgba(255,51,75,0.5); }
  100% { box-shadow: 0 0 0 rgba(255,51,75,0); }
}

/* ===== ШАГ 5: Eco-Mode badge ===== */
.eco-badge {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(0,200,100,0.9);
  color: #fff;
  padding: 4px 14px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  animation: eco-fade 3s ease-out forwards;
}
@keyframes eco-fade {
  0% { opacity: 1; }
  70% { opacity: 1; }
  100% { opacity: 0; }
}

.generating-spinner {

/* ===== SCREEN #2: Mode selection ===== */
#screen-mode { background: var(--bg-core); }


/* ===== SCREEN #2: Mode selection (v2 — glass cards) ===== */
#screen-mode { background: var(--bg-core); }
#screen-mode .dash-topbar { position: sticky; top: 0; }
.mode-container { flex:1; display:flex; flex-direction:column; padding:0 16px; }
.mode-title { font-size:24px; font-weight:700; color:#e2e8f0; margin:0 0 20px; text-align:left; padding:0 4px; }
.mode-cards { display:flex; flex-direction:column; gap:14px; margin-bottom:20px; }
.mode-card {
  width:100%; box-sizing:border-box;
  background:rgba(15,23,42,0.4); backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);
  border:1px solid rgba(255,255,255,0.1); border-radius:16px;
  padding:20px; display:flex; flex-direction:column; align-items:flex-start; text-align:left;
  position:relative; transition:all .3s; cursor:pointer;
}
.mode-card:hover { border-color:rgba(255,255,255,0.2); }
.mode-card.active { border-color:#06b6d4; box-shadow:0 0 20px rgba(6,182,212,0.15); background:rgba(15,23,42,0.6); }
.mode-card-header { display:flex; align-items:center; gap:8px; font-size:18px; font-weight:600; color:#e2e8f0; margin-bottom:6px; width:100%; }
.mode-card-desc { font-size:13px; color:#94a3b8; line-height:1.45; margin-bottom:10px; }
.mode-card-price {
  display:inline-flex; align-items:center;
  font-size:12px; font-family:'Roboto Mono',monospace; font-weight:500; letter-spacing:0.3px;
  color:#22d3ee; background:rgba(6,182,212,0.1); border:1px solid rgba(6,182,212,0.2);
  border-radius:8px; padding:5px 10px; margin-top:2px;
}
.mode-badge {
  position:absolute; top:10px; right:10px;
  background:linear-gradient(135deg,#f59e0b,#ea580c);
  font-size:10px; font-weight:700; color:#fff;
  padding:3px 10px; border-radius:12px;
  text-transform:uppercase; letter-spacing:0.5px;
  animation:pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge { 0%,100%{opacity:1} 50%{opacity:.7} }
  width:100%; padding:16px; border-radius:14px; font-size:16px; font-weight:700;
  color:#fff; text-align:center; transition:all .3s; border:none; cursor:pointer;
}
  background:linear-gradient(90deg,#8b5cf6,#06b6d4);
  box-shadow:0 4px 15px rgba(139,92,246,0.3);
}
  width:100%; padding:12px; font-size:13px; font-weight:500; color:#94a3b8;
  text-align:center; cursor:pointer; background:transparent; border:none;
  transition:color .2s;
}


/* ===== ТЗ БЛОК 2.2: пикер стиля ИИ-фонаStudio / Scandi / Cyberpunk / Loft / Nature */
.bg-style-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 4px;
  align-items: center;
}
.bg-style-picker .bg-style-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  color: #cbd5e1;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: inherit;
}
.bg-style-picker .bg-style-btn:hover {
  background: rgba(255,255,255,0.10);
  color: #ffffff;
}
.bg-style-picker .bg-style-btn.active {
  background: linear-gradient(135deg,#6366f1,#8b5cf6);
  border-color: #8b5cf6;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(139,92,246,0.35);
}
.render-history {
  position: relative;
  z-index: 2;
  margin: 18px 20px 92px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(14px);
}
.render-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.render-history-head h3 { margin: 0; color: #f8fafc; font-size: 14px; }
.render-history-head button {
  border: 0;
  background: transparent;
  color: #22d3ee;
  font-size: 12px;
  cursor: pointer;
}
.render-history-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.render-history-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.render-history-item img { width: 100%; height: 100%; object-fit: cover; }
.render-history-status {
  position: absolute;
  right: 4px;
  bottom: 4px;
  left: 4px;
  overflow: hidden;
  padding: 3px 5px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.72);
  color: #e2e8f0;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.render-history-empty {
  grid-column: 1 / -1;
  padding: 12px 0;
  color: #64748b;
  font-size: 12px;
  text-align: center;
}


/* ==========================================================================
   Сессия 3 — Studio Workspace: чистый тёмный Pro-интерфейс.
   Фон #0F1115, карточки #181B22, рамки rgba(255,255,255,.08),
   акцент индиго #6366F1, PRO/видео — янтарь #F59E0B.
   ========================================================================== */
.s3 {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column;
  background: #0F1115; color: #E5E7EB;
  font-family: Inter, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
.s3-top {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.s3-logo { font-weight: 700; letter-spacing: .2px; }
.s3-plan {
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px;
  border: 1px solid rgba(245,158,11,.5); color: #F59E0B; background: transparent;
}
.s3-bal { margin-left: auto; font-size: 13px; color: #A5B4FC; }
.s3-plus {
  width: 26px; height: 26px; border-radius: 8px; font-size: 15px; font-weight: 700;
  border: 1px solid rgba(99,102,241,.6); color: #6366F1; background: transparent;
}

/* ---- HOME: три главных сценария ---- */
.s3-home { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.s3-card {
  position: relative; text-align: left; display: flex; flex-direction: column; gap: 4px;
  padding: 18px 16px; border-radius: 16px; cursor: pointer;
  background: #181B22; border: 1px solid rgba(255,255,255,.08); color: inherit;
}
.s3-card:active { border-color: rgba(99,102,241,.7); }
.s3-card--hit { border-color: rgba(99,102,241,.45); }
.s3-badge {
  position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; color: #0F1115; background: #F59E0B;
}
.s3-card-title { font-size: 17px; font-weight: 700; }
.s3-card-sub { font-size: 12.5px; color: #9CA3AF; }
.s3-ab-toggle {
  margin-top: 8px; font-size: 12px; color: #A5B4FC;
  border: 1px dashed rgba(99,102,241,.5); border-radius: 10px; padding: 8px 10px;
}
.s3-link {
  background: none; border: none; color: #6B7280; font-size: 13px;
  text-align: center; padding: 10px; cursor: pointer;
}

/* ---- WORKSPACE ---- */
.s3-ws { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.s3-tools {
  display: flex; gap: 8px; padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.s3-tool {
  font-size: 12.5px; padding: 7px 11px; border-radius: 10px; color: #E5E7EB;
  background: #181B22; border: 1px solid rgba(255,255,255,.08); cursor: pointer;
}
.s3-tool--primary {
  margin-left: auto; color: #fff; font-weight: 700;
  background: #6366F1; border-color: #6366F1;
}
.s3-canvas-wrap {
  position: relative; flex: 1; min-height: 0; margin: 10px 12px;
  border-radius: 16px; overflow: hidden; background: #181B22;
  border: 1px solid rgba(255,255,255,.08);
}
.s3-canvas-wrap canvas { width: 100%; height: 100%; object-fit: contain; }
.s3-overlay { position: absolute; inset: 0; pointer-events: none; }
.s3-band { position: absolute; background: rgba(239,68,68,.16); }
.s3-band--top, .s3-band--bottom { left: 0; right: 0; }
.s3-canvas-hint {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  font-size: 11.5px; color: #6B7280; text-align: center; width: 90%;
}
.s3-filmstrip {
  display: flex; gap: 8px; padding: 4px 12px 8px; overflow-x: auto;
}
.s3-thumb {
  flex: 0 0 auto; min-width: 74px; padding: 8px 10px; border-radius: 10px;
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  background: #181B22; border: 1px solid rgba(255,255,255,.08); color: #9CA3AF;
  cursor: pointer;
}
.s3-thumb.is-active { border-color: #6366F1; color: #E5E7EB; }
.s3-thumb-no { font-size: 11px; font-weight: 700; color: #6366F1; }
.s3-thumb-lbl { font-size: 11px; }
.s3-dock {
  display: flex; justify-content: space-around; padding: 8px 6px 12px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.s3-dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; color: #9CA3AF; font-size: 10.5px; cursor: pointer;
}
.s3-dock-btn span { font-size: 20px; }
.s3-dock-btn--video span { filter: drop-shadow(0 0 6px rgba(245,158,11,.6)); }
.s3-dock-btn--video i { color: #F59E0B; }

/* ---- шторка и модалки ---- */
.s3-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  background: #14171E; border-top: 1px solid rgba(255,255,255,.1);
  border-radius: 18px 18px 0 0; max-height: 38%; overflow-y: auto; padding: 14px;
}
.s3-sheet-inner { display: flex; flex-direction: column; gap: 10px; }
.s3-sheet-title { font-size: 15px; font-weight: 700; }
.s3-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.s3-chip {
  font-size: 12px; padding: 6px 10px; border-radius: 999px; color: #9CA3AF;
  background: #181B22; border: 1px solid rgba(255,255,255,.08); cursor: pointer;
}
.s3-chip.is-active { color: #fff; border-color: #6366F1; background: rgba(99,102,241,.18); }
.s3-input {
  width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 13px;
  border-radius: 10px; color: #E5E7EB; background: #181B22;
  border: 1px solid rgba(255,255,255,.08);
}
.s3-sheet-btn {
  padding: 11px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
  color: #E5E7EB; background: #181B22; border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
}
.s3-sheet-btn--primary { color: #fff; background: #6366F1; border-color: #6366F1; }
.s3-empty { font-size: 12.5px; color: #6B7280; }
.s3-model {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 12px; text-align: left; color: inherit;
  background: #181B22; border: 1px solid rgba(255,255,255,.08); cursor: pointer;
}
.s3-model.is-active { border-color: #6366F1; }
.s3-model-name { font-size: 13.5px; font-weight: 600; }
.s3-model-desc { font-size: 11px; color: #6B7280; flex: 1; }
.s3-model-price { font-size: 13px; font-weight: 700; color: #A5B4FC; }

/* ---- DONE: апсейлы ---- */
.s3-done { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.s3-done-img {
  flex: 1; min-height: 180px; border-radius: 16px;
  background: #181B22 center/contain no-repeat url('/assets/mascot_robot.svg');
  border: 1px solid rgba(255,255,255,.08);
}
.s3-cta {
  padding: 13px 14px; border-radius: 12px; font-size: 14px; font-weight: 600;
  color: #E5E7EB; background: #181B22; border: 1px solid rgba(255,255,255,.08);
  cursor: pointer;
}
.s3-cta--video { color: #0F1115; background: #F59E0B; border-color: #F59E0B; }
.s3-cta--ab { color: #A5B4FC; border-color: rgba(99,102,241,.5); }

/* ---- Plans modal ---- */
.s3-modal {
  position: fixed; inset: 0; z-index: 80; display: flex;
  align-items: center; justify-content: center; background: rgba(0,0,0,.6);
}
.s3-modal-card {
  width: min(92%, 380px); padding: 18px; border-radius: 18px;
  background: #14171E; border: 1px solid rgba(255,255,255,.1);
}
.s3-plans { display: flex; flex-direction: column; gap: 10px; }
.s3-plan-card {
  padding: 12px 14px; border-radius: 14px;
  background: #181B22; border: 1px solid rgba(255,255,255,.08);
}
.s3-plan-name { font-size: 14px; font-weight: 700; }
.s3-plan-price { font-size: 13px; color: #A5B4FC; margin: 2px 0 8px; }
.s3-modal-close {
  width: 100%; margin-top: 12px; padding: 11px; border-radius: 12px;
  font-size: 13.5px; color: #9CA3AF; background: none;
  border: 1px solid rgba(255,255,255,.08); cursor: pointer;
}


/* ==========================================================================
   Сессия 4 — TabBar, страницы, живой холст (safe-zone/прогресс), видео.
   ========================================================================== */
.s3-tabbar {
  display: flex; justify-content: space-around; align-items: center;
  padding: 6px 4px 10px; border-top: 1px solid rgba(255,255,255,.08);
  background: #0F1115;
}
.s3-tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; color: #6B7280; font-size: 10.5px;
  cursor: pointer; padding: 4px 8px;
}
.s3-tab span { font-size: 18px; }
.s3-tab.is-active { color: #A5B4FC; }
.s3-tab.is-active span { filter: drop-shadow(0 0 6px rgba(99,102,241,.6)); }

.s3-page { flex: 1; overflow-y: auto; padding: 14px 12px 20px; }
.s3-page-title { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.s3-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.s3-project {
  display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 12px 14px;
  border-radius: 14px; color: inherit; cursor: pointer;
  background: #181B22; border: 1px solid rgba(255,255,255,.08);
}
.s3-project-name { font-size: 14px; font-weight: 600; }
.s3-project-meta, .s3-project-date { font-size: 11.5px; color: #6B7280; }

.s3-brand { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.s3-brand-logo { max-width: 140px; max-height: 90px; object-fit: contain; }
.s3-swatch {
  width: 26px; height: 26px; border-radius: 8px; display: inline-block;
  border: 1px solid rgba(255,255,255,.15);
}
.s3-pro-body { display: flex; flex-direction: column; gap: 10px; }
.s3-pro-balance { font-size: 14px; color: #A5B4FC; font-weight: 600; }

/* прогресс рендера прямо на холсте */
.s3-progress {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: #E5E7EB;
}
.s3-progress-bar {
  height: 6px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden;
}
.s3-progress-bar i { display: block; height: 100%; width: 10%; background: #6366F1; }
.s3-fixsafe {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%);
  font-size: 12px; font-weight: 600; padding: 8px 12px; border-radius: 999px;
  color: #0F1115; background: #F59E0B; border: none; cursor: pointer;
}

/* инфографика (поля в шторке) */
.s3-inf { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.s3-inf textarea { resize: vertical; font-family: inherit; }

/* видео-плеер и превью */
.s3-video {
  width: 100%; max-height: 46vh; border-radius: 14px; background: #000;
  border: 1px solid rgba(255,255,255,.08);
}
.s3-video-status { font-size: 12.5px; color: #A5B4FC; }
.s3-video-thumb {
  width: 100%; max-height: 30vh; object-fit: contain; border-radius: 12px;
  background: #181B22; border: 1px solid rgba(255,255,255,.08);
}
.s3-thumb-ok { font-size: 10px; color: #34D399; }
