/* CarCritic — минималистичная схема (Егор 02.10: «проще, больше белого»). Описание — ../../DESIGN-minimal.md.
   Белый фон, тонкие линии, один приглушённый акцент, без цветных плашек на всю ширину.
   Без теней, градиентов, текстур, анимаций. Фокус 2px с отступом 2px. Цели касания >= 44px.
   Тема переключается атрибутом <html data-theme="…"> (config.json → "theme" или build.py --theme):
     graphite — графит и приглушённый зелёный, Inter Tight + Inter (рекомендуемая);
     mono     — чёрно-белая, Onest;
     paper    — тёплая бумага и бирюза, Golos Text.
   Старая яркая схема Bold Character сохранена в style-bold.css (не подключается). */

/* ---------- шрифты (все OFL 1.1, хостятся у нас) ---------- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/inter-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/inter-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/static/fonts/inter-tight-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 700 800; font-display: swap;
  src: url(/static/fonts/inter-tight-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/onest-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/onest-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/golos-text-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Golos Text"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/static/fonts/golos-text-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- токены тем ---------- */
:root, :root[data-theme="graphite"] {
  --bg: #FFFFFF; --surface: #FAFAFA; --ink: #171717; --muted: #5F5F5F; --line: #E5E5E5; --line-strong: #171717;
  --accent: #297A3A; --accent-hover: #1F5F2C; --accent-soft: #EEF6EF;
  --f-head: "Inter Tight", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --h-w: 700; --h-track: -0.02em; --r: 6px; --r-lg: 8px;
}
:root[data-theme="mono"] {
  --bg: #FFFFFF; --surface: #F7F7F7; --ink: #0D0D0D; --muted: #5E5E5E; --line: #E3E3E3; --line-strong: #0D0D0D;
  --accent: #0D0D0D; --accent-hover: #000000; --accent-soft: #F1F1F1;
  --f-head: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --h-w: 600; --h-track: -0.02em; --r: 6px; --r-lg: 8px;
}
:root[data-theme="paper"] {
  --bg: #FFFFFF; --surface: #FAF8F5; --ink: #27251E; --muted: #625F58; --line: #E6E2DA; --line-strong: #27251E;
  --accent: #016A71; --accent-hover: #01535A; --accent-soft: #EEF6F6;
  --f-head: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --f-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --h-w: 600; --h-track: -0.015em; --r: 8px; --r-lg: 12px;
}
:root { --pad: 16px; --gap: 24px; --ok: #166534; --bad: #B91C1C; }
@media (min-width: 640px) { :root { --pad: 24px; } }
@media (min-width: 1024px) { :root { --pad: 32px; } }

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 18px/29px var(--f-body);
  hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; word-break: normal;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bg); padding: 12px 16px; z-index: 10; }
.skip:focus { left: 0; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1, h2, h3, h4, .wm, .card-title, .sec-card-t { font-family: var(--f-head); font-weight: var(--h-w); letter-spacing: var(--h-track); margin: 0; text-transform: none; hyphens: manual; -webkit-hyphens: manual; }
@media (min-width: 640px) { body { hyphens: manual; -webkit-hyphens: manual; } } /* переносы слов только на узком экране */
h1 { font-size: 32px; line-height: 38px; }
h2 { font-size: 26px; line-height: 32px; }
h3 { font-size: 21px; line-height: 28px; }
h4 { font-size: 19px; line-height: 26px; }
@media (min-width: 640px) { h1 { font-size: 40px; line-height: 46px; } h2 { font-size: 30px; line-height: 36px; } }
@media (min-width: 1024px) { h1 { font-size: 48px; line-height: 54px; } h2 { font-size: 32px; line-height: 40px; } h3 { font-size: 24px; line-height: 30px; } }
.label { font: 500 13px/18px var(--f-body); letter-spacing: 0.02em; color: var(--muted); margin: 0; }
.label a { color: inherit; text-decoration: none; }
.label a:hover { color: var(--ink); text-decoration: underline; }
small, .small { font-size: 14px; line-height: 22px; }

/* ---------- каркас ---------- */
.top { background: var(--bg); color: var(--ink); border-bottom: 1px solid var(--line); }
.top-in, .section, .crumbs, .post, .hero-in, .foot-in { max-width: 1200px; margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }
.top-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 24px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.wm { font-size: 22px; line-height: 28px; color: inherit; letter-spacing: -0.02em; }
.wm-b { color: var(--accent); }
.wm-lg { font-size: 28px; line-height: 34px; }
.nav { display: flex; flex-wrap: wrap; gap: 0 2px; margin-right: -10px; }
.nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--muted); text-decoration: none; font: 500 15px/20px var(--f-body); }
.nav a:hover { color: var(--ink); }
.main { min-height: 60vh; }

.crumbs { padding-top: 16px; font-size: 14px; line-height: 22px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; }
.crumbs li { display: flex; align-items: center; }
.crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--line-strong); opacity: .35; }
.crumbs a { color: var(--muted); display: inline-block; padding: 8px 0; text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--muted); display: none; } /* на телефоне текущая страница уже в заголовке */
@media (min-width: 1024px) { .crumbs [aria-current] { display: flex; } }

