/* Основные стили формы */
.tnved-form-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.tnved-form-wrap.tnved-form-clothing {
  max-width: 1120px;
}

.tnved-form-clothing .tnved-form-layout {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.tnved-form-clothing .tnved-form-main-column {
  flex: 1 1 520px;
  min-width: 280px;
  max-width: 640px;
}

.tnved-live-preview {
  flex: 1 1 300px;
  max-width: 400px;
  min-width: 260px;
  position: sticky;
  top: 12px;
  padding: 16px 18px;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #333;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  box-sizing: border-box;
}

.tnved-preview-title {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 700;
  color: #222;
}

.tnved-preview-hint {
  margin: 0 0 14px;
  font-size: 0.85em;
  color: #666;
  line-height: 1.4;
}

.tnved-preview-section {
  margin-bottom: 18px;
}

.tnved-preview-section h4 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #777;
  font-weight: 700;
}

.tnved-preview-dl {
  margin: 0;
}

.tnved-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 38%) 1fr;
  gap: 6px 12px;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.tnved-preview-k {
  font-weight: 600;
  color: #555;
}

.tnved-preview-v {
  word-break: break-word;
  color: #222;
}

.tnved-preview-queue-item {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.tnved-preview-queue-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95em;
}

.tnved-preview-queue-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tnved-preview-queue-head strong {
  flex: 1;
  margin-bottom: 0;
}

.tnved-queue-remove {
  flex-shrink: 0;
  min-width: 28px;
  min-height: 28px;
  padding: 0 4px;
  line-height: 1;
  font-size: 1.25rem;
  font-weight: 700;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #888;
  cursor: pointer;
  box-shadow: none;
}

.tnved-queue-remove:hover {
  background: transparent;
  border: none;
  color: #c33;
}

.tnved-queue-remove:focus {
  outline: none;
}

.tnved-queue-remove:focus-visible {
  outline: 2px solid rgba(200, 50, 50, 0.45);
  outline-offset: 2px;
}

.tnved-preview-queue-meta {
  color: #444;
}

.tnved-preview-mini {
  font-size: 0.88em;
  color: #555;
  margin-top: 2px;
}

.tnved-preview-empty {
  margin: 0;
  color: #888;
  font-style: italic;
  font-size: 0.95em;
}

