/* tour.css — «Путеводитель» (tour.js): затемнение с вырезом вокруг цели и
   подпись с кнопками. Цвета — из переменных страницы (style.css, бренд
   школы); тёмная тема — своими переменными ниже. */
.tour {
  --tour-scrim: rgba(20, 21, 26, .55);
  --tour-ring: var(--accent, #a81c24);
  --tour-bg: var(--surface, #fff);
  --tour-ink: var(--ink, #14151a);
  --tour-muted: var(--muted, #5d6273);
  --tour-line: var(--line-strong, #cfc8ba);
}
html[data-theme="dark"] .tour {
  --tour-scrim: rgba(0, 0, 0, .66);
  --tour-bg: #1f2128;
  --tour-ink: #f1efe9;
  --tour-muted: #b4b8c4;
  --tour-line: #3a3d48;
}
@media (prefers-color-scheme: dark) {
  html.theme-auto .tour, html[data-theme="auto"] .tour {
    --tour-scrim: rgba(0, 0, 0, .66);
    --tour-bg: #1f2128;
    --tour-ink: #f1efe9;
    --tour-muted: #b4b8c4;
    --tour-line: #3a3d48;
  }
}
.tour[hidden], .tour [hidden] { display: none !important; }

/* Вырез: прозрачная рамка с огромной тенью — затемняет всё вокруг. Нажатия
   проходят сквозь (pointer-events: none): цель нажимают как обычно. */
.tour-hole {
  position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 2147482000;
  border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 0 3px var(--tour-ring), 0 0 0 200vmax var(--tour-scrim);
  transition: left .2s ease, top .2s ease, width .2s ease, height .2s ease;
}
.tour[data-wait="click"] .tour-hole { animation: tour-pulse 1.6s ease-in-out infinite; }
@keyframes tour-pulse {
  0%, 100% { box-shadow: 0 0 0 3px var(--tour-ring), 0 0 0 200vmax var(--tour-scrim); }
  50% { box-shadow: 0 0 0 7px var(--tour-ring), 0 0 0 200vmax var(--tour-scrim); }
}
.tour.is-free .tour-hole { display: none; }

.tour-bubble {
  position: fixed; left: 0; top: 0; z-index: 2147482001;
  box-sizing: border-box; width: min(340px, calc(100vw - 32px));
  padding: 12px 16px; margin: 0;
  border: 1px solid var(--tour-line); border-radius: var(--r-lg, 16px);
  background: var(--tour-bg); color: var(--tour-ink);
  box-shadow: var(--shadow-lg, 0 18px 48px rgba(20, 21, 26, .18));
  font-size: .9375rem; line-height: 1.45; text-align: left;
  overflow-wrap: anywhere;
}
/* Без цели — по центру низа экрана. */
.tour.is-free { position: fixed; inset: 0; z-index: 2147482000; background: var(--tour-scrim); }
.tour.is-free .tour-bubble { left: 50% !important; top: auto !important; bottom: 24px; translate: -50% 0; }
.tour-count { margin: 0 0 4px; color: var(--tour-muted); font-size: .8125rem; font-weight: 600; }
.tour-cta { margin: 0 0 2px; font-weight: 700; color: var(--tour-ring); }
.tour-text { margin: 0 0 10px; }
.tour-list { margin: 0 0 10px; padding-left: 1.2em; }
.tour-list li + li { margin-top: 4px; }
.tour-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.tour-acts .tour-close { margin-left: auto; }

@media (max-width: 639px) {
  /* Телефон: подпись во всю ширину, с полями 16 px — без прокрутки вбок. */
  .tour-bubble { width: calc(100vw - 32px); }
  .tour.is-free .tour-bubble { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .tour-acts .btn { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .tour-hole { transition: none; }
  .tour[data-wait="click"] .tour-hole { animation: none; }
}
@media print { .tour { display: none !important; } }
