/* Анатомия машины — demo/anatomy.html. Самодостаточно: токены сайта продублированы из style.css,
   все классы с префиксом an- (чтобы не пересекаться с основным сайтом). */

:root {
  --bg: #f4f1ea;
  --paper: #fbf9f4;
  --ink: #1b1a17;
  --ink-2: #3d3a34;
  --muted: #77716a;
  --rule: #e2dcd0;
  --rule-2: #d3cbbd;
  --accent: #c2410c;
  --accent-soft: #f6e3d6;
  --st-solved: #2f7d4f;
  --st-partial: #b7791f;
  --st-unsolved: #b42318;
  --st-continued: #2b5ea7;
  --st-unknown: #6b5b95;
  --st-noted: #7a756c;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(27, 26, 23, .04), 0 8px 24px -16px rgba(27, 26, 23, .25);

  /* рентген */
  --xr-bg: #f8f5ee;
  --xr-bg-2: #efe9dd;
  --xr-grid: rgba(27, 26, 23, .055);
  --xr-ink: #24211d;
  --xr-shell: #1b1a17;
  --xr-body: rgba(255, 255, 255, .55);
  --xr-glass: rgba(120, 150, 170, .10);
  --xr-scan: #c2410c;
  --xr-glow: none;
  --tag-bg: rgba(251, 249, 244, .92);
  --tag-bg-3d: rgba(251, 249, 244, .97);
  /* 3D-вид: монохром покоя (toon), рёбра, тень */
  --m3-base: #ece5d7;
  --m3-dark: #8c8476;
  --m3-metal: #d3d0c9;
  --m3-glass: #b9ccd6;
  --m3-edge: #2a2620;
  --m3-shadow: #3b2f20;

  /* палитра систем: силовой агрегат — тёплые, трансмиссия — фиолетовые, ходовая — сине-бирюзовые,
     электрика — янтарные, кузов и салон — зелёно-оливковые */
  --c-engine: #c2410c;
  --c-timing: #8f2a12;
  --c-lube: #a46a08;
  --c-cooling: #d4473a;
  --c-fuel: #dc7a0a;
  --c-ignition: #b0182b;
  --c-turbo: #e85d1a;
  --c-exhaust: #7d4b30;
  --c-gearbox: #6a46b8;
  --c-clutch: #9a5bd0;
  --c-drive: #47379c;
  --c-suspension: #245fa6;
  --c-steering: #0d8577;
  --c-brakes: #1688b8;
  --c-electrics: #b58300;
  --c-ecu: #d29b0c;
  --c-body: #5f7628;
  --c-interior: #3a8a52;
  --c-climate: #8c9a26;
  --c-other: #77716a;
  --z-power: #c2410c;
  --z-drivetrain: #6a46b8;
  --z-chassis: #1d74ad;
  --z-electric: #c08a00;
  --z-body: #4f7d34;
  --z-offcar: #77716a;

  --fl-fuel: #e8890c;
  --fl-coolant: #1f9fd6;
  --fl-oil: #a77a1c;
  --fl-exhaust: #7d6e64;
  --fl-air: #4fa8d8;
  --fl-brake: #d63b2f;
  --fl-power: #e0aa00;
  --fl-refrigerant: #14a3ad;
  --fl-drive: #7d5ae0;

  /* тепловая шкала развёртки кузова: 0 и пять ступеней */
  --heat-0: rgba(255, 255, 255, .6);
  --heat-1: #f7e9bd;
  --heat-2: #f3c56c;
  --heat-3: #e8903e;
  --heat-4: #d1532a;
  --heat-5: #9f2219;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131210;
    --paper: #1c1a17;
    --ink: #efe9df;
    --ink-2: #cfc8bc;
    --muted: #9b948a;
    --rule: #2e2b26;
    --rule-2: #3d3932;
    --accent: #f0743c;
    --accent-soft: #3a2418;
    --st-solved: #5cba82;
    --st-partial: #e0a948;
    --st-unsolved: #f0705f;
    --st-continued: #79a6ea;
    --st-unknown: #a998d6;
    --st-noted: #a39d93;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 28px -18px rgba(0, 0, 0, .8);

    --xr-bg: #0c1419;
    --xr-bg-2: #071015;
    --xr-grid: rgba(150, 205, 240, .06);
    --xr-ink: #bfdcef;
    --xr-shell: #d9efff;
    --xr-body: rgba(150, 205, 240, .035);
    --xr-glass: rgba(150, 205, 240, .07);
    --xr-scan: #7fd3ff;
    --xr-glow: drop-shadow(0 0 4px rgba(120, 200, 255, .55));
    --tag-bg: rgba(12, 20, 25, .86);
    --tag-bg-3d: rgba(12, 20, 25, .94);
    --m3-base: #3b4c57;
    --m3-dark: #1d2830;
    --m3-metal: #6e8796;
    --m3-glass: #4d7488;
    --m3-edge: #cfe6f5;
    --m3-shadow: #000000;

    --c-engine: #ff7a45;
    --c-timing: #e0573a;
    --c-lube: #e5a33a;
    --c-cooling: #ff6b5e;
    --c-fuel: #ffa53d;
    --c-ignition: #ff4f63;
    --c-turbo: #ff8c4a;
    --c-exhaust: #c98b66;
    --c-gearbox: #a084ff;
    --c-clutch: #cf8cff;
    --c-drive: #8a7dff;
    --c-suspension: #5aa6ff;
    --c-steering: #35d0bd;
    --c-brakes: #45c3f5;
    --c-electrics: #ffd23f;
    --c-ecu: #ffe27a;
    --c-body: #a5c45a;
    --c-interior: #6fd08a;
    --c-climate: #d3e05a;
    --c-other: #a39d93;
    --z-power: #ff7a45;
    --z-drivetrain: #a084ff;
    --z-chassis: #4fb6f0;
    --z-electric: #ffd23f;
    --z-body: #8fcb6a;
    --z-offcar: #a39d93;

    --fl-fuel: #ffb23f;
    --fl-coolant: #4cc8ff;
    --fl-oil: #e5b45a;
    --fl-exhaust: #b8a99e;
    --fl-air: #9fdcff;
    --fl-brake: #ff6b5e;
    --fl-power: #ffe066;
    --fl-refrigerant: #4fe3e0;
    --fl-drive: #b29cff;

    --heat-0: rgba(150, 205, 240, .04);
    --heat-1: #4a4527;
    --heat-2: #6f5a25;
    --heat-3: #a8692a;
    --heat-4: #dc6232;
    --heat-5: #ff8a5c;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--sans); -webkit-font-smoothing: antialiased; font-variant-numeric: lining-nums;
  overflow-x: hidden;
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.an-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.an-page { min-height: 100vh; display: flex; flex-direction: column; }
.an-wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding-inline: 28px; }

