/* Guide pages (/ru/<slug>/): the landing's tokens and type, a plain article layout.
   Tokens mirror ru/index.html — change a color there, change it here. Dark tokens live TWICE
   (system unless light is picked, and html[data-theme="dark"]) — edit one, edit the other. */
:root {
  color-scheme: light dark;
  --bg: #f7f5f0; --bg-2: #efece4; --card: #fffefb; --fg: #17181b; --muted: #66655f; --faint: #716f67;
  --line: rgba(23,24,27,.11); --line-2: rgba(23,24,27,.06); --accent: #087a73; --me: #0c7f75;
  --shadow: 0 1px 2px rgba(23,24,27,.05), 0 10px 30px rgba(23,24,27,.07);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0f12; --bg-2: #17191d; --card: #15171b; --fg: #f1f0ec; --muted: #a09e97; --faint: #86847d;
    --line: rgba(255,255,255,.11); --line-2: rgba(255,255,255,.06); --accent: #3cc9bb; --me: #2fbfb0;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f12; --bg-2: #17191d; --card: #15171b; --fg: #f1f0ec; --muted: #a09e97; --faint: #86847d;
  --line: rgba(255,255,255,.11); --line-2: rgba(255,255,255,.06); --accent: #3cc9bb; --me: #2fbfb0;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  padding: .72em 1.3em; border-radius: 12px; font-weight: 650; font-size: 1rem; line-height: 1.2;
  background: var(--fg); color: var(--bg); transition: transform .12s ease, opacity .12s ease;
}
@media (hover: hover) { .btn:hover { transform: translateY(-1px); opacity: .92; } }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.sm { padding: .5em .95em; font-size: .9rem; border-radius: 10px; }
.only-touch { display: none !important; }
html.touch .only-touch { display: inline-flex !important; }
html.touch .no-touch { display: none !important; }

/* ---------- nav ---------- */
nav.top {
  position: sticky; top: 0; z-index: 50; background: var(--bg);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.nav-in { display: flex; align-items: center; justify-content: space-between; height: 58px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; color: var(--fg); text-decoration: none !important; }
.brand svg { flex: none; border-radius: 8px; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-links a.txt { color: var(--muted); font-size: .93rem; font-weight: 550; white-space: nowrap; }
.nav-links a.txt:hover { color: var(--fg); text-decoration: none; }
.theme {
  display: grid; place-items: center; width: 34px; height: 34px; padding: 0; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--line); border-radius: 8px;
}
.theme:hover { color: var(--fg); }
/* RU/EN switch — same look as the landing's (index.html / ru/index.html .lang) */
.lang { font-size: .82rem; font-weight: 650; color: var(--muted); padding: .3em .6em; border-radius: 8px; border: 1px solid var(--line); }
.lang:hover { color: var(--fg); text-decoration: none; }
html:not([data-theme]) .js-theme { display: none; }
.js-theme .i-sun, [data-theme="dark"] .js-theme .i-moon { display: none; }
[data-theme="dark"] .js-theme .i-sun { display: block; }
@media (max-width: 760px) { .nav-links a.txt { display: none; } .nav-links { gap: 12px; } }
@media (max-width: 560px) { .lang { min-height: 34px; display: inline-flex; align-items: center; } }

/* ---------- article ---------- */
.crumbs { font-size: .86rem; color: var(--faint); margin: 30px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "›"; content: "›" / ""; margin-right: 6px; color: var(--faint); }
.crumbs a { color: var(--muted); }
article.guide { max-width: 760px; padding-bottom: 20px; }
h1 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -.02em;
  font-size: clamp(2.1rem, 5.4vw, 3.4rem); line-height: 1.06; margin: 18px 0 .4em;
}
.lead { font-size: 1.18rem; line-height: 1.55; color: var(--muted); margin: 0 0 1.4em; }
h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 3.4vw, 1.95rem); line-height: 1.2; letter-spacing: -.01em; margin: 2.1em 0 .55em; }
h3 { font-size: 1.08rem; line-height: 1.35; margin: 1.6em 0 .4em; }
article p, article li { color: var(--fg); }
article p { margin: 0 0 1em; }
article ul, article ol { padding-left: 1.3em; margin: 0 0 1.2em; }
article li { margin: 0 0 .45em; }
article li::marker { color: var(--faint); }
.muted { color: var(--muted) !important; }

