/* ═══════════════════════════════════════════════════════════
   ДИЗАЙН-ТОКЕНЫ
   «Ночной кинотеатр»: тёплая бархатная темнота, свет от экрана,
   два акцента — малиново-янтарный для действий и шампань для
   ценного (баланс, бонусы). Тёмная тема — единственная.
   Шрифты лежат рядом с панелью и не зависят от внешних сервисов.
   ═══════════════════════════════════════════════════════════ */
@font-face{
  font-family:'Manrope Variable'; font-style:normal; font-display:swap; font-weight:200 800;
  src:url(/static/fonts/manrope-cyrillic-wght-normal.woff2) format('woff2-variations'),
      url(/static/fonts/manrope-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face{
  font-family:'Manrope Variable'; font-style:normal; font-display:swap; font-weight:200 800;
  src:url(/static/fonts/manrope-latin-wght-normal.woff2) format('woff2-variations'),
      url(/static/fonts/manrope-latin-wght-normal.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face{
  font-family:'Playfair Display Variable'; font-style:normal; font-display:swap; font-weight:400 900;
  src:url(/static/fonts/playfair-display-cyrillic-wght-normal.woff2) format('woff2-variations'),
      url(/static/fonts/playfair-display-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face{
  font-family:'Playfair Display Variable'; font-style:normal; font-display:swap; font-weight:400 900;
  src:url(/static/fonts/playfair-display-latin-wght-normal.woff2) format('woff2-variations'),
      url(/static/fonts/playfair-display-latin-wght-normal.woff2) format('woff2');
  unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root{
  /* ── Поверхности: бархат, а не серый ── */
  --bg:            #0F0A0D;
  --surface-1:     #160E13;
  --surface-2:     #1D131A;
  --surface-3:     #261922;
  --surface-4:     #312029;
  --surface-hover: #22161E;
  --glass:         rgba(24,15,20,.72);
  --glass-strong:  rgba(20,12,17,.9);

  /* ── Границы ── */
  --border-subtle: rgba(255,228,236,.05);
  --border:        rgba(255,228,236,.09);
  --border-strong: rgba(255,228,236,.16);
  --border-accent: rgba(255,92,147,.42);

  /* ── Текст (все уровни читаются на любой поверхности, кроме --text-4) ── */
  --text:          #F6EDEF;
  --text-2:        #C8B6BD;
  --text-3:        #A08C95;
  --text-4:        #7A6771;

  /* ── Акцент ── */
  --accent:        #FF5C93;
  --accent-hover:  #FF7AA7;
  --accent-active: #F0447F;
  --accent-deep:   #D92C68;
  --accent-fg:     #FFFFFF;
  --accent-bg:     rgba(255,92,147,.12);
  --accent-bg-2:   rgba(255,92,147,.06);
  --accent-ring:   rgba(255,92,147,.34);
  --ember:         #FF8A5B;

  /* ── Шампань: баланс, бонусы, «лучшее предложение» ── */
  --champagne:      #F2D3A6;
  --champagne-bg:   rgba(242,211,166,.09);
  --champagne-ring: rgba(242,211,166,.28);

  /* ── Семантика ── */
  --success:       #4CD9A0;
  --success-bg:    rgba(76,217,160,.10);
  --success-ring:  rgba(76,217,160,.28);
  --danger:        #FF5D5D;
  --danger-bg:     rgba(255,93,93,.10);
  --danger-ring:   rgba(255,93,93,.30);
  --warning:       #FFC15E;
  --warning-bg:    rgba(255,193,94,.10);
  --info:          #8DBBFF;
  --info-bg:       rgba(141,187,255,.10);

  /* ── Свет и заливки ── */
  --gradient-accent:       linear-gradient(135deg, #D92C68 0%, #CC3B4E 55%, #C94A34 100%);
  --gradient-accent-hover: linear-gradient(135deg, #E0336F 0%, #D2425A 55%, #D1523B 100%);
  --gradient-champagne:    linear-gradient(135deg, rgba(242,211,166,.16) 0%, rgba(255,138,91,.07) 100%);
  --gradient-surface:      linear-gradient(180deg, rgba(255,240,245,.03) 0%, transparent 55%);
  --glow-accent:  radial-gradient(60% 50% at 50% 0%, rgba(217,44,104,.22), transparent 70%);
  --glow-soft:    radial-gradient(60% 40% at 50% 0%, rgba(255,92,147,.10), transparent 70%);
  --grain-overlay: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .35 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* ── Типографика ── */
  --font-sans:    'Manrope Variable', 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Playfair Display Variable', 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-mono:    ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* ── Радиусы: чем крупнее элемент, тем мягче угол ── */
  --r-xs: 8px;
  --r-sm: 10px;
  --r:    14px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;
  --r-2xl: 30px;
  --r-full: 9999px;

  /* ── Пространство (шаг 4px) ── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px;
  --s-7: 28px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* ── Тени: тёплые и глубокие, без серой «грязи» ── */
  --shadow-xs:    0 1px 2px rgba(0,0,0,.4);
  --shadow-sm:    0 4px 14px rgba(0,0,0,.34);
  --shadow:       0 14px 34px rgba(0,0,0,.42), 0 2px 8px rgba(0,0,0,.3);
  --shadow-lg:    0 30px 80px rgba(0,0,0,.6), 0 10px 24px rgba(0,0,0,.4);
  --shadow-glow:  0 12px 36px rgba(217,44,104,.32);
  --shadow-inset: inset 0 1px 0 rgba(255,240,245,.05);

  /* ── Движение ── */
  --ease:        cubic-bezier(.22,1,.36,1);
  --ease-out:    cubic-bezier(.25,.46,.45,.94);
  --ease-in-out: cubic-bezier(.65,0,.35,1);
  --ease-back:   cubic-bezier(.34,1.56,.64,1);
  --d-fast:      140ms;
  --d:           220ms;
  --d-slow:      380ms;

  /* ── Слои ── */
  --z-sidebar:       80;
  --z-bottom-nav:    90;
  --z-mobile-header: 95;
  --z-dock:          100;
  --z-overlay:       110;
  --z-sheet:         300;
  --z-modal:         500;
  --z-dnd:           600;
  --z-toast:         9999;

  /* ── Каркас ── */
  --sidebar-w:       252px;
  --mobile-header-h: 56px;
  --bottom-nav-h:    66px;
  --content-max:     1480px;
}

/* ═══════════════════════════════════════════════════════════
   РЕСЕТ
   ═══════════════════════════════════════════════════════════ */
*,*::before,*::after{
  box-sizing:border-box;
  margin:0;
  padding:0;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

html{
  font-size:16px;
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
  background:var(--bg);
}

body{
  font-family:var(--font-sans);
  font-weight:450;
  font-size:.9375rem;
  line-height:1.55;
  color:var(--text);
  background:var(--bg);
  min-height:100dvh;
  overflow-x:hidden;
  text-rendering:optimizeLegibility;
}

/* Атмосфера: свет «от экрана» сверху и едва заметное зерно.
   Слои неподвижны и не мешают прокрутке. */
body::before{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  background:
    radial-gradient(900px 560px at 12% -8%, rgba(217,44,104,.16), transparent 62%),
    radial-gradient(760px 520px at 100% -4%, rgba(201,74,52,.10), transparent 60%),
    radial-gradient(900px 700px at 50% 120%, rgba(120,30,70,.10), transparent 60%);
}
body::after{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:1;
  background-image:var(--grain-overlay);
  opacity:.035;
}
html[data-auth-state="auth"] body::before{
  background:
    radial-gradient(1000px 700px at 18% 0%, rgba(217,44,104,.24), transparent 62%),
    radial-gradient(800px 600px at 100% 100%, rgba(201,74,52,.14), transparent 60%);
}

/* ═══════════════════════════════════════════════════════════
   ТИПОГРАФИКА
   Заголовки — выразительная антиква с русскими буквами,
   всё остальное — чистый гротеск. Цифры табличные, чтобы
   суммы не «прыгали», и тем же шрифтом, что и текст.
   ═══════════════════════════════════════════════════════════ */
h1,h2,h3{
  font-family:var(--font-display);
  font-weight:600;
  letter-spacing:-.01em;
  line-height:1.15;
  color:var(--text);
}
h4,h5,h6{
  font-family:var(--font-sans);
  font-weight:700;
  line-height:1.3;
  color:var(--text);
}

.num, .tnum{
  font-variant-numeric:tabular-nums;
  font-feature-settings:"tnum" 1;
}
.num{ font-weight:700; }
.mono{
  font-variant-numeric:tabular-nums;
  letter-spacing:.03em;
}
code, pre{ font-family:var(--font-mono); }

code{
  font-size:.86em;
  padding:.14em .45em;
  background:var(--surface-3);
  border:1px solid var(--border);
  border-radius:6px;
  color:var(--text);
}

a{
  color:var(--accent);
  text-decoration:none;
  transition:color var(--d-fast) var(--ease-out);
}
a:hover{ color:var(--accent-hover); }

button{
  font-family:inherit;
  cursor:pointer;
  border:none;
  background:none;
  color:inherit;
}

input, select, textarea{
  font-family:inherit;
  color:inherit;
}

/* ═══════════════════════════════════════════════════════════
   ФОКУС, ВЫДЕЛЕНИЕ, СКРОЛЛ
   ═══════════════════════════════════════════════════════════ */
*:focus{ outline:none; }
*:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:2px;
  border-radius:var(--r-xs);
  transition:outline-offset var(--d-fast) var(--ease-out);
}
.btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible,
.bn-item:focus-visible,
.preset-btn:focus-visible,
.method-btn:focus-visible,
.ig-mode-card:focus-visible,
.ig-param-btn:focus-visible,
.ig-list-item:focus-visible,
.tpl-card:focus-visible{
  outline-offset:3px;
}
.input:focus-visible,
input:focus-visible,
textarea:focus-visible{
  outline:none;
  border-color:var(--accent);
  box-shadow:0 0 0 3px var(--accent-ring);
}

::selection{ background:rgba(167,139,250,.26); color:var(--text); }

/* Скроллбары — тонкие, в тон */
*{ scrollbar-width:thin; scrollbar-color:var(--border-strong) transparent; }
::-webkit-scrollbar{ width:8px; height:8px; }
::-webkit-scrollbar-track{ background:transparent; }
::-webkit-scrollbar-thumb{
  background:var(--border-strong);
  border-radius:var(--r-full);
  border:2px solid transparent;
  background-clip:content-box;
}
::-webkit-scrollbar-thumb:hover{ background:rgba(255,255,255,.18); background-clip:content-box; }
::-webkit-scrollbar-corner{ background:transparent; }

/* ═══════════════════════════════════════════════════════════
   РАННЕЕ ПЕРЕКЛЮЧЕНИЕ ЭКРАНОВ
   ═══════════════════════════════════════════════════════════ */
html[data-auth-state="auth"] #authScreen{ display:flex !important; }
html[data-auth-state="auth"] #appScreen{ display:none !important; }
html[data-auth-state="app"]  #authScreen{ display:none !important; }
html[data-auth-state="app"]  #appScreen{ display:flex !important; }

.hidden{ display:none !important; }

/* При открытой модалке блокируем прокрутку фона.
   На десктопе и мобиле — модалка сама скроллится внутри. */
body.modal-open{ overflow:hidden; }

/* ═══════════════════════════════════════════════════════════
   ИКОНКИ
   Единый линейный набор (stroke 1.5). Один размер по умолчанию.
   ═══════════════════════════════════════════════════════════ */
.i{
  display:inline-block;
  width:1em;
  height:1em;
  vertical-align:-.12em;
  flex-shrink:0;
  stroke:currentColor;
  fill:none;
  stroke-width:1.5;
  stroke-linecap:round;
  stroke-linejoin:round;
  transition:transform var(--d-fast) var(--ease-out);
}
.i-sm{ font-size:14px; }
.i-md{ font-size:18px; }
.i-lg{ font-size:22px; }
.i-xl{ font-size:28px; }
.i-2xl{ font-size:40px; }
.i-3xl{ font-size:56px; }

/* Svg-sprite контейнер скрыт */
.svg-sprite{
  position:absolute;
  width:0;
  height:0;
  overflow:hidden;
  pointer-events:none;
}

/* ═══════════════════════════════════════════════════════════
   ОБЩИЕ УТИЛИТЫ
   ═══════════════════════════════════════════════════════════ */
.row{ display:flex; align-items:center; gap:var(--s-2); }
.row-between{ display:flex; align-items:center; justify-content:space-between; gap:var(--s-3); }
.col{ display:flex; flex-direction:column; gap:var(--s-2); }
.grow{ flex:1; min-width:0; }
.center{ display:flex; align-items:center; justify-content:center; }

.text-2{ color:var(--text-2); }
.text-3{ color:var(--text-3); }
.accent{ color:var(--accent); }
.success{ color:var(--success); }
.danger{ color:var(--danger); }
.warning{ color:var(--warning); }

.truncate{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  min-width:0;
}

/* Префикс .muted — для вспомогательных подписей */
.muted{ color:var(--text-3); font-size:.82rem; }

/* Dot-divider */
.dot{ color:var(--text-4); margin:0 .35em; }

/* ═══════════════════════════════════════════════════════════
   LAYOUT
   Компьютер: тонкая боковая панель из матового стекла и широкая
   рабочая область. Витрина и каталоги занимают всю ширину.
   ═══════════════════════════════════════════════════════════ */
.app{
  display:flex;
  min-height:100dvh;
  position:relative;
  z-index:2;
}

.sidebar{
  width:var(--sidebar-w);
  position:fixed;
  inset:0 auto 0 0;
  z-index:var(--z-sidebar);
  display:flex;
  flex-direction:column;
  background:linear-gradient(180deg, rgba(28,17,23,.82) 0%, rgba(17,11,14,.9) 100%);
  border-right:1px solid var(--border);
  -webkit-backdrop-filter:blur(18px) saturate(1.2);
  backdrop-filter:blur(18px) saturate(1.2);
  transition:transform var(--d-slow) var(--ease);
}

.sidebar-brand{
  display:flex;
  align-items:center;
  gap:12px;
  padding:22px 20px 16px;
}
.brand-mark{
  width:34px;
  height:34px;
  flex-shrink:0;
  filter:drop-shadow(0 6px 14px rgba(217,44,104,.38));
}
.brand-logo{
  width:34px;
  height:34px;
  flex-shrink:0;
  border-radius:10px;
  object-fit:cover;
  box-shadow:0 6px 16px rgba(0,0,0,.4);
}
/* Главный сайт: аватарка проекта (та же, что у бота в Telegram) вместо нейтрального
   значка — её ставит сервер (web_panel/branding.py). Размер и свечение — как у значка,
   скругление 25% повторяет его плитку. display:block — чтобы под картинкой не оставался
   зазор строки и аватарка стояла точно по центру названия. */
.brand-mark.brand-mark--killa{ display:block; border-radius:25%; object-fit:cover; }
.brand-text{
  display:flex;
  flex-direction:column;
  gap:1px;
  min-width:0;
}
.brand-name{
  font-family:var(--font-display);
  font-size:1.16rem;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.brand-sub{
  font-size:.75rem;
  color:var(--text-3);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.sidebar-nav{
  flex:1;
  padding:4px 12px 12px;
  overflow-y:auto;
  overflow-x:hidden;
}
.nav-section{ margin-bottom:12px; }
.nav-section-title{
  font-size:.75rem;
  font-weight:650;
  color:var(--text-3);
  padding:10px 12px 6px;
}

.nav-item{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:9px 12px;
  border-radius:var(--r-sm);
  color:var(--text-2);
  font-size:.9rem;
  font-weight:560;
  text-align:left;
  position:relative;
  margin-bottom:2px;
  -webkit-tap-highlight-color:transparent;
  transition:color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.nav-item > span:not(.nav-badge){
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.nav-item:hover{
  background:rgba(255,240,245,.045);
  color:var(--text);
}
.nav-item.active{
  background:linear-gradient(90deg, rgba(255,92,147,.16) 0%, rgba(255,92,147,.04) 100%);
  color:var(--text);
  font-weight:650;
}
.nav-item.active::before{
  content:'';
  position:absolute;
  left:-12px;
  top:9px;
  bottom:9px;
  width:3px;
  border-radius:0 3px 3px 0;
  background:var(--gradient-accent);
  box-shadow:0 0 14px rgba(255,92,147,.6);
}
.nav-item .i{
  font-size:18px;
  color:var(--text-3);
  flex-shrink:0;
  transition:color var(--d-fast) var(--ease-out);
}
.nav-item:hover .i,
.nav-item.active .i{ color:var(--accent); }
.nav-badge{
  margin-left:auto;
  min-width:20px;
  height:20px;
  padding:0 6px;
  border-radius:var(--r-full);
  background:var(--accent-bg);
  color:var(--accent);
  font-size:.72rem;
  font-weight:750;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-variant-numeric:tabular-nums;
}

.sidebar-footer{
  padding:12px;
  border-top:1px solid var(--border-subtle);
  display:flex;
  flex-direction:column;
  gap:10px;
}

/* Баланс в боковой панели: шампань — цвет «своих денег». */
.sidebar-balance{
  position:relative;
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:14px 14px;
  text-align:left;
  background:var(--gradient-champagne), var(--surface-2);
  border:1px solid rgba(242,211,166,.14);
  border-radius:var(--r);
  cursor:pointer;
  color:inherit;
  -webkit-tap-highlight-color:transparent;
  transition:border-color var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-out);
}
.sidebar-balance:hover{ border-color:var(--champagne-ring); }
.sidebar-balance:active{ transform:scale(.985); }
.sb-main{ flex:1; min-width:0; }
.sb-label{
  font-size:.75rem;
  font-weight:600;
  color:var(--text-3);
  margin-bottom:2px;
}
.sb-value{
  display:flex;
  align-items:baseline;
  gap:6px;
  font-size:1.4rem;
  font-weight:800;
  letter-spacing:-.02em;
  line-height:1.1;
  color:var(--champagne);
  font-variant-numeric:tabular-nums;
}
.sb-value small{
  font-size:.75rem;
  font-weight:600;
  color:var(--text-3);
  letter-spacing:0;
}
.sb-plus{
  width:34px;
  height:34px;
  flex-shrink:0;
  border-radius:var(--r-full);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--gradient-accent);
  color:#fff;
  box-shadow:var(--shadow-glow);
}
.sb-plus .i{ font-size:16px; }

.user-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 4px 2px;
}
.user-avatar{
  width:36px;
  height:36px;
  border-radius:var(--r-full);
  background:linear-gradient(135deg, rgba(255,92,147,.3), rgba(201,74,52,.25));
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.9rem;
  font-weight:800;
  color:#fff;
  flex-shrink:0;
  overflow:hidden;
}
.user-avatar img{ width:100%; height:100%; object-fit:cover; }
.user-info{ flex:1; min-width:0; }
.user-name{
  font-size:.86rem;
  font-weight:650;
  line-height:1.25;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.user-id{
  font-size:.74rem;
  color:var(--text-3);
  margin-top:1px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.logout-btn{
  width:34px;
  height:34px;
  flex-shrink:0;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--r-sm);
  color:var(--text-3);
  transition:color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.logout-btn:hover{ color:var(--danger); background:var(--danger-bg); }
.logout-btn .i{ font-size:17px; }

.main{
  margin-left:var(--sidebar-w);
  flex:1;
  min-height:100dvh;
  min-width:0;
  display:flex;
  flex-direction:column;
}
.main-content{
  width:100%;
  max-width:var(--content-max);
  padding:34px 44px 72px;
  flex:1;
}

.page-header{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:var(--s-6);
}
.page-title{
  font-family:var(--font-display);
  font-size:2.15rem;
  font-weight:600;
  letter-spacing:-.012em;
  line-height:1.12;
  display:flex;
  align-items:center;
  gap:12px;
}
.page-subtitle{
  color:var(--text-2);
  font-size:.95rem;
  line-height:1.55;
  max-width:680px;
}
.page-subtitle b{ color:var(--text); font-weight:650; }
.page-subtitle .num{ color:var(--text); }

.page-header-row{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:var(--s-4);
  flex-wrap:wrap;
  margin-bottom:var(--s-6);
}
.page-header-row .page-header{ flex:1; min-width:220px; margin-bottom:0; }
.page-back{ margin-bottom:var(--s-3); }

/* ═══════════════════════════════════════════════════════════
   MOBILE HEADER + BOTTOM NAV
   Телефон: верхняя строка (только в браузере) и нижняя панель
   из матового стекла с крупной кнопкой «Создать» посередине.
   ═══════════════════════════════════════════════════════════ */
.mobile-header{
  display:none;
  position:fixed;
  top:0; left:0; right:0;
  z-index:var(--z-mobile-header);
  height:calc(var(--mobile-header-h) + env(safe-area-inset-top));
  padding:env(safe-area-inset-top) 14px 0;
  align-items:center;
  gap:10px;
  background:rgba(15,10,13,.78);
  -webkit-backdrop-filter:blur(18px) saturate(1.3);
  backdrop-filter:blur(18px) saturate(1.3);
  border-bottom:1px solid var(--border-subtle);
}
.mobile-brand{
  display:flex;
  align-items:center;
  gap:9px;
  min-width:0;
  flex:1;
}
.mobile-brand .brand-mark,
.mobile-brand .brand-logo{ width:28px; height:28px; }
.mobile-brand-name{
  font-family:var(--font-display);
  font-weight:600;
  font-size:1.05rem;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.mobile-balance{
  display:inline-flex;
  align-items:center;
  gap:7px;
  height:36px;
  padding:0 6px 0 12px;
  border-radius:var(--r-full);
  background:var(--gradient-champagne), var(--surface-2);
  border:1px solid rgba(242,211,166,.18);
  color:var(--champagne);
  font-size:.9rem;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  -webkit-tap-highlight-color:transparent;
}
.mobile-balance .mb-plus{
  width:26px;
  height:26px;
  border-radius:var(--r-full);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:var(--gradient-accent);
  color:#fff;
}
.mobile-balance .mb-plus .i{ font-size:14px; }

.bottom-nav{
  display:none;
  position:fixed;
  left:0; right:0; bottom:0;
  z-index:var(--z-bottom-nav);
  padding:6px 8px calc(6px + env(safe-area-inset-bottom));
  background:rgba(17,11,14,.86);
  -webkit-backdrop-filter:blur(20px) saturate(1.3);
  backdrop-filter:blur(20px) saturate(1.3);
  border-top:1px solid var(--border-subtle);
}
.bn-inner{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  align-items:end;
  max-width:560px;
  margin:0 auto;
}
.bn-item{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  min-height:54px;
  padding:6px 2px 4px;
  color:var(--text-3);
  font-size:.7rem;
  font-weight:650;
  border-radius:var(--r-sm);
  position:relative;
  -webkit-tap-highlight-color:transparent;
  transition:color var(--d-fast) var(--ease-out);
}
.bn-item .i{ font-size:22px; }
.bn-item.active{ color:var(--text); }
.bn-item.active .i{ color:var(--accent); }
.bn-item .bn-dot{
  position:absolute;
  top:6px;
  left:calc(50% + 8px);
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:var(--r-full);
  background:var(--accent);
  color:#fff;
  font-size:.62rem;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 2px var(--bg);
}
/* Центральная кнопка «Создать» — главное действие телефона. */
.bn-create{
  align-self:start;
  margin-top:-20px;
  color:var(--text-2);
}
.bn-create .bn-create-disc{
  width:54px;
  height:54px;
  border-radius:var(--r-full);
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--gradient-accent);
  color:#fff;
  box-shadow:0 10px 28px rgba(217,44,104,.45), 0 0 0 4px var(--bg);
  transition:transform var(--d-fast) var(--ease-out);
}
.bn-create .bn-create-disc .i{ font-size:24px; }
.bn-create:active .bn-create-disc{ transform:scale(.94); }
.bn-create.active{ color:var(--text); }

.overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(8,4,6,.62);
  -webkit-backdrop-filter:blur(4px);
  backdrop-filter:blur(4px);
  z-index:var(--z-overlay);
  opacity:0;
  transition:opacity var(--d) var(--ease-out);
}
.overlay.open{ display:block; opacity:1; }

/* Список «Что создаём» — шторка снизу с крупными плитками. */
.bn-sheet{
  position:fixed;
  inset:0;
  z-index:var(--z-sheet);
  background:rgba(8,4,6,.6);
  -webkit-backdrop-filter:blur(6px);
  backdrop-filter:blur(6px);
  display:flex;
  align-items:flex-end;
  justify-content:center;
  animation:fadeIn var(--d) var(--ease-out);
}
.bn-sheet.hidden{ display:none; }
.bn-sheet-panel{
  width:100%;
  max-width:560px;
  max-height:86dvh;
  overflow-y:auto;
  background:linear-gradient(180deg, #211520 0%, #170F14 100%);
  border:1px solid var(--border);
  border-bottom:none;
  border-radius:var(--r-2xl) var(--r-2xl) 0 0;
  padding:10px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow:var(--shadow-lg);
  animation:sheetUp var(--d-slow) var(--ease);
}
.bn-sheet-grip{
  width:40px;
  height:4px;
  border-radius:var(--r-full);
  background:var(--border-strong);
  margin:2px auto 12px;
}
.bn-sheet-title{
  font-family:var(--font-display);
  font-size:1.3rem;
  font-weight:600;
  margin:0 4px 12px;
}
.bn-sheet-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.bn-sheet-item{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:flex-end;
  gap:3px;
  min-height:104px;
  padding:14px;
  border-radius:var(--r-lg);
  background:var(--surface-2);
  border:1px solid var(--border);
  text-align:left;
  overflow:hidden;
  color:var(--text);
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}
.bn-sheet-item::before{
  content:'';
  position:absolute;
  inset:0;
  background:radial-gradient(120% 80% at 100% 0%, rgba(255,92,147,.16), transparent 60%);
  pointer-events:none;
}
.bn-sheet-item:active{ transform:scale(.97); }
.bn-sheet-item .i{
  position:absolute;
  top:14px;
  left:14px;
  font-size:22px;
  color:var(--accent);
}
.bn-sheet-item b{ font-size:.95rem; font-weight:750; position:relative; }
.bn-sheet-item small{ font-size:.76rem; color:var(--text-3); position:relative; line-height:1.35; }
.bn-sheet-item.is-wide{ grid-column:1 / -1; min-height:84px; }

@keyframes sheetUp{
  from{ transform:translateY(24px); opacity:.4; }
  to{ transform:none; opacity:1; }
}
@keyframes fadeIn{
  from{ opacity:0; }
  to{ opacity:1; }
}

/* ═══════════════════════════════════════════════════════════
   МОБИЛЬНЫЕ БРЕЙКПОИНТЫ
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1180px){
  .main-content{ padding:30px 32px 64px; }
}

@media (max-width: 960px){
  .sidebar{
    transform:translateX(-100%);
    width:280px;
    z-index:calc(var(--z-overlay) + 1);
    box-shadow:var(--shadow-lg);
  }
  .sidebar.open{ transform:translateX(0); }

  .mobile-header{ display:flex; }
  .bottom-nav{ display:block; }

  .main{
    margin-left:0;
    padding-top:calc(var(--mobile-header-h) + env(safe-area-inset-top));
  }
  .main-content{
    padding:20px 16px;
    padding-bottom:calc(var(--bottom-nav-h) + 40px + env(safe-area-inset-bottom));
  }
  .page-title{ font-size:1.75rem; }
  .page-header{ margin-bottom:var(--s-5); }

  /* Внутри Telegram верхней строки нет: у мини-приложения своя шапка. */
  html.is-tg .mobile-header{ display:none; }
  html.is-tg .main{ padding-top:0; }
  html.is-tg .main-content{ padding-top:14px; }
}

@media (max-width: 480px){
  .main-content{ padding-left:14px; padding-right:14px; }
  .page-title{ font-size:1.6rem; }
}

/* На сенсорных экранах поля ввода не мельче 16px — иначе айфон
   сам увеличивает страницу при нажатии на поле. */
@media (hover: none) and (pointer: coarse){
  /* Поле кода входа и так крупнее 16px — его не трогаем. */
  input:not(.auth-input), select, textarea{ font-size:16px !important; }
}

/* ═══════════════════════════════════════════════════════════
   AUTH SCREEN
   ═══════════════════════════════════════════════════════════ */
.auth{
  min-height:100dvh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  position:relative;
  overflow:hidden;
  z-index:2;
}
.auth::before{
  content:'';
  position:absolute;
  top:-40%;
  left:50%;
  transform:translateX(-50%);
  width:min(800px, 140vw);
  height:min(800px, 140vw);
  background:radial-gradient(circle, rgba(139,92,246,.18) 0%, rgba(124,58,237,.06) 30%, transparent 60%);
  pointer-events:none;
  filter:blur(40px);
}
.auth::after{
  content:'';
  position:absolute;
  bottom:-20%;
  right:-10%;
  width:min(500px, 80vw);
  height:min(500px, 80vw);
  background:radial-gradient(circle, rgba(167,139,250,.12), transparent 60%);
  pointer-events:none;
  filter:blur(30px);
}

.auth-card{
  position:relative;
  width:100%;
  max-width:420px;
  padding:36px 32px 32px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.02) 0%, transparent 40%),
    var(--surface-1);
  border:1px solid var(--border);
  border-radius:var(--r-2xl);
  box-shadow:var(--shadow-lg), var(--shadow-inset);
  z-index:2;
}

.auth-brand{
  display:flex;
  align-items:center;
  gap:14px;
  margin-bottom:22px;
}
.auth-brand .brand-mark{
  width:44px;
  height:44px;
  filter:drop-shadow(0 8px 20px rgba(124,58,237,.4));
}
.auth-brand-text{ display:flex; flex-direction:column; gap:2px; line-height:1.1; }
.auth-brand-name{
  font-family:var(--font-sans);
  font-size:1.3rem;
  font-weight:800;
  letter-spacing:.04em;
}
.auth-brand-sub{
  font-size:.66rem;
  font-weight:600;
  letter-spacing:1.6px;
  text-transform:none;
  color:var(--text-3);
}

.auth-title{
  font-family:var(--font-display);
  font-size:1.7rem;
  font-weight:500;
  letter-spacing:-.02em;
  line-height:1.15;
  margin-bottom:22px;
}

.auth-steps{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom:22px;
  padding:16px 16px 16px 14px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r);
  list-style:none;
}
.auth-step{
  display:flex;
  align-items:flex-start;
  gap:12px;
  font-size:.85rem;
  color:var(--text-2);
  line-height:1.55;
}
.auth-step-num{
  flex-shrink:0;
  width:22px;
  height:22px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:.72rem;
  font-weight:700;
  color:var(--accent);
  background:var(--accent-bg);
  border:1px solid var(--border-accent);
  border-radius:var(--r-full);
  font-family:var(--font-mono);
  margin-top:1px;
}
.auth-step a{ font-weight:600; }
.auth-step code{ font-size:.82em; padding:1px 6px; }

.auth-field{
  display:block;
  margin-bottom:14px;
}
.auth-field-label{
  display:block;
  font-size:.72rem;
  font-weight:700;
  letter-spacing:1.2px;
  text-transform:none;
  color:var(--text-3);
  margin-bottom:8px;
}
.auth-input{
  display:block;
  width:100%;
  padding:14px 16px;
  text-align:center;
  font-family:var(--font-mono);
  font-variant-numeric:tabular-nums;
  font-size:1.35rem;
  font-weight:600;
  letter-spacing:8px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r);
  color:var(--text);
  transition:border-color var(--d-fast) var(--ease-out),
             background var(--d-fast) var(--ease-out),
             box-shadow var(--d-fast) var(--ease-out);
  text-indent:8px;
}
.auth-input::placeholder{
  color:var(--text-4);
  letter-spacing:8px;
  text-indent:8px;
}
.auth-input:focus{
  border-color:var(--accent);
  background:var(--surface-1);
  box-shadow:0 0 0 3px var(--accent-ring);
  outline:none;
}
.auth-input[data-error="true"]{
  border-color:var(--danger);
  box-shadow:0 0 0 3px var(--danger-ring);
}
.auth-error{
  display:none;
  align-items:center;
  gap:6px;
  margin-top:8px;
  font-size:.8rem;
  color:var(--danger);
}
.auth-error.show{ display:flex; animation:fadeInShake .3s var(--ease-out); }
.auth-error .i{ font-size:14px; }
@keyframes fadeInShake{
  0%{ opacity:0; transform:translateX(-6px); }
  30%{ transform:translateX(3px); }
  60%{ transform:translateX(-2px); }
  100%{ opacity:1; transform:translateX(0); }
}

.auth-submit{
  width:100%;
  margin-top:2px;
}

.auth-remember{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin-top:4px;
  margin-bottom:18px;
  font-size:.82rem;
  color:var(--text-3);
  cursor:pointer;
  user-select:none;
}
.auth-remember input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  width:16px;
  height:16px;
  border:1.5px solid var(--border-strong);
  background:var(--surface-2);
  border-radius:4px;
  cursor:pointer;
  position:relative;
  transition:all var(--d-fast) var(--ease-out);
  flex-shrink:0;
}
.auth-remember input[type="checkbox"]:hover{ border-color:var(--accent); }
.auth-remember input[type="checkbox"]:checked{
  background:var(--accent);
  border-color:var(--accent);
}
.auth-remember input[type="checkbox"]:checked::after{
  content:'';
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-55%) rotate(45deg);
  width:4px;
  height:8px;
  border:solid #fff;
  border-width:0 2px 2px 0;
}

@media (max-width: 520px){
  .auth-card{ padding:28px 22px; border-radius:var(--r-xl); }
  .auth-title{ font-size:1.45rem; }
  .auth-input{ font-size:1.2rem; letter-spacing:6px; padding:12px 14px; }
}

/* ═══════════════════════════════════════════════════════════
   AUTH: переключатель методов + email-режимы
   ═══════════════════════════════════════════════════════════ */
.auth-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:4px;
  padding:4px;
  margin-bottom:22px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r);
}
.auth-tab{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  font-size:.86rem;
  font-weight:600;
  color:var(--text-3);
  background:transparent;
  border:0;
  border-radius:calc(var(--r) - 4px);
  cursor:pointer;
  transition:color var(--d-fast) var(--ease-out),
             background var(--d-fast) var(--ease-out),
             box-shadow var(--d-fast) var(--ease-out);
  user-select:none;
}
.auth-tab .i{ font-size:16px; opacity:.85; }
.auth-tab:hover{ color:var(--text-2); }
.auth-tab[aria-selected="true"]{
  color:var(--text);
  background:var(--surface-1);
  box-shadow:0 1px 0 rgba(255,255,255,.04) inset, var(--shadow-xs);
}
.auth-tab[aria-selected="true"] .i{ color:var(--accent); opacity:1; }

/* Контейнер email-режимов */
.auth-mode{ display:none; }
.auth-mode.is-active{ display:block; animation:authFade .25s var(--ease-out); }
.auth-mode-pane{ display:none; }
.auth-mode-pane.is-active{ display:block; animation:authFade .2s var(--ease-out); }
@keyframes authFade{
  from{ opacity:0; transform:translateY(4px); }
  to  { opacity:1; transform:translateY(0); }
}

/* Лид (короткое описание текущего режима) */
.auth-lead{
  font-size:.88rem;
  line-height:1.55;
  color:var(--text-2);
  margin:-4px 0 18px 0;
}

/* Текстовое поле в email-форме (отличается от code-инпута: левый-выравненный, моно по необходимости) */
.auth-text{
  display:block;
  width:100%;
  padding:12px 14px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r);
  color:var(--text);
  font-size:.95rem;
  line-height:1.4;
  transition:border-color var(--d-fast) var(--ease-out),
             background var(--d-fast) var(--ease-out),
             box-shadow var(--d-fast) var(--ease-out);
}
.auth-text::placeholder{ color:var(--text-4); }
.auth-text:focus{
  border-color:var(--accent);
  background:var(--surface-1);
  box-shadow:0 0 0 3px var(--accent-ring);
  outline:none;
}
.auth-text[data-error="true"]{
  border-color:var(--danger);
  box-shadow:0 0 0 3px var(--danger-ring);
}
.auth-text[type="email"]{ font-variant:none; letter-spacing:0; }
.auth-text[type="password"]{ font-family:var(--font-sans); }

/* Поле с правой иконкой (например, toggle visibility пароля) */
.auth-field-pw{ position:relative; }
.auth-field-pw .auth-text{ padding-right:42px; }
.auth-pw-toggle{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  background:transparent;
  color:var(--text-3);
  cursor:pointer;
  border-radius:6px;
  transition:color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.auth-pw-toggle:hover{ color:var(--text); background:var(--surface-3); }
.auth-pw-toggle .i{ font-size:16px; }

/* Индикатор силы пароля */
.auth-pw-meter{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:4px;
  margin-top:8px;
}
.auth-pw-meter span{
  height:3px;
  background:var(--surface-3);
  border-radius:2px;
  transition:background var(--d-fast) var(--ease-out);
}
.auth-pw-meter[data-level="1"] span:nth-child(-n+1){ background:var(--danger); }
.auth-pw-meter[data-level="2"] span:nth-child(-n+2){ background:#f59e0b; }
.auth-pw-meter[data-level="3"] span:nth-child(-n+3){ background:#10b981; }
.auth-pw-meter[data-level="4"] span{ background:#10b981; }
.auth-pw-hint{
  font-size:.72rem;
  color:var(--text-3);
  margin-top:6px;
  line-height:1.4;
}

/* Подсказки и ссылки в email-режимах */
.auth-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:12px;
  font-size:.82rem;
  color:var(--text-3);
}
.auth-foot a, .auth-link{
  font-weight:600;
  color:var(--accent);
  cursor:pointer;
  text-decoration:none;
  transition:opacity var(--d-fast) var(--ease-out);
}
.auth-foot a:hover, .auth-link:hover{ opacity:.85; }
.auth-link{ background:transparent; border:0; padding:0; font:inherit; }

.auth-info{
  margin-top:10px;
  padding:12px 14px;
  background:var(--accent-bg);
  border:1px solid var(--border-accent);
  border-radius:var(--r);
  font-size:.82rem;
  line-height:1.55;
  color:var(--text-2);
  display:flex;
  gap:10px;
  align-items:flex-start;
}
.auth-info .i{ color:var(--accent); flex-shrink:0; margin-top:2px; }

.auth-resend{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-top:14px;
  font-size:.84rem;
  color:var(--text-3);
}
.auth-resend-timer{ font-variant-numeric:tabular-nums; color:var(--text-2); }

/* Чек-бокс (для согласия с правилами) — переиспользуем стиль auth-remember */
.auth-agree{
  display:flex;
  align-items:flex-start;
  gap:10px;
  margin:6px 0 14px 0;
  font-size:.82rem;
  color:var(--text-2);
  cursor:pointer;
  user-select:none;
  line-height:1.5;
}
.auth-agree input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  width:16px;
  height:16px;
  margin-top:2px;
  border:1.5px solid var(--border-strong);
  background:var(--surface-2);
  border-radius:4px;
  cursor:pointer;
  position:relative;
  flex-shrink:0;
  transition:all var(--d-fast) var(--ease-out);
}
.auth-agree input[type="checkbox"]:hover{ border-color:var(--accent); }
.auth-agree input[type="checkbox"]:checked{ background:var(--accent); border-color:var(--accent); }
.auth-agree input[type="checkbox"]:checked::after{
  content:'';
  position:absolute;
  top:50%; left:50%;
  transform:translate(-50%,-55%) rotate(45deg);
  width:4px; height:8px;
  border:solid #fff;
  border-width:0 2px 2px 0;
}

/* Лейбл маленький, для email-режима (отличается от auth-field-label, который uppercase + tight) */
.auth-field-tag{
  display:block;
  font-size:.78rem;
  font-weight:500;
  color:var(--text-2);
  margin-bottom:6px;
}

/* Toast-плашки для email-аккаунта на защищённых экранах */
.notice-email{
  display:flex;
  gap:12px;
  align-items:flex-start;
  padding:14px 16px;
  margin-bottom:16px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r);
}
.notice-email .notice-icon{
  width:32px;
  height:32px;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--accent-bg);
  border:1px solid var(--border-accent);
  border-radius:8px;
  color:var(--accent);
}
.notice-email .notice-body{ flex:1; min-width:0; }
.notice-email .notice-title{ font-weight:600; font-size:.92rem; color:var(--text); margin-bottom:2px; }
.notice-email .notice-desc{ font-size:.82rem; color:var(--text-3); line-height:1.55; }
.notice-email .notice-email-addr{ color:var(--text-2); font-weight:500; word-break:break-all; }

/* Заглушка раздела «недоступно для email» */
.unavailable-card{
  text-align:center;
  padding:48px 32px;
}
.unavailable-card .icon-wrap{
  width:64px;
  height:64px;
  margin:0 auto 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:50%;
  color:var(--text-3);
}
.unavailable-card .icon-wrap .i{ font-size:28px; }
.unavailable-card h3{
  font-family:var(--font-display);
  font-size:1.2rem;
  font-weight:500;
  letter-spacing:-.01em;
  margin-bottom:8px;
}
.unavailable-card p{ font-size:.88rem; line-height:1.6; color:var(--text-3); max-width:380px; margin:0 auto; }

/* ═══════════════════════════════════════════════════════════
   КНОПКИ
   ═══════════════════════════════════════════════════════════ */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  height:42px;
  padding:0 18px;
  font-family:var(--font-sans);
  font-size:.9rem;
  font-weight:700;
  line-height:1;
  border-radius:var(--r);
  border:1px solid transparent;
  cursor:pointer;
  white-space:nowrap;
  user-select:none;
  text-decoration:none;
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d-fast) var(--ease-out),
             background var(--d-fast) var(--ease-out),
             border-color var(--d-fast) var(--ease-out),
             box-shadow var(--d) var(--ease-out),
             color var(--d-fast) var(--ease-out),
             opacity var(--d-fast) var(--ease-out);
}
.btn:active{ transform:scale(.97); }
.btn[disabled]{
  opacity:.45;
  cursor:not-allowed;
  transform:none;
  box-shadow:none;
}
.btn .i{ font-size:16px; flex-shrink:0; }

