/* АРП · третий режим выдачи «Как в ОА».
   Табличная геометрия намеренно повторяет renderer проекта «Тапочек». */

.results-view-btn[disabled] {
  opacity: .48;
  cursor: not-allowed;
}

.results-grid.results-grid-oa-mode {
  display: block;
  min-width: 0;
}

.oa-results-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.oa-column-search {
  border: 1px solid #dce6ef;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.oa-column-search-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  background: #fafbfd;
  border-bottom: 1px solid #e6edf4;
}

.oa-column-search-head > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.oa-column-search-head strong {
  font-size: 14px;
  color: #25364a;
}

.oa-column-search-head span {
  font-size: 11px;
  line-height: 1.35;
  color: #748394;
}

.oa-filter-reset {
  flex: 0 0 auto;
  border: 1px solid #cfdae5;
  background: #fff;
  color: #40566b;
  border-radius: 8px;
  padding: 7px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.oa-filter-reset:hover { background: #f3f7fb; }

.oa-global-filter {
  display: grid;
  grid-template-columns: 180px minmax(240px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #e6edf4;
}

.oa-global-filter > span,
.oa-filter-cell > span {
  color: #607184;
  font-size: 10px;
  font-weight: 800;
}

.oa-global-filter input,
.oa-filter-cell input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  border: 1px solid #d5dee8;
  border-radius: 7px;
  background: #fff;
  color: #26394c;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.oa-global-filter input {
  padding: 8px 9px;
}

.oa-filter-cell input {
  padding: 6px 7px;
}

.oa-global-filter input:focus,
.oa-filter-cell input:focus {
  border-color: #8fb7dc;
  box-shadow: 0 0 0 2px rgba(43,108,176,.08);
}

.oa-column-filter-scroll {
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.oa-column-filter-grid {
  display: grid;
  grid-template-columns: 72px 220px 220px 260px 130px 130px 190px 190px;
  min-width: 1380px;
  background: #f3f7fb;
}

.oa-filter-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 7px 8px 8px;
  border-right: 1px solid #e1e8ef;
}

.oa-filter-cell:last-child { border-right: 0; }

.oa-results-status {
  min-height: 18px;
  color: #536577;
  font-size: 12px;
}

.oa-loading-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: oa-pulse 1s ease-in-out infinite alternate;
}

@keyframes oa-pulse { from { opacity: .25; } to { opacity: 1; } }

.oa-results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  transition: opacity .12s ease;
}

.oa-results-list.is-loading { opacity: .55; }

.oa-lab-group {
  border: 1px solid #d7e2ec;
  border-radius: 14px;
  background: #f7f9fc;
  overflow: visible;
}

.oa-lab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border-bottom: 1px solid #dce6ef;
  background: #eef4f9;
  border-radius: 14px 14px 0 0;
}

.oa-lab-name {
  color: #203a55;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

a.oa-lab-name:hover { text-decoration: underline; }

.oa-lab-meta {
  margin-top: 3px;
  color: #718091;
  font-size: 11px;
}

.oa-address-group {
  margin: 10px;
  border: 1px solid #dce6ef;
  border-radius: 12px;
  background: #fff;
  overflow: visible;
}

.oa-address-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border-bottom: 1px solid #e6edf4;
  background: #fbfcfe;
  border-radius: 12px 12px 0 0;
}

.oa-address-label {
  color: #7a8998;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.oa-address-head strong {
  color: #34495d;
  font-size: 12px;
  line-height: 1.4;
}

.oa-area-group {
  padding: 0 10px 10px;
  overflow: visible;
}

.oa-area-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 1px 0;
  color: #455c72;
  font-size: 12px;
}

.oa-area-code {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid #d8e3ed;
  border-radius: 6px;
  background: #f4f8fc;
  color: #60768a;
  font-size: 10px;
  font-weight: 800;
}

/* Ниже — геометрия таблицы из «Тапочка»: оставляем ширины и rowspan-логику. */
.oa-structure-item {
  border: 1px solid #dce6ef;
  border-radius: 12px;
  background: #fff;
  overflow: visible;
  margin-top: 10px;
}

