:root {
  color-scheme: light;

  --bg: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f2f2ee;
  --line: #e6e6e0;
  --line-2: #d4d4cb;

  --ink: #1b1b19;
  --ink-2: #4f4f48;
  --ink-3: #6e6e65;

  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-ink: #ffffff;
  --accent-soft: #eeedff;

  --ok: #0f6b4a;
  --ok-soft: #e7f3ec;
  --warn: #8a5300;
  --warn-soft: #fbf0dd;

  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 6px;

  --bar-h: 58px;

  --mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", ui-monospace, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #121211;
  --surface: #191917;
  --surface-2: #212120;
  --line: #2e2e2a;
  --line-2: #3f3f39;

  --ink: #ecece6;
  --ink-2: #b2b2a9;
  --ink-3: #8d8d83;

  --accent: #a5b0ff;
  --accent-hover: #c3caff;
  --accent-ink: #14141f;
  --accent-soft: #21213a;

  --ok: #6ecf9f;
  --ok-soft: #17281f;
  --warn: #e0ae63;
  --warn-soft: #2a2115;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }

.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.92em;
  letter-spacing: -0.01em;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  overflow: hidden;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.ico {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

:where(button, a, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -44px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-size: 12.5px;
  text-decoration: none;
}

.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ корпус */

.app {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  max-width: 1340px;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ рейл */

.rail {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100vh;
  height: 100dvh;
  padding: 20px 14px 16px;
  border-right: 1px solid var(--line);
  overflow: hidden;
}

.rail__top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.brand {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}

.brand__tld { color: var(--ink-3); font-weight: 500; }

.head__brand { display: none; }

.lang {
  display: flex;
  gap: 2px;
  margin-left: auto;
}

.lang a {
  padding: 2px 7px;
  border-radius: var(--r-xs);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.lang a:hover { background: var(--surface); color: var(--ink); }

.lang a[aria-current="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
}

.facets {
  display: grid;
  gap: 20px;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 5px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}

.facet__h {
  padding: 0 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.facet__list { display: grid; gap: 1px; }

.facet__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 30px;
  padding: 5px 8px;
  border: 0;
  border-radius: var(--r-xs);
  background: none;
  color: var(--ink-2);
  font-size: 13.2px;
  text-align: left;
  cursor: pointer;
}

.facet__item:hover { background: var(--surface); color: var(--ink); }

.facet__item[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  font-weight: 550;
  box-shadow: inset 2px 0 0 var(--accent);
}

.facet__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facet__count {
  margin-left: auto;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
}

.facet__item[aria-pressed="true"] .facet__count { color: var(--accent); }

.checkbox {
  display: grid;
  place-items: center;
  width: 13px;
  height: 13px;
  flex: none;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--surface);
}

.facet__item--check[aria-pressed="true"] .checkbox {
  background: var(--accent);
  border-color: var(--accent);
}

.facet__item--check[aria-pressed="true"] .checkbox::after {
  content: "";
  width: 3px;
  height: 6px;
  margin-top: -2px;
  border-right: 1.5px solid var(--accent-ink);
  border-bottom: 1.5px solid var(--accent-ink);
  transform: rotate(40deg);
}

.rail__foot {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.readout { display: grid; gap: 6px; padding: 0 8px; }

.readout > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.readout dt { font-size: 12px; color: var(--ink-3); }

.readout dd {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rail__note {
  padding: 0 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-3);
}

/* ------------------------------------------------------------------ основной столбец */

.main {
  min-width: 0;
  padding: 34px 44px 0 40px;
}

.head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 24px;
}

.head > div { min-width: 0; }

.head__stamp {
  flex: none;
  padding-top: 5px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 12px;
  white-space: nowrap;
}

.head h1 {
  font-size: clamp(22px, 2.4vw, 26px);
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.head__lede {
  max-width: 74ch;
  margin-top: 8px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ------------------------------------------------------------------ панель */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--bar-h);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.bar__spacer { flex: 1; }

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 340px;
  height: 34px;
  padding: 0 9px 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-3);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: none;
  font-size: 13.5px;
  color: var(--ink);
}

.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { filter: grayscale(1); opacity: 0.5; }

kbd {
  flex: none;
  display: inline-grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover { border-color: var(--ink-3); }

.btn--quiet {
  background: none;
  border-color: transparent;
  color: var(--ink-2);
}

.btn--quiet:hover { background: var(--surface); border-color: var(--line-2); color: var(--ink); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 550;
  text-decoration: none;
}

.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.iconbtn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}

.iconbtn:hover { border-color: var(--line-2); background: var(--surface); color: var(--ink); }

.iconbtn.rail__close { display: none; }

.bar__filters { display: none; }

/* ------------------------------------------------------------------ строка статуса */

.meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.meta__count { color: var(--ink-2); }

.reset {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  background: none;
  color: var(--ink-3);
  font-size: 12.5px;
  cursor: pointer;
}

.reset:hover { color: var(--accent); border-color: var(--accent); }

.meta__hints {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.meta__hints kbd { height: 17px; min-width: 17px; font-size: 10.5px; }

.meta__hints span { display: inline-flex; align-items: center; gap: 4px; }

.meta__hints span + span { margin-left: 8px; }

/* ------------------------------------------------------------------ таблица */

.tbl {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

/* суммы колонок = ровно 100%: при table-layout: fixed любая другая
   комбинация (96% + фикс-пиксели) раздвигает таблицу шире контейнера
   и даёт глобальный горизонтальный скролл */
.col-sel { width: 3.5%; }
.col-name { width: 34%; }
.col-cat { width: 13%; }
.col-card { width: 12%; }
.col-limits { width: 24%; }
.col-period { width: 10%; }
.col-go { width: 3.5%; }

.tbl thead th {
  position: sticky;
  top: var(--bar-h);
  z-index: 5;
  padding: 0;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg);
  /* перекрывает суб-пиксельную щель между тулбаром и шапкой при скролле */
  box-shadow: 0 -1px 0 0 var(--bg);
  text-align: left;
  font-weight: 600;
}

.th {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 10px 12px 10px 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
}

.th:hover { color: var(--ink); }

.th__caret {
  width: 12px;
  height: 12px;
  opacity: 0;
  transition: opacity 0.12s, transform 0.12s;
}

th[aria-sort="ascending"] .th,
th[aria-sort="descending"] .th { color: var(--ink); }

th[aria-sort="ascending"] .th__caret,
th[aria-sort="descending"] .th__caret { opacity: 1; }

th[aria-sort="descending"] .th__caret { transform: rotate(180deg); }

.tbl tbody td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.tbl tbody tr { cursor: pointer; outline-offset: -2px; }

/* отмеченный для сравнения — до hover, чтобы hover оставался заметным */
.tbl tbody tr:has(.cmp-check:checked) td { background: var(--surface-2); }

.tbl tbody tr:hover td { background: var(--surface); }

.tbl tbody tr:last-child td { border-bottom: 0; }

.tbl tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.c-name { padding-top: 9px !important; padding-bottom: 9px !important; }

.c-name .name {
  font-size: 14px;
  font-weight: 550;
  color: var(--ink);
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c-name .sub {
  display: block;
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink-3);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* плавная смена темы и ховеры */
body,
.rail,
.main,
.sheet,
.facet__item,
.facet__count,
.btn,
.iconbtn,
.cmp__card,
.notice,
.cmpbar,
.search,
kbd,
.flag,
.tag,
.seg,
.tbl thead th {
  transition: background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease;
}

.tbl tbody td { transition: background-color 0.14s ease, padding 0.18s ease; }

.btn:active { transform: translateY(1px); }

.iconbtn:active { transform: translateY(1px); }

::selection { background: var(--accent-soft); }

.sheet__body::-webkit-scrollbar,
.facets::-webkit-scrollbar,
.cmp__card::-webkit-scrollbar { width: 8px; }

.sheet__body::-webkit-scrollbar-thumb,
.facets::-webkit-scrollbar-thumb,
.cmp__card::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--line-2);
}

.sheet__body::-webkit-scrollbar-track,
.facets::-webkit-scrollbar-track,
.cmp__card::-webkit-scrollbar-track { background: transparent; }

@keyframes row-in {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}

.tbl tbody .row { animation: row-in 0.22s ease both; animation-delay: calc(var(--i, 0) * 5ms); }

/* ------------------------------------------------------------------ плотность и акцент */

html[data-density="compact"] .tbl tbody td { padding-top: 5px; padding-bottom: 5px; }

html[data-density="compact"] .c-name { padding-top: 5px !important; padding-bottom: 5px !important; }

html[data-density="compact"] .c-name .sub { display: none; }

html[data-accent="violet"] { --accent: #7c3aed; --accent-hover: #6d28d9; }
html[data-accent="cyan"]   { --accent: #0891b2; --accent-hover: #0e7490; }
html[data-accent="green"]  { --accent: #059669; --accent-hover: #047857; }
html[data-accent="orange"] { --accent: #d97706; --accent-hover: #b45309; }

html[data-accent="violet"] { --accent-soft: rgba(124, 58, 237, 0.12); }
html[data-accent="cyan"]   { --accent-soft: rgba(8, 145, 178, 0.12); }
html[data-accent="green"]  { --accent-soft: rgba(5, 150, 105, 0.12); }
html[data-accent="orange"] { --accent-soft: rgba(217, 119, 6, 0.12); }

/* ------------------------------------------------------------------ настройки в рейле */

.settings { display: grid; gap: 10px; padding: 2px 8px 0; }

.settings__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  min-width: 0;
}

.settings__label {
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.swatches { display: flex; gap: 6px; }

.swatch {
  width: 18px;
  height: 18px;
  border: 2px solid transparent;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.swatch:hover { transform: scale(1.15); }

.swatch.is-on { border-color: var(--ink); }

.seg { display: flex; max-width: 100%; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; }

.seg button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 10px;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.seg button.is-on { background: var(--surface-2); color: var(--ink); font-weight: 600; }

/* ------------------------------------------------------------------ welcome */

.welcome {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(20 20 18 / 0.4);
  backdrop-filter: blur(4px);
  animation: fade-in 0.25s ease both;
}

.welcome[hidden] { display: none; }

.welcome.is-closing { animation: fade-out 0.22s ease both; }

.welcome.is-closing .welcome__card { animation: pop-out 0.22s ease both; }

.welcome__card {
  width: min(460px, 100%);
  padding: 28px 28px 24px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 40px 80px -40px rgb(0 0 0 / 0.5);
  animation: pop-in 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.welcome__card h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.03em; }

.welcome__card .lede { margin: 0 0 18px; color: var(--ink-2); font-size: 14px; line-height: 1.6; }

.welcome__list { display: grid; gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; }

.welcome__list li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }

.welcome__list b { color: var(--ink); font-weight: 600; }

.welcome__mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

@keyframes fade-out { from { opacity: 1; } to { opacity: 0; } }

@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }

@keyframes pop-out {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(8px) scale(0.98); }
}

/* ------------------------------------------------------------------ плашки и модалки */

.notice { animation: slide-up 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }

.notice.is-closing { animation: notice-out 0.22s ease both; }

.cmpbar { animation: slide-up 0.25s cubic-bezier(0.22, 1, 0.36, 1) both; }

.cmp { animation: fade-in 0.18s ease both; }

.cmp__card { animation: pop-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes slide-up {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes notice-out {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, 10px); }
}

.c-cat, .c-period { color: var(--ink-2); font-size: 13px; }

.c-limits .mono {
  display: block;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flag {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  color: var(--ink-2);
  font-size: 11.5px;
  white-space: nowrap;
}

.flag--none { border-color: transparent; background: var(--ok-soft); color: var(--ok); }

.flag--card { border-color: transparent; background: var(--warn-soft); color: var(--warn); }

.c-go { padding-right: 0 !important; text-align: right; }

.c-go .ico {
  color: var(--ink-3);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.12s, transform 0.12s;
}

tr:hover .c-go .ico,
tr:focus-visible .c-go .ico { opacity: 1; transform: none; }

.row--empty td { padding: 0 !important; border-bottom: 0; cursor: default; }

.empty { max-width: 46ch; padding: 64px 0; }

.empty h2 { font-size: 16px; }

.empty p {
  margin: 6px 0 16px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.55;
}

/* ------------------------------------------------------------------ внешние каталоги */

.sources {
  margin-top: 42px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.sources__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
}

.sources__head h2 { font-size: 15px; }

.sources__head p { color: var(--ink-3); font-size: 12.5px; }

.sources__list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--line);
}

.src {
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 12px 14px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}

.src:hover { background: var(--surface-2); }

.src__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.src__host {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.src .ico { width: 13px; height: 13px; color: var(--ink-3); transition: transform 0.12s; }

.src:hover .ico { color: var(--accent); transform: translate(1px, -1px); }

.src__desc { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; }

/* ------------------------------------------------------------------ подвал */

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  margin-top: 30px;
  padding: 16px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 12.5px;
  line-height: 1.55;
}

.foot p { max-width: 58ch; }

/* ------------------------------------------------------------------ карточка сервиса */

.sheet {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  border-left: 1px solid var(--line-2);
  background: var(--surface);
  box-shadow: -30px 0 60px -40px rgb(0 0 0 / 0.45);
  animation: sheet-in 0.2s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sheet[hidden] { display: none; }

.sheet:focus { outline: none; }

.sheet.is-closing { animation: sheet-out 0.18s ease-in both; }

@keyframes sheet-in {
  from { transform: translateX(14px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

@keyframes sheet-out {
  from { transform: none; opacity: 1; }
  to { transform: translateX(24px); opacity: 0; }
}

.sheet__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px 11px 22px;
  border-bottom: 1px solid var(--line);
}

.sheet__cat {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.sheet__body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 28px;
}

.sheet h2 {
  margin-top: 2px;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.sheet__tag {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}

.sheet__details {
  margin-top: 16px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.65;
}

.specs { margin-top: 20px; border-bottom: 1px solid var(--line); }

.spec {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 4px 14px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.spec dt {
  padding-top: 2px;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.spec dd { color: var(--ink); font-size: 13.5px; line-height: 1.45; }

.sheet__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 18px;
}

.tag {
  padding: 1px 7px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xs);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
}

.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.sheet__actions .btn { height: 34px; }

.sheet__src {
  margin-top: 14px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11.5px;
  word-break: break-all;
}

.sheet__scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgb(20 20 18 / 0.24);
  animation: fade-in 0.2s ease both;
}

.sheet__scrim[hidden] { display: none; }

.sheet__scrim.is-closing { animation: fade-out 0.2s ease both; }

/* ------------------------------------------------------------------ адаптив */

.rail__scrim { display: none; }

@media (max-width: 1040px) {
  .app { display: block; }

  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: 264px;
    height: 100%;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.22s ease;
    box-shadow: 24px 0 48px -32px rgb(0 0 0 / 0.35);
  }

  .rail.is-open { transform: none; }
  .iconbtn.rail__close { display: grid; }
  .bar__filters { display: inline-flex; }

  .rail__scrim:not([hidden]) {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgb(20 20 18 / 0.28);
    animation: fade-in 0.2s ease both;
  }

  .rail__scrim.is-closing { animation: fade-out 0.2s ease both; }

  .main { padding: 24px 22px 0; }

  .head__brand { display: inline-block; margin-bottom: 12px; }
}

@media (max-width: 880px) {
  .search { flex: 1 1 auto; }

  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl td { display: block; }

  .tbl tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .tbl tbody td { padding: 0 !important; border: 0; }

  .c-name { grid-column: 1 / -1; }
  .tbl tbody .c-cat { display: none; }
  .c-card { grid-column: 1; grid-row: 2; }
  .c-period { grid-column: 2; grid-row: 2; text-align: right; color: var(--ink-3); font-size: 11.5px; }
  .c-limits { grid-column: 1 / -1; grid-row: 3; margin-top: 3px; }
  .c-limits .mono { white-space: normal; }
  .c-go { display: none; }

  .tbl tbody tr:hover td { background: none; }

  .meta__hints { display: none; }
  .foot { margin-top: 24px; }
}

@media (max-width: 720px) {
  .sources__list { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .main { padding: 18px 14px 0; }
  .head { display: block; }
  .head__stamp { display: none; }
  .head h1 { font-size: 20px; }
  .bar { height: auto; flex-wrap: wrap; padding: 10px 0; gap: 8px; }
  .bar__filters { order: 1; }
  .bar__spacer { display: none; }
  .bar__export { order: 2; margin-left: auto; display: flex; gap: 6px; }
  #theme { order: 3; }
  .search { order: 4; flex: 1 1 100%; }
  /* прячем подпись только у JSON (остаётся иконка); MD/CSV без иконок — их текст видим */
  #export span { display: none; }
  #export { padding: 0 9px; }
  .sheet__body { padding: 16px 16px 24px; }
}

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

/* ------------------------------------------------------------------ избранное и сравнение */

.c-sel { padding-left: 2px !important; white-space: nowrap; }

.cmp-check {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 16px;
  height: 16px;
  margin: 0;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-xs);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
  vertical-align: middle;
}

.cmp-check:hover { border-color: var(--accent); transform: scale(1.12); }

.cmp-check:checked {
  border-color: var(--accent);
  background: var(--accent);
  animation: check-pop 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cmp-check:checked::after {
  content: "";
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 4px;
  height: 8px;
  border: solid var(--accent-ink);
  border-width: 0 2px 2px 0;
  transform: rotate(43deg);
}

@keyframes check-pop {
  50% { transform: scale(1.25); }
}

.name-row { display: flex; align-items: center; gap: 5px; min-height: 20px; }

.star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  margin-left: -3px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.row:hover .star, .star:focus-visible { opacity: 0.9; }

.star:hover { opacity: 1; transform: scale(1.18); }

.star.is-on { color: #e8a300; opacity: 1; }

.star.is-on svg { animation: star-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }

@keyframes star-pop {
  40% { transform: scale(1.45) rotate(8deg); }
}

.star svg { width: 13px; height: 13px; pointer-events: none; }

.facet__item--fav .facet__label { display: inline-flex; align-items: center; gap: 8px; }

.cmpbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 9px 9px 16px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 16px 40px -22px rgb(0 0 0 / 0.4);
  transform: translateX(-50%);
  font-size: 13px;
}

.cmpbar__names { color: var(--ink-2); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cmpbar .btn { height: 30px; padding: 0 12px; }

.cmp {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(20 20 18 / 0.35);
}

.cmp[hidden] { display: none; }

.cmp__card {
  width: min(860px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 22px 24px 26px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 30px 70px -40px rgb(0 0 0 / 0.5);
}

.cmp__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }

.cmp__head h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }

.cmp table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

.cmp th, .cmp td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }

.cmp th { width: 110px; color: var(--ink-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; }

.cmp td b { font-weight: 600; }

.cmp a { color: var(--accent); text-decoration: none; }

/* ------------------------------------------------------------------ кликабельные теги и бейдж */

.sheet__tags .tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: none;
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}

.sheet__tags .tag:hover { border-color: var(--accent); color: var(--accent); }

.badge-snap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 10.5px;
  vertical-align: 2px;
}

.badge-snap::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ok); }

/* ------------------------------------------------------------------ cookie-нотис */

.notice {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(680px, calc(100vw - 28px));
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: 0 16px 40px -22px rgb(0 0 0 / 0.4);
  transform: translateX(-50%);
  font-size: 13px;
  color: var(--ink-2);
}

.notice[hidden] { display: none; }

.notice a { color: var(--accent); }

.notice .btn { flex: none; height: 30px; padding: 0 12px; }

/* ------------------------------------------------------------------ статические страницы */

.page {
  max-width: 820px;
  margin: 0 auto;
  padding: 34px 22px 70px;
}

.page-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 34px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.page-top .brand { font-size: 14.5px; }

.page h1 { margin: 0 0 6px; font-size: clamp(24px, 3.4vw, 32px); letter-spacing: -0.03em; }

.page .lede { margin: 0 0 26px; color: var(--ink-2); font-size: 14.5px; line-height: 1.6; }

.page h2 { margin: 30px 0 10px; font-size: 17px; letter-spacing: -0.02em; }

.page p, .page li { font-size: 13.8px; line-height: 1.7; color: var(--ink-2); }

.page ul, .page ol { padding-left: 20px; }

.page li { margin-bottom: 7px; }

.page a { color: var(--accent); }

/* .page a перебивает .btn--primary (0,1,1 против 0,1,0) — текст кнопки сливался с фоном */
.page a.btn--primary { color: var(--accent-ink); }

.page .stamp { margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-3); font-family: var(--mono); font-size: 11px; }

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--ink-3);
  font-family: var(--mono);
  font-size: 11px;
}

