/* ============================================================================
   пдд-экзамен.рф — автошкола «ВОА» (Петрозаводск)
   Дизайн-система «Северная трасса», редакция 2026-09.
   Один файл на весь сайт: лендинг, тренажёр, справочники, оверлеи.
   Селекторы-состояния тренажёра (answer_*, q-number-*, full-exam-*)
   сохранены — их подставляет static/js/trainer.js.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   1. Токены
--------------------------------------------------------------------------- */
:root {
  --font-text: "Manrope", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Unbounded", "Manrope", sans-serif;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-snap: cubic-bezier(0.34, 1.3, 0.5, 1);

  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 32px;

  --container: 1180px;
  --head-h: 72px;
}

/* Тёмная тема — «полярная ночь»: мокрый асфальт, сияние над лесом */
:root,
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b12;
  --bg-2: #0a1019;
  --card: #0e1621;
  --card-2: #121c2a;
  --line: rgba(151, 183, 214, 0.14);
  --line-strong: rgba(151, 183, 214, 0.26);
  --ink: #eaf1f9;
  --ink-strong: #ffffff;
  --mut: #94a7bd;
  --mut-2: #6b7f96;

  --acc: #35e0a1;          /* аврора */
  --acc-2: #58c6ff;        /* лёд */
  --acc-soft: rgba(53, 224, 161, 0.14);
  --acc2-soft: rgba(88, 198, 255, 0.13);
  --grad-cta: linear-gradient(135deg, #23c98d 0%, #2ea7e0 100%);
  --grad-text: linear-gradient(100deg, #4ef0b5, #6fd2ff);

  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --bad: #ff6f6f;
  --bad-soft: rgba(255, 111, 111, 0.13);
  --warn: #ffc14d;
  --warn-soft: rgba(255, 193, 77, 0.14);

  --head-bg: rgba(7, 11, 18, 0.72);
  --overlay: rgba(4, 8, 14, 0.72);
  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 14px 44px rgba(0, 0, 0, 0.45);
  --shadow-cta: 0 10px 30px rgba(35, 201, 141, 0.28);
  --hero-shade:
    linear-gradient(180deg, rgba(5, 9, 15, 0.45) 0%, rgba(5, 9, 15, 0.18) 40%, rgba(7, 11, 18, 0.82) 88%, var(--bg) 100%);
}

/* Светлая тема — «карельский день»: небо, сосны, светлый асфальт */
[data-theme="light"] {
  color-scheme: light;
  --bg: #f2f5f9;
  --bg-2: #e9eef5;
  --card: #ffffff;
  --card-2: #f6f9fc;
  --line: rgba(18, 47, 74, 0.13);
  --line-strong: rgba(18, 47, 74, 0.24);
  --ink: #122437;
  --ink-strong: #0a1725;
  --mut: #52677d;
  --mut-2: #7e91a5;

  --acc: #0b8f66;
  --acc-2: #1673d1;
  --acc-soft: rgba(11, 143, 102, 0.11);
  --acc2-soft: rgba(22, 115, 209, 0.1);
  --grad-cta: linear-gradient(135deg, #0da173 0%, #1a7fd6 100%);
  --grad-text: linear-gradient(100deg, #067a55, #1266bd);

  --ok: #0d9e6e;
  --ok-soft: rgba(13, 158, 110, 0.12);
  --bad: #d64545;
  --bad-soft: rgba(214, 69, 69, 0.1);
  --warn: #b97f14;
  --warn-soft: rgba(212, 158, 49, 0.16);

  --head-bg: rgba(255, 255, 255, 0.78);
  --overlay: rgba(16, 32, 48, 0.5);
  --shadow-1: 0 2px 10px rgba(24, 48, 74, 0.08);
  --shadow-2: 0 18px 44px rgba(24, 48, 74, 0.14);
  --shadow-cta: 0 10px 26px rgba(13, 161, 115, 0.3);
  /* в светлой теме фото НЕ растворяем в белый (выглядит как обрез туманом) —
     затемняем книзу и заканчиваем чистой кромкой секции */
  --hero-shade:
    linear-gradient(180deg, rgba(8, 20, 33, 0.5) 0%, rgba(8, 20, 33, 0.34) 45%, rgba(8, 18, 30, 0.7) 100%);
}

/* ---------------------------------------------------------------------------
   2. База
--------------------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* фоновая «дымка» страницы — едва заметные пятна севера */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(52vw 38vh at 12% -6%, var(--acc-soft), transparent 62%),
    radial-gradient(46vw 34vh at 96% 12%, var(--acc2-soft), transparent 60%);
  opacity: 0.55;
}

img { max-width: 100%; height: auto; }
a { color: var(--acc-2); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  color: var(--ink-strong);
  line-height: 1.16;
  font-weight: 800;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(28px, 4.2vw, 42px); }
h2 { font-size: clamp(22px, 3vw, 30px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }

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

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

::selection { background: var(--acc); color: #04150e; }

body.pdd-modal-open,
body.sheet-open,
body.nav-open { overflow: hidden; }

.container {
  width: min(var(--container), 100% - 40px);
  margin-inline: auto;
}

/* ---------------------------------------------------------------------------
   3. Кнопки
--------------------------------------------------------------------------- */
.local-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--grad-cta);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
  box-shadow: 0 4px 16px rgba(20, 130, 110, 0.18);
}
.local-btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-cta);
  filter: brightness(1.06);
}
.local-btn:active { transform: translateY(0); filter: brightness(0.97); }
.local-btn:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }

.local-btn.secondary {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
  box-shadow: none;
}
.local-btn.secondary:hover {
  border-color: var(--acc);
  color: var(--acc);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.voa-btn-lg { min-height: 54px; padding: 13px 30px; font-size: 16px; }

.pdd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--card) 65%, transparent);
  color: var(--ink);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), color 0.2s var(--ease);
}
.pdd-icon-btn:hover { border-color: var(--acc); color: var(--acc); transform: translateY(-1px); }
.pdd-icon-btn:active { transform: scale(0.94); }
.pdd-icon-btn svg { width: 21px; height: 21px; }
.pdd-icon-btn .icon-theme-dark { display: none; }
[data-theme="dark"] .pdd-icon-btn .icon-theme-light { display: none; }
[data-theme="dark"] .pdd-icon-btn .icon-theme-dark { display: block; }

/* ---------------------------------------------------------------------------
   4. Шапка сайта
--------------------------------------------------------------------------- */
.site-head {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--head-h);
  display: flex;
  align-items: center;
  background: var(--head-bg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.site-head--overlay:not(.is-scrolled) {
  background: linear-gradient(180deg, rgba(4, 8, 14, 0.55), rgba(4, 8, 14, 0));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom-color: transparent;
}
.site-head--overlay:not(.is-scrolled) .site-nav a,
.site-head--overlay:not(.is-scrolled) .site-phone,
.site-head--overlay:not(.is-scrolled) .site-logo-name,
.site-head--overlay:not(.is-scrolled) .site-logo-sub { color: #f2f7fd; }
.site-head--overlay:not(.is-scrolled) .pdd-icon-btn,
.site-head--overlay:not(.is-scrolled) .site-burger { color: #f2f7fd; border-color: rgba(255, 255, 255, 0.28); background: rgba(8, 14, 22, 0.25); }
.site-head--overlay:not(.is-scrolled) .pdd-auth-btn { color: #f2f7fd; border-color: rgba(255, 255, 255, 0.32); }
/* всё, что стоит поверх тёмного фото, читается светлым в обеих темах */
.site-head--overlay:not(.is-scrolled) .site-phone small,
.site-head--overlay:not(.is-scrolled) .pdd-auth-logout { color: rgba(242, 247, 253, 0.72); }
.site-head--overlay:not(.is-scrolled) .pdd-auth-user-name { color: #f2f7fd; }
.site-head--overlay:not(.is-scrolled) .pdd-auth-logout:hover { color: #ff9b9b; }
.site-head--overlay:not(.is-scrolled) .site-nav a:hover { color: #9fe3ff; }
.site-head.is-scrolled { box-shadow: var(--shadow-1); }

.site-head-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  width: min(1320px, 100% - 40px);
  margin-inline: auto;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none !important;
  margin-right: 4px;
  flex-shrink: 0;
}
.site-logo img { width: 46px; height: 46px; display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.18)); }
.site-logo-stack { display: flex; flex-direction: column; line-height: 1.1; }
.site-logo-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink-strong);
}
.site-logo-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut);
}