.oa-structure-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  background: #fafbfd;
  border-bottom: 1px solid #e6edf4;
}

.oa-structure-item-head > div {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.oa-structure-item-head strong { font-size: 14px; }

.oa-match-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef6ff;
  color: #446887;
  font-size: 10px;
  font-weight: 700;
}

.oa-structure-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  scrollbar-gutter: stable;
}

.oa-structure-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1380px;
  table-layout: fixed;
}

.oa-structure-table th,
.oa-structure-table td {
  border-right: 1px solid #e1e8ef;
  border-bottom: 1px solid #e1e8ef;
  padding: 9px 10px;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

.oa-structure-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f3f7fb;
  color: #526476;
  font-size: 11px;
  font-weight: 800;
  box-shadow: 0 1px 0 #dbe4ed;
}

.oa-structure-table tr:last-child td { border-bottom: 0; }
.oa-structure-table th:last-child,
.oa-structure-table td:last-child { border-right: 0; }
.oa-structure-table th:nth-child(1) { width: 72px; }
.oa-structure-table th:nth-child(2) { width: 220px; }
.oa-structure-table th:nth-child(3) { width: 220px; }
.oa-structure-table th:nth-child(4) { width: 260px; }
.oa-structure-table th:nth-child(5) { width: 130px; }
.oa-structure-table th:nth-child(6) { width: 130px; }
.oa-structure-table th:nth-child(7) { width: 190px; }
.oa-structure-table th:nth-child(8) { width: 190px; }

.oa-structure-table .oa-item-number {
  font-weight: 800;
  font-size: 13px;
  background: #fbfcfe;
}

.oa-structure-ref { margin-bottom: 7px; }
.oa-structure-ref:last-child { margin-bottom: 0; }
.oa-structure-ref strong,
.oa-structure-ref span { display: block; }
.oa-structure-ref small {
  display: block;
  color: #7b8997;
  font-size: 10px;
  margin-top: 2px;
}

.oa-code-cell { font-size: 11px; }

.oa-code-chip {
  display: inline-block;
  margin: 1px 4px 3px 0;
  padding: 3px 6px;
  border-radius: 7px;
  background: #eef3f7;
  color: #40566b;
  font-size: 11px;
}

.oa-indicator-name { font-weight: 700; }

.oa-range-chip {
  display: block;
  width: max-content;
  max-width: 100%;
  white-space: normal;
  margin: 2px 5px 2px 0;
  padding: 3px 7px;
  border-radius: 7px;
  background: #f0f4f8;
  font-size: 12px;
}

