/* masterobzor.ru — компоненты. Порядок секций: база → шапка → страница →
   блоки статьи → карточка позиции → таблица → служебное → мобильное. */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "liga" 1, "kern" 1;
}
@media (min-width: 900px) { body { font-size: 19px; } }

img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3, h4 { line-height: 1.22; text-wrap: balance; margin: 0; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(29px, 4.6vw, 40px); }
h2 { font-size: clamp(23px, 3vw, 30px); margin-top: 56px; }
h3 { font-size: clamp(19px, 2.2vw, 22px); font-weight: 600; margin-top: 32px; }
p, ul, ol { margin: 0 0 20px; }
ul, ol { padding-left: 24px; }
li { margin-bottom: 8px; }
small { font-size: 14px; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 20px; }
.measure { max-width: var(--measure); }
.muted { color: var(--muted); }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- шапка ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 40;
}
.header-row { display: flex; align-items: center; gap: 20px; min-height: 62px; }
.logo { display: inline-flex; align-items: baseline; gap: 2px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; color: var(--text); text-decoration: none; white-space: nowrap; }
.logo b { color: var(--accent); font-weight: 700; }
.logo::before {
  content: ""; width: 3px; height: 20px; background: var(--accent);
  margin-right: 9px; border-radius: 2px; align-self: center;
}
.nav { display: flex; gap: 2px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  color: var(--text); text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 8px 11px; border-radius: var(--radius); white-space: nowrap;
}
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-more { color: var(--muted) !important; }
.burger { display: none; margin-left: auto; background: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font: inherit; font-size: 15px; color: var(--text); cursor: pointer; }

/* ---------- крошки ---------- */
.crumbs { font-size: 14px; color: var(--muted); padding: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-current] { color: var(--text); }

/* ---------- бейдж честности: ядро доверия ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em;
  padding: 4px 10px 4px 8px; border-radius: 100px; border: 1px solid;
  text-decoration: none;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge-own  { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 8%, transparent); }
.badge-ask  { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.badge-docs { color: var(--muted); border-color: var(--border); background: var(--surface-2); }

/* ---------- страница статьи ---------- */
.article-head { padding: 8px 0 0; }
.meta-line { font-size: 14px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 0; }
.lede { font-size: clamp(18px, 2.3vw, 21px); line-height: 1.55; color: var(--text); margin: 18px 0 0; max-width: var(--measure); }

/* minmax(0,…) обязателен в обеих раскладках: при grid-колонке `1fr` минимум равен auto,
   и таблица с min-width раздвигает колонку вместо того, чтобы скроллиться внутри .table-wrap. */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; align-items: start; padding: 28px 0 60px; }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.prose, .quick { min-width: 0; }

