/* =========================================================
   PROXIMA — научная база (страница research.html)
   Отдельный файл: подключается только на research.html
   ========================================================= */

.rs-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--line);
}
.rs-stat {
  padding: 18px 20px;
  background: #fff;
}
.rs-stat b {
  display: block;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.rs-stat span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- спектральная шкала в hero ---------- */
.rs-axis {
  margin-top: 38px;
  max-width: 760px;
}
.rs-axis__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--spectrum);
  box-shadow: 0 0 34px -6px var(--accent-glow);
}
.rs-axis__ticks {
  position: relative;
  height: 26px;
  margin-top: 8px;
}
.rs-axis__ticks span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.45);
  font-variant-numeric: tabular-nums;
}
.rs-axis__ticks span::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -8px;
  width: 1px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
}
.rs-axis__note {
  margin-top: 2px;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.38);
}
@media (max-width: 720px) {
  .rs-axis__ticks span:nth-child(even) {
    display: none;
  }
}

/* ---------- визуализации ---------- */
.rs-vizgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 26px;
}
.rs-viz {
  display: flex;
  flex-direction: column;
  padding: 22px 24px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}
.rs-viz__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.rs-viz__title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}
.rs-viz__note {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
}
.rs-viz__sub {
  margin: 16px 0 8px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.rs-viz__sub:first-of-type {
  margin-top: 0;
}

.rs-vbars {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: end;
  gap: 10px;
  flex: 1;
  min-height: 130px;
  padding-top: 18px;
}
.rs-vbar {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.rs-vbar__n {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
  transition: color 0.2s var(--ease);
}
.rs-vbar__col {
  position: relative;
  display: flex;
  align-items: flex-end;
  flex: 1;
  margin: 4px 0 6px;
}
.rs-vbar__bar {
  width: 100%;
  height: var(--h, 10%);
  border-radius: 4px 4px 0 0;
  background: rgba(47, 138, 114, 0.32);
  transition: background 0.2s var(--ease);
}
.rs-vbar__x {
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}
.rs-vbar:hover .rs-vbar__bar {
  background: rgba(47, 138, 114, 0.62);
}
.rs-vbar:hover .rs-vbar__n,
.rs-vbar:hover .rs-vbar__x {
  color: var(--accent);
}
.rs-vbar.is-active .rs-vbar__bar {
  background: var(--accent);
}
.rs-vbar.is-active .rs-vbar__n,
.rs-vbar.is-active .rs-vbar__x {
  color: var(--accent);
}
.rs-vbar[disabled] {
  opacity: 0.35;
  cursor: default;
}
.rs-vbar[disabled]:hover .rs-vbar__bar {
  background: rgba(47, 138, 114, 0.32);
}

.rs-hbars {
  display: grid;
  gap: 4px;
}
.rs-hbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 132px;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s var(--ease);
}
.rs-hbar:hover {
  background: var(--soft);
}
.rs-hbar.is-active {
  background: var(--accent-soft);
  color: var(--accent-2);
}
.rs-hbar[disabled] {
  opacity: 0.35;
  cursor: default;
}
.rs-hbar__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rs-hbar__n {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rs-hbar.is-active .rs-hbar__n {
  color: var(--accent-2);
}
.rs-hbar__track {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--soft-2);
  overflow: hidden;
}
.rs-hbar__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--w, 0%);
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.25;
  transition: opacity 0.2s var(--ease), width 0.3s var(--ease);
}
.rs-hbar:hover .rs-hbar__bar,
.rs-hbar.is-active .rs-hbar__bar {
  opacity: 1;
}