.section { padding-top: 48px; padding-bottom: 8px; }
@media (min-width: 1024px) { .section { padding-top: 72px; } }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sec-h { font-size: 22px; line-height: 28px; margin-bottom: 20px; }
.sec-head .sec-h { margin-bottom: 0; }
.sec-h a { color: inherit; text-decoration: none; }
@media (min-width: 1024px) { .sec-h { font-size: 26px; line-height: 32px; } }
.more, .count { font: 500 15px/20px var(--f-body); }
.more { display: inline-flex; align-items: center; min-height: 44px; }
.lead { font-size: 18px; line-height: 29px; max-width: 680px; margin: 16px 0 32px; color: var(--muted); }
@media (min-width: 1024px) { .lead { font-size: 20px; line-height: 32px; } }

/* ---------- витрина ---------- */
.hero { background: var(--bg); color: var(--ink); }
.hero-in { padding-top: 48px; padding-bottom: 8px; }
@media (min-width: 1024px) { .hero-in { padding-top: 96px; padding-bottom: 24px; } }
.hero-label { margin-bottom: 16px; }
.display { display: none; } /* в минималистичной схеме вордмарк живёт только в шапке */
.hero-h1 { font-size: 32px; line-height: 38px; max-width: 900px; }
@media (min-width: 640px) { .hero-h1 { font-size: 44px; line-height: 50px; } }
@media (min-width: 1024px) { .hero-h1 { font-size: 56px; line-height: 62px; } }
.hero-lead { hyphens: manual; max-width: 680px; margin: 20px 0 0; font-size: 18px; line-height: 29px; color: var(--muted); }
@media (min-width: 1024px) { .hero-lead { font-size: 20px; line-height: 32px; } }

.sec-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .sec-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .sec-grid { grid-template-columns: repeat(3, 1fr); } }
.sec-card { display: flex; flex-direction: column; gap: 6px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: var(--ink); background: var(--bg); }
.sec-card.sc1, .sec-card.sc2 { background: var(--bg); color: var(--ink); }
.sec-card:hover { border-color: var(--line-strong); color: var(--ink); }
.sec-card-t { font: var(--h-w) 20px/26px var(--f-head); letter-spacing: var(--h-track); }
.sec-card-d { font-size: 15px; line-height: 23px; color: var(--muted); }

/* ---------- карточки ---------- */
.grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.card { display: flex; flex-direction: column; gap: 10px; padding: 20px 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); position: relative; }
.card-accent { background: var(--bg); }
.card:hover { border-color: var(--line-strong); }
.card-title { font-size: 20px; line-height: 27px; }
.card-title a { color: var(--ink); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-title a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.card-desc { margin: 0; font-size: 15px; line-height: 23px; color: var(--muted); }
.card-foot { margin-top: auto; font-size: 13px; line-height: 20px; color: var(--muted); }
.flag { display: inline-block; border: 1px solid var(--line); color: var(--muted); font: 500 12px/18px var(--f-body); padding: 0 8px; border-radius: 999px; margin-left: 6px; }

/* ---------- статья ---------- */
.post { padding-top: 16px; padding-bottom: 64px; }
.post-head { max-width: 760px; margin-bottom: 32px; }
.post-head .label { margin-bottom: 12px; }
@media (min-width: 1024px) { .post-head h1 { font-size: 44px; line-height: 52px; } }
.byline { display: flex; gap: 12px; align-items: center; margin-top: 20px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.mono { flex: none; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; font: var(--h-w) 18px/1 var(--f-head); color: var(--accent); }
.byline-text { margin: 0; font-size: 14px; line-height: 22px; color: var(--muted); }
.byline-text a { color: var(--ink); font-weight: 600; text-decoration: none; }
.byline-text a:hover { text-decoration: underline; }
.checked { display: inline-block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.checked::before { content: "✓ "; color: var(--accent); }
.draft-banner { background: var(--surface); color: var(--muted); border: 1px dashed var(--line-strong); padding: 10px 14px; border-radius: var(--r); margin: 0 0 16px; font-size: 14px; line-height: 22px; }

.prose { max-width: 720px; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 20px; }
.prose h2 { margin: 48px 0 16px; }
.prose h3 { margin: 32px 0 12px; }
.prose h4 { margin: 28px 0 10px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--muted); }
.prose a { word-break: break-word; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 24px 0; padding: 4px 0 4px 20px; border-left: 2px solid var(--accent); color: var(--ink); }
.prose blockquote p { margin: 0 0 12px; }
.prose img { border-radius: var(--r-lg); }
.photo { margin: 28px 0; }
.photo img { display: block; width: 100%; height: auto; border-radius: var(--r-lg); background: var(--surface); }
.photo figcaption { margin-top: 8px; font-size: 13px; line-height: 20px; color: var(--muted); }
.photo figcaption a { color: var(--muted); }
.prose code { background: var(--surface); padding: 1px 6px; border-radius: 4px; font-size: 0.9em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.tablewrap { overflow-x: auto; margin: 24px 0; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
.tablewrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 23px; hyphens: manual; }
caption { text-align: left; padding: 12px 16px; font-size: 13px; line-height: 20px; color: var(--muted); caption-side: bottom; }
th, td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface); color: var(--ink); font-weight: 600; white-space: nowrap; }
@media (max-width: 639px) { th { white-space: normal; } th, td { padding: 10px 12px; } }
tbody tr:last-child td { border-bottom: 0; }

details.sources { margin: 48px 0 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); }
details.sources summary { cursor: pointer; padding: 12px 20px; min-height: 44px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; list-style: none; }
details.sources summary::-webkit-details-marker { display: none; }
details.sources summary h2 { margin: 0; font-size: 20px; line-height: 26px; }
details.sources summary::before { content: "+"; font: 500 22px/1 var(--f-body); width: 20px; color: var(--muted); }
details.sources[open] summary::before { content: "−"; }
.sources-hint { font-size: 14px; color: var(--muted); }
.sources-body { padding: 0 20px 12px; font-size: 15px; line-height: 24px; }
section.method { margin: 40px 0 24px; padding: 4px 20px 4px; background: var(--surface); border-radius: var(--r-lg); }
section.method h2 { font-size: 20px; line-height: 26px; margin: 16px 0 10px; }
section.method p { color: var(--muted); }

