/* PF-Rating — слой юзабилити: быстрые ссылки, рейтинг с сортировкой, карточки на телефоне, сводки */

/* Метка «на проверке» и метаданные */
mark.chk { background: var(--warn-soft); color: inherit; border: 1px solid var(--warn-border); border-radius: 6px; padding: 0 .35em; white-space: nowrap; }
.hide-sm { }

/* Быстрые ссылки под H1 */
.quickbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 18px; }
.quickbar a { display: inline-flex; align-items: center; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: .9rem; color: var(--text); }
.quickbar a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.quickbar a.qb-main { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Оглавление — свёрнуто, раскрывается по клику */
details.toc { padding: 12px 16px; margin-bottom: 22px; }
details.toc summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.toc summary::-webkit-details-marker { display: none; }
details.toc summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
details.toc[open] summary::after { transform: rotate(180deg); }
details.toc ol { margin: 10px 0 2px; }

/* Вводный абзац и блок «Факты» — заметнее */
.art-body > p:first-child { font-size: 1.08rem; color: var(--text); }
.art-body > p:first-child + p:has(> strong:only-child) + ul { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px 14px 34px; box-shadow: var(--shadow); }

/* Точки балла прозрачности */
.dots { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); display: inline-block; }
.dots i.on { background: var(--ok); }
.dots b { margin-left: 6px; font-size: .9rem; }