.crumbs a { color: var(--ink-3); text-decoration: none; }

.crumbs a:hover { color: var(--accent); }

.crumbs span { color: var(--line-2); }

.svc-flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; }

.svc-specs { margin: 18px 0 22px; }

.related { margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }

.related h2 { margin: 0 0 12px; }

.related ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; list-style: none; padding: 0; }

.related a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--ink);
  font-size: 13px;
  transition: border-color 0.12s;
}

.related a:hover { border-color: var(--accent); }

.related a small { color: var(--ink-3); font-size: 11px; }

@media (max-width: 880px) {
  .c-sel { display: none !important; }
}

@media (max-width: 720px) {
  .cmpbar { max-width: calc(100vw - 24px); }
  .page { padding: 24px 16px 60px; }
}

/* ------------------------------------------------- разделы сайта в рейле */

.sections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--line);
}

.sections a {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}

.sections a:hover { background: var(--surface); color: var(--ink); }

.sections a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }

/* ------------------------------------------------- ссылка «все →» в заголовке */

.h-link { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--accent); text-decoration: none; }

.h-link:hover { text-decoration: underline; }

/* ------------------------------------------------- страница подборок */

.stacks { display: grid; gap: 34px; margin-top: 8px; }

.stack__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; }

.stack__head h2 { margin: 0; font-size: 17px; letter-spacing: -0.02em; }

