/* =========================================================
       BimmerBrain v3 — «CARBON & SIGNAL» design system
       ========================================================= */
:root {
    /* — Base: carbon neutral (not blue-black) — */
    --bg: #0B0B0D;
    --bg-alt: #111114;
    --surface: #16161A;
    --surface-2: #1C1C21;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    /* — Dominant accent: BMW i Blue — */
    --primary: #1C69E4;
    --primary-hover: #2B7AFF;
    --primary-subtle: rgba(28, 105, 228, 0.12);

    /* — Functional: mint/teal (AI / live statuses) — */
    --accent: #00E0C7;
    --accent-subtle: rgba(0, 224, 199, 0.12);

    /* — Brand micro: BMW M (badges/icons only) — */
    --bmw-m: #E2231A;

    /* — M-Performance tricolour (sparingly!) — */
    --m-light: #2B7AFF;
    --m-navy: #1C69E4;
    --m-red: #E2231A;

    /* — Text (WCAG AA on dark) — */
    --text: #F4F4F6;
    --text-muted: #A0A0A8;
    --text-dim: #6E6E76;

    /* — Radii — */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-xl: 28px;

    /* — Layered elevation — */
    --sh-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 2px rgba(0, 0, 0, 0.5);
    --sh-2: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 8px 24px rgba(0, 0, 0, 0.45);
    --sh-3: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 20px 60px rgba(0, 0, 0, 0.55);

    /* — Motion — */
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-fast: 150ms;
    --dur-base: 300ms;
    --dur-slow: 600ms;

    /* — Type scale (1.250 modular) — */
    --fs-xs: 0.8rem;
    --fs-sm: 1rem;
    --fs-md: 1.25rem;
    --fs-lg: 1.563rem;
    --fs-xl: 1.953rem;
    --fs-2xl: 2.441rem;
    --fs-3xl: 3.052rem;
    --fs-4xl: 3.815rem;
    --fs-5xl: 4.768rem;

    --container: 1280px;
    --pad: clamp(1rem, 5vw, 4rem);
    --pad-quiet: clamp(3.5rem, 7vh, 5.5rem);
    --pad-dense: clamp(2.5rem, 5vh, 4rem);

    color-scheme: dark;
}

/* =========================================================
       LIGHT THEME «ДЕНЬ» — переопределение токенов
       Активируется атрибутом data-theme="light" на <html>
       (assets/js/theme-toggle.js + инлайн-скрипт в header)
       ========================================================= */
:root[data-theme="light"] {
    /* — Base: мягкий белый (не чистый #FFF — комфортнее для глаз) — */
    --bg: #FAFAFC;
    --bg-alt: #F2F3F5;
    --surface: #FFFFFF;
    --surface-2: #F4F5F7;
    --border: rgba(15, 17, 21, 0.10);
    --border-strong: rgba(15, 17, 21, 0.16);

    /* — Dominant accent: BMW i Blue (темнее для WCAG AA на белом) — */
    --primary: #1559C7;
    --primary-hover: #1C69E4;
    --primary-subtle: rgba(21, 89, 199, 0.10);

    /* — Functional: teal (темнее — #00E0C7 нечитаем на белом) — */
    --accent: #009E8C;
    --accent-subtle: rgba(0, 158, 140, 0.10);

    /* — Brand micro: BMW M — без изменений, читаем на обоих фонах — */
    --bmw-m: #E2231A;

    /* — M-Performance tricolour — */
    --m-light: #1C69E4;
    --m-navy: #1559C7;
    --m-red: #E2231A;

    /* — Text (WCAG AA на светлом) — */
    --text: #15161A;
    --text-muted: #55575E;
    --text-dim: #76787F;

    /* — Elevation: мягкие тени, без белых inset-бликов — */
    --sh-1: 0 1px 2px rgba(15, 17, 21, 0.08);
    --sh-2: 0 8px 24px rgba(15, 17, 21, 0.10);
    --sh-3: 0 20px 60px rgba(15, 17, 21, 0.14);

    color-scheme: light;
}

/* ---------- Reset / base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    max-width: 100%;
}

html.no-smooth {
    scroll-behavior: auto;
}

body {
    font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: var(--fs-sm);
    line-height: 1.5;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--primary-hover);
    text-decoration: none;
}

a:hover {
    color: var(--primary-hover);
}

ul {
    list-style: none;
}

button {
    font: inherit;
    cursor: pointer;
    color: inherit;
    background: none;
    border: none;
}

h1,
h2,
h3,
h4 {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text);
}

.mono {
    font-family: "JetBrains Mono", ui-monospace, monospace;
}

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--pad);
}

.section-quiet {
    padding-block: var(--pad-quiet);
}

.section-dense {
    padding-block: var(--pad-dense);
}

/* Единый межсекционный ритм: у секции, идущей сразу за другой,
   убираем верхний паддинг, чтобы отступы соседей не складывались */
.section-quiet+.section-quiet,
.section-quiet+.section-dense,
.section-dense+.section-quiet,
.section-dense+.section-dense {
    padding-top: 0;
}

.bg-alt {
    background: var(--bg-alt);
}

/* ---------- Skip link ---------- */
.skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 2000;
    background: var(--primary);
    color: #fff;
    padding: .75rem 1.25rem;
    border-radius: var(--r-md);
    font-weight: 600;
    transition: top var(--dur-fast) var(--ease);
}

.skip-link:focus {
    top: 1rem;
}

/* ---------- Focus visible (a11y) ---------- */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline-offset: 3px;
}

/* ---------- Section header ---------- */
.sec-head {
    max-width: 680px;
    margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.sec-head--center {
    margin-inline: auto;
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-family: "JetBrains Mono", monospace;
    font-size: .8rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 1rem;
}

.eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

/* M-Performance tricolour маркер на ключевых секциях */
.eyebrow .dot--m {
    border-radius: 1px;
    width: 14px;
    height: 5px;
    background: linear-gradient(90deg, var(--m-navy) 0 33%, var(--m-light) 33% 66%, var(--m-red) 66% 100%);
}

.sec-title {
    font-size: clamp(var(--fs-xl), 3.5vw, var(--fs-3xl));
}

.sec-desc {
    color: var(--text-muted);
    font-size: var(--fs-md);
    margin-top: 1rem;
    max-width: 60ch;
}

.sec-head--center .sec-desc {
    margin-inline: auto;
}

/* =========================================================
       HEADER
       ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 11, 13, 0.85);
    border-bottom: 1px solid var(--border);
    transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}

.site-header.scrolled {
    background: rgba(11, 11, 13, 0.96);
    border-color: var(--border-strong);
}

:root[data-theme="light"] .site-header {
    background: rgba(250, 250, 252, 0.85);
}

:root[data-theme="light"] .site-header.scrolled {
    background: rgba(250, 250, 252, 0.96);
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.brand__logo {
    height: 54px;
    width: auto;
    object-fit: contain;
    /* Логотип — непрозрачная тёмная плашка: оформляем как
       намеренный «бейдж» (app-icon), аккуратный в обеих темах */
    border-radius: 12px;
    display: block;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-desktop a {
    color: var(--text-muted);
    font-size: .9rem;
    font-weight: 500;
    transition: color var(--dur-fast) var(--ease);
}

.nav-desktop a:hover {
    color: var(--text);
}

.header__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font-weight: 600;
    border-radius: var(--r-md);
    padding: .75rem 1.25rem;
    transition: transform var(--dur-base) var(--ease), background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}

.btn--primary {
    background: var(--primary);
    color: #fff;
}

.btn--primary:hover {
    background: var(--primary-hover);
    box-shadow: 0 4px 12px rgba(28, 105, 228, 0.30);
    transform: translateY(-1px);
}

.btn--m-red {
    background: var(--bmw-m);
    color: #fff;
}

.btn--m-red:hover {
    background: #C91F17;
    box-shadow: 0 4px 12px rgba(226, 35, 26, 0.30);
    transform: translateY(-1px);
}

.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn--ghost:hover {
    border-color: var(--primary);
    background: var(--primary-subtle);
}

.btn--lg {
    padding: 1rem 1.75rem;
    font-size: var(--fs-md);
}

.btn--block {
    width: 100%;
}

/* Burger */
.burger {
    display: none;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--r-sm);
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--surface);
}

.burger__bars {
    position: relative;
    display: block;
    width: 22px;
    height: 16px;
}

.burger__bars span {
    position: absolute;
    left: 0;
    height: 2.5px;
    width: 100%;
    background: var(--text);
    border-radius: 2px;
    transition: transform var(--dur-base) var(--ease), opacity var(--dur-fast) var(--ease);
}

.burger__bars span:nth-child(1) {
    top: 0;
}

.burger__bars span:nth-child(2) {
    top: 7px;
}

.burger__bars span:nth-child(3) {
    top: 14px;
}

.burger[aria-expanded="true"] .burger__bars span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger[aria-expanded="true"] .burger__bars span:nth-child(2) {
    opacity: 0;
}

.burger[aria-expanded="true"] .burger__bars span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav (off-canvas) */
.nav-mobile {
    position: fixed;
    inset: 68px 0 0 auto;
    width: min(86vw, 360px);
    z-index: 999;
    background: var(--bg-alt);
    border-left: 1px solid var(--border);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform var(--dur-base) var(--ease), visibility 0s linear var(--dur-base);
    padding: 1.5rem var(--pad);
    display: flex;
    flex-direction: column;
    gap: .5rem;
    overflow-y: auto;
}

.nav-mobile.is-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform var(--dur-base) var(--ease), visibility 0s linear 0s;
    box-shadow: var(--sh-3);
}

.nav-mobile a,
.nav-mobile .btn {
    padding: .9rem .5rem;
    border-radius: var(--r-md);
    font-size: 1.05rem;
    color: var(--text);
}

.nav-mobile a:hover {
    background: var(--surface);
}

