/* ==========================================================================
   Справочник ОКАвода — тема okaved
   Свой стек шрифтов, без внешних запросов. Светлая и тёмная темы.

   Mobile-first: базовые правила рассчитаны на телефон, десктопные
   раскладки добавляются медиазапросами от 720px и 960px.
   ========================================================================== */

:root {
    /* Палитра: тёплый янтарь на графите */
    --accent: #c2410c;
    --accent-strong: #9a3412;
    --accent-soft: rgba(194, 65, 12, .10);
    --accent-line: rgba(194, 65, 12, .30);
    --accent-ink: #ffffff;

    --bg: #f6f4f1;
    --surface: #ffffff;
    --surface-2: #efece7;
    --surface-3: #e5e0d9;
    --text: #1b1815;
    --muted: #6d635a;
    --border: #e2ddd4;
    --code-bg: #f0ece7;

    --shadow-sm: 0 1px 2px rgba(28, 22, 16, .07);
    --shadow: 0 1px 2px rgba(28, 22, 16, .05), 0 8px 24px rgba(28, 22, 16, .07);
    --shadow-lg: 0 2px 6px rgba(28, 22, 16, .08), 0 24px 60px rgba(28, 22, 16, .16);

    --radius: 14px;
    --radius-sm: 9px;
    --radius-lg: 20px;

    --gutter: 16px;
    --wrap: 1200px;
    --read: 68ch;

    --header-h: 56px;
    --tabbar-h: 56px;
    --tap: 44px;

    --fs-xs: .75rem;
    --fs-sm: .8125rem;
    --fs-base: 1rem;
    --fs-md: 1.0625rem;
    --fs-lg: clamp(1.08rem, 1rem + .45vw, 1.25rem);
    --fs-xl: clamp(1.3rem, 1.15rem + .8vw, 1.65rem);
    --fs-2xl: clamp(1.55rem, 1.3rem + 1.4vw, 2.1rem);
    --fs-3xl: clamp(1.95rem, 1.5rem + 2.4vw, 3rem);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
    --accent: #f97316;
    --accent-strong: #fb923c;
    --accent-soft: rgba(249, 115, 22, .14);
    --accent-line: rgba(249, 115, 22, .34);
    --accent-ink: #16181b;

    --bg: #14161a;
    --surface: #1b1e23;
    --surface-2: #23272e;
    --surface-3: #2b3038;
    --text: #f2f3f5;
    --muted: #9aa2ad;
    --border: #2c313a;
    --code-bg: #22262d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .40);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 10px 28px rgba(0, 0, 0, .35);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, .45), 0 28px 70px rgba(0, 0, 0, .55);
}

*, *::before, *::after { box-sizing: border-box; }

/* Атрибут hidden должен побеждать любые display из правил ниже. */
[hidden] { display: none !important; }

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 12px);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.is-locked { overflow: hidden; }

img { max-width: 100%; height: auto; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    border-radius: 6px;
}