.btn-primary{
  background:var(--gradient-accent);
  color:#fff;
  box-shadow:0 8px 24px rgba(217,44,104,.28), inset 0 1px 0 rgba(255,255,255,.14);
}
.btn-primary:hover:not([disabled]){
  background:var(--gradient-accent-hover);
  color:#fff;
  box-shadow:0 12px 32px rgba(217,44,104,.4), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:active:not([disabled]){ box-shadow:0 4px 14px rgba(217,44,104,.3); }

.btn-secondary{
  background:rgba(255,240,245,.06);
  border-color:var(--border);
  color:var(--text);
}
.btn-secondary:hover:not([disabled]){
  background:rgba(255,240,245,.1);
  border-color:var(--border-strong);
  color:var(--text);
}

.btn-ghost{
  background:transparent;
  color:var(--text-2);
}
.btn-ghost:hover:not([disabled]){
  background:rgba(255,240,245,.06);
  color:var(--text);
}

.btn-success{
  background:var(--success-bg);
  border-color:var(--success-ring);
  color:var(--success);
}
.btn-success:hover:not([disabled]){ background:rgba(76,217,160,.16); color:var(--success); }

.btn-danger{
  background:var(--danger-bg);
  border-color:var(--danger-ring);
  color:var(--danger);
}
.btn-danger:hover:not([disabled]){ background:rgba(255,93,93,.16); color:var(--danger); }

.btn-danger-ghost{
  background:transparent;
  color:var(--danger);
}
.btn-danger-ghost:hover:not([disabled]){ background:var(--danger-bg); color:var(--danger); }

.btn-sm{
  height:34px;
  padding:0 13px;
  font-size:.82rem;
  border-radius:var(--r-sm);
}
.btn-sm .i{ font-size:14px; }
.btn-lg{
  height:52px;
  padding:0 24px;
  font-size:.98rem;
  border-radius:var(--r-md);
}
.btn-lg .i{ font-size:18px; }
.btn-block{ width:100%; }

.btn-row{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:var(--s-4);
}

.icon-btn{
  width:38px;
  height:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--r-sm);
  background:rgba(255,240,245,.05);
  border:1px solid var(--border);
  color:var(--text-2);
  transition:background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.icon-btn:hover{ background:rgba(255,240,245,.1); color:var(--text); }
.icon-btn.icon-btn-plain{ background:transparent; border-color:transparent; }
.icon-btn.icon-btn-plain:hover{ background:rgba(255,240,245,.06); }
.icon-btn .i{ font-size:17px; }

.copy-btn{
  width:32px;
  height:32px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--r-xs);
  color:var(--text-3);
  transition:color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.copy-btn:hover{ color:var(--text); background:rgba(255,240,245,.06); }
.copy-btn .i{ font-size:15px; }
.copy-btn[data-copied="true"]{ color:var(--success); }

.copy-inline{
  display:flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.copy-value{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  padding:6px 10px;
  border-radius:var(--r-xs);
  background:rgba(255,240,245,.05);
  border:1px dashed var(--border-strong);
  color:var(--text);
  font-size:.86rem;
  font-weight:600;
  cursor:pointer;
  transition:border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.copy-value:hover{ border-color:var(--border-accent); background:var(--accent-bg-2); }

/* ═══════════════════════════════════════════════════════════
   ИНПУТЫ
   ═══════════════════════════════════════════════════════════ */
.input{
  display:block;
  width:100%;
  padding:11px 14px;
  min-height:42px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  color:var(--text);
  font-family:var(--font-sans);
  font-size:.88rem;
  line-height:1.4;
  transition:border-color var(--d-fast) var(--ease-out),
             background var(--d-fast) var(--ease-out),
             box-shadow var(--d-fast) var(--ease-out);
}
.input::placeholder{ color:var(--text-4); }
.input:focus{
  border-color:var(--accent);
  background:var(--surface-1);
  box-shadow:0 0 0 3px var(--accent-ring);
  outline:none;
}
.input:disabled{ opacity:.5; cursor:not-allowed; }

.input[type="number"]{ -moz-appearance:textfield; appearance:textfield; }
.input[type="number"]::-webkit-outer-spin-button,
.input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance:none;
  margin:0;
}

/* Поле с иконкой внутри */
.input-wrap{
  position:relative;
}
.input-wrap .input{ padding-left:40px; }
.input-wrap .input-icon{
  position:absolute;
  left:13px;
  top:50%;
  transform:translateY(-50%);
  color:var(--text-3);
  pointer-events:none;
  font-size:16px;
}
.input-wrap .input:focus ~ .input-icon{ color:var(--accent); }

.field{
  display:flex;
  flex-direction:column;
  gap:8px;
  margin-bottom:var(--s-3);
}
.field-label{
  font-size:.72rem;
  font-weight:700;
  letter-spacing:1.2px;
  text-transform:none;
  color:var(--text-3);
}
.field-hint{
  font-size:.78rem;
  color:var(--text-3);
  line-height:1.5;
}
.field-error{
  display:none;
  align-items:center;
  gap:6px;
  font-size:.78rem;
  color:var(--danger);
  margin-top:-2px;
}
.field-error.show{ display:flex; animation:fadeInShake .3s var(--ease-out); }
.field-error .i{ font-size:14px; }
.field[data-error="true"] .input{
  border-color:var(--danger);
  box-shadow:0 0 0 3px var(--danger-ring);
}
.field[data-error="true"] .field-error{ display:flex; }

/* Row из нескольких полей */
.field-row{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px, 1fr));
  gap:var(--s-3);
}

