/* Полный отчёт. Только токены. Карта повреждений — в конце файла (блок .dm). */
.rp-page { background: linear-gradient(180deg, var(--surface-hero-top) 0, var(--surface-page) 480px); }
.rp-wrap { max-width: var(--container-2); }
.rp-sec { margin-top: var(--space-12); scroll-margin-top: 72px; }
.rp-sec > .h2 { font-size: clamp(24px, 4.6vw, 34px); margin-bottom: var(--space-2); }
.rp-sec > .rp-lead { color: var(--ink-2); margin-bottom: var(--space-5); max-width: var(--container-text); }

/* ---------- Шапка отчёта ---------- */
.rp-head { padding-top: var(--space-3); }
.rp-head .plaque { margin-bottom: var(--space-3); }
.rp-title { font-size: var(--text-h1); line-height: var(--lh-h1); font-weight: 800; letter-spacing: var(--ls-h1); margin-bottom: var(--space-3); }
.rp-ids { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; color: var(--ink-2); font-size: 15px; margin-bottom: var(--space-4); }
.rp-ids .vin { font: 600 15px var(--font-mono); letter-spacing: .04em; color: var(--ink); }
.rp-ids .rp-gost { width: 120px; height: 26px; }
.rp-actions { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-bottom: var(--space-6); }
.rp-actions a, .rp-actions button { font-size: 14.5px; }

/* ---------- Вердикт и «Главное» ---------- */
.rp-verdict { margin-bottom: var(--space-3); }
.rp-verdict.verdict b { font-size: clamp(20px, 3.4vw, 26px); }
.rp-verdict.verdict span { font-size: 16px; }
.rp-advice { color: var(--ink-2); margin: 0 0 var(--space-5); font-size: 16px; }
.rp-facts { display: grid; gap: 8px; }
.rp-fact { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-card); border-radius: var(--radius-md); padding: 14px 16px; box-shadow: var(--shadow-card); }
.rp-fact .ic { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; }
.rp-fact .ic svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.rp-fact.ok .ic { background: var(--ok); } .rp-fact.warn .ic { background: var(--warn); } .rp-fact.bad .ic { background: var(--bad); }
.rp-fact.na .ic { box-shadow: inset 0 0 0 2px var(--ink-3); }
.rp-fact.lock .ic { background: var(--ink-3); }
.rp-fact.lock .ic svg { stroke-width: 2.6; }
.rp-fact.lock a { color: var(--action); }
.rp-fact b { display: block; font-size: 16px; }
.rp-fact span { display: block; font-size: 14px; color: var(--ink-2); }
.rp-fact a { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }

/* Липкое меню разделов */
.rp-nav { position: sticky; top: var(--header-h, 0px); z-index: 10; margin: var(--space-8) calc(-1 * var(--gutter)) 0; padding: 10px var(--gutter); background: color-mix(in srgb, var(--surface-page) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.rp-nav::-webkit-scrollbar { display: none; }
.rp-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; width: max-content; }
.rp-nav a { display: block; padding: 7px 12px; border-radius: var(--radius-pill); font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.rp-nav a:hover { color: var(--ink); background: var(--surface-plaque); }
.rp-nav a.is-on { background: var(--ink); color: #fff; }

/* ---------- Вопросы продавцу и торг ---------- */
.rp-two { display: grid; gap: 14px; }
.rp-two > * { min-width: 0; }
.rp-qs { list-style: decimal; margin: var(--space-3) 0 0; padding-left: 22px; display: grid; gap: 10px; }
.rp-qs li { font-size: 15.5px; }
.rp-qs li span { display: block; font-size: 13px; color: var(--ink-3); }
.rp-bargain-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.rp-bargain-row:first-of-type { border-top: 0; }
.rp-bargain-row b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-bargain-total { display: flex; justify-content: space-between; gap: 14px; margin-top: 6px; padding-top: 12px; border-top: 2px solid var(--ink); font-weight: 800; font-size: 18px; }
.rp-bargain-total span:last-child { white-space: nowrap; }
.rp-note { font-size: 13.5px; color: var(--ink-3); margin-top: var(--space-3); }

/* ---------- События истории ---------- */
.event { display: grid; grid-template-columns: 1fr; gap: 4px; background: var(--surface-card); border-radius: var(--radius-md); padding: var(--space-4); border-left: 4px solid var(--line-strong); }
.event.ok { border-left-color: var(--ok); } .event.warn { border-left-color: var(--warn); } .event.bad { border-left-color: var(--bad); }
.ev-date { font: 600 13px var(--font-mono); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.event b { display: flex; align-items: center; gap: 6px; font-size: var(--text-h4); }
.event span { display: block; font-size: var(--text-sm); color: var(--ink-2); }
.event small { display: block; font-size: var(--text-xs); color: var(--ink-3); margin-top: 2px; }
.ev-ic { flex: 0 0 18px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; }
.ev-ic svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; }
.ev-ic.bad { background: var(--bad); } .ev-ic.warn { background: var(--warn); }

/* Фильтр «Все / Только риски» */
.seg { display: inline-flex; gap: 4px; background: var(--surface-plaque); padding: 4px; border-radius: var(--radius-pill); margin-bottom: var(--space-3); }
.seg button { border: 0; background: transparent; font: 600 14px var(--font-sans); color: var(--ink-2); padding: 8px 14px; border-radius: var(--radius-pill); min-height: 38px; }
.seg button span { font-family: var(--font-mono); color: var(--ink-3); margin-left: 2px; }
.seg button[aria-checked="true"] { background: var(--surface-card); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shadow-tint), .2); }

/* Лента с машиной */
.tl { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 0 var(--space-3); }
.tl-rail { position: relative; }
.tl-owners { position: absolute; left: 15px; top: 0; bottom: 0; width: 4px; }
.tl-owners i { position: absolute; left: 0; width: 4px; border-radius: 2px; background: var(--line-strong); }
.tl-owners i.seg-risk { background: var(--warn); }
.tl-car { position: absolute; left: 4px; top: 0; width: 26px; height: 48px; transition: transform 120ms linear; filter: drop-shadow(0 4px 6px rgba(var(--shadow-tint), .5)); z-index: 2; }
.tl-car svg { width: 26px; height: 48px; }
.c-body { fill: var(--ink); } .c-glass { fill: #8E949A; }
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.ev-item .event { transition: box-shadow var(--dur-slow); box-shadow: 0 1px 2px rgba(var(--shadow-tint), .08); }
.ev-item.is-passed .event { box-shadow: var(--shadow-card); }
.tl.only-risk .ev-item[data-risk="0"] { display: none; }
.own-tag { margin: var(--space-3) 0 var(--space-2); font-size: var(--text-xs); font-weight: 700; color: var(--ink-2); }
.own-tag.risk { color: var(--warn-strong); }
.ev-item:first-child .own-tag { margin-top: 0; }

/* ---------- Владельцы ---------- */
.owners { margin: 0; background: var(--surface-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-5); --years: 8.6; }
.owners figcaption, .mileage figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px var(--space-4); margin-bottom: var(--space-4); }
.owners figcaption b, .mileage figcaption b { font-size: var(--text-h4); }
.owners figcaption span, .mileage figcaption span { font-size: var(--text-xs); color: var(--ink-3); }
.own-axis { display: flex; justify-content: space-between; font: 500 12px var(--font-mono); color: var(--ink-3); margin: 0 0 6px; }
.own-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); }
.own-rows li { display: grid; grid-template-columns: 1fr auto; gap: 4px var(--space-3); align-items: center; }
.own-name { font-size: var(--text-sm); font-weight: 600; }
.own-dur { font-size: var(--text-xs); color: var(--ink-2); display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.own-rows li.warn .own-dur { color: var(--warn-strong); font-weight: 600; }
.own-bar { grid-column: 1 / -1; position: relative; height: 12px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--surface-plaque) 0 calc(100% / var(--years) - 2px), var(--surface-card) 0 calc(100% / var(--years))); }
.own-bar i { position: absolute; top: 0; bottom: 0; left: calc(var(--from) / var(--years) * 100%); width: calc((var(--to) - var(--from)) / var(--years) * 100%); border-radius: 6px; background: var(--ink); }
.own-rows li.warn .own-bar i { background: var(--warn); }