.site-nav { margin-inline: auto; }
.site-nav ul {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav a {
  position: relative;
  display: inline-block;
  padding: 9px 14px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none !important;
  border-radius: 10px;
  transition: color 0.2s var(--ease);
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: var(--grad-cta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.site-nav a:hover { color: var(--acc); }
.site-nav a:hover::after,
.site-nav a.is-active::after { transform: scaleX(1); }

.site-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.site-phone {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.25;
  color: var(--ink-strong);
  font-weight: 800;
  font-size: 15px;
  text-decoration: none !important;
  letter-spacing: 0.01em;
}
.site-phone small { font-size: 11px; font-weight: 600; color: var(--mut); letter-spacing: 0.06em; }
.site-phone:hover { color: var(--acc); }

.site-burger {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  align-items: center;
  justify-content: center;
}
.site-burger svg { width: 22px; height: 22px; }
.site-burger .i-close { display: none; }
body.nav-open .site-burger .i-open { display: none; }
body.nav-open .site-burger .i-close { display: block; }

/* соцвход в шапке */
.pdd-auth-btn {
  min-height: 40px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-weight: 700;
  font-size: 14px;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
}
.pdd-auth-btn:hover { border-color: var(--acc); color: var(--acc); transform: translateY(-1px); }
.pdd-auth-user { display: inline-flex; align-items: center; gap: 8px; }
.pdd-auth-user[hidden],
.pdd-auth-btn[hidden] { display: none; }
.pdd-auth-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
.pdd-auth-user-name { font-weight: 700; font-size: 14px; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdd-auth-user-name[hidden] { display: none; }
.pdd-auth-logout { color: var(--mut); font-size: 13px; font-weight: 600; }
.pdd-auth-logout:hover { color: var(--bad); }

@media (max-width: 1080px) {
  .site-phone { display: none; }
  .site-nav {
    position: fixed;
    top: var(--head-h);
    left: 0;
    right: 0;
    padding: 10px 20px 26px;
    /* почти непрозрачный фон: blur не везде поддерживается, а меню должно читаться поверх контента */
    background: color-mix(in srgb, var(--bg) 98%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease), visibility 0.3s;
  }
  body.nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { display: block; padding: 13px 10px; font-size: 17px; }
  .site-nav a::after { display: none; }
  .site-nav .site-nav-phone { display: block; }
  .site-burger { display: inline-flex; }
}
.site-nav-phone { display: none; }
.site-nav-phone a { color: var(--acc) !important; font-weight: 800; }

/* отступ под фиксированную шапку на обычных страницах */
.page-offset { padding-top: var(--head-h); }

/* ---------------------------------------------------------------------------
   5. Лендинг: hero
--------------------------------------------------------------------------- */
.lp-hero {
  position: relative;
  min-height: max(620px, 100svh);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}
.lp-hero-media {
  position: absolute;
  inset: -4%;
  z-index: -2;
  background-size: cover;
  background-position: center 64%;
  animation: lp-kenburns 26s var(--ease) infinite alternate;
  will-change: transform;
}
[data-theme="dark"] .lp-hero-media { background-image: url("/static/photos/voa-hero-night-1536.webp"); }
[data-theme="light"] .lp-hero-media { background-image: url("/static/photos/voa-hero-day-1536.webp"); }
@media (max-width: 1300px) {
  [data-theme="dark"] .lp-hero-media { background-image: url("/static/photos/voa-hero-night-1280.webp"); }
  [data-theme="light"] .lp-hero-media { background-image: url("/static/photos/voa-hero-day-1280.webp"); }
}
@media (max-width: 800px) {
  [data-theme="dark"] .lp-hero-media { background-image: url("/static/photos/voa-hero-night-768.webp"); }
  [data-theme="light"] .lp-hero-media { background-image: url("/static/photos/voa-hero-day-768.webp"); }
}
@keyframes lp-kenburns {
  from { transform: scale(1); }
  to { transform: scale(1.09) translateY(-1.2%); }
}
.lp-hero-shade { position: absolute; inset: 0; z-index: -1; background: var(--hero-shade); }

.lp-hero-content {
  width: min(940px, 100% - 44px);
  margin-inline: auto;
  padding: calc(var(--head-h) + 40px) 0 96px;
  text-align: center;
  color: #f4f9ff;
}
.lp-hero-content > * { animation: lp-rise 0.9s var(--ease) both; }
.lp-hero-content > :nth-child(2) { animation-delay: 0.12s; }
.lp-hero-content > :nth-child(3) { animation-delay: 0.22s; }
.lp-hero-content > :nth-child(4) { animation-delay: 0.34s; }
.lp-hero-content > :nth-child(5) { animation-delay: 0.46s; }
@keyframes lp-rise {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

.lp-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(10, 18, 28, 0.35);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8f2fc;
}
.lp-hero-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--grad-cta);
  box-shadow: 0 0 12px rgba(53, 224, 161, 0.9);
}

.lp-hero-title {
  margin: 26px 0 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(30px, 5.4vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.005em;
  color: #ffffff;
  text-shadow: 0 4px 34px rgba(0, 0, 0, 0.45);
  text-wrap: balance;
}
.lp-hero-title em {
  font-style: normal;
  /* hero всегда на тёмном фото — градиент светлый в обеих темах */
  background: linear-gradient(100deg, #7ff5c9 0%, #9fe3ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.35));
}
.lp-hero-sub {
  margin: 0 auto 34px;
  max-width: 640px;
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.6;
  color: rgba(238, 246, 253, 0.92);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
  text-wrap: balance;
}
.lp-hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.lp-hero-cta .local-btn.secondary {
  border-color: rgba(255, 255, 255, 0.44);
  color: #ffffff;
  background: rgba(10, 18, 28, 0.3);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.lp-hero-cta .local-btn.secondary:hover { border-color: #fff; color: #fff; }

.lp-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 26px;
  margin-top: 42px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(226, 238, 249, 0.85);
}
.lp-hero-meta span { display: inline-flex; align-items: center; gap: 8px; }
.lp-hero-meta svg { width: 17px; height: 17px; color: var(--acc); }

.lp-scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  color: rgba(235, 244, 252, 0.75);
  animation: lp-bob 2.4s ease-in-out infinite;
}
.lp-scroll-hint svg { width: 26px; height: 26px; }
@keyframes lp-bob {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.75; }
  50% { transform: translate(-50%, 9px); opacity: 1; }
}

/* ---------------------------------------------------------------------------
   6. Лендинг: секции
--------------------------------------------------------------------------- */
.lp-section { padding: clamp(72px, 9vw, 120px) 0; }
.lp-section--alt { background: var(--bg-2); }

.lp-section-head { max-width: 720px; margin-bottom: clamp(34px, 5vw, 56px); }
.lp-section-head--center { margin-inline: auto; text-align: center; }
.lp-kicker {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--acc);
}
.lp-title {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 3.6vw, 40px);
  line-height: 1.14;
  color: var(--ink-strong);
}
.lp-lead { font-size: clamp(15.5px, 1.8vw, 18px); color: var(--mut); margin: 0; }

/* --- Обучение: фото-карточки категорий --- */
.lp-courses {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.lp-course {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease), border-color 0.45s var(--ease);
  transform-style: preserve-3d;
}
.lp-course:hover {
  transform: translateY(-8px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}
.lp-course-media {
  position: relative;
  aspect-ratio: 16 / 10.5;
  overflow: hidden;
}
.lp-course-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.9s var(--ease);
}
.lp-course:hover .lp-course-media img { transform: scale(1.07); }
.lp-course-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, transparent 55%, rgba(5, 10, 16, 0.55));
  pointer-events: none;
}
.lp-course-cat {
  position: absolute;
  left: 16px;
  bottom: 14px;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(8, 14, 22, 0.62);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #fff;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.lp-course-body { display: flex; flex-direction: column; gap: 10px; padding: 24px 26px 28px; flex: 1; }
.lp-course-body h3 { margin: 0; font-size: 21px; }
.lp-course-body p { margin: 0; color: var(--mut); font-size: 15px; }
.lp-course-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 14px; }
.lp-course-tags span {
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 12.5px;
  font-weight: 700;
}