.nav-mobile .btn {
    margin-top: .75rem;
}

.nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--dur-base) var(--ease), visibility var(--dur-base);
    z-index: 998;
}

.nav-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

:root[data-theme="light"] .nav-backdrop {
    background: rgba(15, 17, 21, 0.4);
}

@media (max-width:1023px) {
    .nav-desktop {
        display: none;
    }

    .header__actions .btn--ghost {
        display: none;
    }
}

@media (max-width:767px) {
    :root {
        --pad-quiet: 3rem;
        --pad-dense: 2.25rem;
    }

    .burger {
        display: flex;
    }

    .header__actions .btn--primary {
        display: none;
    }
}

/* =========================================================
       HERO (7/5 asymmetric)
       ========================================================= */
.hero {
    position: relative;
    overflow: hidden;
    padding-top: clamp(3rem, 8vh, 6rem);
    padding-bottom: var(--pad-quiet);
}

.hero__grid {
    display: grid;
    grid-template-columns: 7fr 5fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
}

.hero__h1 {
    font-size: clamp(var(--fs-3xl), 6vw, var(--fs-5xl));
    line-height: 1.04;
}

.hero__h1 .hl {
    color: var(--primary-hover);
}

/* Hero tagline — value proposition statement */
.hero__tagline {
    margin-top: 1.5rem;
    padding-left: 1rem;
    border-left: 3px solid transparent;
    border-image: linear-gradient(180deg, var(--m-light), var(--m-navy), var(--m-red)) 1;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 600;
    line-height: 1.35;
    max-width: 50ch;
    color: var(--text);
}

.hero__tagline .tagline-accent {
    color: var(--primary-hover);
    font-weight: 700;
}

.hero__sub {
    color: #C8C8CE;
    font-size: var(--fs-md);
    margin-top: 1.5rem;
    max-width: 46ch;
}

:root[data-theme="light"] .hero__sub {
    color: var(--text-muted);
}

.hero__cta-row {
    margin-top: 2.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
}

.hero__search-form {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    width: 100%;
    max-width: 520px;
}

.hero__search-input {
    flex: 1;
    min-height: 56px;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 1rem 1.25rem;
    color: var(--text);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}

/* Гарантируем одинаковую высоту кнопки и инпута в ряду */
.hero__search-form .btn {
    min-height: 56px;
    white-space: nowrap;
}

.hero__search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(28, 105, 228, 0.15);
}

.hero__search-input::placeholder {
    color: var(--text-dim);
}

.hero__microcopy {
    color: var(--text-dim);
    font-size: .85rem;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.hero__microcopy svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

/* Live demo widget */
.demo-widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-1);
    padding: 1.25rem;
    position: relative;
}

.demo-widget__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.demo-status {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-family: "JetBrains Mono", monospace;
    font-size: .72rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.demo-status .pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 var(--accent-subtle);
    animation: pulse 2s var(--ease) infinite;
}

.demo-widget__title {
    font-size: .78rem;
    color: var(--text-dim);
    font-family: "JetBrains Mono", monospace;
}

.demo-q {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: .85rem 1rem;
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: 1rem;
}

.demo-q svg {
    width: 18px;
    height: 18px;
    color: var(--text-dim);
    flex: 0 0 auto;
}

.demo-q__text {
    color: var(--text);
    font-size: .92rem;
}

.demo-q__caret {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--primary-hover);
    margin-left: 2px;
    vertical-align: -2px;
}

.demo-q__caret.blink {
    animation: blink 1s steps(2) infinite;
}

.demo-a {
    background: var(--primary-subtle);
    border: 1px solid rgba(28, 105, 228, 0.28);
    border-radius: var(--r-md);
    padding: 1rem;
}

.demo-a__label {
    font-family: "JetBrains Mono", monospace;
    font-size: .7rem;
    color: var(--primary-hover);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: .5rem;
}

.demo-a__text {
    font-size: .9rem;
    color: var(--text);
    line-height: 1.55;
}

.demo-a__sources {
    margin-top: .85rem;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.chip {
    font-family: "JetBrains Mono", monospace;
    font-size: .68rem;
    padding: .25rem .55rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

:root[data-theme="light"] .chip {
    background: rgba(15, 17, 21, 0.05);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 224, 199, 0.5);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(0, 224, 199, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 224, 199, 0);
    }
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* Hero decorative grid (very subtle) */
.hero__deco {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.hero__deco::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse 80% 60% at 70% 0%, #000 30%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 70% 0%, #000 30%, transparent 75%);
}

:root[data-theme="light"] .hero__deco::before {
    background-image: linear-gradient(rgba(15, 17, 21, 0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 17, 21, 0.03) 1px, transparent 1px);
}

.hero__deco::after {
    content: "";
    position: absolute;
    top: -20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    max-width: 680px;
    max-height: 680px;
    background: radial-gradient(circle, rgba(28, 105, 228, 0.10), transparent 60%);
    filter: blur(10px);
}

/* =========================================================
       TRUST STRIP
       ========================================================= */
.trust {
    border-block: 1px solid var(--border);
    background: var(--bg-alt);
    padding-block: 2.5rem;
}

.trust__label {
    text-align: center;
    font-family: "JetBrains Mono", monospace;
    font-size: .75rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: .1em;
    margin-bottom: 1.5rem;
}

.trust__sources {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .75rem 1rem;
}

.trust__src {
    font-family: "JetBrains Mono", monospace;
    font-size: .85rem;
    color: var(--text-muted);
    padding: .4rem .8rem;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
}

.trust__note {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .78rem;
    color: var(--text-dim);
}

/* =========================================================
       FEATURES
       ========================================================= */
.features__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
    padding: 1.75rem;
    transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}

.card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}

.card__icon {
    width: 44px;
    height: 44px;
    border-radius: var(--r-md);
    background: var(--primary-subtle);
    display: grid;
    place-items: center;
    color: var(--primary-hover);
    margin-bottom: 1.25rem;
    border: 1px solid rgba(28, 105, 228, 0.22);
}

.card__icon svg {
    width: 22px;
    height: 22px;
}

.card__title {
    font-size: var(--fs-md);
    margin-bottom: .6rem;
}

.card__text {
    color: var(--text-muted);
    font-size: .92rem;
}

/* =========================================================
       SCENARIOS (замена сетки возможностей — 2 направления × 2 карточки)
       ========================================================= */
.scenarios-layout {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 4vw, 3.25rem);
}

.scenario-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Заголовок направления (eyebrow-style с акцентной линией) */
.scenario-group__label {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    font-family: "JetBrains Mono", monospace;
    font-size: .92rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.scenario-group__label::before {
    content: "";
    width: 34px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), transparent);
}

.scenario-group__cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Базовая карточка-сценарий (кликабельная) */
.scenario-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .9rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
    padding: 1.85rem 1.75rem;
    color: var(--text);
    text-decoration: none;
    overflow: hidden;
    transition: transform var(--dur-base) var(--ease),
        border-color var(--dur-base) var(--ease),
        box-shadow var(--dur-base) var(--ease);
}

.scenario-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--sh-3);
    color: var(--text);
}

.scenario-card__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* Заголовок карточки — увеличен */
.scenario-card__title {
    display: flex;
    align-items: center;
    gap: .8rem;
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.01em;
    line-height: 1.2;
    color: var(--text);
}

.scenario-card__title svg {
    width: 26px;
    height: 26px;
    color: var(--primary-hover);
    stroke-width: 2;
    flex: 0 0 auto;
}

/* Описание — увеличено */
.scenario-card__desc {
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.55;
}

/* CTA — увеличено */
.scenario-card__cta {
    margin-top: auto;
    padding-top: .75rem;
    font-size: .98rem;
    font-weight: 600;
    color: var(--primary-hover);
    transition: transform var(--dur-fast) var(--ease);
}

.scenario-card:hover .scenario-card__cta,
.scenario-card:focus-visible .scenario-card__cta {
    transform: translateX(4px);
}

/* Усиленная карточка Expert (M-Performance tricolour border + glow) */
.scenario-card--expert {
    border: 1px solid transparent;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, var(--m-navy), var(--m-light) 50%, var(--m-red)) border-box;
}

.scenario-card--expert:hover {
    box-shadow: 0 20px 60px rgba(28, 105, 228, 0.20), var(--sh-3);
}

.scenario-card--expert .scenario-card__title svg {
    color: var(--accent);
}

/* Бейдж Expert: тёмная подложка + tricolour-полоса слева (стиль M GmbH) */
.scenario-badge {
    position: relative;
    font-family: "JetBrains Mono", monospace;
    font-size: .74rem;
    font-weight: 600;
    padding: .35rem .8rem .35rem 1.1rem;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    color: var(--text);
    letter-spacing: .04em;
    flex: 0 0 auto;
    overflow: hidden;
}

.scenario-badge::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: linear-gradient(180deg, var(--m-navy) 0 33%, var(--m-light) 33% 66%, var(--m-red) 66% 100%);
}

/* Tooltip (раскрывается при наведении / фокусе на Expert-карточке) */
.scenario-tooltip {
    margin-top: .5rem;
    padding: 1rem 1.1rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(8px);
    transition: max-height var(--dur-base) var(--ease),
        opacity var(--dur-base) var(--ease),
        transform var(--dur-base) var(--ease),
        border-color var(--dur-base) var(--ease);
}

.scenario-card--expert:hover .scenario-tooltip,
.scenario-card--expert:focus-within .scenario-tooltip {
    max-height: 260px;
    opacity: 1;
    transform: none;
    border-color: rgba(0, 224, 199, 0.22);
}

.tooltip-title {
    font-size: .86rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .65rem;
}