.stack__head p { margin: 0; color: var(--ink-3); font-size: 12.5px; }

.stack__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1px;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: var(--line);
}

.svc {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--surface);
}

.svc__row { display: flex; align-items: center; gap: 8px; }

.svc__row input { accent-color: var(--accent); width: 14px; height: 14px; flex: none; }

.svc__row label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  cursor: pointer;
}

.svc__row a { margin-left: auto; font-size: 11.5px; color: var(--accent); text-decoration: none; white-space: nowrap; }

.svc__row a:hover { text-decoration: underline; }

.svc small { color: var(--ink-3); font-size: 12px; line-height: 1.5; }

.svc[data-done="1"] .svc__row label { color: var(--ink-3); text-decoration: line-through; }

.stack__meta { margin-top: 10px; color: var(--ink-3); font-size: 12px; }

/* ================================================================== РЕСТАЙЛИНГ v2
 * Мягкие тени вместо жёстких рамок, крупнее радиусы, выразительнее акценты.
 * Все селекторы ниже перекрывают базовые — блок добавлен последним намеренно. */

:root {
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --shadow-1: 0 1px 2px rgba(20, 20, 15, 0.05), 0 2px 10px rgba(20, 20, 15, 0.06);
  --shadow-2: 0 4px 16px rgba(20, 20, 15, 0.09), 0 2px 6px rgba(20, 20, 15, 0.05);
  --shadow-3: 0 16px 48px rgba(20, 20, 15, 0.18), 0 4px 14px rgba(20, 20, 15, 0.08);
}