.toc { position: sticky; top: 82px; font-size: 15px; }
.toc-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc li { margin: 0; counter-increment: toc; }
.toc a {
  display: grid; grid-template-columns: 26px 1fr; gap: 4px; align-items: baseline;
  color: var(--muted); text-decoration: none; padding: 6px 0; line-height: 1.35;
  border-left: 2px solid transparent; padding-left: 12px; margin-left: -14px;
}
.toc a::before { content: counter(toc, decimal-leading-zero); font-size: 12px; color: var(--border); font-variant-numeric: tabular-nums; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc a.is-active::before { color: var(--accent); }
@media (max-width: 1000px) { .toc { display: none; } }

.toc-mobile { display: none; margin: 20px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.toc-mobile > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 16px; }
.toc-mobile ol { padding: 0 16px 12px 34px; margin: 0; }
@media (max-width: 1000px) { .toc-mobile { display: block; } }

.prose { max-width: var(--measure); }
.prose > h2:first-child { margin-top: 0; }

/* ---------- блок быстрого ответа: главный экран ---------- */
.quick {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow); margin: 26px 0 0; overflow: hidden;
}
.quick-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.quick-head h2 { font-size: 17px; margin: 0; letter-spacing: 0; }
.quick-head .muted { font-size: 13px; }
.quick-list { display: grid; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 760px) { .quick-list { grid-template-columns: 1fr; } }
.quick-item { padding: 16px 18px; border-right: 1px solid var(--border); }
.quick-item:last-child { border-right: 0; }
@media (max-width: 760px) {
  .quick-item { border-right: 0; border-bottom: 1px solid var(--border); }
  .quick-item:last-child { border-bottom: 0; }
}
.quick-role { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--accent); }
.quick-name { font-weight: 600; font-size: 18px; margin: 6px 0 4px; }
.quick-name a { color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.quick-name a:hover { border-bottom-color: var(--accent); }
.quick-why { font-size: 15px; color: var(--muted); line-height: 1.5; margin: 0; }
.quick-price { font-size: 15px; font-weight: 600; margin-top: 8px; font-variant-numeric: tabular-nums; }

/* строка честности — обязательна, одной строкой, не абзацем */
.honesty {
  font-size: 14px; color: var(--muted); margin: 12px 0 0;
  padding-left: 12px; border-left: 2px solid var(--border);
}

/* ---------- карточка позиции ---------- */
.pos { border-top: 1px solid var(--border); padding: 28px 0 4px; }
.pos-head { display: flex; align-items: flex-start; gap: 14px; }
.pos-num {
  font-size: 30px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums;
  width: 48px; flex: none; line-height: 1.1;
}
.pos-num::after { content: ""; display: block; width: 20px; height: 2px; background: var(--accent); margin-top: 6px; border-radius: 2px; }
.pos-title { margin: 0; }
.pos-sub { font-size: 14px; color: var(--muted); margin-top: 2px; }
.pos-role { display: inline-block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); background: var(--accent-soft); padding: 3px 8px; border-radius: 3px; margin-bottom: 6px; }
.pos-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.pos-price small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

/* minmax(0,…) обязателен: голый max-content на длинном названии характеристики
   растягивает колонку и уносит правый край за вьюпорт на 390px. */
.specs { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 4px 16px; margin: 14px 0 18px; font-size: 15px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .specs { grid-template-columns: 1fr; gap: 0; }
  .specs dt { margin-top: 12px; font-size: 13px; }
  .specs dt:first-child { margin-top: 0; }
}

.pm { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 16px 0; }
@media (max-width: 640px) { .pm { grid-template-columns: 1fr; } }
.pm ul { list-style: none; padding: 0; margin: 0; font-size: 15px; }
.pm li { padding-left: 22px; position: relative; margin-bottom: 7px; line-height: 1.45; }
.pm-good li::before { content: "+"; position: absolute; left: 4px; color: var(--good); font-weight: 700; }
.pm-bad  li::before { content: "−"; position: absolute; left: 4px; color: var(--bad); font-weight: 700; }
.pm h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; margin: 0 0 8px; }
.pm-good h4 { color: var(--good); }
.pm-bad h4 { color: var(--bad); }

.fit { display: grid; gap: 6px; font-size: 15px; margin: 14px 0 0; }
.fit b { font-weight: 600; }
.fit-yes b { color: var(--good); }
.fit-no b { color: var(--bad); }

/* ---------- врезки ---------- */
.note {
  border-left: 3px solid var(--warn); background: var(--surface-2);
  padding: 14px 16px; border-radius: 0 var(--radius) var(--radius) 0; margin: 24px 0; font-size: 16px;
}
.note-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--warn); margin-bottom: 6px; }
.note p:last-child { margin-bottom: 0; }
.note-bad { border-left-color: var(--bad); }
.note-bad .note-title { color: var(--bad); }

/* ---------- таблица сравнения ----------
   Грабли spc-lvt: 4 колонки с ценами рвут вьюпорт на 390px.
   Обёртка со скроллом обязательна, первая колонка липкая. */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 24px 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 15px; min-width: 640px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
td.tnum, th.tnum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-wrap th:first-child, .table-wrap td:first-child {
  position: sticky; left: 0; background: var(--surface); border-right: 1px solid var(--border); font-weight: 600;
}
.table-wrap tbody tr:nth-child(even) td:first-child { background: color-mix(in srgb, var(--surface-2) 92%, var(--surface)); }