/* --- Подготовка к экзамену --- */
.lp-exam-grid {
  display: grid;
  grid-template-columns: minmax(300px, 5fr) 7fr;
  gap: 34px;
  align-items: start;
}
.lp-exam-rules {
  position: sticky;
  top: calc(var(--head-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lp-rule {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-1);
}
.lp-rule-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  height: 46px;
  padding: 0 9px;
  border-radius: 14px;
  background: var(--acc-soft);
  color: var(--acc);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.lp-rule--bad .lp-rule-num { background: var(--bad-soft); color: var(--bad); }
.lp-rule > div { min-width: 0; }
.lp-rule > div > b { display: block; font-size: 15.5px; color: var(--ink-strong); }
.lp-rule > div > span { display: block; font-size: 14px; color: var(--mut); line-height: 1.5; }

.lp-modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.lp-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px 22px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none !important;
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.lp-mode::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--grad-cta);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}
.lp-mode:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}
.lp-mode:hover::before { opacity: 1; }
.lp-mode--wide { grid-column: span 2; flex-direction: row; align-items: center; gap: 18px; padding: 24px 26px; }
.lp-mode--wide .lp-mode-text { flex: 1; }
.lp-mode-ico {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--acc-soft);
  position: relative;
}
.lp-mode-ico::after {
  content: "";
  position: absolute;
  inset: 13px;
  background: var(--acc);
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}
.lp-mode b { font-size: 16.5px; color: var(--ink-strong); }
.lp-mode > span:not([class]), .lp-mode-text > span { font-size: 13.5px; color: var(--mut); line-height: 1.5; }
.lp-mode-arrow {
  position: absolute;
  top: 20px;
  right: 20px;
  color: var(--mut-2);
  transition: transform 0.3s var(--ease), color 0.3s var(--ease);
}
.lp-mode-arrow svg { width: 18px; height: 18px; }
.lp-mode:hover .lp-mode-arrow { transform: translate(3px, -3px); color: var(--acc); }

/* --- Почему ВОА: счётчики и карточки --- */
.lp-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.lp-stat {
  padding: 30px 26px 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, var(--acc-soft), transparent 55%),
    var(--card);
  text-align: center;
  box-shadow: var(--shadow-1);
}
.lp-stat b {
  display: block;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(38px, 5vw, 56px);
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.lp-stat i { font-style: normal; font-family: var(--font-display); font-weight: 700; font-size: clamp(26px, 3vw, 34px); background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-stat span { display: block; margin-top: 10px; color: var(--mut); font-size: 14.5px; font-weight: 600; }

.lp-why-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.lp-why-card {
  padding: 24px 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color 0.35s var(--ease);
}
.lp-why-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.lp-why-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--acc-soft);
  color: var(--acc);
}
.lp-why-ico svg { width: 23px; height: 23px; }
.lp-why-card b { display: block; margin-bottom: 6px; font-size: 16px; color: var(--ink-strong); }
.lp-why-card p { margin: 0; font-size: 13.5px; color: var(--mut); line-height: 1.55; }

/* --- Контакты --- */
.lp-contact-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 26px;
  align-items: stretch;
}
.lp-contact-card {
  padding: clamp(26px, 4vw, 40px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-1);
}
.lp-contact-rows { display: grid; gap: 6px; margin-top: 10px; }
.lp-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 15px;
  padding: 13px 4px;
  border-bottom: 1px dashed var(--line);
}
.lp-contact-row:last-child { border-bottom: 0; }
.lp-contact-row svg { flex-shrink: 0; width: 21px; height: 21px; margin-top: 3px; color: var(--acc); }
.lp-contact-row small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mut-2); }
.lp-contact-row a, .lp-contact-row b { font-size: 16.5px; font-weight: 700; color: var(--ink-strong); }
.lp-contact-row a:hover { color: var(--acc); text-decoration: none; }

.lp-contact-cta {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: clamp(26px, 4vw, 40px);
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--card-2), var(--card-2)) padding-box,
    var(--grad-cta) border-box;
  box-shadow: var(--shadow-1);
}
.lp-contact-cta h3 { font-family: var(--font-display); font-weight: 700; font-size: 22px; margin-bottom: 4px; }
.lp-contact-cta p { color: var(--mut); font-size: 14.5px; margin-bottom: 8px; }
.lp-contact-cta .local-btn { width: 100%; white-space: normal; text-align: center; }
/* колонки грида не должны раздуваться от min-content кнопок/строк — иначе на узких экранах уезжает вся страница */
.lp-contact-grid > *, .lp-exam-grid > * { min-width: 0; }

/* ---------------------------------------------------------------------------
   7. Футер
--------------------------------------------------------------------------- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.site-footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
  padding: 52px 0 38px;
}
.site-footer-brand { display: flex; flex-direction: column; gap: 12px; }
.site-footer-brand .site-logo { margin: 0; }
.site-footer-brand p { margin: 0; color: var(--mut); font-size: 14px; max-width: 340px; }
.site-footer h4 {
  margin: 4px 0 14px;
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut-2);
}
.site-footer-col ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.site-footer-col a { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.site-footer-col a:hover { color: var(--acc); text-decoration: none; }
.site-footer-legal {
  padding: 18px 0 26px;
  border-top: 1px solid var(--line);
  color: var(--mut-2);
  font-size: 13px;
  line-height: 1.6;
}

/* ---------------------------------------------------------------------------
   8. Тренажёр: каркас
--------------------------------------------------------------------------- */
.tr-main {
  min-height: 100svh;
  padding: 26px 0 70px;
}
/* .page-offset идёт ПОСЛЕ .tr-main в исходнике не всегда — фиксируем явно */
.tr-main.page-offset { padding-top: calc(var(--head-h) + 26px); }

.tr-topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.tr-crumbs { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.tr-crumbs b { font-family: var(--font-display); font-weight: 700; font-size: 19px; color: var(--ink-strong); }
.tr-crumbs span { font-size: 13px; color: var(--mut); font-weight: 600; }

.tr-tool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
  user-select: none;
}
.tr-tool:hover { border-color: var(--acc); transform: translateY(-1px); }
#buttonTextCategory { color: var(--acc); }
.tr-tool .mode-ico { width: 17px; height: 17px; background: currentColor; -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }

/* горизонтальная навигация разделов тренажёра */
.tr-nav { margin-bottom: 26px; }
.tr-nav ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.tr-nav ul::-webkit-scrollbar { display: none; }
.tr-nav li { flex-shrink: 0; }
.tr-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--mut);
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none !important;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
  white-space: nowrap;
}
.tr-nav a:hover { color: var(--ink-strong); border-color: var(--line-strong); }
.tr-nav a.active { color: var(--acc); border-color: var(--acc); background: var(--acc-soft); }
.tr-nav .pdd-ico {
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}

/* панели-виды тренажёра */
.local-panel-block { display: none; }
.local-panel-block.show { display: block; animation: panel-in 0.45s var(--ease) both; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.tr-panel {
  padding: clamp(22px, 3.4vw, 38px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-1);
}

/* ---------------------------------------------------------------------------
   9. Тренажёр: хаб режимов
--------------------------------------------------------------------------- */
.tr-hub-head { margin-bottom: 26px; max-width: 760px; }
.tr-hub-head h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(24px, 3.4vw, 36px); }
.tr-hub-head p { color: var(--mut); margin: 0; }

.tr-modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 34px;
}
.tr-mode {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 22px 20px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  text-decoration: none !important;
  overflow: hidden;
  transition: transform 0.32s var(--ease), border-color 0.32s var(--ease), box-shadow 0.32s var(--ease);
}
.tr-mode::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: var(--grad-cta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.tr-mode:hover { transform: translateY(-5px); border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.tr-mode:hover::after { transform: scaleX(1); }
.tr-mode.exam-active { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc), var(--shadow-1); }
.tr-mode.exam-active::after { transform: scaleX(1); }

.tr-mode .mode-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--acc-soft);
  position: relative;
}
.tr-mode .mode-ico::after {
  content: "";
  position: absolute;
  inset: 12px;
  background: var(--acc);
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat;
}
.mode-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15.5px; color: var(--ink-strong); }
.mode-desc { display: block; font-size: 13px; color: var(--mut); line-height: 1.5; }