/* ── Шапка ─────────────────────────────────────────────── */
.an-top { border-bottom: 1px solid var(--rule); }
.an-top-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 52px; }
.an-back {
  text-decoration: none; font-weight: 600; font-size: 15px; display: inline-flex; gap: 8px; align-items: center;
  padding: 8px 0;
}
.an-back span { transition: transform .2s; }
.an-back:hover span { transform: translateX(-3px); }
.an-back:hover { color: var(--accent); }
.an-kicker { font: 500 11.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); text-align: right; }

.an-hero { padding-block: 34px 6px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 40px; align-items: end; }
.an-title { font: 800 clamp(40px, 6.4vw, 88px)/.92 var(--serif); letter-spacing: -.02em; margin: 0; }
.an-title em { font-style: italic; font-weight: 600; color: var(--accent); }
.an-lead { margin: 0 0 6px; max-width: 560px; color: var(--ink-2); font-size: 15.5px; justify-self: end; }

/* ── Полоса управления ─────────────────────────────────── */
.an-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding-block: 22px 14px; }
.an-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; min-height: 40px; font-size: 15px; }
.an-crumbs button {
  border: 0; background: none; padding: 7px 8px; border-radius: 8px; cursor: pointer; color: var(--muted);
  font-weight: 500; display: inline-flex; align-items: center; gap: 7px; transition: color .15s, background .15s;
}
.an-crumbs button:hover { color: var(--ink); background: var(--rule); }
.an-crumbs button[aria-current] { color: var(--ink); font-weight: 600; cursor: default; background: none; }
.an-crumbs button i { width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--ink)); flex: none; }
.an-crumbs .sep { color: var(--rule-2); font-size: 18px; line-height: 1; user-select: none; }
.an-crumbs button.an-c-new { animation: an-crumb .45s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes an-crumb { from { opacity: 0; transform: translateX(-8px); } }

.an-ctrls { display: flex; gap: 10px; flex-wrap: wrap; }
.an-seg {
  display: inline-flex; background: var(--paper); border: 1px solid var(--rule-2); border-radius: 999px; padding: 3px; gap: 2px;
}
.an-seg button {
  border: 0; background: none; border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--ink-2); min-height: 36px; transition: background .2s, color .2s;
}
.an-seg button:hover { color: var(--ink); }
.an-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.an-seg button b { font: 500 11px/1 var(--mono); opacity: .7; margin-left: 5px; font-weight: 500; }

/* ── Основная сетка ────────────────────────────────────── */
.an-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 28px; padding-bottom: 56px; align-items: start; }
.an-viz { min-width: 0; }

/* ── Сцена (рентген) ───────────────────────────────────── */
.an-stage {
  position: relative; width: 100%; aspect-ratio: 16 / 8.6; min-height: 360px; max-height: 72vh;
  border-radius: 22px; overflow: hidden; isolation: isolate;
  background:
    linear-gradient(var(--xr-grid) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--xr-grid) 1px, transparent 1px) 0 0 / 32px 32px,
    radial-gradient(120% 90% at 50% 40%, var(--xr-bg), var(--xr-bg-2));
  border: 1px solid var(--rule);
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.an-stage:focus { outline: none; }
.an-stage::after { /* виньетка */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  box-shadow: inset 0 0 80px -30px rgba(0, 0, 0, .25); border-radius: inherit;
}
.an-arts, .an-arts > svg, .an-ov, .an-tags { position: absolute; inset: 0; width: 100%; height: 100%; }
.an-arts, .an-ov, .an-tags { transition: opacity .45s ease, visibility 0s; }
.an-arts > svg { opacity: 0; transition: opacity .6s ease; display: block; overflow: visible; }
.an-arts > svg.is-active { opacity: 1; }
.an-arts > svg:not(.is-active) { pointer-events: none; }
.an-ov { pointer-events: none; overflow: visible; z-index: 2; }
.an-tags { pointer-events: none; z-index: 4; }

/* ── 3D-вид ────────────────────────────────────────────── */
.an-gl { position: absolute; inset: 0; z-index: 1; opacity: 0; visibility: hidden; transition: opacity .6s ease, visibility 0s .6s; }
.an-gl-c { display: block; width: 100%; height: 100%; outline: none; cursor: grab; touch-action: pan-y; -webkit-tap-highlight-color: transparent; }
.an-gl.is-pick .an-gl-c { cursor: pointer; }
.an-stage.is-grab .an-gl-c { cursor: grabbing; }
.an-stage.is-3d .an-gl { opacity: 1; visibility: visible; transition: opacity .6s ease, visibility 0s; }
.an-stage.is-3d .an-arts { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .5s ease, visibility 0s .5s; }
.an-stage.is-3d.is-unf .an-gl { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; }
.an-stage.is-loading .an-arts { opacity: .5; }
/* под живым WebGL размытие фона у плашек пересчитывалось бы каждый кадр — в 3D плашки просто плотнее */
.an-stage.is-3d .an-tag, .an-stage.is-3d .an-load-in { -webkit-backdrop-filter: none; backdrop-filter: none; }
.an-stage.is-3d .an-tag { transition: background .2s, color .2s, opacity .3s, box-shadow .2s; }
.an-stage.is-3d .an-tag:not(:hover):not(.hot):not(:focus-visible) { background: var(--tag-bg-3d); }
.an-ov .mk.occl { opacity: .38; transition: opacity .3s; }
.an-tag.occl { opacity: .62; }
.an-tag.occl.zero { opacity: .4; }
/* лоадер 3D поверх рентгена: полоса прогресса, вёрстка не прыгает */
.an-load { position: absolute; left: 50%; bottom: 18px; z-index: 7; transform: translateX(-50%); pointer-events: none; animation: an-rise .35s both; }
.an-load-in {
  display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 10px 16px 12px; border-radius: 14px;
  background: var(--tag-bg); border: 1px solid var(--rule-2); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
}
.an-load-in i { display: block; width: 180px; height: 3px; border-radius: 2px; background: var(--rule); overflow: hidden; }
.an-load-in b { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); transition: transform .3s ease; }
/* инструменты 3D: «Разобрать», сброс ракурса */
.an-tools { position: absolute; right: 12px; top: 12px; z-index: 6; display: flex; gap: 6px; }
.an-tool {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; min-width: 36px; padding: 0 12px; justify-content: center;
  border: 1px solid var(--rule-2); border-radius: 999px; background: var(--paper); color: var(--ink); cursor: pointer;
  font: 500 13px/1 var(--sans); box-shadow: 0 6px 16px -12px rgba(0, 0, 0, .4); transition: background .2s, color .2s, border-color .2s;
}
.an-tool#camReset { padding: 0; }
.an-tool svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.an-tool:hover { border-color: var(--ink); }
.an-tool:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.an-xpl[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
#viewSeg [data-view="3d"].is-busy { position: relative; }
#viewSeg [data-view="3d"].is-busy::after { content: ""; position: absolute; right: 4px; top: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); animation: an-blink 1s ease-in-out infinite alternate; }
#viewSeg button:disabled { opacity: .4; cursor: not-allowed; }
@keyframes an-blink { from { opacity: .2; } }

.an-cap { display: flex; justify-content: space-between; align-items: center; gap: 8px 18px; flex-wrap: wrap; min-height: 30px; margin-top: 8px; padding-inline: 4px; }
.an-hint { margin: 0; font: 500 11px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); transition: opacity .3s; }
.an-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); }
.an-legend li { display: inline-flex; align-items: center; gap: 7px; animation: an-rise .4s both; }
.an-legend i { width: 22px; height: 0; border-top: 2.5px dotted var(--flc); }