/* Чекбокс с лейблом */
.checkbox{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-size:.84rem;
  color:var(--text-2);
  cursor:pointer;
  user-select:none;
}
.checkbox input[type="checkbox"]{
  appearance:none;
  -webkit-appearance:none;
  width:16px;
  height:16px;
  border:1.5px solid var(--border-strong);
  background:var(--surface-2);
  border-radius:4px;
  cursor:pointer;
  position:relative;
  transition:all var(--d-fast) var(--ease-out);
  flex-shrink:0;
}
.checkbox input[type="checkbox"]:hover{ border-color:var(--accent); }
.checkbox input[type="checkbox"]:checked{
  background:var(--accent);
  border-color:var(--accent);
}
.checkbox input[type="checkbox"]:checked::after{
  content:'';
  position:absolute;
  top:50%;
  left:50%;
  transform:translate(-50%,-55%) rotate(45deg);
  width:4px;
  height:8px;
  border:solid #fff;
  border-width:0 2px 2px 0;
}

/* ═══════════════════════════════════════════════════════════
   КАРТОЧКИ
   ═══════════════════════════════════════════════════════════ */
.card{
  position:relative;
  background:var(--gradient-surface), var(--surface-1);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  padding:20px 22px;
  box-shadow:var(--shadow-inset);
}
.card + .card{ margin-top:var(--s-4); }
.card:last-child{ margin-bottom:0; }
.card-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--s-3);
  margin-bottom:var(--s-3);
}
.card-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:1rem;
  font-weight:750;
  color:var(--text);
}
.card-title .i{ font-size:18px; color:var(--accent); }
.card-subtitle{
  font-size:.86rem;
  color:var(--text-3);
  margin-top:2px;
}
.card-body{ color:var(--text-2); font-size:.9rem; }
.card-actions{ display:flex; flex-wrap:wrap; gap:10px; margin-top:var(--s-4); }
.card-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:var(--s-4);
  padding:11px 0;
  border-bottom:1px solid var(--border-subtle);
  font-size:.9rem;
}
.card-row:last-child{ border-bottom:none; padding-bottom:0; }
.card-row:first-child{ padding-top:4px; }
.card-label{ color:var(--text-3); flex-shrink:0; }
.card-value{
  color:var(--text);
  font-weight:650;
  text-align:right;
  min-width:0;
  overflow-wrap:anywhere;
}
.card-value.accent{ color:var(--accent); }
.card-value.success{ color:var(--success); }
.card-value.danger{ color:var(--danger); }
.card-value.muted{ color:var(--text-3); font-weight:500; }
.card-divider{
  height:1px;
  background:var(--border-subtle);
  margin:var(--s-4) 0;
}

/* ═══════════════════════════════════════════════════════════
   STAT КАРТОЧКИ
   Цвет несёт смысл: деньги — шампань, остальное — спокойно.
   ═══════════════════════════════════════════════════════════ */
.stats-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:var(--s-3);
  margin-bottom:var(--s-4);
}
.stat-card{
  position:relative;
  padding:18px 18px 16px;
  background:var(--gradient-surface), var(--surface-1);
  border:1px solid var(--border);
  border-radius:var(--r-lg);
  overflow:hidden;
}
.stat-card.accent{
  background:var(--gradient-champagne), var(--surface-1);
  border-color:rgba(242,211,166,.16);
}
.stat-label{
  display:flex;
  align-items:center;
  gap:8px;
  font-size:.82rem;
  font-weight:600;
  color:var(--text-3);
  margin-bottom:8px;
}
.stat-label .i{ font-size:15px; color:var(--text-3); }
.stat-card.accent .stat-label .i{ color:var(--champagne); }
.stat-value{
  display:flex;
  align-items:baseline;
  gap:6px;
  font-size:1.75rem;
  font-weight:800;
  letter-spacing:-.02em;
  line-height:1.1;
  font-variant-numeric:tabular-nums;
}
.stat-card.accent .stat-value{ color:var(--champagne); }
.stat-value small{
  font-size:.8rem;
  font-weight:600;
  color:var(--text-3);
  letter-spacing:0;
}
.stat-sub{
  font-size:.8rem;
  color:var(--text-3);
  margin-top:6px;
}
.stat-sub b{ color:var(--text-2); }
.stat-delta{ font-size:.78rem; font-weight:700; }
.stat-delta.up{ color:var(--success); }
.stat-delta.down{ color:var(--danger); }

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */
.toast-stack{
  position:fixed;
  top:max(16px, env(safe-area-inset-top));
  right:16px;
  z-index:var(--z-toast);
  display:flex;
  flex-direction:column;
  gap:8px;
  pointer-events:none;
  max-width:min(400px, calc(100vw - 32px));
}
.toast{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px 14px;
  background:var(--surface-2);
  border:1px solid var(--border-strong);
  border-radius:var(--r);
  box-shadow:var(--shadow-lg), var(--shadow-inset);
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
  color:var(--text);
  font-size:.85rem;
  font-weight:500;
  line-height:1.45;
  pointer-events:auto;
  animation:toastIn .3s var(--ease-back);
  transition:opacity .25s var(--ease-out), transform .25s var(--ease-out);
  position:relative;
  overflow:hidden;
}
.toast::before{
  content:'';
  position:absolute;
  top:0; left:0;
  width:3px;
  height:100%;
  background:var(--text-3);
}
.toast-success::before{ background:var(--success); }
.toast-error::before{ background:var(--danger); }
.toast-info::before{ background:var(--info); }
.toast-icon{
  flex-shrink:0;
  width:20px;
  height:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--r-full);
  margin-top:1px;
}
.toast-icon .i{ font-size:14px; }
.toast-success .toast-icon{ color:var(--success); background:var(--success-bg); }
.toast-error   .toast-icon{ color:var(--danger);  background:var(--danger-bg); }
.toast-info    .toast-icon{ color:var(--info);    background:var(--info-bg); }
.toast-body{ flex:1; min-width:0; word-wrap:break-word; }
.toast-leave{ opacity:0; transform:translateX(10px); }
@keyframes toastIn{
  from{ opacity:0; transform:translateX(40px); }
  to{ opacity:1; transform:translateX(0); }
}
@media (max-width: 600px){
  .toast-stack{ top:max(12px, env(safe-area-inset-top)); right:12px; left:12px; max-width:none; }
}

/* ═══════════════════════════════════════════════════════════
   SKELETON
   ═══════════════════════════════════════════════════════════ */
.skel{
  background:linear-gradient(
    90deg,
    rgba(255,255,255,.03) 0%,
    rgba(255,255,255,.08) 50%,
    rgba(255,255,255,.03) 100%
  );
  background-size:200% 100%;
  animation:skelSweep 1.6s var(--ease-in-out) infinite;
  border-radius:var(--r-sm);
}
@keyframes skelSweep{
  0%  { background-position:  200% 0; }
  100%{ background-position: -200% 0; }
}

.skel-line{ height:14px; border-radius:4px; margin-bottom:8px; }
.skel-line.lg{ height:20px; }
.skel-line.sm{ height:10px; }
.skel-title{ height:28px; width:40%; margin-bottom:16px; border-radius:6px; }
.skel-block{ height:80px; border-radius:var(--r); margin-bottom:12px; }
.skel-card{
  padding:22px;
  border-radius:var(--r-lg);
  border:1px solid var(--border);
  background:var(--surface-1);
  margin-bottom:var(--s-4);
}
.skel-tile{ aspect-ratio:9/16; border-radius:var(--r-md); }
.skel-stat{
  height:96px;
  border-radius:var(--r-md);
  border:1px solid var(--border);
  background:var(--surface-1);
  padding:18px 20px;
  display:flex;
  flex-direction:column;
  gap:12px;
  justify-content:flex-start;
}
.skel-stat::before, .skel-stat::after{ content:''; display:block; }
.skel-stat::before{
  width:60%; height:10px; border-radius:4px;
  background:rgba(255,255,255,.05);
}
.skel-stat::after{
  width:70%; height:22px; border-radius:6px;
  background:linear-gradient(90deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 100%);
  background-size:200% 100%;
  animation:skelSweep 1.6s var(--ease-in-out) infinite;
}

.skel-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:var(--s-3);
  margin-bottom:var(--s-5);
}

/* ═══════════════════════════════════════════════════════════
   ПУСТЫЕ СОСТОЯНИЯ / ОШИБКИ
   ═══════════════════════════════════════════════════════════ */
.empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:56px 24px;
  gap:14px;
  max-width:460px;
  margin:0 auto;
}
.empty-icon{
  width:56px;
  height:56px;
  border-radius:var(--r-full);
  background:var(--surface-2);
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text-3);
  margin-bottom:2px;
}
.empty-icon .i{ font-size:24px; }
.empty-icon.danger{ color:var(--danger); background:var(--danger-bg); border-color:var(--danger-ring); }
.empty-icon.warning{ color:var(--warning); background:var(--warning-bg); }

.empty-title{
  font-family:var(--font-display);
  font-size:1.1rem;
  font-weight:500;
  color:var(--text);
  letter-spacing:-.01em;
}
.empty-text{
  font-size:.85rem;
  color:var(--text-2);
  line-height:1.6;
  max-width:380px;
}
.empty-action{ margin-top:8px; }

/* Спиннер */
.spinner{
  width:24px;
  height:24px;
  border:2.5px solid var(--border-strong);
  border-top-color:var(--accent);
  border-radius:50%;
  animation:spin .8s linear infinite;
  flex-shrink:0;
}
.spinner-lg{ width:44px; height:44px; border-width:3px; }
.spinner-sm{ width:16px; height:16px; border-width:2px; }
@keyframes spin{ to{ transform:rotate(360deg); } }

.loading-page{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  padding:80px 20px;
  color:var(--text-3);
  font-size:.85rem;
}

/* ═══════════════════════════════════════════════════════════
   SWITCH (toggle)
   ═══════════════════════════════════════════════════════════ */
.switch{
  position:relative;
  display:inline-block;
  width:40px;
  height:22px;
  flex-shrink:0;
}
.switch input{ opacity:0; width:0; height:0; }
.switch-slider{
  position:absolute;
  inset:0;
  background:var(--surface-3);
  border:1px solid var(--border-strong);
  border-radius:var(--r-full);
  cursor:pointer;
  transition:background var(--d-fast) var(--ease-out), border-color var(--d-fast) var(--ease-out);
}
.switch-slider::before{
  content:'';
  position:absolute;
  top:2px;
  left:2px;
  width:16px;
  height:16px;
  background:var(--text-2);
  border-radius:50%;
  transition:transform var(--d) var(--ease-back), background var(--d-fast) var(--ease-out);
}
.switch input:checked + .switch-slider{
  background:var(--accent);
  border-color:var(--accent);
}
.switch input:checked + .switch-slider::before{
  transform:translateX(18px);
  background:#fff;
}

/* ═══════════════════════════════════════════════════════════
   БЭЙДЖИ И ПЛАШКИ
   ═══════════════════════════════════════════════════════════ */
.badge{
  display:inline-flex;
  align-items:center;
  gap:5px;
  height:24px;
  padding:0 10px;
  border-radius:var(--r-full);
  font-size:.76rem;
  font-weight:700;
  background:rgba(255,240,245,.07);
  border:1px solid var(--border);
  color:var(--text-2);
  white-space:nowrap;
  vertical-align:middle;
}
.badge.accent{ background:var(--accent-bg); border-color:var(--accent-ring); color:var(--accent); }
.badge.success{ background:var(--success-bg); border-color:var(--success-ring); color:var(--success); }
.badge.danger{ background:var(--danger-bg); border-color:var(--danger-ring); color:var(--danger); }
.badge.warning{ background:var(--warning-bg); border-color:rgba(255,193,94,.3); color:var(--warning); }
.badge.champagne{ background:var(--champagne-bg); border-color:var(--champagne-ring); color:var(--champagne); }
.badge .i{ font-size:13px; }

.notice{
  display:flex;
  align-items:flex-start;
  gap:12px;
  padding:13px 16px;
  border-radius:var(--r);
  background:rgba(255,240,245,.035);
  border:1px solid var(--border);
  color:var(--text-2);
  font-size:.88rem;
  line-height:1.5;
}
.notice b{ color:var(--text); font-weight:650; }
.notice-icon{
  width:28px;
  height:28px;
  flex-shrink:0;
  border-radius:var(--r-xs);
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--accent-bg);
  color:var(--accent);
}
.notice-icon .i{ font-size:15px; }
.notice.warning{ background:var(--warning-bg); border-color:rgba(255,193,94,.22); }
.notice.warning .notice-icon{ background:rgba(255,193,94,.14); color:var(--warning); }
.notice.danger{ background:var(--danger-bg); border-color:var(--danger-ring); }
.notice.danger .notice-icon{ background:rgba(255,93,93,.14); color:var(--danger); }
.notice.champagne{ background:var(--gradient-champagne); border-color:var(--champagne-ring); color:var(--text); }
.notice.champagne .notice-icon{ background:rgba(242,211,166,.16); color:var(--champagne); }

/* ═══════════════════════════════════════════════════════════
   ГЕНЕРАЦИЯ ВИДЕО — СЕТКА ШАБЛОНОВ
   Карточка — как кадр: превью на всю площадь, название поверх,
   длительность и цена — плашками в углах.
   ═══════════════════════════════════════════════════════════ */
.tpl-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(178px, 1fr));
  gap:16px;
}
.tpl-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-bottom:var(--s-5);
}
.tpl-search{ width:260px; max-width:100%; }