/* ---------- FAQ ---------- */
.faq { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 12px 0; }
.faq summary { padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; font-size: 20px; line-height: 1; }
.faq[open] summary::after { content: "−"; }
.faq-body { padding: 0 18px 16px; font-size: 16px; }
.faq-body p:last-child { margin-bottom: 0; }

/* ---------- источники, обновления, авторство ---------- */
/* Источники — это длинные URL без пробелов: без принудительного переноса они
   растягивают страницу на мобильном (ловилось только по scrollWidth документа). */
.sources { font-size: 15px; }
.sources ol { padding-left: 22px; }
.sources li { color: var(--muted); overflow-wrap: anywhere; word-break: break-word; }
.prose, .prose p, .prose li, .faq-body, .pos-sub { overflow-wrap: break-word; }
.changelog { font-size: 15px; border-left: 2px solid var(--border); padding-left: 16px; }
.changelog time { color: var(--muted); font-variant-numeric: tabular-nums; margin-right: 8px; }
.author-card { display: flex; gap: 16px; align-items: flex-start; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 16px 18px; margin: 20px 0; }
.author-ava { width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); flex: none; display: grid; place-items: center; font-weight: 700; color: var(--muted); }
.author-card p { margin: 4px 0 0; font-size: 15px; color: var(--muted); }

/* ---------- сетки страниц-списков ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 16px; margin: 24px 0; }
.card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }
.card h3 { margin: 0; font-size: 18px; }
.card .card-meta { font-size: 13px; color: var(--muted); margin-top: auto; display: flex; gap: 12px; flex-wrap: wrap; }
.card-soon { opacity: .62; }
.card-soon:hover { border-color: var(--border); box-shadow: none; }

.section-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 22px 0 0; }
.section-tile {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 16px 18px; text-decoration: none; color: inherit; display: block;
}
.section-tile:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.section-tile b { display: block; font-size: 17px; margin-bottom: 4px; }
.section-tile span { font-size: 13px; color: var(--muted); }

.topic-list { list-style: none; padding: 0; margin: 20px 0; columns: 2; column-gap: 40px; }
@media (max-width: 760px) { .topic-list { columns: 1; } }
.topic-list li { break-inside: avoid; margin-bottom: 9px; display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border-bottom: 1px dotted var(--border); padding-bottom: 6px; }
.topic-list .t-shows { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.topic-list a { text-decoration: none; }
.topic-list a:hover { text-decoration: underline; }
.topic-list .soon { color: var(--muted); }

/* ---------- главная ---------- */
.hero { padding: 44px 0 20px; border-bottom: 1px solid var(--border); }
.hero h1 { max-width: 22ch; }
.hero p { font-size: clamp(18px, 2.2vw, 21px); color: var(--muted); max-width: 60ch; margin-top: 16px; }
.pledge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 32px 0 0; }
@media (max-width: 820px) { .pledge { grid-template-columns: 1fr; } }
.pledge div { border-top: 2px solid var(--accent); padding-top: 12px; }
.pledge b { display: block; margin-bottom: 4px; }
.pledge p { font-size: 15px; color: var(--muted); margin: 0; }

/* ---------- CTA ---------- */
.cta { border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); background: var(--surface); padding: 20px; margin: 36px 0; }
.cta h3 { margin: 0 0 6px; }
.cta p { font-size: 15px; color: var(--muted); margin: 0 0 14px; }
.btn { display: inline-block; background: var(--accent); color: #fff; text-decoration: none; font-weight: 600; font-size: 16px; padding: 11px 20px; border-radius: var(--radius); border: 0; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--accent); border: 1px solid currentColor; }

/* ---------- подвал ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 60px; padding: 34px 0; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { color: var(--text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--border); margin-top: 26px; padding-top: 18px; font-size: 13px; color: var(--muted); }

.stub { border: 1px dashed var(--border); border-radius: var(--radius); padding: 22px; background: var(--surface-2); color: var(--muted); }

@media (max-width: 760px) {
  .nav { display: none; }
  .nav.is-open { display: flex; flex-direction: column; width: 100%; margin: 0 0 12px; }
  .burger { display: block; }
  .header-row { flex-wrap: wrap; }
  h2 { margin-top: 40px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