/* ── Арт: рентген-стилизация. В SVG нет цветов — всё здесь ── */
.an-art * { vector-effect: non-scaling-stroke; }
.an-art #shell { filter: var(--xr-glow); transition: opacity .6s; }
.an-stage.is-flying .an-art #shell { filter: none; } /* glow не перерисовываем в полёте */
.an-art .shell-body { fill: var(--xr-body); stroke: var(--xr-shell); stroke-width: 1.4; stroke-linejoin: round; }
.an-art .shell-glass { fill: var(--xr-glass); stroke: var(--xr-shell); stroke-width: .9; stroke-opacity: .7; }
.an-art .shell-line { fill: none; stroke: var(--xr-shell); stroke-width: .9; stroke-opacity: .55; stroke-linecap: round; }
.an-art pattern * { stroke: var(--xr-ink); stroke-width: 1; stroke-opacity: .5; fill: none; vector-effect: none; }

.an-art .sys { --sc: var(--xr-ink); transition: opacity .55s ease; outline: none; }
.an-art .sys .f { fill: var(--xr-ink); fill-opacity: .045; stroke: var(--xr-ink); stroke-opacity: .42; stroke-width: 1; transition: fill .45s, fill-opacity .45s, stroke .45s, stroke-opacity .45s; }
.an-art .sys .f2 { fill: var(--xr-ink); fill-opacity: .2; stroke: none; transition: fill .45s, fill-opacity .45s; }
.an-art .sys .l { fill: none; stroke: var(--xr-ink); stroke-opacity: .5; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; transition: stroke .45s, stroke-opacity .45s; }
.an-art .sys .h { stroke: var(--xr-ink); stroke-opacity: .25; stroke-width: .8; transition: stroke .45s; }
.an-art[data-car="sedan"] .sys .h { fill: url(#hatch-sedan); }
.an-art[data-car="suv"] .sys .h { fill: url(#hatch-suv); }

/* цвет системы — только когда «включена» */
.an-art .sys.on, .an-art .sys.hot, .an-art .sys.sel, .an-art .sys.dim { --sc: var(--sys-c); }
.an-art .sys.on .f, .an-art .sys.hot .f { fill: var(--sc); fill-opacity: .2; stroke: var(--sc); stroke-opacity: .95; }
.an-art .sys.on .f2, .an-art .sys.hot .f2 { fill: var(--sc); fill-opacity: .55; }
.an-art .sys.on .l, .an-art .sys.hot .l, .an-art .sys.on .h, .an-art .sys.hot .h { stroke: var(--sc); stroke-opacity: .95; }
.an-art .sys.hot .f { fill-opacity: .34; }
.an-art .sys.sel .f { fill: var(--sc); fill-opacity: .38; stroke: var(--sc); stroke-opacity: 1; }
.an-art .sys.sel .f2 { fill: var(--sc); fill-opacity: .8; }
.an-art .sys.sel .l, .an-art .sys.sel .h { stroke: var(--sc); stroke-opacity: 1; }
.an-art .sys.dim { opacity: .3; }
.an-art .sys.dim .f { fill: var(--sc); fill-opacity: .08; stroke: var(--sc); stroke-opacity: .5; }
.an-art .sys.dim .l, .an-art .sys.dim .h { stroke: var(--sc); stroke-opacity: .5; }
.an-art .sys.ghost { opacity: .1; pointer-events: none; }
.an-art.has-hot .sys:not(.hot) { opacity: .4; }
.an-art .sys.inert { pointer-events: none; }
.an-art.lvl-0 .sys, .an-art.lvl-1 .sys.on, .an-art.lvl-1 .sys.hot { cursor: pointer; }
.an-art.lvl-0 #shell { opacity: 1; }

/* узлы внутри выбранной системы */
.an-art .sys.sel .node { cursor: pointer; transition: opacity .45s; outline: none; }
.an-art.lvl-3 .sys.sel .node { opacity: .32; }
.an-art.lvl-3 .sys.sel .node.on { opacity: 1; }
.an-art .sys.sel .node.on .f { fill-opacity: .9; stroke-width: 1.8; }
.an-art .sys.sel .node.on .f2 { fill-opacity: 1; }
.an-art .sys.sel .node.hot .f { fill-opacity: .7; }
.an-art.lvl-3 .sys.sel .node.hot { opacity: .85; }
.an-art .node.pulse .f { animation: an-node-pulse .9s ease-in-out infinite alternate; }
@keyframes an-node-pulse { to { fill-opacity: .95; stroke-width: 2.4; } }
.an-art .sys:focus-visible .f { stroke-width: 2.6; stroke-opacity: 1; }
.an-art .node:focus-visible .f { stroke-width: 2.6; fill-opacity: .9; }

/* потоки */
.an-art .flow, .an-art .flow-bed { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .5s; pointer-events: none; }
.an-art .flow { stroke-width: 2.6; stroke-dasharray: 2 11; }
.an-art .flow-bed { stroke-width: 5; }
.an-art .flow.on { opacity: 1; animation: an-flow 1.1s linear infinite; }
.an-art .flow-bed.on { opacity: .16; }
@keyframes an-flow { to { stroke-dashoffset: -26; } }
.an-art .flow-fuel, .an-art .flow-bed.flow-fuel { stroke: var(--fl-fuel); }
.an-art .flow-coolant { stroke: var(--fl-coolant); }
.an-art .flow-oil { stroke: var(--fl-oil); }
.an-art .flow-exhaust { stroke: var(--fl-exhaust); }
.an-art .flow-air { stroke: var(--fl-air); }
.an-art .flow-brake { stroke: var(--fl-brake); }
.an-art .flow-power { stroke: var(--fl-power); }
.an-art .flow-refrigerant { stroke: var(--fl-refrigerant); }
.an-art .flow-drive { stroke: var(--fl-drive); }
.an-art .flow-exhaust.on { animation-duration: 1.6s; }
.an-art .flow-power.on { animation-duration: .6s; }
/* в полёте камеры потоки не перерисовываем каждый кадр */
.an-stage.is-flying .an-art .flow.on { animation-play-state: paused; }
/* в полёте — без переходов цвета/прозрачности у систем (классы встают сразу) и без штриховки-паттерна:
   паттерн перерастеризуется на каждом новом масштабе */
.an-stage.is-flying .an-art .sys, .an-stage.is-flying .an-art .sys * { transition: none !important; }
.an-stage.is-flying .an-art .sys .h { fill: var(--xr-ink); fill-opacity: .07; }

/* интро-скан */
.an-scan-line { stroke: var(--xr-scan); stroke-width: 1.6; }
.an-scan-glow { fill: url(#an-scan-grad); }
.an-scan-grad-a { stop-color: var(--xr-scan); stop-opacity: 0; }
.an-scan-grad-b { stop-color: var(--xr-scan); stop-opacity: .38; }

/* цвета систем → переменная --sys-c */
#sys-engine, [data-s="engine"] { --sys-c: var(--c-engine); }
#sys-timing, [data-s="timing"] { --sys-c: var(--c-timing); }
#sys-lube, [data-s="lube"] { --sys-c: var(--c-lube); }
#sys-cooling, [data-s="cooling"] { --sys-c: var(--c-cooling); }
#sys-fuel, [data-s="fuel"] { --sys-c: var(--c-fuel); }
#sys-ignition, [data-s="ignition"] { --sys-c: var(--c-ignition); }
#sys-turbo, [data-s="turbo"] { --sys-c: var(--c-turbo); }
#sys-exhaust, [data-s="exhaust"] { --sys-c: var(--c-exhaust); }
#sys-gearbox, [data-s="gearbox"] { --sys-c: var(--c-gearbox); }
#sys-clutch, [data-s="clutch"] { --sys-c: var(--c-clutch); }
#sys-drive, [data-s="drive"] { --sys-c: var(--c-drive); }
#sys-suspension, [data-s="suspension"] { --sys-c: var(--c-suspension); }
#sys-steering, [data-s="steering"] { --sys-c: var(--c-steering); }
#sys-brakes, [data-s="brakes"] { --sys-c: var(--c-brakes); }
#sys-electrics, [data-s="electrics"] { --sys-c: var(--c-electrics); }
#sys-ecu, [data-s="ecu"] { --sys-c: var(--c-ecu); }
#sys-body, [data-s="body"] { --sys-c: var(--c-body); }
#sys-interior, [data-s="interior"] { --sys-c: var(--c-interior); }
#sys-climate, [data-s="climate"] { --sys-c: var(--c-climate); }
#sys-other, [data-s="other"] { --sys-c: var(--c-other); }
[data-z="power"] { --sys-c: var(--z-power); }
[data-z="drivetrain"] { --sys-c: var(--z-drivetrain); }
[data-z="chassis"] { --sys-c: var(--z-chassis); }
[data-z="electric"] { --sys-c: var(--z-electric); }
[data-z="body"] { --sys-c: var(--z-body); }
[data-z="offcar"] { --sys-c: var(--z-offcar); }

/* ── Оверлей: маркеры, выноски, плашки ─────────────────── */
.an-ov .ld { fill: none; stroke: var(--sys-c, var(--xr-ink)); stroke-width: 1; stroke-opacity: .75; }
.an-ov .ld.in { animation: an-draw .6s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes an-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
.an-ov .mk { pointer-events: all; cursor: pointer; }
.an-ov .mk-hit { fill: transparent; }
.an-ov .mk-heat { fill: var(--sys-c); stroke: var(--sys-c); stroke-width: 1.6; stroke-opacity: .85; transition: r .4s, fill-opacity .3s; }
.an-ov .mk-dot { fill: var(--sys-c); stroke: var(--xr-bg); stroke-width: 1.5; }
.an-ov .mk-zero .mk-dot { fill: var(--xr-bg); stroke: var(--sys-c); }
.an-ov .mk-ring { fill: none; stroke: var(--sys-c); stroke-width: 1.4; opacity: 0; transform-box: fill-box; transform-origin: center; }
.an-ov .mk.hot .mk-ring, .an-ov .mk.pulse .mk-ring, .an-ov .mk.sel .mk-ring { animation: an-ring 1.4s cubic-bezier(.2, .6, .3, 1) infinite; }
.an-ov .mk.sel .mk-heat { filter: url(#an-glow); }
.an-ov .mk.hot .mk-heat, .an-ov .mk.pulse .mk-heat { fill-opacity: .35; }
.an-ov .mk.sel .mk-heat { fill-opacity: .12; }
@keyframes an-ring { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.2); } }
.an-ov .mk-in { animation: an-pop .5s cubic-bezier(.2, 1.4, .4, 1) both; transform-box: fill-box; transform-origin: center; }
@keyframes an-pop { from { opacity: 0; transform: scale(.2); } }
.an-ov.is-off .ld, .an-ov.is-off .mk, .an-ov.is-off .mk.occl { opacity: 0; transition: opacity .15s; }

.an-tag {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  min-height: 34px; padding: 5px 7px 5px 11px; border-radius: 999px;
  background: var(--tag-bg); color: var(--ink); border: 1px solid var(--sys-c);
  font: 500 13px/1.1 var(--sans); box-shadow: 0 6px 16px -10px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: background .2s, color .2s, opacity .25s, box-shadow .2s;
  will-change: transform;
}
.an-tag::before { content: ""; position: absolute; inset: -4px -2px; } /* зона нажатия ≥ 40px */
.an-tag .tl { overflow: hidden; text-overflow: ellipsis; }
.an-tags.tight .an-tag .tl { max-width: 96px; }
.an-tags.num .an-tag .tl, .an-tags.num .an-tag i { display: none; }
.an-tags.num .an-tag { padding: 4px; min-height: 0; gap: 0; }
.an-tag i { width: 8px; height: 8px; border-radius: 50%; background: var(--sys-c); flex: none; }
.an-tag b {
  font: 500 11.5px/1 var(--mono); padding: 4px 6px; border-radius: 999px; background: var(--sys-c); color: var(--xr-bg);
  min-width: 22px; text-align: center;
}
.an-tag:hover, .an-tag.hot, .an-tag:focus-visible { background: var(--sys-c); color: var(--xr-bg); outline: none; }
.an-tag:hover b, .an-tag.hot b, .an-tag:focus-visible b { background: var(--xr-bg); color: var(--sys-c); }
.an-tag:hover i, .an-tag.hot i { background: var(--xr-bg); }
.an-tag.zero { opacity: .55; }
.an-tag.big { font: 600 15px/1.1 var(--sans); padding: 7px 8px 7px 14px; min-height: 40px; }
.an-tag.big b { font-size: 12.5px; padding: 5px 8px; }
.an-tag.in { animation: an-tag-in .5s cubic-bezier(.2, .9, .25, 1) both; }
@keyframes an-tag-in { from { opacity: 0; translate: 0 6px; } }
.an-tags.is-off .an-tag { opacity: 0; pointer-events: none; transition: opacity .15s; }

/* ── Сбоку / Развёртка ─────────────────────────────────── */
.an-vsw { position: absolute; left: 12px; top: 12px; z-index: 6; box-shadow: 0 6px 16px -12px rgba(0, 0, 0, .4); }
.an-vsw button { min-height: 32px; padding: 5px 12px; font-size: 13px; }
.an-stage.is-unf .an-arts, .an-stage.is-unf .an-ov, .an-stage.is-unf .an-tags { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .45s ease, visibility 0s .45s; }
.an-unf { position: absolute; inset: 0; z-index: 4; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .45s ease, visibility 0s .45s; }
.an-stage.is-unf .an-unf { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .45s ease, visibility 0s; }
.an-unf-art { position: absolute; display: block; overflow: visible; }
.an-unf-art * { vector-effect: non-scaling-stroke; }
.an-unf-art #unfold-shell .f { fill: var(--xr-ink); fill-opacity: .04; stroke: var(--xr-ink); stroke-opacity: .35; stroke-width: 1; }
.an-unf-art #unfold-shell .f2 { fill: var(--xr-ink); fill-opacity: .14; stroke: none; }
.an-unf-art #unfold-shell .l { fill: none; stroke: var(--xr-shell); stroke-opacity: .45; stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.an-unf-art #unfold-shell .h { fill: none; stroke: var(--xr-ink); stroke-opacity: .3; stroke-width: .8; stroke-dasharray: 3 3; }
.an-unf-art .shell-body { fill: var(--xr-body); stroke: var(--xr-shell); stroke-width: 1.2; stroke-linejoin: round; }
.an-unf-art .shell-line { fill: none; stroke: var(--xr-shell); stroke-width: .9; stroke-opacity: .55; stroke-linecap: round; stroke-linejoin: round; }
/* ручки, фары, номера — поверх панелей, но «прозрачны» для мыши и не красятся тепловой картой */
.an-unf-art #unfold-marks { pointer-events: none; }
.an-unf-art #unfold-marks .shell-line, .an-unf-art #unfold-marks path { fill: none; stroke: var(--xr-shell); stroke-opacity: .6; stroke-width: .9; }
.an-unf-art .panel {
  fill: var(--heat-0); stroke: var(--xr-shell); stroke-opacity: .8; stroke-width: 1.1; stroke-linejoin: round; cursor: pointer;
  transition: fill .45s, opacity .3s, stroke-width .2s, stroke .2s;
}
.an-unf-art .panel.glass { stroke-opacity: .6; }
.an-unf-art .panel.h1 { fill: var(--heat-1); } .an-unf-art .panel.h2 { fill: var(--heat-2); }
.an-unf-art .panel.h3 { fill: var(--heat-3); } .an-unf-art .panel.h4 { fill: var(--heat-4); }
.an-unf-art .panel.h5 { fill: var(--heat-5); }
.an-unf-art .panel.glass { fill-opacity: .78; }
.an-unf-art .panel.hot { stroke: var(--ink); stroke-opacity: 1; stroke-width: 2.4; }
.an-unf.has-hot .an-unf-art .panel:not(.hot) { opacity: .55; }
.an-unf.has-sel .an-unf-art .panel:not(.sel) { opacity: .28; }
.an-unf.has-sel .an-unf-art .panel.hot:not(.sel) { opacity: .6; }
.an-unf-art .panel.sel { stroke: var(--ink); stroke-opacity: 1; stroke-width: 2.6; }

.an-unf-pills { position: absolute; inset: 0; pointer-events: none; }
.an-upill {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; border: 1px solid var(--rule-2);
  font: 500 11.5px/1 var(--mono); padding: 4px 7px; min-width: 26px; border-radius: 999px;
  background: var(--tag-bg); color: var(--ink); box-shadow: 0 4px 12px -8px rgba(0, 0, 0, .5);
  transition: background .2s, color .2s, opacity .3s;
}
.an-upill::before { content: ""; position: absolute; inset: -8px; } /* зона нажатия */
.an-upill.zero { color: var(--muted); }
.an-upill:hover, .an-upill.hot, .an-upill:focus-visible, .an-upill.sel { background: var(--ink); color: var(--bg); border-color: var(--ink); outline: none; }
.an-unf.has-sel .an-upill:not(.sel) { opacity: .5; }
.an-unf.sm .an-upill { font-size: 10px; padding: 3px 5px; min-width: 20px; }

.an-unf-side { position: absolute; z-index: 1; display: flex; flex-direction: column; gap: 18px; pointer-events: none; }
.an-unf-side button { pointer-events: auto; }
.an-heat-t { margin: 0 0 7px; font: 500 10.5px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.an-heat-bar { display: flex; gap: 2px; margin-bottom: 20px; }
.an-heat-bar i { flex: 1; height: 12px; border-radius: 2px; position: relative; background: var(--heat-1); min-width: 20px; }
.an-heat-bar i:first-child { border-radius: 6px 2px 2px 6px; } .an-heat-bar i:last-child { border-radius: 2px 6px 6px 2px; }
.an-heat-bar i.h2 { background: var(--heat-2); } .an-heat-bar i.h3 { background: var(--heat-3); }
.an-heat-bar i.h4 { background: var(--heat-4); } .an-heat-bar i.h5 { background: var(--heat-5); }
.an-heat-bar span { position: absolute; right: 0; top: 15px; font: 500 10.5px/1 var(--mono); color: var(--ink-2); transform: translateX(40%); }
.an-heat-bar i:last-child span { transform: none; }
.an-heat-0 { margin: 22px 0 0; font-size: 12px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.an-heat-0 i { width: 18px; height: 10px; border-radius: 2px; background: var(--heat-0); border: 1px solid var(--rule-2); }
.an-loose { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.an-loose .an-heat-t { margin-bottom: 1px; }
.an-lchip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; cursor: pointer;
  border: 1px dashed var(--rule-2); background: var(--tag-bg); border-radius: 12px; padding: 7px 7px 7px 11px; min-height: 36px;
  font: 500 13px/1.2 var(--sans); color: var(--ink); transition: background .2s, color .2s, border-color .2s;
}
.an-lchip span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-lchip b { font: 500 11.5px/1 var(--mono); padding: 4px 6px; border-radius: 999px; background: var(--sys-c); color: var(--xr-bg); flex: none; }
.an-lchip.zero b { background: var(--rule-2); color: var(--ink); }
.an-lchip:hover, .an-lchip.hot, .an-lchip:focus-visible { border-style: solid; border-color: var(--ink); outline: none; }
.an-lchip.sel { background: var(--ink); color: var(--bg); border-style: solid; border-color: var(--ink); }
.an-lchip.sel b { background: var(--bg); color: var(--ink); }
/* узкая сцена: шкала — справа сверху, чипы — строкой внизу */
.an-unf.row .an-unf-side { left: 10px; right: 10px; top: 0; bottom: auto; gap: 0; }
.an-unf.row .an-heat { position: absolute; right: 0; top: 12px; width: 132px; }
.an-unf.row .an-heat.is-low { top: 52px; }
.an-unf.row .an-heat-t { margin-bottom: 4px; font-size: 9.5px; }
.an-unf.row .an-heat-bar { margin-bottom: 0; }
.an-unf.row .an-heat-bar i { height: 9px; min-width: 0; }
.an-unf.row .an-heat-bar span { top: 11px; font-size: 9.5px; }
.an-unf.row .an-heat-0 { display: none; }
.an-unf.row .an-loose { position: absolute; left: 0; right: 0; bottom: 0; flex-direction: row; flex-wrap: wrap; }
.an-unf.row .an-loose .an-heat-t { display: none; }
.an-unf.row .an-lchip { flex: 1 1 0; min-width: 0; min-height: 34px; font-size: 12.5px; padding: 5px 5px 5px 9px; }
.an-tip {
  position: absolute; left: 0; top: 0; z-index: 7; pointer-events: none; white-space: nowrap;
  background: var(--ink); color: var(--bg); font: 500 13px/1.2 var(--sans); padding: 6px 10px; border-radius: 8px;
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .5);
}

/* ── Под машиной ───────────────────────────────────────── */
.an-under { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 14px; }
.an-other {
  display: inline-flex; align-items: center; gap: 12px; padding: 8px 10px 8px 12px; min-height: 48px;
  border: 1px dashed var(--rule-2); border-radius: 14px; background: var(--paper); cursor: pointer; text-align: left;
  transition: border-color .2s, background .2s;
}
.an-other:hover, .an-other.is-on { border-color: var(--ink); border-style: solid; }
.an-other.is-on { background: var(--ink); color: var(--bg); }
.an-other-ico { font-size: 18px; color: var(--muted); }
.an-other b { display: block; font-size: 14.5px; }
.an-other small { display: block; font-size: 12px; color: var(--muted); line-height: 1.2; }
.an-other.is-on small { color: inherit; opacity: .7; }
.an-other em { font: 500 12px/1 var(--mono); font-style: normal; padding: 5px 7px; border-radius: 999px; background: var(--rule); color: var(--ink); }
.an-search {
  display: flex; align-items: center; gap: 8px; background: var(--paper); border: 1.5px solid var(--rule-2);
  border-radius: 999px; padding: 0 16px; min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
.an-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.an-search svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.an-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; padding: 10px 0; }
.an-kinds { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; max-width: 210px; line-height: 1.25; }
.an-kinds input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }

/* указатель систем (дублирующая навигация) */
.an-index { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; margin-top: 28px; padding-top: 18px; border-top: 2px solid var(--ink); }
.an-index h3 { margin: 0 0 6px; font: 600 15px/1.2 var(--serif); }
.an-index h3 button { all: unset; cursor: pointer; display: inline-flex; gap: 7px; align-items: baseline; }
.an-index h3 button:hover { color: var(--accent); }
.an-index h3 button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.an-index h3 i { width: 9px; height: 9px; border-radius: 50%; background: var(--sys-c); display: inline-block; flex: none; }
.an-index ul { list-style: none; margin: 0; padding: 0; }
.an-index li button {
  width: 100%; display: flex; justify-content: space-between; gap: 6px; border: 0; background: none; padding: 5px 6px; margin: 0 -6px;
  border-radius: 7px; cursor: pointer; font-size: 13.5px; color: var(--ink-2); text-align: left;
}
.an-index li button span { font: 500 11px/1.6 var(--mono); color: var(--muted); }
.an-index li button:hover { background: var(--rule); color: var(--ink); }
.an-index li button.is-on { background: var(--sys-c); color: var(--xr-bg); }
.an-index li button.is-on span { color: inherit; opacity: .8; }

/* ── Панель ────────────────────────────────────────────── */
.an-panel {
  position: sticky; top: 16px; max-height: calc(100vh - 32px); display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 22px; box-shadow: var(--shadow); overflow: hidden;
}
.an-sheet-head { display: none; }
.an-panel-body { overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 26px; outline: none; scrollbar-width: thin; }
.an-panel-body.an-enter > * { animation: an-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.an-panel-body.an-enter > *:nth-child(2) { animation-delay: .04s; }
.an-panel-body.an-enter > *:nth-child(3) { animation-delay: .08s; }
.an-panel-body.an-enter > *:nth-child(4) { animation-delay: .12s; }
.an-panel-body.an-enter > *:nth-child(n+5) { animation-delay: .16s; }
@keyframes an-rise { from { opacity: 0; transform: translateY(10px); } }

.an-eyebrow { margin: 0 0 6px; font: 500 11px/1.2 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--sys-c, var(--accent)); display: flex; gap: 8px; align-items: center; }
.an-eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.an-h { margin: 0; font: 700 clamp(28px, 3vw, 36px)/1.02 var(--serif); letter-spacing: -.01em; }
.an-big { display: flex; align-items: baseline; gap: 10px; margin: 14px 0 4px; flex-wrap: wrap; }
.an-big b { font: 600 52px/.9 var(--serif); color: var(--sys-c, var(--ink)); font-variant-numeric: lining-nums tabular-nums; }
.an-big span { color: var(--muted); font-size: 14px; }
.an-sub { margin: 4px 0 0; color: var(--ink-2); font-size: 14px; }
.an-sec { margin-top: 22px; }
.an-sec > h3 { margin: 0 0 10px; font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }

/* полоски */
.an-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.an-bars button {
  width: 100%; border: 0; background: none; padding: 7px 8px; margin: 0; border-radius: 10px; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: center; transition: background .15s;
}
.an-bars button:hover, .an-bars button.hot { background: var(--bg); }
.an-bars button:disabled { cursor: default; }
.an-bars .nm { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.an-bars .nm i { width: 8px; height: 8px; border-radius: 50%; background: var(--sys-c); flex: none; }
.an-bars .n { font: 500 12px/1 var(--mono); color: var(--ink-2); }
.an-bars .tr { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--rule); overflow: hidden; }
.an-bars .tr s { display: block; height: 100%; width: var(--w); background: var(--sys-c); border-radius: inherit; transform-origin: left; animation: an-grow .7s cubic-bezier(.2, .8, .2, 1) both; }
.an-bars li:nth-child(2) s { animation-delay: .03s; } .an-bars li:nth-child(3) s { animation-delay: .06s; }
.an-bars li:nth-child(4) s { animation-delay: .09s; } .an-bars li:nth-child(n+5) s { animation-delay: .12s; }
@keyframes an-grow { from { transform: scaleX(0); } }
.an-bars .misc .nm { color: var(--muted); font-style: italic; font-weight: 400; }
.an-bars .misc .tr s { background: repeating-linear-gradient(90deg, var(--sys-c) 0 4px, transparent 4px 7px); }
.an-bars button.is-on { background: var(--bg); box-shadow: inset 3px 0 0 var(--sys-c); }
.an-bars .sysl { font-size: 11.5px; color: var(--muted); font-weight: 400; }

/* облако симптомов, марки */
.an-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.an-chip { font-size: 13px; padding: 5px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--rule); display: inline-flex; gap: 6px; align-items: baseline; }
.an-chip b { font: 500 11px/1 var(--mono); color: var(--muted); }
.an-chip.l1 { font-size: 14.5px; border-color: var(--sys-c); }
.an-causes { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.an-causes li { font-size: 14px; display: flex; gap: 10px; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed var(--rule); }
.an-causes li:last-child { border-bottom: 0; }
.an-causes b { font: 500 11px/1.6 var(--mono); color: var(--muted); white-space: nowrap; }

/* карточки поломок */
.an-list { display: grid; gap: 10px; }
.an-list.filtering .an-card:not(.match) { opacity: .35; }
.an-card {
  border: 1px solid var(--rule); border-radius: 14px; padding: 12px 14px 12px; background: var(--bg);
  position: relative; transition: border-color .2s, opacity .25s, transform .2s, box-shadow .2s;
}
.an-card::before { content: ""; position: absolute; left: -1px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--stc, var(--muted)); }
.an-card:hover, .an-card.match { border-color: var(--sys-c, var(--ink)); }
.an-card:hover { box-shadow: var(--shadow); }
.an-card-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 12.5px; color: var(--muted); }
.an-car { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.an-st { display: inline-flex; align-items: center; gap: 5px; color: var(--stc); font-weight: 600; white-space: nowrap; font-size: 12px; }
.an-st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.st-solved { --stc: var(--st-solved); } .st-partial { --stc: var(--st-partial); } .st-unsolved { --stc: var(--st-unsolved); }
.st-continued { --stc: var(--st-continued); } .st-unknown { --stc: var(--st-unknown); } .st-noted { --stc: var(--st-noted); }
.an-sym { margin: 6px 0 0; font-size: 15px; font-weight: 500; line-height: 1.35; }
.an-rc { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.an-rc span { color: var(--muted); }
.an-card-ft { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.an-ntag { font: 500 11px/1.2 var(--mono); color: var(--sys-c, var(--muted)); letter-spacing: .03em; display: inline-flex; gap: 6px; align-items: center; min-width: 0; }
.an-ntag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.an-tc {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px; background: var(--ink); color: var(--bg); min-height: 34px;
  transition: background .15s, transform .15s;
}
.an-tc:hover { background: var(--accent); transform: translateY(-1px); }
.an-tc code { font: 500 12px/1 var(--mono); }
.an-more { width: 100%; margin-top: 10px; padding: 11px; border: 1px dashed var(--rule-2); background: none; border-radius: 12px; cursor: pointer; font-weight: 500; color: var(--ink-2); }
.an-more:hover { border-color: var(--ink); color: var(--ink); }
.an-empty { color: var(--muted); font-size: 14px; padding: 14px 0; }
.an-note { margin: 18px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.an-up {
  border: 0; background: none; padding: 6px 0; margin-bottom: 8px; cursor: pointer; color: var(--muted); font-size: 13.5px;
  display: inline-flex; gap: 6px; align-items: center;
}
.an-up:hover { color: var(--ink); }
.an-search-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.an-clear { border: 1px solid var(--rule-2); background: none; border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; }

/* ── Подвал ────────────────────────────────────────────── */
.an-foot { border-top: 1px solid var(--rule); margin-top: auto; }
.an-foot-inner { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-block: 18px 16px; flex-wrap: wrap; }
.an-foot-note { margin: 0; font-size: 12.5px; color: var(--muted); max-width: 720px; }
.sign { margin: 0; font-size: 12px; color: var(--muted); opacity: .8; user-select: none; }

/* ── Адаптив ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .an-main { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
  .an-index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .an-hero { grid-template-columns: 1fr; }
  .an-lead { justify-self: start; }
}

@media (max-width: 1000px) and (min-width: 721px) {
  .an-main { grid-template-columns: minmax(0, 1fr); }
  .an-panel { position: static; max-height: none; }
  .an-panel-body { overflow: visible; }
}

@media (max-width: 720px) {
  .an-wrap { padding-inline: 14px; }
  .an-top-in { min-height: 46px; }
  .an-kicker { font-size: 10px; }
  .an-hero { padding-block: 10px 0; }
  .an-title { font-size: 30px; }
  .an-lead { display: none; }
  .an-bar { padding-block: 12px 8px; gap: 8px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "car car" "crumbs view"; align-items: center; }
  .an-ctrls { display: contents; }
  #carSeg { grid-area: car; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #viewSeg { grid-area: view; align-self: start; }
  .an-seg button { padding: 6px 10px; font-size: 13.5px; min-height: 38px; white-space: nowrap; }
  .an-crumbs { grid-area: crumbs; font-size: 14px; min-height: 40px; flex-wrap: wrap; padding-left: 0; }
  .an-crumbs::-webkit-scrollbar { display: none; }
  .an-crumbs button { padding: 6px 5px; white-space: nowrap; flex: none; }
  .an-crumbs button i { display: none; }
  .an-cap { margin-top: 6px; }
  .an-main { display: block; padding-bottom: calc(38dvh + 24px); }
  .an-stage { aspect-ratio: auto; height: min(58vw + 84px, 44dvh); min-height: 260px; border-radius: 16px; }
  .an-stage::after { box-shadow: inset 0 0 40px -20px rgba(0, 0, 0, .25); }
  .an-art #shell { filter: none; } /* без glow на телефонах */
  .an-under { grid-template-columns: 1fr; }
  .an-other { width: 100%; }
  .an-other em { margin-left: auto; }
  .an-kinds { max-width: none; }
  .an-index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .an-tag { font-size: 12px; min-height: 30px; padding: 4px 5px 4px 9px; gap: 6px; }
  .an-tag::before { inset: -6px -3px; }
  .an-tag b { font-size: 10.5px; padding: 3px 5px; min-width: 18px; }
  .an-tag.big { font-size: 12.5px; min-height: 32px; padding: 4px 5px 4px 10px; }
  .an-tag i { display: none; }
  /* «плотный» режим раскладки на телефоне: мельче шрифт и поля, чтобы подписи остались */
  .an-tags.tight .an-tag, .an-tags.tight .an-tag.big { font-size: 11.5px; min-height: 28px; padding: 3px 4px 3px 8px; gap: 4px; }
  .an-tags.tight .an-tag .tl { max-width: 84px; }
  .an-tags.tight .an-tag b { padding: 3px 4px; min-width: 16px; font-size: 10px; }

  /* шторка */
  .an-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 30; max-height: none;
    height: 90dvh; border-radius: 20px 20px 0 0; border-bottom: 0;
    box-shadow: 0 -12px 40px -16px rgba(0, 0, 0, .4);
    transform: translateY(calc(90dvh - var(--sh, 38dvh)));
    transition: transform .42s cubic-bezier(.2, .85, .25, 1);
    will-change: transform;
  }
  .an-panel[data-sheet="full"] { --sh: 90dvh; }
  .an-panel[data-sheet="peek"] { --sh: var(--sh-peek, 38dvh); }
  .an-panel[data-sheet="min"] { --sh: 76px; }
  .an-panel.dragging { transition: none; }
  .an-sheet-head { display: block; flex: none; touch-action: none; cursor: grab; padding: 6px 0 2px; }
  .an-grip { display: block; width: 100%; height: 30px; border: 0; background: none; cursor: grab; padding: 0; }
  .an-grip i { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--rule-2); margin: 0 auto; }
  .an-panel-body { padding: 4px 16px calc(28px + env(safe-area-inset-bottom)); flex: 1; }
  .an-h { font-size: 26px; }
  .an-big { margin: 8px 0 2px; }
  .an-big b { font-size: 40px; }
  .an-foot-inner { padding-bottom: 20px; }
}

@media (max-width: 380px) {
  .an-back { font-size: 14px; white-space: nowrap; }
  .an-kicker { font-size: 9.5px; letter-spacing: .06em; }
  .an-seg button { padding: 6px 4px; font-size: 13px; }
  .an-vsw button { padding: 5px 9px; }
  .an-tool { min-height: 32px; padding: 0 9px; font-size: 12.5px; }
  .an-xpl span { display: none; } /* узко: только значок, подпись — в aria-label */
  .an-xpl { padding: 0; }
}

/* низкий ландшафт (телефон боком): шапка компактнее, сцена — во всю высоту экрана */
@media (max-height: 520px) and (min-width: 721px) {
  .an-top-in { min-height: 40px; }
  .an-hero { padding-block: 8px 0; }
  .an-title { font-size: 34px; }
  .an-lead { display: none; }
  .an-bar { padding-block: 8px; }
  .an-stage { aspect-ratio: auto; min-height: 240px; height: calc(100dvh - 20px); max-height: none; }
  .an-panel { top: 8px; max-height: calc(100dvh - 16px); }
}

@media (hover: none) {
  .an-tag:hover { background: var(--tag-bg); color: var(--ink); }
  .an-tag:hover b { background: var(--sys-c); color: var(--xr-bg); }
  .an-tag:hover i { background: var(--sys-c); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  .an-art .flow.on { animation: none !important; }
  .an-ov .mk-ring { display: none; }
}
