/* Menu */
nav {	
	border-bottom: 1px solid #30363d;
	background: rgba(11, 15, 26, 0.8);
  backdrop-filter: blur(10px);	
	display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
	height: 40px;
	position: fixed;
  top: 0;
  left: 0;
  width: 100%;
	z-index: 1000;
	height: 40px;
}

.menu {
  display: flex;
  gap: 20px;
	margin-left: 20px;
}

.menu a {
  text-decoration: none;
  color: #b8c1d1;
  font-size: 14px;
  transition: 0.2s;
}

.menu a:hover {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(124, 92, 255, 0.6);
}

/* ============================================================
   MOBILE NAV + HAMBURGER
   ============================================================ */

.nav-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 12px;
}

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: #b8c1d1;
  transition: .25s cubic-bezier(.4,0,.2,1);
  transform-origin: center;
}

.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile drawer */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 40px;
  left: 0;
  right: 0;
  background: rgba(10,14,24,0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(120,180,255,0.1);
  z-index: 999;
  padding: 8px 20px 20px;
  transform: translateY(-6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.mobile-drawer.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav a {
  display: block;
  padding: 11px 4px;
  color: #b8c1d1;
  text-decoration: none;
  font-size: 15px;
  border-bottom: 0.5px solid rgba(255,255,255,0.07);
  transition: color .15s;
}

.mobile-nav a:last-child { border-bottom: none; }

.mobile-nav a:hover { color: #fff; }

/* Show hamburger and hide desktop menu on small screens */
@media (max-width: 700px) {
  .hamburger { display: flex !important; }
  .mobile-drawer { display: block; }
  .menu { display: none; }
}


/* =============================================================
   AI Stock Metadata Generator — style.css
   ============================================================= */


/* =============================================================
   ЦВЕТОВЫЕ ПЕРЕМЕННЫЕ И БАЗОВЫЕ ТОКЕНЫ
   Используются через var(--название) во всём файле.
   Чтобы поменять акцентный цвет — достаточно изменить здесь.
   ============================================================= */

:root {
  --purple:    #7c5cff;           /* Основной фиолетовый акцент */
  --cyan:      #00e5ff;           /* Вторичный голубой акцент */
  --success:   #00e5a0;           /* Зелёный — успех, кнопка Download All */
  --error:     #ff5c7a;           /* Красный — ошибки, drag-reject */
  --text-muted: #b8c1d1;          /* Приглушённый текст (подписи, плейсхолдеры) */
  --text-dim:   #7c8599;          /* Ещё более тусклый текст (имя файла, subtitle) */
  --text-link:  #7aa2ff;          /* Голубоватый — model-info, счётчики */
  --radius:     10px;             /* Базовый радиус скругления */
  --font-mono:  monospace;        /* Моноширинный шрифт для кнопки ZIP */
}

.card-block {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-bottom: 20px;
  width: 100%;
}

.card-item {
  width:100%;
	max-width: 49%;
	border: 1px solid rgba(124, 92, 255, 0.15);
	border-radius:10px;
	padding:20px;
}

.card-title {
      font-size: 11px;
      letter-spacing: 0.12em;
      text-transform: uppercase;
      color: var(--text-muted);
      margin-bottom: 18px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .card-title::after {
      content: '';
      flex: 1;
      height: 1px;
      background: rgba(100, 159, 255, 0.411);
    }

	#card-title-images{margin-top:40px;}

/* =============================================================
   ПРОГРЕСС-БАР
   Фиксированная полоска у верхнего края страницы.
   Показывает прогресс обработки очереди файлов.
   ============================================================= */

/* Обёртка прогресс-бара — фиксирована вверху страницы */
#progress {
  width: 100%;
  height: 6px;
  position: fixed;
  top: 40px;
  left: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transition: opacity 0.3s ease;
}

/* Скрытое состояние прогресс-бара (класс добавляется из JS) */
#progress.hidden {
  opacity: 0;
}

/* Заполняющая полоска — её ширина меняется из JS через style.width */
#progress .bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #7c5cff, #00e5ff, #7c5cff);
  background-size: 200% 100%;
  transition: width 0.5s ease;
  box-shadow:
    0 0 10px rgba(124, 92, 255, 0.3),
    0 0 20px rgba(0, 229, 255, 0.2);
}

/* Анимация свечения запускается когда идёт обработка (класс .active на #progress) */
#progress.active .bar {
  animation: glowMove 2s linear infinite;
}

@keyframes glowMove {
  0%   { background-position: 0%   50%; }
  100% { background-position: 200% 50%; }
}


/* =============================================================
   ШАПКА ВЫБОРА МОДЕЛИ И ПЛАТФОРМЫ
   Горизонтальный ряд с двумя <select>: модель и платформа.
   ============================================================= */