code, pre, kbd { font-family: var(--font-mono); font-size: .92em; }
code { background: var(--code-bg); padding: .12em .38em; border-radius: 5px; overflow-wrap: anywhere; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; left: -9999px; top: 0; z-index: 200;
    background: var(--accent); color: var(--accent-ink);
    padding: .7rem 1.1rem; border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 600; text-decoration: none;
}
.skip-link:focus { left: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.icon {
    width: 20px; height: 20px;
    fill: none; stroke: currentColor; stroke-width: 1.9;
    stroke-linecap: round; stroke-linejoin: round;
    flex: none;
}

/* --- Шапка ----------------------------------------------------------- */

.site-header {
    position: sticky; top: 0; z-index: 60;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
}

.header-inner {
    display: flex; align-items: center; gap: 10px;
    min-height: var(--header-h);
}

.brand {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: inherit;
    min-width: 0;
}
.brand-mark {
    display: grid; place-items: center;
    width: 36px; height: 36px; border-radius: 11px;
    background: linear-gradient(140deg, var(--accent), var(--accent-strong));
    color: var(--accent-ink);
    font-weight: 800; font-size: 12px; letter-spacing: .02em;
    box-shadow: 0 3px 10px var(--accent-soft);
    flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong {
    font-size: 15px; font-weight: 700; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-text small {
    color: var(--muted); font-size: 11.5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* На узких экранах подзаголовок места занимает больше, чем пользы. */
@media (max-width: 399px) {
    .brand-text small { display: none; }
}

.main-nav { display: none; }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; order: 3; }

.icon-btn {
    display: grid; place-items: center;
    width: var(--tap); height: var(--tap); padding: 0;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.96); }

.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Полоса прогресса чтения — по нижней кромке шапки. */
.progress-track {
    position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px; background: transparent; pointer-events: none;
}
.progress-track span {
    display: block; height: 100%; width: 0;
    background: var(--accent);
    transition: width .1s linear;
}

/* --- Поиск ----------------------------------------------------------- */

.search { position: relative; }

.search-form { position: relative; display: flex; align-items: center; }

.search-form > .icon {
    position: absolute; left: 12px; top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    stroke: var(--muted); stroke-width: 2; stroke-linecap: round;
    pointer-events: none; z-index: 1;
}

.search-form input {
    flex: 1 1 auto; min-width: 0;
    width: 100%; height: var(--tap); padding: 0 38px 0 38px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 15px;
    -webkit-appearance: none; appearance: none;
}
.search-form input::placeholder { color: var(--muted); opacity: .8; }
.search-form input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.search-form input::-webkit-search-cancel-button { display: none; }

.search-clear {
    position: absolute; right: 6px; z-index: 1;
    width: 28px; height: 28px; padding: 0;
    border: 0; border-radius: 50%; background: var(--surface-2);
    color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1;
}
.search-clear:hover { color: var(--text); }

.search-results {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 70;
    max-height: 68vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px;
}
.search-results a {
    display: block; padding: 9px 11px; border-radius: var(--radius-sm);
    color: inherit; text-decoration: none;
}
.search-results a:hover, .search-results a.is-active { background: var(--surface-2); }
.search-results .r-title { display: block; font-size: 14.5px; font-weight: 600; }
.search-results .r-meta { display: block; color: var(--muted); font-size: 12.5px; }
.search-results .r-meta code { background: none; padding: 0; color: var(--accent); }
.search-results .r-empty { padding: 12px; color: var(--muted); font-size: 14px; margin: 0; }

/* На телефоне поиск свёрнут в кнопку шапки, а по нажатию выпадает
   строкой прямо под шапкой — так он не занимает место в залипающей
   шапке и остаётся на всю ширину экрана. */
.header-search { display: none; }

.header-search.is-open {
    display: block;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
    padding: 10px var(--gutter);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
}

/* --- Меню-шторка ----------------------------------------------------- */

.nav-sheet {
    position: fixed; inset: 0; z-index: 90;
    display: flex; align-items: flex-end;
    visibility: hidden; pointer-events: none;
}
.nav-sheet.is-open { visibility: visible; pointer-events: auto; }

.nav-sheet-backdrop {
    position: absolute; inset: 0;
    background: rgba(16, 12, 8, .55);
    opacity: 0; transition: opacity .25s ease;
}
.nav-sheet.is-open .nav-sheet-backdrop { opacity: 1; }

.nav-sheet-panel {
    position: relative;
    width: 100%; max-height: 88vh; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--surface);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: var(--shadow-lg);
    padding: 10px var(--gutter) calc(18px + env(safe-area-inset-bottom));
    transform: translateY(102%);
    transition: transform .28s cubic-bezier(.32, .72, 0, 1);
}
.nav-sheet.is-open .nav-sheet-panel { transform: translateY(0); }

.nav-sheet-grip {
    width: 40px; height: 4px; border-radius: 2px;
    background: var(--border); margin: 0 auto 12px;
}

.nav-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 6px;
}
.nav-sheet-head strong { font-size: var(--fs-lg); letter-spacing: -.01em; }

.nav-sheet ul { list-style: none; margin: 0; padding: 0; }

.nav-sheet-link {
    display: flex; align-items: center; gap: 14px;
    min-height: 54px; padding: 6px 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text); text-decoration: none;
    font-size: var(--fs-lg); font-weight: 600;
}
.nav-sheet-link:last-child { border-bottom: 0; }
.nav-sheet-link .icon { width: 22px; height: 22px; color: var(--accent); }
.nav-sheet-link .sheet-sub {
    display: block; font-size: var(--fs-sm); font-weight: 400; color: var(--muted);
}
.nav-sheet-link[aria-current="page"] { color: var(--accent); }

.nav-sheet-theme {
    width: 100%; margin-top: 14px; justify-content: flex-start;
}
.nav-sheet-theme .icon { flex: none; }

.nav-sheet-note {
    margin: 14px 0 0; padding: 12px 14px;
    background: var(--surface-2); border-radius: var(--radius-sm);
    color: var(--muted); font-size: var(--fs-sm);
}
.nav-sheet-note a { color: var(--accent); }

/* --- Нижняя панель (мобильная навигация) ----------------------------- */

.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    display: flex;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-item {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px;
    min-height: var(--tabbar-h);
    padding: 5px 2px 4px;
    border: 0; background: none;
    color: var(--muted); text-decoration: none;
    font: inherit; font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color .15s ease;
}
.tabbar-item .icon { width: 22px; height: 22px; }
.tabbar-item[aria-current="page"], .tabbar-item.is-active { color: var(--accent); }
.tabbar-item:active { transform: scale(.94); }

