/* ============================================================
   faceswap.css — «Face Swap» (/faceswap)
   Раскладка студии: ЛЕВО (лента) — превью/результат,
   ПРАВО (панель настроек) — шейпы + бегунок + «Сгенерировать».
   ============================================================ */

/* прячем ненужные части студийного шаблона; панель настроек оставляем */
body[data-page="faceswap"] .studio-empty,
body[data-page="faceswap"] .composer-wrap { display: none !important; }
/* дефолтные блоки настроек (модель/стиль/размер/…) — их место занимают наши контролы */
body[data-page="faceswap"] .settings-panel > .set-select,
body[data-page="faceswap"] .settings-panel > .set-block,
body[data-page="faceswap"] .settings-panel > .set-row,
body[data-page="faceswap"] .settings-panel > .set-sep,
body[data-page="faceswap"] .settings-panel > .set-collapse,
body[data-page="faceswap"] .settings-panel > .ideas-panel,
body[data-page="faceswap"] .settings-panel > .reset-btn { display: none !important; }

/* ---------- ЛЕВО: превью/результат в ленте ---------- */
.fs-preview { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; position: relative; }
.fs-stage { position: relative; width: 100%; max-width: 660px; aspect-ratio: 3/4; max-height: min(74vh, 720px); border-radius: 20px; overflow: hidden; background: var(--surface-2, rgba(255,255,255,.03)); border: 1px solid var(--line, rgba(255,255,255,.08)); }