:root[data-theme="dark"] {
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.45), 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 4px 16px rgba(0, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 16px 48px rgba(0, 0, 0, 0.65), 0 4px 14px rgba(0, 0, 0, 0.45);
}

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }

/* --- герой главной --- */

.head h1 {
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

.head__stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
}

.chip--ok { background: var(--ok-soft); color: var(--ok); }

/* --- облако тегов --- */

.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.tagcloud a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 13px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s, color 0.12s;
}

.tagcloud a:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}

.tagcloud a small { color: var(--ink-3); font-size: 10.5px; font-weight: 500; }

/* --- карточки-ссылки --- */

.sources__list { border: none; background: none; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

.src {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  transition: transform 0.14s, box-shadow 0.14s, border-color 0.14s;
}

.src:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); transform: translateY(-2px); }

/* --- кнопки --- */

.btn { border-radius: var(--r-sm); }

.btn--primary { box-shadow: var(--shadow-1); }

.btn--primary:hover { box-shadow: var(--shadow-2); }

/* --- разделы навигации в рейле --- */

.sections { gap: 5px; }

.sections a { border: 1px solid transparent; }

.sections a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

/* --- фасеты --- */

.facet__item { border-radius: var(--r-sm); }

.facet__item[aria-pressed="true"] {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.facet__count {
  border-radius: 999px;
  background: var(--surface-2);
  padding: 1px 8px;
  font-size: 10.5px;
}

/* --- таблица --- */

.row { transition: background 0.1s; }

.tbl tbody tr:hover td { background: var(--surface); }

.tbl tbody tr:hover td:first-child { border-top-left-radius: var(--r-sm); border-bottom-left-radius: var(--r-sm); }

.tbl tbody tr:hover td:last-child { border-top-right-radius: var(--r-sm); border-bottom-right-radius: var(--r-sm); }

.tbl thead th { border-bottom: 1px solid var(--line-2); }

/* --- карточка сервиса (шторка) --- */

.sheet {
  border-radius: var(--r-lg) 0 0 0;
  box-shadow: var(--shadow-3);
}

.sheet__scrim { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }

/* --- модалки: сравнение, welcome --- */

.cmp__card, .welcome__card { border-radius: var(--r-lg); box-shadow: var(--shadow-3); }

/* --- плашки-уведомления --- */

.notice { border-radius: var(--r-sm); box-shadow: var(--shadow-2); }

/* --- страница тега/подборки --- */

.page .badge-snap { margin-left: 10px; vertical-align: middle; }

/* --- скроллбар --- */

::-webkit-scrollbar { width: 10px; height: 10px; }

::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 999px; border: 2px solid var(--bg); }

