@font-face {
  font-family: 'RuPlate';
  src: url('assets/fonts/GOST-R-50577-93.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #667085;
  --line: #d9e0ea;
  --blue: #2563eb;
  --green: #0f6b22;
  --red: #c62828;
  --navy: #142447;
  --navy-2: #1e3a8a;
  --accent: #38bdf8;
  --accent-2: #facc15;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  width: 100%;
}

img { max-width: 100%; }

section > h2 {
  font-size: 28px;
  letter-spacing: -0.01em;
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px max(16px, calc((100% - 1120px) / 2));
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--navy-2);
  color: white;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
}

.topnav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  font-weight: 600;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
}

.topnav a:hover { color: var(--navy-2); }

.nav-cta {
  white-space: nowrap;
  background: var(--navy-2);
  color: white;
  font-weight: 700;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 8px;
  text-decoration: none;
}

.nav-cta:hover { background: #1b3175; }

@media (max-width: 720px) {
  .topnav { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: white;
  isolation: isolate;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(800px 420px at 85% -10%, rgba(56, 189, 248, 0.35), transparent 60%),
    radial-gradient(700px 500px at 0% 110%, rgba(250, 204, 21, 0.18), transparent 55%),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 60%, #1d4ed8 100%);
}

.hero-inner {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
  align-items: center;
  padding: 56px 0 64px;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #bfdbfe;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: 40px;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: white;
}

.hero .lead {
  color: #d7e2fb;
  font-size: 16px;
  line-height: 1.6;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: var(--accent-2);
  color: #1f2937;
  box-shadow: 0 10px 24px rgba(250, 204, 21, 0.28);
}

.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 28px rgba(250, 204, 21, 0.36); }

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }

.hero-trust {
  list-style: none;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin: 22px 0 0;
  padding: 0;
  font-size: 13px;
  color: #cfe0fb;
}

.hero-trust li { display: flex; align-items: center; gap: 6px; }
.hero-trust li::before { content: '✓'; color: var(--accent-2); font-weight: 800; }

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
}

.hero-art canvas {
  width: 100%;
  max-width: 420px;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.35));
}

.hero-art-glow {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(220px 140px at 50% 50%, rgba(56, 189, 248, 0.35), transparent 70%);
}

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding: 40px 0 44px; }
  .hero h1 { font-size: 30px; }
  .hero-art { order: -1; }
}

/* ---------- Generic section spacing ---------- */
.features, .how, .use-cases, .faq, .cta-final {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 56px 0;
}

.section-sub {
  margin-top: -6px;
  margin-bottom: 26px;
}

.features h2, .how h2, .use-cases h2, .faq h2 {
  margin-bottom: 8px;
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.feature-card, .usecase-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.feature-card:hover, .usecase-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(20, 32, 54, 0.12);
  border-color: #c3d3ec;
}

.feature-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.feature-card h3, .usecase-card h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.feature-card p, .usecase-card p {
  margin: 0;
  font-size: 14px;
}

@media (max-width: 860px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* ---------- How it works ---------- */
.steps {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--navy-2);
  color: white;
  font-weight: 800;
  font-size: 14px;
}

.steps h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.steps p {
  margin: 0;
  font-size: 13px;
}