.tnved-draft-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin: 0 0 16px;
  padding: 12px 14px;
  background: #fffdcc;
  border: 1px solid rgba(251,234,49,.7);
  border-radius: 12px;
  font-weight: 600;
}
.tnved-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  justify-content: stretch;
}
.tnved-preview-actions .tnved-btn {
  flex: 1 1 140px;
}
.tnved-queue-actions {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.tnved-queue-edit {
  border: none;
  background: #fbea31;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tnved-preview-footer {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
  font-size: 0.9em;
  color: #555;
}
.tnved-section-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 16px;
  color: #333;
}
.tnved-section-divider {
  height: 1px;
  background: #eee;
  margin: 24px 0;
}
.tnved-form-title { margin-top: 0; margin-bottom: 12px; font-size: 28px; line-height: 1.2; text-align: center; color: #1C1C1C; }

.tnved-form .tnved-field { margin-bottom: 14px; }

.tnved-form .tnved-field-row { display: flex; gap: 12px; }

.tnved-form .tnved-field-row > div { flex: 1; }

.tnved-form .tnved-field small { display: block; margin-top: 6px; font-size: 0.85em; color: #666; }

.tnved-form label { display: block; margin-bottom: 6px; font-weight: 600; color: #444; }

.tnved-form select, .tnved-form input[type="text"], .tnved-form input[type="date"] { width: 100%; padding: 12px 14px; font-size: 1em; border: 1px solid #e0e0e0; border-radius: 12px; box-sizing: border-box; transition: box-shadow .15s ease, border-color .15s ease; }

.tnved-form select:focus, .tnved-form input[type="text"]:focus, .tnved-form input[type="date"]:focus { outline: none; border-color: rgba(251,234,49,.65); box-shadow: 0 0 0 3px rgba(251,234,49,.25); }

.tnved-form select.error, .tnved-form input[type="text"].error { border-color: #dc3545; box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2); }

.tnved-form select.error:focus, .tnved-form input[type="text"].error:focus { border-color: #dc3545; box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2); }

.tnved-form select:disabled, .tnved-form input:disabled { background: #f5f5f5; }

.tnved-message { margin: 10px 0; padding: 12px 14px; border-radius: 10px; }

.tnved-message-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }

.tnved-message-error { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.tnved-actions { margin-top: 16px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: center; }

.tnved-btn { padding: 12px 20px; font-size: 1em; font-weight: 800; border: 1px solid rgba(251,234,49,.6) !important; border-radius: 12px; cursor: pointer; box-shadow: 0 12px 26px rgba(251,234,49,.25) !important; transition: transform .1s ease, box-shadow .18s ease; white-space: nowrap; }

.tnved-btn-submit { background: var(--genznak-primary) !important; color: #000 !important; }

.tnved-btn-secondary { background: var(--genznak-primary) !important; color: #000 !important; }

.tnved-btn-submit:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(251,234,49,.35); }

.tnved-btn-secondary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 16px 32px rgba(251,234,49,.35); }

.tnved-btn:disabled { opacity: 0.7; cursor: not-allowed; }

.tnved-notice { padding: 14px; background: #fff3cd; border: 1px solid #ffc107; border-radius: 10px; margin: 24px auto; max-width: 720px; }

.tnved-notice a { color: #856404; font-weight: 600; }

.tnved-bulk-block { margin-bottom: 8px; }
.tnved-bulk-hint { font-size: 0.95em; color: #555; line-height: 1.45; margin: 0 0 14px; }
.tnved-bulk-hint code { font-size: 0.9em; background: #f4f4f4; padding: 2px 6px; border-radius: 4px; }
.tnved-bulk-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 10px; }
.tnved-bulk-file-wrap { display: inline-flex; flex-direction: column; gap: 4px; font-weight: 600; color: #444; }
.tnved-bulk-file-label { font-size: 0.9em; }
.tnved-master-status { margin-top: 8px; }

/* ==================================================================== */
/* Адаптивность формы для телефонов                                     */
/* ==================================================================== */
/* В этом файле раньше не было ни одного медиазапроса, хотя форма содержит
   32 поля. Аудитория — селлеры маркетплейсов, значительная часть заходит
   с телефона. Ниже — только то, что чинит мобильный вид; на десктопе
   ничего не меняется. */

@media (max-width: 900px) {
  .tnved-form-clothing .tnved-form-layout {
    gap: 20px;
  }
  /* Превью заявки уводим под форму, а не в узкую колонку сбоку. */
  .tnved-live-preview {
    flex: 1 1 100%;
    max-width: 100%;
    order: 2;
  }
  .tnved-form-clothing .tnved-form-main-column {
    flex: 1 1 100%;
    max-width: 100%;
    order: 1;
  }
}

@media (max-width: 640px) {
  .tnved-form-wrap {
    padding-left: 14px;
    padding-right: 14px;
  }

  .tnved-form-title {
    font-size: 22px;
    line-height: 1.25;
  }

  /* Поля на всю ширину и высотой не меньше 44px — иначе по ним неудобно
     попадать пальцем. */
  .tnved-field input,
  .tnved-field select,
  .tnved-field textarea {
    width: 100%;
    min-height: 44px;
    /* 16px обязательно: при меньшем размере Safari на iPhone
       принудительно зумит страницу при фокусе на поле. */
    font-size: 16px;
  }

  /* Кнопки в столбик и на всю ширину. */
  .tnved-bulk-actions,
  .tnved-form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tnved-bulk-actions .tnved-btn,
  .tnved-form-actions .tnved-btn {
    width: 100%;
    justify-content: center;
  }

  .tnved-bulk-file-wrap {
    width: 100%;
  }

  /* Превью в две строки вместо двух колонок — иначе значения обрезаются. */
  .tnved-preview-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .tnved-preview-k {
    font-size: 13px;
  }
}