::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

::-webkit-scrollbar-track { background: transparent; }

@media (prefers-reduced-motion: reduce) {
  .src, .tagcloud a, .btn--primary { transition: none; transform: none; }
}

/* ================================================================== АНИМАЦИИ И ПОЛИШ v3 */

html { scroll-behavior: smooth; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.94) translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* появление шапки и чипов */
.head > div { animation: fade-up 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

.head__stamp { animation: fade-up 0.5s 0.1s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

.head__stats .chip { animation: pop-in 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

.head__stats .chip:nth-child(1) { animation-delay: 0.08s; }
.head__stats .chip:nth-child(2) { animation-delay: 0.16s; }
.head__stats .chip:nth-child(3) { animation-delay: 0.24s; }
.head__stats .chip:nth-child(4) { animation-delay: 0.32s; }

/* секции главной и облако тегов */
.sources { animation: fade-up 0.55s 0.05s cubic-bezier(0.2, 0.7, 0.3, 1) both; }

.sources + .sources { animation-delay: 0.12s; }

.sources + .sources + .sources { animation-delay: 0.2s; }

.tagcloud { animation: fade-up 0.5s 0.1s both; }

.foot { animation: fade-up 0.5s 0.15s both; }

/* липкая панель поиска и фильтров */
.bar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 0;
}

/* нажатия */
.btn:active,
.iconbtn:active { transform: translateY(1px); }

.src:active { transform: translateY(0) scale(0.99); }

.tagcloud a:active { transform: scale(0.97); }

/* сортировка: стрелка вращается */
.th__caret { transition: transform 0.18s ease; transform: rotate(-90deg); }

th[aria-sort="ascending"] .th__caret { transform: rotate(0deg); }

th[aria-sort="descending"] .th__caret { transform: rotate(180deg); }

/* строки таблицы: чуть заметный подъём */
.row td { transition: background 0.12s; }

/* --- похожие сервисы в карточке --- */

.sheet__related { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }

.sheet__related h3 {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.rel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.12s, box-shadow 0.12s, transform 0.12s;
}

.rel b { font-size: 13px; color: var(--ink); font-weight: 600; }

.rel small { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }

.rel:hover { border-color: var(--accent); box-shadow: var(--shadow-1); transform: translateY(-1px); }

/* мягкое затемнение шторки */
.sheet__scrim { transition: opacity 0.2s; }

/* глобальный предохранитель анимаций */
@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;
  }
}