.tr-mode--featured {
  grid-column: span 2;
  background:
    linear-gradient(150deg, var(--acc-soft), transparent 60%),
    var(--card);
}
.tr-mode--featured .mode-title { font-size: 17.5px; }

.mywrongscounter,
.myfavcounter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--bad);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}
.myfavcounter { background: var(--acc-2); }
.mywrongscounter-gray,
.myfavcounter-gray { background: var(--line-strong); color: var(--mut); }

/* блок «экзамен завтра» и «слабые места» */
.pdd-home-extra {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 34px;
}
.pdd-home-extra h2 { font-size: 17px; margin-bottom: 12px; }
.pdd-home-extra > div {
  padding: 22px 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card);
}
.pdd-exam-plan { grid-row: 2; }
.pdd-plan-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 14.5px; }
.pdd-plan-list li::marker { color: var(--acc); font-weight: 800; }
.pdd-weak-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.pdd-weak-row:last-child { border-bottom: 0; }
.pdd-weak-row b { color: var(--ink-strong); }
.pdd-weak-row span { color: var(--mut); white-space: nowrap; }

/* факты (используются в хабе и панелях) */
.pdd-facts { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.pdd-fact {
  min-width: 108px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  text-align: center;
}
.pdd-fact b {
  display: block;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink-strong);
}
.pdd-fact span { font-size: 12.5px; color: var(--mut); font-weight: 600; }
.pdd-fact--live b { color: var(--acc); }
.pdd-here {
  margin: 10px 0 0;
  color: var(--mut);
  font-size: 13.5px;
  font-weight: 600;
}
.lp-mode > .pdd-here {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--acc);
}

/* ---------------------------------------------------------------------------
   10. Билеты и темы
--------------------------------------------------------------------------- */
.tickets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.button-bilet-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1.25;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  text-decoration: none !important;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.button-bilet-item.is-done {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: linear-gradient(160deg, var(--ok-soft), var(--card-2) 55%);
}
.button-bilet-item.is-progress {
  border-color: var(--warn);
  background: var(--warn-soft);
}
.button-bilet-mark {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ok);
  line-height: 1;
}
.button-bilet-item.is-progress .button-bilet-mark { color: var(--warn); }
.button-bilet-item:hover {
  transform: translateY(-3px);
  border-color: var(--acc);
  background: var(--acc-soft);
  box-shadow: var(--shadow-1);
}
.button-bilet-item:active { transform: none; }
.button-bilet-item-sub {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink-strong);
}

.button-thema-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-top: 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none !important;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.button-thema-item:hover { transform: translateX(4px); border-color: var(--acc); background: var(--acc-soft); }
.button-thema-item > span:first-child { flex: 1; }
.button-thema-count {
  flex-shrink: 0;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 12.5px;
  font-weight: 800;
}
.button-thema-item.is-done {
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: linear-gradient(90deg, var(--ok-soft), var(--card-2) 42%);
}
.button-thema-item.is-progress {
  border-color: var(--warn);
  background: linear-gradient(90deg, var(--warn-soft), var(--card-2) 42%);
}
.button-thema-item.is-progress .button-thema-done {
  background: var(--warn);
  color: #2a1c00;
}
.button-thema-item.is-progress:hover {
  border-color: var(--warn);
  background: linear-gradient(90deg, var(--warn-soft), var(--card-2) 42%);
}
.button-thema-done {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--ok);
  color: #042016;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.tip-autonext {
  display: block;
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mut);
}

/* ---------------------------------------------------------------------------
   11. Квиз (тренировка)
--------------------------------------------------------------------------- */
#view-quiz { display: none; max-width: 900px; margin-inline: auto; }

.timer-head {
  position: sticky;
  top: calc(var(--head-h) + 10px);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--head-bg);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: var(--shadow-1);
  margin-bottom: 14px;
  overflow: hidden;
}
.quiz-exit {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--mut);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.quiz-exit svg { width: 20px; height: 20px; }
.quiz-exit:hover { color: var(--acc); border-color: var(--acc); transform: translateX(-2px); }
.box_num_bil_vop { display: flex; flex-direction: column; line-height: 1.3; margin-right: auto; min-width: 0; }
#nomerb { font-weight: 800; font-size: 15px; color: var(--ink-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#nomerq { font-size: 12.5px; color: var(--mut); font-weight: 600; white-space: nowrap; }
.quiz-block-chip {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.quiz-block-chip[hidden] { display: none; }
#timer {
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  font-variant-numeric: tabular-nums;
  color: var(--acc);
  letter-spacing: 0.04em;
  transition: color 0.3s var(--ease);
}
#timer.is-low { color: var(--bad); animation: timer-pulse 1s var(--ease) infinite; }
@keyframes timer-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.quiz-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--line);
}
.quiz-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--grad-cta);
  transition: width 0.4s var(--ease);
}

.local-statline { font-size: 13.5px; color: var(--mut); margin: 0 4px 12px; font-weight: 600; }
.local-statline .ok { color: var(--ok); }
.local-statline .bad { color: var(--bad); }

#blking-examen {
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-1);
  padding: clamp(18px, 3vw, 32px);
}

.quest-image-frame {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 20px;
}
.quest-image-frame.is-empty { display: none; }
.quest-image-frame::after {
  content: "©Автошкола ВОА";
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 8px 3px 26px;
  background:
    url("/static/brand/mark.svg") 5px center / 16px 16px no-repeat,
    rgba(8, 12, 20, 0.38);
  border-radius: 999px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}