.post-foot { max-width: 720px; margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; font-size: 14px; line-height: 22px; color: var(--muted); text-decoration: none; }
.tag:hover { border-color: var(--line-strong); color: var(--ink); }
.ai-note { margin: 16px 0 0; font-size: 14px; line-height: 22px; color: var(--muted); }

/* ---------- калькулятор ---------- */
.calc { margin: 32px 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); overflow: hidden; }
.calc-form { padding: 20px 24px; }
.calc-title { margin: 0 0 4px; font: var(--h-w) 20px/26px var(--f-head); letter-spacing: var(--h-track); }
.calc-intro { margin: 0 0 20px; font-size: 15px; line-height: 23px; color: var(--muted); }
.calc-fields { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 640px) { .calc-fields { grid-template-columns: repeat(2, 1fr); gap: 16px 20px; } }
.calc-field label { display: block; font: 500 14px/20px var(--f-body); margin-bottom: 4px; color: var(--ink); }
.calc-field input { width: 100%; height: 44px; padding: 0 12px; font: 400 17px/24px var(--f-body); color: var(--ink); background: var(--bg); border: 1px solid #C9C9C9; border-radius: var(--r); }
.calc-field input:hover { border-color: var(--line-strong); }
.calc-field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.calc-out { margin-top: 20px; padding: 16px 20px; background: var(--surface); color: var(--ink); border-radius: var(--r); }
.calc-res { margin: 0; display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 640px) { .calc-res { grid-template-columns: repeat(3, 1fr); } }
.calc-res dt { font-size: 13px; line-height: 20px; color: var(--muted); }
.calc-res dd { margin: 2px 0 0; font: var(--h-w) 26px/32px var(--f-head); letter-spacing: var(--h-track); color: var(--accent); hyphens: manual; }
.calc-bad { margin: 0; font-size: 17px; line-height: 27px; }
.calc-noscript { margin: 16px 0 0; padding: 12px 16px; background: var(--surface); color: var(--ink); border-radius: var(--r); }
.calc > .tablewrap { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }

/* ---------- кнопки, поиск, 404 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; background: var(--ink); color: var(--bg); border: 1px solid var(--ink); border-radius: var(--r); font: 600 16px/20px var(--f-body); text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--bg); color: var(--ink); }
.nf-search { display: flex; flex-wrap: wrap; gap: 12px; max-width: 560px; }
.nf-search input { flex: 1 1 240px; height: 44px; padding: 0 12px; font: 400 17px/24px var(--f-body); background: var(--bg); border: 1px solid #C9C9C9; border-radius: var(--r); }
.nf-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.nf-section { display: flex; align-items: center; min-height: 56px; padding: 12px 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); color: var(--ink); text-decoration: none; }
.nf-section:hover { border-color: var(--line-strong); }
.nf-list { margin: 0; padding-left: 20px; }
.nf-list li { margin-bottom: 8px; }

/* ---------- подвал ---------- */
.foot { margin-top: 96px; background: var(--bg); color: var(--ink); border-top: 1px solid var(--line); }
.foot-in { padding-top: 40px; padding-bottom: 48px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 16px 0 12px -10px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--muted); font-weight: 500; font-size: 15px; text-decoration: none; }
.foot-links a:hover { color: var(--ink); text-decoration: underline; }
.foot-ai { max-width: 680px; margin: 0 0 12px; font-size: 14px; line-height: 22px; color: var(--muted); }
.foot-ai a { color: var(--muted); }
.foot-copy { margin: 0; font-size: 14px; line-height: 22px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