.cta {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
  padding: 22px 24px; margin: 1.6em 0 1.2em;
}
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .88rem; color: var(--muted); margin: 1em 0 0; }
.cta .note { font-size: .88rem; color: var(--muted); margin: .7em 0 0; }

ol.steps { counter-reset: step; list-style: none; padding: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 46px; margin: 0 0 1em; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: .05em; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font: 650 .9rem/1 var(--sans); color: var(--accent); background: var(--bg-2); border: 1px solid var(--line);
}

.callout { border-left: 3px solid var(--accent); background: var(--bg-2); border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 1.4em 0; }
.callout p:last-child { margin-bottom: 0; }

.table-wrap:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-wrap { overflow-x: auto; margin: 1.2em 0 1.4em; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: .92rem; line-height: 1.45; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line-2); }
thead th { font-weight: 650; background: var(--bg-2); }
tbody th { font-weight: 600; color: var(--muted); width: 26%; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
td.us { background: color-mix(in srgb, var(--accent) 7%, transparent); }
/* phones: the row labels stay put while the columns scroll under them */
th[scope="row"], thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); }
thead th:first-child { background: var(--bg-2); }
@media (max-width: 560px) { tbody th { width: auto; min-width: 118px; } table { min-width: 600px; } }

/* ---------- FAQ (same markup as the landing: scripts/landing_seo.py parses it) ---------- */
.faq-list { display: grid; gap: 10px; margin: 1em 0 0; }
.qa { background: var(--card); border: 1px solid var(--line); border-radius: 14px; scroll-margin-top: 80px; }
.qa summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-radius: 14px; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 { margin: 0; font-size: 1.02rem; font-weight: 600; line-height: 1.35; flex: 1; }
.qa summary::after { content: "+"; content: "+" / ""; flex: none; font: 500 1.3rem/1 var(--sans); color: var(--faint); transition: transform .2s ease; }
.qa[open] summary::after { transform: rotate(45deg); }
.qa .ans { padding: 0 20px 16px; color: var(--muted); line-height: 1.6; }
.qa .ans p { margin: 0 0 .6em; color: var(--muted); }
.qa .ans p:last-child { margin-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .qa summary::after { transition: none; } .btn { transition: none; } }

/* ---------- related guides ---------- */
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 1em 0 0; padding: 0; list-style: none; }
.related a {
  display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); color: var(--fg); text-decoration: none;
}
.related a:hover { border-color: var(--accent); }
.related b { display: block; font-weight: 650; margin-bottom: 2px; }
.related span { font-size: .88rem; color: var(--muted); line-height: 1.45; }

footer { border-top: 1px solid var(--line); margin-top: 56px; padding: 30px 0; color: var(--muted); font-size: .88rem; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot-in nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.foot-in nav a { color: var(--muted); }

@media (max-width: 560px) {
  .wrap { padding: 0 16px; }
  .cta { padding: 18px; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .lead { font-size: 1.08rem; }
}

/* ---------- changelog (/ru/changelog/: releases between the changelog markers — scripts/landing_changelog.py) ---------- */
.versions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 .6em; padding: 0; list-style: none; }
.versions li { margin: 0; }
.versions a {
  display: inline-block; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--muted); font: 600 .86rem/1.4 var(--mono);
}
.versions a:hover { color: var(--fg); border-color: var(--accent); text-decoration: none; }
.release { border-top: 1px solid var(--line); margin-top: 2.4em; padding-top: .2em; scroll-margin-top: 70px; }
.release h2 { margin-top: .9em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.release h2 time { font: 500 .95rem/1.4 var(--sans); letter-spacing: 0; color: var(--faint); }
.release .notes h3:first-child { margin-top: .9em; }
.changelog > .muted { margin-top: 2.4em; font-size: .92rem; }