.tpl-card{
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:3 / 4;
  padding:0;
  border-radius:var(--r-lg);
  overflow:hidden;
  background:var(--surface-2);
  border:1px solid var(--border-subtle);
  box-shadow:var(--shadow-sm);
  text-align:left;
  color:var(--text);
  isolation:isolate;
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d) var(--ease), box-shadow var(--d) var(--ease), border-color var(--d) var(--ease);
}
.tpl-card::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(10,6,8,.45) 0%, transparent 26%, transparent 52%, rgba(10,6,8,.9) 100%);
}
.tpl-card:hover{
  transform:translateY(-3px);
  border-color:var(--border-accent);
  box-shadow:var(--shadow), 0 0 0 1px rgba(255,92,147,.18);
}
.tpl-card:active{ transform:scale(.985); }
.tpl-preview{
  position:absolute;
  inset:0;
  background:
    radial-gradient(120% 80% at 20% 10%, rgba(255,92,147,.22), transparent 60%),
    linear-gradient(160deg, #2A1822 0%, #140C11 100%);
}
.tpl-preview img,
.tpl-preview video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform var(--d-slow) var(--ease);
}
.tpl-card:hover .tpl-preview img,
.tpl-card:hover .tpl-preview video{ transform:scale(1.04); }
.tpl-placeholder{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  color:var(--text-4);
}
.tpl-placeholder .i{ font-size:34px; }
.tpl-placeholder-text{ font-size:.78rem; font-weight:600; }
.tpl-play-hint{
  position:absolute;
  top:50%;
  left:50%;
  z-index:2;
  width:44px;
  height:44px;
  margin:-22px 0 0 -22px;
  border-radius:var(--r-full);
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,10,13,.5);
  border:1px solid rgba(255,240,245,.2);
  color:#fff;
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  opacity:0;
  transform:scale(.9);
  transition:opacity var(--d) var(--ease), transform var(--d) var(--ease);
  pointer-events:none;
}
.tpl-play-hint .i{ font-size:18px; margin-left:2px; }
.tpl-card:hover .tpl-play-hint{ opacity:1; transform:none; }
.tpl-card[data-state="playing"] .tpl-play-hint,
.tpl-card[data-video-failed="true"] .tpl-play-hint{ opacity:0; }

.tpl-top{
  position:absolute;
  top:10px;
  left:10px;
  right:10px;
  z-index:2;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:6px;
}
.tpl-meta{
  position:absolute;
  left:12px;
  right:12px;
  bottom:12px;
  z-index:2;
}
.tpl-name{
  font-size:.95rem;
  font-weight:750;
  line-height:1.25;
  text-shadow:0 1px 14px rgba(0,0,0,.65);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.tpl-price{
  font-size:.8rem;
  color:rgba(246,237,239,.8);
  margin-top:2px;
}
.tpl-price .unit{ margin-left:4px; }

/* Плашки поверх медиа (длительность, цена, «хит»). */
.chip{
  display:inline-flex;
  align-items:center;
  gap:5px;
  height:24px;
  padding:0 9px;
  border-radius:var(--r-full);
  font-size:.74rem;
  font-weight:750;
  line-height:1;
  white-space:nowrap;
  color:#fff;
  background:rgba(15,10,13,.58);
  border:1px solid rgba(255,240,245,.14);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  font-variant-numeric:tabular-nums;
}
.chip .i{ font-size:12px; }
.chip s{ opacity:.6; font-weight:550; }
.chip-accent{ background:rgba(217,44,104,.88); border-color:transparent; }
.chip-champ{ background:rgba(40,28,20,.7); border-color:rgba(242,211,166,.35); color:var(--champagne); }
.chip-success{ background:rgba(20,50,40,.75); border-color:rgba(76,217,160,.35); color:var(--success); }
.chip-danger{ background:rgba(60,20,24,.75); border-color:rgba(255,93,93,.35); color:#FF9A9A; }

/* Сегментный переключатель (фильтры, «изображение/видео»). */
.seg{
  display:inline-flex;
  align-items:center;
  gap:2px;
  padding:3px;
  border-radius:var(--r-full);
  background:rgba(255,240,245,.05);
  border:1px solid var(--border);
  max-width:100%;
  overflow-x:auto;
  scrollbar-width:none;
}
.seg::-webkit-scrollbar{ display:none; }
.seg-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  height:34px;
  padding:0 15px;
  border-radius:var(--r-full);
  font-size:.86rem;
  font-weight:650;
  color:var(--text-2);
  white-space:nowrap;
  -webkit-tap-highlight-color:transparent;
  transition:background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.seg-btn .i{ font-size:15px; }
.seg-btn:hover{ color:var(--text); }
.seg-btn.active{
  background:var(--surface-4);
  color:var(--text);
  box-shadow:0 1px 0 rgba(255,240,245,.06) inset, 0 4px 12px rgba(0,0,0,.3);
}

/* Строка подсказки над каталогом. */
.hint-line{
  display:flex;
  align-items:center;
  gap:10px;
  color:var(--text-2);
  font-size:.86rem;
  margin-bottom:var(--s-5);
}
.hint-line .i{ font-size:16px; color:var(--champagne); flex-shrink:0; }
.hint-line b{ color:var(--text); font-weight:650; }

/* ═══════════════════════════════════════════════════════════
   ГЕНЕРАЦИЯ ФОТО — РЕЖИМЫ
   ═══════════════════════════════════════════════════════════ */
.ig-modes{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(240px, 1fr));
  gap:16px;
}
.ig-mode-card{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  min-height:220px;
  padding:18px;
  border-radius:var(--r-xl);
  overflow:hidden;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255,92,147,.2), transparent 60%),
    linear-gradient(160deg, #26161F 0%, #150D12 100%);
  border:1px solid var(--border);
  text-align:left;
  color:var(--text);
  isolation:isolate;
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d) var(--ease), border-color var(--d) var(--ease), box-shadow var(--d) var(--ease);
}
.ig-mode-card:hover{
  transform:translateY(-3px);
  border-color:var(--border-accent);
  box-shadow:var(--shadow);
}
.ig-mode-card:active{ transform:scale(.985); }
.ig-mode-card[data-has-preview="true"]{ min-height:280px; }
.ig-mode-preview{
  position:absolute;
  inset:0;
  z-index:-2;
}
.ig-mode-preview img,
.ig-mode-preview video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform var(--d-slow) var(--ease);
}
.ig-mode-card[data-has-preview="true"]::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(180deg, rgba(10,6,8,.2) 0%, rgba(10,6,8,.35) 40%, rgba(10,6,8,.92) 100%);
}
.ig-mode-card[data-has-preview="true"]:hover .ig-mode-preview img,
.ig-mode-card[data-has-preview="true"]:hover .ig-mode-preview video{ transform:scale(1.04); }
.ig-mode-head{ display:flex; align-items:center; gap:12px; margin-bottom:10px; }
.ig-mode-content{ display:flex; flex-direction:column; height:100%; justify-content:space-between; gap:12px; }
.ig-mode-card[data-has-preview="true"] .ig-mode-content{ position:absolute; inset:18px; }
.ig-mode-icon{
  width:42px;
  height:42px;
  border-radius:var(--r);
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,10,13,.55);
  border:1px solid rgba(255,240,245,.14);
  color:var(--accent);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  flex-shrink:0;
}
.ig-mode-icon .i{ font-size:20px; }
.ig-mode-body{ min-width:0; }
.ig-mode-name{
  font-family:var(--font-display);
  font-size:1.35rem;
  font-weight:600;
  line-height:1.2;
}
.ig-mode-desc{
  font-size:.86rem;
  color:var(--text-2);
  margin-top:4px;
  line-height:1.45;
}
.ig-mode-price{
  display:inline-flex;
  align-items:baseline;
  gap:5px;
  margin-top:8px;
  font-size:1rem;
  font-weight:800;
  color:var(--champagne);
  font-variant-numeric:tabular-nums;
}
.ig-mode-price .unit{ font-size:.78rem; font-weight:600; color:var(--text-3); }
.ig-mode-price s{ color:var(--text-3); font-weight:600; margin-right:4px; }
.ig-mode-bottom{ margin-top:auto; }

/* ═══════════════════════════════════════════════════════════
   ГЕНЕРАЦИЯ ФОТО — ПОШАГОВЫЕ ЭКРАНЫ (внутри модалки)
   ═══════════════════════════════════════════════════════════ */
.step-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.step-back{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 12px 7px 10px;
  font-size:.78rem;
  font-weight:500;
  color:var(--text-2);
  background:transparent;
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  cursor:pointer;
  transition:all var(--d-fast) var(--ease-out);
}
.step-back:hover{
  color:var(--text);
  background:var(--surface-2);
  border-color:var(--border-strong);
}
.step-back .i{ font-size:14px; }

.step-indicator{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-size:.75rem;
  color:var(--text-3);
  font-family:var(--font-mono);
  font-variant-numeric:tabular-nums;
}
.step-indicator-dots{ display:flex; gap:4px; }
.step-dot{
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--border-strong);
  transition:background var(--d-fast) var(--ease-out);
}
.step-dot.active{ background:var(--accent); }
.step-dot.done{ background:var(--success); }

.step-title{
  font-family:var(--font-display);
  font-size:1.1rem;
  font-weight:500;
  color:var(--text);
  margin-bottom:14px;
  letter-spacing:-.005em;
}
/* Подзаголовок шага: выводится сразу после .step-title и приглушает контраст,
   чтобы основной заголовок оставался ведущим в иерархии. Уменьшает межстрочный
   margin у заголовка (через `+`-селектор), чтобы пара читалась как единый блок. */
.step-title + .step-subtitle{ margin-top:-10px; }
.step-subtitle{
  font-size:.84rem;
  line-height:1.5;
  color:var(--text-3);
  margin-bottom:14px;
}

.ig-param-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(115px, 1fr));
  gap:8px;
  margin-bottom:14px;
}
.ig-param-btn{
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  padding:12px 14px;
  text-align:center;
  cursor:pointer;
  font-size:.82rem;
  font-weight:500;
  color:var(--text);
  font-family:var(--font-sans);
  width:100%;
  -webkit-tap-highlight-color:transparent;
  transition:border-color var(--d-fast) var(--ease-out),
             color var(--d-fast) var(--ease-out),
             background var(--d-fast) var(--ease-out);
}
.ig-param-btn:hover{
  border-color:var(--border-accent);
  color:var(--accent);
  background:var(--accent-bg-2);
}
.ig-param-btn.active{
  background:var(--accent-bg);
  border-color:var(--accent);
  color:var(--accent);
  font-weight:600;
}

.ig-list{
  display:grid;
  grid-template-columns:repeat(2, 1fr);
  gap:8px;
  max-height:360px;
  overflow-y:auto;
  padding-right:4px;
  margin-bottom:12px;
}
.ig-list-item{
  display:flex;
  align-items:center;
  gap:10px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  padding:11px 12px;
  cursor:pointer;
  font-size:.82rem;
  font-weight:500;
  color:var(--text);
  font-family:var(--font-sans);
  width:100%;
  text-align:left;
  -webkit-tap-highlight-color:transparent;
  transition:border-color var(--d-fast) var(--ease-out),
             color var(--d-fast) var(--ease-out),
             background var(--d-fast) var(--ease-out);
}
.ig-list-item:hover{
  border-color:var(--border-accent);
  color:var(--accent);
  background:var(--accent-bg-2);
}
.ig-list-item .i{ font-size:16px; color:var(--text-3); flex-shrink:0; }
.ig-list-item:hover .i{ color:var(--accent); }
.ig-list-item-text{
  flex:1;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

@media (max-width: 520px){
  .ig-list{ grid-template-columns:1fr; max-height:none; }
  .ig-param-grid{ grid-template-columns:repeat(3, 1fr); }
}

/* ═══════════════════════════════════════════════════════════
   ВЫБОР: ПОЗА / КОЛЛЕКЦИЯ / МОДЕЛЬ — СЕТКА КАРТОЧЕК С ПРЕВЬЮ
   Тот же язык, что у шаблонов видео: кадр, название поверх.
   ═══════════════════════════════════════════════════════════ */
.ig-pick-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(160px, 1fr));
  gap:14px;
}
.ig-pick-card{
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:3 / 4;
  padding:0;
  border-radius:var(--r-lg);
  overflow:hidden;
  background:var(--surface-2);
  border:1px solid var(--border-subtle);
  box-shadow:var(--shadow-sm);
  text-align:left;
  color:var(--text);
  isolation:isolate;
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d) var(--ease), box-shadow var(--d) var(--ease), border-color var(--d) var(--ease), opacity var(--d-fast);
}
.ig-pick-card::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(10,6,8,.4) 0%, transparent 24%, transparent 55%, rgba(10,6,8,.9) 100%);
}
.ig-pick-card:hover{
  transform:translateY(-3px);
  border-color:var(--border-accent);
  box-shadow:var(--shadow), 0 0 0 1px rgba(255,92,147,.18);
}
.ig-pick-card:hover .ig-pick-thumb img,
.ig-pick-card:hover .ig-pick-thumb video{ transform:scale(1.04); }
.ig-pick-card:active{ transform:scale(.985); }
.ig-pick-card.is-loading{ opacity:.6; pointer-events:none; }
.ig-pick-card:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }
.ig-pick-thumb{
  position:absolute;
  inset:0;
  background:
    radial-gradient(120% 80% at 20% 10%, rgba(255,92,147,.2), transparent 60%),
    linear-gradient(160deg, #2A1822 0%, #140C11 100%);
}
.ig-pick-thumb img,
.ig-pick-thumb video{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform var(--d-slow) var(--ease);
}
.ig-pick-thumb-empty{
  position:absolute;
  inset:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  color:var(--text-4);
}
.ig-pick-thumb-empty .i{ font-size:32px; }
.ig-pick-thumb-empty-text{ display:none; }

/* Список сюжетов — когда у раздела ещё нет превью.
   Плитки без картинок выглядели бы как сломанная галерея: четырнадцать
   одинаковых пустых прямоугольников. Строка честнее и читается быстрее.
   Как только превью появятся, раздел сам переключится на плитки. */
.snd-list{ display:flex; flex-direction:column; gap:10px; }
.snd-row{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:12px 14px;
  border-radius:var(--r-lg);
  background:var(--surface-2);
  border:1px solid var(--border-subtle);
  box-shadow:var(--shadow-sm);
  text-align:left;
  color:var(--text);
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d) var(--ease), box-shadow var(--d) var(--ease), border-color var(--d) var(--ease);
}
.snd-row:hover{ transform:translateY(-2px); border-color:var(--border-accent); box-shadow:var(--shadow); }
.snd-row:active{ transform:scale(.99); }
.snd-row.is-loading{ opacity:.6; pointer-events:none; }
.snd-row-icon{
  flex:none;
  width:42px;
  height:42px;
  border-radius:13px;
  display:grid;
  place-items:center;
  color:var(--accent);
  background:
    radial-gradient(120% 90% at 25% 15%, rgba(255,92,147,.22), transparent 62%),
    linear-gradient(160deg, #2A1822 0%, #140C11 100%);
}
.snd-row-main{ display:block; flex:1; min-width:0; }
.snd-row-name{ display:block; font-size:.92rem; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.snd-row-sub{ display:block; font-size:.78rem; color:var(--text-3); margin-top:2px; }
.snd-row-price{ flex:none; font-size:.92rem; font-weight:700; white-space:nowrap; }
.snd-row-price s{ color:var(--text-3); font-weight:500; margin-right:6px; }

/* Ряды выбора длительности и качества. Обычный btn-row переносил
   последнюю кнопку на отдельную строку — сетка держит их в один ряд
   на любой ширине. */
.snd-opts{ display:grid; gap:8px; }
.snd-opts-5{ grid-template-columns:repeat(5, minmax(0, 1fr)); }
.snd-opts-4{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
.snd-opts-3{ grid-template-columns:repeat(3, minmax(0, 1fr)); }
.snd-opts-2{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
.snd-opts-1{ grid-template-columns:minmax(0, 1fr); }
.snd-opts .btn{ padding-left:4px; padding-right:4px; font-size:.82rem; white-space:nowrap; }

/* Переключатель двух входов в раздел: всегда в один ряд, поровну. */
.snd-tabs{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:10px; }
.snd-tabs .btn{ padding-left:8px; padding-right:8px; }

/* Готовые наряды: две ровные колонки вместо рваного переноса. */
.ig-cl-presets{ display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
.ig-cl-presets .btn{
  padding:10px 10px;
  font-size:.84rem;
  justify-content:flex-start;
  text-align:left;
  /* Длинные названия переносим, а не выпускаем за край кнопки. */
  white-space:normal;
  line-height:1.25;
  min-height:46px;
}
.ig-pick-top{
  position:absolute;
  top:10px;
  left:10px;
  right:10px;
  z-index:2;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:6px;
}
.ig-pick-name{
  position:absolute;
  left:12px;
  right:12px;
  bottom:12px;
  z-index:2;
  font-size:.92rem;
  font-weight:750;
  line-height:1.25;
  text-shadow:0 1px 14px rgba(0,0,0,.65);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.ig-pick-card[data-empty="true"]::after{ background:linear-gradient(180deg, transparent 50%, rgba(10,6,8,.6) 100%); }

/* ═══════════════════════════════════════════════════════════
   DEPOSIT — СУММЫ И МЕТОДЫ
   Базовые элементы выбора (используются и на странице баланса,
   и в выводе средств партнёра).
   ═══════════════════════════════════════════════════════════ */
.balance-hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:22px 24px;
  border-radius:var(--r-xl);
  background:var(--gradient-champagne), var(--surface-1);
  border:1px solid rgba(242,211,166,.16);
  margin-bottom:var(--s-4);
}
.balance-hero-label{ font-size:.85rem; color:var(--text-3); font-weight:600; }
.balance-hero-value{
  display:flex;
  align-items:baseline;
  gap:8px;
  font-size:2.3rem;
  font-weight:800;
  letter-spacing:-.02em;
  color:var(--champagne);
  font-variant-numeric:tabular-nums;
}
.balance-hero-value small{ font-size:.9rem; font-weight:600; color:var(--text-3); letter-spacing:0; }
.balance-hero-icon{
  width:52px; height:52px;
  border-radius:var(--r-md);
  display:flex; align-items:center; justify-content:center;
  background:rgba(242,211,166,.12);
  color:var(--champagne);
}
.balance-hero-icon .i{ font-size:24px; }

.preset-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(96px, 1fr));
  gap:8px;
  margin-bottom:var(--s-4);
}
.preset-btn{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:2px;
  min-height:58px;
  padding:8px 6px;
  border-radius:var(--r);
  background:rgba(255,240,245,.04);
  border:1px solid var(--border);
  color:var(--text);
  font-size:1.05rem;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  -webkit-tap-highlight-color:transparent;
  transition:border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-out);
}
.preset-btn:hover{ border-color:var(--border-strong); background:rgba(255,240,245,.07); }
.preset-btn:active{ transform:scale(.97); }
.preset-btn.active{
  border-color:var(--accent);
  background:var(--accent-bg);
  box-shadow:0 0 0 3px var(--accent-ring);
}
.preset-unit{ font-size:.72rem; font-weight:600; color:var(--text-3); }
.preset-bonus{
  position:absolute;
  top:-8px;
  right:-6px;
  height:18px;
  padding:0 6px;
  border-radius:var(--r-full);
  background:var(--champagne);
  color:#2A1A10;
  font-size:.64rem;
  font-weight:800;
  display:inline-flex;
  align-items:center;
}

.methods-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(150px, 1fr));
  gap:8px;
  margin-bottom:var(--s-4);
}
.method-btn{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:50px;
  padding:10px 14px;
  border-radius:var(--r);
  background:rgba(255,240,245,.04);
  border:1px solid var(--border);
  color:var(--text);
  font-size:.9rem;
  font-weight:650;
  text-align:left;
  -webkit-tap-highlight-color:transparent;
  transition:border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.method-btn:hover{ border-color:var(--border-strong); background:rgba(255,240,245,.07); }
.method-btn.active{ border-color:var(--accent); background:var(--accent-bg); box-shadow:0 0 0 3px var(--accent-ring); }
.method-btn .i{ font-size:18px; color:var(--text-3); flex-shrink:0; }
.method-btn:hover .i,
.method-btn.active .i{ color:var(--accent); }

.bonus-info{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  padding:12px 14px;
  border-radius:var(--r);
  background:var(--gradient-champagne);
  border:1px solid var(--champagne-ring);
  color:var(--text);
  font-size:.9rem;
  animation:fadeIn var(--d) var(--ease-out);
}
.bonus-info .i{ font-size:17px; color:var(--champagne); }
.bonus-info .num{ color:var(--champagne); }
.bonus-info-total{ margin-left:auto; color:var(--text-2); }
.bonus-info-total b{ color:var(--text); }
.bonus-info.leaving{ opacity:0; transition:opacity 200ms var(--ease-out); }

/* ═══════════════════════════════════════════════════════════
   FAQ / INFO
   ═══════════════════════════════════════════════════════════ */
.faq{
  display:flex;
  flex-direction:column;
  gap:2px;
}
.faq-item{
  border-bottom:1px solid var(--border-subtle);
}
.faq-item:last-child{ border-bottom:none; }
.faq-q{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 0;
  font-size:.9rem;
  font-weight:600;
  color:var(--text);
  cursor:pointer;
  line-height:1.45;
  user-select:none;
  background:transparent;
  border:none;
  text-align:left;
  width:100%;
  transition:color var(--d-fast) var(--ease-out);
  -webkit-tap-highlight-color:transparent;
}
.faq-q:hover{ color:var(--accent); }
.faq-q-chevron{
  flex-shrink:0;
  color:var(--text-3);
  transition:transform var(--d) var(--ease-out);
}
.faq-q-chevron .i{ font-size:18px; }
.faq-item[data-open="true"] .faq-q-chevron{ transform:rotate(180deg); color:var(--accent); }
.faq-a{
  font-size:.85rem;
  color:var(--text-2);
  line-height:1.65;
  padding:0 0 16px;
  max-height:0;
  overflow:hidden;
  transition:max-height var(--d-slow) var(--ease-out), padding var(--d) var(--ease-out);
}
.faq-item[data-open="true"] .faq-a{
  max-height:400px;
  padding:0 0 18px;
}

.links-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px, 1fr));
  gap:10px;
}
.link-card{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 16px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r-sm);
  color:var(--text-2);
  font-size:.86rem;
  font-weight:500;
  transition:all var(--d-fast) var(--ease-out);
  text-decoration:none;
  cursor:pointer;
}
.link-card:hover{
  border-color:var(--border-accent);
  color:var(--accent);
  background:var(--accent-bg-2);
  transform:translateY(-1px);
}
.link-card .link-icon{
  flex-shrink:0;
  width:32px;
  height:32px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:var(--r-xs);
  background:var(--surface-3);
  border:1px solid var(--border);
  color:var(--text-3);
  transition:all var(--d-fast) var(--ease-out);
}
.link-card:hover .link-icon{
  color:var(--accent);
  background:var(--accent-bg);
  border-color:var(--border-accent);
}
.link-card .link-icon .i{ font-size:16px; }
.link-card-arrow{
  margin-left:auto;
  flex-shrink:0;
  color:var(--text-4);
  transition:transform var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.link-card-arrow .i{ font-size:14px; }
.link-card:hover .link-card-arrow{ transform:translateX(2px); color:var(--accent); }

/* ═══════════════════════════════════════════════════════════
   АДМИН-РЕДАКТОР (ПРЕВЬЮ / IMAGE-GEN настройки)
   ═══════════════════════════════════════════════════════════ */
.preview-item{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 0;
  border-bottom:1px solid var(--border-subtle);
}
.preview-item:last-child{ border-bottom:none; }
.preview-thumb{
  width:48px;
  height:48px;
  border-radius:var(--r-sm);
  background:var(--surface-3);
  overflow:hidden;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--border);
  color:var(--text-4);
}
.preview-thumb video,
.preview-thumb img{ width:100%; height:100%; object-fit:cover; }
.preview-thumb .i{ font-size:18px; }