/* Контейнер всей строки выбора */
.select-model {
  padding: 20px 0 0 0;
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

/* Обёртка одного <select> с подписью («Model:» / «Platform:») */
.sel {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-left: 5px;	
}

.sel span {
  white-space: nowrap;
	font-size: 12px;
	padding-right: 5px;
}


/* =============================================================
   ПОЛЯ ФОРМЫ: LABEL И SELECT
   ============================================================= */

/* Скрываем стрелки у <input type="number"> во всех браузерах */
input[type="number"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

/* Базовый стиль для всех <label> на странице */
label {
  position: relative;
  width: fit-content;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: #b8c1d1;
}

/* Псевдоэлемент зарезервирован для стрелки-индикатора (сейчас отключён) */
label::after {
  /* content: "⌄"; */
  position: absolute;
  right: 14px;
  bottom: 14px;
  color: #7aa2ff;
  font-size: 14px;
  pointer-events: none;
}

/* Общий стиль для обоих <select>: модель и платформа */
#model, #platform {
  width: 100%;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background:
    linear-gradient(
      180deg,
      rgba(20, 28, 45, 0.95),
      rgba(12, 18, 32, 0.98)
    );
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

#model:hover, #platform:hover {
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.08);
}

#model:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow:
    0 0 0 3px rgba(124, 92, 255, 0.15),
    0 0 18px rgba(124, 92, 255, 0.2);
  transform: translateY(-1px);
}

/* Цвет фона выпадающих опций (поддерживается не всеми браузерами) */
option {
  background: #101826;
  color: #ffffff;
}


/* =============================================================
   ПАНЕЛЬ НАСТРОЕК (Title max chars / Desc max chars / Keywords)
   Динамически создаётся через JS (initSettingsUI).
   ============================================================= */

/* Горизонтальный flex-контейнер для трёх числовых полей */
#settingsPanel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin: 16px 0;
}

.mirror-settingsPanel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin: 16px 0;
}

/* <label> внутри панели — переопределяем базовый стиль label */
#settingsPanel label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: #b8c1d1;
}

/* Числовые <input> в панели настроек — стилизованы под #model */
#settingsPanel input[type="number"] {
  width: 150px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.95), rgba(12, 18, 32, 0.98));
  color: #ffffff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  text-align: right;
}

/* Класс .is-focused добавляется/убирается из JS при фокусе */
#settingsPanel input[type="number"]:focus,
#settingsPanel input[type="number"].is-focused {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15), 0 0 18px rgba(124, 92, 255, 0.2);
}


/* ===== KEYWORD RULES (всегда открыт, каждый инструмент со своей строки) ===== */

.keyword-rules-panel {
  margin-top: 0px;
  padding-top: 14px;
  /* border-top: 1px solid rgba(124, 92, 255, 0.15); */
}

.kr-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 10px;
}

.kr-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kr-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
	width: 100%;   /* перекрывает базовый label { width: fit-content } */
}

.kr-field textarea,
.kr-field select {
  width: 100%;
  box-sizing: border-box;     /* ключевое: padding теперь входит в 100%, а не добавляется сверху */
  min-height: 34px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20,28,45,0.95), rgba(12,18,32,0.98));
  color: #ffffff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, height .1s ease;
}

.kr-field textarea {
  /* resize: none;      /* высота теперь управляется JS, ручное растягивание больше не нужно */
  overflow: hidden;
	field-sizing: content;
  max-height: 300px; /* по вкусу */
}

.kr-field select {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.kr-field textarea:focus,
.kr-field select:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

.kr-checks {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.kr-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

.kr-checkbox input {
  accent-color: #7c5cff;
  cursor: pointer;
}


/* ===== MODEL COMPARISON — внизу карточки Settings ===== */

.puter-model-comparison {
  display: block;
  width: fit-content;
  margin: 16px 0 0 auto;
}


/* ===== KEYWORD TOOLBAR (кнопка ⚙ Tools над textarea Keywords) ===== */

.kw-toolbar {
  position: relative;
  align-self: flex-start;
  margin-bottom: 4px;
}

.kw-tools-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-link);
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s ease;
}

.kw-tools-btn:hover {
  color: #ffffff;
}

.kw-tools-btn .kw-icon {
  font-size: 12px;
  line-height: 1;
}

.kw-caret {
  font-size: 9px;
  line-height: 1;
  transition: transform 0.15s ease;
  color: var(--text-dim);
}

.kw-tools-btn.open .kw-caret {
  transform: rotate(180deg);
}

.kw-tools-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: max-content;
  min-width: 200px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20,28,45,0.98), rgba(10,16,28,0.98));
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45), 0 0 20px rgba(124,92,255,0.1);
  animation: kwMenuIn 0.15s ease;
  transform-origin: top left;
}

@keyframes kwMenuIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.kw-tools-menu.open { display: block; }

.kw-tools-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  color: #e6e6e6;
  font-size: 12.5px;
  font-family: inherit;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease;
}

.kw-tools-menu button:hover {
  background: rgba(124, 92, 255, 0.15);
  color: #ffffff;
}

.kw-tools-menu .kw-icon {
  flex-shrink: 0;
  width: 15px;
  text-align: center;
  font-size: 12px;
  line-height: 1;
}

.field-change-info {
  font-size: 11px;
  color: var(--success);
  margin-top: 2px;
  min-height: 14px;
}


/* ===== BATCH TOOLS (боковая панель, прозрачная) ===== */

.batch-tools-panel {
  position: fixed;
  right: -340px;
  top: 0;
  height: 100%;
  width: 340px;
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.99), rgba(10, 16, 28, 0.99));
  border-left: 1px solid rgba(124, 92, 255, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: right 0.25s ease;
  z-index: 1000;
  padding: 20px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 255, 0.4) transparent;
}

