/* ============================================================================
   Единый дизайн-система приложения (Индиго + системный шрифт)
   Используется всеми страницами раздела «Поиск» и «Личный кабинет».
   ========================================================================== */

/* ---------- Токены дизайна ------------------------------------------------ */
:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f8f9fd;
  --text: #1e293b;
  --heading: #0f172a;
  --muted: #64748b;
  --muted-2: #94a3b8;

  --primary: #605be5;
  --primary-hover: #3c42e0;
  --primary-soft: #e0e3ff;
  --primary-soft-2: #edf0ff;
  --ring: rgba(75, 82, 243, 0.2);

  --tabbar: #41454c;
  --border: #e2e8f0;
  --line: #e9ecf2;

  --success: #10b981;
  --success-soft: #ecfdf5;
  --success-text: #047857;
  --warning-soft: #fde68a;
  --warning-text: #b45309;
  --slate-soft: #f1f5f9;
  --slate-text: #475569;

  --danger: #dc2626;

  --radius-xl: 16px;
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;

  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -18px rgba(15, 23, 42, 0.18);
  --shadow-lg: 0 24px 60px -22px rgba(15, 23, 42, 0.35);
}

/* ---------- База ----------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }



img, svg, video, canvas { display: block; max-width: 100%; }
video { height: auto; }




[hidden] { display: none !important; }
.hidden { display: none !important; }
.pointer-events-none { pointer-events: none; }

::placeholder { color: var(--muted-2); opacity: 1; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

/* Кастомный скроллбар */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Каркас страницы ----------------------------------------------- */
/* .page { */
  /* width: 100%; */
  /* max-width: 1200px; */
  /* margin: 0 auto; */
  /* padding: clamp(16px, 3vw, 32px) clamp(16px, 3vw, 40px) 48px; */
/* } */

/* .page--wide { max-width: 1440px; } */

/* .page-title { */
  /* font-size: clamp(27px, 3.2vw, 36px); */
  /* font-weight: 700; */
  /* letter-spacing: -0.02em; */
  /* color: var(--heading); */
  /* line-height: 1.1; */
/* } */

/* .page-header { margin-bottom: 20px; } */
/* .page-header p { margin-top: 6px; } */

/* .page-subtitle { */
  /* color: var(--muted); */
  /* font-size: clamp(14px, 1.4vw, 16px); */
/* } */




/* Анимационный цикл */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); box-shadow: 0 0 10px rgba(0, 123, 255, 0.5); } /* Легкое увеличение размера и свечение */
    100% { transform: scale(1); }
}