@media (max-width: 520px) {
  .quest-image-frame::after {
    right: 6px;
    bottom: 6px;
    padding: 2px 7px 2px 22px;
    background-size: 14px 14px, auto;
    background-position: 4px center, 0 0;
    font-size: 10px;
    min-height: 20px;
  }
}
.quest-image {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border-radius: 12px;
  background: #0b0f16;
}
[data-theme="light"] .quest-image { background: #e6ebf2; }
.quest-image.is-empty { display: none; }

.quest {
  font-size: clamp(17px, 2.2vw, 20px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink-strong);
  margin-bottom: 20px;
}

/* варианты ответов; классы целиком заменяет trainer.js */
.answer,
.answer_green,
.answer_red,
.answer_yellow,
.answer_gray {
  margin: 10px 0;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.answer { cursor: pointer; }
.answer:hover { border-color: var(--acc); background: var(--acc-soft); transform: translateX(3px); }
.answer:active { transform: scale(0.995); }
.answer ol,
.answer_green ol,
.answer_red ol,
.answer_yellow ol,
.answer_gray ol {
  margin: 0;
  padding: 14px 18px 14px 44px;
}
.answer li,
.answer_green li,
.answer_red li,
.answer_yellow li,
.answer_gray li {
  font-size: 15.5px;
  line-height: 1.5;
}
.answer li::marker,
.answer_green li::marker,
.answer_red li::marker,
.answer_yellow li::marker,
.answer_gray li::marker {
  font-weight: 800;
  color: var(--mut-2);
}
.answer_green { border-color: var(--ok); background: var(--ok-soft); }
.answer_green li::marker { color: var(--ok); }
.answer_red { border-color: var(--bad); background: var(--bad-soft); }
.answer_red li::marker { color: var(--bad); }
.answer_yellow { border-color: var(--warn); background: var(--warn-soft); }
.answer_yellow li::marker { color: var(--warn); }
.answer_gray { opacity: 0.62; }

#tip-quest { display: none; }
#tip-quest.show {
  display: block;
  margin-top: 16px;
  padding: 16px 20px;
  border-radius: var(--r-sm);
  border: 1px solid var(--ok);
  background: var(--ok-soft);
  font-size: 14.5px;
  line-height: 1.6;
  animation: panel-in 0.35s var(--ease) both;
}
#tip-quest.show.bad { border-color: var(--bad); background: var(--bad-soft); }
#tip-quest b { color: var(--ink-strong); }

.local-next-row { display: none; margin-top: 18px; gap: 12px; flex-wrap: wrap; }
.local-next-row.show { display: flex; }

#blking-quests {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px dashed var(--line);
}
.q-number,
.q-number-gray,
.q-number-green,
.q-number-red {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 6px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--mut);
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease);
}
.q-number:hover { border-color: var(--acc); color: var(--ink-strong); transform: translateY(-2px); }
.q-number-gray { background: var(--line); color: var(--mut); }
.q-number-green { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.q-number-red { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.q-number-active { box-shadow: 0 0 0 2px var(--acc); border-color: var(--acc); color: var(--ink-strong); }

.local-keys-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 12.5px;
  color: var(--mut-2);
}
.quiz-stack { position: relative; }

/* преподаватель «Разобраться» */
.pdd-tutor-panel { margin-top: 14px; display: grid; gap: 12px; }
.pdd-tutor-panel[hidden] { display: none; }
.pdd-tutor-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pdd-tutor-text {
  padding: 16px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  font-size: 14.5px;
  line-height: 1.65;
  white-space: pre-wrap;
}
.pdd-tutor-follow { display: flex; gap: 10px; flex-wrap: wrap; }
.pdd-tutor-follow .pdd-auth-input { flex: 1; min-width: 200px; }
.pdd-tutor-audio { width: 100%; }

/* ---------------------------------------------------------------------------
   12. Класс ГАИ (полноэкранный экзамен)
--------------------------------------------------------------------------- */
.gibdd-start {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(90vw 70vh at 50% -10%, var(--acc2-soft), transparent 60%),
    var(--bg);
}
.gibdd-start.show { display: flex; }
/* на низких экранах карточка выше вьюпорта — не обрезать, а скроллить внутри оверлея */
.gibdd-start-card { margin: auto; }
@media (max-width: 800px) {
  .gibdd-start { padding: 14px; }
  .gibdd-start-card p { font-size: 14px; }
}
.gibdd-back {
  position: absolute;
  top: 22px;
  left: 26px;
  color: var(--mut);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
}
.gibdd-back:hover { color: var(--acc); }
.gibdd-start-card {
  width: min(620px, 100%);
  padding: clamp(28px, 4vw, 46px);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-2);
  text-align: center;
  animation: panel-in 0.5s var(--ease) both;
}
.gibdd-start-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--mut);
}
.gibdd-start-card h1 { font-family: var(--font-display); font-size: clamp(26px, 4vw, 34px); }
.gibdd-start-card p { color: var(--mut); font-size: 15px; }
.gibdd-start-card .warn {
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent);
  font-size: 14px;
}
.gibdd-start-cta { font-weight: 700; color: var(--ink-strong) !important; margin-top: 8px; }
.gibdd-start-cats { display: flex; gap: 14px; justify-content: center; margin-top: 16px; }
.gibdd-start-cats button {
  min-width: 150px;
  min-height: 56px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  color: var(--ink-strong);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.gibdd-start-cats button:hover {
  transform: translateY(-3px);
  border-color: var(--acc);
  background: var(--acc-soft);
  box-shadow: var(--shadow-1);
}

.full-examen-pdd {
  position: fixed;
  inset: 0;
  z-index: 71;
  display: none;
  background: var(--bg);
  overflow-y: auto;
}
.full-examen-pdd.show { display: block; }
.full-exam-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--head-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.full-exam-numbers {
  display: flex;
  align-items: center;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}
.full-exam-numbers::-webkit-scrollbar { display: none; }
.full-exam-logo { display: block; }
.full-exam-num,
#quest-mini-list {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 5px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--card-2);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mut);
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
#quest-mini-list svg { width: 16px; height: 16px; }
.full-exam-num.answered { background: var(--line); }
.full-exam-num.ok { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.full-exam-num.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.full-exam-num-active { border-color: var(--acc) !important; color: var(--ink-strong) !important; box-shadow: 0 0 0 1px var(--acc); }
.full-exam-extras { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.full-exam-timer {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--acc);
  font-variant-numeric: tabular-nums;
}
.full-exam-extra { cursor: pointer; font-size: 19px; color: var(--mut); }
.full-exam-extra:hover { color: var(--ink-strong); }

.full-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 20px;
  max-width: 1500px;
  margin-inline: auto;
}
.full-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px 12px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  border-top: 4px solid var(--blk, var(--acc));
  background: var(--card);
}
.first-block { --blk: #35e0a1; }
.second-block { --blk: #58c6ff; }
.third-block { --blk: #b58cff; }
.fourth-block { --blk: #ffc14d; }

.full-exam-cell { position: relative; }
.full-exam-item-sub {
  position: absolute;
  top: -8px;
  left: -6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--bg-2);
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 800;
  color: var(--mut);
}
.full-exam-item-res { display: none; }
.full-exam-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 92px;
  padding: 14px 12px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.full-exam-item:hover { transform: translateY(-3px); border-color: var(--acc); box-shadow: var(--shadow-1); }
.full-exam-item.has-answer { opacity: 0.86; }
.full-exam-item.has-ok { border-color: var(--ok); background: var(--ok-soft); }
.full-exam-item.has-wrong { border-color: var(--bad); background: var(--bad-soft); }
.full-exam-item-padding { flex-shrink: 0; }
.full-exam-item-image {
  display: block;
  width: 100%;
  height: 84px;
  border-radius: 9px;
  background-size: cover;
  background-position: center;
}
.full-exam-quest {
  font-size: 12px;
  line-height: 1.45;
  color: var(--mut);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.full-quest {
  position: fixed;
  inset: 0;
  top: 53px;
  z-index: 72;
  display: none;
  flex-direction: column;
  background: var(--bg);
}
.full-quest.show { display: flex; }
.full-quest-content {
  flex: 1;
  overflow-y: auto;
  width: min(920px, 100% - 32px);
  margin-inline: auto;
  padding: 26px 0 16px;
}
.full-quest-text {
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink-strong);
  margin-bottom: 18px;
}
.full-quest-image .quest-image-frame {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 18px;
}
.full-quest-image img {
  display: block;
  max-width: 100%;
  max-height: 42vh;
  margin: 0;
  border-radius: 12px;
}
.full-quest-answers { display: grid; gap: 10px; }
.full-quest-answers .ans {
  margin: 0;
  padding: 14px 18px 14px 44px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card);
  cursor: pointer;
  font-size: 15.5px;
  line-height: 1.5;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.full-quest-answers .ans:hover { border-color: var(--acc); background: var(--acc-soft); }
.full-quest-answers .ans li::marker { font-weight: 800; color: var(--mut-2); }
.full-quest-answers .ans.picked {
  border-color: var(--warn);
  background: var(--warn-soft);
  box-shadow: 0 0 0 1px var(--warn);
}
.full-quest-answers .ans.correct { border-color: var(--ok); background: var(--ok-soft); }
.full-quest-answers .ans.bad { border-color: var(--bad); background: var(--bad-soft); }
.full-quest-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--head-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.full-quest-but {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
  user-select: none;
}
.full-quest-but:hover { border-color: var(--acc); color: var(--acc); transform: translateY(-1px); }

.full-result-examen {
  position: fixed;
  inset: 0;
  z-index: 73;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.full-result-examen.show { display: flex; }
.full-result-examen > div {
  width: min(560px, 100%);
  padding: clamp(30px, 4vw, 46px);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-2);
  text-align: center;
  animation: pop-in 0.5s var(--ease-snap) both;
}
@keyframes pop-in {
  from { opacity: 0; transform: scale(0.92) translateY(18px); }
  to { opacity: 1; transform: none; }
}
#resultText {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(24px, 4vw, 32px);
  margin-bottom: 12px;
}
.full-result-examen.result-green #resultText { color: var(--ok); }
.full-result-examen.result-red #resultText { color: var(--bad); }
#resultDesc { color: var(--mut); font-size: 15px; line-height: 1.6; }

/* ---------------------------------------------------------------------------
   13. Итог тренировки (модалка)
--------------------------------------------------------------------------- */
#result-examen-shadow {
  position: fixed;
  inset: 0;
  z-index: 74;
  display: none;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
#result-examen-shadow.show { display: block; }
#result-examen {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
}
#result-examen.show { display: flex; }
.result-examen-box {
  pointer-events: auto;
  width: min(520px, 100%);
  border-radius: var(--r-xl);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-2);
  animation: pop-in 0.5s var(--ease-snap) both;
}
.result-examen-upper { padding: clamp(30px, 4vw, 44px); text-align: center; }
.svg-rezult-exam,
.svg-rezult-exam-good { display: none; width: 76px; height: 76px; margin: 0 auto 16px; }
.svg-rezult-exam.show,
.svg-rezult-exam-good.show { display: block; }
.svg-rezult-exam circle { stroke: var(--bad); stroke-width: 3; }
.svg-rezult-exam path { stroke: var(--bad); stroke-width: 4; stroke-linecap: round; }
.svg-rezult-exam-good path { fill: var(--ok); }
.rezult {
  display: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(23px, 3.4vw, 30px);
  line-height: 1.25;
  margin-bottom: 10px;
}
.rezult.show { display: block; }
#textresultGood { color: var(--ok); }
#textresultBad { color: var(--bad); }
.resultCountBlock { color: var(--mut); font-size: 15px; line-height: 1.7; }
.result-reason {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: var(--r-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}
.result-reason[hidden] { display: none; }

/* ---------------------------------------------------------------------------
   14. Справочник знаков
--------------------------------------------------------------------------- */
.ref-search {
  display: flex;
  gap: 10px;
  margin: 18px 0 14px;
}
.ref-search input {
  flex: 1;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.ref-search input::placeholder { color: var(--mut-2); }
.ref-search input:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}

.sign-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}
.sign-filters::-webkit-scrollbar { display: none; }
.sign-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--mut);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.sign-chip span {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--line);
  font-size: 11.5px;
  color: var(--mut);
}
.sign-chip:hover { color: var(--ink-strong); border-color: var(--line-strong); }
.sign-chip.is-on { color: var(--acc); border-color: var(--acc); background: var(--acc-soft); }
.sign-chip.is-on span { background: var(--acc); color: #06281c; }

.signs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.sign-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  text-align: center;
  cursor: pointer;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.sign-tile:hover { transform: translateY(-4px); border-color: var(--acc); box-shadow: var(--shadow-1); }
.sign-tile:active { transform: none; }
.sign-tile[hidden] { display: none; }
.sign-tile img { width: 64px; height: 64px; object-fit: contain; }
.sign-tile-noimg { color: var(--mut-2); font-size: 12px; padding: 20px 0; }
.sign-tile-code { font-weight: 800; font-size: 13px; color: var(--acc-2); }
.sign-tile-name {
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--mut);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.signs-empty,
.pdd-fines-empty {
  padding: 26px;
  border-radius: var(--r-md);
  border: 1px dashed var(--line-strong);
  color: var(--mut);
  text-align: center;
  margin-top: 14px;
}

.sign-sheet { position: fixed; inset: 0; z-index: 80; }
.sign-sheet[hidden] { display: none; }
.sign-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.sign-sheet-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(640px, calc(100% - 28px));
  max-height: min(84vh, 720px);
  overflow-y: auto;
  padding: 26px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-2);
  animation: pop-in 0.4s var(--ease-snap) both;
}
.sign-sheet-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 14px; }
#sign-sheet-img {
  flex-shrink: 0;
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: var(--r-xs);
  background: var(--card-2);
  padding: 8px;
}
.sign-sheet-headtext { flex: 1; }
.sign-sheet-cat {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acc);
}
.sign-sheet-card h2 { font-size: 20px; margin: 0; }
.sign-sheet-close { flex-shrink: 0; }
.sign-sheet-body { white-space: pre-line; font-size: 14.5px; line-height: 1.65; color: var(--ink); }
.sign-penalty {
  margin-top: 16px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent);
  background: var(--warn-soft);
  font-size: 14px;
  line-height: 1.6;
}
.sign-penalty b { display: block; margin-bottom: 4px; color: var(--ink-strong); }
.sign-sheet-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.sign-sheet-nav .local-btn:disabled { opacity: 0.4; }

