/* ===========================================================
   AutoAtlas — main stylesheet
   =========================================================== */
:root {
  --bg: #0c0e12;
  --bg-2: #12151b;
  --card: #161a21;
  --card-2: #1c212a;
  --line: #262c37;
  --text: #e9ecf1;
  --muted: #9aa4b2;
  --accent: #ff5a1f;
  --accent-2: #ffb020;
  --accent-soft: rgba(255, 90, 31, .12);
  --good: #3ecf8e;
  --bad: #ff5d6c;
  --info: #4ea1ff;
  --glass: #7fb3e6;
  --wheel: #2a2f38;
  --hub: #aab3c0;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --font: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-head: 'Oswald', 'Manrope', system-ui, sans-serif;
  --maxw: 1200px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-2: #eef0f4;
  --card: #ffffff;
  --card-2: #f3f5f8;
  --line: #dde2ea;
  --text: #15181e;
  --muted: #5b6574;
  --accent: #e8480f;
  --accent-2: #c77800;
  --accent-soft: rgba(232, 72, 15, .09);
  --good: #13925a;
  --bad: #d4283a;
  --info: #1f6fd1;
  --glass: #a9cdf0;
  --wheel: #2a2f38;
  --hub: #c9d0da;
  --shadow: 0 8px 24px rgba(20, 30, 50, .08);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.7 var(--font); overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-2); }
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; line-height: 1.2; letter-spacing: .01em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.2em; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font: 600 1.45rem/1 var(--font-head); letter-spacing: .02em; }
.logo:hover { color: var(--text); }
.logo b { color: var(--accent); font-weight: 600; }
.logo-mark { width: 30px; height: 30px; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); font-weight: 800; font-size: .85rem; cursor: pointer; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { border-color: var(--accent); }
.lang-menu summary .ic { color: var(--accent); }
.lang-menu ul { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); min-width: 190px; list-style: none; margin: 0; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 60; }
.lang-menu li a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.lang-menu li a b { display: inline-block; min-width: 28px; font-size: .75rem; color: var(--muted); }
.lang-menu li a:hover { background: var(--card-2); }
.lang-menu li a.on { background: var(--accent-soft); color: var(--accent); }
.lang-menu li a.on b { color: var(--accent); }
.theme-toggle { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; }
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle .i-moon { display: none; }
[data-theme="light"] .theme-toggle .i-sun { display: none; }
[data-theme="light"] .theme-toggle .i-moon { display: block; }