.tooltip-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.tooltip-list li {
    display: flex;
    align-items: flex-start;
    gap: .6rem;
    font-size: .95rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.tooltip-list span {
    color: var(--accent);
    font-weight: 700;
    flex: 0 0 auto;
}

/* =========================================================
       KNOWLEDGE BASE
       ========================================================= */
.kb__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.kb__counter {
    position: relative;
    display: inline-block;
    font-family: "JetBrains Mono", monospace;
    color: var(--text);
    font-size: var(--fs-lg);
    padding-bottom: .6rem;
}

/* M-Performance tricolour микро-полоса под счётчиком */
.kb__counter::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 72px;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--m-navy) 0 33%, var(--m-light) 33% 66%, var(--m-red) 66% 100%);
}

.kb__counter b {
    color: var(--primary-hover);
    letter-spacing: -0.01em;
}

.kb__cats {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.cat-btn {
    padding: .5rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: .85rem;
    font-weight: 500;
    transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.cat-btn:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.cat-btn.active {
    background: var(--primary-subtle);
    border-color: rgba(28, 105, 228, 0.35);
    color: var(--primary-hover);
}

/* =========================================================
       KNOWLEDGE HUB — split layout (sticky visual + content)
       ========================================================= */
.kb-split {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
}

.kb-split__visual {
    position: sticky;
    top: 92px;
    border-radius: var(--r-xl);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--sh-3);
    background: var(--surface);
    aspect-ratio: 2 / 3;
}

.kb-split__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: saturate(0.9) contrast(1.08) brightness(0.92);
}

/* HUD gradient overlay — глубина + брендинг */
.kb-split__visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(11, 11, 13, 0.15) 0%, transparent 25%, transparent 60%, rgba(11, 11, 13, 0.88) 100%),
        radial-gradient(ellipse 90% 50% at 50% 100%, rgba(28, 105, 228, 0.18), transparent 70%);
}

/* HUD grid overlay (как в hotspot__visual) */
.kb-split__visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 224, 199, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 224, 199, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(ellipse 80% 80% at 50% 50%, #000 20%, transparent 80%);
}

/* Floating caption поверх изображения */
.kb-split__caption {
    position: absolute;
    left: 1.25rem;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 3;
    display: flex;
    flex-direction: column;
    gap: .4rem;
}

.kb-split__caption-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-family: "JetBrains Mono", monospace;
    font-size: .68rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: .08em;
}

.kb-split__caption-eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s var(--ease) infinite;
}

.kb-split__caption-title {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #fff;
    line-height: 1.25;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

.kb-split__caption-sub {
    font-size: .82rem;
    color: var(--text-muted);
}

/* === HUD: scan-line animation (AI analyzing knowledge base) === */
.kb-split__scan-line {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent) 50%, transparent);
    box-shadow: 0 0 10px 1px rgba(0, 224, 199, 0.5);
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    will-change: top, opacity;
    animation: kb-scan 5s var(--ease) infinite;
    animation-delay: 1.5s;
}

@keyframes kb-scan {
    0% {
        top: 0%;
        opacity: 0;
    }

    8% {
        opacity: 0.7;
    }

    45% {
        top: 100%;
        opacity: 0.7;
    }

    50% {
        opacity: 0;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

/* === HUD: corner brackets (targeting reticle) === */
.kb-split__bracket {
    position: absolute;
    width: 22px;
    height: 22px;
    z-index: 3;
    pointer-events: none;
    border-color: var(--accent);
    opacity: 0.45;
    transition: opacity var(--dur-base) var(--ease);
}

.kb-split__bracket--tl {
    top: 12px;
    left: 12px;
    border-top: 2px solid;
    border-left: 2px solid;
    border-top-left-radius: 6px;
}

.kb-split__bracket--tr {
    top: 12px;
    right: 12px;
    border-top: 2px solid;
    border-right: 2px solid;
    border-top-right-radius: 6px;
}

.kb-split__bracket--bl {
    bottom: 12px;
    left: 12px;
    border-bottom: 2px solid;
    border-left: 2px solid;
    border-bottom-left-radius: 6px;
}

.kb-split__bracket--br {
    bottom: 12px;
    right: 12px;
    border-bottom: 2px solid;
    border-right: 2px solid;
    border-bottom-right-radius: 6px;
}

/* === HUD: model badge (top-left) === */
.kb-split__model-tag {
    position: absolute;
    top: 1.25rem;
    left: 1.25rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .35rem .7rem;
    border-radius: var(--r-sm);
    background: rgba(11, 11, 13, 0.72);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-strong);
    font-family: "JetBrains Mono", monospace;
    font-size: .7rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .04em;
}

:root[data-theme="light"] .kb-split__model-tag {
    background: rgba(255, 255, 255, 0.85);
}

.kb-split__model-tag .dot-red {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bmw-m);
    flex: 0 0 auto;
}

/* === Hover: brackets brighter + photo filter normalizes === */
@media (hover: hover) {
    .kb-split__visual:hover .kb-split__bracket {
        opacity: 0.85;
    }

    .kb-split__visual:hover .kb-split__photo {
        filter: saturate(1) contrast(1.1) brightness(1);
        transition: filter var(--dur-slow) var(--ease);
    }
}

/* === Reduced motion: disable scan line === */
@media (prefers-reduced-motion: reduce) {
    .kb-split__scan-line {
        animation: none;
        display: none;
    }
}

/* Content column */
.kb-split__content {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

/* Compact doc-grid inside split */
.kb-split .doc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Responsive: на планшетах — sticky отключаем, на мобиле — стек */
@media (max-width: 1023px) {
    .kb-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .kb-split__visual {
        position: relative;
        top: auto;
        max-width: 460px;
        margin-inline: auto;
        aspect-ratio: 3 / 4;
    }

    /* При смене ratio с 2/3 → 3/4 изображение обрезается.
               Сдвигаем фокус вверх (50% 28%), чтобы сохранить переднюю часть
               BMW G30 (решётка kidney / фары / капот) в кадре. */
    .kb-split__photo {
        object-position: 50% 28%;
    }
}

@media (max-width: 640px) {
    .kb-split .doc-grid {
        grid-template-columns: 1fr;
    }
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

.doc {
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
    padding: 1.1rem 1.15rem;
    color: var(--text);
    transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}

.doc:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

.doc__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .55rem;
}

.doc__id {
    font-family: "JetBrains Mono", monospace;
    font-size: .72rem;
    color: var(--text-dim);
}

.doc__badge {
    font-family: "JetBrains Mono", monospace;
    font-size: .68rem;
    padding: .2rem .55rem;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.doc__badge--urgent {
    color: var(--bmw-m);
    border-color: rgba(226, 35, 26, 0.35);
    background: rgba(226, 35, 26, 0.10);
}

.doc__title {
    font-size: var(--fs-md);
    margin-bottom: .55rem;
    line-height: 1.3;
}

.doc__ai {
    background: var(--surface-2);
    border-left: 2px solid var(--primary);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    padding: .55rem .8rem;
    margin-bottom: .65rem;
}

.doc__ai-label {
    font-family: "JetBrains Mono", monospace;
    font-size: .62rem;
    color: var(--primary-hover);
    text-transform: uppercase;
    letter-spacing: .06em;
    display: block;
    margin-bottom: .25rem;
}

.doc__ai-text {
    font-size: .8rem;
    color: var(--text-muted);
    line-height: 1.5;
    /* Ограничиваем AI summary 3 строками + «…» */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.doc__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .4rem;
    margin-top: auto;
}

.doc__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.doc__src {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-family: "JetBrains Mono", monospace;
    font-size: .72rem;
    color: var(--text-dim);
}

.doc__src svg {
    width: 14px;
    height: 14px;
}

/* --- «Читать далее» (accent link) --- */
.doc__readmore {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-family: "JetBrains Mono", monospace;
    font-size: .76rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    user-select: none;
    transition: color var(--dur-base) var(--ease), gap var(--dur-base) var(--ease);
    margin-left: auto;
    flex-shrink: 0;
}

.doc__readmore:hover {
    color: var(--primary-hover);
    gap: .55rem;
}

.doc__readmore svg {
    width: 16px;
    height: 16px;
    transition: transform var(--dur-base) var(--ease);
}

.doc__readmore:hover svg {
    transform: translateX(3px);
}

/* --- Overlay-ссылка (покрывает всю карточку, под readmore) --- */
.doc {
    position: relative;
}

.doc__link-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: var(--r-lg);
}

/* Элементы поверх overlay (readmore, tags) получают больший z-index */
.doc__foot,
.doc__readmore {
    position: relative;
    z-index: 2;
}

/* --- Фильтрация: скрытые карточки --- */
.doc--hidden {
    display: none;
}

.doc--filtered-in {
    animation: docFadeIn .4s var(--ease) both;
}

@keyframes docFadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Empty state --- */
.kb__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: .95rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--r-lg);
}

/* =========================================================
       CASE / DEMO
       ========================================================= */
.case {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: stretch;
}

.case__panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-2);
    padding: 1.75rem;
}

.case__label {
    font-family: "JetBrains Mono", monospace;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 1rem;
}

.case__label--q {
    color: var(--text-dim);
}

.case__label--a {
    color: var(--primary-hover);
}

.case__q {
    font-family: "Space Grotesk", sans-serif;
    font-size: var(--fs-lg);
    color: var(--text);
    line-height: 1.35;
}

.case__a p {
    color: var(--text);
    font-size: .95rem;
    margin-bottom: .85rem;
    line-height: 1.6;
}

.case__a ul {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    margin-top: 1rem;
}

.case__a li {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    color: var(--text-muted);
    font-size: .9rem;
}

.case__a li svg {
    width: 18px;
    height: 18px;
    color: var(--accent);
    flex: 0 0 auto;
    margin-top: .1rem;
}

.case__sources {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* =========================================================
       HOTSPOTS: Interactive car diagnostic map
       ========================================================= */
.hotspots {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(2rem, 5vw, 3rem);
}

.hotspot__visual {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-3);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    max-height: 620px;
    width: 100%;
}