/* ---------- база: рейл + список ---------- */
.rs-db {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 34px;
  margin-top: 30px;
  align-items: start;
}
.rs-rail {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  gap: 22px;
  padding-right: 6px;
  max-height: calc(100vh - var(--header-h) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.rs-rail__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.rs-rail__head {
  margin: 0;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.rs-rail__reset {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
}
.rs-rail__reset[hidden] {
  display: none;
}
.rs-group {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.rs-label {
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 500;
}
.rs-check {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  cursor: pointer;
}
.rs-check:hover {
  color: var(--accent);
}
.rs-check input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.rs-check em {
  font-size: 11.5px;
  font-style: normal;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rs-check.is-off {
  opacity: 0.4;
}
.rs-more {
  margin-top: 4px;
}
.rs-more summary {
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}
.rs-more summary::-webkit-details-marker {
  display: none;
}
.rs-more summary::after {
  content: " ↓";
}
.rs-more[open] summary::after {
  content: " ↑";
}
.rs-more__list {
  margin-top: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

/* ---------- тулbar ---------- */
.rs-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.rs-count {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
.rs-count b {
  font-weight: 500;
  color: var(--text);
}
.rs-toolbar__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}
.rs-search {
  flex: 0 0 320px;
}
.rs-search input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.rs-search input:focus {
  border-color: var(--accent);
}
.rs-btn-ghost {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.rs-btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.rs-btn-ghost[hidden] {
  display: none;
}

/* ---------- активные фильтры ---------- */
.rs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.rs-chips[hidden] {
  display: none;
}
.rs-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px 6px 12px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  font: inherit;
  font-size: 12px;
  color: var(--accent-2);
  cursor: pointer;
}
.rs-chip b {
  font-weight: 500;
}
.rs-chip span {
  font-size: 14px;
  line-height: 1;
  opacity: 0.7;
}
.rs-chip:hover span {
  opacity: 1;
}

/* ---------- записи ---------- */
.rs-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.theme-dark .rs-note {
  color: var(--on-dark-muted);
}
.rs-recs {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}
.rs-rec {
  border-bottom: 1px solid var(--line);
}
.rs-rec[hidden] {
  display: none;
}
.rs-rec__sum {
  display: grid;
  grid-template-columns: 46px 50px minmax(0, 1.15fr) minmax(0, 0.95fr) 152px 18px;
  align-items: center;
  gap: 14px;
  padding: 13px 2px;
  font-size: 13px;
  cursor: pointer;
  list-style: none;
}
.rs-rec__sum::-webkit-details-marker {
  display: none;
}
.rs-rec__sum:hover {
  color: var(--accent);
}
.rs-rec__n {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rs-rec__year {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rs-rec__crop {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rs-rec__theme {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.rs-rec__range {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rs-rec__range > span:last-child {
  flex: 0 0 auto;
  overflow: visible;
  text-overflow: clip;
}
.rs-rng {
  position: relative;
  flex: 0 0 54px;
  height: 5px;
  border-radius: 999px;
  background: var(--soft-2);
}
.rs-rng i {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: var(--spectrum);
}
.rs-rec__chev {
  width: 9px;
  height: 9px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.2s var(--ease);
}
.rs-rec[open] .rs-rec__chev {
  transform: rotate(225deg) translate(-2px, -2px);
}
.rs-rec__body {
  padding: 4px 2px 22px;
  max-width: 980px;
}
.rs-rec__title {
  margin: 0 0 14px;
  padding-right: 40px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}
.rs-rec__dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 28px;
  margin: 0;
}
.rs-rec__dl div {
  min-width: 0;
}
.rs-rec__dl dt {
  margin-bottom: 3px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.rs-rec__dl dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}
.rs-rec__fw {
  grid-column: 1 / -1;
}
.rs-rec__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.rs-rec__doi {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.rs-empty {
  padding: 40px 0;
  font-size: 14px;
  color: var(--muted);
}
.rs-empty[hidden] {
  display: none;
}
.rs-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}
.rs-more-wrap[hidden] {
  display: none;
}

/* ---------- методика ---------- */
.rs-meth {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}
.rs-meth details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 20px;
}
.rs-meth summary {
  padding: 15px 0;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.rs-meth summary::-webkit-details-marker {
  display: none;
}
.rs-meth summary::after {
  content: "+";
  float: right;
  color: var(--muted);
}
.rs-meth details[open] summary::after {
  content: "−";
}
.rs-meth__body {
  padding: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}
.rs-meth__body p {
  margin: 0 0 10px;
}
.rs-meth__body ul {
  margin: 0 0 10px;
  padding-left: 18px;
}
.rs-meth__body li {
  margin-bottom: 5px;
}

/* ---------- тёмная тема ---------- */
.theme-dark .rs-db,
.theme-dark .rs-viz {
  color-scheme: dark;
}
.theme-dark .rs-stat,
.theme-dark .rs-viz,
.theme-dark .rs-meth details {
  background: var(--dark-2);
  border-color: var(--line-dark);
}
.theme-dark .rs-stats {
  background: var(--line-dark);
  border-color: var(--line-dark);
}
.theme-dark .rs-stat span,
.theme-dark .rs-viz__note,
.theme-dark .rs-viz__sub,
.theme-dark .rs-count,
.theme-dark .rs-rec__n,
.theme-dark .rs-rec__year,
.theme-dark .rs-rec__theme,
.theme-dark .rs-rec__range,
.theme-dark .rs-rec__dl dt,
.theme-dark .rs-rec__foot,
.theme-dark .rs-rail__head {
  color: var(--on-dark-muted);
}
.theme-dark .rs-vbar__bar,
.theme-dark .rs-rng,
.theme-dark .rs-hbar__track {
  background: rgba(255, 255, 255, 0.14);
}
.theme-dark .rs-hbar:hover {
  background: rgba(255, 255, 255, 0.06);
}
.theme-dark .rs-hbar.is-active {
  background: rgba(47, 138, 114, 0.18);
  color: #7fd3ba;
}
.theme-dark .rs-rng i {
  opacity: 0.9;
}
.theme-dark .rs-group,
.theme-dark .rs-toolbar,
.theme-dark .rs-recs,
.theme-dark .rs-rec {
  border-color: var(--line-dark);
}
.theme-dark .rs-search input,
.theme-dark .rs-btn-ghost {
  background: var(--dark-3);
  border-color: var(--line-dark);
  color: var(--on-dark);
}
.theme-dark .rs-chip {
  background: rgba(47, 138, 114, 0.18);
  border-color: rgba(127, 211, 186, 0.4);
  color: #7fd3ba;
}
.theme-dark .rs-rec__sum:hover,
.theme-dark .rs-check:hover {
  color: #7fd3ba;
}
.theme-dark .rs-rail__reset,
.theme-dark .rs-rec__doi,
.theme-dark .rs-more summary {
  color: #7fd3ba;
}

/* ---------- адаптив ---------- */
@media (max-width: 1100px) {
  .rs-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .rs-db {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .rs-rail {
    position: static;
    max-height: none;
    gap: 0;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    overflow: visible;
  }
  .theme-dark .rs-rail {
    background: var(--dark-2);
    border-color: var(--line-dark);
  }
  .rs-rail__top {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line);
  }
  .theme-dark .rs-rail__top {
    border-color: var(--line-dark);
  }
  .rs-rail__body {
    display: grid;
    gap: 0;
    padding: 0 18px 6px;
  }
  .rs-rail[data-open="false"] .rs-rail__body {
    display: none;
  }
  .rs-group {
    padding: 14px 0;
  }
  .rs-rec__sum {
    grid-template-columns: 44px 52px minmax(0, 1fr) 18px;
    gap: 10px;
  }
  .rs-rec__theme,
  .rs-rec__range {
    display: none;
  }
  .rs-toolbar {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
  .rs-toolbar__right {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .rs-search {
    flex: 1 1 100%;
  }
}
@media (min-width: 1101px) {
  .rs-rail__top .rs-rail__toggle {
    display: none;
  }
  .rs-rail__body {
    display: grid;
    gap: 22px;
  }
}
@media (max-width: 720px) {
  .rs-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rs-stat {
    padding: 14px 16px;
  }
  .rs-stat b {
    font-size: 21px;
  }
  .rs-vizgrid {
    grid-template-columns: 1fr;
  }
  .rs-rec__dl {
    grid-template-columns: 1fr;
  }
  .rs-viz {
    padding: 18px 16px;
  }
}