/* ---------------------------------------------------------------------------
   15. Текст ПДД
--------------------------------------------------------------------------- */
.rules-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.rule-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none !important;
  transition: transform 0.22s var(--ease), border-color 0.22s var(--ease), background 0.22s var(--ease);
}
.rule-link:hover { transform: translateX(4px); border-color: var(--acc); background: var(--acc-soft); }
.rule-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--acc-soft);
  color: var(--acc);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  color: var(--mut);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
}
.back-link:hover { color: var(--acc); }
.rule-body { font-size: 15.5px; line-height: 1.75; }
.rule-body h2, .rule-body h3, .rule-body h4 { margin-top: 1.4em; }
.rule-body p { margin: 0 0 1em; }
.rule-body ul, .rule-body ol { padding-left: 24px; }
.rule-body li { margin-bottom: 0.5em; }
.rule-body img { border-radius: var(--r-xs); background: #fff; padding: 4px; }
.rule-body a { color: var(--acc-2); }
.rule-body table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 14px; }
.rule-body th, .rule-body td { border: 1px solid var(--line-strong); padding: 8px 12px; text-align: left; }
.rule-body blockquote {
  margin: 1em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--acc);
  background: var(--card-2);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
}

/* ---------------------------------------------------------------------------
   16. Штрафы
--------------------------------------------------------------------------- */
.pdd-fines { display: grid; gap: 12px; margin-top: 16px; }
.pdd-fine {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.pdd-fine[hidden] { display: none; }
.pdd-fine-media { flex-shrink: 0; }
.pdd-fine-media img { width: 58px; height: 58px; object-fit: contain; }
.pdd-fine-body { flex: 1; min-width: 0; }
.pdd-fine-title { font-weight: 700; color: var(--ink-strong); font-size: 15px; }
.pdd-fine-title:hover { color: var(--acc); text-decoration: none; }
.pdd-fine-code { color: var(--acc-2); }
.pdd-fine-cat { display: block; margin: 3px 0 6px; font-size: 12px; color: var(--mut-2); font-weight: 600; }
.pdd-fine-text { margin: 0; font-size: 13.5px; color: var(--mut); line-height: 1.55; }

/* ---------------------------------------------------------------------------
   17. Панели: FAQ, лента, поддержка, тест знаков, форум
--------------------------------------------------------------------------- */
.crumbs {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut-2);
  margin-bottom: 10px;
}
.pdd-pill {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.pdd-hint { color: var(--mut-2); font-size: 13.5px; }
.pdd-bullets { padding-left: 22px; display: grid; gap: 9px; }
.pdd-bullets li::marker { color: var(--acc); }

.pdd-faq {
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--card-2);
  overflow: hidden;
}
.pdd-faq summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink-strong);
  list-style: none;
  position: relative;
  padding-right: 46px;
  transition: color 0.2s var(--ease);
}
.pdd-faq summary::-webkit-details-marker { display: none; }
.pdd-faq summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--acc-soft);
  color: var(--acc);
  font-size: 17px;
  font-weight: 700;
  transition: transform 0.3s var(--ease);
}
.pdd-faq[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.pdd-faq[open] summary { color: var(--acc); }
.pdd-faq p, .pdd-faq ul { padding: 0 20px; margin: 0 0 14px; font-size: 14.5px; color: var(--ink); }
.pdd-faq ul { padding-left: 40px; }

.pdd-feed-item { padding: 20px 0; border-bottom: 1px dashed var(--line); }
.pdd-feed-item:last-child { border-bottom: 0; }
.pdd-feed-item time { font-size: 12.5px; font-weight: 700; color: var(--acc); letter-spacing: 0.04em; }
.pdd-feed-item h2 { font-size: 18px; margin: 6px 0 8px; }
.pdd-feed-item p { margin: 0; color: var(--mut); font-size: 14.5px; }

.pdd-support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 18px 0; }
.pdd-support-card {
  padding: 22px 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.pdd-support-card h2 { font-size: 17px; }
.pdd-support-card p { color: var(--mut); font-size: 14px; }
.pdd-support-form {
  margin-top: 10px;
  padding: 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card-2);
  display: grid;
  gap: 14px;
}
.pdd-support-form h2 { font-size: 17px; margin: 0; }
.pdd-field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--mut); }
.pdd-field input,
.pdd-field select,
.pdd-field textarea {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 11px 15px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: var(--card);
}
.pdd-field textarea { resize: vertical; }
.pdd-field input:focus, .pdd-field select:focus, .pdd-field textarea:focus {
  outline: none;
  border-color: var(--acc);
  box-shadow: 0 0 0 3px var(--acc-soft);
}

