/* Обучающий режим: затемнение экрана и модальное окно (sessionStorage: coolside_tutorial_active). */

.tutorial-mode {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    box-sizing: border-box;
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    pointer-events: auto;
}

.tutorial-mode__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.78);
    pointer-events: auto;
}

/* Интерактивные этапы: клики проходят к подсвеченным элементам, кроме модалки. */
.tutorial-mode--stage-profile,
.tutorial-mode--stage-home-region,
.tutorial-mode--stage-profile-overview,
.tutorial-mode--stage-map,
.tutorial-mode--stage-home-region-map,
.tutorial-mode--stage-locate-result,
.tutorial-mode--stage-checkin-top,
.tutorial-mode--stage-checkin-wait {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-profile .tutorial-mode__dialog,
body.tutorial-mode--active.tutorial-mode--stage-home-region .tutorial-mode__dialog,
body.tutorial-mode--active.tutorial-mode--stage-profile-overview .tutorial-mode__dialog,
body.tutorial-mode--active.tutorial-mode--stage-map .tutorial-mode__dialog,
body.tutorial-mode--active.tutorial-mode--stage-home-region-map .tutorial-mode__dialog,
body.tutorial-mode--active.tutorial-mode--stage-locate-result .tutorial-mode__dialog,
body.tutorial-mode--active.tutorial-mode--stage-checkin-top .tutorial-mode__dialog,
body.tutorial-mode--active.tutorial-mode--stage-checkin-wait .tutorial-mode__dialog {
    pointer-events: auto;
}

/* Этап 5: модалка на карте, подсветка «Выбрать курорт». */
.tutorial-mode--stage-home-region-map {
    z-index: 2750;
}

/* Этап 3: модалка над блоком выбора региона (позиция задаётся в tutorialMode). */
.tutorial-mode--stage-home-region {
    z-index: 2750;
    align-items: flex-start;
    justify-content: flex-start;
    --tutorial-home-region-width: min(480px, calc(100vw - 32px));
}

.tutorial-mode__dialog {
    display: flex;
    flex-direction: column;
    width: min(480px, 100%);
    height: fit-content;
    max-height: min(88vh, 640px);
    border-radius: 20px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32);
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: auto;
    /* x-teleport в body: на /profile/ у body нет font-family (только .profile-page). */
    font: 15px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Модалка в body (x-teleport): всегда выше оверлея .tutorial-mode (2600–2750). */
body.tutorial-mode--active .tutorial-mode__dialog {
    position: fixed;
    z-index: 2802;
}

/* Высота блока прогресса + зазор (для отступа контента на /profile/, этап 3). */
body.tutorial-mode--active {
    --tutorial-progress-reserve: 68px;
}

/* Индикатор прогресса: этапы 1–6, в т.ч. без модалки на шаге 6. */
.tutorial-mode__progress {
    position: fixed;
    /* Под фиксированным верхним меню (~56px) */
    top: max(64px, calc(env(safe-area-inset-top, 0px) + 56px));
    left: 50%;
    z-index: 2815;
    box-sizing: border-box;
    width: min(480px, calc(100vw - 32px));
    padding: 10px 14px 12px;
    border-radius: 14px;
    transform: translateX(-50%);
    pointer-events: none;
    font: 13px/1.3 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Тёмная тема: прогресс, модалка и оверлей на всех этапах обучения. */
body.tutorial-mode--active .tutorial-mode__progress {
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

body.tutorial-mode--active .tutorial-mode__progress-label {
    color: #e2e8f0;
}

body.tutorial-mode--active .tutorial-mode__progress-track {
    background: rgba(51, 65, 85, 0.9);
}

body.tutorial-mode--active .tutorial-mode__dialog {
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}

body.tutorial-mode--active .tutorial-mode__title {
    color: #f1f5f9;
}

body.tutorial-mode--active .tutorial-mode__text {
    color: #cbd5e1;
}

body.tutorial-mode--active .tutorial-mode__hint,
body.tutorial-mode--active .tutorial-mode__collapse-task {
    color: #5eead4;
}

body.tutorial-mode--active .tutorial-mode__close {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

body.tutorial-mode--active .tutorial-mode__close:hover {
    color: #f1f5f9;
    background: rgba(148, 163, 184, 0.2);
}

body.tutorial-mode--active .tutorial-mode__backdrop {
    background: rgba(15, 23, 42, 0.88);
}

body.tutorial-mode--active .tutorial-mode__secondary-btn {
    border-color: rgba(148, 163, 184, 0.35);
    background: rgba(30, 41, 59, 0.9);
    color: #cbd5e1;
}

body.tutorial-mode--active .tutorial-mode__secondary-btn:hover {
    background: rgba(51, 65, 85, 0.95);
}

.tutorial-mode__progress-label {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.tutorial-mode__progress-track {
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
}

.tutorial-mode__progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb 0%, #0d9488 100%);
    transition: width 0.25s ease;
}

/* Этапы 1–2–4: по центру экрана, отступы по бокам как у модалки под прогрессом. */
.tutorial-mode__dialog--centered {
    top: 50%;
    left: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    width: min(480px, calc(100vw - 32px));
    max-width: min(480px, calc(100vw - 32px));
}

/* Этап 3 и карта: модалка под полосой «Шаг N из 7». */
.tutorial-mode__dialog--below-progress {
    top: calc(
        max(64px, calc(env(safe-area-inset-top, 0px) + 56px))
        + var(--tutorial-progress-reserve, 68px)
        + 8px
    );
    bottom: auto;
    left: 50%;
    right: auto;
    margin: 0;
    transform: translateX(-50%);
    width: min(480px, calc(100vw - 32px));
    max-width: min(480px, calc(100vw - 32px));
    max-height: min(42vh, 320px);
}

.tutorial-mode__dialog--below-progress.tutorial-mode__dialog--collapsed {
    max-height: none;
}

/* Этап 3 (регион уже выбран): над нижним меню «Карта», профиль остаётся видимым. */
.tutorial-mode__dialog--above-bottom-nav {
    top: auto;
    bottom: calc(var(--coolside-bottom-nav-top-from-bottom, 68px) + 12px);
    left: 50%;
    right: auto;
    margin: 0;
    transform: translateX(-50%);
    width: min(480px, calc(100vw - 32px));
    max-width: min(480px, calc(100vw - 32px));
    max-height: min(42vh, 320px);
}

.tutorial-mode__dialog--anchored {
    right: auto;
    margin: 0;
    box-sizing: border-box;
    /* left и transform — в tutorialMode по getBoundingClientRect цели */
    width: var(--tutorial-home-region-width, min(480px, calc(100vw - 32px)));
    max-width: var(--tutorial-home-region-width, min(480px, calc(100vw - 32px)));
    transition: opacity 0.15s ease;
}

.tutorial-mode__dialog--position-pending {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.tutorial-mode--stage-profile .tutorial-mode__backdrop,
.tutorial-mode--stage-map .tutorial-mode__backdrop {
    pointer-events: none;
}

/* Этап 3: затемнение — «дырка» через box-shadow у формы, не сплошной backdrop. */
.tutorial-mode--stage-home-region .tutorial-mode__backdrop {
    background: transparent;
    pointer-events: none;
}

/* Этапы 5–8: карта видна, backdrop перехватывает клики (на 5 — «Где я», на 7 — «Чекин»). */
body.tutorial-mode--active.tutorial-mode--stage-home-region-map .tutorial-mode__backdrop,
body.tutorial-mode--active.tutorial-mode--stage-locate-result .tutorial-mode__backdrop,
body.tutorial-mode--active.tutorial-mode--stage-checkin-top .tutorial-mode__backdrop,
body.tutorial-mode--active.tutorial-mode--stage-checkin-wait .tutorial-mode__backdrop {
    background: transparent;
    pointer-events: auto;
}

.tutorial-mode__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    cursor: pointer;
    font-size: 28px;
    font-weight: 300;
    line-height: 1;
    flex-shrink: 0;
}

.tutorial-mode__close--inline {
    position: static;
}

.tutorial-mode__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 10px 10px 14px;
    flex-shrink: 0;
}

.tutorial-mode__header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.tutorial-mode__collapse-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 10px 10px 14px;
    box-sizing: border-box;
}

.tutorial-mode__collapse-task {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding-right: 4px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: center;
}

.tutorial-mode__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #334155;
    cursor: pointer;
    flex-shrink: 0;
}

body.tutorial-mode--active .tutorial-mode__toggle {
    background: rgba(148, 163, 184, 0.12);
    color: #94a3b8;
}

body.tutorial-mode--active .tutorial-mode__toggle:hover {
    color: #f1f5f9;
    background: rgba(148, 163, 184, 0.2);
}

.tutorial-mode__chevron {
    width: 22px;
    height: 22px;
    display: block;
}

.tutorial-mode__dialog--collapsed {
    overflow: hidden;
}

.tutorial-mode__close:hover {
    background: rgba(15, 23, 42, 0.14);
    color: #0f172a;
}

.tutorial-mode__body {
    flex: 0 1 auto;
    padding: 0 20px 20px;
    box-sizing: border-box;
}

.tutorial-mode__title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    color: #0f172a;
}