.batch-tools-panel.open { right: 0; }

.btp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
  margin: -20px -24px 16px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(124, 92, 255, 0.12);
}

.btp-header button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.btp-header button:hover {
  background: rgba(255, 92, 122, 0.1);
  border-color: rgba(255, 92, 122, 0.3);
  color: #ff5c7a;
}

.btp-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.btp-body button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btp-body button .kw-icon {
  flex-shrink: 0;
  width: 15px;
  text-align: center;
  font-size: 12px;
  line-height: 1;
}

.btp-body button:hover {
  border-color: rgba(0, 229, 255, 0.3);
  color: #ffffff;
  background: rgba(124, 92, 255, 0.12);
}

.btp-summary {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 12px;
}

.kw-tools-menu button {width:100% !important; margin: 2px 0;}


/* =============================================================
   ДРОПЗОНА (зона загрузки файлов)
   Поддерживает три состояния: обычное, dragover, drag-reject.
   ============================================================= */

#dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 180px;
  padding: 30px;
  border-radius: 10px;
  border: 1px dashed rgba(124, 92, 255, 0.35);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.015)
    );
  backdrop-filter: blur(12px);
  color: #b8c1d1;
  font-size: 16px;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

#dropzone:hover {
  border-color: rgba(0, 229, 255, 0.6);
  background:
    linear-gradient(
      180deg,
      rgba(124, 92, 255, 0.06),
      rgba(0, 229, 255, 0.03)
    );
  box-shadow:
    0 0 20px rgba(124, 92, 255, 0.15),
    0 0 40px rgba(0, 229, 255, 0.08);
  transform: translateY(-2px);
}

/* Файл перетаскивается над дропзоной — подсветка голубым */
#dropzone.dragover {
  border-color: #00e5ff;
  background:
    linear-gradient(
      180deg,
      rgba(0, 229, 255, 0.08),
      rgba(124, 92, 255, 0.06)
    );
  box-shadow:
    0 0 25px rgba(0, 229, 255, 0.25),
    0 0 50px rgba(124, 92, 255, 0.15);
  color: #ffffff;
}

/* Перетаскивается неподдерживаемый формат — красная рамка */
#dropzone.drag-reject {
  border-color: var(--error);
  background: rgba(255, 92, 106, 0.07);
}

/* Внутреннее содержимое дропзоны: иконка + текст */
.dropzone-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dropzone-icon {
  font-size: 32px;
  color: #7c5cff;
  text-shadow:
    0 0 10px rgba(124, 92, 255, 0.4),
    0 0 20px rgba(0, 229, 255, 0.2);
}

.dropzone-title {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
}

.dropzone-subtitle {
  font-size: 14px;
  color: #7c8599;
}


/* =============================================================
   ИНФОРМАЦИЯ О ФАЙЛАХ И ПРЕВЬЮ
   ============================================================= */

/* Строка «N images selected» под дропзоной */
#fileInfo {
  margin: 10px 0;
}

/* Сетка миниатюр выбранных файлов */
#preview {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-items: flex-start;
  margin-top: 20px;
}

/* Скрываем контейнер превью если он пустой */
#preview:empty {
  display: none;
}

/* Каждая миниатюра — квадрат 50×50 */
#preview img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  display: block;
  border-radius: 5px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.04),
      rgba(255, 255, 255, 0.02)
    );
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 4px 20px rgba(0, 0, 0, 0.25);
}

#preview img:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow:
    0 0 20px rgba(124, 92, 255, 0.12),
    0 0 40px rgba(0, 229, 255, 0.08);
}

/* Плашка «+N more...» когда файлов больше MAX_PREVIEW */
.preview-more {
  display: flex;
  align-items: center;
  padding: 8px;
  color: #888;
  font-size: 0.85rem;
}


/* =============================================================
   КНОПКА «GENERATE AI METADATA»
   Градиентная кнопка запуска обработки очереди.
   ============================================================= */

#startBtn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(90deg, #7c5cff, #00e5ff);
  color: #0b1220;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
  box-shadow:
    0 0 18px rgba(124, 92, 255, 0.25),
    0 0 32px rgba(0, 229, 255, 0.12);
  overflow: hidden;
  margin: 20px 0;
	width: 100%;
}

#startBtn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow:
    0 0 24px rgba(124, 92, 255, 0.35),
    0 0 42px rgba(0, 229, 255, 0.18);
}

#startBtn:active {
  transform: translateY(0);
}

/* Блик-оверлей поверх градиента (декоративный) */
#startBtn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 40%);
  pointer-events: none;
}

/* Задизейбленное состояние — пока идёт обработка */
#startBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}


/* =============================================================
   КНОПКА «DOWNLOAD ALL AS ZIP»
   Зелёная акцентная кнопка. Скрыта (display:none) до первого
   успешного результата — показывается из JS.
   ============================================================= */

#downloadAllBtn {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(0, 229, 160, 0.35);
  background: rgba(0, 229, 160, 0.06);
  color: var(--success);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
  margin: 20px 0;
  display: none;
}

#downloadAllBtn:hover:not(:disabled) {
  background: rgba(0, 229, 160, 0.12);
  border-color: var(--success);
  box-shadow: 0 0 24px rgba(0, 229, 160, 0.2);
  transform: translateY(-1px);
}

#downloadAllBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}


/* =============================================================
   КАРТОЧКИ РЕЗУЛЬТАТОВ (#results и .result)
   Каждый обработанный файл получает свою карточку .result.
   ============================================================= */

/* Сетка карточек результатов — одна колонка с зазорами */
#results {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 24px;
}

/* Одна карточка результата: превью слева, поля справа */
.result {
  display: flex;
  gap: 18px;
  padding: 16px;
  border-radius: 10px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.03),
      rgba(255, 255, 255, 0.015)
    );
  border: 1px solid rgba(124, 92, 255, 0.15);
  backdrop-filter: blur(12px);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.result:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow:
    0 0 20px rgba(124, 92, 255, 0.12),
    0 0 40px rgba(0, 229, 255, 0.06);
}

/* Левая колонка карточки: квадратная миниатюра + имя файла */
.thumb {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 160px;
}

.thumb img {
  width: 160px;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Имя файла под миниатюрой — обрезается многоточием если длинное */
.filename {
  font-size: 12px;
  color: #7c8599;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Правая колонка карточки: метаданные, статус, поля */
.result > div:last-child {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Строка «Model: ... | Platform: ...» */
.model-info {
  font-size: 12px;
  color: #7aa2ff;
}


/* =============================================================
   ПОЛЯ МЕТАДАННЫХ (Title / Description / Keywords)
   Каждое поле: подпись → textarea + кнопка копирования → счётчик.
   ============================================================= */

/* Контейнер всех трёх полей */
.fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Одно поле (Title, Description или Keywords) */
.field {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-direction: column;
}

/* Подпись поля: «Title» / «Description» / «Keywords» */
.field-name {
  font-size: 12px;
  color: #7aa2ff;
  margin-bottom: 2px;
}

/* Горизонтальная обёртка: textarea + кнопка копирования */
.field-inner {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

/* Редактируемое текстовое поле.
   Высота подстраивается автоматически через JS (autoResize). */
.field textarea {
  flex: 1;
  min-height: 40px;
  max-height: 300px;
  resize: none;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  color: #e6e6e6;
  outline: none;
  font-size: 13px;
  overflow: hidden;
  transition: height 0.15s ease;
}

.field textarea:focus {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
}

/* Кнопка копирования (⧉) рядом с textarea */
.field button {
  width: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(122, 162, 255, 0.1);
  color: #7aa2ff;
  cursor: pointer;
  transition: 0.2s ease;
}

.field button:hover {
  background: rgba(0, 229, 255, 0.15);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2);
}

/* Счётчик символов/слов под полем.
   Цвет меняется через JS: добавляется один из трёх классов ниже. */
.field-counter {
  font-size: 12px;
  text-align: right;
  padding-right: 48px; /* Отступ чтобы счётчик не наезжал на кнопку копирования */
  transition: color 0.2s;
}

.field-counter.ok-chars   { color: #7aa2ff; } /* В пределах лимита (символы) */
.field-counter.ok-words   { color: #00e5ff; } /* Ровно нужное число слов */
.field-counter.over-limit { color: #ffaa44; } /* Превышение лимита */


/* =============================================================
   КНОПКИ ДЕЙСТВИЙ В КАРТОЧКЕ
   ============================================================= */

/* Базовая кнопка «Generate again» */
.btn-retry {
  align-self: flex-start;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: transparent;
  color: #b8c1d1;
  cursor: pointer;
  transition: 0.2s ease;
}

.btn-retry:hover {
  color: #ffffff;
  border-color: rgba(0, 229, 255, 0.3);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.15);
}

/* Кнопка «Save with EXIF» — расширяет .btn-retry зелёным акцентом.
   Скрыта (display:none) до успешной генерации — показывается из JS. */
.btn-exif {
  /* border-color: rgba(0, 229, 160, 0.3); */
  color: #00e5a0;
}


/* =============================================================
   СПИННЕР ЗАГРУЗКИ
   Показывается внутри .status пока идёт запрос к AI.
   ============================================================= */

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-top: 2px solid #7c5cff;
  border-right: 2px solid #00e5ff;
  display: inline-block;
  animation: spin 1.2s linear infinite;
  box-shadow:
    0 0 10px rgba(124, 92, 255, 0.25),
    0 0 20px rgba(0, 229, 255, 0.15);
  filter: drop-shadow(0 0 6px rgba(0, 229, 255, 0.4));
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* =============================================================
   СТАТУСНЫЕ ЦВЕТА
   Используются внутри .status для обозначения результата.
   ============================================================= */

.success { color: #00e5ff; } /* ✓ Done */
.error   { color: #ff5c7a; } /* ⚠ Ошибка */


/* ===== БЛОК СТАТУСА PUTER-АККАУНТА ===== */

.puter-key-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

/* Статус ключа — строка под инпутом */
.puter-key-status {
  font-size: 12px;
  color: var(--text-dim);
  transition: color 0.2s;
}

.puter-key-status.ok   { color: var(--success); }
.puter-key-status.warn { color: #ffaa44; }
.puter-key-status.empty { color: var(--text-dim); }

/* Ссылка на получение ключа */
.puter-key-link {
  font-size: 12px;
  color: var(--text-link);
  text-decoration: none;
}

.puter-key-link:hover {
  text-decoration: underline;
}


/* Puter Account */
.puter-resources {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 10px 0 6px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
}

.puter-resource-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.puter-resource-row span:last-child {
  color: var(--text-link);
  font-weight: 600;
}

.puter-privacy-note {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 6px;
  padding-left: 2px;
}

.puter-credits-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.puter-credits-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* ===== КНОПКА ===== */
.puter-stats-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.25);
  background: rgba(124, 92, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin: 8px 0;
  letter-spacing: 0.02em;
}

.puter-stats-btn:hover {
  border-color: rgba(124, 92, 255, 0.5);
  color: #ffffff;
  background: rgba(124, 92, 255, 0.15);
  box-shadow: 0 0 14px rgba(124, 92, 255, 0.15);
}

/* ===== ОВЕРЛЕЙ ===== */
.pstats-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: pstats-fade-in 0.2s ease;
}

@keyframes pstats-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ===== МОДАЛЬНОЕ ОКНО ===== */
.pstats-modal {
  width: 100%;
  max-width: 540px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.99), rgba(10, 16, 28, 0.99));
  box-shadow:
    0 0 60px rgba(124, 92, 255, 0.15),
    0 0 120px rgba(0, 229, 255, 0.06);
  animation: pstats-slide-up 0.25s ease;
  overflow: hidden;
}

@keyframes pstats-slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ===== ШАПКА ===== */
.pstats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(124, 92, 255, 0.12);
  flex-shrink: 0;
}

.pstats-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.pstats-subtitle {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pstats-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.pstats-close:hover {
  background: rgba(255, 92, 122, 0.1);
  border-color: rgba(255, 92, 122, 0.3);
  color: #ff5c7a;
}

/* ===== ТЕЛО ===== */
.pstats-body {
  overflow-y: auto;
  flex: 1;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pstats-loading {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 20px 0;
}

/* ===== СЕКЦИИ ===== */
.pstats-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pstats-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ===== ОБЗОР ===== */
.pstats-overview {
  display: flex;
  align-items: center;
  gap: 24px;
}

.pstats-big-num {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 90px;
}

.pstats-big-label {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 4px;
}

.pstats-overview-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pstats-overview-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}

.pstats-overview-row span:last-child {
  font-weight: 500;
  color: #ffffff;
}

/* Главный прогресс-бар */
.pstats-main-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.pstats-main-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
  box-shadow: 0 0 10px currentColor;
}

/* ===== МОДЕЛИ ===== */
.pstats-models {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pstats-model-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pstats-model-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pstats-model-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #e0e6f0;
  font-family: monospace;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pstats-provider-icon {
  color: var(--purple);
  font-size: 14px;
  flex-shrink: 0;
}

.pstats-model-meta {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.pstats-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(124, 92, 255, 0.15);
  color: #a090ff;
  border: 1px solid rgba(124, 92, 255, 0.2);
  white-space: nowrap;
}

.pstats-model-stats {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  padding: 0 2px;
}

.pstats-model-stats span:last-child {
  color: #00e5a0;
  font-weight: 500;
}

.pstats-footer{font-size: 12px;}


.models-table-wrap {
  margin: 0 0 40px;
}

/* Легенда */
.models-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.models-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.models-quality-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Таблица */
.models-table {
  border: 1px solid rgba(124, 92, 255, 0.15);
  border-radius: 12px;
  overflow: hidden;
}

/* Строки */
.models-row {
  display: grid;
  grid-template-columns: 1fr 100px 160px 110px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(124, 92, 255, 0.08);
  transition: background 0.2s;
}

.models-row:last-child {
  border-bottom: none;
}

.models-row:not(.models-header):hover {
  background: rgba(124, 92, 255, 0.05);
}

/* Заголовок таблицы */
.models-header {
  background: rgba(124, 92, 255, 0.08);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 16px;
}

/* Рекомендованная строка */
.models-recommended {
  background: rgba(0, 229, 255, 0.04);
  border-left: 2px solid #00e5ff;
}

.models-recommended:hover {
  background: rgba(0, 229, 255, 0.07) !important;
}

/* Колонка модели */
.models-col-model {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.models-name {
  font-size: 13px;
  color: #e0e6f0;
  font-family: monospace;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.models-provider {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Бейдж провайдера */
.models-provider-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
}

.models-provider-badge.gemini {
  background: rgba(66, 133, 244, 0.15);
  color: #7aa2ff;
  border: 1px solid rgba(66, 133, 244, 0.2);
}

.models-provider-badge.qwen {
  background: #fff3e0;
  color: #e65100;
}

.models-provider-badge.meta {
  background: rgba(0, 134, 255, 0.12);
  color: #7aa2ff;
  border: 1px solid rgba(0, 134, 255, 0.2);
}

.models-provider-badge.xai {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Бейдж Recommended */
.models-rec-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.12);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.25);
  font-family: sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* Колонка с числом фото */
.models-col-photos {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.models-num {
  font-weight: 600;
  font-family: monospace;
  color: #ffffff;
}

/* Колонка с баром */
.models-col-bar {
  display: flex;
  align-items: center;
}

.models-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.models-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* Колонка качества */
.models-col-quality {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Сноска */
.models-note {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 12px;
  line-height: 1.6;
}

.models-note a {
  color: var(--text-link);
  text-decoration: none;
}

.models-note a:hover {
  text-decoration: underline;
}

/* Адаптив для мобильных */
@media (max-width: 600px) {
  .models-row {
    grid-template-columns: 1fr 80px;
    grid-template-rows: auto auto;
  }

  .models-col-bar {
    display: none;
  }

  .models-col-quality {
    justify-content: flex-end;
  }
}

#backToTopBtn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 160, 0.35);
  background: rgba(20, 20, 24, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #00e5a0;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 999;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}

#backToTopBtn.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

#backToTopBtn:hover {
  background: rgba(0, 229, 160, 0.12);
  border-color: #00e5a0;
}

#backToTopBtn svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ===== KEYWORDS CHIP EDITOR (кнопки-теги с крестиком удаления) ===== */
.kw-chip-editor {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 9px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.15);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kw-chip-editor:focus-within {
  border-color: rgba(0, 229, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.1);
}

.kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 4px 10px;
  border-radius: 5px;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.3);
  color: #e6e6e6;
  font-size: 12.5px;
  line-height: 1.3;
  white-space: nowrap;
  animation: kwChipIn 0.12s ease;
}

@keyframes kwChipIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

.kw-chip-text {
  white-space: nowrap;
}

.kw-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.kw-chip-remove:hover {
  background: rgba(255, 92, 122, 0.25);
  color: #ff5c7a;
}

.kw-chip-input {
  flex: 1;
  min-width: 120px;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 11px;
  outline: none;
  padding: 4px 2px;
}

.kw-chip-input::placeholder {
  color: var(--text-dim);
}

button.kw-chip-remove{
	width: auto;
	height:auto;
	padding:2px 6px 5px 6px;
	border-radius:4px;
	background: #471d67;
}

.kw-chip {
  cursor: grab;
}

.kw-chip:active {
  cursor: grabbing;
}

.kw-chip-dragging {
  opacity: 0.9;
}

.kw-chip-just-moved {
  animation: kwChipHighlight 0.9s ease;
}

@keyframes kwChipHighlight {
  0%   { background: rgba(0, 229, 255, 0.35); border-color: rgba(0, 229, 255, 0.7); }
  100% { background: rgba(124, 92, 255, 0.14); border-color: rgba(124, 92, 255, 0.3); }
}

.kw-chip-drop-before {
  box-shadow: -3px 0 0 0 #00e5ff;
}

.kw-chip-drop-after {
  box-shadow: 3px 0 0 0 #00e5ff;
}

/* ===== KEYWORD CHIP — тематические подсветки ===== */
.kw-chip-top {
  position: relative;
  padding-left: 22px;
}

.kw-chip-top::before {
  content: attr(data-rank);
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 170, 68, 0.2);
  color: #ffaa44;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
}

.kw-chip-duplicate {
  box-shadow: 0 0 0 2px rgba(255, 170, 68, 0.55) inset;
}

.kw-chip-flagged {
  outline: 2px solid rgba(255, 92, 122, 0.75);
  outline-offset: -1px;
}

.kw-chip-included {
  border-color: #00e5a0;
  box-shadow: inset 0 0 0 1px rgba(0, 229, 160, 0.4);
}

.kw-chip-edit-input {
  min-width: 50px;
  max-width: 220px;
  padding: 1px 4px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 12.5px;
  font-family: inherit;
  outline: none;
}

/* *********** */

/* Убираем фиксированное позиционирование у одиночной кнопки —
   теперь обе кнопки лежат внутри .side-tools-tabs и позиционируются
   через него, поэтому здесь только внешний вид самой кнопки. */
.batch-tools-tab {
  writing-mode: vertical-rl;
  padding: 14px 5px;
  border-radius: 10px 0 0 10px;
  border: 1px solid rgba(124, 92, 255, 0.25);
  border-right: none;
  background: rgba(20, 28, 45, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text-link);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: -4px 0 20px rgba(0,0,0,0.25);
  transition: all 0.2s ease;
}

.batch-tools-tab:hover {
  color: #ffffff;
  border-color: rgba(0, 229, 255, 0.4);
  background: rgba(20, 28, 45, 0.65);
  box-shadow: -4px 0 24px rgba(124, 92, 255, 0.2);
}

/* Контейнер держит обе кнопки друг под другом без наложения */
.side-tools-tabs {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.undo-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 12px);
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid rgba(124, 92, 255, 0.3);
  background: rgba(15, 20, 32, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #e6e6e6;
  font-size: 12.5px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,0.35), 0 0 20px rgba(124,92,255,0.15);
  opacity: 0;
  pointer-events: none;
  z-index: 3000;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.undo-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* =============================================================
   ЗЕРКАЛО SETTINGS В БОКОВОЙ ПАНЕЛИ
   Переопределяет верстку, рассчитанную на широкий .card-item (49%),
   под узкую колонку ~300px внутри .batch-tools-panel.
   ============================================================= */

.settings-mirror-card {
  max-width: 100% !important;
  width: 100% !important;
  border: none;
  padding: 0;
}

/* Заголовок "⚙ Settings" внутри карточки — дублирует заголовок панели,
   поэтому скрываем, чтобы не было двух одинаковых надписей подряд */
.settings-mirror-card > .card-title {
  display: none;
}

/* ---- Title/Description/Keywords/Top keywords — 2 колонки в узкой панели ---- */
.settings-mirror-card #settingsPanel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin: 0 0 18px;
}

/* ---- AI Model / Platform селекты ---- */
.settings-mirror-card #select-model {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-top: 0;
  margin-bottom: 18px;
}

.settings-mirror-card .sel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin-left: 0;
}

.settings-mirror-card .sel span {
  font-size: 12px;
  color: var(--text-muted);
  padding-right: 0;
}

.settings-mirror-card #model,
.settings-mirror-card #platform {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  font-size: 13px;
}

