/* ═══════════════════════════════════════════════
   FastyVideo — стили
   Адаптация дизайна fasty_video_site под тёмную тему
═══════════════════════════════════════════════ */

/* ─── Контейнер ─── */
.fv-container {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  gap: 16px;
}
.fv-container.visible { display: flex; }

/* ─── Баланс-бар ─── */
.fv-balance-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.fv-balance-bar span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.fv-balance-amount {
  color: var(--accent) !important;
  font-weight: 800 !important;
  font-size: 20px !important;
  letter-spacing: -0.5px;
}
.fv-topup-btn {
  margin-left: auto;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.fv-topup-btn:hover { background: #d44e2e; }

/* ─── Саб-табы ─── */
.fv-sub-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 4px;
}
.fv-sub-tab {
  flex: 1;
  padding: 9px 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.fv-sub-tab svg { flex-shrink: 0; }
.fv-sub-tab:hover { color: var(--text-primary); background: rgba(255,255,255,0.04); }
.fv-sub-tab.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(232,93,38,0.3);
}

/* ─── Модели (сетка как в fasty_video_site) ─── */
.fv-models {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.fv-model-card {
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  position: relative;
}
.fv-model-card:hover {
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.fv-model-card.active {
  border-color: var(--accent);
  background: rgba(232,93,38,0.06);
  box-shadow: 0 0 0 1px var(--accent);
}
.fv-model-card .fv-mc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
  line-height: 1.3;
}
.fv-model-card .fv-mc-provider {
  font-size: 11px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.fv-model-card .fv-mc-price {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(232,93,38,0.1);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.fv-top-badge {
  display: inline-block;
  padding: 2px 7px;
  background: linear-gradient(135deg, #e85d26, #f59e0b);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 4px;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.fv-model-card.fv-top {
  border-color: rgba(232,93,38,0.4);
  background: linear-gradient(135deg, rgba(232,93,38,0.08), rgba(245,158,11,0.04));
  box-shadow: 0 0 12px rgba(232,93,38,0.1);
}
.fv-model-card.fv-top:hover {
  border-color: rgba(232,93,38,0.6);
  box-shadow: 0 0 20px rgba(232,93,38,0.15);
}
.fv-model-card.fv-top .fv-mc-name {
  color: #fff;
}

/* ─── Форма генерации ─── */
.fv-gen-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.fv-form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: -8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fv-prompt {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.fv-prompt:focus { border-color: var(--accent); }
.fv-prompt::placeholder { color: rgba(255,255,255,0.25); }

/* ─── Параметры ─── */
.fv-params {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.fv-param-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fv-param-group label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}
.fv-param-group select,
.fv-param-group input {
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.fv-param-group select:focus,
.fv-param-group input:focus { border-color: var(--accent); }

/* ─── Toggle-кнопки (формат) ─── */
.fv-toggle-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fv-toggle-btn {
  padding: 10px 16px;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.fv-toggle-btn:hover { border-color: rgba(255,255,255,0.2); color: var(--text-primary); }
.fv-toggle-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,93,38,0.08);
}

/* ─── Загрузка файла (upload zone) ─── */
.fv-upload-area {
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.fv-upload-zone {
  width: 100%;
  padding: 24px;
  border: 2px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  font-size: 13px;
}
.fv-upload-zone:hover { border-color: var(--accent); color: var(--accent); }
.fv-upload-zone.has-file { border-color: var(--green); border-style: solid; }

.fv-upload-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}
.fv-upload-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.fv-upload-remove {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ─── Footer формы ─── */
.fv-gen-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}
.fv-price {
  font-size: 14px;
  color: var(--text-secondary);
}
.fv-price b { color: var(--accent); font-size: 16px; }
.fv-generate-btn {
  padding: 12px 32px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(232,93,38,0.25);
}
.fv-generate-btn:hover { background: #d44e2e; box-shadow: 0 4px 12px rgba(232,93,38,0.35); }
.fv-generate-btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.fv-generate-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.fv-generate-btn svg { flex-shrink: 0; }
.fv-btn-spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fv-spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ─── Активные генерации ─── */
.fv-active { display: flex; flex-direction: column; gap: 12px; }

.fv-gen-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  transition: border-color 0.2s;
}
.fv-gen-item:hover { border-color: rgba(255,255,255,0.12); }
.fv-gen-item .fv-gi-info { flex: 1; min-width: 0; }
.fv-gen-item .fv-gi-model {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.fv-gen-item .fv-gi-prompt {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Статусы ─── */
.fv-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.fv-status.pending { background: rgba(245,158,11,0.12); color: #f59e0b; }
.fv-status.processing { background: rgba(59,130,246,0.12); color: #3b82f6; animation: fv-pulse 1.5s infinite; }
.fv-status.completed { background: rgba(34,197,94,0.12); color: #22c55e; }
.fv-status.failed { background: rgba(239,68,68,0.12); color: #ef4444; }

@keyframes fv-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ─── Результат ─── */
.fv-result {
  margin-top: 8px;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
}
.fv-result img,
.fv-result video {
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: #111;
  border-radius: 12px;
  display: block;
}
.fv-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 16px;
  background: #22c55e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.fv-download-btn:hover { background: #16a34a; }

/* ─── История ─── */
.fv-history { display: flex; flex-direction: column; gap: 12px; }
.fv-history-empty, .fv-empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.fv-empty-state svg { color: var(--text-secondary); }

/* Фильтры */
.fv-hist-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.fv-hf-btn {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
}
.fv-hf-btn span {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
}
.fv-hf-btn:hover { border-color: rgba(255,255,255,0.15); color: var(--text-primary); }
.fv-hf-btn.active {
  background: rgba(232,93,38,0.1);
  color: var(--accent);
  border-color: var(--accent);
}
.fv-hf-btn.active span { background: rgba(232,93,38,0.15); }

/* Таблица истории */
.fv-hist-table {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.fv-ht-header {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.fv-ht-row {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
  font-size: 13px;
  transition: background 0.15s;
  cursor: default;
}
.fv-ht-row:last-child { border-bottom: none; }
.fv-ht-row:hover { background: rgba(255,255,255,0.02); }
.fv-ht-row { cursor: pointer; }

/* Колонки */
.fv-ht-col-type { width: 44px; flex-shrink: 0; }
.fv-ht-col-model { width: 130px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1px; }
.fv-ht-col-prompt { flex: 1; min-width: 0; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fv-ht-col-status { width: 110px; flex-shrink: 0; display: flex; align-items: center; gap: 6px; }
.fv-ht-col-price { width: 70px; flex-shrink: 0; text-align: right; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.fv-ht-col-date { width: 100px; flex-shrink: 0; text-align: right; color: var(--text-secondary); font-size: 12px; }

/* Иконка типа */
.fv-ht-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
}

/* Модель */
.fv-ht-model-name { font-weight: 600; color: var(--text-primary); font-size: 12px; }
.fv-ht-provider { font-size: 10px; color: var(--text-secondary); }

/* Статус точка */
.fv-ht-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Колонка действий */
.fv-ht-col-actions { width: 140px; flex-shrink: 0; display: flex; gap: 6px; justify-content: flex-end; }
.fv-ht-btn {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.fv-ht-btn:hover { border-color: var(--accent); color: var(--accent); }
.fv-ht-btn-download {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.3);
  color: #22c55e;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.fv-ht-btn-download:hover { background: rgba(34,197,94,0.2); border-color: #22c55e; color: #22c55e; }

/* ─── Модалка деталей ─── */
.fv-detail-modal {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  max-width: 580px;
  width: 92%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  overflow: hidden;
  animation: fv-modal-in 0.25s ease-out;
}
@keyframes fv-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@media (max-width: 640px) {
  .fv-detail-modal {
    animation: fv-modal-slide-up 0.3s ease-out;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    position: fixed;
    bottom: 0;
    max-height: 85vh;
    overflow-y: auto;
  }
  @keyframes fv-modal-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}
.fv-detail-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fv-detail-section { margin-bottom: 18px; }
.fv-detail-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.fv-detail-row {
  display: flex;
  padding: 7px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 13px;
}
.fv-detail-row-label {
  width: 110px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 500;
}
.fv-detail-row-value {
  flex: 1;
  color: var(--text-primary);
  word-break: break-word;
}
.fv-detail-prompt {
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  max-height: 150px;
  overflow-y: auto;
  color: var(--text-primary);
}
.fv-detail-info {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(59,130,246,0.06);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.fv-detail-info strong { color: var(--text-primary); }

/* Мобильная адаптация: таблица → карточки */
@media (max-width: 640px) {
  .fv-ht-header { display: none; }
  .fv-ht-row {
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--border);
  }
  .fv-ht-col-type { width: 36px; }
  .fv-ht-col-model { width: auto; flex: 1; }
  .fv-ht-col-prompt { width: 100%; order: 10; white-space: normal !important; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .fv-ht-col-status { width: auto; order: 5; margin-left: auto; }
  .fv-ht-col-price { width: auto; order: 6; }
  .fv-ht-col-date { width: 100%; order: 11; text-align: left; font-size: 11px; }
  .fv-ht-col-actions { width: 100%; order: 12; }
  .fv-ht-btn { flex: 1; text-align: center; padding: 8px 12px; font-size: 12px; }

  /* Detail modal mobile */
  .fv-detail-modal { width: 96%; border-radius: 14px; }
  .fv-detail-row { flex-direction: column; gap: 2px; }
  .fv-detail-row-label { width: auto; font-size: 11px; }
}

/* ─── Модалка пополнения ─── */
.fv-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.fv-modal-overlay.active { display: flex; }

.fv-modal {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: fv-modal-in 0.25s ease-out;
}
.fv-modal h3 {
  margin: 0 0 20px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.fv-topup-amounts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.fv-topup-amount {
  padding: 16px 12px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.fv-topup-amount:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(232,93,38,0.06);
}
.fv-modal-close {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.fv-modal-close:hover { border-color: rgba(255,255,255,0.2); color: var(--text-primary); }

/* ─── Прогресс-бар (как в fasty_video_site) ─── */
.fv-progress-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  margin-top: -4px;
  border-top: none;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.fv-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: fv-spin 1s linear infinite;
  flex-shrink: 0;
}
@keyframes fv-spin {
  to { transform: rotate(360deg); }
}
.fv-progress-info { flex: 1; min-width: 0; }
.fv-progress-bar-bg {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.fv-progress-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease;
}
.fv-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
}
.fv-progress-meta span:last-child { color: var(--text-secondary); font-weight: 400; }

/* ─── Ошибка-блок (как в fasty_video_site) ─── */
.fv-error-block {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15);
  border-radius: 12px;
  margin-top: 4px;
}
.fv-error-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(239,68,68,0.12);
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Алерты ─── */
.fv-error {
  padding: 12px 16px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: 10px;
  color: #ef4444;
  font-size: 13px;
}
.fv-success {
  padding: 12px 16px;
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.2);
  border-radius: 10px;
  color: #22c55e;
  font-size: 13px;
}

/* ─── Switch toggle (iOS-style, как в референсе) ─── */
.fv-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  width: 100%;
}
.fv-switch-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.fv-switch-hint { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.fv-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.fv-switch input { opacity: 0; width: 0; height: 0; }
.fv-switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.15);
  border-radius: 24px;
  transition: 0.3s;
}
.fv-switch-slider:before {
  content: "";
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.fv-switch input:checked + .fv-switch-slider { background: #22c55e; }
.fv-switch input:checked + .fv-switch-slider:before { transform: translateX(20px); }

/* ─── Музыкальные поля ─── */
.fv-music-textarea {
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.fv-music-textarea:focus { border-color: var(--accent); }
.fv-music-textarea::placeholder { color: rgba(255,255,255,0.25); }
.fv-music-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.fv-music-input:focus { border-color: var(--accent); }
.fv-music-input::placeholder { color: rgba(255,255,255,0.25); }
.fv-char-count {
  text-align: right;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* ─── Custom Fields (музыка) ─── */
#fvCustomFields {
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
#fvSimpleFields { width: 100%; }

/* ─── Range slider стилизация ─── */
.fv-param-group input[type="range"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.06);
  height: 6px;
  border-radius: 4px;
  outline: none;
  border: none;
}
.fv-param-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
.fv-param-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: none;
}
.fv-param-group input[type="range"]::-moz-range-track {
  background: rgba(255,255,255,0.06);
  height: 6px;
  border-radius: 4px;
}

/* ─── Focus states (keyboard accessibility) ─── */
.fv-model-card:focus-visible,
.fv-toggle-btn:focus-visible,
.fv-sub-tab:focus-visible,
.fv-hf-btn:focus-visible,
.fv-ht-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fv-generate-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.fv-prompt:focus-visible { outline: none; }

/* ─── Audio result ─── */
.fv-result audio {
  width: 100%;
  border-radius: 8px;
}

/* ─── Checkbox стилизация ─── */
.fv-param-group label input[type="checkbox"] {
  margin-right: 6px;
  accent-color: var(--accent);
}

/* ─── Skeleton loading ─── */
@keyframes fv-shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.fv-skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200px 100%;
  animation: fv-shimmer 1.5s ease-in-out infinite;
  border-radius: 12px;
}
.fv-skeleton-card {
  height: 80px;
  border-radius: 12px;
}
.fv-skeleton-row {
  height: 52px;
  border-radius: 8px;
  margin-bottom: 4px;
}

/* ─── Stagger animation ─── */
@keyframes fv-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fv-animate-in {
  animation: fv-fade-in 0.25s ease-out both;
}

/* ─── Мобильная адаптация ─── */
@media (max-width: 600px) {
  .fv-container { padding: 10px; gap: 10px; }
  .fv-models { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
  .fv-model-card { padding: 14px 10px; min-height: 44px; }
  .fv-model-card .fv-mc-name { font-size: 12px; }
  .fv-gen-form { padding: 14px; border-radius: 12px; }
  .fv-gen-footer { flex-direction: column; align-items: stretch; }
  .fv-generate-btn { width: 100%; text-align: center; }
  .fv-balance-bar { padding: 10px 14px; }
  .fv-balance-amount { font-size: 18px !important; }
  .fv-topup-amount { font-size: 16px; padding: 12px 10px; }
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .fv-animate-in { animation: none; }
  .fv-detail-modal, .fv-modal { animation: none; }
  .fv-spinner { animation-duration: 2s; }
  .fv-btn-spinner { animation-duration: 2s; }
}

@media (max-width: 390px) {
  .fv-models { grid-template-columns: 1fr 1fr; }
  .fv-container { padding: 8px; }
  .fv-gen-form { padding: 12px; }
}