.tabs { border-top: 1px solid var(--line); }
.tabs-inner { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-top: 6px; padding-bottom: 6px; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
.tabs-inner::-webkit-scrollbar { display: none; }
.tab { flex: none; white-space: nowrap; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .9rem; padding: 7px 12px; border-radius: 999px; transition: background .15s, color .15s; }
.tab:hover { color: var(--text); background: var(--card); }
.tab.on { color: #fff; background: var(--accent); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; font-weight: 800; text-decoration: none; padding: 12px 20px; border-radius: 12px; border: 0; cursor: pointer; font-family: var(--font); font-size: 1rem; }
.btn:hover { background: var(--accent-2); color: #111; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { border-color: var(--accent); color: var(--text); }

/* ---------- home hero ---------- */
.hero { position: relative; min-height: min(80vh, 640px); display: flex; align-items: flex-end; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(8,9,12,.92) 0%, rgba(8,9,12,.65) 45%, rgba(8,9,12,.1) 100%), linear-gradient(0deg, rgba(8,9,12,.85) 0%, transparent 40%); }
.hero-inner { position: relative; z-index: 1; padding-top: 80px; padding-bottom: 56px; color: #f2f4f7; }
.hero h1 { max-width: 14ch; font-size: clamp(2.3rem, 6.5vw, 4.4rem); color: #fff; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { max-width: 560px; font-size: 1.12rem; color: #cfd5de; }
.hero .btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.hero .btn.ghost { color: #fff; border-color: rgba(255,255,255,.3); }
.eyebrow { display: inline-block; font-weight: 800; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 12px; }

.section { padding: 64px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 720px; margin-bottom: 32px; }
.section-head p { color: var(--muted); }

/* ---------- cards ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; }
.card h3 { margin-bottom: .35em; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card .muted, .muted { color: var(--muted); }
a.card { display: block; color: var(--text); text-decoration: none; transition: transform .15s, border-color .15s; }
a.card:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text); }
.card-img { padding: 0; overflow: hidden; }
.card-img img { aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.card-img .card-body { padding: 18px 20px 20px; }
.card-img h3 { display: flex; align-items: center; gap: 8px; }
.card-img p { color: var(--muted); font-size: .95rem; }
.card .ic-wrap { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 12px; }
.card .ic-wrap .ic { width: 24px; height: 24px; }
.tag { display: inline-block; font-size: .75rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin: 0 6px 6px 0; }
.tag.good { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.tag.info { background: color-mix(in srgb, var(--info) 15%, transparent); color: var(--info); }
.tag.warn { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }

.steps { counter-reset: step; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.step { counter-increment: step; }
.step::before { content: counter(step, decimal-leading-zero); display: block; font: 600 2rem/1 var(--font-head); color: var(--accent); margin-bottom: 10px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.stat b { display: block; font: 600 2rem/1.1 var(--font-head); color: var(--accent); }
.stat span { color: var(--muted); font-size: .9rem; }

/* ---------- inner page hero ---------- */
.page-hero { position: relative; padding: 40px 0 36px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.page-hero.has-img { min-height: 380px; display: flex; align-items: flex-end; overflow: hidden; background: #0a0b0e; }
.page-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8,9,12,.95) 0%, rgba(8,9,12,.6) 50%, rgba(8,9,12,.25) 100%); }
.page-hero-inner { position: relative; z-index: 1; }
.page-hero.has-img .page-hero-inner { color: #eef1f5; padding-top: 60px; }
.page-hero.has-img h1 { color: #fff; }
.page-hero .lead { font-size: 1.15rem; max-width: 760px; margin-bottom: .6em; }
.page-hero.has-img .lead { color: #d3d9e1; }
.updated { font-size: .82rem; color: var(--muted); margin: 0; }
.page-hero.has-img .updated { color: #aab3bf; }
.breadcrumbs { font-size: .85rem; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; color: var(--muted); }
.page-hero.has-img .breadcrumbs { color: #b9c1cc; }
.breadcrumbs a { color: inherit; }

/* ---------- article layout ---------- */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; padding-top: 40px; padding-bottom: 40px; }
.layout.no-toc { grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.toc { position: sticky; top: 130px; align-self: start; max-height: calc(100vh - 150px); overflow: auto; font-size: .9rem; }
.toc summary { font: 600 1rem var(--font-head); text-transform: uppercase; letter-spacing: .06em; cursor: pointer; margin-bottom: 8px; list-style: none; }
.toc summary::-webkit-details-marker { display: none; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li a:hover { color: var(--text); }
.toc li a.on { color: var(--accent); border-left-color: var(--accent); }

.prose { min-width: 0; }
.prose > h2 { margin-top: 1.9em; padding-top: .4em; scroll-margin-top: 130px; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.5em; scroll-margin-top: 130px; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .35em; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--text); }
.prose .grid { margin: 1.4em 0; }
.prose .card h3 { margin-top: 0; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { color: var(--muted); font-size: .88rem; margin-top: 8px; }

/* callouts */
.callout { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); margin: 1.5em 0; }
.callout > .ic { color: var(--accent); width: 24px; height: 24px; margin-top: 2px; }
.callout p:last-child { margin: 0; }
.callout.info { background: color-mix(in srgb, var(--info) 10%, transparent); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.callout.info > .ic { color: var(--info); }
.callout.good { background: color-mix(in srgb, var(--good) 10%, transparent); border-color: color-mix(in srgb, var(--good) 30%, transparent); }
.callout.good > .ic { color: var(--good); }

/* pros/cons */
.pc { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin: .8em 0 0; }
.pc ul { list-style: none; padding: 0; margin: 0; font-size: .95rem; }
.pc li { position: relative; padding-left: 22px; margin-bottom: .3em; }
.pc .pro li::before { content: "+"; position: absolute; left: 0; color: var(--good); font-weight: 800; }
.pc .con li::before { content: "−"; position: absolute; left: 0; color: var(--bad); font-weight: 800; }
.pc h4 { font-family: var(--font); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 6px; color: var(--muted); }

/* tables */
.table-wrap { overflow-x: auto; margin: 1.4em 0; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; min-width: 560px; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--card-2); font-weight: 800; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--card) 60%, transparent); }

/* car silhouettes */
.car-svg { width: 100%; height: auto; max-width: 260px; display: block; margin: 0 auto 12px; }
.car-svg .b { fill: var(--accent); }
.car-svg .g { fill: var(--glass); opacity: .85; }
.car-svg .w { fill: var(--wheel); stroke: var(--card); stroke-width: 4; }
.car-svg .h { fill: var(--hub); }
.car-svg .gr { stroke: var(--line); stroke-width: 2; }
.body-card { display: flex; flex-direction: column; }
.car-wrap { background: var(--card-2); border-radius: 10px; padding: 18px 12px 6px; margin-bottom: 14px; }
.car-wrap .car-svg { margin-bottom: 0; }
.car-wrap .car-svg .w { stroke: var(--card-2); }
.examples { font-size: .88rem; color: var(--muted); margin-top: auto; padding-top: 8px; }
.examples b { color: var(--text); }

/* FAQ */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 700; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 18px 16px; color: var(--muted); }
.faq details > div p:last-child { margin: 0; }

/* tools (converter, quiz, filters) */
.tool { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 1.6em 0; box-shadow: var(--shadow); }
.tool h3 { display: flex; align-items: center; gap: 10px; margin-top: 0; }
.tool h3 .ic { color: var(--accent); }
.tool-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.field label { display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, input.search {
  width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 12px; font: 600 1.05rem var(--font);
}
.field input:focus, input.search:focus { border-color: var(--accent); outline: none; }
.tool .note { font-size: .85rem; color: var(--muted); margin: 12px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 1em 0 1.2em; }
.chip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 14px; font: 700 .88rem var(--font); cursor: pointer; }
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
[hidden] { display: none !important; }

.quiz fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.quiz legend { font-weight: 800; margin-bottom: 8px; }
.quiz .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.quiz .opts label { cursor: pointer; }
.quiz .opts input { position: absolute; opacity: 0; pointer-events: none; }
.quiz .opts span { display: inline-block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 14px; font-weight: 600; font-size: .95rem; background: var(--bg); }
.quiz .opts input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.quiz .opts input:focus-visible + span { outline: 2px solid var(--accent); }
.quiz-result { margin-top: 18px; padding: 18px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.quiz-result h4 { font-family: var(--font-head); font-size: 1.3rem; margin: 0 0 6px; }
.quiz-result .car-svg { max-width: 220px; margin: 0 0 10px; }
.quiz-result .car-svg .w { stroke: var(--bg); }

/* glossary */
.glossary { margin: 1em 0; }
.glossary .term { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); }
.glossary dt { font-weight: 800; font-size: 1.05rem; }
.glossary dt small { color: var(--muted); font-weight: 600; margin-left: 6px; }
.glossary dd { margin: 4px 0 0; color: var(--muted); }
.letter { font: 600 1.6rem var(--font-head); color: var(--accent); margin: 1.2em 0 0; }

/* brands */
.brand-card h3 { margin-bottom: 2px; }
.brand-card .meta { font-size: .82rem; color: var(--muted); margin-bottom: 8px; }
.brand-card p { font-size: .94rem; }
.flag { font-size: 1.3rem; margin-right: 4px; }

/* ads */
.ad { margin: 2em 0; text-align: center; min-height: 100px; }
.ad-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 6px; }

/* pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-bottom: 56px; }
.pager-link { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; text-decoration: none; color: var(--text); }
.pager-link:hover { border-color: var(--accent); color: var(--text); }
.pager-link small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; }
.pager-link span { font: 600 1.2rem var(--font-head); }
.pager-link.next { text-align: right; }
.pager-link.next small { justify-content: flex-end; }

/* footer */
.site-footer { background: var(--bg-2); border-top: 1px solid var(--line); padding: 48px 0 24px; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 36px; }
.footer-brand p { color: var(--muted); margin-top: 14px; max-width: 420px; }
.site-footer h2 { font: 700 .8rem var(--font); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 12px; }
.site-footer h2.mt { margin-top: 22px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer li a { color: var(--text); text-decoration: none; }
.site-footer li a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 32px; padding-top: 20px; color: var(--muted); font-size: .84rem; }
.disclaimer { max-width: 820px; }

.to-top { position: fixed; right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 40; }
.to-top .ic { transform: rotate(-90deg); }
.to-top.show { opacity: 1; pointer-events: auto; }

/* 404 + language picker */
.notfound { text-align: center; padding: 20px 0 40px; }
.notfound .car-svg { max-width: 300px; }
.notfound .car-svg .w { stroke: var(--bg); }
.big404 { font: 700 5rem/1 var(--font-head); color: var(--accent); margin: 0 0 10px; }
.lang-picker main { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 40px 16px; }
.lang-picker h1 { font-size: clamp(1.2rem, 3vw, 1.6rem); color: var(--muted); font-family: var(--font); font-weight: 600; margin: 18px 0 28px; }
.logo.big { font-size: 2.6rem; }
.logo.big .logo-mark { width: 48px; height: 48px; }
.lang-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); width: 100%; max-width: 760px; }
.lang-card { display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; text-decoration: none; color: var(--text); }
.lang-card:hover { border-color: var(--accent); color: var(--text); }
.lang-card b { font: 600 2rem var(--font-head); color: var(--accent); }
.lang-card small { color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 24px; }
  .toc { position: static; max-height: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
  .toc summary { margin: 0; }
  .toc details[open] summary { margin-bottom: 10px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  .header-row { height: 54px; }
  .logo { font-size: 1.25rem; }
  .logo-mark { width: 26px; height: 26px; }
  .lang-menu summary { padding: 0 10px; }
  .section { padding: 44px 0; }
  .hero { min-height: 540px; }
  .hero > img { object-position: 75% 50%; }
  .hero::after { background: linear-gradient(0deg, rgba(8,9,12,.95) 0%, rgba(8,9,12,.7) 55%, rgba(8,9,12,.3) 100%); }
  .page-hero.has-img { min-height: 320px; }
  .pager { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ---------- language-specific typography ---------- */
html:lang(zh) {
  --font: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', 'Source Han Sans SC', sans-serif;
  --font-head: 'Manrope', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
}
html:lang(zh) h1, html:lang(zh) h2, html:lang(zh) h3 { font-weight: 800; letter-spacing: 0; }
html:lang(hi) {
  --font: 'Manrope', 'Noto Sans Devanagari', 'Nirmala UI', 'Mangal', sans-serif;
  --font-head: 'Oswald', 'Noto Sans Devanagari', 'Nirmala UI', sans-serif;
}
html:lang(hi) body { line-height: 1.85; }
html:lang(ar) {
  --font: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
  --font-head: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}
html:lang(ar) h1, html:lang(ar) h2, html:lang(ar) h3 { font-weight: 700; }

/* ---------- right-to-left (Arabic) ---------- */
[dir="rtl"] * { letter-spacing: 0 !important; }
[dir="rtl"] .prose ul, [dir="rtl"] .prose ol { padding-left: 0; padding-right: 1.3em; }
[dir="rtl"] .toc ol { border-left: 0; border-right: 2px solid var(--line); }
[dir="rtl"] .toc li a { padding: 5px 14px 5px 0; margin-left: 0; margin-right: -2px; border-left: 0; border-right: 2px solid transparent; }
[dir="rtl"] .toc li a.on { border-right-color: var(--accent); }
[dir="rtl"] .pc li { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .pc .pro li::before, [dir="rtl"] .pc .con li::before { left: auto; right: 0; }
[dir="rtl"] .faq summary { padding: 16px 18px 16px 48px; }
[dir="rtl"] .faq summary::after { right: auto; left: 18px; }
[dir="rtl"] th, [dir="rtl"] td { text-align: right; }
[dir="rtl"] .pager-link.next { text-align: left; }
[dir="rtl"] .pager-link.next small { justify-content: flex-start; }
[dir="rtl"] .hero::after { background: linear-gradient(270deg, rgba(8,9,12,.92) 0%, rgba(8,9,12,.65) 45%, rgba(8,9,12,.1) 100%), linear-gradient(0deg, rgba(8,9,12,.85) 0%, transparent 40%); }
[dir="rtl"] .hero > img { transform: scaleX(-1); }
[dir="rtl"] .tabs-inner { -webkit-mask-image: linear-gradient(270deg, #000 92%, transparent); mask-image: linear-gradient(270deg, #000 92%, transparent); }
[dir="rtl"] .to-top { right: auto; left: 16px; }
[dir="rtl"] .btn .ic, [dir="rtl"] .pager-link .ic { transform: scaleX(-1); }
[dir="rtl"] .glossary dt small { margin-left: 0; margin-right: 6px; }
[dir="rtl"] .skip { left: auto; right: -999px; }
[dir="rtl"] .skip:focus { right: 8px; }
[dir="rtl"] input[type="number"] { direction: ltr; text-align: right; }
@media (max-width: 600px) {
  [dir="rtl"] .hero::after { background: linear-gradient(0deg, rgba(8,9,12,.95) 0%, rgba(8,9,12,.7) 55%, rgba(8,9,12,.3) 100%); }
}

/* ---------- HTML sitemap ---------- */
.sitemap-grid h3 a { color: var(--text); text-decoration: none; }
.sitemap-grid h3 a:hover { color: var(--accent); }
.sitemap-grid .muted { font-size: .92rem; }
.sitemap-grid ul { font-size: .92rem; margin: .4em 0 0; }
.sitemap-grid li { margin-bottom: .2em; }