.preview-info{
  flex:1;
  min-width:0;
  overflow:hidden;
}
.preview-name{
  font-size:.84rem;
  font-weight:600;
  color:var(--text);
  line-height:1.3;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.preview-id{
  display:block;
  font-size:.68rem;
  color:var(--text-4);
  font-family:var(--font-mono);
  margin-top:2px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.preview-url{
  flex:2;
  min-width:160px;
}
.preview-url .input{
  font-size:.78rem;
  min-height:36px;
  padding:8px 12px;
}
.preview-action{ flex-shrink:0; }

@media (max-width: 640px){
  .preview-item{
    flex-wrap:wrap;
    gap:8px;
  }
  .preview-thumb{ width:40px; height:40px; }
  .preview-info{ flex-basis:calc(100% - 52px); }
  .preview-url{ flex-basis:100%; min-width:0; }
}

/* Админ-ряды: единая высота input и кнопки-сохранить (36px),
   чтобы не было рваного ритма между элементами в одной строке. */
.preview-item .input,
.preview-item .btn.btn-sm{
  min-height:36px;
  padding:7px 11px;
  font-size:.82rem;
}
.preview-item .btn.btn-sm{
  padding:7px 12px;
}

/* Цены в админке (сетка) */
.grid-2{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
  gap:var(--s-3);
  margin-bottom:var(--s-3);
}

/* ═══════════════════════════════════════════════════════════
   АДМИН: ПРЕВЬЮ ФОТО — ВКЛАДКИ И КАРТОЧКИ
   Раздел заменяет «Настройки фото-гена»: цены, превью режимов,
   позы, коллекции — всё на одной странице с навигацией по вкладкам.
   ═══════════════════════════════════════════════════════════ */

/* Контейнер с вкладками: тонкая полоска под сегментами (как у Stripe/Linear).
   На мобильном — горизонтальный скролл сегментов вместо переноса строк. */
.tabs{
  display:flex;
  gap:2px;
  padding:4px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r-md);
  margin-bottom:var(--s-4);
  overflow-x:auto;
  scrollbar-width:none;
}
.tabs::-webkit-scrollbar{ display:none; }

.tabs-tab{
  flex:1 1 auto;
  min-width:max-content;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 16px;
  font-size:.84rem;
  font-weight:500;
  color:var(--text-3);
  background:transparent;
  border:0;
  border-radius:var(--r-sm);
  cursor:pointer;
  transition:color var(--d) var(--ease-out),
             background var(--d) var(--ease-out);
  -webkit-tap-highlight-color:transparent;
  white-space:nowrap;
}
.tabs-tab:hover{ color:var(--text); }
.tabs-tab.active{
  color:var(--text);
  background:var(--surface-4);
  box-shadow:0 1px 0 0 rgba(255,255,255,.04) inset, 0 1px 2px rgba(0,0,0,.25);
}
.tabs-tab .i{ font-size:14px; }
.tabs-tab .badge{
  font-size:.65rem;
  font-weight:600;
  padding:1px 6px;
  background:var(--surface-3);
  color:var(--text-3);
  border-radius:var(--r-full);
  letter-spacing:.2px;
}
.tabs-tab.active .badge{ background:var(--accent-bg); color:var(--accent); }

/* Сетка карточек превью. Адаптивная: 1–2 колонки на мобильном,
   расширяется до 3 на десктопе. Каждая карточка — самостоятельный
   юнит с превью, метаданными, полями и кнопкой сохранения. */
.ipv-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(320px, 1fr));
  gap:14px;
}

.ipv-card{
  position:relative;
  display:grid;
  grid-template-columns:96px 1fr;
  gap:14px;
  padding:14px;
  background:var(--surface-2);
  border:1px solid var(--border);
  border-radius:var(--r-md);
  transition:border-color var(--d) var(--ease-out),
             box-shadow var(--d) var(--ease-out);
}
.ipv-card:hover{
  border-color:var(--border-strong);
  box-shadow:0 1px 2px rgba(0,0,0,.18);
}
/* Карточка с несохранёнными правками — тонкий accent-border сигнализирует
   админу, что нужно нажать «Сохранить». Сбрасывается после успешного
   сохранения через атрибут data-dirty. */
.ipv-card[data-dirty="true"]{
  border-color:var(--accent);
  box-shadow:0 0 0 1px var(--accent-ring);
}

/* Миниатюра превью. Фиксированное соотношение 3:4 — компромисс между
   пейзажным контентом коллекций и портретными позами. */
.ipv-thumb{
  position:relative;
  aspect-ratio:3/4;
  border-radius:var(--r-sm);
  overflow:hidden;
  background:
    linear-gradient(135deg, var(--surface-3) 0%, var(--surface-2) 100%);
  border:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.ipv-thumb video,
.ipv-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.ipv-thumb-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  color:var(--text-4);
}
.ipv-thumb-empty .i{ font-size:22px; opacity:.5; }
.ipv-thumb-empty-text{
  font-size:.62rem;
  letter-spacing:1px;
  text-transform:none;
  opacity:.55;
}

/* Правая часть карточки: ID, поля (название + URL), кнопка. */
.ipv-body{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:0;
}
.ipv-head{
  display:flex;
  flex-direction:column;
  gap:2px;
  min-width:0;
}
.ipv-title{
  font-size:.86rem;
  font-weight:600;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  line-height:1.3;
}
.ipv-id{
  font-size:.65rem;
  color:var(--text-4);
  font-family:var(--font-mono);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ipv-fields{
  display:flex;
  flex-direction:column;
  gap:6px;
}
.ipv-field-label{
  font-size:.66rem;
  letter-spacing:.4px;
  text-transform:none;
  color:var(--text-4);
  font-weight:600;
  margin-bottom:2px;
}
.ipv-card .input{
  min-height:32px;
  padding:6px 10px;
  font-size:.78rem;
}
.ipv-card .input.mono{
  font-family:var(--font-mono);
  font-size:.74rem;
}
.ipv-actions{
  display:flex;
  gap:6px;
  margin-top:auto;
  padding-top:6px;
}
.ipv-actions .btn{
  flex:1;
  min-height:32px;
  font-size:.78rem;
  padding:6px 12px;
}

/* Группа коллекций: категория и её модели. Структурируем визуально
   с лёгким отступом слева и усиленным фоном — чтобы пользователь
   видел иерархию «коллекция → варианты». */
.ipv-coll-group{
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:14px;
  background:var(--surface-1);
  border:1px solid var(--border);
  border-radius:var(--r-md);
  margin-bottom:14px;
}
.ipv-coll-group:last-child{ margin-bottom:0; }
.ipv-coll-group-head{
  display:flex;
  align-items:center;
  gap:10px;
  padding-bottom:12px;
  border-bottom:1px solid var(--border-subtle);
}
.ipv-coll-group-head-title{
  font-size:.92rem;
  font-weight:700;
  color:var(--text);
  flex:1;
  min-width:0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.ipv-coll-group-head .badge{
  font-size:.66rem;
  font-weight:600;
  padding:2px 8px;
  background:var(--surface-3);
  color:var(--text-3);
  border-radius:var(--r-full);
}

/* Адаптация под мобильный: на узких экранах превью становится
   полноценной верхней областью, а блок информации — под ним. */
@media (max-width: 480px){
  .ipv-card{
    grid-template-columns:1fr;
    gap:12px;
  }
  .ipv-thumb{
    aspect-ratio:16/10;
    max-width:none;
  }
  .ipv-coll-group{ padding:12px; }
}

/* Empty-state для всей страницы — когда позы/коллекции не загрузились. */
.ipv-empty{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding:40px 20px;
  text-align:center;
  color:var(--text-3);
  background:var(--surface-2);
  border:1px dashed var(--border);
  border-radius:var(--r-md);
}
.ipv-empty .i{ font-size:32px; color:var(--text-4); opacity:.6; }
.ipv-empty-title{ font-size:.88rem; font-weight:600; color:var(--text-2); }
.ipv-empty-hint{ font-size:.78rem; color:var(--text-4); max-width:380px; }

/* ═══════════════════════════════════════════════════════════
   UPLOAD ZONE
   ═══════════════════════════════════════════════════════════ */
.upload-zone{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:168px;
  padding:24px 18px;
  border-radius:var(--r-lg);
  border:1.5px dashed rgba(255,228,236,.2);
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(255,92,147,.08), transparent 70%),
    rgba(255,240,245,.02);
  text-align:center;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:border-color var(--d) var(--ease-out), background var(--d) var(--ease-out), transform var(--d-fast) var(--ease-out);
}
.upload-zone:hover{ border-color:var(--border-accent); background:rgba(255,92,147,.05); }
.upload-zone:active{ transform:scale(.99); }
.upload-zone.dragover{
  border-color:var(--accent);
  border-style:solid;
  background:var(--accent-bg);
  box-shadow:0 0 0 4px var(--accent-ring);
}
.upload-zone input[type="file"]{ display:none; }
.upload-icon{
  width:52px;
  height:52px;
  border-radius:var(--r-full);
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--gradient-accent);
  color:#fff;
  box-shadow:var(--shadow-glow);
  transition:transform var(--d) var(--ease-back);
}
.upload-zone:hover .upload-icon{ transform:translateY(-2px) scale(1.04); }
.upload-icon .i{ font-size:22px; }
.upload-text{ font-size:.95rem; font-weight:650; color:var(--text); }
.upload-text b{ color:var(--accent); font-weight:750; }
.upload-text .accent{ color:var(--accent); }
.upload-hint{ font-size:.8rem; color:var(--text-3); }
.upload-preview{
  position:relative;
  display:inline-block;
  max-width:100%;
  border-radius:var(--r-lg);
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow:var(--shadow);
}
.upload-preview img{
  display:block;
  max-width:100%;
  max-height:300px;
  object-fit:contain;
  background:#000;
}
.remove-photo{
  position:absolute;
  top:8px;
  right:8px;
  width:32px;
  height:32px;
  border-radius:var(--r-full);
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,10,13,.7);
  border:1px solid rgba(255,240,245,.18);
  color:#fff;
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
  transition:background var(--d-fast) var(--ease-out);
}
.remove-photo:hover{ background:var(--danger); }
.remove-photo .i{ font-size:15px; }

@keyframes balanceBump{
  0%  { transform:scale(1); }
  30% { transform:scale(1.12); color:var(--success); }
  100%{ transform:scale(1); }
}
.balance-bump{
  display:inline-block;
  animation:balanceBump 650ms var(--ease-back);
}

/* ═══════════════════════════════════════════════════════════
   МОДАЛКА (desktop — окно по центру, mobile — шторка снизу)
   Три размера: узкое окно для вопросов, широкое для выбора из
   сетки и «студия» — пример слева, настройки справа.
   ═══════════════════════════════════════════════════════════ */
.modal-overlay{
  position:fixed;
  inset:0;
  z-index:var(--z-modal);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(8,4,6,.7);
  -webkit-backdrop-filter:blur(8px) saturate(1.1);
  backdrop-filter:blur(8px) saturate(1.1);
  animation:fadeIn var(--d) var(--ease-out);
}
.modal-overlay.hidden{ display:none; }

.modal,
.modal-card{
  position:relative;
  width:100%;
  max-width:520px;
  max-height:calc(100dvh - 48px);
  overflow-y:auto;
  overscroll-behavior:contain;
  background:linear-gradient(180deg, #211520 0%, #170F14 100%);
  border:1px solid var(--border);
  border-radius:var(--r-2xl);
  padding:28px;
  box-shadow:var(--shadow-lg);
  animation:modalIn var(--d-slow) var(--ease);
}
.modal-card{ max-width:440px; }
.modal::before{
  content:'';
  position:absolute;
  inset:0 0 auto 0;
  height:180px;
  background:var(--glow-soft);
  pointer-events:none;
  border-radius:var(--r-2xl) var(--r-2xl) 0 0;
}
.modal > *{ position:relative; }
.modal.is-wide{ max-width:980px; }
.modal.is-studio{
  max-width:1060px;
  padding:0;
  overflow:hidden;
  display:flex;
}
.modal.is-studio::before{ display:none; }

@keyframes modalIn{
  from{ opacity:0; transform:translateY(14px) scale(.985); }
  to{ opacity:1; transform:none; }
}

.modal-close{
  position:absolute;
  top:16px;
  right:16px;
  z-index:5;
  width:38px;
  height:38px;
  border-radius:var(--r-full);
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,10,13,.55);
  border:1px solid var(--border);
  color:var(--text-2);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  transition:background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out), transform var(--d-fast) var(--ease-out);
}
.modal-close:hover{ background:rgba(255,240,245,.1); color:var(--text); }
.modal-close:active{ transform:scale(.94); }
.modal-close .i{ font-size:18px; }

.modal-title{
  display:flex;
  align-items:center;
  gap:10px;
  font-family:var(--font-display);
  font-size:1.5rem;
  font-weight:600;
  line-height:1.2;
  padding-right:48px;
  margin-bottom:6px;
}
.modal-title .i{ font-size:20px; color:var(--accent); flex-shrink:0; }
.modal-subtitle{
  color:var(--text-2);
  font-size:.9rem;
  margin-bottom:var(--s-4);
}
.modal-body{ color:var(--text-2); font-size:.92rem; line-height:1.55; margin-top:8px; }
.modal-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:22px; flex-wrap:wrap; }

.modal-preview{
  border-radius:var(--r-lg);
  overflow:hidden;
  background:#000;
  margin:var(--s-3) 0 var(--s-4);
  aspect-ratio:16 / 10;
}
.modal-preview img,
.modal-preview video{ width:100%; height:100%; object-fit:cover; display:block; }

.modal-summary{
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:14px 16px;
  margin:var(--s-4) 0;
  border-radius:var(--r);
  background:rgba(255,240,245,.035);
  border:1px solid var(--border-subtle);
  font-size:.9rem;
}
.modal-summary > div{ display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.modal-summary-label{ color:var(--text-3); }
.modal-summary-value{ font-weight:750; color:var(--text); font-variant-numeric:tabular-nums; }
.modal-summary-value.accent{ color:var(--champagne); font-size:1.02rem; }
.modal-summary-value.success{ color:var(--text-2); font-weight:650; }

/* Ожидание, результат и ошибка — внутри окна. */
.gen-progress{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:10px;
  padding:12px 0 4px;
}
.gen-progress .spinner-lg{ margin-bottom:6px; }
.gen-progress-title{ font-family:var(--font-display); font-size:1.4rem; font-weight:600; }
.gen-progress-meta{ color:var(--text-2); font-size:.9rem; }
.gen-progress-meta b{ color:var(--text); font-variant-numeric:tabular-nums; }
.gen-progress-elapsed{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:6px 12px;
  border-radius:var(--r-full);
  background:rgba(255,240,245,.05);
  color:var(--text-2);
  font-size:.84rem;
  font-variant-numeric:tabular-nums;
}
.gen-progress-elapsed .i{ font-size:14px; color:var(--accent); }
.gen-progress-hint{ color:var(--text-3); font-size:.84rem; max-width:360px; }

.gen-result{ display:flex; flex-direction:column; gap:14px; }
.gen-result-header{ display:flex; align-items:center; gap:12px; padding-right:48px; }
.gen-result-header-icon{
  width:38px; height:38px;
  border-radius:var(--r-full);
  display:flex; align-items:center; justify-content:center;
  background:var(--success-bg);
  color:var(--success);
  flex-shrink:0;
}
.gen-result-header-icon .i{ font-size:18px; }
.gen-result-title{ font-family:var(--font-display); font-size:1.45rem; font-weight:600; }
.gen-result-sub{ color:var(--text-2); font-size:.9rem; }
.gen-result-media{
  border-radius:var(--r-lg);
  overflow:hidden;
  background:#000;
  display:flex;
  align-items:center;
  justify-content:center;
}
.gen-result-media video,
.gen-result-media img{
  display:block;
  width:100%;
  max-height:62dvh;
  object-fit:contain;
  background:#000;
}
.result-actions{ display:flex; flex-wrap:wrap; gap:10px; }
.download-notice{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:12px 14px;
  border-radius:var(--r);
  background:rgba(255,240,245,.035);
  border:1px solid var(--border-subtle);
  color:var(--text-2);
  font-size:.84rem;
  line-height:1.5;
}
.download-notice b{ color:var(--text); }
.download-notice .i{ font-size:16px; color:var(--champagne); flex-shrink:0; margin-top:1px; }

.gen-error{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:10px;
  padding:14px 0 4px;
}
.gen-error-icon{
  width:56px; height:56px;
  border-radius:var(--r-full);
  display:flex; align-items:center; justify-content:center;
  background:var(--danger-bg);
  color:var(--danger);
}
.gen-error-icon .i{ font-size:24px; }
.gen-error-title{ font-family:var(--font-display); font-size:1.4rem; font-weight:600; }
.gen-error-text{ color:var(--text-2); font-size:.92rem; max-width:400px; }

.insuf{ display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:6px 0 2px; }
.insuf-icon{
  width:60px; height:60px;
  border-radius:var(--r-full);
  display:flex; align-items:center; justify-content:center;
  background:var(--champagne-bg);
  color:var(--champagne);
}
.insuf-icon .i{ font-size:26px; }
.insuf-title{ font-family:var(--font-display); font-size:1.45rem; font-weight:600; }
.insuf-text{ color:var(--text-2); font-size:.92rem; max-width:360px; }
.insuf-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; width:100%; margin-top:6px; }
.insuf-cell{
  padding:14px;
  border-radius:var(--r);
  background:rgba(255,240,245,.04);
  border:1px solid var(--border-subtle);
}
.insuf-cell-label{ font-size:.8rem; color:var(--text-3); margin-bottom:4px; }
.insuf-cell-value{ font-size:1.35rem; font-weight:800; font-variant-numeric:tabular-nums; }
.insuf-cell.accent .insuf-cell-value{ color:var(--text); }
.insuf-cell.danger .insuf-cell-value{ color:var(--champagne); }
.insuf-actions{ display:flex; gap:10px; width:100%; margin-top:8px; }
.insuf-actions .btn{ flex:1; }