@media (max-width: 640px) {
  .stack__grid { grid-template-columns: 1fr; }
}

/* ================================================================== MATERIAL YOU (v4)
 * Тонные палитры M3, пилюли, state layers, elevation — поверх всех базовых слоёв. */

:root {
  --bg: #f5f2fa;
  --surface: #ffffff;
  --surface-2: #ece7f4;
  --line: #e2dced;
  --line-2: #cbc4d8;

  --ink: #1a1721;
  --ink-2: #49454e;
  --ink-3: #7a757f;

  --accent: #6d5af8;
  --accent-hover: #5b48e6;
  --accent-ink: #ffffff;
  --accent-soft: #e5deff;

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 28px;
}

:root[data-theme="dark"] {
  --bg: #121017;
  --surface: #1b1922;
  --surface-2: #262230;
  --line: #2d2938;
  --line-2: #454052;

  --ink: #e6e1e9;
  --ink-2: #c6c1cd;
  --ink-3: #97919f;

  --accent: #c7bdff;
  --accent-hover: #ddd5ff;
  --accent-ink: #291f60;
  --accent-soft: #2a2450;
}

/* --- типографика M3: метки --- */

.facet__h,
.sheet__related h3,
.readout dt {
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 600;
}

.th {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
}

/* --- state layers (ripple-эмуляция) --- */