/* --- Кнопка «наверх» ------------------------------------------------- */

.to-top {
    position: fixed; right: 14px; z-index: 75;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
    display: grid; place-items: center;
    width: 46px; height: 46px; padding: 0;
    border: 1px solid var(--border); border-radius: 50%;
    background: var(--surface); color: var(--accent);
    box-shadow: var(--shadow);
    cursor: pointer;
    opacity: 0; visibility: hidden; transform: translateY(10px) scale(.9);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    -webkit-tap-highlight-color: transparent;
}
.to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--surface-2); }

/* --- Общее ----------------------------------------------------------- */

.site-main {
    padding: 20px 0 28px;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px);
}

h1, h2, h3, h4 { line-height: 1.22; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: var(--fs-2xl); margin: .2em 0 .4em; }
h2 { font-size: var(--fs-xl); margin: 1.5em 0 .5em; }
h3 { font-size: var(--fs-lg); margin: 1.3em 0 .35em; }

.lead { color: var(--muted); font-size: var(--fs-md); margin: 0 0 1.1em; }
.muted { color: var(--muted); }

.page-head { margin-bottom: 18px; }

.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; margin: 2em 0 .8em;
}
.section-head h2 { margin: 0; }
.section-head .section-more {
    display: inline-flex; align-items: center;
    min-height: 40px; padding: 0 2px;
    font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
    text-decoration: none; color: var(--accent);
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--tap); padding: 0 18px;
    border-radius: var(--radius-sm);
    background: var(--accent); color: var(--accent-ink); text-decoration: none;
    font-size: 15px; font-weight: 600; border: 1px solid transparent;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
    transition: filter .15s ease, background .15s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { filter: brightness(.94); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); filter: none; }

.breadcrumbs { margin: 0 0 14px; font-size: var(--fs-sm); color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--border); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }

/* --- Текст ----------------------------------------------------------- */

.prose, .article-body { max-width: var(--read); font-size: var(--fs-md); }
.prose h2, .article-body h2 { scroll-margin-top: calc(var(--header-h) + 16px); }
.prose h3, .article-body h3 { scroll-margin-top: calc(var(--header-h) + 16px); }
.prose img, .article-body img {
    display: block; margin: 1.3em auto; border-radius: var(--radius);
    box-shadow: var(--shadow); background: var(--surface-2);
}
.prose figure, .article-body figure { margin: 1.5em 0; }
.prose figcaption, .article-body figcaption {
    text-align: center; color: var(--muted); font-size: var(--fs-sm);
    font-style: italic; margin-top: -.5em;
}
.prose blockquote, .article-body blockquote {
    margin: 1.3em 0; padding: 6px 16px;
    border-left: 3px solid var(--accent); color: var(--muted);
}
.prose ul, .article-body ul, .prose ol, .article-body ol { padding-left: 1.3em; }
.prose li, .article-body li { margin: .3em 0; }
.prose hr, .article-body hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.prose table, .article-body table {
    width: 100%; max-width: 100%; border-collapse: collapse;
    margin: 1.3em 0; font-size: 14.5px;
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.prose th, .article-body th, .prose td, .article-body td {
    border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top;
}
.prose th, .article-body th { background: var(--surface-2); font-weight: 700; }
.prose a, .article-body a { overflow-wrap: anywhere; }

/* --- Главная --------------------------------------------------------- */

/* Фон — фотография машины; поверх — плотное затемнение слева, где текст. */
.hero {
    position: relative; overflow: hidden;
    margin: -20px 0 0;
    padding: 34px 0 30px;
    background-color: #101216;
    background-image: url("/user/media/hero-oka-1920.webp");
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
    color: #f4f5f6;
}
.hero::before {
    content: ""; position: absolute; inset: 0; z-index: 0;
    background:
        linear-gradient(100deg,
            rgba(10, 12, 16, .96) 0%,
            rgba(10, 12, 16, .93) 28%,
            rgba(10, 12, 16, .80) 50%,
            rgba(10, 12, 16, .55) 76%,
            rgba(10, 12, 16, .40) 100%),
        radial-gradient(60% 130% at 84% 34%, rgba(234, 88, 12, .30), transparent 62%);
    pointer-events: none;
}
.hero::after {
    content: ""; position: absolute; z-index: 0;
    bottom: -60%; left: -30%;
    width: 70vw; height: 70vw; max-width: 520px; max-height: 520px;
    background: radial-gradient(circle, rgba(249, 115, 22, .20), transparent 65%);
    pointer-events: none;
}
.hero-inner {
    position: relative; z-index: 1;
    max-width: var(--wrap); margin: 0 auto;
    padding: 0 var(--gutter);
}

.hero-eyebrow {
    display: inline-block; margin: 0 0 12px;
    padding: 4px 12px; border-radius: 999px;
    background: rgba(249, 115, 22, .16);
    border: 1px solid rgba(249, 115, 22, .34);
    color: #fdba74;
    font-size: var(--fs-xs); font-weight: 700;
    letter-spacing: .09em; text-transform: uppercase;
}
.hero-title {
    margin: 0 0 .3em;
    font-size: var(--fs-3xl);
    letter-spacing: -.025em;
}
.hero-lead {
    max-width: 46ch; margin: 0 0 20px;
    color: #c3c9d2; font-size: var(--fs-md);
}

.hero-search {
    display: flex; gap: 8px;
    max-width: 560px;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: var(--radius);
    padding: 6px;
}
.hero-search input {
    flex: 1 1 auto; min-width: 0;
    height: 44px; padding: 0 14px;
    border: 0; border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 15px;
    -webkit-appearance: none; appearance: none;
}
.hero-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.hero-search .btn { height: 44px; flex: none; padding: 0 20px; }
.hero-search .btn:hover { filter: brightness(1.1); }

.hero-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; margin-top: 22px; max-width: 560px;
}
.hero-stat {
    padding: 11px 12px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: var(--radius-sm);
}
.hero-stat b {
    display: block; font-size: var(--fs-xl); font-weight: 800;
    color: #fb923c; line-height: 1.15;
}
.hero-stat span {
    display: block; margin-top: 2px;
    color: #aab2bd; font-size: var(--fs-xs); line-height: 1.3;
}