.tutorial-mode__text {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: #475569;
}

.tutorial-mode__text + .tutorial-mode__text {
    margin-top: 12px;
}

.tutorial-mode__hint {
    margin: 16px 0 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: #0f766e;
    text-align: center;
}

.tutorial-mode__blink {
    animation: tutorial-mode-blink 1.1s ease-in-out infinite;
}

@keyframes tutorial-mode-blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.25;
    }
}

.tutorial-mode__actions {
    flex-shrink: 0;
    padding: 0 20px 20px;
    box-sizing: border-box;
}

.tutorial-mode__start-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 0 20px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb 0%, #0d9488 100%);
    color: #ffffff;
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    animation: tutorial-mode-cta-pulse 2s ease-in-out infinite;
}

.tutorial-mode__start-btn:hover {
    filter: brightness(1.06);
}

a.tutorial-mode__start-btn {
    text-decoration: none;
    box-sizing: border-box;
}

.tutorial-mode__actions--guest {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tutorial-mode__secondary-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    background: #ffffff;
    color: #475569;
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.tutorial-mode__secondary-btn:hover {
    background: #f8fafc;
}

@keyframes tutorial-mode-cta-pulse {
    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
    }
    50% {
        transform: scale(1.04);
        box-shadow: 0 12px 32px rgba(13, 148, 136, 0.45);
    }
}