.btn,
.iconbtn,
.facet__item,
.src,
.rel,
.tag,
.sections a,
.tagcloud a {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

.btn::after,
.iconbtn::after,
.facet__item::after,
.src::after,
.rel::after,
.tag::after,
.sections a::after,
.tagcloud a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.btn:active::after,
.iconbtn:active::after,
.facet__item:active::after,
.src:active::after,
.rel:active::after,
.tag:active::after,
.sections a:active::after,
.tagcloud a:active::after {
  opacity: 0.14;
  transition-duration: 0s;
}

/* --- кнопки: filled и tonal --- */

.btn { border-radius: 999px; padding-top: 9px; padding-bottom: 9px; }

.btn--primary { border-color: transparent; }

.btn--quiet {
  background: var(--surface-2);
  border-color: transparent;
  color: var(--ink-2);
}

.btn--quiet:hover { background: var(--accent-soft); color: var(--accent); }

.iconbtn { border-radius: 999px; border-color: transparent; background: var(--surface-2); color: var(--ink-2); }

.iconbtn:hover { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* --- поиск: пилюля surface-variant --- */

.search { background: var(--surface-2); border: 1px solid transparent; border-radius: 999px; }

.search:focus-within {
  background: var(--surface);
  border-color: transparent;
  box-shadow: inset 0 0 0 2px var(--accent);
}

.search kbd { border: none; background: transparent; color: var(--ink-3); }

/* --- фасеты: M3 filter chips --- */

.facet__item { border-radius: 999px; padding: 7px 12px; }

.facet__item[aria-pressed="true"] {
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--accent);
  font-weight: 600;
}

.facet__item:hover { background: var(--surface-2); color: var(--ink); }

.facet__count { background: transparent; color: var(--ink-3); padding: 0; }

.facet__item[aria-pressed="true"] .facet__count { color: var(--accent); font-weight: 600; }

/* --- разделы навигации: navigation rail --- */

.sections a { border-radius: 999px; }

.sections a[aria-current="page"] {
  background: var(--accent-soft);
  border-color: transparent;
}

/* --- рейл --- */

.rail { background: var(--surface); }

.facet__h { font-size: 11px; color: var(--ink-3); }

.readout { background: var(--surface-2); border-radius: var(--r-md); padding: 12px; }

.readout > div { border-bottom-color: var(--line); }

.readout dd { color: var(--accent); font-weight: 700; }

/* --- таблица --- */

.flag { border-radius: 999px; padding: 2px 10px; font-weight: 600; }

.tbl thead th { border-bottom: 1px solid var(--line-2); }

.row { border-radius: var(--r-sm); }

/* --- шторка: modal drawer M3 --- */

.sheet { border-radius: var(--r-lg) 0 0 0; background: var(--surface); }

.badge-snap { border-radius: 999px; }

.tag { border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); padding: 4px 12px; }

