/* ============================================================
   image-editor.css — /image-edit как единый шелл с /image
   Панель — РОДНАЯ (settings-panel). Прячем только композер и
   родной пустой экран; холст и табы живут в фиде.
   ============================================================ */
body[data-page="image-edit"] .composer-wrap,
body[data-page="image-edit"] .studio-empty { display: none !important; }

.ie-feedroot { width: 100%; }

/* табы-слайдер */
.ie-tabs-wrap { display: flex; align-items: center; gap: 7px; margin-bottom: 18px; }
.ie-tab-arrow { flex: none; width: 32px; height: 32px; border-radius: 9px; background: rgba(255,255,255,.05); border: 1px solid var(--line, rgba(255,255,255,.1)); color: var(--text-2, #c7c7cf); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ie-tab-arrow:hover { background: rgba(255,255,255,.1); color: var(--text, #fff); }
.ie-tab-arrow.hide { visibility: hidden; }
.ie-tab-arrow svg { width: 16px; height: 16px; }
.ie-tabs-track { flex: 1; display: flex; gap: 8px; overflow-x: auto; scroll-behavior: smooth; scrollbar-width: none; }
.ie-tabs-track::-webkit-scrollbar { display: none; }
.ie-tab { flex: none; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; background: rgba(255,255,255,.04); border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 12px; padding: 10px 16px; color: var(--text-2, #c7c7cf); font-family: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; transition: background .14s, color .14s; }
.ie-tab svg { width: 17px; height: 17px; }
.ie-tab:hover { color: var(--text, #fff); }
.ie-tab.on { background: #ffffff; color: var(--accent-ink, #1a1f05); border-color: transparent; }

/* центр: зона загрузки / холст / результат */
#ie-canvas { display: flex; align-items: center; justify-content: center; min-height: 56vh; }

.ie-drop { width: 100%; max-width: 100%; border: 1.5px dashed var(--line, rgba(255,255,255,.16)); border-radius: 20px; padding: 52px 24px; text-align: center; background: rgba(255,255,255,.02); transition: border-color .15s, background .15s; }
.ie-drop.drag { border-color: rgba(228,244,130,.55); background: rgba(228,244,130,.05); }
.ie-drop-ic { width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 22px; background: #ffffff; color: var(--accent-ink, #1a1f05); display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 40px rgba(228,244,130,.25); }
.ie-drop-ic svg { width: 38px; height: 38px; }
.ie-drop h2 { font-family: var(--font-display, inherit); font-weight: 700; font-size: 26px; margin: 0 0 10px; color: var(--text, #fff); }
.ie-drop p { color: var(--text-2, #c7c7cf); font-size: 14px; margin: 0 auto 22px; max-width: 420px; line-height: 1.5; }
.ie-pick { display: inline-flex; align-items: center; gap: 9px; background: #ffffff; color: var(--accent-ink, #1a1f05); border: 0; border-radius: 13px; padding: 13px 24px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
.ie-pick svg { width: 18px; height: 18px; }

.ie-stage { position: relative; display: inline-flex; line-height: 0; }
.ie-base { display: block; max-width: 100%; max-height: 64vh; width: auto; height: auto; border-radius: 12px; }
.ie-mask { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; }
.ie-brush-dot { position: absolute; border: 1.5px solid rgba(228,244,130,.9); border-radius: 50%; pointer-events: none; transform: translate(-50%, -50%); display: none; }

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

.ie-result { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.ie-result img { max-width: 100%; max-height: 64vh; border-radius: 14px; }
.ie-result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.ie-rbtn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; background: rgba(255,255,255,.05); color: var(--text, #fff); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 12px; padding: 12px 18px; font-family: inherit; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.ie-rbtn:hover { background: rgba(228,244,130,.12); border-color: var(--accent, #E4F482); color: var(--accent, #E4F482); }
.ie-rbtn svg { width: 17px; height: 17px; }
.ie-rbtn.primary { background: #ffffff; color: var(--accent-ink, #1a1f05); border: 0; }

/* ── панель параметров В РОДНОЙ settings-panel (под карточкой модели) ── */
.ie-extra { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 4px; }
.ie-plbl { font-size: 11px; font-weight: 600; color: var(--text-3, #8a8a93); margin-bottom: 7px; }
.ie-phint { font-size: 12.5px; color: var(--text-3, #8a8a93); line-height: 1.45; }

.ie-seg { display: flex; gap: 5px; background: rgba(255,255,255,.04); border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 11px; padding: 4px; }
.ie-seg-b { flex: 1; display: flex; align-items: center; justify-content: center; background: transparent; border: 0; border-radius: 8px; padding: 9px; color: var(--text-2, #c7c7cf); cursor: pointer; }
.ie-seg-b svg { width: 16px; height: 16px; }
.ie-seg-b.active, .ie-seg-w.active { background: #ffffff; color: var(--accent-ink, #1a1f05); }
.ie-seg-w { flex: 1; background: transparent; border: 0; border-radius: 8px; padding: 8px; color: var(--text-2, #c7c7cf); font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }

.ie-select { position: relative; }
.ie-select select { width: 100%; appearance: none; -webkit-appearance: none; color-scheme: dark; background: rgba(255,255,255,.04); color: var(--text, #fff); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 10px; padding: 10px 32px 10px 12px; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.ie-select select:focus { outline: none; border-color: var(--accent, #E4F482); }
.ie-select select option { background: #17171e; color: #f3f3f5; }
.ie-select svg { position: absolute; right: 11px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3, #8a8a93); pointer-events: none; }

.ie-range { width: 100%; accent-color: var(--accent, #E4F482); }
.ie-ta { width: 100%; box-sizing: border-box; resize: none; min-height: 132px; background: rgba(255,255,255,.04); color: var(--text, #fff); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 11px; padding: 11px 13px; font-family: inherit; font-size: 13.5px; line-height: 1.4; }
.ie-ta:focus { outline: none; border-color: var(--accent, #E4F482); }

.ie-pbtn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: rgba(255,255,255,.04); border: 1px solid var(--line, rgba(255,255,255,.1)); border-radius: 10px; padding: 10px; color: var(--text-2, #c7c7cf); font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.ie-pbtn svg { width: 16px; height: 16px; }
.ie-ref-thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; }
.ie-ref-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ie-ref-x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(10,10,14,.7); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }

.ie-apply { display: flex; align-items: center; justify-content: center; gap: 8px; background: #ffffff; color: var(--accent-ink, #1a1f05); border: 0; border-radius: 12px; padding: 14px; font-family: inherit; font-weight: 700; font-size: 14.5px; cursor: pointer; margin-top: 2px; }
.ie-apply svg { width: 18px; height: 18px; }
.ie-apply:hover { filter: brightness(1.05); }
.ie-apply:disabled { opacity: .6; cursor: default; }

@media (max-width: 900px) { #ie-canvas { min-height: 42vh; } .ie-base, .ie-result img { max-height: 48vh; } }

/* ── подсказки «шаг 1-2-3» в пустом экране редактора ── */
.ie-drop.with-steps { padding: 30px 22px; max-width: 100%; }
.ie-replace { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 8px; background: transparent; color: var(--text-2, #c7c7cf); border: 1px solid var(--line, rgba(255,255,255,.14)); border-radius: 12px; padding: 11px 16px; font-family: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
.ie-replace:hover { background: rgba(255,255,255,.05); color: var(--text, #fff); }
.ie-replace svg { width: 16px; height: 16px; }
.ie-steps-lbl { font-size: 10.5px; color: var(--text-2, #8a8a93); text-transform: uppercase; letter-spacing: .05em; margin: 2px 0 11px; }
.ie-steps { display: flex; gap: 10px; margin: 0 0 22px; }
.ie-step { flex: 1; min-width: 0; background: rgba(255,255,255,.03); border: 1px solid var(--line, rgba(255,255,255,.08)); border-radius: 12px; padding: 13px 12px; text-align: left; position: relative; }
.ie-step-n { position: absolute; top: 9px; right: 9px; width: 19px; height: 19px; border-radius: 6px; background: #ffffff; color: var(--accent-ink, #1a1f05); font-weight: 800; font-size: 11px; display: flex; align-items: center; justify-content: center; }
.ie-step-ic { width: 30px; height: 30px; border-radius: 8px; background: rgba(228,244,130,.12); color: var(--accent, #E4F482); display: flex; align-items: center; justify-content: center; margin-bottom: 9px; }
.ie-step-ic svg { width: 17px; height: 17px; }
.ie-step b { display: block; font-size: 12.5px; color: var(--text, #fff); margin-bottom: 3px; }
.ie-step span { font-size: 11px; color: var(--text-2, #8a8a93); line-height: 1.35; }
@media (max-width: 720px) { .ie-steps { flex-direction: column; } .ie-drop.with-steps { max-width: 380px; } }

/* ── Ползунок длительности видео (модели с непрерывным диапазоном) ── */
.ve-dur-val { color: var(--accent, #E4F482); font-weight: 700; margin-left: 6px; }
.ve-dur-range {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 6px; background: #242430; outline: none;
  margin: 10px 0 6px; cursor: pointer;
}
.ve-dur-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent, #E4F482); cursor: pointer;
  border: 3px solid #12121a; box-shadow: 0 0 0 1px var(--accent, #E4F482);
}
.ve-dur-range::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent, #E4F482);
  cursor: pointer; border: 3px solid #12121a;
}
.ve-dur-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3, #7a7a82); }