/* ---- Keyword Rules ---- */
.settings-mirror-card .keyword-rules-panel {
  margin-top: 0;
  padding-top: 24px;
}

.settings-mirror-card .kr-field textarea {
  font-size: 12px;
	field-sizing: content ; /* сбрасываем к обычному поведению */
  box-sizing: border-box;  /* чтобы border учитывался внутри height, а не поверх */
	max-height: none;
}


/* ===== ЕДИНЫЙ СТИЛЬ СКРОЛЛБАРА ДЛЯ ВСЕХ ПРОКРУЧИВАЕМЫХ ОБЛАСТЕЙ =====
   Боковые панели (Settings / Batch Tools / CSV Export), модалки
   (Model Comparison / Usage Statistics) и кастомный dropdown-список. */
.batch-tools-panel,
.pstats-body,
.custom-select-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 92, 255, 0.4) transparent;
}

.batch-tools-panel::-webkit-scrollbar,
.pstats-body::-webkit-scrollbar,
.custom-select-list::-webkit-scrollbar {
  width: 6px;
}

.batch-tools-panel::-webkit-scrollbar-track,
.pstats-body::-webkit-scrollbar-track,
.custom-select-list::-webkit-scrollbar-track {
  background: transparent;
}

.batch-tools-panel::-webkit-scrollbar-thumb,
.pstats-body::-webkit-scrollbar-thumb,
.custom-select-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.45), rgba(0, 229, 255, 0.35));
  border-radius: 3px;
}