/* ---------- График пробега ---------- */
.mileage { margin: 0; background: var(--surface-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-5); }
.mil-plot { position: relative; }
.mil-svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--font-sans); }
.mil-grid line { stroke: var(--line); stroke-width: 1; }
.mil-axis text { font: 500 11px var(--font-mono); fill: var(--ink-3); }
.mil-line { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.mil-drop { fill: none; stroke: var(--bad); stroke-width: 2; stroke-dasharray: 4 4; }
.mil-dot { fill: var(--ink); stroke: var(--surface-card); stroke-width: 2; }
.mil-dot.bad { fill: var(--bad); }
.mil-hit { fill: transparent; cursor: pointer; }
.mil-hit:focus-visible { outline: none; stroke: var(--ink); stroke-width: 2; }
.mil-label { font-size: 12.5px; font-weight: 700; fill: var(--bad-strong); }
.mil-label-sub { font-size: 11.5px; fill: var(--ink-2); }
.mil-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--ink); color: #fff; font-size: 13px; line-height: 1.35; padding: 8px 10px; border-radius: 8px; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
.mil-table { margin-top: var(--space-3); }
.mil-table summary { cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.mil-table table { width: 100%; border-collapse: collapse; margin-top: var(--space-2); font-size: 14px; }
.mil-table th, .mil-table td { text-align: left; padding: 6px 8px 6px 0; border-bottom: 1px solid var(--line); }

/* ---------- Юридические проверки ---------- */
.rp-legal { display: grid; gap: 0; }
.rp-legal .fc-row:first-child { border-top: 0; }
/* Подробности под строкой: дела, лоты, продажи на аукционах, фото */
.fc-more { margin-top: var(--space-2); }
.fc-more summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.fc-items { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: 10px; }
.fc-items li { display: grid; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line-strong); font-size: 14px; }
.fc-items b { font-size: 14.5px; }
.fc-items a { font-weight: 600; color: var(--ink); text-underline-offset: 3px; }
.fc-table { width: 100%; border-collapse: collapse; margin-top: var(--space-2); font-size: 14px; }
.fc-table th, .fc-table td { text-align: left; padding: 6px 8px 6px 0; border-top: 1px solid var(--line); vertical-align: top; }
.fc-table th { font-weight: 600; color: var(--ink-3); font-size: 13px; width: 40%; }
.fc-more .rp-gallery { margin-top: var(--space-3); }

/* ---------- Фото ---------- */
.rp-carphotos { margin-top: var(--space-3); padding: var(--space-5); }
.rp-carphotos .h3 { margin: 0 0 4px; }
.rp-carphotos-note { margin: 0 0 var(--space-3); font-size: 14px; color: var(--ink-3); }
.rp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.rp-gallery a { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-plaque); }
.rp-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Остальные разделы — раскрывающиеся ---------- */
.rp-acc { display: grid; gap: 8px; }
.rp-acc details { background: var(--surface-card); border-radius: var(--radius-md); box-shadow: var(--shadow-card); }
.rp-acc summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 16px 18px; }
.rp-acc summary::-webkit-details-marker { display: none; }
.rp-acc summary b { font-size: 16.5px; flex: 0 0 auto; }
.rp-acc summary span { font-size: 14px; color: var(--ink-2); text-align: right; }
.rp-acc summary::after { content: '+'; font: 600 20px var(--font-mono); color: var(--ink-3); }
.rp-acc details[open] summary::after { content: '−'; }
.rp-acc .body { padding: 0 18px 18px; font-size: 15px; color: var(--ink-2); }
.rp-acc table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rp-acc td, .rp-acc th { text-align: left; padding: 8px 8px 8px 0; border-top: 1px solid var(--line); vertical-align: top; }
.rp-acc th { font-weight: 600; color: var(--ink-3); font-size: 13px; }
.rp-acc .src { font-size: 13px; color: var(--ink-3); margin-top: 8px; }
.rp-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.rp-photos div { aspect-ratio: 4 / 3; border-radius: var(--radius-sm); background: repeating-linear-gradient(135deg, rgba(var(--shadow-tint), .06) 0 10px, transparent 10px 20px), var(--surface-sheet); display: grid; place-items: center; font-size: 12.5px; color: var(--ink-3); text-align: center; padding: 6px; }