/* пустой холст «Здесь появится результат» */
.fs-canvas { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; padding: 34px; border-style: dashed; }
.fs-canvas-ic { width: 66px; height: 66px; border-radius: 18px; background: rgba(255,255,255,.05); display: flex; align-items: center; justify-content: center; color: var(--accent, #d1fe17); transition: color .2s; }
.fs-canvas.is-video .fs-canvas-ic { color: var(--accent-2, #e4ff6b); }
.fs-canvas-ic svg { width: 32px; height: 32px; }
.fs-canvas b { font-size: 16px; color: var(--text, #fff); }
.fs-canvas span { font-size: 13.5px; color: var(--text-2, #9a9aa2); max-width: 300px; line-height: 1.45; }
.fs-canvas-badge { margin-top: 4px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--accent-soft, rgba(209,254,23,.14)); color: var(--accent-2, #e4ff6b); }

/* before/after + одиночное превью + видео (в ленте) */
.fs-cmp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.fs-cmp-before { will-change: clip-path; }
.fs-rmedia { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
.fs-cmp-single .fs-rmedia { object-fit: cover; }
.fs-cmp { user-select: none; -webkit-user-select: none; }
.fs-cmp-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: rgba(255,255,255,.92); transform: translateX(-1px); cursor: ew-resize; touch-action: none; z-index: 2; }
.fs-cmp-grip { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 38px; height: 38px; border-radius: 50%; background: #fff; color: #111; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.fs-cmp-grip svg { width: 20px; height: 20px; }
.fs-cmp-tag { position: absolute; bottom: 12px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(10,10,14,.6); color: #fff; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); z-index: 1; }
.fs-cmp-tag.before { left: 12px; } .fs-cmp-tag.after { right: 12px; }

.fs-ractions { display: flex; gap: 10px; }
.fs-rbtn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; background: var(--accent, #d1fe17); color: var(--accent-ink, #111); border: 0; border-radius: 12px; padding: 11px 18px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.fs-rbtn.ghost { background: rgba(255,255,255,.05); color: var(--text, #fff); border: 1px solid var(--line, rgba(255,255,255,.12)); }
.fs-rbtn:hover { filter: brightness(1.05); }
.fs-rbtn svg { width: 17px; height: 17px; }

.fs-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: rgba(10,10,14,.66); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); border-radius: 20px; color: #fff; font-size: 14px; z-index: 3; }
.fs-spin { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.2); border-top-color: var(--accent, #d1fe17); border-radius: 50%; animation: fs-spin .8s linear infinite; }
@keyframes fs-spin { to { transform: rotate(360deg); } }

/* ---------- ПРАВО: контролы в панели настроек (на всю высоту) ---------- */
.fs-controls { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 14px; }
.fs-zones { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
/* оба шейпа делят высоту поровну и НЕ меняют её при загрузке */
.fs-zone { flex: 1 1 0; position: relative; min-height: 175px; border: 1.5px dashed var(--line, rgba(255,255,255,.16)); border-radius: 16px; background: rgba(255,255,255,.03); cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; display: flex; align-items: center; justify-content: center; }
.fs-zone:hover, .fs-zone.drag { border-color: var(--accent-ring, rgba(209,254,23,.4)); background: var(--accent-soft, rgba(209,254,23,.08)); }
.fs-zone.has { border-style: solid; background: #0d0d13; }
/* загруженное фото/видео — целиком, без обрезки */
.fs-thumb { width: 100%; height: 100%; object-fit: contain; background: #0d0d13; }
.fs-ph { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 9px; padding: 18px; color: var(--text-2, #c7c7cf); width: 100%; }
.fs-ph-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.05); display: flex; align-items: center; justify-content: center; color: var(--accent, #d1fe17); }
.fs-ph-ic svg { width: 22px; height: 22px; }
.fs-ph-tx { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.fs-ph b { font-size: 14px; color: var(--text, #fff); font-weight: 600; }
.fs-ph-tx span { font-size: 12.5px; line-height: 1.4; max-width: 240px; }
.fs-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(10,10,14,.72); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.fs-x:hover { background: rgba(10,10,14,.92); }

.fs-typerow { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; }
.fs-typelbl { font-size: 14px; font-weight: 600; color: var(--text, #fff); }
.fs-toggle { display: inline-flex; gap: 3px; background: rgba(255,255,255,.06); border-radius: 999px; padding: 4px; }
.fs-tg { border: 0; background: transparent; color: var(--text-2, #9a9aa2); width: 42px; height: 32px; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s; }
.fs-tg svg { width: 19px; height: 19px; }
.fs-tg.on { background: var(--accent, #d1fe17); color: var(--accent-ink, #111); }

.fs-err { flex: 0 0 auto; color: #ff8da3; font-size: 13.5px; }
.fs-go { flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--accent, #d1fe17); color: var(--accent-ink, #111); border: 0; border-radius: 14px; padding: 15px 20px; font-family: inherit; font-weight: 800; font-size: 15.5px; cursor: pointer; transition: filter .15s, transform .06s; margin-top: 2px; }
.fs-go:hover { filter: brightness(1.04); } .fs-go:active { transform: scale(.99); }
.fs-go:disabled { opacity: .55; cursor: default; }
.fs-go svg { width: 19px; height: 19px; }
.fs-cost { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 800; }
.fs-coin { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; display: inline-block; background: linear-gradient(160deg, #f0d97a, #c79a2e); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }

/* ---------- планшет/мобилка: панель настроек показываем, всё в столбик ---------- */
@media (max-width: 1100px) {
  body[data-page="faceswap"] .studio-main { flex-direction: column; height: auto; min-height: 100vh; }
  body[data-page="faceswap"] .studio-chat { height: auto; }
  body[data-page="faceswap"] .studio-feed { height: auto; min-height: 44vh; }
  body[data-page="faceswap"] .settings-panel { display: flex !important; width: auto; flex: none; height: auto; border-left: 0; border-top: 1px solid var(--line, rgba(255,255,255,.1)); }
  .fs-stage { max-width: 460px; aspect-ratio: 1/1; }
  /* шейпы — фиксированной высоты, в столбик, миниатюра заполняет карточку */
  .fs-controls { flex: none; }
  .fs-zones { flex: none; }
  .fs-zone { flex: none; min-height: 128px; }
  .fs-zone.has { min-height: 128px; }
  .fs-thumb { object-fit: cover; }
  .fs-ph { flex-direction: row; text-align: left; gap: 12px; }
  .fs-ph-tx { align-items: flex-start; }
  .fs-ph-tx span { max-width: none; }
}
@media (max-width: 560px) {
  .fs-cmp-grip { width: 34px; height: 34px; }
}