/* Применение анимации к классу .blink */
.btn.blink {
    animation-name: pulse;
    animation-duration: 1s;          /* Длительность одного цикла */
    animation-iteration-count: infinite; /* Бесконечное повторение */
    animation-timing-function: ease-in-out; /* Плавное ускорение и замедление */
}




   .search-card {
      max-width: 720px; margin: 0 auto; background: #fff; border-radius: 12px;
      box-shadow: 0 2px 12px rgba(0,0,0,.08); overflow: hidden;
    }
    .tabs {
      display: flex; padding: 12px 24px; border-bottom: 2px solid #e8ecf0;
    }
    .tab {
      flex: 1; padding: 10px 16px; text-align: center; cursor: pointer;
      font-size: 14px; font-weight: 600; color: #889; background: #fafbfc;
      transition: .2s; border: none; position: relative;
    }
    .tab:not(:last-child) { border-right: 1px solid #e8ecf0; }
    .tab:hover { background: #f0f2f5; color: #556; }
    .tab.active {
      background: #fff; color: #1a73e8;
    }
    .tab.active::after {
      content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
      height: 2px; background: #1a73e8;
    }
    .category-grid {
      display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 12px; padding: 20px 24px;
    }
    .category {
      display: flex; align-items: center; gap: 8px; padding: 10px 16px;
      border-radius: 8px; border: 1px solid #d0d5dd; cursor: pointer;
      transition: .2s; font-size: 14px; font-weight: 500; color: #222;
    }
    .category:hover { background: #f0f7ff; border-color: #1a73e8; }
    .category.active {
      background: #1a73e8; border-color: #1a73e8; color: #fff;
    }
    .category svg { width: 20px; height: 20px; fill: currentColor; }
    .field-row {
      display: flex; align-items: center; gap: 12px; padding: 10px 24px;
      border-top: 1px solid #e8ecf0;
    }
    .field-label {
      font-size: 14px; font-weight: 600; color: #667; width: 120px;
    }
    .field-select {
      padding: 6px 12px; border-radius: 8px; border: 1px solid #d0d5dd;
      font-size: 14px; outline: none; transition: .2s;
    }
    .field-select:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
    .field-input {
      padding: 6px 12px; border-radius: 8px; border: 1px solid #d0d5dd;
      font-size: 14px; outline: none; transition: .2s; flex: 1;
    }
    .field-input:focus { border-color: #1a73e8; box-shadow: 0 0 0 3px rgba(26,115,232,.15); }
    .field-input.error {
      animation: errorBlink 1s;
    }
    @keyframes errorBlink {
      0%, 100% { border-color: #d0d5dd; }
      25%, 75% { border-color: #f03e3e; box-shadow: 0 0 0 3px rgba(240,62,62,.15); }
    }
    .search-row {
      display: flex; align-items: center; gap: 8px; padding: 10px 24px;
      border-top: 1px solid #e8ecf0;
    }
    .search-row-label { font-size: 14px; font-weight: 600; color: #667; }
    .search-row-value { flex: 1; color: #344054; }
    .search-row-value input {
      width: 100%; padding: 4px 10px; border-radius: 6px;
      border: 1px solid #1a73e8; font-size: 14px; outline: none;
      box-shadow: 0 0 0 3px rgba(26,115,232,.15);
    }
    .search-row .row-btn {
      padding: 4px 8px; font-size: 14px; font-weight: 600; border-radius: 8px;
      border: none; cursor: pointer; transition: .2s; background: none; color: #667;
    }
    .search-row .row-btn:hover { background: #f0f7ff; color: #1a73e8; }
    .search-row .row-btn.delete:hover { background: #fde8e8; color: #f03e3e; }
    .actions {
      padding: 16px 24px; display: flex; gap: 12px;
    }
    .btn {
      padding: 10px 28px; border-radius: 8px; font-size: 14px; font-weight: 600;
      border: none; cursor: pointer; transition: .2s;
    }
    .btn-primary { background: #1a73e8; color: #fff; }
    .btn-primary:hover { background: #1557b0; }
    .btn-secondary { background: #e8ecf0; color: #344054; }
    .btn-secondary:hover { background: #d0d5dd; }
    @media (max-width: 600px) {
      body { padding: 10px; }
      .search-card { border-radius: 10px; }
      .tabs { padding: 8px 6px; overflow-x: auto; }
      .tab { padding: 10px 6px; font-size: 12px; white-space: nowrap; }
      .category-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; padding: 14px 12px; }
      .field-row { flex-direction: column; align-items: stretch; gap: 6px; padding: 12px; }
      .field-label { width: auto; }
      .field-select { width: 100%; }
      .search-row { flex-wrap: wrap; padding: 10px 12px; }
      .search-row-label { width: 100%; }
      .search-row-value input { font-size: 16px; }
      .actions { flex-direction: column; padding: 12px; }
      .btn { width: 100%; }
    }












/* ---------- Табы навигации (тёмная панель) ПРОВЕРИТЬ-------------------------------- */
.tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 6px;
  margin: 0 0 24px;
  background: var(--tabbar);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 0 0 auto;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #dce2ea;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease;
}
.tab-btn:hover { color: #fff; }
.tab-btn.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px -4px rgba(75, 82, 243, 0.55);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

/* ---------- Карточки ------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid #eef1f6;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 32px);
}


 .card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,.08);
    padding: 20px;
    flex: 1;
    min-width: 0;
  }
  .card-right {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,.08);
    padding: 24px;
    width: 100%;
    flex-shrink: 0;
    align-self: flex-start;
  }


.card-title {
  font-size: clamp(18px, 2.4vw, 22px);
  font-weight: 700;
  color: var(--heading);
  margin: 0 0 18px;
}

.card-foot {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* Двухколоночная раскладка (основная + сайдбар) */
.layout-2 {
  display: grid;
  grid-template-columns: 1fr 270px;
  gap: 18px;
  align-items: start;
}

/* ---------- Кнопки --------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: background-color 160ms ease, border-color 160ms ease,
              color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 20px -10px rgba(75, 82, 243, 0.55);
}
.btn-primary:hover { background: var(--primary-hover); }

.btn-outline {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-outline:hover { background: #7088ff; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--heading); }

.btn-soft {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 13px;
}
.btn-soft:hover { background: #d4d9ff; }

.btn-lg { padding: 14px 24px; font-size: 15px; border-radius: 14px; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 12px; }
.btn-block { width: 100%; }

.btn[disabled] { opacity: 0.45; cursor: default; }
.btn[disabled]:hover { transform: none; }

/* Кнопка-переключатель кадрирования (poisk) */
.crop-toggle {
  width: 100%;
  padding: 10px;
  border: 1px solid #c7ccf8;
  background: var(--primary-soft-2);
  border-radius: 12px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 160ms ease, color 160ms ease;
}
.crop-toggle:hover { background: var(--primary-soft); }
.crop-toggle.on { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Формы ---------------------------------------------------------- */
.form-group { margin-bottom: 18px; }

.field-label,
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 7px;
}

.input,
.select,
textarea.input,
input[type="date"].input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.input:focus,
.select:focus,
textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}

.field-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row-layout { display: flex; gap: 16px; flex-wrap: wrap; }
.field-row-layout > * { flex: 1; min-width: 150px; }

.range { width: 100%; accent-color: var(--primary); }
.range:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.form-note { margin-top: 10px; color: var(--muted); font-size: 12px; }

/* ---------- Бейджи --------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.badge--success { background: #d1fae5; color: var(--success-text); }
.badge--warning { background: var(--warning-soft); color: var(--warning-text); }
.badge--muted { background: var(--slate-soft); color: var(--slate-text); }
.badge--info { background: var(--primary-soft-2); color: var(--primary); }

/* ---------- Подсказка / notice -------------------------------------------- */
.notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin-top: 16px;
  background: var(--primary-soft-2);
  color: #4b4f8f;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}
.notice svg { flex: 0 0 auto; }

/* ---------- Тосты ---------------------------------------------------------- */
.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

/* Тост, вынесенный прямо в <body> (страницы recentzapros, kabinet) */
body > .toast { position: fixed; right: 22px; bottom: 22px; z-index: 70; }

.toast {
  max-width: min(390px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 12px;
  background: #0f172a;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ---------- Модальные окна ------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
}

.modal {
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal--sm { max-width: 420px; }
.modal--lg { max-width: 760px; }
.modal--xl { max-width: 960px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}
.modal-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--heading);
  font-size: 16px;
}
.modal-body { padding: 24px; overflow-y: auto; }
.modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.modal-close { color: var(--muted-2); transition: color 160ms ease; }
.modal-close:hover { color: var(--text); }

/* ---------- Иконки в один клик (кружки) ----------------------------------- */
.info-badge {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 13px;
  box-shadow: var(--shadow);
}

/* ---------- Иконки lucide (размер по контексту) --------------------------- */
.lucide { display: inline-block; flex: 0 0 auto; }
button .lucide { color: inherit; }
.btn .lucide { width: 16px; height: 16px; }
.btn-soft .lucide { width: 14px; height: 14px; }
.btn-lg .lucide { width: 18px; height: 18px; }
.btn--min .lucide { width: 14px; height: 14px; }
.icon-btn .lucide { width: 14px; height: 14px; }
.modal-close .lucide { width: 20px; height: 20px; }
.modal-title .lucide { width: 18px; height: 18px; }
.crop-toggle .lucide { width: 16px; height: 16px; }
.tool-btn .lucide { width: 18px; height: 18px; }
.preview-play .lucide { width: 24px; height: 24px; }
.spinner-icon .lucide { width: 40px; height: 40px; }

/* ============================================================================
   Страница: Фото / Видео (poisk-photo)
   ========================================================================== */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}

/* Зона загрузки */
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.dashed-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  min-height: 220px;
  padding: 15px;
  border: 1.5px dashed #c7ccf8;
  border-radius: var(--radius-xl);
  background: #fbfbff;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color 200ms ease, background-color 200ms ease, transform 200ms ease;
}
.dashed-card:hover { border-color: var(--primary); background: #f7f8ff; }
.dashed-card.dragover { border-color: var(--primary); background: #eef1ff; transform: scale(0.995); }

.dashed-card .upload-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }

.upload-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  margin-bottom: 12px;
}
.upload-icon svg { width: 44px; height: 44px; }

.upload-label { font-weight: 700; color: var(--heading); font-size: 15px; }
.upload-hint { color: var(--muted-2); font-size: 12px; margin-top: 4px; }

/* Предпросмотр загруженного медиа */
.preview-card { width: 100%; display: flex; flex-direction: column; align-items: center; }
.preview-box {
  position: relative;
  width: 110px;
  height: 110px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--slate-soft);
  border: 1px solid #dbeafe;
  box-shadow: var(--shadow);
}
.preview-box--wide { width: 128px; height: 96px; display: flex; align-items: center; justify-content: center; background: #0f172a; }
.preview-box img, .preview-box video { width: 100%; height: 100%; object-fit: cover; }
.preview-frame { position: absolute; inset: 4px; border: 1px dashed var(--primary); border-radius: 8px; opacity: 0.75; }
.preview-play {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.2); color: #fff;
}

.icon-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  transition: background-color 150ms ease;
}
.icon-btn:hover { background: var(--danger); }

.preview-name { color: var(--text); font-size: 12px; font-weight: 500; margin-top: 8px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-badge { margin-top: 6px; }

/* Выпадающие панели (локация / период) */
.dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  max-height: 200px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
}
.dropdown--right { left: auto; right: 0; }
.dropdown--wide { width: 320px; max-width: calc(100vw - 32px); padding: 16px; max-height: none; }

.dropdown-item {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color 140ms ease, color 140ms ease;
}
.dropdown-item:hover { background: var(--primary-soft-2); color: var(--primary); }
.dropdown-item svg { color: var(--muted-2); }
.dropdown-empty { padding: 10px 16px; font-size: 12px; color: var(--muted-2); }

.dropdown-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  margin-bottom: 10px;
}

.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.preset-btn {
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--slate-soft);
  font-size: 12px;
  font-weight: 500;
  transition: background-color 150ms ease, color 150ms ease;
}
.preset-btn:hover { background: var(--primary-soft-2); color: var(--primary); }

.period-divider { border-top: 1px solid var(--line); padding-top: 14px; }

.date-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.date-mini { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 10px; font-size: 12px; background: var(--surface); }

.dropdown-foot { display: flex; align-items: center; justify-content: space-between; }
.link-btn { font-size: 12px; color: var(--muted); transition: color 150ms ease; }
.link-btn:hover { color: var(--heading); }

/* Боковая панель «Возможности» */
.feature-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.feature-head h3 { font-size: 16px; font-weight: 700; color: var(--heading); }

.feature-list { display: flex; flex-direction: column; gap: 14px; }
.feature-item { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.5; }
.feature-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); margin-top: 7px; }

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.status-led { display: inline-flex; align-items: center; gap: 8px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); }
.status-dot--live { animation: statusPulse 1.6s ease-in-out infinite; }
@keyframes statusPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

.version-chip { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 11px; background: var(--slate-soft); color: var(--slate-text); padding: 2px 8px; border-radius: 6px; }

/* Редактор биометрии */
.editor-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 24px; }

.editor-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 16px;
  background: #0f172a;
  border-radius: 14px;
  position: relative;
  overflow: hidden;
}
.editor-frame { position: relative; max-width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.editor-frame img,
.editor-frame video { max-width: 100%; max-height: 300px; border-radius: 10px; object-fit: contain; }

.biometric-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.face-box { position: relative; width: 132px; height: 176px; border: 2px solid var(--primary); border-radius: 10px; }
.face-label {
  position: absolute;
  top: -14px;
  left: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.landmark, .landmark--bar { position: absolute; background: #22d3ee; border-radius: 50%; box-shadow: 0 0 4px rgba(34, 211, 238, 0.85); }
.landmark { width: 5px; height: 5px; }
.landmark--bar { width: 8px; height: 4px; border-radius: 4px; }

@keyframes pulseTarget { 0%, 100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.04); opacity: 1; } }
.pulse-target { animation: pulseTarget 1.8s ease-in-out infinite; }

@keyframes scanAnimation { 0% { top: 0%; opacity: 0.8; } 50% { opacity: 1; } 100% { top: 100%; opacity: 0.8; } }
.scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  animation: scanAnimation 2s linear infinite alternate;
}

.crop-layer { position: absolute; inset: 0; z-index: 30; cursor: crosshair; touch-action: none; }
.crop-selection { position: absolute; border: 2px solid #8b8fff; box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.62); }
.crop-size {
  position: absolute;
  top: -28px;
  left: 0;
  white-space: nowrap;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}
.crop-hint {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 10px;
  padding: 6px 10px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
}

.editor-status { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: #cbd5e1; }
.editor-status .status-dot { background: #34d399; }

.editor-controls { display: flex; flex-direction: column; justify-content: space-between; gap: 16px; }
.editor-controls .stack { display: flex; flex-direction: column; gap: 16px; }

.slider-label { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.slider-val { color: var(--muted-2); font-family: ui-monospace, Menlo, Consolas, monospace; }

.editor-section { padding-top: 12px; border-top: 1px solid var(--line); }
.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text);
  transition: background-color 150ms ease;
}
.tool-btn:hover { background: var(--slate-soft); }
.tool-btn svg { color: var(--muted); }

.crop-help { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 10px; color: var(--muted); }
.crop-help .link-btn { font-weight: 600; color: #4338ca; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--primary-soft-2); border: 1px solid #c7ccf8; }
.switch-copy { font-size: 12px; }
.switch-copy .t { font-weight: 700; color: #312e81; }
.switch-copy .s { color: var(--primary); opacity: 0.75; font-size: 11px; }
.switch-row input { width: 16px; height: 16px; accent-color: var(--primary); flex: 0 0 auto; }

/* Модальные: сканирование */
.scan-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; min-height: 380px; }
.spinner-box { position: relative; width: 96px; height: 96px; margin-bottom: 24px; }
.spinner-ring--ping { position: absolute; inset: 0; border-radius: 50%; border: 4px solid var(--ring); animation: statusPulse 1.6s ease-in-out infinite; }
.spinner-ring { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--primary); border-top-color: transparent; display: flex; align-items: center; justify-content: center; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.spinner-icon { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--primary); }
.scan-title { font-size: 20px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.scan-sub { font-size: 14px; color: var(--muted); max-width: 460px; margin-bottom: 24px; }

.progress-track { width: 100%; max-width: 480px; height: 12px; border-radius: 999px; background: var(--slate-soft); overflow: hidden; margin-bottom: 8px; }
.progress-bar { height: 100%; border-radius: 999px; background: var(--primary); transition: width 300ms ease; }
.scan-pct { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; font-weight: 600; color: var(--muted); }

.results-state { display: flex; flex-direction: column; overflow: hidden; }
.match-list { flex: 1; overflow-y: auto; max-height: 500px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }

.match-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.match-card--top { border: 2px solid rgba(16, 185, 129, 0.5); background: rgba(236, 253, 245, 0.35); }
.match-main { display: flex; align-items: center; gap: 16px; flex: 1; min-width: 0; }

.match-avatar { position: relative; flex: 0 0 auto; width: 80px; height: 80px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); box-shadow: var(--shadow); }
.match-avatar img { width: 100%; height: 100%; object-fit: cover; }
.match-avatar-tag { position: absolute; bottom: 0; left: 0; right: 0; background: #334155; color: #fff; font-size: 10px; text-align: center; font-weight: 700; padding: 2px 0; }
.match-avatar-tag--top { background: #059669; }

.match-name { font-weight: 700; color: var(--heading); font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.match-meta { display: grid; grid-template-columns: auto auto; gap: 2px 18px; margin-top: 8px; font-size: 12px; color: var(--muted); }
.match-meta span { color: var(--muted-2); }

.match-actions { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
.btn--min { flex: 1; padding: 8px 14px; font-size: 12px; border-radius: 12px; }

.modal-info { font-size: 12px; color: var(--muted); }

/* ============================================================================
   Страница: Поиск по данным (search-by-data)
   ========================================================================== */

.sidebar-lead { margin-bottom: 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.cat-block { margin-bottom: 16px; }
.cat-block:last-child { margin-bottom: 0; }
.cat-block__name {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--primary-soft-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--heading);
}
.cat-block__name::before {
  content: '';
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.cat-block__list { margin: 0; padding: 0; list-style: none; }
.cat-block__list li {
  position: relative;
  padding: 3px 0 3px 16px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.cat-block__list li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--muted-2);
}

.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding: 20px 0; }
.category {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  line-height:1.2;
  font-weight: 500;
  color: var(--text);
  transition: background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
.category:hover { background: var(--primary-soft-2); border-color: var(--primary); }
.category.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.category svg { width: 20px; height: 20px; fill: currentColor; flex: 0 0 auto; }

.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.field-row-label { font-size: 14px; font-weight: 600; color: var(--muted); width: 150px; flex: 0 0 auto; }

.field-select, .field-input {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 14px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field-select:focus, .field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--ring);
}
.field-input { flex: 1; min-width: 0; }

.field-input.error { animation: errorBlink 1s; }
@keyframes errorBlink {
  0%, 100% { border-color: var(--border); }
  25%, 75% { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.16); }
}

.search-rows { display: flex; flex-direction: column; }
.search-row {
	display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 6px;
	margin-bottom: 8px;
    background: #edf0ff;
    padding: 5px 5px;
}
.search-row-label { font-size: 14px; font-weight: 600; color: var(--muted); flex: 0 0 auto; }
.search-row-value { flex: 1; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
.search-row-value input {
  width: 100%;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  font-size: 14px;
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}
.row-btn {
  padding: 4px 8px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  color: var(--muted);
  transition: background-color 160ms ease, color 160ms ease;
}
.row-btn:hover { background: var(--primary-soft-2); color: var(--primary); }
.row-btn.delete:hover { background: #fde8e8; color: #ef4444; }

.actions-bar { display: flex; gap: 12px; padding: 18px 0 0; border-top: 1px solid var(--line); }

/* ============================================================================
   Страница: Поиск по аудио (search-by-audio)
   ========================================================================== */
.page-sidebar { position: sticky; top: 20px; }

.step { margin-bottom: 22px; }
.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step-number {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}
.step-head h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--heading); }

.upload-box {
  border: 2px dashed #c7ccf8;
  padding: 22px;
  text-align: center;
  border-radius: 12px;
  cursor: pointer;
  background: var(--primary-soft-2);
  transition: background-color 200ms ease, border-color 200ms ease;
}
.upload-box:hover, .upload-box.dragover { background: var(--primary-soft); border-color: var(--primary); }
.upload-box p { margin: 0; color: var(--primary); }
.upload-box small { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

.file-meta { display: none; margin-top: 12px; font-size: 13px; color: var(--muted); }
.file-meta b { color: var(--text); }

.transcribe-btn, .search-btn { background: var(--primary); color: #fff; border-radius: 10px; padding: 10px 20px; font-weight: 500; transition: background-color 180ms ease; }
.transcribe-btn:hover, .search-btn:hover { background: var(--primary-hover); }
.transcribe-btn:disabled { background: #a5b4fc; cursor: not-allowed; }

.transcript-status { font-size: 13px; color: var(--muted); margin-top: 12px; }
.transcript { margin-top: 14px; }

.audio-player { display: flex; align-items: center; margin-top: 16px; }
.audio-player audio { width: 100%; }

.segment {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  margin-bottom: 6px;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.segment:hover { background: var(--slate-soft); }
.segment.active { background: var(--primary-soft-2); border-color: var(--primary); }
.segment input[type="checkbox"] { margin-right: 4px; cursor: pointer; accent-color: var(--primary); }
.segment-time { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--primary); white-space: nowrap; flex: 0 0 auto; }
.segment-text { color: var(--text); }

.demo-note { font-size: 12px; color: var(--muted-2); margin-bottom: 10px; }

.custom-fragments { margin-top: 16px; }
.custom-fragments input[type="text"] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  background: var(--surface);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.custom-fragments input[type="text"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.add-fragment { margin-top: 8px; background: var(--primary-soft); color: var(--primary); padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 500; transition: background-color 160ms ease; }
.add-fragment:hover { background: var(--primary); color: #fff; }

.results {
  display: none;
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--primary-soft-2);
  border-left: 4px solid var(--primary);
  border-radius: 0 12px 12px 0;
}
.results h4 { margin: 0 0 8px; color: var(--heading); }
.results ul { margin: 0; padding-left: 20px; color: var(--text); font-size: 13px; line-height: 1.7; }

/* ============================================================================
   Страница: Комбинированный поиск (kombipoisk)
   ========================================================================== */
.app { display: flex; gap: 24px; width: 100%; align-items: flex-start; }

.app .card-right {
  flex: 0 0 auto;
  width: 100%;
  max-width: 420px;
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid #eef1f6;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  padding: 24px;
}

.app .steps { display: flex; gap: 4px; margin-bottom: 24px; }

.app .step { flex: 1; text-align: center; position: relative; }
.app .step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  padding: 0 6px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 700;
  background: var(--slate-soft);
  color: var(--muted-2);
  margin-bottom: 6px;
  transition: background-color 200ms ease, color 200ms ease;
}
.app .step.active .step-num { background: var(--primary); color: #fff; }
.app .step.done .step-num { background: var(--success); color: #fff; }
.app .step-label { font-size: 11px; color: var(--muted-2); transition: color 200ms ease; line-height: 1.3; }
.app .step.active .step-label { color: var(--primary); font-weight: 600; }
.app .step.done .step-label { color: var(--success); }
.app .step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 26px);
  width: calc(100% - 52px);
  height: 2px;
  background: var(--line);
}
.app .step.done:not(:last-child)::after { background: var(--success); }



.app .tab-pane { display: none; }
.app .tab-pane.active { display: block; }

.app .tab { display: none; }
.app .tab.active { display: block; }


.app .step-title { font-size: 18px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.app .step-desc { font-size: 14px; color: var(--muted); margin-bottom: 20px; }



.app .form-group {
    /* margin-bottom: 20px; */
  }
  
.app .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
  }
.app .form-group select,
.app .form-group input[type="text"],
.app .form-group input[type="date"],
.app .form-group input[type="file"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    outline: none;
    transition: .2s;
  }
  
.app .form-group select {margin-top:16px;}
 
.app .form-group select:focus,
.app .form-group input[type="text"]:focus,
.app .form-group input[type="date"]:focus {
    border-color: #4a6cf7;
    box-shadow: 0 0 0 3px rgba(74,108,247,.12);
  }
.app .form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.app .form-row .form-group { flex: 1; min-width: 140px; }




.app .checkbox-group { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.app .checkbox-group label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  transition: border-color 180ms ease, background-color 180ms ease;
}
.app .checkbox-group label:hover { border-color: var(--primary); background: var(--primary-soft-2); }
.app .checkbox-group input[type="checkbox"] { accent-color: var(--primary); width: 18px; height: 18px; flex: 0 0 auto; }
.app .checkbox-sub { display: block; font-size: 12px; color: var(--muted-2); margin-top: 2px; }

.app .file-upload {
  position: relative;
  border: 1px dashed var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease;
}
.app .file-upload:hover { border-color: var(--primary); background: var(--primary-soft-2); }
.app .file-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.app .file-name { display: block; font-size: 12px; color: var(--muted-2); margin-top: 6px; }
.app .file-hint { font-size: 11px; color: var(--muted-2); margin-top: 4px; }

.app .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #4a6cf7;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;
  }
.app .btn:hover { background: #7088ff; }
.app .btn:disabled { opacity: .4; cursor: default; }
.app .btn-outline {
    background: transparent;
    color: #4a6cf7;
    border: 1px solid #4a6cf7;
  }
  .btn-outline:hover { background: #605be5; }

.app .hint-text { font-size: 12px; color: var(--muted-2); margin-top: 10px; }
.app .nav-actions { display: flex; gap: 12px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.app .change-link { font-size: 13px; color: var(--primary); font-weight: 500; cursor: pointer; transition: color 160ms ease; }
.app .change-link:hover { color: var(--primary-hover); text-decoration: underline; }

.app .review-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.app .review-key { color: var(--muted-2); min-width: 110px; }
.app .review-val { color: var(--text); font-weight: 500; overflow-wrap: anywhere; }

  /* Results */
.app .result-title { font-size: 16px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.app .result-count { font-size: 14px; font-weight: 700; color: var(--heading); margin-bottom: 16px; }
.app .result-card {
  display: flex;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  font-size: 13px;
  transition: border-color 180ms ease;
}
.app .result-card:hover { border-color: var(--border); }
.app .result-card .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--primary-soft-2);
  color: var(--primary);
  margin-bottom: 6px;
}
.app .result-card .row { display: flex; justify-content: space-between; color: var(--muted); line-height: 1.8; }
.app .result-body { flex: 1; min-width: 0; }
.app .result-thumb {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft-2);
  color: var(--primary);
}

.app .highlight { box-shadow: 0 0 0 3px rgba(75, 82, 243, 0.35); }

/* ============================================================================
   Страница: Недавние / Сохранённые запросы (recentzapros)
   ========================================================================== */
.filters { display: flex; gap: 8px; margin: 0 0 16px; padding: 0; border: 0; overflow-x: auto; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 22px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.filter-button:hover { border-color: var(--primary); color: #fff; transform: translateY(-1px); }
.filter-button.active { border-color: transparent; color: #fff; background: var(--primary); box-shadow: 0 6px 16px -8px rgba(75, 82, 243, 0.5); }

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.table-wrap table {
  width: auto;
  /* min-width: 880px; */
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--surface);
}

th, td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); vertical-align: middle; text-align: left; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:last-child td { border-bottom: 0; }

th {
  height: 46px;
  padding: 8px 14px;
  background: var(--surface-soft);
  color: var(--heading);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
td { min-height: 54px; padding: 8px 13px; font-size: 14px; line-height: 1.3; }
tbody tr { transition: background-color 160ms ease, opacity 200ms ease, transform 220ms ease; }
tbody tr:hover { background: var(--primary-soft-2); }

@keyframes rowIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
tbody tr { animation: rowIn 420ms; }
tbody tr:nth-child(2) { animation-delay: 55ms; }
tbody tr:nth-child(3) { animation-delay: 110ms; }
tbody tr:nth-child(4) { animation-delay: 165ms; }
tbody tr:nth-child(5) { animation-delay: 220ms; }


#request-list td {
	padding: 5px;
}

.date-cell { color: var(--muted); }
.cell-muted { margin-top: 3px; color: var(--muted-2); font-size: 13px; }

.type-cell { display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.type-icon, .button-icon, .info-icon { color: var(--primary); fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.type-icon { width: 25px; height: 25px; stroke-width: 1.9; }
.button-icon { width: 20px; height: 20px; stroke-width: 1.9; }
.info-icon { width: 25px; height: 25px; stroke-width: 2; }

.actions-row { display: grid; grid-template-columns: 104px minmax(150px, 1fr) 110px 28px; gap: 10px; align-items: center; }
.action-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--primary);
  border-radius: 10px;
  color: var(--primary);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.action-button:hover { background: #7088ff; box-shadow: 0 4px 12px -8px rgba(75, 82, 243, 0.4); transform: translateY(-1px); }
.action-button.primary { border-color: transparent; color: #fff; background: var(--primary); box-shadow: 0 5px 12px -8px rgba(75, 82, 243, 0.5); }
.action-button.primary:hover { background: var(--primary-hover); }

.menu-wrap { position: relative; }
.more-button {
  width: 28px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  letter-spacing: 1px;
}
.more-button:hover, .more-button[aria-expanded="true"] { background: var(--primary-soft-2); }

.context-menu {
  position: absolute;
  z-index: 30;
  right: 0;
  top: calc(100% + 4px);
  width: 150px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px) scale(0.98);
  transform-origin: top right;
  transition: opacity 140ms ease, transform 140ms ease, visibility 140ms ease;
}
.context-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.context-menu button {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  font-size: 13px;
  transition: background-color 140ms ease;
}
.context-menu button:hover { background: var(--primary-soft-2); color:#605be5;}
.context-menu .danger { color: var(--danger); }

.empty-state {
  display: none;
  min-width: 800px;
  padding: 48px 20px;
  color: var(--muted);
  background: var(--surface);
  text-align: center;
  font-size: 15px;
}

/* ============================================================================
   Страница: Личный кабинет (kabinet)
   ========================================================================== */
.cabinet-page { padding-bottom: 48px; }
.cabinet-page > .page-title { margin-bottom: 22px; }

.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-xl); box-shadow: var(--shadow); }

.top-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); gap: 10px; }
.top-grid > .surface { min-width: 0; }

.heading { display: flex; align-items: center; gap: 12px; min-width: 0; height: 40px; }
.heading h2 { font-size: 22px; font-weight: 700; color: var(--heading); letter-spacing: -0.4px; white-space: nowrap; }
.icon { display: block; flex: none; color: var(--primary); }
.search-icon { width: 36px; height: 36px; }

.search-panel { padding: 10px; }
.search-panel .heading { margin-bottom: 14px; }
.search-lead { font-size: 18px; line-height: 1.4; color: var(--heading); font-weight: 500; }
.search-description { margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.55; }

.free-search {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 24px;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(105deg, var(--primary-soft-2) 0%, #e8eaff 100%);
}
.database-icon { width: 40px; height: 40px; color: var(--primary); }
.free-search strong { display: block; margin-bottom: 4px; line-height:1.1; color: var(--heading); }
.free-search p { color: var(--muted); font-size: 13px; line-height: 1.55; }

.multimedia-panel { padding: 10px; }
.multimedia-panel > .heading { margin: 0 0 8px 8px; }
.multimedia-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; }

.credit-table {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--slate-soft);
}

.tarif h5 {font-size:16px;}
.tarif h6 {font-size:14px;}

.credit-table h3 { margin-bottom: 8px; font-size: 15px; font-weight: 700; color: var(--heading); }
.credit-rows { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.credit-row {
  display: grid;
  grid-template-columns: 50% 50%;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.credit-row + .credit-row { border-top: 1px solid var(--line); }
.credit-row span { display: flex; align-items: center; padding: 9px 10px; }
.credit-row span + span { padding-left: 12px; border-left: 1px solid var(--line); }

.credit-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--primary-soft-2);
  color: var(--muted);
  font-size: 13px;
}



.info-icon { width: 22px; height: 22px; color: var(--primary); }

.credit-packs {padding-top:8px;}
.credit-packs h3 { margin: 2px 0 10px; font-size: 15px; font-weight: 700; color: var(--heading); }
.credit-pack-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.credit-pack { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-align: center; background: var(--surface); }
.credit-pack h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--heading); }
.credit-pack .price { margin: 4px 0 8px; font-size: 20px; font-weight: 700; color: var(--heading); }

.action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px solid var(--primary);
  border-radius: 10px;
  background: var(--surface);
  color: var(--primary);
  font-size: 13px;
  margin-top:10px;
  font-weight: 500;
  text-align: center;
  text-decoration: none;
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
.action:hover { background: #4b52f3); box-shadow: 0 4px 12px -8px rgba(75, 82, 243, 0.45); transform: translateY(-1px); }
.action:active { transform: none; }

.action--filled { border-color: var(--primary); background: var(--primary); color: #fff; }
.action--filled:hover { background: var(--primary-hover); box-shadow: 0 5px 14px -8px rgba(75, 82, 243, 0.5); }



.middle-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 6px; margin-top: 10px; }
.middle-grid > .surface { min-width: 0; }

.section-heading { height: 42px; gap: 14px; }
.section-heading h2 { font-size: 20px; line-height: 1.3; white-space: nowrap; }
.section-icon { width: 32px; height: 32px; }

.access-panel { padding: 10px; }
.access-panel > .section-heading { margin-bottom: 14px; }
.access-body { display: grid; grid-template-columns: 1.4fr 2px minmax(0, 2fr); gap: 8px; }

.single-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--slate-soft);
  white-space: nowrap;
}
.single-price span { font-size: 16px; font-weight: 600; color: var(--text); }
.single-price strong { font-size: 20px; font-weight: 700; color: var(--heading); }
.single-access p { margin: 12px 4px 18px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.single-access .action { height: 42px; margin-top:40px;}

.access-divider { background: var(--line); }

.materials-box { min-width: 0; padding: 10px 7px 12px; border: 1px solid var(--line); border-radius: 12px; }
.materials-heading { display: flex; align-items: center; gap: 10px; height: 38px; }
.materials-heading h3 { font-size: 16px; font-weight: 700; color: var(--heading); white-space: nowrap; }
.layers-icon { width: 30px; height: 30px; color: var(--primary); }
.material-packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.material-pack { min-width: 0; padding: 12px 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--slate-soft); text-align: center; }
.material-pack .quantity { font-size: 18px; font-weight: 700; color: var(--heading); }
.material-pack .unit { font-size: 12px; color: var(--muted); }
.material-pack .price { margin-top: 10px; font-size: 18px; font-weight: 700; color: var(--heading); }


.subscriptions-panel { padding: 10px; }
.subscriptions-panel > .section-heading { margin: 0 0 4px 10px; }
.crown-icon { width: 32px; height: 32px; color: var(--primary); }

.subscriptions { display: grid; grid-template-columns: minmax(0, 218fr) minmax(0, 252fr); gap: 12px; }
.subscription {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.subscription--plus { border-color: #9e91f9; background: var(--primary-soft-2); box-shadow: inset 0 0 0 1px rgba(75, 82, 243, 0.1); }
.subscription h3 { margin: 0 0 0 4px; font-size: 18px; font-weight: 700; color: var(--heading); }
.subscription-price { margin: 8px 0 0 4px; font-size: 18px; color: var(--text); }
.subscription-price strong { font-weight: 700; color: var(--heading); }
.subscription-price span { font-size: 14px; color: var(--muted); }

.subscription .badge {
  position: absolute;
  top: 8px;
  right: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 7px;
}

.features { display: grid; gap: 6px; margin: 12px 0 10px 4px; padding: 0; list-style: none; }
.features li { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: start; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.2; }
.check-icon { width: 16px; height: 16px; margin-top: 1px; color: var(--primary); }

.subscription .action { height: 40px; margin-top: auto; }

.monitor-panel { padding: 10px; margin-top: 10px; }
.monitor-panel > .section-heading { margin-bottom: 14px; }
.monitor-content { display: grid; grid-template-columns: repeat(3, 1fr) minmax(0, 3fr); gap: 10px; }
.monitor-option { padding: 14px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--slate-soft); text-align: center; }
.monitor-option .quantity { font-size: 18px; font-weight: 700; color: var(--heading); }
.monitor-option .unit { font-size: 13px; color: var(--muted); }
.monitor-option .price { margin-top: 8px; font-size: 18px; font-weight: 700; color: var(--heading); }
.monitor-option .price span { font-size: 13px; font-weight: 400; color: var(--muted); }

.notification {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(105deg, var(--primary-soft-2), #e8eaff);
}
.bell-icon { width: 36px; height: 36px; color: var(--primary); flex: 0 0 auto; }
.notification strong { display: block; margin: 0 0 8px; line-height: 1.1; font-size: 13px; color: var(--heading); }
.notification p { color: var(--muted); font-size: 13px; line-height: 1.55; }

/* Диалог оформления (кабинет) */
.checkout-dialog {
  width: min(420px, calc(100vw - 32px));
  padding: 26px;
  border: 1px solid #dedcf6;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.checkout-dialog[open] { animation: dialogIn 0.2s ease-out both; }
.checkout-dialog::backdrop { background: rgba(10, 10, 39, 0.5); }
@keyframes dialogIn { from { opacity: 0; transform: translateY(12px) scale(0.985); } to { opacity: 1; transform: translateY(0) scale(1); } }

.dialog-close {
  position: absolute;
  top: 12px;
  right: 14px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  font-size: 27px;
  line-height: 1;
}
.dialog-close:hover { background: var(--primary-soft-2); }
.dialog-eyebrow { margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.checkout-dialog h2 { max-width: 330px; font-size: 22px; line-height: 1.3; color: var(--heading); }
.dialog-price { margin: 12px 0 20px; font-size: 22px; font-weight: 700; color: var(--heading); }
.dialog-price span { font-size: 15px; font-weight: 400; color: var(--muted); }
.dialog-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 700; color: var(--text); }

.dialog-input {
  width: 100%;
  height: 43px;
  margin-bottom: 14px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.dialog-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.checkout-dialog .action { height: 43px; }
.dialog-disclaimer { margin-top: 12px; color: var(--muted); font-size: 12px; line-height: 1.5; }

/* Кабинетный тост использует атрибут hidden + id=toast */
.page-toast {
  position: fixed;
  z-index: 60;
  right: 18px;
  bottom: 18px;
  max-width: min(390px, calc(100vw - 36px));
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  line-height: 1.45;
}
.page-toast[hidden] { display: none; }

/* ============================================================================
   Адаптивность
   ========================================================================== */
@media (max-width: 1080px) {
  .content-grid { grid-template-columns: 1fr; }
  .layout-2 { grid-template-columns: 1fr; }
  .layout-2 .page-sidebar { position: static; }
  .app { flex-direction: column; }
  .app .card-right { max-width: none; }
  .top-grid, .middle-grid { grid-template-columns: 1fr; }
  .multimedia-layout { grid-template-columns: 1fr; }
  .monitor-content { grid-template-columns: repeat(3, 1fr); }
  .notification { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .upload-grid { grid-template-columns: 1fr; }
  .field-grid-2 { grid-template-columns: 1fr; }
  .editor-grid { grid-template-columns: 1fr; }
  .match-card { flex-direction: column; align-items: stretch; }
  .match-actions { flex-direction: row; }
  .actions-row { grid-template-columns: 1fr 1fr; }
  .actions-row .menu-wrap { grid-column: 1 / -1; }
  .access-body { grid-template-columns: 1fr; }
  .access-divider { display: none; }
  .material-packs { grid-template-columns: 1fr 1fr; }
  .subscriptions { grid-template-columns: 1fr; }
  .monitor-content { grid-template-columns: 1fr; }
  .notification { grid-column: auto; }
  .match-meta { grid-template-columns: 1fr; }
  .search-row { flex-wrap: wrap; }
  .search-row-label { width: 100%; }
}