@media (max-width: 960px){
  .modal-overlay{ align-items:flex-end; padding:0; }
  .modal,
  .modal-card{
    max-width:none;
    max-height:92dvh;
    border-radius:var(--r-2xl) var(--r-2xl) 0 0;
    border-bottom:none;
    padding:22px 18px calc(22px + env(safe-area-inset-bottom));
    animation:sheetUp var(--d-slow) var(--ease);
  }
  .modal-card{ border-radius:var(--r-2xl); margin:0 12px calc(12px + env(safe-area-inset-bottom)); padding:22px 18px; }
  .modal.is-wide,
  .modal.is-studio{
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
    border:none;
  }
  .modal.is-wide{ padding-top:calc(18px + env(safe-area-inset-top)); }
  .modal-close{ top:calc(12px + env(safe-area-inset-top)); right:12px; }
  .modal:not(.is-wide):not(.is-studio) .modal-close{ top:14px; }
  .modal-title{ font-size:1.35rem; }
  .gen-result-media video,
  .gen-result-media img{ max-height:56dvh; }
}

/* ═══════════════════════════════════════════════════════════
   DRAG & DROP OVERLAY
   ═══════════════════════════════════════════════════════════ */
.dnd-overlay{
  position:fixed;
  inset:0;
  z-index:var(--z-dnd);
  background:rgba(4,4,8,.82);
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px;
  pointer-events:none;
  opacity:0;
  transition:opacity var(--d-fast) var(--ease-out);
}
.dnd-overlay.show{ opacity:1; pointer-events:auto; }
.dnd-box{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  padding:38px 48px;
  background:var(--accent-bg);
  border:2.5px dashed var(--accent);
  border-radius:var(--r-xl);
  text-align:center;
  max-width:420px;
  box-shadow:
    0 0 0 6px var(--accent-bg-2),
    0 30px 80px rgba(0,0,0,.5);
  animation:dndPulse 2s var(--ease-in-out) infinite;
}
@keyframes dndPulse{
  0%,100%{ transform:scale(1); }
  50%    { transform:scale(1.02); }
}
.dnd-icon{
  width:56px;
  height:56px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--accent);
  background:var(--surface-1);
  border:1px solid var(--border-accent);
  border-radius:var(--r-full);
  margin-bottom:4px;
}
.dnd-icon .i{ font-size:26px; }
.dnd-text{
  font-family:var(--font-display);
  font-size:1.15rem;
  font-weight:500;
  color:var(--text);
  letter-spacing:-.005em;
}
.dnd-sub{
  font-size:.82rem;
  color:var(--text-2);
}

/* ═══════════════════════════════════════════════════════════
   REDUCED MOTION
   Уважаем настройки системы: никаких transform-анимаций,
   только opacity для ключевых переходов.
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
    scroll-behavior:auto !important;
  }
  .skel{ animation:none !important; background:rgba(255,255,255,.05) !important; }
  .spinner{ animation:spin 1.2s linear infinite !important; }
}

/* ═══════════════════════════════════════════════════════════
   ПЕЧАТЬ (на всякий)
   ═══════════════════════════════════════════════════════════ */
@media print{
  .sidebar, .mobile-header, .bottom-nav, .modal-overlay, .overlay, .toast-stack{ display:none !important; }
  body::before, body::after{ display:none; }
  .main{ margin-left:0; }
  .card{ break-inside:avoid; }
}

/* ═══════════════════════════════════════════════════════════
   ВЕБ-ФРАНШИЗА: «Мои сайты»
   Минимальный набор стилей для нового раздела. Использует
   существующие токены (--bg, --surface-*, --text, --border-*).
   ═══════════════════════════════════════════════════════════ */

/* Сетка карточек сайтов */
.wf-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px, 1fr));
  gap:16px;
  margin-top:20px;
}
@media (max-width:560px){
  .wf-grid{ grid-template-columns:1fr; }
}

/* Карточка-кнопка (вся карточка кликабельна — открывает детали) */
.wf-card{
  cursor:pointer;
  transition:border-color .12s ease, transform .12s ease;
}
.wf-card:hover{
  border-color:var(--border-strong);
  transform:translateY(-1px);
}

/* Бейджи статусов */
.wf-badge{
  display:inline-flex; align-items:center;
  padding:3px 10px; border-radius:999px;
  font-size:11px; font-weight:600;
  letter-spacing:.04em; text-transform:none;
  border:1px solid var(--border);
}
.wf-badge.success{
  color:#86efac; background:rgba(34,197,94,.08); border-color:rgba(34,197,94,.24);
}
.wf-badge.warning{
  color:#fcd34d; background:rgba(234,179,8,.08); border-color:rgba(234,179,8,.24);
}
.wf-badge.muted{
  color:var(--text-dim); background:rgba(255,255,255,.04);
}

/* Поле «поддомен + .morphai.cc» */
.wf-suffix-row{
  display:flex; align-items:stretch;
  border:1px solid var(--border); border-radius:10px;
  overflow:hidden; background:var(--surface-2);
}
.wf-suffix-row .input{
  flex:1 1 auto; border:0; background:transparent; border-radius:0;
}
.wf-suffix-row .wf-suffix{
  display:flex; align-items:center;
  padding:0 14px;
  background:var(--surface-3);
  color:var(--text-dim);
  font-size:13px;
  border-left:1px solid var(--border);
  white-space:nowrap;
}