/* --- Плитки ---------------------------------------------------------- */

.tile-grid {
    display: grid; gap: 10px;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
}

.tile {
    display: flex; flex-direction: column; gap: 4px;
    padding: 15px 16px;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: inherit; text-decoration: none;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.tile:hover {
    transform: translateY(-2px);
    border-color: var(--accent-line);
    box-shadow: var(--shadow);
}
.tile-title {
    display: flex; align-items: center; gap: 9px;
    font-weight: 700; font-size: var(--fs-md); letter-spacing: -.01em;
    color: var(--text);
}
.tile-title .icon { color: var(--accent); }
.tile-sub { color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.tile-arrow {
    margin-top: 4px; color: var(--accent);
    font-size: var(--fs-sm); font-weight: 700;
}

/* --- Каталог: дерево-ориентир --------------------------------------- */

.cat-model {
    display: grid; gap: 16px;
    margin: 0 0 18px; padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
}
.cat-model-text { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.55; }

.cat-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-stat {
    padding: 9px 12px;
    background: var(--surface-2); border-radius: var(--radius-sm);
}
.cat-stat b {
    display: block; font-size: var(--fs-xl); font-weight: 800;
    line-height: 1.1; color: var(--accent);
}
.cat-stat span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.25; }
.cat-stat-muted { background: transparent; border: 1px dashed var(--border); }
.cat-stat-muted b { color: var(--muted); }

/* --- Панель каталога ------------------------------------------------ */

.cat-panel {
    position: sticky; top: var(--header-h); z-index: 25;
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 10px 0; margin-bottom: 6px;
    background: var(--bg);
}

.cat-search { position: relative; flex: 1 1 100%; }
.cat-search > .icon {
    position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; stroke: var(--muted); stroke-width: 2;
    stroke-linecap: round; pointer-events: none;
}
.cat-search input {
    width: 100%; height: var(--tap); padding: 0 12px 0 35px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    font: inherit; font-size: 15px; -webkit-appearance: none; appearance: none;
}
.cat-search input:focus {
    border-color: var(--accent); outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.cat-panel-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-toggle {
    min-height: 38px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: 999px;
    background: var(--surface); color: var(--muted);
    font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    transition: background .14s ease, color .14s ease, border-color .14s ease;
}
.cat-toggle:hover { background: var(--surface-2); color: var(--text); }
.cat-toggle[aria-pressed="true"] {
    background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent);
}

.cat-hint { color: var(--muted); padding: 20px 0; }

/* --- Дерево ---------------------------------------------------------- */

.cat-tree { padding-bottom: 20px; }

.cat-section { border-bottom: 1px solid var(--border); }
.cat-section:last-child { border-bottom: 0; }

.cat-section-head { margin: 0; }
.cat-toggle-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; min-height: 52px;
    padding: 8px 4px; border: 0; background: none;
    color: inherit; font: inherit; text-align: left;
    cursor: pointer;
}
.cat-toggle-btn:hover .cat-section-title { color: var(--accent); }

.cat-caret {
    flex: none; width: 0; height: 0;
    border-left: 6px solid currentColor;
    border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent;
    opacity: .45; transition: transform .18s ease;
}
.cat-toggle-btn[aria-expanded="true"] .cat-caret { transform: rotate(90deg); }