.tag:hover { border-color: var(--accent); color: var(--accent); }

/* --- снекбар (notice) — inverse surface --- */

.notice {
  background: #322f38;
  color: #f4eff6;
  border: none;
  border-radius: var(--r-xs);
  box-shadow: var(--shadow-2);
}

.notice .btn { background: #e5deff; color: #2a2450; border-color: transparent; }

/* --- cmp-бар: bottom app bar --- */

.cmpbar { border-radius: var(--r-md) var(--r-md) 0 0; box-shadow: var(--shadow-3); background: var(--surface); }

/* --- welcome и модалки --- */

.welcome__card { border-radius: var(--r-lg); }

.cmp__card { border-radius: var(--r-lg); }

/* --- пустое состояние --- */

.empty { border-radius: var(--r-md); }

/* --- верхняя панель: elevation при скролле --- */

.bar { border-bottom: 1px solid transparent; transition: border-color 0.2s, box-shadow 0.2s; }

.bar.is-scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-1); }

/* --- сегменты и свотчи --- */

.seg { border-radius: 999px; }

.seg button { border-radius: 999px; }

.seg button.is-on { background: var(--accent-soft); color: var(--accent); }

.swatch { border-radius: 999px; }

/* --- чипы статистики --- */

.chip { border-radius: 999px; }

/* --- скроллбар тоньше --- */

::-webkit-scrollbar { width: 8px; height: 8px; }

::-webkit-scrollbar-thumb { border: none; border-radius: 999px; }

::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

::-webkit-scrollbar-corner, ::-webkit-scrollbar-track { background: transparent; }

.rail::-webkit-scrollbar-thumb { background: var(--line-2); }

/* ------------------------------------------------------------------ печать: Ctrl+P → PDF с таблицей */

@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f4f4f2;
    --line: #dddddd;
    --line-2: #bbbbbb;
    --ink: #111111;
    --ink-2: #333333;
    --ink-3: #555555;
  }

  html[data-theme] { color-scheme: light; }

  .rail,
  .rail__scrim,
  .bar,
  .meta__hints,
  .share-filter,
  .sheet,
  .sheet__scrim,
  .cmpbar,
  .cmp,
  .notice,
  .welcome,
  .skip,
  .sources,
  .c-sel,
  .c-go,
  .star,
  .reset {
    display: none !important;
  }

  .app { display: block; max-width: none; }

  .main { padding: 0; }

  .head { margin-bottom: 12px; }

  .tbl thead th {
    position: static;
    box-shadow: none;
  }

  .tbl tbody .row { animation: none; }

  .tbl tbody tr { break-inside: avoid; }

  .c-limits .mono { white-space: normal; overflow: visible; }

  a { color: inherit; text-decoration: none; }

  .flag,
  .th,
  td {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