.batch-tools-panel::-webkit-scrollbar-thumb:hover,
.pstats-body::-webkit-scrollbar-thumb:hover,
.custom-select-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(124, 92, 255, 0.65), rgba(0, 229, 255, 0.55));
}

/* =============================================================
   FIX: восстановление стилей для клона #settingsCardBlock внутри
   боковой панели после того, как у вложенных элементов убрали id
   (во избежание дублей). Работаем через классы mirror-<originalId>,
   которые проставляет JS в initSettingsMirror().
   ============================================================= */

.settings-mirror-card .mirror-model,
.settings-mirror-card .mirror-platform {
  width: 100%;
  max-width: 100%;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.95), rgba(12, 18, 32, 0.98));
  color: #ffffff;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.settings-mirror-card .mirror-model:hover,
.settings-mirror-card .mirror-platform:hover {
  border-color: rgba(0, 229, 255, 0.35);
}

.settings-mirror-card .mirror-model:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15), 0 0 18px rgba(124, 92, 255, 0.2);
}

.settings-mirror-card .mirror-settingsPanel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
  margin: 0 0 18px;
}

/* .settings-field-label — это <label for="..."> у Title/Description/
   Keywords count/Top keywords count. Отдельно от .settings-toggle-switch
   (тот тоже <label>, но это переключатель, не подпись — не трогаем его здесь). */