/* Photo of BMW G30 */
.hotspot__photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    position: relative;
    z-index: 0;
    filter: saturate(0.9) contrast(1.08) brightness(0.92);
}

/* HUD grid overlay */
.hotspot__visual::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(rgba(43, 122, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(43, 122, 255, 0.06) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

/* Vignette + blue tint for brand integration (shifted right — car subject in 3/4 view) */
.hotspot__visual::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse 72% 62% at 58% 44%, transparent 22%, rgba(11, 11, 13, 0.68) 100%),
        linear-gradient(135deg, rgba(28, 105, 228, 0.08), transparent 60%);
    pointer-events: none;
}

/* HTML hotspot buttons (replaces SVG dots) */
.hotspot-dot {
    position: absolute;
    z-index: 3;
    width: 52px;
    height: 52px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    transform: translate(-50%, -50%);
}

.hotspot-dot .hp-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    transition: transform var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}

.hotspot-dot .hp-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 16px currentColor;
    transition: transform var(--dur-fast) var(--ease);
}

.hotspot-dot .hotspot__pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: hp-pulse 2.5s var(--ease) infinite;
    pointer-events: none;
}

.hotspot-dot:focus-visible .hp-ring,
.hotspot-dot:hover .hp-ring,
.hotspot-dot[aria-expanded="true"] .hp-ring {
    transform: scale(1.2);
    background: rgba(0, 0, 0, 0.5);
}

.hotspot-dot[aria-expanded="true"] .hp-core {
    transform: translate(-50%, -50%) scale(1.4);
}

/* Zone colors */
.hp--engine {
    color: var(--bmw-m);
}

.hp--trans {
    color: var(--accent);
}

.hp--cooling {
    color: var(--m-light);
}

.hp--brakes {
    color: var(--primary);
}

/* Zone positions on G30 photo (3/4 front view, 16:9 — car faces left) */
.hp--engine {
    top: 53%;
    left: 36%;
}

.hp--trans {
    top: 66%;
    left: 58%;
}

.hp--cooling {
    top: 62%;
    left: 26.5%;
}

.hp--brakes {
    top: 70%;
    left: 51%;
}

/* — — — Visible zone labels (always-on informative overlay) — — — */
.hotspot-dot::after {
    content: attr(data-label);
    position: absolute;
    top: 50%;
    left: calc(100% + 16px);
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    padding: .35rem .75rem;
    background: rgba(11, 11, 13, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid currentColor;
    border-radius: var(--r-sm);
    font-family: "JetBrains Mono", monospace;
    font-size: .72rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .02em;
    color: #fff;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: transform var(--dur-base) var(--ease),
        background var(--dur-base) var(--ease),
        box-shadow var(--dur-base) var(--ease);
}

/* Connector tick from dot to label */
.hotspot-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(100% + 4px);
    width: 10px;
    height: 1.5px;
    background: currentColor;
    opacity: 0.55;
    z-index: 4;
    pointer-events: none;
}

/* Label positioned to the LEFT (for right-side hotspots) */
.hp-label--left::after {
    left: auto;
    right: calc(100% + 16px);
}

.hp-label--left::before {
    left: auto;
    right: calc(100% + 4px);
}

/* Enlarge label on hover/focus/active */
.hotspot-dot:hover::after,
.hotspot-dot:focus-visible::after,
.hotspot-dot[aria-expanded="true"]::after {
    background: rgba(11, 11, 13, 0.95);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6), 0 0 0 1px currentColor;
    transform: translateY(-50%) scale(1.06);
}

@media (max-width: 767px) {
    .hotspot-dot {
        width: 44px;
        height: 44px;
    }

    .hotspot-dot::after {
        font-size: .62rem;
        padding: .25rem .55rem;
    }
}

/* Мобильные: лейблы точек скрыты, кроме активной (иначе накладываются) */
@media (max-width: 767px) {

    .hotspot-dot::after,
    .hotspot-dot::before {
        display: none;
    }

    .hotspot-dot[aria-expanded="true"]::after,
    .hotspot-dot[aria-expanded="true"]::before {
        display: inline-flex;
    }
}

/* — — — HUD panel zones: интерактивные оверлеи на панелях изображения — — — */
.hp-zone {
    position: absolute;
    z-index: 2;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: transparent;
    cursor: pointer;
    transition: border-color var(--dur-base) var(--ease),
        background var(--dur-base) var(--ease),
        box-shadow var(--dur-base) var(--ease);
}

/* Позиции панелей (% от контейнера, масштабируются с изображением) */
.hp-zone--n52 {
    top: 9.5%;
    left: 15%;
    width: 15.7%;
    height: 21.5%;
}

.hp-zone--b58 {
    top: 31.5%;
    left: 9.7%;
    width: 15.4%;
    height: 16.3%;
}

.hp-zone--dme {
    top: 52%;
    left: 7.1%;
    width: 12%;
    height: 17%;
}

.hp-zone--zf8hp {
    top: 19.7%;
    left: 33.1%;
    width: 11.8%;
    height: 15.9%;
}

.hp-zone--coolsys {
    top: 37.4%;
    left: 78.9%;
    width: 13.1%;
    height: 16%;
}

.hp-zone--suspension {
    top: 18.3%;
    left: 45.9%;
    width: 10.2%;
    height: 15.9%;
}

.hp-zone--electrical {
    top: 20.7%;
    left: 76.9%;
    width: 13.2%;
    height: 17.1%;
}

.hp-zone--ibs {
    top: 55%;
    left: 83%;
    width: 11.1%;
    height: 13.9%;
}

/* Цвета зон (как у точек) */
.hp-zone--n52,
.hp-zone--b58,
.hp-zone--dme {
    color: var(--bmw-m);
}

.hp-zone--zf8hp {
    color: var(--accent);
}

.hp-zone--coolsys {
    color: var(--m-light);
}

.hp-zone--soon {
    color: rgba(255, 255, 255, 0.55);
    cursor: default;
}

/* Hover/focus glow — 100% CSS */
.hp-zone:hover,
.hp-zone:focus-visible {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 18px rgba(43, 122, 255, 0.35),
        inset 0 0 22px rgba(255, 255, 255, 0.06);
    outline: none;
}

.hp-zone[data-zone="engine"]:hover,
.hp-zone[data-zone="engine"]:focus-visible {
    box-shadow: 0 0 18px rgba(226, 35, 26, 0.4),
        inset 0 0 22px rgba(226, 35, 26, 0.1);
}

.hp-zone[data-zone="trans"]:hover,
.hp-zone[data-zone="trans"]:focus-visible {
    box-shadow: 0 0 18px rgba(0, 224, 199, 0.4),
        inset 0 0 22px rgba(0, 224, 199, 0.1);
}

.hp-zone[data-zone="cooling"]:hover,
.hp-zone[data-zone="cooling"]:focus-visible {
    box-shadow: 0 0 18px rgba(43, 122, 255, 0.45),
        inset 0 0 22px rgba(43, 122, 255, 0.12);
}

/* Бейдж «Скоро» — появляется при hover */
.hp-zone__tag {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: .2rem .45rem;
    border: 1px solid currentColor;
    border-radius: var(--r-sm);
    background: rgba(11, 11, 13, 0.85);
    font-family: "JetBrains Mono", monospace;
    font-size: .6rem;
    font-weight: 600;
    letter-spacing: .04em;
    opacity: 0;
    transition: opacity var(--dur-fast) var(--ease);
    pointer-events: none;
}

.hp-zone--soon:hover .hp-zone__tag {
    opacity: 1;
}

/* Синхронизация через :has() — без JS */
/* Активная зона (клик по точке или зоне) → постоянный контур у связанных панелей */
.hotspot__visual:has(.hotspot-dot[data-zone="engine"][aria-expanded="true"]) .hp-zone[data-zone="engine"],
.hotspot__visual:has(.hotspot-dot[data-zone="trans"][aria-expanded="true"]) .hp-zone[data-zone="trans"],
.hotspot__visual:has(.hotspot-dot[data-zone="cooling"][aria-expanded="true"]) .hp-zone[data-zone="cooling"] {
    border-color: currentColor;
}

/* Hover на точке → glow связанной панели */
.hotspot__visual:has(.hotspot-dot[data-zone="engine"]:hover) .hp-zone[data-zone="engine"],
.hotspot__visual:has(.hotspot-dot[data-zone="trans"]:hover) .hp-zone[data-zone="trans"],
.hotspot__visual:has(.hotspot-dot[data-zone="cooling"]:hover) .hp-zone[data-zone="cooling"] {
    border-color: currentColor;
    background: rgba(255, 255, 255, 0.04);
}

/* Hover на панели → подсветка связанной карточки */
.hotspots:has(.hp-zone[data-zone="engine"]:hover) .hp-card[data-zone="engine"],
.hotspots:has(.hp-zone[data-zone="trans"]:hover) .hp-card[data-zone="trans"],
.hotspots:has(.hp-zone[data-zone="cooling"]:hover) .hp-card[data-zone="cooling"] {
    opacity: 1;
    transform: none;
    border-color: var(--border-strong);
}

/* Мобильные: панели мелкие — оставляем только точки */
@media (max-width: 767px) {
    .hp-zone {
        display: none;
    }
}

@keyframes hp-pulse {
    0% {
        opacity: 0.6;
        transform: scale(1);
    }

    70% {
        opacity: 0;
        transform: scale(2.8);
    }

    100% {
        opacity: 0;
        transform: scale(2.8);
    }
}

.hotspot__panel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

@media (max-width: 767px) {
    .hotspot__panel {
        grid-template-columns: 1fr;
    }
}

.hp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 1.5rem;
    box-shadow: var(--sh-1);
    transition: border-color var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
    opacity: 0.45;
    transform: translateY(4px);
}