/* Рейтинг: панель сортировки и фильтров */
.rating { margin: 18px 0 28px; scroll-margin-top: 72px; }
.rating-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 12px 14px; margin-bottom: 12px; position: sticky; top: 64px; z-index: 5; }
.rt-sort { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; }
.rt-sort select { font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.rt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); font-size: .85rem; cursor: pointer; user-select: none; }
.chip input { accent-color: var(--primary); margin: 0; }
.chip.is-on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.rt-count { margin: 0 0 0 auto; }
.rank-n { display: inline-flex; width: 30px; height: 30px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 800; background: var(--surface-2); }
.rank-n.top3 { background: var(--primary); color: #fff; }
.rt-table th[scope="row"] a { font-weight: 700; }

/* Карточки рейтинга — только на телефоне */
.rcards, .art-body .rcards { display: none; list-style: none; padding: 0; margin: 0; }
.art-body .rcards > li { margin: 0 0 12px; }
.rcard { padding: 14px; margin-bottom: 12px; }
.rc-head { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.rc-name { display: flex; flex-direction: column; line-height: 1.3; }
.rc-name b { font-size: 1.05rem; }
.rc-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin: 12px 0; }
.rc-facts div { min-width: 0; }
.rc-facts dt { font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.rc-facts dd { margin: 0; font-size: .92rem; }
.rc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Сводка над обзором сервиса */
.svc-summary { padding: 16px 18px; margin: 0 0 22px; border-left: 4px solid var(--primary); }
.ss-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ss-head p { margin: 0 0 2px; }
.ss-name { font-size: 1.25rem; display: block; }
.ss-place { display: inline-block; font-size: .85rem; margin-right: 10px; }
.svc-summary .rc-facts { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.svc-summary > p:last-child { margin: 10px 0 0; }

/* Кнопка «наверх» */
.to-top { position: fixed; right: 14px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; box-shadow: var(--shadow); z-index: 20; }
.to-top:hover { color: #fff; text-decoration: none; background: var(--primary-h); }

@media (max-width: 720px) {
  h1 { font-size: 1.6rem; }
  .eyebrow { font-size: .72rem; }
  .hide-sm { display: none; }
  .page-wide, .art-layout { padding-top: 14px; }
  .quickbar { flex-wrap: nowrap; overflow-x: auto; margin-left: -16px; margin-right: -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .quickbar::-webkit-scrollbar { display: none; }
  .quickbar a { flex: 0 0 auto; }
  .rt-table { display: none; }
  .rcards, .art-body .rcards { display: block; }
  .rc-actions .btn { flex: 1 1 0; }
  .to-top { bottom: 84px; width: 40px; height: 40px; opacity: .9; }
  .rating-tools { position: static; padding: 10px 12px; }
  .rt-count { margin: 0; width: 100%; }
  .rt-chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .rt-chips::-webkit-scrollbar { display: none; }
  .chip { flex: 0 0 auto; }
  .svc-summary .rc-facts { grid-template-columns: 1fr 1fr; }
  .art-body > p:first-child { font-size: 1.02rem; }
}

/* Лидеры на первом экране */
.leaders { margin: 0 0 18px; }
.leaders-h { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; }
.leaders-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.leader { display: flex; gap: 10px; padding: 12px; color: var(--text); align-items: flex-start; }
.leader:hover { text-decoration: none; border-color: var(--primary); color: var(--text); }
.ld-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ld-body b { font-size: 1.02rem; }
.ld-fact { font-size: .85rem; line-height: 1.35; }

/* Плашки ТЗ §0.4 */
.flags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; }
.flag { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.3; padding: 2px 8px; border-radius: 999px; border: 1px solid transparent; }
.flag-red { background: var(--bad-soft); color: var(--bad); border-color: var(--bad); }
.flag-yellow { background: var(--warn-soft); color: #92400e; border-color: var(--warn-border); }
.flag-info { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.flag-claim { background: var(--surface-2); color: var(--muted); border-color: var(--border); font-weight: 500; }
@media (prefers-color-scheme: dark) { .flag-yellow { color: #fcd34d; } }
.rt-table th[scope="row"] .flags { max-width: 260px; }

/* Сравнение из рейтинга */
.cmp-check { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; color: var(--muted); cursor: pointer; margin-top: 6px; font-weight: 500; }
.cmp-check input { accent-color: var(--primary); width: 16px; height: 16px; }
.rt-table .cmp-check { display: flex; }
.rc-actions .cmp-check { margin: 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; flex: 1 1 0; justify-content: center; }
.cmp-bar { position: sticky; bottom: 12px; z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 0; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 6px 24px rgb(15 23 42 / .12); }
.cmp-form:not(:has(input[name="s[]"]:checked)) .cmp-bar { position: static; box-shadow: none; }
.grid-3c { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

@media (max-width: 720px) {
  .leaders-row { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 80%; overflow-x: auto; padding: 0 0 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .leaders-row::-webkit-scrollbar { display: none; }
  .leader { scroll-snap-align: start; }
  .grid-3c { grid-template-columns: 1fr; }
  .cmp-bar { bottom: 8px; }
}

/* Таблица сравнения на телефоне: параметр -> значения по сервисам */
@media (max-width: 720px) {
  .cmp-table { overflow: visible; }
  .cmp-table table, .cmp-table tbody, .cmp-table tr { display: block; width: 100%; }
  .cmp-table thead { display: none; }
  .cmp-table tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .cmp-table th[scope="row"] { display: block; padding: 0 0 4px; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); border: 0; }
  .cmp-table td { display: grid; grid-template-columns: 38% 1fr; gap: 8px; padding: 3px 0; border: 0; }
  .cmp-table td::before { content: attr(data-label); font-weight: 700; font-size: .85rem; }
}

.grid-4c { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .grid-4c { grid-template-columns: 1fr 1fr; } }
td.best { background: var(--ok-soft); font-weight: 700; }
td.best::after { content: " ✓"; color: var(--ok); }
.ld-body .dots { align-self: flex-start; }

/* ===== Рейтинг в стиле прототипа (_design/prototype.html) ===== */
.rt-table { border-radius: 12px; box-shadow: 0 4px 6px -1px rgb(15 23 42 / .07), 0 2px 4px -2px rgb(15 23 42 / .05); }
.rtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rtable thead th { background: var(--surface-2); padding: 14px 18px; text-align: left; font-size: .72rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; border-bottom: 1px solid var(--border); }
.rtable th.th-sort a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.rtable th.th-sort:hover { background: #eef2f7; }
.rtable .sort-ic { width: 15px; height: 15px; opacity: .3; }
.rtable th.is-on, .rtable th.is-on a { color: var(--text); }
.rtable th.is-on .sort-ic { opacity: 1; color: var(--primary); }
.rtable tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rtable tbody tr:last-child td { border-bottom: 0; }
.rtable tbody tr:hover { background: #f8fafc; }
.ta-r { text-align: right; }
.rtable td.ta-r { white-space: nowrap; }
.rtable td.ta-r .cmp-check { justify-content: flex-end; }
.medal { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; background: var(--surface-2); color: var(--text-2); }
.medal.m1 { background: #fef3c7; color: #b45309; }
.medal.m2 { background: #e2e8f0; color: #475569; }
.medal.m3 { background: #ffedd5; color: #c2410c; }
.svc-cell { display: flex; align-items: center; gap: 14px; }
.svc-logo { flex: none; width: 40px; height: 40px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem; letter-spacing: .02em; }
.svc-name { font-weight: 600; color: var(--text); }
.svc-name a { color: var(--text); }
.svc-name a:hover { color: var(--primary); }
.svc-sub { font-size: .82rem; color: var(--muted); line-height: 1.35; }
.svc-cell .flags { margin-top: 4px; }
.tbadge { display: inline-flex; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.tb-green { background: #d1fae5; color: #065f46; }
.tb-blue { background: #dbeafe; color: #1e40af; }
.tb-sky { background: #e0f2fe; color: #075985; }
.tb-slate { background: #f1f5f9; color: #334155; }
.tb-violet { background: #ede9fe; color: #5b21b6; }
.tb-amber { background: #fef3c7; color: #92400e; }
.rtable .btn-ghost { background: var(--primary-soft); color: var(--primary); border: 0; }
.rtable .btn-ghost:hover { background: #dbeafe; }
.rtable .dots { margin-bottom: 2px; }
@media (min-width: 721px) { .rt-sort { display: none; } }
@media (prefers-color-scheme: dark) {
  .rtable tbody tr:hover, .rtable th.th-sort:hover { background: var(--surface-2); }
  .medal.m1 { background: #422006; color: #fcd34d; } .medal.m2 { background: #334155; color: #e2e8f0; } .medal.m3 { background: #431407; color: #fdba74; }
  .tb-green { background: #064e3b; color: #a7f3d0; } .tb-blue { background: #1e3a8a; color: #bfdbfe; } .tb-sky { background: #0c4a6e; color: #bae6fd; }
  .tb-slate { background: #1e293b; color: #cbd5e1; } .tb-violet { background: #3b0764; color: #ddd6fe; } .tb-amber { background: #451a03; color: #fde68a; }
}

/* Главная: заголовок по центру, как в прототипе */
.page-home .art > header, .page-home .quickbar { text-align: center; justify-content: center; }
.page-home .art > header h1 { max-width: 900px; margin-left: auto; margin-right: auto; }
.page-home .art > header .eyebrow { justify-content: center; }
.rc-head { grid-template-columns: auto auto 1fr auto; }

/* Поиск в шапке */
.header-in { gap: 16px; }
.hsearch { flex: 1; max-width: 240px; margin-left: 12px; }
.hsearch input { width: 100%; height: 38px; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); font: inherit; font-size: .9rem; color: var(--text); }
.hsearch input:focus { background: var(--surface); border-color: var(--primary); outline: 2px solid var(--primary-soft); }
.hsearch-m { display: none; color: var(--text-2); }
@media (max-width: 1100px) { .hsearch { display: none; } .hsearch-m { display: inline-flex; margin-left: auto; margin-right: 8px; padding: 6px; } }
.search-big { display: flex; gap: 8px; margin: 12px 0 24px; }
.search-big input { flex: 1; height: 48px; font-size: 1.05rem; border-radius: 10px; }
.search-list { list-style: none; padding: 0; margin: 0 0 24px; }
.search-list li { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--border); }
@media (max-width: 720px) { .search-big { flex-direction: column; } }

/* Строка разделов обзора и FAQ (без редакционной темы) */
.secnav { position: sticky; top: 64px; z-index: 6; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; background: var(--bg); border-bottom: 1px solid var(--border); margin: 0 0 20px; padding: 8px 0; }
.secnav::-webkit-scrollbar { display: none; }
.secnav a { flex: 0 0 auto; padding: 6px 12px; font-size: .88rem; font-weight: 600; color: var(--text-2); border-radius: 999px; }
.secnav a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.art-body h2, .art-body h3 { scroll-margin-top: 124px; }
.faq { margin-top: 8px; }
.faq-item { display: grid; grid-template-columns: 30px 1fr; column-gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.faq-item:first-child { border-top: 1px solid var(--border); }
.faq-item::before { content: "?"; grid-row: 1 / span 2; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.faq-item h3 { margin: 2px 0 6px; font-size: 1.04rem; }
.faq-a > :last-child { margin-bottom: 0; }
@media (max-width: 720px) { .secnav { top: 56px; margin-left: -16px; margin-right: -16px; padding-left: 12px; padding-right: 12px; } }

/* Точки балла: сброс отступа старого списка .dots из style.css */
.dots { padding-left: 0 !important; display: inline-flex; }

/* Главная: заголовок по центру во всю ширину */
.page-home .art > header { max-width: none; }
.page-home .art > header h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }

/* Панель фильтров — лёгкая строка над таблицей */
.rating-tools { background: transparent; border: 0; padding: 0 0 12px; position: static; gap: 8px 12px; }
.rating-tools .chip { font-size: .82rem; padding: 4px 11px; background: var(--surface); }
.rating-tools .chip.is-on { background: var(--primary-soft); }
.rt-count { align-self: center; }
@media (max-width: 720px) { .page-home .quickbar { justify-content: flex-start; } }