.cat-section-title {
    flex: 1 1 auto; min-width: 0;
    font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.015em;
}

.cat-count {
    flex: none; min-width: 30px; padding: 2px 9px;
    border-radius: 999px;
    background: var(--surface-2); color: var(--muted);
    font-size: 12px; font-weight: 700; text-align: center;
}
.cat-section-head .cat-count { background: var(--accent-soft); color: var(--accent); }

/* --- Группы ---------------------------------------------------------- */

.cat-section-body { padding: 0 0 14px; }

.cat-group { border-top: 1px solid var(--border); }
.cat-group-head { min-height: 44px; padding-left: 12px; }
.cat-group-title {
    flex: 1 1 auto; min-width: 0;
    font-size: 15px; font-weight: 600; color: var(--text);
}
.cat-group-body { padding: 0 0 10px 22px; }

/* --- Позиции каталога ВАЗ ------------------------------------------- */

.cat-item {
    padding: 8px 0;
    border-top: 1px dashed var(--border);
}
.cat-item:first-child { border-top: 0; }

.cat-item-title {
    font-size: 13.5px; font-weight: 600; color: var(--muted);
    letter-spacing: .01em;
}
.cat-item.is-empty .cat-item-title { font-weight: 500; opacity: .75; }
.cat-item.has-parts .cat-item-title { color: var(--text); }

/* --- Строка детали --------------------------------------------------- */

.cat-part {
    display: flex; align-items: center; gap: 10px;
    margin: 4px 0 0; padding: 6px 10px 6px 6px;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    text-decoration: none; color: inherit;
    transition: background .14s ease, border-color .14s ease;
}
.cat-part:hover { background: var(--surface); border-color: var(--border); }

.cat-part-photo {
    flex: none; width: 40px; height: 40px;
    border-radius: 7px; background: var(--surface-2);
    object-fit: contain; padding: 3px;
}
.cat-part-photo.is-empty {
    background: repeating-linear-gradient(45deg,
        var(--surface-2), var(--surface-2) 4px, transparent 4px, transparent 8px);
    border: 1px dashed var(--border);
}

.cat-part-title {
    flex: 1 1 auto; min-width: 0;
    font-size: 14.5px; font-weight: 500; line-height: 1.35;
}

.cat-part-article {
    flex: none; max-width: 42%;
    font-family: var(--font-mono); font-size: 12px;
    color: var(--muted); text-align: right;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cat-part-alt {
    flex: none; padding: 1px 8px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 11px; font-weight: 700; white-space: nowrap;
}

.cat-part-go { flex: none; color: var(--accent); font-weight: 700; }

/* В режиме «весь каталог ВАЗ» показываем и пустые позиции */
.cat-tree[data-full="0"] .cat-item.is-empty { display: none; }
.cat-tree[data-full="0"] .cat-group:has(.cat-item.is-empty:not(:only-child)) { }
.cat-tree[data-full="0"] .cat-group:not(:has(.cat-item.has-parts)) { display: none; }

/* --- Плоский список -------------------------------------------------- */

.cat-flat {
    margin: 24px 0 0; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.cat-flat summary {
    cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted);
}
.cat-flat-list { margin: 12px 0 0; padding-left: 1.4em; }
.cat-flat-list li { margin: .35em 0; font-size: 14px; }
.cat-flat-list code {
    font-family: var(--font-mono); font-size: 12px; color: var(--muted);
    margin-left: 6px;
}
.cat-flat-path {
    display: block; color: var(--muted); font-size: 12px;
}

/* --- Карточка детали (блок «Похожие детали») ------------------------- */

.part-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }

.part-card {
    position: relative;
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.part-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-line);
    box-shadow: var(--shadow);
    cursor: pointer;
}

.part-photo {
    position: relative; aspect-ratio: 4 / 3;
    background: var(--surface-2);
    display: grid; place-items: center; overflow: hidden;
}
.part-photo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; mix-blend-mode: multiply; }
:root[data-theme="dark"] .part-photo img { mix-blend-mode: normal; }

.part-placeholder {
    display: grid; place-items: center;
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--surface); color: var(--muted); opacity: .5;
}
.part-placeholder .icon { width: 26px; height: 26px; stroke-width: 1.5; }

.part-nophoto {
    position: absolute; left: 7px; bottom: 7px;
    padding: 1px 7px; border-radius: 999px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    color: var(--muted); font-size: 10px; font-weight: 600;
}