.hp-card.is-active {
    opacity: 1;
    transform: none;
    border-color: var(--border-strong);
    box-shadow: var(--sh-2);
}

.hp-card__head {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .85rem;
}

.hp-card__icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.hp-card__icon svg {
    width: 20px;
    height: 20px;
}

.hp-card[data-zone="engine"] .hp-card__icon {
    background: rgba(226, 35, 26, 0.12);
    color: var(--bmw-m);
    border: 1px solid rgba(226, 35, 26, 0.28);
}

.hp-card[data-zone="trans"] .hp-card__icon {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(0, 224, 199, 0.28);
}

.hp-card[data-zone="cooling"] .hp-card__icon,
.hp-card[data-zone="brakes"] .hp-card__icon {
    background: var(--primary-subtle);
    color: var(--primary-hover);
    border: 1px solid rgba(28, 105, 228, 0.28);
}

.hp-card__title {
    font-size: 1.05rem;
}

.hp-card__issues {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.hp-card__issue {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    color: var(--text-muted);
    font-size: .88rem;
}

.hp-card__issue b {
    color: var(--text);
    font-weight: 600;
}

.hp-card__freq {
    display: inline-block;
    margin-top: .75rem;
    font-family: "JetBrains Mono", monospace;
    font-size: .72rem;
    color: var(--text-dim);
    padding-top: .75rem;
    border-top: 1px solid var(--border);
}

/* =========================================================
       PRICING
       ========================================================= */
.pricing__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    align-items: stretch;
}

.price {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-2);
    padding: 2rem 1.75rem;
    display: flex;
    flex-direction: column;
    transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}

.price:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
}

/* Single allowed border-gradient: featured plan */
.price--featured {
    border: 1px solid transparent;
    position: relative;
    background:
        linear-gradient(var(--surface), var(--surface)) padding-box,
        linear-gradient(135deg, var(--primary), var(--accent)) border-box;
}

.price__badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-family: "JetBrains Mono", monospace;
    font-size: .68rem;
    font-weight: 600;
    padding: .3rem .7rem;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
}

.price__name {
    font-size: var(--fs-md);
    color: var(--text);
    margin-bottom: .5rem;
}

.price__desc {
    color: var(--text-muted);
    font-size: .85rem;
    min-height: 2.6em;
}

.price__amount {
    font-family: "Space Grotesk", sans-serif;
    font-size: var(--fs-2xl);
    color: var(--text);
    margin-block: 1.25rem;
}

.price__amount small {
    font-size: .85rem;
    color: var(--text-dim);
    font-family: "Inter", sans-serif;
    font-weight: 500;
}

.price__feats {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: 1.5rem;
    flex: 1;
}

.price__feats li {
    display: flex;
    gap: .55rem;
    align-items: flex-start;
    color: var(--text-muted);
    font-size: .88rem;
}

.price__feats li svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
    flex: 0 0 auto;
    margin-top: .15rem;
}

.price__goal {
    font-size: .72rem;
    color: var(--text-dim);
    margin-top: .5rem;
}

/* =========================================================
       FAQ accordion
       ========================================================= */
.faq__list {
    max-width: 820px;
    margin-inline: auto;
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    box-shadow: var(--sh-1);
    overflow: hidden;
    transition: border-color var(--dur-base) var(--ease);
}

.faq-item.is-open {
    border-color: var(--border-strong);
}

.faq-item__btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.4rem;
    text-align: left;
    color: var(--text);
    font-weight: 600;
    font-size: 1rem;
}

.faq-item__btn:hover {
    background: var(--surface-2);
}

.faq-item__icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    color: var(--primary-hover);
    transition: transform var(--dur-base) var(--ease);
}

.faq-item.is-open .faq-item__icon {
    transform: rotate(45deg);
}

.faq-item__panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--dur-base) var(--ease);
}

.faq-item__panel-inner {
    padding: 0 1.4rem 1.25rem;
    color: var(--text-muted);
    font-size: .92rem;
    line-height: 1.6;
}

/* =========================================================
       FINAL CTA
       ========================================================= */
.cta-final {
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-final__deco {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.cta-final__deco::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 30%;
    transform: translateX(-50%);
    width: 60vw;
    max-width: 760px;
    height: 760px;
    background: radial-gradient(circle, rgba(28, 105, 228, 0.08), transparent 60%);
}

/* BMW atmospheric photo background for CTA */
.cta-final__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

.cta-final__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    opacity: 0.14;
    filter: saturate(0.8) contrast(1.05);
}

/* Gradient overlay: ensure text legibility (darkened for contrast) */
.cta-final__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            var(--bg) 0%,
            rgba(11, 11, 13, 0.88) 18%,
            rgba(11, 11, 13, 0.82) 50%,
            rgba(11, 11, 13, 0.88) 82%,
            var(--bg) 100%);
}

@media (max-width: 767px) {
    .cta-final__bg img {
        opacity: 0.06;
    }

    /* На мобильных фон ещё темнее для читаемости */
    .cta-final__bg::after {
        background: linear-gradient(180deg,
                var(--bg) 0%,
                rgba(11, 11, 13, 0.94) 15%,
                rgba(11, 11, 13, 0.90) 50%,
                rgba(11, 11, 13, 0.94) 85%,
                var(--bg) 100%);
    }
}

.cta-final__title {
    font-size: clamp(var(--fs-2xl), 5vw, var(--fs-4xl));
    color: #ffffff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

.cta-final__sub {
    color: #FFFFFF !important;
    font-size: var(--fs-md);
    margin-top: 1.25rem;
    max-width: 52ch;
    margin-inline: auto;
    line-height: 1.6;
    /* Многослойная тень: максимальный контраст на любом фоне */
    text-shadow:
        0 0 4px rgba(0, 0, 0, 0.95),
        0 0 12px rgba(0, 0, 0, 0.8),
        0 2px 6px rgba(0, 0, 0, 0.9),
        0 4px 18px rgba(0, 0, 0, 0.85) !important;
    /* Полупрозрачная подложка для гарантированной читаемости */
    background: rgba(11, 11, 13, 0.35);
    padding: 0.5rem 1rem;
    border-radius: var(--r-sm);
}

.cta-final__btn {
    margin-top: 2.5rem;
}

/* =========================================================
       FOOTER
       ========================================================= */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-alt);
    padding-block: 2.5rem;
}

.footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.footer__cols {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer__cols a {
    color: var(--text-muted);
    font-size: .88rem;
    transition: color var(--dur-fast) var(--ease);
}

.footer__cols a:hover {
    color: var(--text);
}

.footer__copy {
    color: var(--text-dim);
    font-size: .8rem;
}

.footer__disclaimer {
    width: 100%;
    text-align: center;
    font-size: .75rem;
    color: var(--text-dim);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* =========================================================
       CARBON FIBER TEXTURE (subtle weave pattern)
       ========================================================= */
.carbon-texture {
    position: relative;
}

.carbon-texture::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.4;
    background-image:
        /* diagonal weave 1 */
        repeating-linear-gradient(45deg,
            rgba(255, 255, 255, 0.012) 0,
            rgba(255, 255, 255, 0.012) 2px,
            transparent 2px,
            transparent 6px),
        /* diagonal weave 2 */
        repeating-linear-gradient(-45deg,
            rgba(255, 255, 255, 0.012) 0,
            rgba(255, 255, 255, 0.012) 2px,
            transparent 2px,
            transparent 6px);
    mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
    -webkit-mask-image: linear-gradient(180deg, transparent, #000 20%, #000 80%, transparent);
}

:root[data-theme="light"] .carbon-texture::before {
    background-image:
        repeating-linear-gradient(45deg,
            rgba(15, 17, 21, 0.014) 0,
            rgba(15, 17, 21, 0.014) 2px,
            transparent 2px,
            transparent 6px),
        repeating-linear-gradient(-45deg,
            rgba(15, 17, 21, 0.014) 0,
            rgba(15, 17, 21, 0.014) 2px,
            transparent 2px,
            transparent 6px);
}

/* =========================================================
       M-PERFORMANCE TRICOLOUR (used sparingly)
       ========================================================= */
.m-stripe {
    display: inline-flex;
    width: 28px;
    height: 3px;
    border-radius: 2px;
    overflow: hidden;
    flex: 0 0 auto;
    vertical-align: middle;
}

.m-stripe i {
    display: block;
    flex: 1;
}

.m-stripe i:nth-child(1) {
    background: var(--m-light);
}

.m-stripe i:nth-child(2) {
    background: var(--m-navy);
}

.m-stripe i:nth-child(3) {
    background: var(--m-red);
}

/* Featured pricing card: M accent line on top */
.price--featured .price__badge {
    background: linear-gradient(90deg, var(--m-light), var(--m-navy), var(--m-red));
    box-shadow: 0 2px 8px rgba(28, 105, 228, 0.35);
}

/* =========================================================
       HERO: BMW atmospheric photo background (Carbon & Signal)
       ========================================================= */
.hero__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    overflow: hidden;
}

.hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
    opacity: 0.35;
    /* Интеграция в тёмный фон через двойную градиентную маску */
    -webkit-mask-image: linear-gradient(105deg, transparent 0%, transparent 25%, #000 55%, #000 100%),
        linear-gradient(to bottom, #000 60%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image: linear-gradient(105deg, transparent 0%, transparent 25%, #000 55%, #000 100%),
        linear-gradient(to bottom, #000 60%, transparent 100%);
    mask-composite: intersect;
}

/* Blue tint overlay для брендинга */
.hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(28, 105, 228, 0.08), transparent 50%);
    pointer-events: none;
}

/* Сохраняем старый класс для обратной совместимости */
.hero__car {
    display: none;
}

@media (max-width: 1023px) {
    .hero__bg img {
        opacity: 0.22;
        object-position: center;
    }
}

@media (max-width: 767px) {
    .hero__bg img {
        opacity: 0.15;
    }
}

/* =========================================================
       HERO photo — LIGHT THEME «ДЕНЬ»
       Фото остаётся ВИДИМЫМ и атмосферным (фирменная драма),
       но интегрировано в светлый фон: растворение слева
       (текстовая зона), мягкие fade сверху/снизу, лёгкая
       вуаль только над текстом. Правая часть с машиной — чистая.
       ========================================================= */
:root[data-theme="light"] .hero__bg img {
    opacity: 0.5 !important;
    /* перебивает Elementor-killer (opacity: 1 !important) */
    filter: grayscale(0.15) brightness(1.05);
    -webkit-mask-image:
        linear-gradient(100deg, transparent 0%, transparent 28%, #000 58%, #000 100%),
        linear-gradient(to bottom, transparent 0%, #000 12%, #000 78%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(100deg, transparent 0%, transparent 28%, #000 58%, #000 100%),
        linear-gradient(to bottom, transparent 0%, #000 12%, #000 78%, transparent 100%);
    mask-composite: intersect;
}

/* Лёгкая вуаль только над текстовой зоной — читаемость заголовка */
:root[data-theme="light"] .hero__bg::after {
    background: linear-gradient(100deg,
            var(--bg) 0%,
            rgba(250, 250, 252, 0.85) 30%,
            rgba(250, 250, 252, 0.25) 55%,
            transparent 75%);
}

@media (max-width: 1023px) {
    :root[data-theme="light"] .hero__bg img {
        opacity: 0.35 !important;
    }
}

@media (max-width: 767px) {
    :root[data-theme="light"] .hero__bg img {
        opacity: 0.25 !important;
    }
}

/* =========================================================
       Scroll reveal
       ========================================================= */
html.js .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}

html.js .reveal.in-view {
    opacity: 1;
    transform: none;
}

/* =========================================================
       Responsive
       ========================================================= */
@media (max-width:1280px) {
    .scenario-group__cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:1023px) {
    .hero__grid {
        grid-template-columns: 1fr;
    }

    .demo-widget {
        order: 2;
    }

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

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

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

    .pricing__grid {
        grid-template-columns: 1fr;
        max-width: 460px;
        margin-inline: auto;
    }
}

@media (max-width:767px) {
    .scenario-group__cards {
        grid-template-columns: 1fr;
    }

    .hero__cta-row {
        align-items: stretch;
        gap: 0.875rem;
    }

    .hero__search-form {
        flex-direction: column;
        max-width: 100%;
        gap: 0.625rem;
    }

    .hero__search-input {
        font-size: 16px;
        /* iOS anti-zoom: фиксированный размер шрифта */
        min-height: 54px;
        /* Touch-таргет Apple HIG (≥44pt) */
        padding: 0.875rem 1rem;
    }

    .hero__search-form .btn {
        width: 100%;
        min-height: 54px;
        /* Единый touch-таргет с инпутом */
        font-size: 1rem;
        justify-content: center;
    }

    .footer__inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width:480px) {
    :root {
        --pad: 1rem;
    }

    .brand__logo {
        height: 46px;
    }

    .demo-widget {
        padding: 1rem;
    }

    /* Hero search: компактные отступы на узких экранах */
    .hero__search-input {
        padding: 0.75rem 0.875rem;
    }

    .hero__search-form .btn {
        padding: 0.75rem 1rem;
    }

    /* Microcopy: уменьшаем на узких экранах */
    .hero__microcopy {
        font-size: .78rem;
    }

    /* Answer result: компактные внутренние отступы */
    .answer-result {
        padding: 1rem;
    }

    .answer-result__header {
        gap: .75rem;
    }

    .answer-result__icon {
        width: 36px;
        height: 36px;
    }
}

/* =========================================================
       Reduced motion
       ========================================================= */
@media (prefers-reduced-motion:reduce) {

    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }

    .demo-status .pulse {
        animation: none;
    }

    .demo-q__caret.blink {
        animation: none;
    }
}

/* =========================================================
       BMW EXPERT — Purchase assistant panel
       ========================================================= */
.expert-grid {
    display: grid;
    grid-template-columns: 0.85fr 1.15fr;
    gap: clamp(1.5rem, 3vw, 2.5rem);
    align-items: start;
}

.expert-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    box-shadow: var(--sh-2);
    padding: clamp(1.5rem, 3vw, 2rem);
    transition: border-color var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
    /* Фикс обрезки контента справа на мобильных (CSS Grid overflow).
       Grid-item по умолчанию имеет min-width:auto и не сжимается меньше
       самого длинного контента. min-width:0 позволяет ему сжиматься. */
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

.expert-card:hover {
    border-color: var(--border-strong);
}

.expert-card__header {
    display: flex;
    align-items: center;
    gap: .65rem;
    font-family: "JetBrains Mono", monospace;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

/* BMW model thumbnail in Expert card */
.expert-card__media {
    margin: calc(-1 * clamp(1.5rem, 3vw, 2rem)) calc(-1 * clamp(1.5rem, 3vw, 2rem)) 1.5rem;
    height: 200px;
    overflow: hidden;
    position: relative;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    border-bottom: 1px solid var(--border);
}

.expert-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Gradient overlay for seamless blend with dark card */
.expert-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(11, 11, 13, 0.2) 0%,
            transparent 30%,
            rgba(22, 22, 26, 0.8) 100%);
    pointer-events: none;
}

:root[data-theme="light"] .expert-card__media::after {
    background: linear-gradient(180deg,
            rgba(250, 250, 252, 0.15) 0%,
            transparent 30%,
            rgba(255, 255, 255, 0.85) 100%);
}

/* Model badge over image */
.expert-card__media-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 2;
    font-family: "JetBrains Mono", monospace;
    font-size: .7rem;
    font-weight: 600;
    color: var(--text);
    background: rgba(11, 11, 13, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border-strong);
    padding: .35rem .75rem;
    border-radius: var(--r-sm);
    letter-spacing: .05em;
}

:root[data-theme="light"] .expert-card__media-badge {
    background: rgba(255, 255, 255, 0.85);
}

@media (max-width: 767px) {
    .expert-card__media {
        height: 160px;
    }
}

.expert-card__header svg {
    color: var(--primary-hover);
    flex: 0 0 auto;
}

/* Parameter rows */
.expert-param {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .65rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

:root[data-theme="light"] .expert-param {
    border-bottom-color: rgba(15, 17, 21, 0.08);
}

.expert-param:last-of-type {
    border-bottom: none;
}

.expert-param__label {
    color: var(--text-dim);
    font-size: .9rem;
}

.expert-param__val {
    color: var(--text);
    font-weight: 600;
    font-size: .95rem;
    font-family: "JetBrains Mono", monospace;
}

/* AI summary box */
.expert-ai-summary {
    margin-top: 1.5rem;
    padding: 1.1rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-subtle), transparent);
    border: 1px solid rgba(28, 105, 228, 0.25);
    border-left: 3px solid var(--primary);
    border-radius: 0 var(--r-md) var(--r-md) 0;
}

.expert-ai-summary__label {
    display: inline-block;
    font-family: "JetBrains Mono", monospace;
    font-size: .68rem;
    font-weight: 600;
    color: var(--primary-hover);
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .6rem;
}

.expert-ai-summary__text {
    font-size: .92rem;
    line-height: 1.6;
    color: var(--text);
}

/* Score board */
.expert-score-board {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.expert-score-circle {
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 30% 30%, var(--primary-subtle), transparent 70%),
        var(--surface-2);
    border: 2px solid transparent;
    background-clip: padding-box;
    box-shadow: 0 0 24px rgba(28, 105, 228, 0.15), inset 0 0 12px rgba(0, 224, 199, 0.08);
    position: relative;
}

/* M-Performance tricolour дуга вокруг скоринга (92% = 9.2/10) */
.expert-score-circle::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    padding: 2px;
    background: conic-gradient(from -90deg,
            var(--m-navy) 0deg,
            var(--m-light) 165deg,
            var(--m-red) 300deg,
            rgba(255, 255, 255, 0.08) 331deg,
            rgba(255, 255, 255, 0.08) 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

:root[data-theme="light"] .expert-score-circle::before {
    background: conic-gradient(from -90deg,
            var(--m-navy) 0deg,
            var(--m-light) 165deg,
            var(--m-red) 300deg,
            rgba(15, 17, 21, 0.10) 331deg,
            rgba(15, 17, 21, 0.10) 360deg);
}

.expert-score-circle .val {
    font-family: "Space Grotesk", sans-serif;
    font-size: 2.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}

.expert-score-circle .max {
    font-size: .78rem;
    color: var(--text-dim);
    font-family: "JetBrains Mono", monospace;
}

.expert-ratings {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.rating-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.rating-label {
    font-size: .85rem;
    color: var(--text-muted);
}

.rating-stars {
    font-size: .9rem;
    letter-spacing: 1px;
    color: var(--accent);
    white-space: nowrap;
}

.rating-stars .empty {
    color: var(--text-dim);
    opacity: 0.35;
}

/* Lists */
.expert-lists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.expert-list-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .85rem;
}

.expert-list-title svg {
    flex: 0 0 auto;
}

.expert-list {
    display: flex;
    flex-direction: column;
    gap: .6rem;
}

.expert-list li {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-size: .85rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.expert-list li svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin-top: .15rem;
}

.expert-list--warn li svg {
    color: var(--bmw-m);
}

.expert-list--check li svg {
    color: var(--accent);
}

/* Comparison table */
.expert-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--r-md);
    border: 1px solid var(--border);
}

.expert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem;
}

/* На узких экранах убираем принудительный min-width,
   чтобы таблица не вызывала горизонтальный overflow страницы.
   Горизонтальный скролл остаётся внутри .expert-table-wrap. */