@media (max-width: 860px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* ---------- Demo panel ---------- */
.demo-panel {
  width: min(900px, calc(100% - 28px));
  margin: 12px auto 56px;
}

/* ---------- FAQ ---------- */
.faq details {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  margin-top: 10px;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  list-style: none;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::before {
  content: '+';
  display: inline-block;
  width: 18px;
  color: var(--navy-2);
  font-weight: 800;
}

.faq details[open] summary::before { content: '−'; }

.faq p {
  margin: 10px 0 0 18px;
  font-size: 14px;
}

/* ---------- Final CTA ---------- */
.cta-final {
  text-align: center;
  border-top: 1px solid var(--line);
}

.cta-final h2 { margin-bottom: 8px; }
.cta-final p { max-width: 560px; margin: 0 auto 22px; }
.cta-final .btn-primary { color: #1f2937; }

/* ---------- Footer ---------- */
.site-footer {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--navy-2); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 8px 24px rgba(20, 32, 54, 0.08);
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.status {
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.controls, .feedback-row {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
}

label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

select, input[type="text"] {
  height: 40px;
  border: 1px solid #aab4c3;
  border-radius: 7px;
  padding: 0 10px;
  background: white;
  color: var(--text);
}

input[type="text"] {
  min-width: 260px;
  font-family: Consolas, monospace;
  letter-spacing: 2px;
  text-transform: uppercase;
}

button, .file-picker span {
  height: 40px;
  border: 0;
  border-radius: 7px;
  padding: 0 16px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  background: #9bb3d6;
  cursor: default;
}

.file-picker input {
  display: none;
}

.file-picker span {
  display: inline-flex;
  align-items: center;
}

.preview-wrap {
  position: relative;
  margin-top: 18px;
  border: 1px dashed #bac5d5;
  border-radius: 10px;
  background: #f8fafc;
  min-height: 260px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.preview-wrap img {
  max-width: 100%;
  max-height: 560px;
  display: none;
}

.bbox-overlay {
  position: absolute;
  border: 3px solid #17d34a;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 0 18px rgba(23, 211, 74, 0.28);
  pointer-events: none;
}

.corner-overlay {
  position: absolute;
  pointer-events: none;
  overflow: visible;
}

.corner-overlay polygon {
  fill: rgba(23, 211, 74, 0.12);
  stroke: #17d34a;
  stroke-width: 3;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 4px rgba(23, 211, 74, 0.5));
}

.bbox-label {
  position: absolute;
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 6px 6px 6px 0;
  background: #17d34a;
  color: #072b10;
  font: 700 13px/18px Consolas, monospace;
  white-space: nowrap;
}

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

.result, .feedback {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.crop-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  background: #fbfdff;
}

.crop-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.crop-head h2 {
  margin: 0;
}

.crop-head span {
  color: var(--muted);
  font-size: 12px;
}

.crop-grid {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.crop-grid img {
  max-width: min(360px, 100%);
  max-height: 180px;
  border: 1px solid #aab4c3;
  border-radius: 8px;
  background: white;
}

.subcrop-list {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.subcrop-item {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.subcrop-item img {
  max-width: 190px;
  max-height: 95px;
}

.plate-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ru-plate-canvas {
  display: block;
  width: min(340px, 100%);
  height: auto;
  filter: drop-shadow(0 3px 6px rgba(20, 32, 54, 0.18));
}

.plate-caption-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.plate-caption {
  font-family: Consolas, monospace;
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--muted);
}

.ghost-btn {
  height: 34px;
  padding: 0 12px;
  background: white;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 7px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 700;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfdff;
}

.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

pre {
  white-space: pre-wrap;
  overflow: auto;
  max-height: 260px;
  background: #111827;
  color: #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}

.small {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.ok { color: var(--green); }
.err { color: var(--red); }

@media (max-width: 720px) {
  .header { display: block; }
  .status { display: inline-block; margin-top: 12px; }
  .controls, .feedback-row { display: grid; align-items: stretch; }
  .crop-grid { display: grid; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
  input[type="text"] { min-width: 0; width: 100%; }
}

/* ==========================================================================
   Vehicle-confirmation demo experience (Hallmark redesign)
   Answer-first OCR result → vehicle lookup → "Это ваш автомобиль?" → result.
   Preserves the site's tokens (Inter, blue accents, light theme, radii 7–14).
   ========================================================================== */
:root {
  --ok: #0f7a2e;   --ok-tint: #e7f6ec;
  --warn: #b45309; --warn-tint: #fdf1e3;
  --danger-2: #c62828; --danger-tint: #fdecec;
  --brand-tint: #eaf0fb;
  --shadow-md: 0 10px 28px rgba(20, 32, 54, 0.12);
  --shadow-lg: 0 24px 60px rgba(20, 32, 54, 0.22);
}

/* The [hidden] attribute must always win over component display rules
   (e.g. .modal-root{display:grid}, .conf-pill{display:inline-flex}). Without
   this, hidden elements like the empty confirmation modal stay visible. */
[hidden] { display: none !important; }

/* Focus visibility (a11y) */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, summary:focus-visible, .cand-card:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

/* Shared buttons */
.btn-solid, .btn-outline {
  height: 44px; padding: 0 20px; border-radius: 10px;
  font-weight: 700; font-size: 15px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn-solid { border: 0; background: var(--blue); color: #fff; }
.btn-solid:hover { background: #1d4ed8; }
.btn-solid:disabled { background: #9bb3d6; cursor: default; }
.btn-outline { border: 1px solid var(--line); background: #fff; color: var(--text); }
.btn-outline:hover { border-color: #b9c6dc; background: #f8fafc; }
.link-btn {
  height: auto; padding: 0; border: 0; background: none;
  color: var(--blue); font-weight: 700; font-size: 13px; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

#recognizeBtn { height: 44px; padding: 0 22px; font-size: 15px; border-radius: 9px; }
.file-picker span { height: 44px; border-radius: 9px; }

/* ---- Answer-first result ---- */
.answer { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 20px; }
.answer-status {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 700; font-size: 15px; padding: 6px 15px 6px 7px; border-radius: 999px;
}
.answer-status-icon {
  display: inline-flex; width: 28px; height: 28px; border-radius: 50%;
  align-items: center; justify-content: center; background: #fff;
}
.answer-status[data-state="ok"]   { color: var(--ok);       background: var(--ok-tint); }
.answer-status[data-state="ok"]   .answer-status-icon { color: var(--ok); }
.answer-status[data-state="warn"] { color: var(--warn);     background: var(--warn-tint); }
.answer-status[data-state="warn"] .answer-status-icon { color: var(--warn); }
.answer-status[data-state="error"]{ color: var(--danger-2); background: var(--danger-tint); }
.answer-status[data-state="error"] .answer-status-icon { color: var(--danger-2); }

.answer-plate { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 16px; }
.answer-plate .ru-plate-canvas { width: min(360px, 100%); height: auto; }
.answer-plate-side { display: flex; flex-direction: column; gap: 10px; min-width: 180px; }
.answer .plate-caption {
  font-family: Consolas, monospace; font-size: 20px; letter-spacing: 3px;
  font-weight: 700; color: var(--text);
}
.conf-pill {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  background: #f1f5fb; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 13px; font-size: 13px; font-weight: 600; color: var(--text);
}
.conf-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); }
.answer-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.answer-correct {
  margin-top: 16px; background: #f8fafc; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
.answer-correct > label { display: block; color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 9px; }
.answer-correct-row { display: flex; gap: 10px; flex-wrap: wrap; }
.answer-correct input {
  height: 44px; flex: 1; min-width: 150px; border: 1px solid #aab4c3; border-radius: 10px;
  padding: 0 12px; font-family: Consolas, monospace; font-size: 16px; letter-spacing: 2px; text-transform: uppercase;
}

/* ---- Vehicle flow ---- */
.vehicle { margin-top: 16px; }
.vehicle-loading, .vehicle-note {
  border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: #fbfdff;
}
.vh-loading-head { display: flex; align-items: center; gap: 11px; font-weight: 600; color: var(--text); font-size: 15px; }
.vh-spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid #cdd8ea; border-top-color: var(--blue);
  animation: vh-spin 0.8s linear infinite;
}
.vh-skeleton { display: flex; gap: 14px; margin-top: 16px; }
.sk-tile { width: 56px; height: 56px; border-radius: 12px; }
.sk-lines { flex: 1; display: flex; flex-direction: column; gap: 9px; justify-content: center; }
.sk-lines i { display: block; height: 12px; border-radius: 6px; }
.sk-lines i:nth-child(1) { width: 55%; } .sk-lines i:nth-child(2) { width: 38%; } .sk-lines i:nth-child(3) { width: 70%; }
.sk-tile, .sk-lines i {
  background: linear-gradient(90deg, #e9eef6 25%, #f3f6fb 37%, #e9eef6 63%);
  background-size: 400% 100%; animation: vh-shimmer 1.4s ease infinite;
}
@keyframes vh-spin { to { transform: rotate(360deg); } }
@keyframes vh-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.vehicle-note { display: flex; gap: 13px; align-items: flex-start; }
.vh-note-icon {
  flex: none; width: 36px; height: 36px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
}
.vh-note-icon[data-tone="muted"] { background: #eef2f7; color: var(--muted); }
.vh-note-icon[data-tone="warn"]  { background: var(--danger-tint); color: var(--danger-2); }
.vehicle-note b { display: block; font-size: 15px; color: var(--text); }
.vehicle-note p { margin: 4px 0 0; font-size: 14px; }
.vehicle-note .link-btn { margin-top: 8px; }

/* ---- Brand tile (monogram; no external logos) ---- */
.brand-tile {
  flex: none; width: 52px; height: 52px; border-radius: 13px; background: var(--brand-tint);
  display: inline-flex; align-items: center; justify-content: center; color: var(--navy-2);
  box-shadow: inset 0 0 0 1px rgba(30, 58, 138, 0.1);
}
.brand-tile--lg { width: 62px; height: 62px; border-radius: 15px; }
.brand-mono { font-weight: 800; font-size: 25px; letter-spacing: -0.02em; }
.brand-tile--lg .brand-mono { font-size: 30px; }
.brand-tile--logo { background: #fff; box-shadow: inset 0 0 0 1px var(--line); padding: 9px; }
.brand-tile--lg.brand-tile--logo { padding: 11px; }
.brand-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

/* ---- Final result ---- */
.vehicle-final {
  border: 1px solid #cfe4d6; background: linear-gradient(180deg, #f4fbf6, #fdfffe);
  border-radius: 16px; padding: 20px 22px; box-shadow: var(--shadow-md);
}
.final-head { display: inline-flex; align-items: center; gap: 8px; color: var(--ok); font-weight: 800; font-size: 14px; }
.final-card { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.vh-make { font-size: 20px; font-weight: 800; letter-spacing: -0.01em; color: var(--text); }
.vh-sub { color: var(--muted); font-size: 14px; margin-top: 2px; }
.final-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.final-grid div { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.final-grid span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 5px; }
.final-grid b { font-size: 16px; }
.mono { font-family: Consolas, monospace; letter-spacing: 1px; }
.final-source { display: flex; align-items: center; gap: 6px; margin: 14px 0 0; color: var(--muted); font-size: 12.5px; }

/* ---- Confirmation modal ---- */
body.modal-open { overflow: hidden; }
.modal-root { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.5); backdrop-filter: blur(2px); animation: modal-fade 0.18s ease; }
.modal {
  position: relative; width: min(460px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: #fff; border-radius: 18px; padding: 26px 24px 24px; box-shadow: var(--shadow-lg);
  animation: modal-rise 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-close {
  position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 10px;
  border: 0; background: #f1f5f9; color: var(--muted); padding: 0;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.modal-close:hover { background: #e6ebf2; color: var(--text); }
.modal-step { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.modal-title { margin: 6px 0 0; font-size: 22px; letter-spacing: -0.01em; color: var(--text); }
.modal-note { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.vh-hero { display: flex; align-items: center; gap: 16px; margin-top: 18px; }
.vh-hero-id .vh-make { font-size: 19px; }
.vh-plate-chip {
  display: inline-block; margin-top: 15px; font-family: Consolas, monospace; font-weight: 700;
  font-size: 17px; letter-spacing: 3px; color: var(--text);
  background: #f1f5fb; border: 1px solid var(--line); border-radius: 10px; padding: 9px 15px;
}
.vh-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.vh-card { border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; background: #fbfdff; }
.vh-card span { display: block; color: var(--muted); font-size: 11.5px; letter-spacing: 0.02em; margin-bottom: 4px; }
.vh-card b { display: block; font-size: 15px; }
.vh-card i { display: block; color: var(--muted); font-size: 12px; font-style: normal; margin-top: 3px; }
.modal-actions { display: flex; gap: 12px; margin-top: 22px; }
.modal-actions .btn-outline, .modal-actions .btn-solid { flex: 1; }
.modal-error { margin: 14px 0 -6px; color: var(--danger-2); font-size: 13px; font-weight: 600; }
@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-rise { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }

/* ---- Candidate cards ---- */
.cand-list { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.cand-card {
  display: flex; align-items: center; gap: 14px; width: 100%; height: auto; text-align: left;
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: #fff;
  color: var(--text); font-weight: 400; cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.cand-card:hover { border-color: #b9c6dc; background: #f8fafc; }
.cand-card.is-selected { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue), var(--shadow-md); background: #f5f9ff; }
.cand-id { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.cand-id .vh-make { font-size: 16px; }
.cand-vin { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cand-mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #cdd8ea; }
.cand-card.is-selected .cand-mark {
  border-color: var(--blue);
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat;
}

/* ---- Technical data (collapsed) ---- */
.tech { margin-top: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdff; overflow: hidden; }
.tech > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-weight: 700; font-size: 14px; color: var(--text);
}
.tech > summary::-webkit-details-marker { display: none; }
.tech-chevron {
  width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.2s ease; margin: -3px 3px 0 0;
}
.tech[open] .tech-chevron { transform: rotate(-135deg); margin-top: 3px; }
.tech-body { padding: 0 16px 16px; }
.tech-body .crop-panel { margin-top: 0; }

/* ---- Responsive: tablet + mobile ---- */
@media (max-width: 560px) {
  .demo-panel { padding: 18px; }
  .modal-root { place-items: end center; padding: 0; }
  .modal {
    width: 100%; max-width: none; max-height: 92vh; border-radius: 20px 20px 0 0;
    padding: 22px 18px calc(20px + env(safe-area-inset-bottom));
    animation: sheet-rise 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  .modal-actions { flex-direction: column-reverse; }
  .vh-cards, .final-grid { grid-template-columns: 1fr; }
  .answer-plate { gap: 16px; }
  .answer-plate .ru-plate-canvas { width: 100%; }
}
@keyframes sheet-rise { from { transform: translateY(100%); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important; scroll-behavior: auto !important;
  }
  .vh-spinner { border-top-color: var(--blue); border-right-color: var(--blue); }
}