.pdd-quiz-start, .pdd-quiz-done { max-width: 560px; }
.pdd-quiz-play { max-width: 640px; }
.pdd-quiz-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--mut);
  margin-bottom: 16px;
}
.pdd-quiz-sign {
  display: flex;
  justify-content: center;
  padding: 22px;
  border-radius: var(--r-md);
  background: var(--card-2);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.pdd-quiz-sign img { width: 150px; height: 150px; object-fit: contain; }
.pdd-quiz-ask { font-weight: 700; color: var(--ink-strong); }
.pdd-quiz-answers { display: grid; gap: 10px; margin-bottom: 14px; }
.pdd-quiz-opt {
  text-align: left;
  padding: 13px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.pdd-quiz-opt:hover:not(:disabled) { border-color: var(--acc); background: var(--acc-soft); transform: translateX(3px); }
.pdd-quiz-opt.is-right { border-color: var(--ok); background: var(--ok-soft); }
.pdd-quiz-opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.pdd-quiz-feedback {
  padding: 13px 17px;
  border-radius: var(--r-sm);
  font-size: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
}
.pdd-quiz-feedback.is-right { border-color: var(--ok); background: var(--ok-soft); }
.pdd-quiz-feedback.is-wrong { border-color: var(--bad); background: var(--bad-soft); }

.forum-item { padding: 12px 0; border-bottom: 1px dashed var(--line); }

/* контакты (юр. страница) */
.voa-contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0; }
.voa-contact-card {
  padding: 22px 24px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.voa-contact-card h2 { font-size: 16px; }
.voa-contact-card p { margin-bottom: 6px; }
.voa-phone { font-size: 19px; font-weight: 800; color: var(--ink-strong); }
.voa-phone:hover { color: var(--acc); text-decoration: none; }

/* ---------------------------------------------------------------------------
   18. Модалка входа
--------------------------------------------------------------------------- */
/* Центрирование через flex: анимация pop-in управляет transform карточки,
   поэтому translate(-50%,-50%) на ней использовать нельзя */
.pdd-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.pdd-modal[hidden] { display: none; }
.pdd-modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.pdd-modal-card {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 30px 28px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-2);
  animation: pop-in 0.4s var(--ease-snap) both;
}
.pdd-modal-card h2 { font-family: var(--font-display); font-size: 22px; }
.pdd-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 20px;
  color: var(--mut);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pdd-modal-close:hover { color: var(--bad); background: var(--bad-soft); }
.pdd-auth-providers { display: grid; gap: 10px; margin-top: 14px; }
.pdd-auth-provider {
  padding: 13px 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  font-weight: 700;
  font-size: 14.5px;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.pdd-auth-provider:hover { border-color: var(--acc); background: var(--acc-soft); transform: translateY(-1px); }
.pdd-auth-muted { color: var(--mut); font-size: 14px; }
.pdd-auth-error { color: var(--bad); font-size: 14px; }
.pdd-auth-label { display: grid; gap: 6px; margin: 12px 0; font-size: 13.5px; font-weight: 700; color: var(--mut); }
.pdd-auth-input {
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  padding: 11px 15px;
  border-radius: var(--r-xs);
  border: 1px solid var(--line-strong);
  background: var(--card-2);
}
.pdd-auth-input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
.pdd-auth-input-phone {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------------
   19. Чат
--------------------------------------------------------------------------- */
.pdd-chat-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 65;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--grad-cta);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-cta);
  transition: transform 0.25s var(--ease);
}
.pdd-chat-fab svg { width: 20px; height: 20px; flex: none; }
.pdd-chat-fab:hover { transform: translateY(-3px); }
.pdd-chat-window {
  position: fixed;
  right: 20px;
  bottom: 82px;
  z-index: 66;
  width: min(380px, calc(100vw - 32px));
  height: min(520px, 70vh);
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  animation: panel-in 0.35s var(--ease) both;
}
.pdd-chat-window[hidden] { display: none; }
.pdd-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--card-2);
}
.pdd-chat-head button { font-size: 18px; color: var(--mut); width: 30px; height: 30px; border-radius: 8px; }
.pdd-chat-head button:hover { color: var(--bad); background: var(--bad-soft); }
.pdd-chat-messages { flex: 1; overflow-y: auto; padding: 14px 18px; display: grid; gap: 10px; align-content: start; }
.pdd-chat-msg {
  padding: 10px 14px;
  border-radius: var(--r-xs);
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
}
.pdd-chat-msg strong { display: block; font-size: 12.5px; color: var(--acc); margin-bottom: 2px; }
.pdd-chat-cardlink { display: inline-block; margin-top: 5px; font-size: 12.5px; font-weight: 700; }
.pdd-chat-compose {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--card-2);
}
.pdd-chat-compose .pdd-auth-input { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------------------
   20. Реклама (РСЯ)
--------------------------------------------------------------------------- */
.pdd-ad { margin: 18px 0; }
.pdd-ad-label {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mut-2);
  margin-bottom: 6px;
}
.pdd-ad-frame { min-height: 0; border-radius: var(--r-sm); overflow: hidden; }
.pdd-ad--live .pdd-ad-frame[hidden] { display: block; }

/* ---------------------------------------------------------------------------
   21. Scroll-reveal и «выключатели» анимаций
--------------------------------------------------------------------------- */
html.js-anim [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  transition-delay: var(--rd, 0ms);
}
html.js-anim [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  html.js-anim [data-reveal] { opacity: 1; transform: none; }
  .lp-hero-media { animation: none; }
}

/* ---------------------------------------------------------------------------
   21a. Тост
--------------------------------------------------------------------------- */
.pdd-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 120;
  transform: translate(-50%, 20px);
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.pdd-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.pdd-toast[hidden] { display: none; }
.pdd-toast--ok { border-color: var(--ok); background: var(--ok-soft); }
.pdd-toast--warn { border-color: var(--warn); background: var(--warn-soft); }
.pdd-toast--bad { border-color: var(--bad); background: var(--bad-soft); }

/* ---------------------------------------------------------------------------
   21b. Настройки тренажёра (модалка)
--------------------------------------------------------------------------- */
.pdd-settings-list { display: grid; gap: 10px; margin: 18px 0 6px; }
.pdd-switch {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
  cursor: pointer;
  transition: border-color 0.2s var(--ease);
}
.pdd-switch:hover { border-color: var(--acc); }
.pdd-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.pdd-switch-track {
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--line-2, var(--line));
  position: relative;
  transition: background 0.25s var(--ease);
}
.pdd-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.25s var(--ease);
}
.pdd-switch input:checked + .pdd-switch-track { background: var(--acc); }
.pdd-switch input:checked + .pdd-switch-track::after { transform: translateX(18px); }
.pdd-switch input:focus-visible + .pdd-switch-track { outline: 2px solid var(--acc); outline-offset: 2px; }
.pdd-switch-text { display: flex; flex-direction: column; gap: 2px; }
.pdd-switch-text b { font-size: 14.5px; color: var(--ink-strong); }
.pdd-switch-text small { font-size: 12.5px; color: var(--mut); }
.pdd-settings-danger {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.pdd-settings-danger .tr-tool { font-size: 13px; }
.pdd-settings-danger .tr-tool:hover { border-color: var(--bad); color: var(--bad); }

/* ---------------------------------------------------------------------------
   21c. Класс ГАИ: регламент на стартовом экране
--------------------------------------------------------------------------- */
.gibdd-rules {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 18px 0 6px;
  text-align: left;
}
.gibdd-rules > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--card-2);
}
.gibdd-rules b { font-family: var(--font-display); font-size: 18px; color: var(--acc); }
.gibdd-rules > div:last-child b { color: var(--bad); }
.gibdd-rules span { font-size: 12.5px; color: var(--mut); line-height: 1.4; }

/* ---------------------------------------------------------------------------
   21d. Лендинг: «как проходит обучение»
--------------------------------------------------------------------------- */
.lp-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  position: relative;
}
.lp-steps::before {
  content: "";
  position: absolute;
  top: 26px;
  left: 6%;
  right: 6%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--acc) 12%, var(--acc) 88%, transparent);
  opacity: 0.45;
}
.lp-step {
  position: relative;
  padding: 0 4px;
  text-align: center;
}
.lp-step-num {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  margin-bottom: 16px;
  background: var(--grad-cta);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  box-shadow: var(--shadow-cta), 0 0 0 8px var(--bg);
}
.lp-step h3 { font-size: 17px; margin-bottom: 8px; color: var(--ink-strong); }
.lp-step p { font-size: 14px; color: var(--mut); line-height: 1.55; }