.part-body {
    display: flex; flex-direction: column; gap: 4px;
    padding: 9px 11px 11px; flex: 1 1 auto;
}
.part-group {
    color: var(--muted); font-size: 10.5px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.part-title { margin: 0; font-size: .95rem; line-height: 1.32; font-weight: 600; }
.part-title a { color: inherit; text-decoration: none; }
.part-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.part-title a:hover { color: var(--accent); }
.part-article code {
    font-size: 12px; padding: 2px 6px; cursor: copy;
    position: relative; z-index: 2;
}
.part-models { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.part-alt { color: var(--muted); font-size: 11.5px; font-weight: 600; }
.part-alt-none { opacity: .7; font-weight: 500; }
.part-foot {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-top: auto; padding-top: 7px;
}
.part-more { color: var(--accent); font-size: 12px; font-weight: 700; white-space: nowrap; }

/* --- Карточка детали ------------------------------------------------- */

.part-layout {
    display: grid; grid-template-columns: 1fr; gap: 22px;
    align-items: start;
}

.part-gallery { position: sticky; top: calc(var(--header-h) + 16px); }

.part-gallery-main {
    margin: 0; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
    aspect-ratio: 1 / 1;
    display: grid; place-items: center;
}
.part-gallery-main img {
    width: 100%; height: 100%; object-fit: contain; padding: 16px;
    mix-blend-mode: multiply;
}
:root[data-theme="dark"] .part-gallery-main img { mix-blend-mode: normal; }

.part-gallery-empty {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    background: var(--surface-2);
}
.part-gallery-empty .part-placeholder { width: 84px; height: 84px; }
.part-gallery-empty .part-placeholder .icon { width: 42px; height: 42px; }
.part-gallery-empty .part-nophoto { position: static; background: none; }

.part-thumbs {
    display: flex; gap: 8px; margin-top: 8px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
.part-thumb {
    flex: none; width: 64px; height: 64px; padding: 0;
    border: 2px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); cursor: pointer; overflow: hidden;
}
.part-thumb.is-active { border-color: var(--accent); }
.part-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }

.part-info { min-width: 0; }
.part-info h1 { margin: 4px 0 .5em; }
.part-info .part-group { margin-bottom: 2px; }
.part-info .label {
    display: inline-block; min-width: 132px;
    color: var(--muted); font-size: var(--fs-xs);
    text-transform: uppercase; letter-spacing: .05em;
}
.part-info .part-article { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.part-info .part-article code {
    font-size: 17px; padding: 5px 11px; cursor: copy;
    font-weight: 600;
}
.part-apply { margin-top: 12px; }
.part-apply .part-models { margin-top: 5px; }

.part-block {
    margin: 26px 0 0; padding-top: 20px;
    border-top: 1px solid var(--border);
}
.part-block h2 { margin: 0 0 12px; font-size: var(--fs-lg); }

.part-empty { color: var(--muted); margin: 0; }

/* --- Чем заменить ---------------------------------------------------- */

.variant-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

.variant {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 13px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.variant-tier {
    flex: none;
    padding: 3px 9px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    background: var(--surface-2); color: var(--muted);
}
.tier-original { background: rgba(22, 163, 74, .14); color: #15803d; }
.tier-quality { background: var(--accent-soft); color: var(--accent); }
.tier-budget { background: var(--surface-2); color: var(--muted); }
:root[data-theme="dark"] .tier-original { background: rgba(34, 197, 94, .16); color: #4ade80; }

.variant-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.variant-article { font-size: 15px; font-weight: 600; }
.variant-brand { color: var(--text); font-size: 14px; }
.variant-note { color: var(--muted); font-size: 13px; }

/* --- Что лучше покупать ---------------------------------------------- */

.part-advice {
    margin: 24px 0 0; padding: 16px 18px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    border-radius: var(--radius);
}
.part-advice h2 {
    display: flex; align-items: center; gap: 9px;
    margin: 0 0 8px; font-size: var(--fs-lg);
    color: var(--accent);
}
.part-advice h2 .icon { width: 20px; height: 20px; }
.part-advice-body { color: var(--text); font-size: 15px; }
.part-advice-body p { margin: 0 0 .6em; }
.part-advice-body p:last-child { margin-bottom: 0; }
.part-advice-body ul, .part-advice-body ol { margin: .4em 0; padding-left: 1.2em; }

.part-notes-body, .part-analogs-text { color: var(--text); font-size: 15px; }
.part-analogs-text { color: var(--muted); }

/* --- Похожие детали -------------------------------------------------- */

.part-related { margin: 36px 0 8px; }
.part-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* --- Статья ---------------------------------------------------------- */

.article { max-width: var(--wrap); }
.article-head { margin-bottom: 1.2em; }
.article-date { color: var(--muted); font-size: var(--fs-sm); }
.article-body { max-width: var(--read); }

.article-foot {
    display: flex; flex-wrap: wrap; gap: 10px;
    margin-top: 2.2em; padding-top: 1.3em;
    border-top: 1px solid var(--border);
}

.toc {
    margin: 1.8em 0; padding: 12px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius);
}
.toc summary {
    cursor: pointer; font-size: var(--fs-xs); font-weight: 700;
    text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
    list-style: none; display: flex; align-items: center; gap: 8px;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before {
    content: ""; width: 0; height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent; border-bottom: 4px solid transparent;
    transition: transform .2s ease;
}
.toc[open] summary::before { transform: rotate(90deg); }
.toc ol { margin: 10px 0 0; padding-left: 1.2em; font-size: 14.5px; }
.toc li { margin: .3em 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* --- Врезки и выноски ----------------------------------------------- */

.note {
    margin: 1.4em 0; padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: .96em;
}
.note > :first-child { margin-top: 0; }
.note > :last-child { margin-bottom: 0; }
.note p { margin: .5em 0; }

.note-title {
    display: block; margin-bottom: .4em;
    font-weight: 700; line-height: 1.3;
}

.note-warn { border-left-color: #dc2626; background: rgba(220, 38, 38, .05); }
.note-warn .note-title { color: #dc2626; }

.note-tip { border-left-color: #16a34a; background: rgba(22, 163, 74, .05); }
.note-tip .note-title { color: #16a34a; }

.note-pick { border-left-color: var(--accent); background: var(--accent-soft); }
.note-pick .note-title { color: var(--accent); }

:root[data-theme="dark"] .note-warn { border-left-color: #f87171; background: rgba(248, 113, 113, .08); }
:root[data-theme="dark"] .note-warn .note-title { color: #f87171; }
:root[data-theme="dark"] .note-tip { border-left-color: #4ade80; background: rgba(74, 222, 128, .08); }
:root[data-theme="dark"] .note-tip .note-title { color: #4ade80; }

.source {
    margin-top: 1.6em; padding-top: .8em;
    border-top: 1px dashed var(--border);
    color: var(--muted); font-size: var(--fs-sm);
}

/* --- Легенда к схеме ------------------------------------------------- */

.legend {
    display: grid; gap: 0 20px;
    grid-template-columns: 1fr;
    font-size: .94em;
}
.legend-item {
    display: flex; gap: 10px; padding: 5px 0;
    border-bottom: 1px solid var(--border);
}
.legend-num {
    flex: none; min-width: 28px;
    color: var(--accent); font-weight: 700;
}
.legend-col {
    grid-column: 1 / -1;
    margin-top: 12px; font-weight: 700;
}

/* --- Сетка разделов (лендинг «Запчасти») ----------------------------- */

.pick-grid {
    display: grid; gap: 10px;
    grid-template-columns: 1fr;
}
.pick-card {
    display: flex; flex-direction: column; gap: 4px;
    padding: 15px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    text-decoration: none; color: inherit;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.pick-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-line);
    box-shadow: var(--shadow);
}
.pick-card-title { font-weight: 700; font-size: var(--fs-md); letter-spacing: -.01em; }
.pick-card-sub { color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }
.pick-card-arrow { margin-top: 4px; color: var(--accent); font-weight: 700; font-size: var(--fs-sm); }

@media (min-width: 720px) {
    .pick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (min-width: 1024px) {
    .pick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --- Списки статей и разделов ---------------------------------------- */

.article-list { display: grid; gap: 10px; }

.article-item {
    padding: 14px 16px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    transition: border-color .15s ease, transform .15s ease;
}
.article-item:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.article-item h2 { margin: 0 0 4px; font-size: var(--fs-lg); }
.article-item h2 a { color: inherit; text-decoration: none; }
.article-item h2 a:hover { color: var(--accent); }
.article-item time { color: var(--muted); font-size: var(--fs-xs); }
.article-item p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

.repair-sections { display: grid; gap: 12px; }

.repair-block {
    padding: 16px 18px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
}
.repair-block > h2 { margin: 0 0 2px; font-size: var(--fs-lg); }
.repair-block > h2 a { color: inherit; text-decoration: none; }
.repair-block > h2 a:hover { color: var(--accent); }
.repair-block > .muted { margin: 0 0 8px; font-size: var(--fs-sm); }

.repair-list { list-style: none; margin: 0; padding: 0; }
.repair-list li { border-top: 1px solid var(--border); }
.repair-list li:first-child { border-top: 0; }
.repair-list a {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 2px; color: var(--text); text-decoration: none;
    min-height: var(--tap); justify-content: center;
}
.repair-list a:hover { color: var(--accent); }
.repair-sub { color: var(--muted); font-size: var(--fs-sm); line-height: 1.4; }

/* --- Подвал ---------------------------------------------------------- */

.site-footer {
    border-top: 1px solid var(--border); background: var(--surface);
    margin-top: 32px;
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
.footer-inner {
    display: grid; gap: 22px;
    grid-template-columns: 1fr;
    padding: 26px var(--gutter);
}
.footer-col strong { display: block; margin-bottom: 8px; font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.footer-col p { margin: 0; color: var(--muted); font-size: 14px; }
.footer-about p { max-width: 46ch; }
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin: 2px 0; font-size: 14.5px; }
.footer-col a {
    display: inline-flex; align-items: center; min-height: 38px;
    color: var(--text); text-decoration: none;
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; gap: 6px 18px;
    border-top: 1px solid var(--border); padding: 12px var(--gutter);
}
.footer-bottom p { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.footer-credit a { color: var(--muted); text-decoration: none; }
.footer-credit a:hover { color: var(--accent); text-decoration: underline; }

/* --- Всплывающее подтверждение --------------------------------------- */

.toast {
    position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 18px);
    z-index: 110;
    transform: translate(-50%, 12px);
    padding: 10px 18px; border-radius: 999px;
    background: var(--text); color: var(--bg);
    font-size: 14px; font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   Десктоп: от 720px
   ========================================================================== */

@media (max-width: 719px) {
    /* Узкий экран: кадр помельче, машина смещена вправо, текст читается. */
    .hero {
        background-image: url("/user/media/hero-oka-900.webp");
        background-position: 74% 58%;
    }
    .hero::before {
        background:
            linear-gradient(178deg,
                rgba(10, 12, 16, .72) 0%,
                rgba(10, 12, 16, .89) 46%,
                rgba(10, 12, 16, .95) 100%),
            radial-gradient(80% 70% at 72% 42%, rgba(234, 88, 12, .26), transparent 64%);
    }
}

@media (min-width: 720px) {
    :root {
        --gutter: 24px;
        --header-h: 64px;
    }

    .legend { grid-template-columns: 1fr 1fr; }

    .hero { margin: -20px 0 0; padding: 52px 0 44px; }
    .hero-stats { grid-template-columns: repeat(3, auto); gap: 10px; }
    .hero-stat { min-width: 150px; }

    .tile-grid { gap: 14px; }
    .part-grid { gap: 14px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .part-grid[data-view="list"] { grid-template-columns: 1fr; }
    .part-grid-compact { grid-template-columns: repeat(4, minmax(0, 1fr)); }

    .catalog-toolbar { padding: 10px 12px; }
    .catalog-search { flex: 1 1 220px; }
    .catalog-status { flex: 0 0 auto; margin-left: auto; text-align: right; }

    .article-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
    .repair-sections { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

    .footer-inner { grid-template-columns: 1.4fr 1fr 1fr; padding: 34px var(--gutter); }
}

/* ==========================================================================
   Десктоп: от 960px — полная навигация, нижняя панель убирается
   ========================================================================== */

@media (min-width: 960px) {
    :root { --header-h: 68px; }

    .site-main { padding: 30px 0 60px; padding-bottom: 60px; }

    .main-nav { display: block; margin-left: auto; order: 1; }
    .main-nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
    .main-nav a {
        display: block; padding: 8px 12px; border-radius: var(--radius-sm);
        color: var(--muted); text-decoration: none; font-size: 14.5px; font-weight: 600;
    }
    .main-nav a:hover { background: var(--surface-2); color: var(--text); }
    .main-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

    .header-search {
        display: block; order: 2;
        width: 250px; margin-left: 12px;
    }
    .header-search .search-results { left: auto; right: 0; width: 420px; max-width: 86vw; }

    .header-actions { margin-left: 0; }
    .search-toggle { display: none; }

    /* На широком экране фильтры остаются на виду при прокрутке каталога. */
    .catalog-toolbar {
        position: sticky; top: calc(var(--header-h) + 10px); z-index: 30;
    }

    /* Каталог: дерево разделов слева, сетка деталей справа. */
    .catalog-layout { grid-template-columns: 264px minmax(0, 1fr); gap: 22px; }
    .catalog-aside { display: block; }
    .catalog-aside-inner {
        position: sticky; top: calc(var(--header-h) + 12px);
        max-height: calc(100vh - var(--header-h) - 28px);
        overflow-y: auto;
    }
    .catalog-filter-btn { display: none; }
    .part-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    /* Карточка детали: галерея слева, справочная часть справа. */
    .part-layout { grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 30px; }

    .burger { display: none; }
    .tabbar { display: none; }
    .nav-sheet { display: none; }
    .to-top { bottom: 24px; right: 24px; }
    .site-footer { padding-bottom: 0; }
    .toast { bottom: 24px; }
}

@media (min-width: 1180px) {
    .header-search { width: 300px; }
    .catalog-layout { grid-template-columns: 280px minmax(0, 1fr); }
    .part-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- Печать ---------------------------------------------------------- */

@media print {
    .site-header, .tabbar, .to-top, .nav-sheet, .search, .article-foot, .toc { display: none !important; }
    body { background: #fff; color: #000; }
    .site-main { padding: 0; }
    .prose, .article-body { max-width: none; }
}