@media (max-width: 600px) {
    .expert-table {
        min-width: 0;
        width: 100%;
    }
}

.expert-table th,
.expert-table td {
    padding: .85rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.expert-table thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-weight: 600;
    font-size: .8rem;
    font-family: "JetBrains Mono", monospace;
}

.expert-table tbody tr:last-child td {
    border-bottom: none;
}

.expert-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

:root[data-theme="light"] .expert-table tbody tr:hover {
    background: rgba(15, 17, 21, 0.03);
}

.expert-table td {
    color: var(--text-muted);
}

.expert-table .col-highlight {
    background: rgba(28, 105, 228, 0.06);
    color: var(--text);
    font-weight: 600;
}

/* Expert responsive */
@media (max-width: 1023px) {
    .expert-grid {
        grid-template-columns: 1fr;
    }

    .expert-lists {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .expert-score-board {
        flex-direction: column;
        text-align: center;
        gap: 1.25rem;
    }

    .expert-ratings {
        width: 100%;
    }
}

/* ANSWER RESULT - API Search Results */
.answer-result {
    display: none;
    margin-top: 1.5rem;
    background: var(--surface, #111);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    padding: 1.5rem;
    animation: fadeInUp .4s ease
}

.answer-result.active {
    display: block
}

.answer-result__header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem
}

.answer-result__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary, #1C69E4);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.answer-result__icon svg {
    width: 22px;
    height: 22px;
    color: #fff
}

.answer-result__icon--error {
    background: #dc2626
}

/* Индикатор загрузки для не-hero форм (expert-форма подбора и т.п.) */
.answer-result__icon--loading {
    background: var(--primary, #1C69E4);
    animation: pulse-bg 1.2s ease-in-out infinite
}

.answer-result__icon--loading svg {
    animation: spin .8s linear infinite
}

@keyframes pulse-bg {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .6
    }
}

.answer-result__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text, #f5f5f7);
    margin-bottom: .25rem
}

.answer-result__meta {
    font-size: .85rem;
    color: var(--text-muted, #888)
}

.answer-result__body {
    color: var(--text, #f5f5f7);
    font-size: .95rem;
    line-height: 1.6;
    margin-bottom: 1rem
}

.answer-result__body p {
    margin-bottom: .5rem
}

.answer-result__body ul {
    padding-left: 1.2rem
}

.answer-result__body li {
    margin-bottom: .35rem
}

.answer-result__sources {
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    padding-top: 1rem
}

.answer-result__sources-title {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-muted, #888);
    margin-bottom: .5rem
}

.answer-result__source {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .85rem;
    padding: .35rem .7rem;
    background: var(--bg-alt, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 6px;
    margin-right: .5rem;
    margin-bottom: .35rem;
    color: var(--primary-hover, #2B7AFF);
    text-decoration: none;
    transition: border-color .2s
}

.answer-result__source:hover {
    border-color: var(--primary, #1C69E4)
}

.answer-result__source svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0
}

/* ADR-057: Model Identity Lock — бейдж «кузов · двигатель · годы» */
.answer-result__identity {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .4rem;
    margin-bottom: .75rem
}

.answer-result__identity-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: .75rem;
    letter-spacing: .02em;
    padding: .25rem .55rem;
    border-radius: 999px;
    background: var(--bg-alt, rgba(255, 255, 255, 0.04));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    color: var(--text, #f5f5f7)
}

.answer-result__identity-chip--label {
    text-transform: uppercase;
    font-size: .68rem;
    color: var(--text-muted, #888)
}

/* Статус подтверждения идентичности: зелёный / жёлтый / красный */
.answer-result__identity-chip--evidence_backed {
    border-color: rgba(48, 209, 88, .45);
    color: #30D158
}

.answer-result__identity-chip--catalog_only {
    border-color: rgba(255, 214, 10, .45);
    color: #FFD60A
}

.answer-result__identity-chip--unknown {
    border-color: rgba(255, 69, 58, .45);
    color: #FF453A
}

/* ADR-057: статус подтверждения факта внутри карточки источника */
.answer-result__source-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .1rem .35rem;
    border-radius: 4px;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    color: var(--text-muted, #888);
    flex-shrink: 0
}

.answer-result__source-badge--verified {
    border-color: rgba(48, 209, 88, .45);
    color: #30D158
}

.answer-result__source-badge--partial {
    border-color: rgba(255, 214, 10, .45);
    color: #FFD60A
}

.answer-result__source-badge--inferred {
    border-color: rgba(255, 69, 58, .4);
    color: #FF6961
}

.answer-result__tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .75rem
}

.answer-result__tag {
    font-size: .8rem;
    padding: .2rem .6rem;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted, #999)
}

.answer-result__tag--blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa
}

:root[data-theme="light"] .answer-result__tag {
    background: rgba(15, 17, 21, 0.06);
}

:root[data-theme="light"] .answer-result__tag--blue {
    color: #1D4ED8;
}

/* AI Pipeline — анимация обработки запроса */
.ai-pipeline {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--surface, #111);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
    border-radius: 12px
}

.ai-pipeline.active {
    display: flex;
    animation: fadeInUp .4s ease
}

.ai-pipeline__step {
    display: flex;
    align-items: center;
    gap: .5rem;
    opacity: .3;
    transition: opacity .3s
}

.ai-pipeline__step.active {
    opacity: 1
}

.ai-pipeline__step.done {
    opacity: .6
}

.ai-pipeline__step.done .ai-pipeline__icon {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80
}

.ai-pipeline__step.active .ai-pipeline__icon {
    background: var(--primary, #1C69E4);
    color: #fff;
    animation: pulse 1.5s ease infinite
}

.ai-pipeline__icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .3s, color .3s
}

:root[data-theme="light"] .ai-pipeline__icon {
    background: rgba(15, 17, 21, 0.06);
}

:root[data-theme="light"] .ai-pipeline__step.done .ai-pipeline__icon {
    color: #16A34A;
}

.ai-pipeline__icon svg {
    width: 18px;
    height: 18px;
    color: currentColor
}

.ai-pipeline__step:not(:last-child)::after {
    content: '';
    width: 2rem;
    height: 2px;
    background: var(--border, rgba(255, 255, 255, 0.08));
    margin-left: .5rem
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.1)
    }
}

.hero__search-form.is-loading .btn {
    pointer-events: none;
    opacity: .7
}

.hero__search-form.is-loading .btn-text::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-left: .5rem;
    vertical-align: middle
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.api-status {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    padding: .5rem .85rem;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 500;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: .4rem;
    backdrop-filter: blur(10px)
}

.api-status--online {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #4ade80
}

.api-status--offline {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171
}

:root[data-theme="light"] .api-status--online {
    color: #15803D;
}

:root[data-theme="light"] .api-status--offline {
    color: #DC2626;
}

.api-status__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pd 2s ease-in-out infinite
}

@keyframes pd {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: .4
    }
}

/* =========================================================
   ASTRA OVERRIDE LAYER
   Нейтрализует конфликты с main.min.css и inline стилями Astra
   ========================================================= */