/* Подсказки под полями (доступность/ошибки/успех) */
.wf-hint{
  margin-top:6px;
  font-size:12px; line-height:1.4;
  color:var(--text-dim);
  min-height:18px;
}
.wf-hint.success{ color:#86efac; }
.wf-hint.error{   color:#fca5a5; }

/* Inline-ошибка формы */
.wf-error{
  margin-top:8px; min-height:18px;
  font-size:13px; color:#fca5a5;
}

/* Кнопка «назад» в шапке детального экрана */
.wf-back{
  margin-bottom:8px;
}

/* Пунктирный «callout» с предупреждением */
.wf-callout{
  margin:0 0 12px 0;
  padding:12px 14px;
  background:rgba(234,179,8,.06);
  border:1px solid rgba(234,179,8,.24);
  border-radius:10px;
  font-size:13px; line-height:1.5;
  color:var(--text-dim);
}

/* Желтое предупреждение — например, для email-юзеров на форме создания. */
.wf-callout.wf-callout-warn{
  background:rgba(234,179,8,.06);
  border-color:rgba(234,179,8,.28);
  color:var(--text-2);
}

/* «Заблокировано» — нейтральный серый callout с заголовком и текстом.
   Используется в карточках, которые недоступны конкретному пользователю
   (например, привязка TG-бота для email-юзера). */
.wf-callout.wf-callout-locked{
  margin:0;
  padding:14px 16px;
  background:rgba(255,255,255,.03);
  border:1px solid var(--border);
  border-radius:10px;
  color:var(--text-dim);
}
.wf-callout-title{
  display:flex; align-items:center; gap:8px;
  margin-bottom:6px;
  color:var(--text);
  font-size:14px;
}
.wf-callout-title b{ font-weight:600; }
.wf-callout-text{
  font-size:13px; line-height:1.5;
}

/* Блок-строка «Уведомления партнёру»: текст слева, switch справа.
   Использует общий стиль .switch (см. секцию SWITCH выше). */
.wf-notif-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}
.wf-notif-text{
  flex:1 1 auto;
  min-width:0;
}
.wf-notif-title{
  font-size:14px;
  font-weight:500;
  color:var(--text);
  line-height:1.4;
  margin-bottom:4px;
}
.wf-notif-hint{
  font-size:12px;
  color:var(--text-2);
  line-height:1.5;
}

/* ── Теги в разделе «Генератор» ────────────────────────────────
   Карточка с картинкой вместо голой кнопки: человеку видно, что он
   выбирает. Часть картинок Clothoff — вырезанные силуэты без фона,
   поэтому под ними своя тёмная подложка. */
.hg-tags{ display:grid; grid-template-columns:repeat(auto-fill, minmax(132px,1fr)); gap:12px; }
.hg-tag{
  position:relative; display:block; width:100%; padding:0; overflow:hidden;
  border:1px solid var(--border); border-radius:var(--r-md);
  background:var(--surface-2); cursor:pointer; text-align:left;
  transition:border-color .15s ease, transform .15s ease;
}
.hg-tag:hover{ border-color:var(--accent-soft, var(--border-strong)); transform:translateY(-1px); }
.hg-tag.is-on{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; }
.hg-tag-img{
  display:block; width:100%; aspect-ratio:3/4; object-fit:cover;
  background:#0d0f14;                 /* подложка под прозрачные картинки */
}
.hg-tag-img.is-cutout{ object-fit:contain; padding:6px; }
.hg-tag-name{
  position:absolute; left:0; right:0; bottom:0; padding:22px 10px 9px;
  font-size:.86rem; line-height:1.2; color:#fff;
  background:linear-gradient(to top, rgba(0,0,0,.9) 35%, rgba(0,0,0,0));
  /* Длинные названия вроде «Missionary Vaginal» на узком экране уезжали
     в три строки и перекрывали картинку — ограничиваем двумя. */
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden;
}
/* Карточка без картинки. Подпись у карточки с фото прижата ко дну поверх
   затемнения; если фото нет, её нужно вернуть в обычный поток — иначе она
   висит в пустой рамке и обрезается. */
.hg-tag-plain{
  display:flex; align-items:center; justify-content:center;
  min-height:66px; padding:12px 10px;
  font-size:.84rem; line-height:1.25; text-align:center; color:var(--text-1);
}
.hg-tag-plain .hg-tag-name{
  position:static; padding:0; background:none; color:inherit;
}
.hg-tag-plain.is-on{ background:var(--surface-3); }


/* ── Конструктор «Генератор» ───────────────────────────────────
   Вместо длинных списков-гармошек — плитки категорий, как привычно
   по другим разделам. Нажатие открывает выбор внутри категории,
   выбранное сразу видно на плитке. */
.hg-head{ display:flex; align-items:center; gap:12px; margin-bottom:var(--s-4); }
.hg-head-cover{ width:56px; height:56px; border-radius:var(--r-md); object-fit:cover;
                background:#0d0f14; flex:0 0 auto; }
.hg-head-name{ font-weight:600; }
.hg-head-sub{ font-size:.82rem; color:var(--text-3); }
.hg-cats{ display:grid; grid-template-columns:repeat(auto-fill, minmax(168px,1fr)); gap:12px; }
@media (max-width: 640px){
  .hg-cats{ grid-template-columns:repeat(2, 1fr); gap:10px; }
  .hg-cat-label{ font-size:.88rem; padding:22px 10px 10px; }
  .hg-tags{ grid-template-columns:repeat(2, 1fr); gap:10px; }
  .hg-tag-name{ font-size:.82rem; padding:18px 8px 8px; }
  .hg-head-cover{ width:48px; height:48px; }
}
.hg-cat-card{
  position:relative; display:block; width:100%; padding:0; overflow:hidden; cursor:pointer;
  border:1px solid var(--border); border-radius:var(--r-md); background:var(--surface-2);
  transition:border-color .15s ease, transform .15s ease;
}
.hg-cat-card:hover{ border-color:var(--border-accent); transform:translateY(-1px); }
.hg-cat-card.is-on{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent) inset; }
.hg-cat-img{ display:block; width:100%; aspect-ratio:3/4; object-fit:cover; background:#0d0f14; }
/* Вырезанные силуэты без фона: показываем целиком и подсвечиваем снизу,
   иначе на тёмной карточке они читаются как серое пятно. */
.hg-cat-img.is-cutout{
  object-fit:contain; padding:10px 10px 26px;
  background:radial-gradient(120% 80% at 50% 100%, rgba(255,255,255,.10), #0d0f14 70%);
}
.hg-cat-label{
  position:absolute; left:0; right:0; bottom:0; padding:26px 12px 12px;
  font-size:.95rem; font-weight:600; color:#fff; text-align:left; letter-spacing:.01em;
  background:linear-gradient(to top, rgba(0,0,0,.92) 30%, rgba(0,0,0,0));
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden;
}
.hg-cat-count{
  position:absolute; top:10px; right:10px; min-width:26px; height:26px; padding:0 8px;
  border-radius:999px; background:var(--accent); color:#fff;
  font-size:.82rem; font-weight:600; line-height:26px; text-align:center;
  box-shadow:0 2px 10px rgba(0,0,0,.45);
}
.hg-picked{ display:flex; flex-wrap:wrap; gap:6px; margin:10px 0 0; }
.hg-chip{
  display:inline-flex; align-items:center; gap:6px; padding:4px 8px 4px 10px;
  border-radius:999px; background:var(--surface-3); border:1px solid var(--border);
  font-size:.78rem; color:var(--text-1);
}
.hg-chip button{ border:0; background:none; color:var(--text-3); cursor:pointer;
                 font-size:1rem; line-height:1; padding:0 2px; }
.hg-chip button:hover{ color:var(--text-1); }

/* ── Shorts: одно вводное видео ──────────────────────────────────────
   Показывать оба ролика было лишним: человек и так понимает принцип.
   Одно видео под блюром, нажатие ведёт к выбору размера пачки. */

/* Карточки размеров пачки: цифра, цена и стоимость за ролик. */


/* ═══════════════════════════════════════════════════════════
   ВИТРИНА
   Первый экран после входа: живой баннер с лучшим шаблоном и
   полки по разделам — как в кинотеатре.
   ═══════════════════════════════════════════════════════════ */
.home-top{
  position:relative;
  isolation:isolate;
  margin-bottom:6px;
}
/* Подсветка цветами играющего ролика: размытая копия обложки.
   По бокам не шире полей страницы — иначе на телефоне страница
   начинает ездить вбок (размытие само по себе ширину не добавляет). */
.home-glow{
  position:absolute;
  inset:-60px -24px auto -24px;
  height:520px;
  z-index:-1;
  background-size:cover;
  background-position:center;
  filter:blur(90px) saturate(1.5);
  opacity:.38;
  pointer-events:none;
  transition:opacity var(--d-slow) var(--ease-out);
}
.home-hero{
  position:relative;
  min-height:300px;
  border-radius:var(--r-2xl);
  overflow:hidden;
  display:flex;
  align-items:flex-end;
  background:#0A0608;
  border:1px solid var(--border);
  box-shadow:var(--shadow-lg);
  isolation:isolate;
}
.home-hero::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:-1;
  background:
    linear-gradient(90deg, rgba(10,6,8,.94) 0%, rgba(10,6,8,.72) 34%, rgba(10,6,8,.12) 72%, rgba(10,6,8,0) 100%),
    linear-gradient(0deg, rgba(10,6,8,.7) 0%, transparent 50%);
}
.home-hero-body{
  padding:40px 44px;
  max-width:580px;
}
.home-hero-chips{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:14px; }
.home-hero-title{
  font-family:var(--font-display);
  font-size:3rem;
  font-weight:600;
  line-height:1.04;
  letter-spacing:-.015em;
  margin-bottom:12px;
}
.home-hero-text{
  color:var(--text-2);
  font-size:1rem;
  line-height:1.55;
  max-width:440px;
  margin-bottom:22px;
}
.home-hero-actions{ display:flex; flex-wrap:wrap; gap:10px; }

/* Фон баннера: размытая обложка ролика. Цвета сцены заполняют баннер,
   а сама сцена показана чётко в рамке. */
.hero-backdrop{
  position:absolute;
  inset:-48px;
  z-index:-2;
  background-size:cover;
  background-position:center;
  filter:blur(40px) saturate(1.35) brightness(.78);
  pointer-events:none;
}
/* Обложки нет — фирменный градиент вместо чёрного фона. */
.hero-backdrop.is-brand{
  inset:0;
  filter:none;
  background:
    radial-gradient(70% 90% at 88% 18%, rgba(255,92,147,.3), transparent 62%),
    radial-gradient(60% 80% at 62% 100%, rgba(201,74,52,.22), transparent 66%),
    linear-gradient(160deg, #2A1822 0%, #110A0E 100%);
}

/* Баннер с роликом: текст слева, ролик справа — целиком и в своих
   пропорциях, без обрезки. Размер рамки считается от высоты баннера
   и пропорций ролика (--hero-ar ставит _heroFit). */
.home-hero.has-frame{
  --hero-h:clamp(300px, min(32vw, 100vh - 150px), 460px);
  min-height:var(--hero-h);
  align-items:center;
  gap:32px;
  padding:26px 26px 26px 48px;
}
@media (max-width: 960px){
  /* Планшет: боковой панели нет, баннер шире — делаем его выше. */
  .home-glow{ left:0; right:0; }
  .home-hero.has-frame{ --hero-h:clamp(300px, min(46vw, 100vh - 200px), 440px); }
}
.home-hero.has-frame::after{
  background:linear-gradient(90deg, rgba(10,6,8,.88) 0%, rgba(10,6,8,.7) 40%, rgba(10,6,8,.42) 72%, rgba(10,6,8,.34) 100%);
}
.home-hero.has-frame .home-hero-body{
  flex:1 1 auto;
  min-width:0;
  max-width:600px;
  padding:0;
}
.home-hero.has-frame .home-hero-title{
  font-size:clamp(2rem, 3.2vw, 3rem);
  overflow-wrap:break-word;
}
/* Строки одной длины, без одинокого слова на последней. */
.home-hero.has-frame .home-hero-title,
.home-hero.has-frame .home-hero-text{ text-wrap:balance; }
.hero-frame{
  position:relative;
  flex:0 0 auto;
  width:min(46%, calc((var(--hero-h) - 54px) * var(--hero-ar, .5625)));
  aspect-ratio:var(--hero-ar, .5625);
  margin-left:auto;
  border-radius:var(--r-xl);
  overflow:hidden;
  isolation:isolate;
  background:#07040A;
  box-shadow:0 28px 64px rgba(0,0,0,.55), 0 0 0 1px rgba(255,240,245,.1);
  opacity:0;
  transform:translateY(10px) scale(.98);
  transition:opacity var(--d-slow) var(--ease-out), transform var(--d-slow) var(--ease-out), box-shadow var(--d) var(--ease);
}
.hero-frame.is-ready{ opacity:1; transform:none; }
.hero-frame > img,
.hero-frame > video{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:contain;
  display:block;
}
/* Нажатие на ролик открывает студию — как на карточке шаблона. */
.hero-frame-hit{
  position:absolute;
  inset:0;
  z-index:1;
  width:100%;
  height:100%;
  padding:0;
  border:0;
  border-radius:inherit;
  background:transparent;
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.hero-frame-hit:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
@media (hover: hover){
  .hero-frame.is-ready:hover{
    transform:translateY(-3px);
    box-shadow:0 34px 72px rgba(0,0,0,.6), 0 0 0 1px rgba(255,92,147,.45);
  }
}
/* Не загрузились ни ролик, ни обложка — пустую рамку не показываем. */
.home-hero.no-frame .hero-frame{ display:none; }

/* Вступление к пачкам — тот же баннер, только ниже и без кнопок. */
.home-hero.sh-intro{
  --hero-h:clamp(240px, 20vw, 290px);
  margin-bottom:22px;
}
.home-hero.sh-intro .home-hero-title{ font-size:clamp(1.5rem, 2.3vw, 2rem); }
.home-hero.sh-intro .home-hero-text{ margin-bottom:0; }

.btn-glass{
  background:rgba(255,240,245,.1);
  border-color:rgba(255,240,245,.18);
  color:#fff;
  -webkit-backdrop-filter:blur(12px);
  backdrop-filter:blur(12px);
}
.btn-glass:hover:not([disabled]){ background:rgba(255,240,245,.16); color:#fff; }

.home-note{
  display:flex;
  align-items:center;
  gap:12px;
  margin-top:18px;
  padding:14px 18px;
  border-radius:var(--r-lg);
  background:var(--gradient-champagne), var(--surface-1);
  border:1px solid var(--champagne-ring);
  color:var(--text);
  font-size:.92rem;
}
.home-note .i{ font-size:20px; color:var(--champagne); flex-shrink:0; }
.home-note b{ color:var(--champagne); }
.home-note .btn{ margin-left:auto; }

.shelf{ margin-top:40px; }
.shelf-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.shelf-title{
  font-family:var(--font-display);
  font-size:1.55rem;
  font-weight:600;
  line-height:1.2;
}
.shelf-sub{ color:var(--text-3); font-size:.88rem; margin-top:3px; }
.shelf-link{
  display:inline-flex;
  align-items:center;
  gap:4px;
  height:34px;
  padding:0 12px;
  border-radius:var(--r-full);
  color:var(--text-2);
  font-size:.86rem;
  font-weight:650;
  white-space:nowrap;
  transition:background var(--d-fast) var(--ease-out), color var(--d-fast) var(--ease-out);
}
.shelf-link:hover{ background:rgba(255,240,245,.06); color:var(--text); }
.shelf-link .i{ font-size:15px; }

.shelf-row{
  display:grid;
  grid-auto-flow:column;
  grid-auto-columns:clamp(168px, 15vw, 214px);
  gap:14px;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  scroll-snap-type:x mandatory;
  scroll-padding-left:2px;
  padding:4px 2px 10px;
  scrollbar-width:none;
  -webkit-mask-image:linear-gradient(90deg, #000 0, #000 calc(100% - 48px), transparent 100%);
  mask-image:linear-gradient(90deg, #000 0, #000 calc(100% - 48px), transparent 100%);
}
.shelf-row::-webkit-scrollbar{ display:none; }
.shelf-row > *{ scroll-snap-align:start; }
.shelf-row.is-wide{ grid-auto-columns:clamp(240px, 22vw, 300px); }
.shelf-row .ig-mode-card{ min-height:250px; }
.shelf-skel{ aspect-ratio:3 / 4; border-radius:var(--r-lg); }

/* Пачки на витрине: крупная цифра вместо картинки. */
.pack-card{
  position:relative;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  aspect-ratio:3 / 4;
  padding:16px;
  border-radius:var(--r-lg);
  overflow:hidden;
  text-align:left;
  color:var(--text);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(255,92,147,.24), transparent 60%),
    linear-gradient(165deg, #2A1822 0%, #150D12 100%);
  border:1px solid var(--border);
  box-shadow:var(--shadow-sm);
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d) var(--ease), border-color var(--d) var(--ease), box-shadow var(--d) var(--ease);
}
.pack-card:hover{ transform:translateY(-3px); border-color:var(--border-accent); box-shadow:var(--shadow); }
.pack-card:active{ transform:scale(.985); }
.pack-card.is-best{ border-color:var(--champagne-ring); }
.pack-card-size{
  font-family:var(--font-display);
  font-size:3.4rem;
  font-weight:700;
  line-height:1;
}
.pack-card-word{ font-size:.95rem; font-weight:700; margin-top:4px; }
.pack-card-price{ font-size:1.05rem; font-weight:800; color:var(--champagne); font-variant-numeric:tabular-nums; }
.pack-card-price s{ color:var(--text-3); font-weight:600; margin-right:4px; }
.pack-card-per{ font-size:.78rem; color:var(--text-3); margin-top:2px; }

/* ═══════════════════════════════════════════════════════════
   СТУДИЯ
   Выбрали шаблон — открывается студия: пример крупно слева,
   фото и настройки справа, цена и главная кнопка всегда видны.
   ═══════════════════════════════════════════════════════════ */
.studio{
  display:grid;
  grid-template-columns:minmax(0, 45fr) minmax(0, 55fr);
  width:100%;
  min-height:0;
  max-height:calc(100dvh - 48px);
}
.studio-media{
  position:relative;
  min-height:520px;
  background:#07040A;
  overflow:hidden;
  isolation:isolate;
}
/* Пример показываем целиком, без обрезки; свободное место вокруг
   заполняет размытая копия обложки (или фирменный градиент). */
.studio-media > img,
.studio-media > video{
  position:absolute;
  inset:0;
  z-index:1;
  width:100%;
  height:100%;
  object-fit:contain;
}
.studio-media-bg{
  position:absolute;
  inset:-40px;
  z-index:0;
  background-size:cover;
  background-position:center;
  filter:blur(34px) saturate(1.3) brightness(.62);
  pointer-events:none;
}
.studio-media-bg.is-brand{
  inset:0;
  filter:none;
  background:
    radial-gradient(90% 70% at 30% 20%, rgba(255,92,147,.24), transparent 60%),
    radial-gradient(80% 70% at 80% 90%, rgba(201,74,52,.18), transparent 60%),
    linear-gradient(160deg, #2A1822 0%, #110A0E 100%);
}
.studio-media::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:2;
  pointer-events:none;
  background:linear-gradient(180deg, rgba(10,6,8,.35) 0%, transparent 25%, transparent 70%, rgba(10,6,8,.55) 100%);
}
.studio-media-empty{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  color:rgba(255,240,245,.2);
  background:
    radial-gradient(90% 70% at 30% 20%, rgba(255,92,147,.28), transparent 60%),
    radial-gradient(80% 70% at 80% 90%, rgba(201,74,52,.22), transparent 60%),
    linear-gradient(160deg, #2A1822 0%, #110A0E 100%);
}
.studio-media-empty .i{ font-size:64px; }
.studio-media-caption{
  position:absolute;
  left:18px;
  bottom:16px;
  z-index:3;
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}
.studio-body{
  display:flex;
  flex-direction:column;
  min-height:0;
  max-height:calc(100dvh - 48px);
  overflow-y:auto;
  overscroll-behavior:contain;
}
.studio-content{ padding:30px 30px 8px; flex:1; }
.studio-head{ margin-bottom:18px; padding-right:40px; }
.studio-title{
  font-family:var(--font-display);
  font-size:1.75rem;
  font-weight:600;
  line-height:1.15;
}
.studio-sub{ color:var(--text-2); font-size:.92rem; margin-top:6px; }
.studio-foot{
  position:sticky;
  bottom:0;
  padding:14px 30px calc(18px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg, rgba(23,15,20,0) 0%, rgba(23,15,20,.94) 26%, #170F14 100%);
}
.studio-foot .modal-summary{ margin:0 0 12px; }
.studio-tip{
  display:flex;
  align-items:flex-start;
  gap:8px;
  color:var(--text-3);
  font-size:.82rem;
  margin-top:10px;
}
.studio-tip .i{ font-size:14px; color:var(--champagne); margin-top:2px; flex-shrink:0; }
.studio-picked{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-bottom:14px;
}
.studio-picked .badge{ height:26px; }

@media (max-width: 960px){
  .studio{
    grid-template-columns:1fr;
    grid-template-rows:auto 1fr;
    max-height:100dvh;
    height:100dvh;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .studio-media{
    min-height:0;
    height:min(46dvh, 420px);
  }
  .studio-body{ max-height:none; overflow:visible; }
  .studio-content{ padding:22px 18px 6px; }
  .studio-head{ padding-right:0; }
  .studio-title{ font-size:1.5rem; }
  .studio-foot{ padding:12px 18px calc(16px + env(safe-area-inset-bottom)); }
}

/* ═══════════════════════════════════════════════════════════
   ЗАДАЧИ: ОЖИДАНИЕ В ФОНЕ
   Генерация сворачивается в светящуюся капсулу, как музыка в
   плеере. Можно листать витрину и запускать новое.
   ═══════════════════════════════════════════════════════════ */
.dock{
  position:fixed;
  right:24px;
  bottom:24px;
  z-index:var(--z-dock);
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
  pointer-events:none;
}
.dock.hidden{ display:none; }
.dock > *{ pointer-events:auto; }
.dock-pill{
  display:inline-flex;
  align-items:center;
  gap:12px;
  height:54px;
  padding:0 18px 0 8px;
  border-radius:var(--r-full);
  background:rgba(28,17,24,.92);
  border:1px solid var(--border-strong);
  box-shadow:var(--shadow-lg);
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
  color:var(--text);
  text-align:left;
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d) var(--ease), border-color var(--d) var(--ease), box-shadow var(--d) var(--ease);
  animation:dockIn var(--d-slow) var(--ease);
}
.dock-pill:active{ transform:scale(.97); }
.dock-pill.is-done{
  border-color:var(--success-ring);
  box-shadow:var(--shadow-lg), 0 0 0 4px rgba(76,217,160,.12), 0 0 32px rgba(76,217,160,.25);
}
.dock-pill.is-failed{ border-color:var(--danger-ring); }
.dock-thumb{
  position:relative;
  width:40px;
  height:40px;
  border-radius:var(--r-full);
  overflow:hidden;
  flex-shrink:0;
  background:var(--surface-3);
}
.dock-thumb img{ width:100%; height:100%; object-fit:cover; }
.dock-thumb::after{
  content:'';
  position:absolute;
  inset:0;
  border-radius:inherit;
  border:2px solid transparent;
  border-top-color:var(--accent);
  border-right-color:var(--accent);
  animation:spin 1s linear infinite;
}
.dock-pill.is-done .dock-thumb::after,
.dock-pill.is-failed .dock-thumb::after{ animation:none; border-color:transparent; }
.dock-thumb .i{
  position:absolute;
  inset:0;
  margin:auto;
  font-size:18px;
  color:var(--text-3);
}
.dock-state{
  position:absolute;
  right:-2px;
  bottom:-2px;
  width:18px;
  height:18px;
  border-radius:var(--r-full);
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--success);
  color:#0B1A13;
  box-shadow:0 0 0 2px #1C1118;
}
.dock-state .i{ font-size:11px; position:static; color:inherit; }
.dock-pill.is-failed .dock-state{ background:var(--danger); color:#fff; }
.dock-text{ display:flex; flex-direction:column; min-width:0; max-width:230px; }
.dock-title{ font-size:.88rem; font-weight:750; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dock-sub{ font-size:.76rem; color:var(--text-3); white-space:nowrap; font-variant-numeric:tabular-nums; }
.dock-count{
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:var(--r-full);
  background:var(--accent);
  color:#fff;
  font-size:.72rem;
  font-weight:800;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.dock-panel{
  width:340px;
  max-height:min(60dvh, 460px);
  overflow-y:auto;
  padding:8px;
  border-radius:var(--r-xl);
  background:rgba(24,15,20,.96);
  border:1px solid var(--border-strong);
  box-shadow:var(--shadow-lg);
  -webkit-backdrop-filter:blur(18px);
  backdrop-filter:blur(18px);
  animation:dockIn var(--d) var(--ease);
}
.dock-panel.hidden{ display:none; }
.dock-panel-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:8px 10px 10px;
  font-size:.86rem;
  font-weight:750;
}
.dock-row{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:10px;
  border-radius:var(--r);
  text-align:left;
  color:var(--text);
  -webkit-tap-highlight-color:transparent;
  transition:background var(--d-fast) var(--ease-out);
}
.dock-row:hover{ background:rgba(255,240,245,.05); }
.dock-row .dock-thumb{ width:44px; height:44px; border-radius:var(--r-sm); }
.dock-row .dock-thumb::after{ border-radius:var(--r-sm); }
.dock-row-main{ flex:1; min-width:0; }
.dock-row-title{ font-size:.88rem; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dock-row-sub{ font-size:.78rem; color:var(--text-3); }
.dock-row-sub.success{ color:var(--success); }
.dock-row-sub.danger{ color:#FF9A9A; }
.dock-row .i.chev{ font-size:16px; color:var(--text-3); }

@keyframes dockIn{
  from{ opacity:0; transform:translateY(10px) scale(.98); }
  to{ opacity:1; transform:none; }
}
@media (max-width: 960px){
  .dock{
    left:12px;
    right:12px;
    bottom:calc(var(--bottom-nav-h) + 12px + env(safe-area-inset-bottom));
    align-items:center;
  }
  .dock-pill{ height:50px; max-width:100%; }
  .dock-panel{ width:100%; }
}

/* Экран ожидания внутри студии: ваше фото под «сканером». */
.wait{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:14px;
  padding:8px 0 4px;
}
.scan{
  position:relative;
  width:min(240px, 62vw);
  aspect-ratio:3 / 4;
  border-radius:var(--r-xl);
  overflow:hidden;
  background:
    radial-gradient(90% 70% at 30% 20%, rgba(255,92,147,.28), transparent 60%),
    linear-gradient(160deg, #2A1822 0%, #110A0E 100%);
  box-shadow:var(--shadow-lg), 0 0 0 1px var(--border);
}
.scan img{ width:100%; height:100%; object-fit:cover; display:block; filter:saturate(.9) brightness(.85); }
.scan::before{
  content:'';
  position:absolute;
  left:0; right:0;
  height:34%;
  top:-34%;
  background:linear-gradient(180deg, transparent 0%, rgba(255,92,147,.0) 20%, rgba(255,92,147,.45) 80%, rgba(255,210,225,.9) 100%);
  mix-blend-mode:screen;
  animation:scanMove 2.4s var(--ease-in-out) infinite;
}
.scan::after{
  content:'';
  position:absolute;
  inset:0;
  box-shadow:inset 0 0 60px rgba(217,44,104,.35);
  pointer-events:none;
}
@keyframes scanMove{
  0%  { top:-34%; }
  100%{ top:100%; }
}
.wait-title{ font-family:var(--font-display); font-size:1.45rem; font-weight:600; }
.wait-sub{ color:var(--text-2); font-size:.9rem; max-width:380px; }
.stages{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  justify-content:center;
}
.stage{
  display:inline-flex;
  align-items:center;
  gap:6px;
  height:28px;
  padding:0 11px;
  border-radius:var(--r-full);
  font-size:.78rem;
  font-weight:700;
  color:var(--text-3);
  background:rgba(255,240,245,.04);
  border:1px solid var(--border-subtle);
}
.stage .i{ font-size:12px; }
.stage.done{ color:var(--success); border-color:var(--success-ring); background:var(--success-bg); }
.stage.now{ color:var(--text); border-color:var(--border-accent); background:var(--accent-bg); }
.wait-actions{ display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-top:4px; }
.slots{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(84px, 1fr));
  gap:8px;
  width:100%;
  margin-top:6px;
}
.slot{
  position:relative;
  aspect-ratio:3 / 4;
  border-radius:var(--r);
  overflow:hidden;
  background:rgba(255,240,245,.04);
  border:1px solid var(--border-subtle);
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text-4);
  font-size:.8rem;
  font-weight:700;
}
.slot.is-pending::before{
  content:'';
  position:absolute;
  inset:0;
  background:linear-gradient(110deg, transparent 30%, rgba(255,240,245,.07) 50%, transparent 70%);
  background-size:200% 100%;
  animation:shimmer 1.6s linear infinite;
}
.slot img,
.slot video{ width:100%; height:100%; object-fit:cover; display:block; }
.slot.is-ready{ border-color:var(--border); cursor:pointer; }
.slot .slot-n{
  position:absolute;
  left:6px;
  bottom:6px;
  z-index:2;
}
@keyframes shimmer{
  from{ background-position:200% 0; }
  to{ background-position:-200% 0; }
}

/* ═══════════════════════════════════════════════════════════
   РЕЗУЛЬТАТ
   ═══════════════════════════════════════════════════════════ */
.res{ display:flex; flex-direction:column; gap:14px; }
.res-head{ display:flex; align-items:center; gap:12px; padding-right:48px; }
.res-title{ font-family:var(--font-display); font-size:1.5rem; font-weight:600; line-height:1.2; }
.res-sub{ color:var(--text-2); font-size:.88rem; margin-top:2px; }
.res-media{
  position:relative;
  border-radius:var(--r-xl);
  overflow:hidden;
  background:#000;
  display:flex;
  align-items:center;
  justify-content:center;
  animation:reveal 900ms var(--ease) both;
}
.res-media video,
.res-media img{
  display:block;
  width:100%;
  max-height:64dvh;
  object-fit:contain;
  background:#000;
}
/* Результат «проявляется», как снимок полароида. */
@keyframes reveal{
  from{ filter:blur(18px) brightness(1.6) saturate(.4); opacity:.2; transform:scale(1.02); }
  to{ filter:none; opacity:1; transform:none; }
}
.res-source{
  position:absolute;
  left:12px;
  bottom:12px;
  width:64px;
  height:64px;
  border-radius:var(--r-full);
  overflow:hidden;
  border:2px solid rgba(255,240,245,.8);
  box-shadow:var(--shadow);
  z-index:2;
}
.res-source img{ width:100%; height:100%; object-fit:cover; }
.res-actions{ display:flex; flex-wrap:wrap; gap:10px; }
.res-actions .btn-primary{ flex:1 1 180px; }
.res-note{
  display:flex;
  align-items:flex-start;
  gap:10px;
  color:var(--text-2);
  font-size:.84rem;
  line-height:1.5;
}
.res-note .i{ font-size:16px; color:var(--champagne); flex-shrink:0; margin-top:1px; }
.res-gallery{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));
  gap:10px;
}
.res-item{
  position:relative;
  aspect-ratio:3 / 4;
  border-radius:var(--r);
  overflow:hidden;
  background:#000;
  border:1px solid var(--border);
}
.res-item img,
.res-item video{ width:100%; height:100%; object-fit:cover; display:block; }
.res-item-dl{
  position:absolute;
  right:8px;
  bottom:8px;
  z-index:2;
  width:36px;
  height:36px;
  border-radius:var(--r-full);
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(15,10,13,.7);
  border:1px solid rgba(255,240,245,.2);
  color:#fff;
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
}
.res-item-dl .i{ font-size:16px; }
.res-item-n{ position:absolute; left:8px; top:8px; z-index:2; }

/* Шторка «до/после»: тянете ползунок — видно разницу. */
.ba{
  position:relative;
  width:100%;
  border-radius:var(--r-xl);
  overflow:hidden;
  background:#000;
  user-select:none;
  touch-action:pan-y;
  animation:reveal 900ms var(--ease) both;
}
.ba img{
  display:block;
  width:100%;
  max-height:64dvh;
  object-fit:contain;
  background:#000;
}
.ba-before{
  position:absolute;
  inset:0;
  clip-path:inset(0 calc(100% - var(--ba, 50%)) 0 0);
}
.ba-before img{ width:100%; height:100%; max-height:none; object-fit:contain; }
.ba-line{
  position:absolute;
  top:0;
  bottom:0;
  left:var(--ba, 50%);
  width:2px;
  margin-left:-1px;
  background:#fff;
  box-shadow:0 0 12px rgba(0,0,0,.5);
  pointer-events:none;
}
.ba-knob{
  position:absolute;
  top:50%;
  left:var(--ba, 50%);
  width:40px;
  height:40px;
  margin:-20px 0 0 -20px;
  border-radius:var(--r-full);
  background:#fff;
  color:#1A0E14;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--shadow);
  pointer-events:none;
}
.ba-knob .i{ font-size:16px; }
.ba-range{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  opacity:0;
  cursor:ew-resize;
  margin:0;
}
.ba-tag{ position:absolute; top:12px; z-index:2; }
.ba-tag.left{ left:12px; }
.ba-tag.right{ right:12px; }

/* ═══════════════════════════════════════════════════════════
   МОИ РАБОТЫ
   ═══════════════════════════════════════════════════════════ */
.works-toolbar{ margin-bottom:var(--s-5); }
.works-day{ margin-top:28px; }
.works-day:first-of-type{ margin-top:0; }
.works-day-title{
  font-size:.95rem;
  font-weight:750;
  color:var(--text-2);
  margin-bottom:12px;
}
.works-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(176px, 1fr));
  gap:14px;
}
.wcard{
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:3 / 4;
  border-radius:var(--r-lg);
  overflow:hidden;
  background:var(--surface-2);
  border:1px solid var(--border-subtle);
  text-align:left;
  color:var(--text);
  isolation:isolate;
  -webkit-tap-highlight-color:transparent;
  transition:transform var(--d) var(--ease), border-color var(--d) var(--ease), box-shadow var(--d) var(--ease);
}
.wcard:hover{ transform:translateY(-3px); border-color:var(--border-accent); box-shadow:var(--shadow); }
.wcard:active{ transform:scale(.985); }
.wcard-media{
  position:absolute;
  inset:0;
  z-index:-2;
  background:
    radial-gradient(120% 80% at 20% 10%, rgba(255,92,147,.2), transparent 60%),
    linear-gradient(160deg, #2A1822 0%, #140C11 100%);
}
.wcard-media img{ width:100%; height:100%; object-fit:cover; display:block; }
.wcard-media .i{
  position:absolute;
  inset:0;
  margin:auto;
  font-size:34px;
  color:var(--text-4);
}
.wcard::after{
  content:'';
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(180deg, rgba(10,6,8,.45) 0%, transparent 26%, transparent 50%, rgba(10,6,8,.92) 100%);
}
.wcard.is-dim .wcard-media img{ filter:grayscale(.6) brightness(.6); }
.wcard-top{
  position:absolute;
  top:10px;
  left:10px;
  right:10px;
  display:flex;
  justify-content:space-between;
  gap:6px;
}
.wcard-body{ position:absolute; left:12px; right:12px; bottom:12px; }
.wcard-title{
  font-size:.92rem;
  font-weight:750;
  line-height:1.25;
  text-shadow:0 1px 14px rgba(0,0,0,.65);
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.wcard-sub{ font-size:.78rem; color:rgba(246,237,239,.78); margin-top:3px; font-variant-numeric:tabular-nums; }
.wcard-spin{
  position:absolute;
  top:50%;
  left:50%;
  width:34px;
  height:34px;
  margin:-17px 0 0 -17px;
  border-radius:var(--r-full);
  border:2.5px solid rgba(255,240,245,.2);
  border-top-color:var(--accent);
  animation:spin 1s linear infinite;
}

/* ═══════════════════════════════════════════════════════════
   БАЛАНС
   ═══════════════════════════════════════════════════════════ */
.bal-layout{
  display:grid;
  grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr);
  gap:20px;
  align-items:start;
}
.bal-card{
  position:relative;
  overflow:hidden;
  padding:26px 26px 22px;
  border-radius:var(--r-2xl);
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(242,211,166,.20), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(217,44,104,.18), transparent 60%),
    linear-gradient(160deg, #2A1B20 0%, #170F13 100%);
  border:1px solid rgba(242,211,166,.18);
  box-shadow:var(--shadow);
  margin-bottom:16px;
}
.bal-label{ font-size:.88rem; font-weight:650; color:var(--text-2); }
.bal-value{
  display:flex;
  align-items:baseline;
  gap:10px;
  margin-top:6px;
  font-size:3rem;
  font-weight:800;
  letter-spacing:-.03em;
  line-height:1;
  color:var(--champagne);
  font-variant-numeric:tabular-nums;
}
.bal-value small{ font-size:1rem; font-weight:650; color:var(--text-3); letter-spacing:0; }
.bal-hint{ margin-top:10px; color:var(--text-2); font-size:.88rem; }
.bal-bonus{
  display:flex;
  align-items:center;
  gap:14px;
  padding:16px 18px;
  border-radius:var(--r-lg);
  background:linear-gradient(120deg, rgba(242,211,166,.2) 0%, rgba(255,138,91,.12) 100%);
  border:1px solid var(--champagne-ring);
  margin-bottom:16px;
}
.bal-bonus-big{
  font-family:var(--font-display);
  font-size:2rem;
  font-weight:700;
  color:var(--champagne);
  line-height:1;
  flex-shrink:0;
}
.bal-bonus-text{ font-size:.92rem; color:var(--text); line-height:1.45; }
.bal-bonus-text span{ color:var(--text-2); }
.bal-section-title{
  font-size:.95rem;
  font-weight:750;
  margin:4px 0 10px;
}
.pay-groups{ display:grid; gap:8px; margin-bottom:12px; }
.pay-group{
  display:flex;
  align-items:center;
  gap:14px;
  width:100%;
  padding:14px 16px;
  border-radius:var(--r-lg);
  background:rgba(255,240,245,.035);
  border:1px solid var(--border);
  text-align:left;
  color:var(--text);
  -webkit-tap-highlight-color:transparent;
  transition:border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.pay-group:hover{ border-color:var(--border-strong); background:rgba(255,240,245,.06); }
.pay-group.active{ border-color:var(--accent); background:var(--accent-bg); box-shadow:0 0 0 3px var(--accent-ring); }
.pay-group-icon{
  width:40px;
  height:40px;
  border-radius:var(--r);
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,240,245,.06);
  color:var(--text-2);
  flex-shrink:0;
}
.pay-group.active .pay-group-icon{ background:rgba(255,92,147,.18); color:var(--accent); }
.pay-group-icon .i{ font-size:20px; }
.pay-group-main{ flex:1; min-width:0; }
.pay-group-title{ font-size:.95rem; font-weight:750; }
.pay-group-sub{ font-size:.8rem; color:var(--text-3); margin-top:2px; }
.pay-radio{
  width:20px;
  height:20px;
  border-radius:var(--r-full);
  border:2px solid var(--border-strong);
  flex-shrink:0;
  position:relative;
}
.pay-group.active .pay-radio{ border-color:var(--accent); }
.pay-group.active .pay-radio::after{
  content:'';
  position:absolute;
  inset:3px;
  border-radius:inherit;
  background:var(--accent);
}
.pay-sub{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  padding:4px 2px 12px;
}
.pay-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  height:38px;
  padding:0 14px;
  border-radius:var(--r-full);
  background:rgba(255,240,245,.05);
  border:1px solid var(--border);
  color:var(--text);
  font-size:.86rem;
  font-weight:650;
  -webkit-tap-highlight-color:transparent;
  transition:border-color var(--d-fast) var(--ease-out), background var(--d-fast) var(--ease-out);
}
.pay-chip:hover{ border-color:var(--border-strong); }
.pay-chip.active{ border-color:var(--accent); background:var(--accent-bg); color:var(--text); }
.pay-total{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:14px 16px;
  margin:4px 0 14px;
  border-radius:var(--r);
  background:rgba(255,240,245,.035);
  border:1px solid var(--border-subtle);
  font-size:.9rem;
}
.pay-total > div{ display:flex; justify-content:space-between; gap:12px; }
.pay-total span{ color:var(--text-3); }
.pay-total b{ font-variant-numeric:tabular-nums; }
.pay-total .is-big b{ font-size:1.05rem; color:var(--champagne); }
.pay-wait{
  display:flex;
  flex-direction:column;
  align-items:center;
  text-align:center;
  gap:10px;
  padding:22px 16px;
  border-radius:var(--r-lg);
  background:rgba(255,240,245,.035);
  border:1px solid var(--border);
}
.pay-wait-title{ font-family:var(--font-display); font-size:1.3rem; font-weight:600; }
.pay-wait-sub{ color:var(--text-2); font-size:.88rem; max-width:360px; }
.pay-wait.is-ok{ border-color:var(--success-ring); background:var(--success-bg); }
.pay-wait .ok-icon{
  width:52px; height:52px;
  border-radius:var(--r-full);
  display:flex; align-items:center; justify-content:center;
  background:var(--success);
  color:#0B1A13;
}
.pay-wait .ok-icon .i{ font-size:24px; }

.history{ display:flex; flex-direction:column; }
.hrow{
  display:flex;
  align-items:center;
  gap:12px;
  padding:12px 4px;
  border-bottom:1px solid var(--border-subtle);
}
.hrow:last-child{ border-bottom:none; }
.hrow-icon{
  width:38px;
  height:38px;
  border-radius:var(--r);
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,240,245,.05);
  color:var(--text-2);
  flex-shrink:0;
}
.hrow-icon .i{ font-size:17px; }
.hrow-icon.in{ background:var(--success-bg); color:var(--success); }
.hrow-icon.back{ background:var(--champagne-bg); color:var(--champagne); }
.hrow-main{ flex:1; min-width:0; }
.hrow-title{ font-size:.9rem; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.hrow-sub{ font-size:.78rem; color:var(--text-3); margin-top:1px; }
.hrow-amount{
  font-size:.95rem;
  font-weight:800;
  white-space:nowrap;
  font-variant-numeric:tabular-nums;
  text-align:right;
}
.hrow-amount.plus{ color:var(--success); }
.hrow-amount.zero{ color:var(--text-3); }
.hrow-amount small{ display:block; font-size:.74rem; font-weight:650; color:var(--champagne); }

@media (max-width: 1080px){
  .bal-layout{ grid-template-columns:1fr; }
}
@media (max-width: 480px){
  .bal-value{ font-size:2.5rem; }
  .bal-card{ padding:22px 20px 18px; }
}

/* ═══════════════════════════════════════════════════════════
   ПРОФИЛЬ: шапка и сгруппированные списки
   ═══════════════════════════════════════════════════════════ */
.profile-head{
  display:flex;
  align-items:center;
  gap:18px;
  padding:22px;
  margin-bottom:18px;
  border-radius:var(--r-2xl);
  background:
    radial-gradient(100% 90% at 0% 0%, rgba(217,44,104,.2), transparent 60%),
    linear-gradient(160deg, #24161E 0%, #160E13 100%);
  border:1px solid var(--border);
}
.profile-avatar{
  width:64px;
  height:64px;
  border-radius:var(--r-full);
  overflow:hidden;
  flex-shrink:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:var(--gradient-accent);
  color:#fff;
  font-family:var(--font-display);
  font-size:1.6rem;
  font-weight:700;
  box-shadow:var(--shadow-glow);
}
.profile-avatar img{ width:100%; height:100%; object-fit:cover; }
.profile-main{ flex:1; min-width:0; }
.profile-name{
  font-family:var(--font-display);
  font-size:1.5rem;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.profile-meta{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.profile-balance{ text-align:right; flex-shrink:0; }
.profile-balance-label{ font-size:.8rem; color:var(--text-3); }
.profile-balance-value{
  font-size:1.6rem;
  font-weight:800;
  color:var(--champagne);
  font-variant-numeric:tabular-nums;
  line-height:1.1;
}

.profile-cols{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  gap:18px;
  align-items:start;
}
.list-group{
  border-radius:var(--r-xl);
  background:var(--surface-1);
  border:1px solid var(--border);
  overflow:hidden;
  margin-bottom:18px;
}
.list-group-title{
  font-size:.82rem;
  font-weight:700;
  color:var(--text-3);
  padding:14px 18px 6px;
}
.list-row{
  display:flex;
  align-items:center;
  gap:14px;
  width:100%;
  padding:13px 18px;
  text-align:left;
  color:var(--text);
  border-top:1px solid var(--border-subtle);
  -webkit-tap-highlight-color:transparent;
  transition:background var(--d-fast) var(--ease-out);
}
.list-group-title + .list-row{ border-top:none; }
button.list-row:hover,
a.list-row:hover{ background:rgba(255,240,245,.04); color:var(--text); }
.list-row-icon{
  width:34px;
  height:34px;
  border-radius:var(--r-sm);
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(255,240,245,.06);
  color:var(--text-2);
  flex-shrink:0;
}
.list-row-icon .i{ font-size:17px; }
.list-row-main{ flex:1; min-width:0; }
.list-row-title{ font-size:.92rem; font-weight:650; }
.list-row-sub{ font-size:.8rem; color:var(--text-3); margin-top:1px; }
.list-row-value{ font-size:.9rem; font-weight:700; color:var(--text-2); white-space:nowrap; }
.list-row .chev{ font-size:16px; color:var(--text-4); flex-shrink:0; }
.list-row.danger,
.list-row.danger .list-row-icon{ color:var(--danger); }
.list-row.danger .list-row-icon{ background:var(--danger-bg); }
.list-row.accent .list-row-icon{ background:var(--accent-bg); color:var(--accent); }
.list-pad{ padding:4px 18px 18px; }
.inline-form{ display:flex; gap:8px; }
.inline-form .input{ flex:1; min-width:0; }

@media (max-width: 1080px){
  .profile-cols{ grid-template-columns:1fr; }
}
@media (max-width: 560px){
  .profile-head{ flex-wrap:wrap; padding:18px; gap:14px; }
  .profile-balance{ text-align:left; width:100%; display:flex; align-items:baseline; justify-content:space-between; }
  .profile-name{ font-size:1.3rem; }
}

/* ═══════════════════════════════════════════════════════════
   ВХОД: КОМПОЗИЦИЯ
   Компьютер — атмосферная половина с названием и формой справа.
   Телефон — короткий заголовок сверху и форма.
   ═══════════════════════════════════════════════════════════ */
.auth-aside{
  display:none;
}
@media (min-width: 1024px){
  html[data-auth-state="auth"] #authScreen.auth{
    display:grid !important;
    grid-template-columns:minmax(0, 1.1fr) minmax(420px, .9fr);
    align-items:stretch;
    padding:0;
  }
  .auth-aside{
    position:relative;
    display:flex;
    flex-direction:column;
    justify-content:flex-end;
    padding:56px 64px;
    overflow:hidden;
    isolation:isolate;
    border-right:1px solid var(--border-subtle);
  }
  .auth-aside::before{
    content:'';
    position:absolute;
    inset:-20%;
    z-index:-1;
    background:
      radial-gradient(40% 35% at 30% 30%, rgba(217,44,104,.55), transparent 70%),
      radial-gradient(35% 30% at 70% 60%, rgba(201,74,52,.4), transparent 70%),
      radial-gradient(30% 30% at 40% 80%, rgba(242,211,166,.18), transparent 70%);
    filter:blur(40px);
    animation:auroraDrift 22s var(--ease-in-out) infinite alternate;
  }
  .auth-aside-kicker{ display:flex; align-items:center; gap:12px; margin-bottom:auto; }
  .auth-aside-kicker .brand-mark,
  .auth-aside-kicker .brand-logo{ width:40px; height:40px; }
  .auth-aside-kicker span{ font-family:var(--font-display); font-size:1.3rem; font-weight:600; }
  .auth-aside-title{
    font-family:var(--font-display);
    font-size:clamp(2.6rem, 4vw, 3.8rem);
    font-weight:600;
    line-height:1.04;
    letter-spacing:-.02em;
    max-width:620px;
  }
  .auth-aside-text{ color:var(--text-2); font-size:1.02rem; margin-top:16px; max-width:480px; }
  .auth-aside-list{ display:grid; gap:12px; margin-top:32px; max-width:480px; }
  .auth-aside-item{ display:flex; align-items:center; gap:12px; color:var(--text); font-size:.95rem; font-weight:600; }
  .auth-aside-item .i{
    width:36px; height:36px; padding:9px;
    border-radius:var(--r);
    background:rgba(255,240,245,.08);
    border:1px solid var(--border);
    color:var(--accent);
    flex-shrink:0;
  }
  .auth-aside + .auth-card{ align-self:center; justify-self:center; }
}
@keyframes auroraDrift{
  from{ transform:translate3d(-2%, -2%, 0) scale(1); }
  to{ transform:translate3d(3%, 2%, 0) scale(1.08); }
}

/* ═══════════════════════════════════════════════════════════
   ПОДТВЕРЖДЕНИЕ (карточка поверх экрана)
   ═══════════════════════════════════════════════════════════ */
.modal-overlay > .modal-card .modal-title{ font-size:1.3rem; padding-right:0; }
.modal-overlay > .modal-card .modal-body{ color:var(--text-2); }

.user-row{ display:flex; align-items:center; gap:6px; }
.user-row .user-card{ flex:1; min-width:0; }

.shelf-row.ig-pick-grid{ grid-template-columns:none; }
.gen-error-icon.is-info{ background:var(--champagne-bg); color:var(--champagne); }

/* ═══════════════════════════════════════════════════════════
   ДОВОДКА ПО СКРИНШОТАМ
   ═══════════════════════════════════════════════════════════ */
/* Карточка режима с картинкой: содержимое занимает ровно карточку,
   иначе нижняя строка с ценой уходит за край. */
.ig-mode-card[data-has-preview="true"] .ig-mode-content{ height:auto; }

/* Нижняя панель студии — сплошная, чтобы не просвечивало содержимое. */
.studio-foot{
  background:#170F14;
  border-top:1px solid var(--border-subtle);
  box-shadow:0 -14px 30px rgba(0,0,0,.35);
}

/* Пачки на своей странице: выбор сразу, без лишнего шага. */
.pack-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(210px, 1fr));
  gap:16px;
}
.pack-grid .pack-card{ aspect-ratio:auto; min-height:230px; }

@media (max-width: 960px){
  .dock{ bottom:calc(var(--bottom-nav-h) + 34px + env(safe-area-inset-bottom)); }
  .studio-media{ height:min(40dvh, 360px); }
  .studio-foot .modal-summary{ padding:10px 12px; gap:3px; font-size:.84rem; }
}

@media (max-width: 600px){
  /* Две колонки на телефоне: крупно, но не во весь экран. */
  .tpl-grid,
  .works-grid,
  .ig-pick-grid,
  .ig-modes,
  .pack-grid{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:10px;
  }
  .ig-mode-card{ min-height:210px; padding:14px; border-radius:var(--r-lg); }
  .ig-mode-card[data-has-preview="true"]{ min-height:236px; }
  .ig-mode-card[data-has-preview="true"] .ig-mode-content{ inset:14px; }
  .ig-mode-name{ font-size:1.12rem; }
  .ig-mode-desc{ font-size:.78rem; }
  .ig-mode-icon{ width:36px; height:36px; }
  .ig-mode-icon .i{ font-size:17px; }
  .pack-grid .pack-card{ min-height:200px; }
  .pack-card-size{ font-size:2.8rem; }

  .tpl-toolbar{ flex-direction:column; align-items:stretch; }
  .tpl-search{ width:100%; }
  .tpl-name,
  .ig-pick-name,
  .wcard-title{ font-size:.86rem; }
  .tpl-meta,
  .ig-pick-name,
  .wcard-body{ left:10px; right:10px; bottom:10px; }
  .tpl-top,
  .ig-pick-top,
  .wcard-top{ top:8px; left:8px; right:8px; }
  .chip{ height:22px; padding:0 7px; font-size:.7rem; }

  /* Полки витрины: видно две с лишним карточки — понятно, что дальше есть ещё. */
  .shelf{ margin-top:32px; }
  .shelf-title{ font-size:1.32rem; }
  .shelf-row{
    grid-auto-columns:42vw;
    margin:0 -14px;
    padding:4px 14px 10px;
    scroll-padding-left:14px;
    -webkit-mask-image:none;
    mask-image:none;
  }
  .shelf-row.is-wide{ grid-auto-columns:64vw; }

  .home-hero{ min-height:0; border-radius:var(--r-xl); }
  .home-hero-body{ padding:22px 20px; }
  .home-hero-title{ font-size:2.1rem; }
  .home-hero-text{ font-size:.92rem; margin-bottom:16px; }
  .home-hero::after{
    background:linear-gradient(0deg, rgba(10,6,8,.94) 0%, rgba(10,6,8,.55) 55%, rgba(10,6,8,.15) 100%);
  }
  .home-note{ font-size:.86rem; padding:12px 14px; }

  /* Баннер с роликом на телефоне: ролик сверху целиком, текст под ним,
     ничего не перекрывает сцену. Сетка, а не колонка flex: так размер
     рамки по пропорциям стабильно считают все браузеры. */
  .home-hero.has-frame{
    --hero-mh:clamp(220px, 40vh, 340px);
    display:grid;
    grid-template-columns:minmax(0, 1fr);
    grid-template-areas:"frame" "body";
    gap:0;
    min-height:0;
    padding:14px 0 0;
  }
  .home-hero.has-frame::after{
    background:linear-gradient(180deg, rgba(10,6,8,.3) 0%, rgba(10,6,8,.5) 45%, rgba(10,6,8,.9) 100%);
  }
  .home-hero.has-frame .hero-frame{
    grid-area:frame;
    justify-self:center;
    align-self:start;
    width:min(calc(100% - 28px), calc(var(--hero-mh) * var(--hero-ar, .5625)));
    margin:0;
    border-radius:var(--r-lg);
  }
  .home-hero.has-frame .home-hero-body{
    grid-area:body;
    max-width:none;
    padding:16px 18px 20px;
    text-align:center;
  }
  .home-hero.has-frame .home-hero-chips{ justify-content:center; margin-bottom:10px; }
  .home-hero.has-frame .home-hero-title{ font-size:1.8rem; margin-bottom:8px; }
  .home-hero.has-frame .home-hero-text{ margin:0 auto 16px; }
  .home-hero.has-frame .home-hero-actions{ gap:8px; }
  .home-hero.has-frame .home-hero-actions .btn{ flex:1 1 auto; padding:0 12px; }
  /* Вступление к пачкам на телефоне остаётся строкой: текст и небольшой
     ролик рядом — главное на этой странице всё-таки выбор пачки. */
  .home-hero.sh-intro{
    --hero-mh:200px;
    display:flex;
    align-items:center;
    gap:14px;
    padding:14px 14px 14px 18px;
  }
  .home-hero.sh-intro::after{
    background:linear-gradient(90deg, rgba(10,6,8,.85) 0%, rgba(10,6,8,.6) 55%, rgba(10,6,8,.35) 100%);
  }
  .home-hero.sh-intro .hero-frame{
    align-self:center;
    width:min(40%, calc(var(--hero-mh) * var(--hero-ar, .5625)));
  }
  .home-hero.sh-intro .home-hero-body{ padding:0; text-align:left; }
  .home-hero.sh-intro .home-hero-title{ font-size:1.35rem; }
  .home-hero.sh-intro .home-hero-text{ font-size:.86rem; margin:0; }
}

/* Старые браузеры без aspect-ratio: рамка по высоте баннера, ролик
   вписывается внутрь целиком (object-fit: contain). */
@supports not (aspect-ratio: 1 / 1){
  .hero-frame{ height:calc(var(--hero-h) - 54px); }
  @media (max-width: 600px){
    .home-hero.has-frame .hero-frame{ height:var(--hero-mh); }
  }
}

/* Пока видна капсула, внизу страницы оставляем под неё место,
   чтобы последние карточки не прятались. */
body.has-dock .main-content{ padding-bottom:120px; }
@media (max-width: 960px){
  body.has-dock .main-content{ padding-bottom:calc(var(--bottom-nav-h) + 110px + env(safe-area-inset-bottom)); }
}

/* Подписи внутри строк списков и способов оплаты — каждая на своей строке. */
.pay-group-title, .pay-group-sub,
.list-row-title, .list-row-sub,
.dock-row-title, .dock-row-sub{ display:block; }