.oa-muted { color: #8a97a4; }

.oa-match-highlight {
  padding: 0 .08em;
  border-radius: 3px;
  background: #ffe79a;
  color: inherit;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.oa-results-pager {
  width: 100%;
  margin: 14px 0 0;
}

.oa-results-pager:empty { display: none; }

.oa-results-pager .oa-pagination-panel {
  width: 100%;
}


@media (max-width: 900px) {
  .oa-column-search-head { align-items: flex-start; flex-direction: column; }
  .oa-global-filter { grid-template-columns: 1fr; }
  .oa-address-group { margin: 7px; }
  .oa-area-group { padding-left: 6px; padding-right: 6px; }
}

/* Старые экспортёры формируют карточечную выдачу, поэтому в PDF-подобном режиме
   временно не показываем их до появления отдельного OA-export. */
body.results-view-oa .results-export-actions {
  display: none !important;
}

/* ===== OA UI v2: sticky filters, aligned columns, lab collapsing ===== */
.oa-results-shell {
  --oa-col-number: 72px;
  --oa-col-document: 220px;
  --oa-col-method: 220px;
  --oa-col-objects: 260px;
  --oa-col-okpd2: 130px;
  --oa-col-tnved: 130px;
  --oa-col-indicator: 190px;
  --oa-col-range: 190px;
  --oa-table-width: 1412px;
  --oa-table-inset: 22px;
}

.oa-column-search {
  position: sticky;
  top: 0;
  z-index: 25;
  box-shadow: 0 8px 20px rgba(31, 49, 69, .10);
}

.oa-column-search-head {
  flex-wrap: wrap;
  padding: 8px 10px;
}

.oa-stats-row,
.oa-collapse-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.oa-stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid #dce6ef;
  border-radius: 999px;
  background: #fff;
  color: #607184;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.oa-stat-chip strong {
  color: #203a55;
  font-size: 14px;
  line-height: 1;
}

.oa-stat-chip-primary {
  border-color: #b9d0ff;
  background: #edf4ff;
  color: #315fd2;
}

.oa-stat-chip-primary strong { color: #2457c5; }

.oa-top-filters {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.4fr);
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #e6edf4;
  background: #fff;
}

.oa-top-filters .oa-global-filter {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 8px;
  padding: 0;
  border-bottom: 0;
}

.oa-column-filter-scroll {
  padding-left: var(--oa-table-inset);
  padding-right: var(--oa-table-inset);
  background: #f3f7fb;
}

.oa-column-filter-grid {
  grid-template-columns:
    var(--oa-col-number)
    var(--oa-col-document)
    var(--oa-col-method)
    var(--oa-col-objects)
    var(--oa-col-okpd2)
    var(--oa-col-tnved)
    var(--oa-col-indicator)
    var(--oa-col-range);
  width: var(--oa-table-width);
  min-width: var(--oa-table-width);
}

.oa-filter-cell,
.oa-structure-table th,
.oa-structure-table td {
  box-sizing: border-box;
}

.oa-structure-table {
  width: var(--oa-table-width);
  min-width: var(--oa-table-width);
}

.oa-structure-table col.oa-col-number { width: var(--oa-col-number); }
.oa-structure-table col.oa-col-document { width: var(--oa-col-document); }
.oa-structure-table col.oa-col-method { width: var(--oa-col-method); }
.oa-structure-table col.oa-col-objects { width: var(--oa-col-objects); }
.oa-structure-table col.oa-col-okpd2 { width: var(--oa-col-okpd2); }
.oa-structure-table col.oa-col-tnved { width: var(--oa-col-tnved); }
.oa-structure-table col.oa-col-indicator { width: var(--oa-col-indicator); }
.oa-structure-table col.oa-col-range { width: var(--oa-col-range); }

/* Старые nth-child ширины оставляем ниже по специфичности, colgroup задаёт
   реальную геометрию. Для предсказуемости не даём ячейкам её раздувать. */
.oa-structure-table th:nth-child(1) { width: var(--oa-col-number); }
.oa-structure-table th:nth-child(2) { width: var(--oa-col-document); }
.oa-structure-table th:nth-child(3) { width: var(--oa-col-method); }
.oa-structure-table th:nth-child(4) { width: var(--oa-col-objects); }
.oa-structure-table th:nth-child(5) { width: var(--oa-col-okpd2); }
.oa-structure-table th:nth-child(6) { width: var(--oa-col-tnved); }
.oa-structure-table th:nth-child(7) { width: var(--oa-col-indicator); }
.oa-structure-table th:nth-child(8) { width: var(--oa-col-range); }

.oa-lab-head-main { min-width: 0; }

.oa-lab-toggle {
  flex: 0 0 auto;
  border: 1px solid #cbd8e5;
  border-radius: 8px;
  background: #fff;
  color: #40566b;
  padding: 6px 10px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.oa-lab-toggle:hover { background: #f5f8fb; }
.oa-lab-group.is-collapsed .oa-lab-head { border-bottom: 0; border-radius: 14px; }
.oa-lab-group.is-collapsed .oa-lab-body { display: none; }

@media (max-width: 900px) {
  .oa-results-shell { --oa-table-inset: 14px; }
  .oa-column-search { top: 0; }
  .oa-top-filters { grid-template-columns: 1fr; }
  .oa-top-filters .oa-global-filter { grid-template-columns: 1fr; }
}

/* ===== OA UI v3: full-width layout, sticky lab name, launch notice ===== */

/* В режиме «Как в ОА» таблица важнее карточки справа: отдаём ей всю ширину. */
body.results-view-oa .app > .right-panel,
body.results-view-oa #right-panel,
body.results-view-oa .details-collapse-btn {
  display: none !important;
}

body.results-view-oa .app > .main {
  flex: 1 1 auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* Колонки остаются синхронными с фильтрами, но теперь растягиваются на всю
   доступную ширину. Горизонтальный scroll появляется только на узком экране. */
.oa-results-shell {
  --oa-col-number: 5%;
  --oa-col-document: 17%;
  --oa-col-method: 15%;
  --oa-col-objects: 20%;
  --oa-col-okpd2: 8%;
  --oa-col-tnved: 8%;
  --oa-col-indicator: 14%;
  --oa-col-range: 13%;
  --oa-table-min-width: 1080px;
  --oa-sticky-filter-height: 150px;
  width: 100%;
}

.oa-column-filter-grid {
  width: 100%;
  min-width: var(--oa-table-min-width);
}

.oa-structure-table {
  width: 100%;
  min-width: var(--oa-table-min-width);
}

/* Название текущей лаборатории остаётся перед глазами при длинной ОА.
   Когда начинается следующая лаборатория, sticky-заголовок естественно
   вытесняется её заголовком. */
.oa-lab-head {
  position: sticky;
  top: calc(var(--oa-sticky-filter-height) + 4px);
  z-index: 22;
  box-shadow: 0 3px 10px rgba(31, 49, 69, .08);
}

.oa-filter-scope-hint {
  padding: 6px 10px 7px;
  border-bottom: 1px solid #e6edf4;
  background: #fbfcfe;
  color: #6b7b8c;
  font-size: 10px;
  line-height: 1.35;
}

.oa-filter-scope-hint strong {
  color: #40566b;
}

/* На месяц мягко подсвечиваем новую возможность. После даты класс перестаёт
   назначаться JavaScript-ом автоматически. */
#results-view-oa-btn.oa-new-feature {
  position: relative;
  color: #2457c5;
  background: #edf4ff;
  border-color: #b9d0ff;
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(58, 111, 224, .05), 0 0 0 2px rgba(58, 111, 224, .06);
}

#results-view-oa-btn.oa-new-feature::after {
  content: "НОВОЕ";
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 1px 4px;
  border-radius: 999px;
  background: #2f6fe4;
  color: #fff;
  font-size: 7px;
  line-height: 1.45;
  letter-spacing: .03em;
  vertical-align: middle;
}

@media (max-width: 1200px) {
  .oa-results-shell {
    --oa-table-min-width: 1040px;
  }
}

@media (max-width: 900px) {
  .oa-lab-head {
    top: calc(var(--oa-sticky-filter-height) + 2px);
  }
}

/* ===== OA UI v4: compact sticky toolbar + lab navigator ===== */

.oa-results-shell {
  gap: 8px;
}

/* Исправляем старое правило .oa-column-search-head > div { flex-direction:column },
   из-за которого три счётчика на широком экране шли каждый с новой строки. */
.oa-column-search-head {
  flex-wrap: nowrap;
  gap: 10px;
  padding: 5px 8px;
  min-height: 34px;
}

.oa-column-search-head > .oa-stats-row,
.oa-column-search-head > .oa-lab-navigator,
.oa-column-search-head > .oa-collapse-actions {
  flex-direction: row;
}

.oa-stats-row,
.oa-collapse-actions,
.oa-lab-navigator {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
  min-width: 0;
}

.oa-stat-chip {
  min-height: 24px;
  padding: 3px 7px;
  gap: 4px;
  font-size: 9px;
}

.oa-stat-chip strong {
  font-size: 12px;
}

.oa-scope-info {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #d6e1eb;
  border-radius: 50%;
  background: #fff;
  color: #5c6f83;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: help;
}

.oa-scope-info:hover,
.oa-scope-info:focus-visible {
  color: #2457c5;
  border-color: #a9c3ef;
  background: #f4f8ff;
  outline: none;
}

.oa-lab-navigator {
  flex: 1 1 460px;
  justify-content: center;
}

.oa-lab-nav-label {
  flex: 0 0 auto;
  color: #607184;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.oa-lab-nav-label strong {
  color: #29445f;
  font-size: 10px;
}

.oa-lab-navigator select {
  width: min(430px, 38vw);
  min-width: 220px;
  max-width: 430px;
  height: 26px;
  padding: 2px 26px 2px 7px;
  border: 1px solid #d5dee8;
  border-radius: 7px;
  background: #fff;
  color: #33495f;
  font: inherit;
  font-size: 10px;
  outline: none;
}

.oa-lab-navigator select:focus {
  border-color: #8fb7dc;
  box-shadow: 0 0 0 2px rgba(43,108,176,.08);
}

.oa-nav-btn {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #cfdae5;
  border-radius: 7px;
  background: #fff;
  color: #40566b;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.oa-nav-btn:hover:not(:disabled) { background: #f3f7fb; }
.oa-nav-btn:disabled { opacity: .4; cursor: default; }

.oa-nav-truncated {
  flex: 0 0 auto;
  color: #8794a2;
  font-size: 9px;
  white-space: nowrap;
}

.oa-collapse-actions {
  flex: 0 0 auto;
  margin-left: auto;
}

.oa-collapse-actions .oa-filter-reset {
  padding: 4px 7px;
  font-size: 9px;
  border-radius: 7px;
}

.oa-top-filters {
  gap: 8px;
  padding: 5px 8px;
}

.oa-top-filters .oa-global-filter {
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 6px;
}

.oa-global-filter input {
  padding: 6px 8px;
  font-size: 11px;
}

.oa-column-filter-scroll {
  padding-left: 10px;
  padding-right: 10px;
}

.oa-filter-cell {
  gap: 3px;
  padding: 4px 6px 5px;
}

.oa-filter-cell input {
  padding: 5px 6px;
  font-size: 11px;
}

/* Статус после успешной загрузки дублировал счётчики и отнимал ещё строку. */
.oa-results-status:empty {
  display: none;
}

/* При переходе через навигатор sticky-заголовок не должен скрывать начало карточки. */
.oa-lab-group {
  scroll-margin-top: calc(var(--oa-sticky-filter-height) + 42px);
}

@media (max-width: 1350px) {
  .oa-column-search-head {
    flex-wrap: wrap;
  }
  .oa-lab-navigator {
    order: 3;
    flex-basis: 100%;
    justify-content: flex-start;
  }
  .oa-lab-navigator select {
    width: min(560px, 65vw);
    max-width: 560px;
  }
}

@media (max-width: 800px) {
  .oa-column-search-head {
    align-items: flex-start;
  }
  .oa-stats-row,
  .oa-collapse-actions {
    flex-wrap: wrap;
  }
  .oa-lab-navigator {
    flex-wrap: wrap;
  }
  .oa-lab-navigator select {
    order: 4;
    width: 100%;
    max-width: none;
  }
  .oa-top-filters {
    padding-top: 4px;
    padding-bottom: 4px;
  }
}

/* ===== OA UI v5: sticky stack fix, visible loading, count parity hints ===== */
.oa-results-shell {
  --oa-page-sticky-top: 54px;
}

/* Верхняя шапка обычной выдачи уже sticky с более высоким z-index.
   Поэтому OA-фильтры начинаются строго ПОД ней, а не под ней визуально. */
.oa-column-search {
  top: var(--oa-page-sticky-top, 54px) !important;
  z-index: 70 !important;
}

.oa-lab-head {
  top: calc(var(--oa-page-sticky-top, 54px) + var(--oa-sticky-filter-height) + 4px) !important;
  z-index: 60 !important;
}

.oa-lab-group {
  scroll-margin-top: calc(var(--oa-page-sticky-top, 54px) + var(--oa-sticky-filter-height) + 44px) !important;
}

.oa-source-count-note {
  color: #7c8996;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
  border-left: 1px solid #dce4ec;
  padding-left: 7px;
}

/* Центрированный, но ненавязчивый индикатор тяжёлого серверного поиска. */
.oa-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity .16s ease, visibility .16s ease;
  background: rgba(245, 248, 252, .08);
}

.oa-loading-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.oa-loading-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid rgba(194, 207, 220, .88);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  color: #33495f;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 16px 42px rgba(24, 45, 72, .16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.oa-loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid #dbe7f6;
  border-top-color: #2f6fe4;
  border-radius: 50%;
  animation: oa-v5-spin .75s linear infinite;
}

@keyframes oa-v5-spin {
  to { transform: rotate(360deg); }
}

body.theme-dark .oa-loading-card,
html[data-theme="dark"] .oa-loading-card {
  background: rgba(18, 29, 45, .96);
  color: #dbe7f5;
  border-color: rgba(105, 128, 153, .45);
}

@media (max-width: 900px) {
  .oa-column-search {
    top: var(--oa-page-sticky-top, 0px) !important;
  }
  .oa-lab-head {
    top: calc(var(--oa-page-sticky-top, 0px) + var(--oa-sticky-filter-height) + 2px) !important;
  }
}

/* ===== OA UI v8: compact working header ===== */

/* В рабочем режиме оставляем sticky только строку фильтров по столбцам.
   Статистика, навигация и общие поля доступны одной кнопкой. */
.oa-results-shell.oa-toolbar-collapsed .oa-column-search-head,
.oa-results-shell.oa-toolbar-collapsed .oa-top-filters {
  display: none !important;
}

.oa-results-shell.oa-toolbar-collapsed .oa-column-search {
  border-radius: 0 0 10px 10px;
  box-shadow: 0 5px 18px rgba(44, 65, 88, .08);
}

.oa-results-shell.oa-toolbar-collapsed .oa-column-filter-scroll {
  padding-top: 2px;
  padding-bottom: 2px;
}

.oa-results-shell.oa-toolbar-collapsed .oa-filter-cell {
  padding-top: 2px;
  padding-bottom: 3px;
}

.oa-results-shell.oa-toolbar-collapsed .oa-filter-cell > span {
  margin-bottom: 1px;
  font-size: 8px;
  line-height: 1.05;
}

.oa-results-shell.oa-toolbar-collapsed .oa-filter-cell input {
  min-height: 25px;
  padding-top: 3px;
  padding-bottom: 3px;
}

/* В компактном рабочем состоянии общая строка «Результаты поиска / режимы»
   тоже убирается из sticky-стека. Вернуть её можно кнопкой «Панель». */
body.search-results-focus.oa-workspace-compact #mode-search .results-header {
  display: none !important;
}