/* Этап 2: подсветка кнопки «Профиль» в верхнем меню. */
body.tutorial-mode--stage-profile .app-top-menu {
    z-index: 2701;
    pointer-events: auto;
}

body.tutorial-mode--stage-profile .app-top-menu__auth-row a:not(.app-top-menu__button--tutorial-target),
body.tutorial-mode--stage-profile .app-top-menu__auth-row button {
    pointer-events: none;
}

body.tutorial-mode--stage-profile .app-top-menu__button--tutorial-target {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
    animation: tutorial-mode-profile-target 1.4s ease-in-out infinite;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.95),
        0 0 0 6px rgba(96, 165, 250, 0.55),
        0 0 28px rgba(96, 165, 250, 0.75);
}

@keyframes tutorial-mode-profile-target {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.95),
            0 0 0 6px rgba(96, 165, 250, 0.55),
            0 0 28px rgba(96, 165, 250, 0.75);
    }
    50% {
        transform: scale(1.08);
        box-shadow:
            0 0 0 4px rgba(255, 255, 255, 1),
            0 0 0 10px rgba(96, 165, 250, 0.65),
            0 0 36px rgba(96, 165, 250, 0.95);
    }
}

body.tutorial-mode--active.tutorial-mode--stage-profile .coolside-js-only > *:not(.tutorial-mode) {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-profile .tutorial-mode,
body.tutorial-mode--active.tutorial-mode--stage-profile .app-top-menu {
    pointer-events: auto;
}

/* Этап 3: «дырка» в затемнении — ширина как у модалки, отступ сверху задаётся в JS. */
body.tutorial-mode--stage-home-region .profile-page > h1,
body.tutorial-mode--stage-home-region .profile-card > .profile-section:not([data-tutorial-target='home-region']),
body.tutorial-mode--stage-home-region .profile-actions--tutorial-restart {
    display: none;
}

body.tutorial-mode--stage-home-region .profile-page {
    position: relative;
    /* Выше оверлея .tutorial-mode (2750), иначе клики не доходят до формы */
    z-index: 2760;
    box-sizing: border-box;
    width: 100%;
    max-width: min(480px, calc(100vw - 32px));
    margin-left: auto;
    margin-right: auto;
    margin-top: calc(
        max(64px, calc(env(safe-area-inset-top, 0px) + 56px))
        + var(--tutorial-progress-reserve, 68px)
        + var(--tutorial-dialog-reserve, 320px)
        + 20px
    );
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

body.tutorial-mode--stage-home-region .profile-card {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

body.tutorial-mode--stage-home-region [data-tutorial-target='home-region'] {
    position: relative;
    z-index: 1;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: 20px 22px 22px;
    pointer-events: auto;
    border-radius: 20px;
    background: #ffffff;
    color: #0f172a;
    animation: tutorial-mode-home-region-spotlight 1.6s ease-in-out infinite;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.98),
        0 0 0 9999px rgba(15, 23, 42, 0.78),
        0 24px 48px rgba(15, 23, 42, 0.28);
}

body.tutorial-mode--stage-home-region [data-tutorial-target='home-region'] .profile-form {
    padding: 0;
    background: transparent;
    box-shadow: none;
}

@keyframes tutorial-mode-home-region-spotlight {
    0%,
    100% {
        box-shadow:
            0 0 0 2px rgba(255, 255, 255, 0.98),
            0 0 0 9999px rgba(15, 23, 42, 0.78),
            0 24px 48px rgba(15, 23, 42, 0.28);
    }
    50% {
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 1),
            0 0 0 9999px rgba(15, 23, 42, 0.82),
            0 28px 56px rgba(15, 23, 42, 0.34);
    }
}

/* Этап 3 без региона: компактная подсказка под прогрессом, без второй большой модалки. */
body.tutorial-mode--active.tutorial-mode--stage-home-region .tutorial-mode__dialog--stage3-form-hint {
    max-height: none;
    overflow: hidden;
    border-radius: 14px;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region .tutorial-mode__dialog--stage3-form-hint .tutorial-mode__collapse-bar {
    padding: 12px 12px 12px 16px;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region .tutorial-mode__dialog--stage3-form-hint .tutorial-mode__collapse-task {
    font-size: 15px;
}

body.tutorial-mode--stage-home-region .profile-page,
body.tutorial-mode--stage-home-region .profile-card {
    overflow: visible;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region .coolside-js-only > *:not(.tutorial-mode) {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region .tutorial-mode {
    pointer-events: none;
}

/* Страница выше оверлея; кликабелен только блок выбора региона */
body.tutorial-mode--active.tutorial-mode--stage-home-region .profile-page {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region [data-tutorial-target='home-region'],
body.tutorial-mode--active.tutorial-mode--stage-home-region [data-tutorial-target='home-region'] * {
    pointer-events: auto;
}

/* Кнопка перезапуска на этапе 3: на месте в карточке профиля, disabled. */
body.tutorial-mode--active.tutorial-mode--stage-home-region .profile-actions--tutorial-restart--locked,
body.tutorial-mode--active.tutorial-mode--stage-profile-overview .profile-actions--tutorial-restart--locked {
    position: relative;
    z-index: 2810;
    pointer-events: auto;
}

body.tutorial-mode--stage-home-region .profile-actions--tutorial-restart--locked .profile-btn--tutorial-locked,
body.tutorial-mode--stage-profile-overview .profile-actions--tutorial-restart--locked .profile-btn--tutorial-locked {
    opacity: 0.85;
    box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.55);
}

/* Этап 3 (регион уже выбран): профиль виден за модалкой. */
.tutorial-mode--stage-profile-overview {
    z-index: 2750;
}

body.tutorial-mode--stage-profile-overview .profile-page {
    position: relative;
    z-index: 2760;
    margin-top: calc(
        max(64px, calc(env(safe-area-inset-top, 0px) + 56px))
        + var(--tutorial-progress-reserve, 68px)
        + var(--tutorial-dialog-reserve, 320px)
        + 12px
    );
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
}

body.tutorial-mode--active.tutorial-mode--stage-profile-overview .coolside-js-only > *:not(.tutorial-mode) {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-profile-overview .tutorial-mode {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-profile-overview .profile-page {
    pointer-events: none;
}

/* Этап 4: подсветка кнопки «Карта» в нижнем меню. */
.tutorial-mode--stage-map {
    z-index: 2750;
}

body.tutorial-mode--stage-map .app-bottom-nav,
body.tutorial-mode--stage-map-nav .app-bottom-nav {
    /* Выше оверлея (2750) и модалки в body (2802) */
    z-index: 2810;
    pointer-events: auto;
}

body.tutorial-mode--stage-map .app-bottom-nav__link--tutorial-target,
body.tutorial-mode--stage-map-nav .app-bottom-nav__link--tutorial-target {
    position: relative;
    z-index: 1;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.22);
    animation: tutorial-mode-map-target 1.4s ease-in-out infinite;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.95),
        0 0 0 6px rgba(45, 212, 191, 0.55),
        0 0 28px rgba(45, 212, 191, 0.75);
}

@keyframes tutorial-mode-map-target {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.95),
            0 0 0 6px rgba(45, 212, 191, 0.55),
            0 0 28px rgba(45, 212, 191, 0.75);
    }
    50% {
        transform: scale(1.06);
        box-shadow:
            0 0 0 4px rgba(255, 255, 255, 1),
            0 0 0 10px rgba(45, 212, 191, 0.65),
            0 0 36px rgba(45, 212, 191, 0.95);
    }
}

body.tutorial-mode--active.tutorial-mode--stage-map .coolside-js-only > *:not(.tutorial-mode) {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-map .tutorial-mode {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-map .app-bottom-nav,
body.tutorial-mode--active.tutorial-mode--stage-map-nav .app-bottom-nav {
    pointer-events: auto;
}

body.tutorial-mode--active.tutorial-mode--stage-map .app-bottom-nav__link--tutorial-target,
body.tutorial-mode--active.tutorial-mode--stage-map-nav .app-bottom-nav__link--tutorial-target {
    pointer-events: auto;
}

/* Этап 5: подсветка кнопки «Где я»; зум +/- под блокирующим слоем. */
body.tutorial-mode--stage-home-region-map .locate-control {
    position: fixed;
    z-index: 2760;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region-map .locate-control__zoom {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region-map .coolside-js-only > *:not(.tutorial-mode) {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region-map .tutorial-mode {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-home-region-map [data-tutorial-target='locate'],
body.tutorial-mode--active.tutorial-mode--stage-home-region-map [data-tutorial-target='locate'] * {
    pointer-events: auto;
}

body.tutorial-mode--stage-home-region-map .locate-control__button--tutorial-target {
    position: relative;
    z-index: 1;
    pointer-events: auto;
    animation: tutorial-mode-locate-target 1.4s ease-in-out infinite;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.95),
        0 0 0 6px rgba(45, 212, 191, 0.55),
        0 0 28px rgba(45, 212, 191, 0.75);
}

@keyframes tutorial-mode-locate-target {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.95),
            0 0 0 6px rgba(45, 212, 191, 0.55),
            0 0 28px rgba(45, 212, 191, 0.75);
    }
    50% {
        transform: scale(1.08);
        box-shadow:
            0 0 0 4px rgba(255, 255, 255, 1),
            0 0 0 10px rgba(45, 212, 191, 0.65),
            0 0 36px rgba(45, 212, 191, 0.95);
    }
}

/* Этапы 6–7: карта видна за модалкой. */
body.tutorial-mode--active.tutorial-mode--stage-locate-result .coolside-js-only > *:not(.tutorial-mode),
body.tutorial-mode--active.tutorial-mode--stage-checkin-top .coolside-js-only > *:not(.tutorial-mode),
body.tutorial-mode--active.tutorial-mode--stage-checkin-wait .coolside-js-only > *:not(.tutorial-mode) {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-locate-result .tutorial-mode,
body.tutorial-mode--active.tutorial-mode--stage-checkin-top .tutorial-mode,
body.tutorial-mode--active.tutorial-mode--stage-checkin-wait .tutorial-mode {
    pointer-events: none;
}

/* Этап 7: подсветка кнопки «Чекин» в верхнем меню. */
body.tutorial-mode--stage-checkin-top .app-top-menu {
    z-index: 2701;
    pointer-events: auto;
}

body.tutorial-mode--stage-checkin-top .app-top-menu__left .app-top-menu__popup-wrap button:not(.app-top-menu__button--tutorial-target),
body.tutorial-mode--stage-checkin-top .app-top-menu__right,
body.tutorial-mode--stage-checkin-top .app-top-menu__right * {
    pointer-events: none;
}

body.tutorial-mode--active.tutorial-mode--stage-checkin-top .app-top-menu,
body.tutorial-mode--active.tutorial-mode--stage-checkin-top .app-top-menu__button--tutorial-target {
    pointer-events: auto;
}

body.tutorial-mode--stage-checkin-top .app-top-menu__button--tutorial-target {
    position: relative;
    z-index: 1;
    animation: tutorial-mode-checkin-top-target 1.4s ease-in-out infinite;
    box-shadow:
        0 0 0 3px rgba(255, 255, 255, 0.95),
        0 0 0 6px rgba(45, 212, 191, 0.55),
        0 0 28px rgba(45, 212, 191, 0.75);
}

@keyframes tutorial-mode-checkin-top-target {
    0%,
    100% {
        transform: scale(1);
        box-shadow:
            0 0 0 3px rgba(255, 255, 255, 0.95),
            0 0 0 6px rgba(45, 212, 191, 0.55),
            0 0 28px rgba(45, 212, 191, 0.75);
    }
    50% {
        transform: scale(1.08);
        box-shadow:
            0 0 0 4px rgba(255, 255, 255, 1),
            0 0 0 10px rgba(45, 212, 191, 0.65),
            0 0 36px rgba(45, 212, 191, 0.95);
    }
}

/* Этап 8: анимация ожидания чекина. */
.tutorial-mode__wait-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 16px 0 8px;
}

.tutorial-mode__wait-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #5eead4;
    animation: tutorial-mode-wait-bounce 1.1s ease-in-out infinite;
}

.tutorial-mode__wait-dot:nth-child(2) {
    animation-delay: 0.18s;
}

.tutorial-mode__wait-dot:nth-child(3) {
    animation-delay: 0.36s;
}

.tutorial-mode__wait-text {
    animation: tutorial-mode-blink 1.1s ease-in-out infinite;
}

@keyframes tutorial-mode-wait-bounce {
    0%,
    80%,
    100% {
        transform: scale(0.65);
        opacity: 0.45;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Уведомление «ещё рано» на этапе 5. */
.tutorial-mode__toast {
    position: fixed;
    top: calc(max(64px, calc(env(safe-area-inset-top, 0px) + 56px)) + var(--tutorial-progress-reserve, 68px) + 12px);
    left: 50%;
    z-index: 2820;
    max-width: min(420px, calc(100vw - 32px));
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.94);
    color: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.35);
    transform: translateX(-50%);
    pointer-events: none;
}