/* Force dark background on all containers */
body.bimmerbrain-landing-v3,
body.bimmerbrain-landing-v3 #page,
body.bimmerbrain-landing-v3 .site-content,
body.bimmerbrain-landing-v3 .ast-container,
body.bimmerbrain-landing-v3 .ast-separate-container,
body.bimmerbrain-landing-v3 .ast-plain-container,
body.bimmerbrain-landing-v3 .ast-page-builder-template,
body.bimmerbrain-landing-v3 .content-area,
body.bimmerbrain-landing-v3 .site-main,
body.bimmerbrain-landing-v3 .entry-content,
body.bimmerbrain-landing-v3 .ast-article-single,
body.bimmerbrain-landing-v3 .ast-article-inner {
    background-color: var(--bg, #0B0B0D) !important;
    color: var(--text, #f5f5f7) !important;
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* Remove Astra container constraints */
body.bimmerbrain-landing-v3 .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
}

body.bimmerbrain-landing-v3 .site {
    background-color: var(--bg, #0B0B0D) !important;
    color: var(--text, #f5f5f7) !important;
}

/* Fix heading colors overridden by Astra */
body.bimmerbrain-landing-v3 h1,
body.bimmerbrain-landing-v3 h2,
body.bimmerbrain-landing-v3 h3,
body.bimmerbrain-landing-v3 h4,
body.bimmerbrain-landing-v3 h5,
body.bimmerbrain-landing-v3 h6,
body.bimmerbrain-landing-v3 .entry-content h1,
body.bimmerbrain-landing-v3 .entry-content h2,
body.bimmerbrain-landing-v3 .entry-content h3,
body.bimmerbrain-landing-v3 .entry-content h4,
body.bimmerbrain-landing-v3 .entry-content h5,
body.bimmerbrain-landing-v3 .entry-content h6,
body.bimmerbrain-landing-v3 .entry-title,
body.bimmerbrain-landing-v3 .entry-title a {
    color: var(--text, #f5f5f7) !important;
}

/* Link colors — только текстовые ссылки внутри контента.
   Навигация, футер, кнопки и карточки красятся своими компонентными правилами. */
body.bimmerbrain-landing-v3 .entry-content a {
    color: var(--accent, #00E0C7);
}

/* Remove Astra header/footer whitespace if present */
body.bimmerbrain-landing-v3 .ast-separate-container #primary,
body.bimmerbrain-landing-v3 .ast-plain-container #primary,
body.bimmerbrain-landing-v3 #primary {
    margin: 0 !important;
    padding: 0 !important;
}

/* Block Elementor lazy-load background killer */
body.bimmerbrain-landing-v3 .hero__bg img,
body.bimmerbrain-landing-v3 .cta-final__bg img,
body.bimmerbrain-landing-v3 .hero__bg,
body.bimmerbrain-landing-v3 .cta-final__bg {
    background-image: none !important;
}

body.bimmerbrain-landing-v3 .hero__bg img,
body.bimmerbrain-landing-v3 .cta-final__bg img {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Remove Astra default body margins/paddings */
body.bimmerbrain-landing-v3 {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* Hide Astra scroll-to-top (we have our own UI) */
body.bimmerbrain-landing-v3 #ast-scroll-top {
    display: none !important;
}

/* Remove Astra entry-content layout constraints */
body.bimmerbrain-landing-v3 .entry-content>* {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Fix button styles overridden by Astra */
body.bimmerbrain-landing-v3 button,
body.bimmerbrain-landing-v3 .ast-button,
body.bimmerbrain-landing-v3 .button,
body.bimmerbrain-landing-v3 input[type="submit"],
body.bimmerbrain-landing-v3 input[type="button"],
body.bimmerbrain-landing-v3 .wp-block-button__link {
    font-family: inherit !important;
    font-weight: 700 !important;
}

/* === HERO SEARCH FORM: принудительное выравнивание высот === */
/* Astra задаёт фиксированный height для input — нейтрализуем */
body.bimmerbrain-landing-v3 .hero__search-form {
    display: flex !important;
    align-items: stretch !important;
    gap: 0.5rem !important;
}

body.bimmerbrain-landing-v3 .hero__search-input {
    min-height: 56px !important;
    height: auto !important;
    padding: 1rem 1.25rem !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    box-sizing: border-box !important;
}

body.bimmerbrain-landing-v3 .hero__search-form .btn {
    min-height: 56px !important;
    height: auto !important;
    padding: 1rem 1.75rem !important;
    font-size: var(--fs-md) !important;
    line-height: 1.3 !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
}

/* Мобильные: колонка, full-width */
@media (max-width: 767px) {
    body.bimmerbrain-landing-v3 .hero__search-form {
        flex-direction: column !important;
        gap: 0.625rem !important;
    }

    body.bimmerbrain-landing-v3 .hero__search-input {
        min-height: 54px !important;
        font-size: 16px !important;
        padding: 0.875rem 1rem !important;
    }

    body.bimmerbrain-landing-v3 .hero__search-form .btn {
        width: 100% !important;
        min-height: 54px !important;
        justify-content: center !important;
    }
}

/* =========================================================
   OVERFLOW GUARD — глобальная защита от обрезки контента
   на мобильных (CSS Grid / Flexbox min-width:auto bug)
   ========================================================= */
/* Все прямые потомки grid-контейнеров получают min-width:0,
   чтобы они могли сжиматься под размер колонки, а не
   раздуваться до ширины самого длинного содержимого. */
body.bimmerbrain-landing-v3 .expert-grid>*,
body.bimmerbrain-landing-v3 .hero__grid>*,
body.bimmerbrain-landing-v3 .features__grid>*,
body.bimmerbrain-landing-v3 .scenario-group__cards>*,
body.bimmerbrain-landing-v3 .kb-split>*,
body.bimmerbrain-landing-v3 .kb-split .doc-grid>*,
body.bimmerbrain-landing-v3 .case>*,
body.bimmerbrain-landing-v3 .hotspots>*,
body.bimmerbrain-landing-v3 .hotspot__panel>*,
body.bimmerbrain-landing-v3 .pricing__grid>*,
body.bimmerbrain-landing-v3 .expert-lists>* {
    min-width: 0;
}

/* Дополнительно: перенос длинных слов/URL внутри карточек */
body.bimmerbrain-landing-v3 .card,
body.bimmerbrain-landing-v3 .doc,
body.bimmerbrain-landing-v3 .scenario-card,
body.bimmerbrain-landing-v3 .price,
body.bimmerbrain-landing-v3 .hp-card,
body.bimmerbrain-landing-v3 .faq-item__panel-inner {
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ---------- Nav: BMW Expert link (Space Grotesk акцент) ---------- */
.nav-link--expert {
    font-family: "Space Grotesk", sans-serif;
    font-weight: 600;
    letter-spacing: -0.01em;
}

/* =========================================================
       INTENT TABS + QUERY CHIPS (Hero: два сценария)
       ========================================================= */
.intent-tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
}

.intent-tab {
    position: relative;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: "Inter", system-ui, sans-serif;
    font-size: .92rem;
    font-weight: 600;
    padding: .55rem 1.15rem;
    border-radius: 999px;
    cursor: pointer;
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.intent-tab:hover {
    color: var(--text);
}

.intent-tab.is-active {
    background: var(--primary);
    color: #fff;
}

/* M-Performance tricolour микро-полоса под активным табом */
.intent-tab.is-active::after {
    content: "";
    position: absolute;
    left: 20%;
    right: 20%;
    bottom: 3px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--m-navy) 0 33%, var(--m-light) 33% 66%, var(--m-red) 66% 100%);
}

/* Чипы популярных запросов */
.hero__chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    max-width: 640px;
}

.chip--query {
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-family: inherit;
    transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.chip--query:hover {
    color: var(--text);
    border-color: var(--primary);
    background: var(--primary-subtle);
}

/* Укрупнённая поисковая строка hero */
.hero__search-form {
    max-width: 640px;
}

@media (max-width:767px) {
    .intent-tabs {
        display: flex;
        width: 100%;
    }

    .intent-tab {
        flex: 1;
        text-align: center;
        padding-inline: .5rem;
    }

    .hero__chips {
        max-width: 100%;
    }
}

/* =========================================================
       EXPERT SEARCH (строка подбора в блоке BMW Expert)
       ========================================================= */
.expert-search {
    max-width: 680px;
    margin: 0 auto 2.5rem;
    padding: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-2);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .85rem;
}

.expert-search .hero__search-form {
    max-width: 100%;
    width: 100%;
}

.expert-search__microcopy {
    justify-content: center;
}

.expert-search .answer-result {
    width: 100%;
}

.expert-example-label {
    text-align: center;
    color: var(--text-dim);
    font-size: .8rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 1.25rem;
}

@media (max-width:767px) {
    .expert-search {
        padding: 1rem;
        margin-bottom: 2rem;
    }
}

/* =========================================================
       KB ARTICLES (экспертные статьи в Knowledge Hub)
       ========================================================= */
.kb-articles {
    margin-top: clamp(2.5rem, 5vw, 4rem);
}

.kb-articles__head {
    max-width: 680px;
    margin-bottom: 1.75rem;
}

.kb-articles__title {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(var(--fs-lg), 2.5vw, var(--fs-xl));
    font-weight: 700;
    letter-spacing: -0.01em;
}

.kb-articles__desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: .6rem;
    line-height: 1.55;
}

.doc__badge--article {
    background: var(--primary-subtle);
    color: var(--primary-hover);
    border: 1px solid rgba(28, 105, 228, 0.35);
}

.doc--article {
    transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}

.doc--article:hover {
    border-color: var(--primary);
    box-shadow: 0 12px 40px rgba(28, 105, 228, 0.12), var(--sh-2);
}

/* =========================================================
       THEME TOGGLE (день/ночь)
       Кнопка [data-theme-toggle] в header + мобильном меню.
       Иконки: в тёмной теме — солнце (перейти к светлой),
       в светлой — луна (перейти к тёмной).
       ========================================================= */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition:
        color var(--dur-fast) var(--ease),
        border-color var(--dur-fast) var(--ease),
        background-color var(--dur-fast) var(--ease);
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface-2);
}

.theme-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.theme-toggle__icon {
    width: 18px;
    height: 18px;
}

/* В тёмной теме показываем солнце, в светлой — луну */
:root:not([data-theme="light"]) .theme-toggle__icon--moon,
:root[data-theme="light"] .theme-toggle__icon--sun {
    display: none;
}

/* Вариант в мобильном меню — полноширинная строка с подписью */
.theme-toggle--mobile {
    width: 100%;
    height: auto;
    padding: 0.85rem 1rem;
    border-radius: var(--r-md);
    justify-content: flex-start;
    font-family: inherit;
    font-size: var(--fs-sm);
}

/* Плавный переход между темами (класс вешает theme-toggle.js на 400 мс) */
html.theme-anim,
html.theme-anim *,
html.theme-anim *::before,
html.theme-anim *::after {
    transition:
        background-color 300ms ease,
        color 300ms ease,
        border-color 300ms ease,
        box-shadow 300ms ease !important;
}

/* =========================================================
       LIGHT THEME — финальный CTA: тёмная секция-акцент
       Глобальный Astra-фикс `h1–h6 { color: var(--text) !important }`
       в светлой теме красит заголовок в тёмный на тёмном фото.
       Форсируем светлый текст + равномерно тёмный оверлей
       (в dark-теме оверлей уходит в var(--bg) — там это слияние
       с фоном; в light это были бы светлые полосы).
       ========================================================= */
:root[data-theme="light"] body.bimmerbrain-landing-v3 .cta-final__title {
    color: #F4F4F6 !important;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}

:root[data-theme="light"] .cta-final__bg::after {
    background: linear-gradient(180deg,
            rgba(11, 11, 13, 0.94) 0%,
            rgba(11, 11, 13, 0.86) 50%,
            rgba(11, 11, 13, 0.94) 100%);
}

@media (max-width: 767px) {
    :root[data-theme="light"] .cta-final__bg::after {
        background: linear-gradient(180deg,
                rgba(11, 11, 13, 0.96) 0%,
                rgba(11, 11, 13, 0.90) 50%,
                rgba(11, 11, 13, 0.96) 100%);
    }
}

/* =========================================================
       LIGHT THEME — hotspot-карточки проблем
       Димминг opacity: 0.45 на тёмном читается как «muted»,
       на светлом — карточки-призраки. Смягчаем до 0.8:
       неактивное состояние остаётся заметным, но читаемым.
       ========================================================= */
:root[data-theme="light"] .hp-card {
    opacity: 0.8;
}