.settings-mirror-card .settings-field-label {
  font-size: 12px;
  color: var(--text-muted);
}

.settings-mirror-card .settings-field-control input[type="number"] {
  width: 100%;
  max-width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.95), rgba(12, 18, 32, 0.98));
  color: #ffffff;
  outline: none;
  text-align: right;
}

.settings-mirror-card .settings-field-control input[type="number"]:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15), 0 0 18px rgba(124, 92, 255, 0.2);
}

/* =============================================================
   КАСТОМНЫЙ DROPDOWN ДЛЯ <select>
   Нативный select скрыт (display:none), но остаётся в DOM и
   полностью рабочим — value/change/input не трогали. Визуально
   вместо системного попапа показывается свой HTML-список, поэтому
   цвета/фон опций одинаковы во всех браузерах и панелях.
   ============================================================= */

.custom-select-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 360px;
}

.custom-select-native {
  display: none !important;
}

button.custom-select-trigger {width:230px;}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.95), rgba(12, 18, 32, 0.98));
  color: #ffffff;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: rgba(0, 229, 255, 0.35);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.08);
}

.custom-select-trigger:focus,
.custom-select-trigger.open {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15), 0 0 18px rgba(124, 92, 255, 0.2);
}

.custom-select-trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-caret {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.custom-select-trigger.open .custom-select-caret {
  transform: rotate(180deg);
}

.custom-select-list {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 50;
	height:auto;
  max-height: 500px;
	width:auto;
	max-width:300px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20,28,45,0.98), rgba(10,16,28,0.98));
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.45), 0 0 20px rgba(124,92,255,0.1);
}