/* Sticky-заголовок текущей лаборатории превращаем в одну строку. */
body.oa-workspace-compact .oa-lab-head {
  min-height: 32px;
  padding: 5px 10px !important;
  gap: 6px;
}

body.oa-workspace-compact .oa-lab-head-main {
  width: 100%;
}

body.oa-workspace-compact .oa-lab-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.25;
}

body.oa-workspace-compact .oa-lab-meta,
body.oa-workspace-compact .oa-lab-toggle {
  display: none !important;
}

/* Небольшая плавающая кнопка ничего не отнимает от высоты таблицы. */
.oa-toolbar-reveal {
  position: fixed;
  top: calc(var(--oa-page-sticky-top, 0px) + 7px);
  right: 18px;
  z-index: 96;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid rgba(177, 194, 211, .9);
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #42586f;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(31, 51, 74, .12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.oa-toolbar-reveal:hover,
.oa-toolbar-reveal:focus-visible {
  color: #2457c5;
  border-color: #a9c3ef;
  background: #f7faff;
  outline: none;
}

.oa-toolbar-reveal[hidden] {
  display: none !important;
}

.oa-toolbar-collapse-btn {
  color: #315b8b;
  border-color: #c9d8e8;
  background: #f7faff;
}

body.theme-dark .oa-toolbar-reveal,
html[data-theme="dark"] .oa-toolbar-reveal {
  background: rgba(20, 31, 47, .95);
  color: #cbd9e8;
  border-color: rgba(98, 120, 145, .65);
}

/* После скрытия общей results-header фильтры становятся самым верхним sticky-слоем. */
body.oa-workspace-compact .oa-results-shell {
  --oa-page-sticky-top: 0px;
}

@media (max-width: 900px) {
  .oa-toolbar-reveal {
    right: 8px;
    top: 7px;
  }
  .oa-toolbar-collapse-btn {
    display: none;
  }
}
\n\n/* ===== OA UI v9: real compact mode in the actual results scroll container ===== */\n\n/* В АРП прокручивается не window, а #mode-search .results-area.\n   В компактном OA-режиме освобождаем и пространство ВНЕ этого scroll-контейнера. */\nbody.search-results-focus.oa-workspace-compact .main > .main-header,\nbody.search-results-focus.oa-workspace-compact #mode-search > .nch-er-filter-area {\n  display: none !important;\n}\n\nbody.search-results-focus.oa-workspace-compact #mode-search .results-search-summary,\nbody.search-results-focus.oa-workspace-compact #mode-search .results-header {\n  display: none !important;\n}\n\nbody.search-results-focus.oa-workspace-compact #mode-search .results-area {\n  padding-top: 0 !important;\n}\n\n/* Рабочий sticky-стек: только колонные фильтры + название текущей ИЛ. */\nbody.oa-workspace-compact .oa-column-search {\n  top: 0 !important;\n  border-top-left-radius: 0 !important;\n  border-top-right-radius: 0 !important;\n}\n\nbody.oa-workspace-compact .oa-lab-head {\n  top: calc(var(--oa-sticky-filter-height) + 2px) !important;\n}\n\nbody.oa-workspace-compact .oa-lab-group {\n  scroll-margin-top: calc(var(--oa-sticky-filter-height) + 38px) !important;\n}\n\n/* Кнопка раскрытия не занимает высоту и остаётся доступной даже после скрытия main-header. */\nbody.oa-workspace-compact .oa-toolbar-reveal {\n  top: 8px !important;\n  right: 18px !important;\n}\n\n/* На невысоких ноутбуках рабочая строка ещё плотнее. */\n@media (max-height: 820px) {\n  .oa-results-shell.oa-toolbar-collapsed .oa-filter-cell input {\n    min-height: 23px;\n    padding-top: 2px;\n    padding-bottom: 2px;\n  }\n  body.oa-workspace-compact .oa-lab-head {\n    min-height: 29px;\n    padding-top: 4px !important;\n    padding-bottom: 4px !important;\n  }\n}\n

/* ===== OA v12: same desktop pagination UX as cards/table ===== */
@media (min-width: 1201px) {
  body.results-view-oa .oa-results-shell {
    padding-bottom: 112px;
  }

  body.results-view-oa .oa-results-pager {
    position: fixed !important;
    left: calc(var(--arp-sidebar-width, 260px) + 32px) !important;
    right: 20px !important;
    bottom: 16px !important;
    z-index: 90 !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  body.results-view-oa .app.sidebar-collapsed .oa-results-pager {
    left: calc(var(--arp-sidebar-collapsed-width, 74px) + 24px) !important;
  }

  body.results-view-oa .oa-results-pager .oa-pagination-panel {
    pointer-events: auto !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 10px 12px !important;
    border-radius: 24px !important;
    border: 1px solid rgba(226,230,237,.82) !important;
    background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(248,250,255,.95)) !important;
    box-shadow: 0 22px 52px rgba(29,45,78,.18) !important;
    backdrop-filter: blur(16px) saturate(1.08) !important;
    -webkit-backdrop-filter: blur(16px) saturate(1.08) !important;
  }
}

@media (max-width: 1200px) {
  body.results-view-oa .oa-results-pager {
    position: static !important;
    margin-top: 12px !important;
  }

  body.results-view-oa .oa-results-pager .oa-pagination-panel {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  body.results-view-oa .oa-results-pager .pagination-size,
  body.results-view-oa .oa-results-pager .pagination-nav {
    justify-self: start !important;
  }
}


/* ===== OA v13: reuse the native ARP results-pagination container =====
   The old OA pager lived inside the scrolling OA shell, so position:fixed
   could be anchored by the scroll/paint context and visually behave like
   an in-flow block. V13 renders OA pagination into #results-pagination,
   exactly the same container used by "Подробно" and "Компактно". */
body.results-view-oa .oa-results-pager {
  display: none !important;
}

@media (min-width: 1181px) {
  /* OA hides the right laboratory panel, so let the native fixed pager
     use the released width just like the compact table mode does. */
  body.results-view-oa .app.mode-search .results-pagination {
    right: 32px !important;
  }
}