/* ---------- Документы для сделки ---------- */
.rp-docs { display: grid; gap: 10px; }
.rp-doc { display: flex; align-items: center; gap: 14px; padding: 16px 18px; background: var(--surface-card); border-radius: var(--radius-md); box-shadow: var(--shadow-card); text-decoration: none; color: var(--ink); }
.rp-doc svg { flex: 0 0 auto; color: var(--ink-2); }
.rp-doc b { display: block; }
.rp-doc span { font-size: 13.5px; color: var(--ink-3); }
.rp-doc .dl { margin-left: auto; font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.rp-doc.is-soon { background: var(--surface-sheet); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.rp-doc.is-soon .plaque { margin-left: auto; flex: 0 0 auto; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rp-tip { margin-top: var(--space-3); padding: 14px 16px; border-radius: var(--radius-md); background: var(--surface-sheet); font-weight: 600; font-size: 15px; }

/* ---------- Следующая машина (тёмная) ---------- */
.rp-next { margin-top: var(--space-14); padding-block: 44px; background: radial-gradient(800px 420px at 15% 0%, var(--surface-dark-glow) 0%, rgba(59, 49, 41, 0) 70%), var(--surface-dark); }
.rp-next .h2 { margin-bottom: 8px; }
.rp-next p { color: var(--on-dark-2); margin-bottom: var(--space-5); max-width: 36em; }
.rp-next .rp-left { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--on-dark); margin-bottom: var(--space-4); }
.rp-feedback { margin-top: var(--space-8); padding-top: var(--space-6); border-top: 1px solid var(--line-dark); }
.rp-feedback label { display: block; font-weight: 700; color: var(--on-dark); margin-bottom: 8px; }
.rp-feedback .row { display: flex; gap: 8px; }
.rp-feedback input { flex: 1; min-width: 0; height: 50px; border-radius: var(--radius-sm); border: 2px solid #4A4E54; background: #16181B; color: var(--on-dark); padding: 0 14px; }
.rp-feedback input:focus { outline: none; border-color: #fff; }
.rp-feedback button { min-height: 50px; }
.rp-thanks { margin: 0; font-weight: 700; color: var(--on-dark); }

/* ---------- Машина ---------- */
.rp-specs dd { font-weight: 600; }
.rp-notes { display: grid; gap: 10px; align-content: start; }
.rp-note-card { background: var(--surface-card); border-radius: var(--radius-md); box-shadow: var(--shadow-card); padding: 14px 16px; font-size: 15px; color: var(--ink-2); border-left: 4px solid var(--line-strong); }
.rp-note-card b { color: var(--ink); }
.rp-note-card.ok { border-left-color: var(--ok); } .rp-note-card.warn { border-left-color: var(--warn); } .rp-note-card.bad { border-left-color: var(--bad); }

/* ---------- ДТП ---------- */
.rp-accidents { display: grid; gap: 14px; }
.rp-acc-card { background: var(--surface-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 20px 18px; border-top: 5px solid var(--line-strong); }
.rp-acc-card.bad { border-top-color: var(--bad); } .rp-acc-card.warn { border-top-color: var(--warn); }
.rp-acc-card time { font: 600 14px var(--font-mono); color: var(--ink-2); }
.rp-acc-card h3 { font-size: var(--text-h3); margin: 4px 0 2px; }
.rp-acc-card header p { color: var(--ink-2); font-size: 15px; }
.rp-acc-dl { display: grid; gap: 0; margin: var(--space-4) 0; border-top: 1px solid var(--line); }
.rp-acc-dl div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.rp-acc-dl dt { color: var(--ink-3); }
.rp-acc-dl dd { margin: 0; font-weight: 600; text-align: right; }
.rp-acc-lbl { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-bottom: 6px; }
.rp-chips { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rp-chips li { font-size: 14px; font-weight: 600; padding: 5px 10px; border-radius: var(--radius-pill); background: var(--surface-plaque); }
.rp-acc-card.bad .rp-chips li { background: var(--bad-bg); color: var(--bad-strong); }
.rp-acc-card.warn .rp-chips li { background: var(--warn-bg); color: var(--warn-strong); }
.rp-acc-note { font-size: 15px; background: var(--surface-sheet); border-radius: var(--radius-sm); padding: 12px 14px; }
.rp-acc-src { font-size: 13px; color: var(--ink-3); margin-top: var(--space-3); }
.rp-acc-src a { color: var(--ink-2); font-weight: 600; }

/* ---------- Такси ---------- */
.rp-taxi-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.rp-taxi-head b { display: block; font-size: 18px; }
.rp-taxi-head span { font-size: 14px; color: var(--ink-2); }
.rp-taxi .rp-acc-dl { margin-bottom: 8px; }
.rp-taxi .src { font-size: 13px; color: var(--ink-3); }
.rp-acc .rp-sub { font-size: 15px; margin: var(--space-5) 0 6px; }

@media (min-width: 700px) {
  .rp-accidents { grid-template-columns: 1fr 1fr; }
  .rp-facts { grid-template-columns: 1fr 1fr; }
  .rp-two { grid-template-columns: 1.15fr 1fr; }
  .event { grid-template-columns: 110px 1fr; }
  .tl { grid-template-columns: 48px 1fr; }
  .tl-owners { left: 22px; }
  .tl-car { left: 11px; }
  .own-rows li { grid-template-columns: 180px 1fr 150px; }
  .own-bar { grid-column: auto; }
  .own-axis { margin-left: calc(180px + var(--space-3)); margin-right: calc(150px + var(--space-3)); }
  .rp-docs { grid-template-columns: 1fr 1fr; }
  .rp-photos { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 900px) {
  .rp-nav { margin-inline: calc(-1 * var(--gutter-desktop)); padding-inline: var(--gutter-desktop); }
}
@media (prefers-reduced-motion: reduce) {
  .tl-car { display: none; }
  .ev-item .event { transition: none; }
}

/* =========================================================
   Карта повреждений (SVG, 4 стороны + вид сверху)
   ========================================================= */
/* Карта повреждений. Только токены из src/styles/tokens.css. */
.dm .legend { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); font-size: var(--text-sm); font-weight: 600; }
.dm .legend li { display: flex; align-items: center; gap: var(--space-2); }
.dm .sw { display: inline-block; width: 16px; height: 16px; border-radius: 4px; border: 2px solid; flex: 0 0 auto; }
.dm .sw.bad { background: color-mix(in srgb, var(--bad) 24%, #fff); border-color: var(--bad); }
.dm .sw.warn { background: color-mix(in srgb, var(--warn) 24%, #fff); border-color: var(--warn); }
.dm .sw.none { background: var(--surface-card); border-color: var(--ink-3); }

/* ---------- Сцена ---------- */
.dm .map { display: grid; gap: var(--space-4); }
.dm .map > * { min-width: 0; }
.dm .map-main { background: var(--surface-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-3); }
.dm .stage { position: relative; border-radius: var(--radius-md); background: radial-gradient(420px 180px at 50% 62%, #FFFFFF 0%, rgba(255,255,255,0) 70%), var(--surface-sheet); touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: grab; overflow: hidden; }
.dm .stage:active { cursor: grabbing; }
.dm .views { position: relative; aspect-ratio: 8 / 3; }
.dm .car { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform: translateX(calc(var(--dir, 1) * 24px)); transition: opacity var(--dur-base) var(--ease-standard), transform var(--dur-base) var(--ease-standard); pointer-events: none; }
.dm .car.is-on { opacity: 1; transform: none; pointer-events: auto; }
/* Технический рисунок: тонкие линии одной толщины при любом размере (non-scaling-stroke) */
.dm .car path, .dm .car circle, .dm .car rect { vector-effect: non-scaling-stroke; }
.dm .shadow { stroke: none; }
.dm .body-line { fill: none; stroke: #2B2E33; stroke-width: 1.6; stroke-linejoin: round; pointer-events: none; }
.dm .glass { stroke: #2B2E33; stroke-width: 1.2; stroke-linejoin: round; pointer-events: none; }
.dm .reflect { fill: none; stroke: #FFFFFF; stroke-width: 2.2; stroke-linecap: round; opacity: .85; pointer-events: none; }
.dm .seam { fill: none; stroke: #2B2E33; stroke-opacity: .32; stroke-width: 1; stroke-linecap: round; pointer-events: none; }
.dm .dark { fill: #2F3236; stroke: #2B2E33; stroke-width: 1; pointer-events: none; }
.dm .light { fill: #E9ECEE; stroke: #2B2E33; stroke-width: 1; stroke-linejoin: round; pointer-events: none; } /* нейтрально: не путать с «ремонтом» */
.dm .inner { fill: #C9CED2; stroke: #2B2E33; stroke-width: .8; pointer-events: none; }
.dm .trim { fill: #FFFFFF; stroke: #2B2E33; stroke-width: 1.1; stroke-linejoin: round; pointer-events: none; }
.dm .drl { fill: none; stroke: #FFFFFF; stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.dm .slat { fill: none; stroke: #6B7076; stroke-width: 1; pointer-events: none; }
.dm .chrome { fill: none; stroke: #B9B5AE; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; pointer-events: none; }
.dm .badge { fill: none; stroke: #B9B5AE; stroke-width: 1.6; pointer-events: none; }
.dm .wiper { fill: none; stroke: #2F3236; stroke-width: 1.6; stroke-linecap: round; pointer-events: none; }
.dm .tail { fill: none; stroke: #9AA0A6; stroke-width: 1.6; stroke-linecap: round; pointer-events: none; }
.dm .vent { fill: none; stroke: #2B2E33; stroke-opacity: .45; stroke-width: 1; pointer-events: none; }
.dm .pipe { fill: #C8C4BC; stroke: #2B2E33; stroke-width: 1; pointer-events: none; }
.dm .refl { fill: #A8A29A; pointer-events: none; }
.dm .plate { fill: #FFFFFF; stroke: #2B2E33; stroke-width: 1.1; pointer-events: none; }
/* Колесо */
.dm .well { fill: #3A3836; pointer-events: none; }
.dm .tire { fill: #26282B; pointer-events: none; }
.dm .sidewall { fill: none; stroke: #45484D; stroke-width: 1; pointer-events: none; }
.dm .rim { fill: #D7D3CC; stroke: #8E8A83; stroke-width: 1; pointer-events: none; }
.dm .rim-gap { fill: #3B3E42; pointer-events: none; }
.dm .caliper { fill: #6E7277; pointer-events: none; }
.dm .spoke { fill: #ECE9E4; stroke: #8E8A83; stroke-width: .7; stroke-linejoin: round; pointer-events: none; }
.dm .hub { fill: #D7D3CC; stroke: #8E8A83; stroke-width: .8; pointer-events: none; }
.dm .hub-in { fill: #8E8A83; pointer-events: none; }

/* Детали: цвет = вердикт. Заливка ~24%, контур 2px */
.dm .part { stroke-width: 1.4; stroke-linejoin: round; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill-opacity var(--dur-fast), stroke-width var(--dur-fast); }
.dm .part.none { fill: #FFFFFF; fill-opacity: 0; stroke: #2B2E33; stroke-opacity: .5; stroke-width: 1; } /* прозрачная: виден объём кузова, но клик ловится */
.dm .part.bad { fill: var(--overlay-bad); fill-opacity: var(--overlay-opacity); stroke: var(--bad); }
.dm .part.warn { fill: var(--overlay-warn); fill-opacity: .3; stroke: var(--warn); }
.dm .part:hover { fill-opacity: .42; }
.dm .part.none:hover { fill: var(--surface-plaque); fill-opacity: .7; }
.dm .part.is-sel { stroke-width: 4; fill-opacity: .5; }
.dm .part.none.is-sel { fill: var(--surface-plaque); fill-opacity: .8; stroke-width: 3; }
.dm .part:focus-visible { outline: none; stroke: var(--ink); stroke-width: 4; }

.dm .rot { position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border-radius: 50%; border: 0; background: var(--surface-card); box-shadow: var(--shadow-card); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
.dm .rot svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.dm .rot.prev { left: 8px; } .dm .rot.next { right: 8px; }
.dm .hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); margin: 0; display: flex; gap: 6px; align-items: center; font-size: var(--text-xs); font-weight: 600; color: var(--ink-2); background: rgba(255,252,246,.9); padding: 4px 10px; border-radius: var(--radius-pill); pointer-events: none; white-space: nowrap; }
.dm .hint svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.dm .view-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-1) 0; }
.dm .view-name { margin: 0; font-weight: 700; font-size: var(--text-h4); }
.dm .view-tabs { display: flex; gap: 4px; background: var(--surface-plaque); padding: 3px; border-radius: var(--radius-pill); }
.dm .view-tabs button { border: 0; background: transparent; font: 600 13.5px var(--font-sans); color: var(--ink-2); padding: 6px 11px; border-radius: var(--radius-pill); cursor: pointer; min-height: 32px; }
.dm .view-tabs button[aria-selected="true"] { background: var(--surface-card); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shadow-tint), .2); }

/* ---------- Мини-карта и карточка детали ---------- */
.dm .map-side { display: grid; gap: var(--space-4); align-content: start; }
.dm .mini { margin: 0; background: var(--surface-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-4); }
.dm .mini figcaption { font-size: var(--text-xs); font-weight: 600; color: var(--ink-3); margin-bottom: var(--space-2); }
.dm .mini svg { display: block; width: 100%; height: auto; }
.dm .cam path { fill: var(--ink); }
.dm .cam { transition: transform var(--dur-base) var(--ease-standard); }
.dm .detail { background: var(--surface-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: var(--space-5); min-height: 180px; }
.dm .detail h3 { font-size: var(--text-h3); line-height: var(--lh-h3); margin: var(--space-3) 0 var(--space-1); }
.dm .detail p { margin: 0 0 var(--space-2); font-size: var(--text-sm); color: var(--ink-2); }
.dm .d-part { font-weight: 700; color: var(--ink) !important; font-size: var(--text-h4) !important; }
.dm .d-when time { font-family: var(--font-mono); font-weight: 600; color: var(--ink); }
.dm .d-src { color: var(--ink-3) !important; font-size: var(--text-xs) !important; }
.dm .d-tip { background: var(--surface-sheet); border-radius: var(--radius-sm); padding: var(--space-3); margin-top: var(--space-3) !important; }
.dm .d-tip b { color: var(--ink); }
.dm .d-empty b { display: block; font-size: var(--text-h4); color: var(--ink); margin-bottom: 4px; }
.dm .chip { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; padding: 6px 10px; border-radius: var(--radius-sm); }
.dm .chip svg { width: 18px; height: 18px; padding: 3px; border-radius: 50%; fill: none; stroke: #fff; stroke-width: 3.2; stroke-linecap: round; }
.dm .chip.bad { background: var(--bad-bg); color: var(--bad-strong); } .dm .chip.bad svg { background: var(--bad); }
.dm .chip.warn { background: var(--warn-bg); color: var(--warn-strong); } .dm .chip.warn svg { background: var(--warn); }
.dm .chip.none { background: var(--surface-plaque); color: var(--ink-2); }

/* ---------- Список деталей ---------- */
.dm .found { margin-top: var(--space-8); }
.dm .found-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.dm .f-item { width: 100%; display: flex; gap: var(--space-3); align-items: center; text-align: left; border: 0; background: var(--surface-card); border-radius: var(--radius-md); padding: var(--space-3) var(--space-4); box-shadow: var(--shadow-card); font: 400 var(--text-sm)/1.4 var(--font-sans); color: var(--ink-2); cursor: pointer; border-left: 4px solid; }
.dm .f-item.bad { border-left-color: var(--bad); } .dm .f-item.warn { border-left-color: var(--warn); }
.dm .f-item b { display: block; color: var(--ink); font-size: var(--text-body); }
.dm .note { font-size: var(--text-sm); color: var(--ink-2); margin: var(--space-4) 0 0; max-width: var(--container-text); }

@media (max-width: 699px) {
  /* Телефон: кнопки поворота в нижних углах, не закрывают машину */
  .dm .rot { top: auto; bottom: 6px; margin: 0; width: 36px; height: 36px; }
  .dm .rot svg { width: 18px; height: 18px; }
  .dm .views { aspect-ratio: 8 / 3.6; }
  .dm .hint { display: none; } /* на телефоне есть вкладки сторон, свайп понятен и так */
}
@media (min-width: 900px) {
  /* Схема — во всю ширину, чтобы машина была крупной; под ней мини-карта и карточка детали */
  .dm .map-side { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
  .dm .found-list { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .dm .car, .dm .cam, .dm .part { transition: none; }
}

/* Чертёж (car-blueprint.js): белый кузов, линии поверх, области деталей под линиями */
.dm .bp .bp-body { fill: #FFFFFF; }
.dm .bp .bp-lines path { fill: #2B2E33; pointer-events: none; }
.dm .bp .part { stroke-width: 0; }
.dm .bp .part.is-sel { stroke-width: 1.5; }
.dm .bp .part.none.is-sel { stroke: #2B2E33; stroke-opacity: .6; }
.dm .credit { margin: 6px 0 0; font-size: 12px; color: var(--ink-3); }
.dm .credit a { color: inherit; }

/* Блок торга и документы: пояснения */
.rp-bargain-note { margin: 12px 0 0; font-size: 13.5px; color: var(--ink-3); }
.rp-docs-note { margin: 10px 0 0; font-size: 13.5px; color: var(--ink-3); }
.rp-sharednote { margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-card); box-shadow: var(--shadow-card); font-size: 14.5px; }
.rp-shareoff { margin: -8px 0 var(--space-6); font-size: 13.5px; color: var(--ink-3); }
.rp-shareoff .link-btn { font-size: 13.5px; }
.rp-acc-scheme { display: block; margin-top: 6px; } .rp-acc-scheme img { display: block; max-width: 100%; max-height: 320px; border-radius: var(--radius-md); border: 1px solid var(--line-strong); background: #fff; }
.rp-updating { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 0 0 12px; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--surface-card); box-shadow: var(--shadow-card); border-left: 4px solid var(--warn); font-size: 14.5px; }
.rp-updating b { color: var(--ink); }
.rp-partialnote { margin: 0 0 12px; font-size: 14px; color: var(--ink-2); }
@media print { .rp-updating { display: none; } }
/* VIN по госномеру не нашли: форма «впишите VIN» в шапке отчёта */
.rp-vinform { margin: 0 0 14px; padding: 18px 20px; border-radius: var(--radius-md); background: var(--surface-card); box-shadow: var(--shadow-card); border: 2px solid var(--action); font-size: 14.5px; scroll-margin-top: 80px; }
.rp-vin-h { margin: 0; font-size: 19px; line-height: 1.3; }
.rp-vin-sub { margin: 4px 0 12px; color: var(--ok); font-weight: 600; }
.rp-vinhelp { margin-top: 10px; font-size: 13.5px; color: var(--ink-2); }
.rp-vinhelp summary { cursor: pointer; width: fit-content; text-decoration: underline dotted; }
.rp-vinhelp p { margin: 6px 0 0; }
.rp-vinrow { display: flex; flex-wrap: wrap; gap: 8px; }
.rp-vinrow input { flex: 1 1 220px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line, #d0d5dd); border-radius: var(--radius-sm); font: inherit; font-family: var(--font-mono, monospace); text-transform: uppercase; }
.rp-vinrow input[aria-invalid="true"] { border-color: var(--bad, #c0392b); }
@media (max-width: 520px) { .rp-vinrow .btn-act { flex: 1 1 100%; } }
.rp-vinerr { display: block; margin-top: 6px; color: var(--bad, #c0392b); }
@media print { .rp-vinform { display: none; } }