/* ---------------------------------------------------------------------------
   21e. Лендинг: FAQ о поступлении
--------------------------------------------------------------------------- */
.lp-faq-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) 1.4fr;
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}
.lp-faq-grid .lp-section-head { margin-bottom: 0; position: sticky; top: calc(var(--head-h) + 24px); }
.lp-faq-list { display: grid; gap: 10px; }
.lp-faq-list .pdd-faq { margin: 0; }
.lp-faq-list .pdd-faq[open] { border-color: var(--acc); box-shadow: var(--shadow-1); }
.lp-faq-list .pdd-faq summary { font-size: 16px; }
.lp-faq-list .pdd-faq p { font-size: 15px; line-height: 1.65; color: var(--mut); margin-bottom: 18px; }
.lp-faq-grid .lp-section-head .local-btn { margin-top: 18px; }

/* ---------------------------------------------------------------------------
   21f. Лендинг: карта и липкий CTA
--------------------------------------------------------------------------- */
.lp-map {
  position: relative;
  margin-top: clamp(30px, 4vw, 48px);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  aspect-ratio: 21 / 8;
  min-height: 280px;
  background: var(--card-2);
}
.lp-map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
[data-theme="dark"] .lp-map iframe { filter: invert(0.9) hue-rotate(185deg) saturate(0.65) brightness(0.95); }
.lp-map-badge {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  color: var(--ink-strong);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none !important;
  max-width: calc(100% - 36px);
}
.lp-map-badge svg { width: 20px; height: 20px; color: var(--acc); flex: none; }
.lp-map-badge span { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.lp-map-badge b { font-size: 13.5px; }
.lp-map-badge small { font-size: 11.5px; font-weight: 600; color: var(--mut); }
.lp-map-badge:hover { border-color: var(--acc); }

.lp-sticky-cta {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 70;
  gap: 8px;
  padding: 8px;
  border-radius: 18px;
  background: var(--head-bg);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-2);
  transform: translateY(120%);
  transition: transform 0.4s var(--ease);
}
.lp-sticky-cta.is-on { transform: none; }
.lp-sticky-cta .local-btn { flex: 1; min-height: 46px; font-size: 14px; padding: 10px 12px; white-space: nowrap; }

/* На активной тренировке прячем всё лишнее */
body.gibdd-open { overflow: hidden; }
html[data-view="quiz"] .tr-topbar { margin-bottom: 14px; }

/* ---------------------------------------------------------------------------
   22. Адаптив
--------------------------------------------------------------------------- */
@media (max-width: 1080px) {
  .site-actions { margin-left: auto; }
  .lp-steps { grid-template-columns: repeat(3, 1fr); row-gap: 30px; }
  .lp-steps::before { display: none; }
  .lp-faq-grid { grid-template-columns: 1fr; }
  .lp-faq-grid .lp-section-head { position: static; margin-bottom: 8px; }
  .lp-courses { grid-template-columns: repeat(2, 1fr); }
  .lp-why-grid { grid-template-columns: repeat(2, 1fr); }
  .lp-exam-grid { grid-template-columns: 1fr; }
  .lp-exam-rules { position: static; }
  .tr-modes { grid-template-columns: repeat(3, 1fr); }
  .tr-mode--featured { grid-column: span 3; }
  .full-container { grid-template-columns: repeat(2, 1fr); }
  .site-footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 800px) {
  :root { --head-h: 62px; }
  body { font-size: 15px; }
  .lp-hero { min-height: max(560px, 100svh); }
  .lp-hero-content { padding-bottom: 74px; }
  .lp-courses { grid-template-columns: 1fr; }
  .lp-modes { grid-template-columns: 1fr; }
  .lp-mode--wide { grid-column: span 1; }
  .lp-stats { grid-template-columns: 1fr; gap: 14px; }
  .lp-contact-grid { grid-template-columns: 1fr; }
  .tr-modes { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tr-mode--featured { grid-column: span 2; }
  .pdd-home-extra { grid-template-columns: 1fr; }
  .rules-list { grid-template-columns: 1fr; }
  .pdd-support-grid { grid-template-columns: 1fr; }
  .voa-contact-grid { grid-template-columns: 1fr; }
  .timer-head { top: calc(var(--head-h) + 6px); padding: 10px 16px; }
  .full-container { grid-template-columns: 1fr; }
  .full-quest { top: 49px; }
  .site-footer-inner { grid-template-columns: 1fr; gap: 26px; padding: 40px 0 30px; }

  /* компактная шапка */
  .site-head-inner { gap: 12px; width: calc(100% - 28px); }
  .site-logo { gap: 9px; margin-right: 0; }
  .site-logo img { width: 40px; height: 40px; }
  .site-logo-name { font-size: 15px; }
  .site-logo-sub { display: none; }
  .site-actions { gap: 8px; }
  .pdd-auth-btn { padding: 7px 13px; font-size: 13px; }
  .pdd-auth-user-name { max-width: 90px; }
  .pdd-icon-btn, .site-burger { width: 38px; height: 38px; border-radius: 11px; }

  /* чат: круглая кнопка, не мешает вопросу */
  .pdd-chat-fab { right: 14px; bottom: 14px; width: 52px; min-height: 52px; padding: 0; justify-content: center; }
  .pdd-chat-fab span { display: none; }
  .pdd-chat-fab svg { width: 24px; height: 24px; }
  .pdd-chat-window { right: 10px; left: 10px; bottom: 76px; width: auto; height: min(560px, 72vh); }
  html[data-view="quiz"] .pdd-chat-fab { display: none; }
  html[data-view="quiz"] .tr-topbar,
  html[data-view="quiz"] .tr-nav { display: none; }
  html[data-view="quiz"] .tr-main.page-offset { padding-top: calc(var(--head-h) + 12px); }
  .timer-head { padding: 10px 12px; gap: 10px; }
  .quiz-exit { width: 34px; height: 34px; }
  #timer { font-size: 17px; }

  .gibdd-rules { grid-template-columns: repeat(2, 1fr); }
  .lp-sticky-cta { display: flex; }
  /* min-height вместе с aspect-ratio переносится в min-width и раздувает страницу на узких экранах */
  .lp-map { aspect-ratio: auto; min-height: 0; height: 260px; }
  .lp-map-badge { left: 12px; bottom: 12px; font-size: 13px; }
}

@media (max-width: 360px) {
  .site-head-inner { gap: 8px; width: calc(100% - 20px); }
  .site-logo { gap: 7px; min-width: 0; }
  .site-logo img { width: 36px; height: 36px; }
  .site-logo-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .site-actions { gap: 6px; }
}

@media (max-width: 520px) {
  .lp-why-grid { grid-template-columns: 1fr; }
  .tr-modes { grid-template-columns: 1fr; }
  .tr-mode--featured { grid-column: span 1; }
  .tickets-grid { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
  .lp-hero-cta .local-btn { width: 100%; }
  .gibdd-start-cats { flex-direction: column; }
  .gibdd-start-cats button { width: 100%; }
  .tr-topbar { gap: 8px; }
  .tr-crumbs { width: 100%; flex-direction: column; align-items: flex-start; gap: 2px; }
  .tr-crumbs b { font-size: 22px; }
  .lp-steps { grid-template-columns: 1fr 1fr; gap: 22px 14px; }
  .lp-step-num { width: 46px; height: 46px; font-size: 16px; margin-bottom: 12px; }
  .lp-step h3 { font-size: 15px; }
  .lp-step p { font-size: 13px; }
  .pdd-facts { grid-template-columns: 1fr 1fr; }
  .quiz-block-chip { display: none; }
  /* вход — в мобильном меню, чтобы шапка не ломалась */
  .site-actions .pdd-auth-btn,
  .site-actions .pdd-auth-user { display: none; }
  .site-nav ul .site-nav-auth { display: block; }
}
body.nav-open .lp-sticky-cta { transform: translateY(120%); }
.site-nav-auth { display: none; }
.site-nav-auth button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 10px;
  font-size: 17px;
  font-weight: 600;
  color: var(--acc);
  border-radius: 10px;
}