.custom-select-list.open { display: block; }

.custom-select-option {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #e6e6e6;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-select-option:hover,
.custom-select-option.is-active {
  background: rgba(124, 92, 255, 0.18);
  color: #ffffff;
}

.custom-select-option.is-selected {
  color: #00e5ff;
  font-weight: 600;
}

.custom-select-option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

/* В узких контейнерах (боковая панель, Keyword Rules) — без ограничения ширины */
.batch-tools-panel .custom-select-wrap,
.kr-field .custom-select-wrap {
  max-width: 100%;
}

.kr-field .custom-select-trigger {  
  font-size: 12px;
  border-radius: 8px;
}

/* *********** */

/* Убираем двойной скролл — пусть скроллит только .batch-tools-panel */
.csv-fields-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
  padding-right: 2px;
}

/* Компактная раскладка строки: чекбокс+лейбл в одну линию,
   инпут (если есть) — под ней на всю ширину */
.csv-field-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(124, 92, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.csv-field-row.is-checked {
  border-color: rgba(0, 229, 255, 0.3);
  background: rgba(124, 92, 255, 0.06);
}

.csv-field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}

.csv-field-row.is-checked .csv-field-checkbox {
  color: #ffffff;
}

.csv-field-checkbox input {
  accent-color: #7c5cff;
  cursor: pointer;
  flex-shrink: 0;
}

/* Текстовое поле (Copyright, Creator, Category и т.п.) */
textarea.csv-field-input {
  width: 100%;
  box-sizing: border-box;
  min-height: 30px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(124, 92, 255, 0.2);
  background: linear-gradient(180deg, rgba(20,28,45,0.95), rgba(12,18,32,0.98));
  color: #ffffff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  resize: none;
  field-sizing: content;
  max-height: 100px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.csv-field-input:focus {
  border-color: rgba(124, 92, 255, 0.6);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.15);
}

/* Native select для Yes/No полей физически скрывается через
   .custom-select-native (см. common.js enhanceSelectDropdown) —
   видимым остаётся .custom-select-trigger, поэтому подгоняем ЕГО,
   а не select.csv-field-input, который на экране не отображается */
.csv-field-row .custom-select-wrap {
  max-width: 100%;
}

.csv-field-row .custom-select-trigger {
  width: 100%;
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 7px;
}

.csv-field-row .custom-select-list {
  max-width: 100%;
}

.csv-field-row .custom-select-option {
  font-size: 12px;
  padding: 6px 8px;
}

/* Пометка "будет вставлено пустым" для полей типа Category/Prompt */
.csv-field-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
}

#csvExportRunBtn {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

/* Кнопка "📄 Export CSV" под "📦 Download All as ZIP" */
#exportCsvBtn {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(124, 92, 255, 0.35);
  background: rgba(124, 92, 255, 0.06);
  color: #a090ff;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 0 20px;
  display: none;
}

#exportCsvBtn:hover:not(:disabled) {
  background: rgba(124, 92, 255, 0.14);
  border-color: #a090ff;
  box-shadow: 0 0 24px rgba(124, 92, 255, 0.2);
  transform: translateY(-1px);
}

#exportCsvBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ----------------------------- */

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-field-label {
  font-size: 13px;
  opacity: 0.8;
}

.settings-field-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-field-control input[type="number"] {
  flex: 1;
  min-width: 0;
}

.settings-field-control input[type="number"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Компактный тумблер слева от поля */
.settings-toggle-switch {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 17px;
  flex-shrink: 0;
  cursor: pointer;
}

.settings-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.settings-toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.settings-toggle-slider::before {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.settings-toggle-switch input:checked + .settings-toggle-slider {
  background: #00e5a0;
}

.settings-toggle-switch input:checked + .settings-toggle-slider::before {
  transform: translateX(13px);
}

.field-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.kw-toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* ----------------------------------- */

/* ===== PLATFORM INFO BUTTON ROW ===== */
.platform-info-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

@media (max-width: 480px) {
  .platform-info-row { justify-content: flex-start; }
}

/* ===== PLATFORM GUIDE LIST (внутри модалки) ===== */
.platform-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.platform-item {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(124, 92, 255, 0.08);
}

.platform-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.platform-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}

.platform-item-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* -------------------------------- */

.batch-pause-banner {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: min(110vw, 480px);
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 92, 122, 0.5);
  color: #ff8fa3;
  font-size: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.batch-pause-banner button {
  background: #00e5a0;
  color: #0a0a0a;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.batch-cancel-btn {
  background: transparent !important;
  color: #ff8fa3 !important;
  border: 1px solid rgba(255, 143, 163, 0.5) !important;
}

.generate-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Кнопка "↺ New Generation" — тот же стиль, что у Export CSV, другой акцент */
#newGenerationBtn {
  width: 100%;
  padding: 14px 24px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 176, 32, 0.35);
  background: rgba(255, 176, 32, 0.06);
  color: #ffb454;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.2s;
  margin: 0 0 20px;
  display: none;
}

#newGenerationBtn:hover:not(:disabled) {
  background: rgba(255, 176, 32, 0.14);
  border-color: #ffb454;
  box-shadow: 0 0 24px rgba(255, 176, 32, 0.2);
  transform: translateY(-1px);
}

#newGenerationBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}