:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #14171c;
  --muted: #5f6673;
  --line: #e3e6eb;
  --accent: #1f6feb;
  --accent-soft: #e8f0fe;
  --good: #1a7f37;
  --warn-bg: #fff6d6;
  --warn-line: #f0d77a;
  --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1116;
    --surface: #161b22;
    --text: #e6e9ee;
    --muted: #9aa3b0;
    --line: #2a313c;
    --accent: #4c8dff;
    --accent-soft: #1a2a45;
    --good: #3fb950;
    --warn-bg: #2d2610;
    --warn-line: #6b5a1c;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--accent-soft); padding: 1px 5px; border-radius: 5px; }

/* Шапка */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top__in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.logo { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo { display: inline-flex; align-items: center; gap: 8px; }
.logo img { display: block; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 10px; border-radius: 999px; white-space: nowrap; }
.nav a:hover { color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* Хлебные крошки */
.crumbs { font-size: 14px; color: var(--muted); padding-top: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.crumbs span { margin: 0 4px; }

/* Страница */
.page { padding-top: 28px; padding-bottom: 56px; }
.page h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.02em; }
.lead { font-size: 18px; color: var(--muted); max-width: 780px; margin: 0 0 28px; }
/* Текст — удобной ширины, а плитки и чипы — на всю ширину, как каталог */
.prose > :not(.cards):not(.chips) { max-width: 820px; }
.prose h2, .faq h2, section > h2 { font-size: 26px; line-height: 1.25; margin: 44px 0 14px; letter-spacing: -0.01em; }
.prose h3 { font-size: 19px; margin: 28px 0 10px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 6px 0; }

.demo { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 20px; font-size: 15px; }

/* Таблица рейтинга */
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button {
  font: inherit; font-size: 14px; cursor: pointer;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px;
}
.tabs button[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.check { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; cursor: pointer; }
.tablebox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th, .table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .n { width: 36px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prov b { display: block; }
.prov a { color: var(--text); text-decoration: none; }
.prov a:hover { text-decoration: underline; }
.prov span { font-size: 13px; color: var(--muted); }
.best { color: var(--good); font-weight: 600; }
.score { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.bar { width: 56px; height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }

/* Обычные таблицы в тексте */
.plain { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: block; overflow-x: auto; }
.plain thead, .plain tbody { display: table; width: 100%; border-collapse: collapse; }
.plain th, .plain td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.plain th { font-size: 14px; color: var(--muted); font-weight: 600; background: var(--bg); }
.plain tr:last-child td, .plain tr:last-child th { border-bottom: 0; }
.spec th { width: 42%; background: none; }

/* Карточки */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.pending h2 { margin: 0 0 8px; font-size: 22px; }
.pending p { color: var(--muted); max-width: 720px; }
.card .queue { list-style: none; padding: 0; margin: 16px 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.queue li { border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 14px; background: var(--bg); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.tile { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--text); transition: border-color .15s; }
.tile:hover { border-color: var(--accent); }
.tile b { display: block; margin-bottom: 4px; }
.tile span { color: var(--muted); font-size: 14px; }

/* FAQ */
.faq { max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; position: relative; padding-right: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 20px; font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 18px 16px; color: var(--muted); }

.formula { font-family: ui-monospace, Consolas, monospace; font-size: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; border-radius: 999px; padding: 9px 20px; font-size: 15px; font-weight: 600; }

/* Подвал */
.foot { border-top: 1px solid var(--line); padding: 32px 0; background: var(--surface); }
.foot__grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(auto-fit, minmax(150px, 1fr)); gap: 24px 40px; align-items: start; }
.foot__about p { margin: 0; max-width: 340px; }
.foot h2 { font-size: 15px; margin: 0 0 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li { margin: 4px 0; font-size: 14px; }
.foot a { color: var(--muted); text-decoration: none; }
.foot a:hover { color: var(--text); }

/* Каталог провайдеров */
.catalog { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 8px; }
.filters { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; }
.filters__box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.filters summary { font-weight: 700; display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filters fieldset { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.filters legend { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; padding: 0; }
.filters label { display: flex; gap: 8px; align-items: center; font-size: 14px; padding: 3px 0; cursor: pointer; }
.filters fieldset:has(label:nth-of-type(9)) { max-height: 230px; overflow-y: auto; }
.filters__reset, .linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; font: inherit; font-size: 14px; padding: 0; }
.catalog__bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.catalog__count { color: var(--muted); font-size: 15px; }
.catalog__count b { color: var(--text); }
.sort { font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.sort select, .compare select { font: inherit; font-size: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }

.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; }
.pcard__head { display: flex; gap: 14px; align-items: flex-start; }
.pcard__head p { margin: 2px 0 0; }
.pcard__rank { font-weight: 800; color: var(--accent); font-size: 20px; min-width: 40px; line-height: 1.4; }
.pcard h3 { margin: 0; font-size: 20px; line-height: 1.3; }
.pcard h3 a { color: var(--text); text-decoration: none; }
.pcard h3 a:hover { color: var(--accent); }
.pcard__alt { font-weight: 400; color: var(--muted); font-size: 15px; }
.pcard__body { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; margin-top: 14px; }
.attrs { margin: 0; display: grid; gap: 6px; align-content: start; }
.attrs div { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 10px; font-size: 14px; }
.attrs dt { color: var(--muted); }
.attrs dd { margin: 0; }
.attrs--wide div { grid-template-columns: 210px minmax(0, 1fr); font-size: 15px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.attrs-empty { margin: 0; }
.checked { margin: 8px 0 0; }
.metrics { background: var(--bg); border-radius: 12px; padding: 14px 16px; }
.metrics__score { display: flex; align-items: baseline; gap: 8px; }
.metrics__score b { font-size: 32px; color: var(--accent); line-height: 1; }
.metrics__score span { color: var(--muted); font-size: 14px; }
.metrics dl { margin: 10px 0 6px; display: grid; gap: 4px; }
.metrics dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.metrics dt { color: var(--muted); }
.metrics dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.metrics p { margin: 0; }
.metrics--wait { display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.pcard__foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.btn--ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); }
.btn--ghost:hover { border-color: var(--accent); }
.cmp { margin-left: auto; font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: center; cursor: pointer; }
.cmp-count { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; line-height: 18px; min-width: 18px; padding: 0 5px; text-align: center; }
.nav a[aria-current="page"] .cmp-count { background: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; color: var(--text); background: var(--surface); font-size: 14px; }
.chip:hover { border-color: var(--accent); }
.chip span { color: var(--muted); margin-left: 4px; }
.tabs-nav { display: flex; gap: 4px; margin: 28px 0 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs-nav a { padding: 8px 14px; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs-nav a:hover { color: var(--text); }
.provider-top .pcard { margin: 8px 0 0; }
.sitemap { columns: 2; column-gap: 32px; padding-left: 20px; }
.sitemap li { margin: 6px 0; break-inside: avoid; }

/* Сравнение */
.compare__picker { margin: 0 0 16px; }
.compare__picker label { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.compare__box { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ctable { border-collapse: collapse; width: 100%; font-size: 14px; min-width: 520px; }
.ctable th, .ctable td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ctable thead th { font-size: 16px; white-space: nowrap; }
.ctable tbody th { color: var(--muted); font-weight: 500; width: 200px; }
.ctable th:first-child { position: sticky; left: 0; background: var(--surface); }
.compare__sec th { background: var(--bg) !important; color: var(--text) !important; font-weight: 700 !important; }

/* Телефоны и планшеты */
@media (max-width: 900px) {
  .catalog { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; overflow: visible; }
  .pcard__body { grid-template-columns: minmax(0, 1fr); }
}

/* Телефоны */
@media (max-width: 760px) {
  .top__in { flex-direction: column; align-items: flex-start; gap: 4px; padding-top: 10px; padding-bottom: 6px; }
  .nav { width: 100%; margin: 0 -10px; padding: 0 6px; }
  .foot__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot__about { grid-column: 1 / -1; }
  .lead { font-size: 17px; }
  .pcard { padding: 16px; }
  .attrs div, .attrs--wide div { grid-template-columns: 112px minmax(0, 1fr); }
  .cmp { margin-left: 0; }
  .sitemap { columns: 1; }
  .tablebox { background: none; border: 0; border-radius: 0; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    margin-bottom: 12px; padding: 8px 0; position: relative;
  }
  .table td { border: 0; padding: 5px 16px; display: flex; justify-content: space-between; gap: 12px; }
  .table td[data-l]::before { content: attr(data-l); color: var(--muted); font-size: 14px; font-weight: 400; text-align: left; }
  .table .n { position: absolute; top: 10px; right: 0; width: auto; }
  .table td.prov { display: block; padding-right: 48px; }
}
