:root {
    --brand-purple: #320f5b;
    --brand-yellow: #fec600;
    --page-bg: #f0f1f6;
    --text-dark: #2c3e50;
    --step-gray: #b7bcc7;
    --learning-video-aspect: 56.25%;
    /* Shared chapter layout tokens (desktop overrides refine these). */
    --flanked-nav-arrow-size: 52px;
    --flanked-nav-arrow-gap: clamp(12px, 2vw, 18px);
    /* Single source of truth for chapter/practice page geometry.
       The toolbar position derives from these — override ONLY here. */
    --chapter-shell-max: 900px;
    --chapter-page-padding: 20px;
}

html,
body {
    width: 100%;
    min-height: 100vh;
    overflow-x: hidden;
}

html {
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    font-family: 'Assistant', 'Segoe UI', sans-serif;
    background: var(--page-bg);
    color: var(--text-dark);
    direction: rtl;
}

.chapter-page {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding: var(--chapter-page-padding);
}

.chapter-shell,
.chapter-integrated-shell {
    width: 100%;
    max-width: var(--chapter-shell-max);
}

/* Shared top toolbar: Home (right in RTL) + progress */
.chapter-toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    min-height: 44px;
    box-sizing: border-box;
}

.chapter-toolbar .chapter-progress {
    flex: 1 1 auto;
    margin-bottom: 0;
    min-width: 0;
}

.home-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid var(--brand-purple);
    border-radius: 50%;
    background: var(--brand-purple);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(50, 15, 91, 0.18);
    font-family: inherit;
}

.home-btn:hover {
    background: #442172;
    border-color: #442172;
    color: #fff;
    transform: translateY(-1px);
}

.home-btn:focus-visible {
    outline: 3px solid rgba(50, 15, 91, 0.35);
    outline-offset: 3px;
}

.home-btn__icon {
    display: block;
    width: 22px;
    height: 22px;
}

/* Legacy top-nav kept for any residual markup; prefer .chapter-toolbar */
.chapter-top-nav {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.chapter-top-nav--main-menu {
    justify-content: flex-start;
}

.chapter-top-nav__spacer {
    flex: 1 1 auto;
}

.main-menu-btn:not(.home-btn) {
    margin-inline-start: auto;
    margin-inline-end: 0;
}

.chapter-top-nav:not(.chapter-top-nav--split) > .main-menu-btn:only-child,
.chapter-top-nav--main-menu > .top-nav-btn:only-child {
    margin-inline-start: 0;
}

.top-nav-btn {
    border: none;
    border-radius: 999px;
    background: var(--brand-purple);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 8px 16px;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.top-nav-btn:hover {
    background: #442172;
}

.chapter-progress {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    min-height: 44px;
}

.progress-item {
    position: relative;
    border: none;
    border-radius: 12px;
    padding: 10px 8px;
    font-weight: 700;
    font-size: 1rem;
    line-height: 1.25;
    min-height: 44px;
    box-sizing: border-box;
    background: #f5f6fa;
    color: var(--step-gray);
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-family: inherit;
}

.progress-item.locked {
    cursor: not-allowed;
    pointer-events: none;
}

/* Floating tooltip (body-mounted, always 100% opaque) */
.disabled-tooltip-float {
    position: fixed;
    z-index: 10000;
    transform: translate(-50%, calc(-100% - 10px));
    min-width: 220px;
    max-width: 320px;
    padding: 10px 12px;
    background: #ffffff;
    color: #32105b;
    border: 2px solid var(--brand-purple);
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.82rem;
    line-height: 1.4;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    box-shadow: 0 10px 28px #32105b40;
    opacity: 1;
    pointer-events: none;
}

/* Legacy pseudo-element tooltips disabled - floating tooltip used instead */
.progress-item.locked::after,
[data-tooltip]:disabled::after,
[data-tooltip].is-soft-disabled::after,
[data-tooltip].option-card--locked::after,
.continue-btn:disabled::after {
    content: none !important;
    display: none !important;
}

/* Disabled-button tooltip hosts */
[data-tooltip]:disabled,
[data-tooltip].is-soft-disabled,
[data-tooltip].option-card--locked {
    position: relative;
}

/* Keep tooltip hosts at full opacity */
:disabled[data-tooltip],
[data-tooltip].is-soft-disabled,
[data-tooltip].option-card--locked {
    opacity: 1 !important;
}

.next-step-btn:disabled[data-tooltip] {
    background: #f8f6fc;
    border-color: #d4c2e8;
}

.next-step-btn:disabled[data-tooltip] .next-step-icon {
    opacity: 0.5;
}

.primary-step-btn:disabled[data-tooltip],
.submit-answer-btn:disabled[data-tooltip],
.primary-btn:disabled[data-tooltip] {
    background: #ebe6c8;
    color: #7a6896;
    box-shadow: none;
}

.countdown-start:disabled[data-tooltip] {
    background: #9a7bb8;
}

.play-icon-btn:disabled[data-tooltip] {
    background: #e8e0f2;
}

.play-icon-btn:disabled[data-tooltip] .play-icon-svg {
    opacity: 0.5;
}

.option-card--locked[data-tooltip]:not(.selected):not(.wrong-flash):not(.option-card--correct) {
    opacity: 1 !important;
}

.post-video-multi-select-panel--feedback .option-card--locked[data-tooltip] {
    opacity: 1 !important;
}

.progress-item.current {
    background: var(--brand-purple);
    color: #fff;
}

.progress-item.completed {
    background: #ede7f8;
    color: var(--brand-purple);
}

.progress-item.completed::before {
    content: '✓';
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    color: #1f8f3a;
    font-weight: 800;
    font-size: 0.95rem;
}

.chapter-header {
    text-align: center;
    margin-bottom: 16px;
}

.chapter-title {
    margin: 0;
    color: var(--brand-purple);
    font-weight: 800;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    line-height: 1.35;
}

.chapter-subtitle {
    margin: 8px 0 0;
    color: #5f6b7a;
    font-size: clamp(0.92rem, 1.5vw, 1.02rem);
    line-height: 1.5;
}

.chapter-step-indicator {
    margin: 10px 0 0;
    color: #6b7280;
    font-size: 0.9rem;
    font-weight: 700;
}

.chapter-step-host {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 52vh;
}

/* Unified desktop chapter shell - fixed navigation + shared content frame */
@media (min-width: 768px) and (min-height: 640px) {
    :root {
        --chapter-shell-max: min(1240px, calc(100vw - 40px));
        --chapter-page-padding: 26px 20px 20px;
    }

    .chapter-page {
        --flanked-nav-arrow-size: 52px;
        --flanked-nav-arrow-gap: clamp(12px, 2vw, 18px);
        --chapter-title-reserve: clamp(80px, 11vh, 120px);
        --chapter-content-max-height: calc(
            100vh
            - 46px /* page padding */
            - 44px - 8px /* toolbar + margin */
            - var(--chapter-title-reserve)
            - 8px /* bottom breathing room */
        );
        --chapter-content-width: min(
            calc(var(--chapter-shell-max) - 2 * (var(--flanked-nav-arrow-size) + var(--flanked-nav-arrow-gap))),
            calc(var(--chapter-content-max-height) * 16 / 9)
        );
        /* Match learning-video-embed border-box height (2px border each side). */
        --chapter-content-height: calc((var(--chapter-content-width) - 4px) * 9 / 16 + 4px);
        align-items: flex-start;
        justify-content: center;
        min-height: 100vh;
        max-height: 100vh;
        overflow: hidden;
        padding: var(--chapter-page-padding);
        box-sizing: border-box;
    }

    .practice-page:has(.chapter-integrated-shell) {
        --flanked-nav-arrow-size: 52px;
        --flanked-nav-arrow-gap: clamp(12px, 2vw, 18px);
        align-items: flex-start;
        justify-content: center;
        padding: var(--chapter-page-padding);
        box-sizing: border-box;
    }

    .chapter-shell {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: var(--chapter-shell-max);
        height: calc(100vh - 46px);
        max-height: calc(100vh - 46px);
        min-height: 0;
    }

    .chapter-integrated-shell {
        width: 100%;
        max-width: var(--chapter-shell-max);
    }

    .chapter-toolbar {
        flex-shrink: 0;
        margin-bottom: 8px;
        min-height: 44px;
    }

    .chapter-top-nav {
        flex-shrink: 0;
        margin-bottom: 8px;
        min-height: 44px;
    }

    .chapter-progress {
        flex-shrink: 0;
        margin-bottom: 0;
        min-height: 44px;
    }

    .chapter-header {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        margin-bottom: 0;
        min-height: 0;
    }

    .chapter-subtitle,
    .chapter-step-indicator {
        display: none;
    }

    .chapter-step-host {
        flex: 0 1 auto;
        min-height: 0;
        overflow: visible;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0;
    }

    .chapter-step-host > .learning-video-embed,
    .chapter-step-host > .reflection-experience,
    .chapter-step-host > .chat-sim,
    .chapter-step-host > .interaction-panel,
    .chapter-step-host > .video-overlay-step,
    .chapter-step-host > .video-flanked-nav-step {
        flex: 0 0 auto;
        align-self: center;
        height: fit-content;
        min-height: 0;
    }

    /* Shared main content frame - video, reflection, interactions */
    .chapter-step-host > .video-flanked-nav-step,
    .chapter-step-host > .learning-video-embed,
    .chapter-step-host > .video-overlay-step,
    .chapter-step-host > .snap-video-wrap {
        width: var(--chapter-content-width);
        max-width: var(--chapter-content-width);
        margin-inline: auto;
    }

    .chapter-step-host > .video-flanked-nav-step .learning-video-embed,
    .chapter-step-host > .video-overlay-step .learning-video-embed,
    .chapter-step-host > .snap-video-wrap .learning-video-embed {
        width: 100%;
        max-width: 100%;
        margin-inline: auto;
    }

    .chapter-step-host > .video-flanked-nav-step .video-overlay-step__media,
    .chapter-step-host > .video-flanked-nav-step .video-flanked-nav-step__media,
    .chapter-step-host > .video-overlay-step .video-overlay-step__media {
        width: 100%;
    }

    .snap-case-flanked-step.video-flanked-nav-step,
    .snap-control-flanked-step.video-flanked-nav-step {
        width: var(--chapter-content-width);
        max-width: var(--chapter-content-width);
    }

    /* Reflection / interaction fills the same frame as the video */
    .reflection-flanked-nav.video-flanked-nav-step,
    .chat-sim-flanked-nav.video-flanked-nav-step {
        width: var(--chapter-content-width);
        max-width: var(--chapter-content-width);
    }

    .reflection-flanked-nav .reflection-experience,
    .chat-sim-flanked-nav .chat-sim {
        width: 100%;
        height: var(--chapter-content-height);
        max-height: var(--chapter-content-height);
        flex: 0 0 auto;
        align-self: stretch;
    }

    .reflection-flanked-nav .reflection-experience__shell,
    .reflection-experience:has([data-reflection-slide="stage1"].is-active) .reflection-experience__shell,
    .reflection-experience:has([data-reflection-slide="stage2"].is-active) .reflection-experience__shell,
    .reflection-experience:has([data-reflection-slide="final"].is-active) .reflection-experience__shell {
        flex: 1 1 auto;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        padding: 14px 20px 14px;
        box-sizing: border-box;
    }

    .chat-sim-flanked-nav .chat-sim__shell {
        flex: 1 1 auto;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        padding: 0;
        box-sizing: border-box;
    }

    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="stage1"].is-active),
    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="stage2"].is-active),
    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="final"].is-active) {
        flex: 0 0 auto;
        height: var(--chapter-content-height);
        max-height: var(--chapter-content-height);
    }

    .reflection-flanked-nav .reflection-experience__layout,
    .reflection-flanked-nav .reflection-experience__main,
    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="stage1"].is-active) .reflection-experience__layout,
    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="stage2"].is-active) .reflection-experience__layout,
    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="final"].is-active) .reflection-experience__layout,
    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="stage1"].is-active) .reflection-experience__main,
    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="stage2"].is-active) .reflection-experience__main,
    .reflection-flanked-nav .reflection-experience:has([data-reflection-slide="final"].is-active) .reflection-experience__main {
        flex: 1 1 auto;
        min-height: 0;
    }

    .reflection-flanked-nav .reflection-experience__viewport {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .reflection-flanked-nav .reflection-experience__slide.is-active {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .reflection-flanked-nav .reflection-experience__slide-body {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    .reflection-flanked-nav .reflection-experience__final-text--choices {
        min-height: 0;
        height: 100%;
        align-self: stretch;
        justify-content: center;
    }

    .reflection-flanked-nav .reflection-experience--with-stage-visual .reflection-experience__checklist {
        flex: 1 1 auto;
        min-height: 0;
    }

    .reflection-flanked-nav .reflection-experience--with-stage-visual .reflection-check-row {
        flex: 1 1 0;
        align-items: center;
        min-height: 0;
    }

    .reflection-flanked-nav .reflection-experience__cards {
        flex: 1 1 auto;
        align-content: stretch;
        gap: clamp(8px, 1.2vh, 12px);
    }

    .reflection-flanked-nav .reflection-experience--checklist .reflection-experience__checklist {
        flex: 1 1 auto;
        min-height: 0;
    }

    .reflection-flanked-nav .reflection-experience--checklist .reflection-experience__slide-body {
        justify-content: flex-start;
    }

    .reflection-flanked-nav .reflection-experience--checklist .reflection-check-row {
        flex: 1 1 0;
        align-items: center;
    }

    .reflection-flanked-nav .reflection-experience--checklist .reflection-experience__other-wrap {
        flex-shrink: 0;
        margin-top: 8px;
    }

    .reflection-flanked-nav .reflection-experience__slide-actions {
        margin-top: auto;
        padding: 12px 0 2px;
        flex-shrink: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }
}

/* Vimeo embed - standard 16:9 presentation (matches ch1-v1 / 1193238987) */
.learning-video-embed {
    width: 100%;
    margin: 0;
    background: #fff;
    border: 2px solid #e2d4fa;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(50, 15, 91, 0.1);
}

.learning-video-embed__frame {
    /* Aspect ratio now comes from Bootstrap's .ratio.ratio-16x9 (56.25%),
       overridable per-context via --bs-aspect-ratio. The --hidden-audio
       variant intentionally has no .ratio classes and stays collapsed. */
    position: relative;
    background: #1a0a30;
}

.learning-video-embed__poster {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    cursor: pointer;
    background: #1a0a30;
}

.learning-video-embed__poster img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.learning-video-embed__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    border-radius: 50%;
    background: rgba(254, 198, 0, 0.95);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.learning-video-embed__play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent #2a1248;
}

.learning-video-embed__poster:hover .learning-video-embed__play,
.learning-video-embed__poster:focus-visible .learning-video-embed__play {
    transform: scale(1.06);
    background: var(--brand-yellow);
}

.learning-video-embed__poster:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: -3px;
}

.learning-video-embed.is-playing .learning-video-embed__poster,
.learning-video-embed__poster[hidden] {
    display: none !important;
}

.learning-video-embed__frame--hidden-audio {
    padding-top: 0 !important;
    height: 0;
}

.learning-video-embed__frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.chapter-step-host > .learning-video-embed,
.video-overlay-step__media .learning-video-embed,
.snap-video-wrap > .learning-video-embed,
.video-flanked-nav-step__media .learning-video-embed,
.video-flanked-nav-step__media .post-video-experience,
.video-flanked-nav-step__media .video-placeholder {
    width: 100%;
    margin: 0;
}

/* Video placeholder - swap this block for <video> later via data-video-slot */
.video-placeholder {
    background: #fff;
    border: 2px solid #e2d4fa;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(50, 15, 91, 0.1);
}

.video-placeholder-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 140px;
    padding: 28px 20px;
    background: linear-gradient(145deg, #2a1248 0%, #1a0a30 100%);
    border-bottom: 2px dashed rgba(254, 198, 0, 0.45);
}

.video-placeholder-badge {
    margin: 0;
    color: var(--brand-yellow);
    font-weight: 800;
    font-size: clamp(1rem, 2vw, 1.15rem);
    text-align: center;
    line-height: 1.4;
}

.video-placeholder-hint {
    margin: 0;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
}

.video-placeholder-body {
    padding: 20px 22px 22px;
    text-align: right;
}

.video-placeholder-title {
    margin: 0 0 12px;
    color: var(--brand-purple);
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 800;
    line-height: 1.35;
}

.video-placeholder-visual {
    margin: 0 0 14px;
    padding: 12px 14px;
    background: #f5f0fc;
    border-radius: 10px;
    border-right: 4px solid var(--brand-yellow);
    color: #4b5565;
    font-size: 0.95rem;
    line-height: 1.65;
    font-weight: 600;
}

.video-placeholder-script-label {
    margin: 0 0 8px;
    color: #6b7280;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0;
}

.video-placeholder-script {
    margin: 0;
    color: #2c3e50;
    font-size: clamp(0.98rem, 1.6vw, 1.06rem);
    line-height: 1.75;
    font-weight: 500;
    white-space: pre-wrap;
}

.video-placeholder--compact .video-placeholder-frame {
    min-height: 100px;
    padding: 20px;
}

.video-placeholder--compact .video-placeholder-body {
    padding: 16px 18px;
}

.emergency-model-intro {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(22px, 3.2vw, 40px);
    direction: rtl;
    width: 100%;
    height: var(--chapter-content-height, auto);
    max-height: var(--chapter-content-height, none);
    min-height: 0;
    background: #fff;
    border: 2px solid #e2d4fa;
    border-radius: 16px;
    padding: clamp(22px, 3vw, 36px) clamp(24px, 3.2vw, 40px);
    box-shadow: 0 10px 28px rgba(50, 15, 91, 0.1);
    box-sizing: border-box;
    overflow: hidden;
}

.chapter-step-host:has(.emergency-model-flanked-step) {
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.emergency-model-flanked-step.video-flanked-nav-step {
    width: var(--chapter-content-width, 100%);
    max-width: var(--chapter-content-width, 100%);
}

.emergency-model-flanked-step .video-flanked-nav-step__media {
    width: 100%;
}

.emergency-model-flanked-step .emergency-model-intro {
    width: 100%;
}

.emergency-model-intro__text {
    flex: 1 1 48%;
    min-width: 0;
    min-height: 0;
    text-align: right;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.emergency-model-intro__paragraph {
    margin: 0 0 18px;
    color: #4b5565;
    font-size: clamp(1.08rem, 1.7vw, 1.24rem);
    line-height: 1.65;
    font-weight: 600;
}

.emergency-model-intro__text:has(.emergency-model-intro__paragraph) .emergency-model-intro__paragraph:first-child {
    font-weight: 800;
    color: var(--brand-purple);
    font-size: clamp(1.16rem, 1.9vw, 1.36rem);
    line-height: 1.45;
}

.emergency-model-intro__text:has(.emergency-model-intro__paragraph) .emergency-model-intro__paragraph:last-child {
    font-weight: 800;
}

.emergency-model-intro__paragraph:last-child {
    margin-bottom: 0;
}

.emergency-model-intro__visual {
    flex: 1 1 52%;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.emergency-model-intro__image-wrap {
    position: relative;
    width: 100%;
    max-width: min(100%, 560px);
}

.emergency-model-intro__image {
    display: block;
    width: 100%;
    max-width: min(100%, 560px);
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    transition: opacity 0.2s ease;
}

.emergency-model-intro__hotspots {
    position: absolute;
    inset: 0;
}

.emergency-model-intro__hotspot {
    position: absolute;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 28%;
    padding: 0;
}

.emergency-model-intro__hotspot--shortFuse {
    top: 4%;
    left: 4%;
    width: 46%;
    height: 46%;
}

.emergency-model-intro__hotspot--negativity {
    top: 4%;
    left: 50%;
    width: 46%;
    height: 46%;
}

.emergency-model-intro__hotspot--physical {
    top: 50%;
    left: 4%;
    width: 46%;
    height: 46%;
}

.emergency-model-intro__hotspot--apathy {
    top: 50%;
    left: 50%;
    width: 46%;
    height: 46%;
}

.emergency-model-intro--sign-active .emergency-model-intro__text {
    border-inline-start: 4px solid var(--brand-yellow);
    padding-inline-start: 16px;
}

.emergency-model-intro__sign-title {
    margin: 0 0 18px;
    color: var(--brand-purple);
    font-size: clamp(1.35rem, 2.2vw, 1.7rem);
    font-weight: 800;
    line-height: 1.3;
    text-align: right;
}

.emergency-model-intro__sign-section {
    margin-bottom: 16px;
}

.emergency-model-intro__sign-section:last-child {
    margin-bottom: 0;
}

.emergency-model-intro__sign-heading {
    margin: 0 0 8px;
    color: var(--brand-purple);
    font-size: clamp(1.1rem, 1.7vw, 1.24rem);
    font-weight: 800;
    line-height: 1.4;
    text-align: right;
}

.emergency-model-intro__sign-body {
    margin: 0;
    color: #4b5565;
    font-size: clamp(1.05rem, 1.6vw, 1.18rem);
    line-height: 1.65;
    font-weight: 600;
    text-align: right;
}

/* Shared chapter intro popup - matches LearningChapter4 u4-intro pattern */
body.u4-intro-open {
    overflow: hidden;
}

.u4-intro-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(17, 10, 33, 0.58);
    direction: rtl;
}

.u4-intro-backdrop[hidden] {
    display: none;
}

.u4-intro-modal {
    width: min(100%, 720px);
    max-height: min(90vh, 720px);
    overflow-y: auto;
    padding: 28px 26px 24px;
    border-radius: 18px;
    border: 2px solid #e2d4fa;
    background: linear-gradient(180deg, #ffffff 0%, #faf8fc 100%);
    box-shadow: 0 18px 42px rgba(50, 15, 91, 0.28);
    text-align: right;
}

.u4-intro-title {
    margin: 0 0 16px;
    color: var(--brand-purple);
    font-size: clamp(1.35rem, 2.8vw, 1.75rem);
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
}

.u4-intro-body {
    margin-bottom: 22px;
}

.u4-intro-body p {
    margin: 0 0 14px;
    color: #3d3550;
    font-size: clamp(1rem, 1.8vw, 1.08rem);
    line-height: 1.7;
    font-weight: 500;
    text-align: right;
}

.u4-intro-body p:last-child {
    margin-bottom: 0;
}

.u4-intro-body__emphasis {
    color: var(--brand-purple);
    font-weight: 800;
}

.u4-intro-btn {
    display: block;
    width: 100%;
    border: none;
    border-radius: 999px;
    padding: 14px 20px;
    background: var(--brand-yellow);
    color: var(--brand-purple);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(254, 198, 0, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.u4-intro-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(254, 198, 0, 0.42);
}

.u4-intro-btn:focus-visible {
    outline: 3px solid rgba(50, 15, 91, 0.35);
    outline-offset: 3px;
}

.u4-intro-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.u4-intro-btn--secondary {
    background: #fff;
    color: var(--brand-purple);
    border: 2px solid var(--brand-purple);
    box-shadow: none;
}

.u4-intro-btn--secondary:hover {
    background: #f5f0fc;
    box-shadow: none;
}

.u4-intro-modal--actions {
    width: min(100%, 800px);
}

/* Chapter 2 - control center intro */
.snap-control-intro {
    background: #fff;
    border: 2px solid #e2d4fa;
    border-radius: 14px;
    padding: 16px 20px;
    box-shadow: 0 6px 18px rgba(50, 15, 91, 0.08);
}

.snap-control-intro__text {
    margin: 0;
    color: var(--brand-purple);
    font-size: clamp(1rem, 1.8vw, 1.12rem);
    font-weight: 700;
    line-height: 1.65;
    text-align: right;
}

.snap-control-intro-visual {
    margin-top: 14px;
}

.chapter-step-host:has(.snap-control-flanked-step) {
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.snap-control-flanked-step.video-flanked-nav-step {
    width: var(--chapter-content-width, 100%);
    max-width: var(--chapter-content-width, 100%);
}

.snap-control-flanked-step .video-flanked-nav-step__media {
    width: 100%;
}

.snap-control-flanked-step .snap-control-intro-visual {
    margin-top: 0;
    width: 100%;
}

.chapter-step-host:has(.snap-case-flanked-step) {
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.snap-case-flanked-step.video-flanked-nav-step {
    width: var(--chapter-content-width, 100%);
    max-width: var(--chapter-content-width, 100%);
}

.snap-case-flanked-step .video-flanked-nav-step__media {
    width: 100%;
}

.snap-case-flanked-step .video-flanked-nav-step__media .snap-video-wrap {
    width: 100%;
}

.snap-control-center {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(50, 15, 91, 0.18);
}

.snap-control-center__bg {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
}

.snap-control-center__screens {
    position: absolute;
    top: 31%;
    right: 1%;
    left: 1%;
    bottom: 33%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: 1fr;
    gap: 1.2%;
    align-items: center;
}

.snap-control-screen {
    min-width: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    aspect-ratio: auto;
    border: 4px solid #1f0d38;
    border-radius: 8px;
    overflow: hidden;
    background: #0d0618;
    box-shadow:
        0 0 0 1px rgba(254, 198, 0, 0.25),
        inset 0 0 20px rgba(0, 0, 0, 0.45);
}

.snap-control-screen__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: brightness(0.68) contrast(1.05);
}

.snap-control-screen--preview {
    position: relative;
}

.snap-control-screen--link {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 4px solid #1f0d38;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    background: #0d0618;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 0 1px rgba(254, 198, 0, 0.25),
        inset 0 0 20px rgba(0, 0, 0, 0.45);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.snap-control-screen--link:hover,
.snap-control-screen--link:focus-visible {
    box-shadow:
        0 0 0 2px var(--brand-yellow),
        0 0 0 1px rgba(254, 198, 0, 0.25),
        inset 0 0 20px rgba(0, 0, 0, 0.45);
    transform: scale(1.02);
}

.snap-control-screen--link:focus-visible {
    outline: none;
}

.snap-control-screen--completed {
    border-color: #22c55e !important;
    box-shadow:
        0 0 0 2px rgba(34, 197, 94, 0.55),
        0 0 0 1px rgba(254, 198, 0, 0.2),
        inset 0 0 20px rgba(0, 0, 0, 0.45) !important;
}

.snap-control-screen__badge {
    position: absolute;
    top: 6px;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.snap-control-screen__play,
.snap-video-wrap__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border-radius: 50%;
    background: rgba(254, 198, 0, 0.92);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.snap-control-screen__play::after,
.snap-video-wrap__play::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 9px 0 9px 14px;
    border-color: transparent transparent transparent #2a1248;
}

/* Chapter 1 - question replaces video after playback ends */
.video-overlay-step {
    width: 100%;
    margin: 0;
}

.video-overlay-step__media[hidden] {
    display: none !important;
}

.video-overlay-step__media {
    width: 100%;
}

.video-overlay-step__question[hidden] {
    display: none !important;
}

.video-overlay-step__question .step-actions {
    margin-top: 0;
    padding-top: 0;
}

[data-video-overlay-slot="ch1-v1"].video-overlay-step--question .video-overlay-step__question > .step-actions {
    margin-top: clamp(18px, 3vw, 28px);
}

.video-overlay-step--question .video-overlay-step__question:has(.post-video-multi-select-panel) > .step-actions {
    margin-top: clamp(24px, 4vw, 36px);
    padding-top: clamp(12px, 2vw, 18px);
}

.video-overlay-step--question .video-overlay-step__question > .post-video-multi-select-flanked-nav,
.video-overlay-step--question .video-overlay-step__question > .video-flanked-nav-step {
    width: 100%;
    max-width: 100%;
}

.video-overlay-step--question .video-overlay-step__question {
    width: 100%;
    min-height: 0;
}

.video-overlay-step--question .post-video-multi-select-flanked-nav .video-flanked-nav-step__media,
.video-overlay-step--question .post-video-multi-select-flanked-nav .post-video-experience {
    width: 100%;
    min-height: 0;
}

@media (min-width: 901px) {
    .video-overlay-step--question .post-video-multi-select-flanked-nav.reflection-flanked-nav .post-video-experience {
        height: var(--chapter-content-height, min(68vh, 640px));
        max-height: var(--chapter-content-height, min(68vh, 640px));
    }
}

.post-video-multi-select-panel {
    position: relative;
    overflow: hidden;
}

.video-overlay-step__question .video-overlay-step__rewatch.secondary-step-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    margin: 0;
    border: 2px solid var(--brand-purple);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-purple);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 6px 14px;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s ease;
    white-space: nowrap;
}

.video-overlay-step__question .video-overlay-step__rewatch.secondary-step-btn:hover {
    background: #f6f0ff;
    transform: translateY(-1px);
}

.video-overlay-step__question .post-video-multi-select-panel .interaction-instruction {
    padding-inline-start: clamp(8px, 2vw, 12px);
}

.post-video-multi-select-panel:has(.video-overlay-step__rewatch) .interaction-instruction {
    margin-top: clamp(36px, 6vw, 44px);
}

.post-video-multi-select-body {
    position: relative;
    min-height: 0;
}

.post-video-multi-select-panel .post-video-reflection-overlay.reflection-experience__overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 2.8vw, 24px);
    box-sizing: border-box;
    border-radius: 14px;
    background: rgba(248, 246, 252, 0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    direction: rtl;
    text-align: right;
    overflow: auto;
    overscroll-behavior: contain;
    border: 0;
    gap: 0;
}

.post-video-multi-select-panel .post-video-reflection-overlay.reflection-experience__overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.post-video-multi-select-panel .post-video-reflection-overlay.reflection-experience__overlay[hidden] {
    display: none !important;
}

.post-video-multi-select-panel .post-video-reflection-overlay .reflection-experience__overlay-card {
    width: min(100%, 520px);
    margin: 0 auto;
    max-height: min(58vh, 420px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.post-video-multi-select-panel .post-video-reflection-feedback.reflection-experience__overlay-text {
    width: 100%;
    max-height: none;
    overflow: visible;
    color: #434c5c;
    font-size: clamp(1rem, 1.35vw, 1.1rem);
    line-height: 1.55;
    font-weight: 600;
    margin: 0;
}

.post-video-multi-select-panel--feedback .option-card--locked {
    pointer-events: none;
    opacity: 0.94;
}

.post-video-multi-select-panel--feedback .option-card.selected {
    border-color: #c4b5e8;
    background: #f7f4fc;
    box-shadow: 0 0 0 2px rgba(95, 61, 143, 0.12);
}

.post-video-multi-select-flanked-nav.video-flanked-nav-step {
    width: var(--chapter-content-width, 100%);
    max-width: var(--chapter-content-width, 100%);
    min-height: 0;
}

/* Same outer frame as .learning-video-embed (16:9 + border/shadow) */
.post-video-experience {
    position: relative;
    width: 100%;
    margin: 0;
    background: #fff;
    border: 2px solid #e2d4fa;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(50, 15, 91, 0.1);
    box-sizing: border-box;
}

.post-video-experience::before {
    content: '';
    display: block;
    padding-top: var(--learning-video-aspect, 56.25%);
}

.post-video-experience__card {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.6vh, 16px);
    padding: clamp(12px, 2vh, 20px) clamp(14px, 2vw, 22px);
    border-radius: 0;
    background: linear-gradient(160deg, #ffffff 0%, #faf8ff 48%, #f3eef9 100%);
    border: 0;
    box-shadow: none;
    box-sizing: border-box;
    overflow: hidden;
}

.post-video-experience__upper {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.95fr) minmax(180px, 0.95fr);
    align-items: center;
    column-gap: clamp(14px, 2.2vw, 24px);
    row-gap: 12px;
}

.post-video-experience__upper--solo {
    grid-template-columns: 1fr;
}

.post-video-experience__content {
    min-width: 0;
    min-height: 0;
    gap: clamp(8px, 1.2vh, 12px);
}

.post-video-experience__question {
    margin: 0;
    color: var(--brand-purple);
    font-size: clamp(1.05rem, 1.45vw, 1.22rem);
    font-weight: 800;
    line-height: 1.45;
    text-align: right;
}

.post-video-experience__subheading {
    margin: 10px 0 0;
    color: var(--brand-purple);
    font-size: clamp(1rem, 1.35vw, 1.15rem);
    font-weight: 800;
    line-height: 1.5;
    text-align: right;
}

.post-video-experience__supporting {
    margin: 0;
    color: #566274;
    font-size: clamp(1.12rem, 1.6vw, 1.28rem);
    font-weight: 700;
    line-height: 1.5;
    text-align: right;
}

.post-video-experience__divider {
    height: 1px;
    width: 100%;
    background: rgba(50, 15, 91, 0.12);
    margin: 2px 0;
}

.post-video-experience .reflection-experience__checklist {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.post-video-experience__visual {
    justify-self: center;
    max-width: min(100%, 280px);
}

.post-video-experience__overlay.reflection-experience__overlay {
    border-radius: inherit;
}

.post-video-experience--overlay-open .post-video-experience__card {
    pointer-events: none;
    user-select: none;
}

.post-video-experience--overlay-open .reflection-check-row {
    pointer-events: none;
}

@media (max-width: 900px) {
    .post-video-experience__upper {
        grid-template-columns: 1fr;
    }

    .post-video-experience__visual {
        order: -1;
        width: min(42vw, 160px);
        max-width: min(42vw, 160px);
    }
}

.video-overlay-flanked-nav {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: clamp(14px, 3vw, 28px);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding-inline: clamp(8px, 2vw, 20px);
    box-sizing: border-box;
}

.video-overlay-flanked-nav__side {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 0;
    align-self: flex-end;
}

.video-overlay-flanked-nav__main {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.video-overlay-flanked-nav__main .video-overlay-step {
    margin: 0;
}

.video-overlay-flanked-nav__back {
    flex: 0 0 auto;
}

/* SNAP case - same .learning-video-embed as chapter 1; overlays for preview / question */
.chapter-step-host > iframe {
    display: none !important;
}

.chapter-page:has(.snap-video-wrap--question)::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(13, 6, 24, 0.52);
    pointer-events: auto;
}

.chapter-page:has(.snap-video-wrap--question) .chapter-toolbar,
.chapter-page:has(.snap-video-wrap--question) .chapter-top-nav,
.chapter-page:has(.snap-video-wrap--question) .chapter-progress,
.chapter-page:has(.snap-video-wrap--question) .chapter-header,
.chapter-page:has(.snap-video-wrap--question) .snap-stage-back-row {
    pointer-events: none;
}

.chapter-page:has(.snap-video-wrap--question) .snap-case-flanked-step .video-flanked-nav-step__side {
    pointer-events: auto;
    z-index: 75;
}

.chapter-page:has(.snap-video-wrap--question) .snap-video-wrap {
    position: relative;
    z-index: 72;
}

.snap-video-wrap--question .learning-video-embed iframe {
    pointer-events: none;
}

.snap-video-wrap {
    position: relative;
    width: 100%;
    margin: 0;
}

.chapter-step-host:has(.snap-video-wrap--playing),
.chapter-step-host:has(.snap-video-wrap--question),
.chapter-step-host:has(.video-overlay-step) {
    gap: 12px;
    overflow: visible;
}

.snap-video-wrap--question {
    overflow: visible;
}

.snap-video-wrap__preview,
.snap-video-wrap__scrim,
.snap-video-wrap__question-mount {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 16px;
}

.snap-video-wrap__preview {
    display: block;
    z-index: 2;
    overflow: hidden;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.snap-video-wrap__preview[hidden] {
    display: none !important;
}

.snap-video-wrap--playing .snap-video-wrap__preview,
.snap-video-wrap--question .snap-video-wrap__preview {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
}

.snap-video-wrap__hint {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    margin: 0;
    padding: 12px 14px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(transparent, rgba(13, 6, 24, 0.88));
    pointer-events: none;
    z-index: 2;
}

.snap-video-wrap__thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    filter: brightness(0.7) contrast(1.05);
    transition: filter 0.35s ease, transform 0.45s ease;
}

.snap-video-wrap__preview:hover .snap-video-wrap__thumb,
.snap-video-wrap__preview:focus-visible .snap-video-wrap__thumb {
    filter: brightness(0.82) contrast(1.05);
    transform: scale(1.02);
}

.snap-video-wrap__preview:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 2px;
}

.snap-video-wrap__scrim {
    z-index: 3;
    background: rgba(13, 6, 24, 0);
    pointer-events: none;
    transition: background 0.45s ease;
}

.snap-video-wrap--question .snap-video-wrap__scrim {
    background: transparent;
    pointer-events: none;
}

.snap-video-wrap__question-mount {
    z-index: 4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    pointer-events: none;
    overflow: visible;
}

.snap-video-wrap__question .snap-case-question-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.snap-stage-back-row {
    width: 100%;
    margin: 0 auto 14px;
    display: flex;
    justify-content: flex-start;
    padding-inline: clamp(16px, 4vw, 40px);
    box-sizing: border-box;
}

.snap-video-wrap__question-mount > .step-actions.snap-case-actions {
    position: relative;
    width: min(100%, 900px);
    margin: 0;
    padding-top: 0;
    pointer-events: auto;
    justify-content: center;
}

.snap-video-wrap__question.snap-case-question-panel {
    position: relative;
    flex: 0 1 auto;
    width: min(100%, 900px);
    max-height: none;
    margin: 0;
    padding: 48px 28px 16px;
    border-radius: 12px;
    border: 2px solid rgba(226, 212, 250, 0.9);
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 12px 32px rgba(26, 10, 48, 0.28);
    overflow: visible;
    pointer-events: auto;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.45s ease, transform 0.45s ease;
}

.snap-video-wrap--question .learning-video-embed {
    overflow: visible;
}

.snap-video-wrap--question .learning-video-embed__frame {
    overflow: visible;
}

@media (min-width: 641px) {
    .snap-video-wrap--question .learning-video-embed__frame {
        --bs-aspect-ratio: 62%;
    }
}

.snap-video-wrap--question .snap-video-wrap__question.snap-case-question-panel:not([hidden]) {
    opacity: 1;
    transform: scale(1);
}

.snap-video-wrap__question .snap-case-header {
    font-size: clamp(1.3rem, 2.6vw, 1.55rem);
    margin-bottom: 8px;
}

.snap-video-wrap__question .interaction-instruction {
    font-size: clamp(1.15rem, 2.3vw, 1.4rem);
    margin-bottom: 14px;
    line-height: 1.5;
}

.snap-video-wrap__question .options-list {
    gap: 12px;
    margin-bottom: 12px;
}

.snap-video-wrap__question .option-card {
    padding: 14px 18px;
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    line-height: 1.5;
}

.snap-case-question-panel[hidden],
.snap-case-actions[hidden] {
    display: none !important;
}

.snap-video-wrap__question .snap-video-wrap__rewatch.secondary-step-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    margin: 0;
    border: 2px solid var(--brand-purple);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-purple);
    font-size: 0.82rem;
    font-weight: 800;
    padding: 6px 14px;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s ease;
    white-space: nowrap;
}

.snap-video-wrap__question .snap-video-wrap__rewatch.secondary-step-btn:hover {
    background: #f6f0ff;
    transform: translateY(-1px);
}

@media (max-width: 640px) {
    .snap-video-wrap__question-mount {
        padding: 8px;
    }

    .snap-video-wrap__question.snap-case-question-panel {
        width: 100%;
        padding: 40px 12px 10px;
    }

    .snap-video-wrap--question .learning-video-embed__frame {
        --bs-aspect-ratio: 56.25%;
    }
}

@media (max-width: 640px) {
    .snap-control-center__screens {
        top: 32%;
        right: 1%;
        left: 1%;
        bottom: 32%;
        gap: 1%;
    }

    .snap-control-screen {
        border-width: 2px;
        border-radius: 5px;
    }
}

/* Interaction panels */
.interaction-panel {
    background: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 8px 22px rgba(50, 15, 91, 0.08);
    text-align: right;
}

.interaction-instruction {
    margin: 0 0 16px;
    color: var(--brand-purple);
    font-size: clamp(1.05rem, 1.8vw, 1.2rem);
    font-weight: 800;
    line-height: 1.5;
}

.interaction-subinstruction {
    margin: -8px 0 14px;
    color: #5f6b7a;
    font-size: 0.95rem;
    line-height: 1.55;
    font-weight: 600;
}

.options-list {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.option-card {
    border: 2px solid #d7dce5;
    background: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-purple);
    cursor: pointer;
    transition: 0.2s ease;
    text-align: right;
    font-family: inherit;
    line-height: 1.45;
}

.option-card:hover {
    border-color: #9f8fc5;
    background: #f9f7ff;
}

.option-card.selected {
    border-color: var(--brand-yellow);
    box-shadow: 0 0 0 2px rgba(254, 198, 0, 0.28);
    background: #fff8db;
}

.option-card.wrong-flash {
    border-color: #e57373;
    background: #fff5f5;
}

.option-card--correct {
    border-color: #22c55e;
    background: #f0fdf4;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.option-card--locked:not(.selected):not(.wrong-flash):not(.option-card--correct) {
    opacity: 0.88;
}

/* Chapter 1 - balanced viewport-fitting reflection experience */
.reflection-experience {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    display: flex;
    height: 100%;
}

/* Stages 1–3 + final: shrink-wrap to content - no tall empty region below the CTA */
.reflection-experience:has([data-reflection-slide="stage1"].is-active),
.reflection-experience:has([data-reflection-slide="stage2"].is-active),
.reflection-experience:has([data-reflection-slide="final"].is-active) {
    flex: 0 1 auto;
    height: auto;
    align-self: center;
}

.reflection-experience__shell {
    background: linear-gradient(155deg, #ffffff 0%, #faf8ff 42%, #f2edf9 100%);
    border: 1px solid rgba(50, 15, 91, 0.11);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(50, 15, 91, 0.1);
    padding: 12px 18px 10px;
    overflow: hidden;
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.reflection-experience:has([data-reflection-slide="stage1"].is-active) .reflection-experience__shell,
.reflection-experience:has([data-reflection-slide="stage2"].is-active) .reflection-experience__shell,
.reflection-experience:has([data-reflection-slide="final"].is-active) .reflection-experience__shell {
    flex: 0 1 auto;
    height: auto;
    padding: 12px 18px 12px;
}

.reflection-experience:has([data-reflection-slide="stage1"].is-active) .reflection-experience__layout,
.reflection-experience:has([data-reflection-slide="stage2"].is-active) .reflection-experience__layout,
.reflection-experience:has([data-reflection-slide="final"].is-active) .reflection-experience__layout,
.reflection-experience:has([data-reflection-slide="stage1"].is-active) .reflection-experience__main,
.reflection-experience:has([data-reflection-slide="stage2"].is-active) .reflection-experience__main,
.reflection-experience:has([data-reflection-slide="final"].is-active) .reflection-experience__main {
    flex: 0 1 auto;
}

.reflection-experience__shell::after {
    content: '';
    position: absolute;
    inset: auto 0 0 auto;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(254, 198, 0, 0.09) 0%, transparent 68%);
    pointer-events: none;
}

.reflection-experience__shell--final {
    background: linear-gradient(155deg, #fffdf7 0%, #faf8ff 50%, #f2edf9 100%);
}

.reflection-experience__layout {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.reflection-experience__rail {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(50, 15, 91, 0.08);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
    flex-shrink: 0;
}

.reflection-experience__hero-wrap {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(50, 15, 91, 0.1);
    flex-shrink: 0;
    width: 62px;
}

.reflection-experience__hero {
    display: block;
    width: 100%;
    height: 42px;
    object-fit: cover;
    object-position: center;
}

.reflection-experience__main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    flex: 1 1 auto;
}

.reflection-experience__viewport {
    position: relative;
    flex: 0 1 auto;
    min-height: 0;
}

.reflection-experience__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.reflection-experience__slide.is-active {
    position: relative;
    inset: auto;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    flex: 0 1 auto;
    width: 100%;
    height: auto;
    justify-content: flex-start;
}

.reflection-experience__slide[data-reflection-slide="stage2"].is-active,

.reflection-experience__slide[data-reflection-slide="final"].is-active {
    justify-content: center;
}

.reflection-experience__slide.is-leaving {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: translateX(10px);
}

.reflection-experience__slide.is-entering {
    opacity: 0;
    transform: translateX(-10px);
}

.reflection-experience__slide--transition {
    justify-content: center;
}

.reflection-experience__slide-body {
    flex: 0 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.reflection-experience__slide-actions {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 0 2px;
    margin-top: 0;
    width: 100%;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.reflection-experience__cta.primary-step-btn {
    min-width: 210px;
    padding: 11px 26px;
    font-size: 1.06rem;
    font-weight: 800;
    box-shadow: 0 4px 14px rgba(50, 15, 91, 0.12);
}

.reflection-experience__intro,
.reflection-experience__supporting,
.reflection-experience__transition-text,
.reflection-experience__final-text,
.reflection-experience__pressure-feedback {
    margin: 0 0 12px;
    color: #434c5c;
    font-size: clamp(1rem, 1.35vw, 1.08rem);
    line-height: 1.55;
    font-weight: 600;
}

.reflection-experience__intro p {
    margin: 0 0 0.55em;
}

.reflection-experience__intro p:last-child {
    margin-bottom: 0;
}

.reflection-experience__transition-text p,
.reflection-experience__final-text p,
.reflection-experience__pressure-feedback p {
    margin: 0 0 0.65em;
}

.reflection-experience__transition-text p:last-child,
.reflection-experience__final-text p:last-child,
.reflection-experience__pressure-feedback p:last-child {
    margin-bottom: 0;
}

.reflection-experience__question {
    margin: 0 0 8px;
    color: var(--brand-purple);
    font-size: clamp(1.12rem, 1.65vw, 1.28rem);
    font-weight: 800;
    line-height: 1.42;
}

.reflection-experience__slide[data-reflection-slide="stage2"] .reflection-experience__supporting {
    margin-top: 0;
    margin-bottom: 12px;
}

.reflection-experience__instruction {
    margin: 0 0 12px;
    color: #566274;
    font-size: clamp(0.96rem, 1.2vw, 1.02rem);
    line-height: 1.48;
    font-weight: 600;
}

.reflection-experience__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin: 0;
}

.reflection-experience--checklist .reflection-experience__shell {
    padding: clamp(16px, 2.2vh, 22px) clamp(20px, 2.5vw, 28px);
}

.reflection-experience--checklist .reflection-experience__slide-body {
    justify-content: flex-start;
    gap: clamp(8px, 1.2vh, 12px);
}

.reflection-experience--checklist .reflection-experience__intro {
    margin: 0;
    max-width: none;
}

.reflection-experience--checklist .reflection-experience__question {
    margin: 0;
}

.reflection-experience--checklist .reflection-experience__supporting {
    margin: 0;
}

.reflection-experience--checklist .reflection-experience__instruction {
    margin: 0;
    font-size: clamp(0.9rem, 1.1vw, 0.96rem);
}

/* When an intro leads the stage, it is the bold headline; the question stays regular below it. */
.reflection-experience__stage-header:has(.reflection-experience__intro) .reflection-experience__intro,
.reflection-experience__stage-header:has(.reflection-experience__intro) .reflection-experience__intro p {
    margin: 0;
    color: var(--brand-purple);
    font-size: clamp(1.12rem, 1.65vw, 1.28rem);
    font-weight: 800;
    line-height: 1.42;
}

.reflection-experience__stage-header:has(.reflection-experience__intro) .reflection-experience__question {
    margin: 0;
    color: #434c5c;
    font-size: clamp(1rem, 1.35vw, 1.08rem);
    font-weight: 600;
    line-height: 1.55;
}

.reflection-experience__checklist {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(50, 15, 91, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
}

.reflection-check-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: clamp(12px, 1.5vw, 16px);
    width: 100%;
    margin: 0;
    padding: clamp(12px, 1.8vh, 18px) clamp(14px, 2vw, 20px);
    border: 0;
    border-bottom: 1px solid rgba(50, 15, 91, 0.08);
    border-radius: 0;
    background: transparent;
    color: var(--brand-purple);
    text-align: right;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    font-family: inherit;
    box-sizing: border-box;
    flex: 1 1 0;
    min-height: 0;
}

.reflection-check-row:last-child {
    border-bottom: 0;
}

.reflection-check-row:hover:not(:disabled) {
    background: rgba(50, 15, 91, 0.045);
}

.reflection-check-row:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: -3px;
    z-index: 1;
    position: relative;
}

.reflection-check-row.selected {
    background: rgba(50, 15, 91, 0.075);
}

.reflection-check-row__box {
    position: relative;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 0;
    border: 2px solid #9f8fc5;
    border-radius: 6px;
    background: #fff;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.reflection-check-row.selected .reflection-check-row__box {
    background: var(--brand-purple);
    border-color: var(--brand-purple);
}

.reflection-check-row.selected .reflection-check-row__box::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 6px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.reflection-check-row__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    font-size: clamp(0.98rem, 1.25vw, 1.08rem);
    font-weight: 650;
    line-height: 1.4;
    color: #3a4452;
}

.reflection-check-row__label {
    display: block;
    color: var(--brand-purple);
    font-weight: 800;
    font-size: clamp(1rem, 1.3vw, 1.1rem);
    line-height: 1.3;
}

.reflection-check-row__detail {
    display: block;
    color: #4b5565;
    font-weight: 600;
    line-height: 1.4;
}

.reflection-check-row__text:not(:has(.reflection-check-row__label)) .reflection-check-row__detail {
    color: #3a4452;
    font-weight: 650;
}

.reflection-check-row.selected .reflection-check-row__text,
.reflection-check-row.selected .reflection-check-row__detail {
    color: var(--brand-purple);
}

.reflection-check-row.selected .reflection-check-row__label {
    color: var(--brand-purple);
}

.reflection-check-row--locked {
    cursor: default;
}

.reflection-check-row--locked:not(.selected) {
    opacity: 0.72;
}

.reflection-experience__stage-header {
    display: flex;
    flex-direction: column;
    gap: clamp(6px, 1vh, 10px);
    flex-shrink: 0;
    padding-bottom: clamp(6px, 1vh, 10px);
    border-bottom: 1px solid rgba(50, 15, 91, 0.1);
}

.reflection-experience__stage-header .reflection-experience__intro,
.reflection-experience__stage-header .reflection-experience__question,
.reflection-experience__stage-header .reflection-experience__supporting,
.reflection-experience__stage-header .reflection-experience__instruction {
    margin: 0;
}

.reflection-experience__final-text--choices {
    gap: clamp(8px, 1.2vh, 12px);
    justify-content: center;
    min-height: 0;
}

.reflection-experience__final-text--choices .reflection-experience__checklist,
.reflection-experience__final-text--choices .reflection-experience__cards {
    flex: 1 1 auto;
    min-height: 0;
}

.reflection-experience__final-text--choices .reflection-experience__other-wrap {
    flex-shrink: 0;
}

.reflection-experience--with-stage-visual.reflection-experience--checklist .reflection-check-row {
    padding: clamp(7px, 1.1vh, 12px) clamp(10px, 1.4vw, 14px);
}

.reflection-experience--with-stage-visual.reflection-experience--checklist .reflection-check-row__text {
    font-size: clamp(0.94rem, 1.15vw, 1.04rem);
}

.reflection-experience--with-stage-visual.reflection-experience--checklist .reflection-check-row__label {
    font-size: clamp(0.96rem, 1.18vw, 1.06rem);
}

.reflection-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 0;
    padding: 11px 14px 11px 28px;
    border: 2px solid #d7dce5;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--brand-purple);
    text-align: right;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.18s ease;
    font-family: inherit;
    position: relative;
}

.reflection-card--wide {
    grid-column: 1 / -1;
}

.reflection-card:hover {
    border-color: #9f8fc5;
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(50, 15, 91, 0.08);
}

.reflection-card:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 1px;
}

.reflection-card.selected {
    border-color: var(--brand-yellow);
    background: linear-gradient(145deg, #fffbea 0%, #fff8db 100%);
    box-shadow: 0 0 0 2px rgba(254, 198, 0, 0.32), 0 6px 16px rgba(50, 15, 91, 0.08);
    transform: translateY(-1px);
}

.reflection-card.selected .reflection-card__check {
    opacity: 1;
    transform: scale(1);
}

.reflection-card--locked {
    cursor: default;
}

.reflection-card--locked:not(.selected) {
    opacity: 0.72;
}

.reflection-card__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.reflection-card__label {
    font-size: clamp(0.98rem, 1.2vw, 1.04rem);
    font-weight: 800;
    line-height: 1.3;
}

.reflection-card__detail {
    font-size: clamp(0.92rem, 1.1vw, 0.98rem);
    font-weight: 600;
    line-height: 1.4;
    color: #4b5565;
}

.reflection-card__body:not(:has(.reflection-card__label)) .reflection-card__detail {
    font-size: clamp(0.98rem, 1.2vw, 1.04rem);
    font-weight: 700;
    line-height: 1.38;
    color: var(--brand-purple);
}

.reflection-card__check {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--brand-yellow);
    border: 2px solid var(--brand-purple);
    opacity: 0;
    transform: scale(0.65);
    transition: 0.2s ease;
}

.reflection-card__check::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 7px;
    border: solid var(--brand-purple);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.reflection-experience__final-card {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(220px, 1.05fr);
    align-items: center;
    column-gap: clamp(14px, 2.4vw, 24px);
    row-gap: 14px;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: clamp(8px, 1.6vh, 16px) clamp(8px, 1.8vw, 18px);
    border-radius: 14px;
    background: transparent;
    border: 0;
    box-shadow: none;
    animation: reflectionFadeIn 0.3s ease;
    box-sizing: border-box;
    flex: 1 1 auto;
    min-height: 0;
    direction: rtl;
}

.reflection-experience__final-icon {
    display: none;
}

.reflection-experience__final-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(14px, 2.2vh, 22px);
    text-align: right;
    color: var(--text-dark);
    min-width: 0;
    align-self: stretch;
    padding-inline: clamp(10px, 1.6vw, 26px);
    box-sizing: border-box;
}

.reflection-experience__final-visual {
    position: relative;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    min-width: 0;
    max-width: 100%;
    z-index: 0;
}

.reflection-experience__final-visual::before {
    content: '';
    position: absolute;
    inset: 10% -8% -6% 10%;
    border-radius: 22px;
    background: linear-gradient(155deg, rgba(196, 216, 236, 0.55) 0%, rgba(226, 218, 242, 0.42) 100%);
    z-index: 0;
    pointer-events: none;
}

.reflection-experience__final-image {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    max-width: min(380px, 100%);
    max-height: min(420px, 58vh);
    height: auto;
    object-fit: contain;
    object-position: center;
    border-radius: 16px;
}

.reflection-experience__final-text:not(.reflection-experience__final-text--choices) p {
    margin: 0;
    font-size: clamp(1.02rem, 1.35vw, 1.16rem);
    font-weight: 600;
    line-height: 1.65;
    color: #3a4452;
}

.reflection-experience__final-text p.reflection-experience__final-text--question {
    color: var(--brand-purple);
    font-weight: 800;
    font-size: clamp(1.08rem, 1.55vw, 1.26rem);
    line-height: 1.55;
}

.reflection-experience__final-text p.reflection-experience__final-text--marker {
    color: #3a4452;
    font-weight: 700;
    font-size: clamp(1.02rem, 1.35vw, 1.14rem);
    line-height: 1.7;
    width: fit-content;
    max-width: 100%;
    margin-inline-start: auto;
    padding: 0.08em 0.28em;
    border-radius: 3px;
    background: linear-gradient(
        transparent 58%,
        rgba(254, 198, 0, 0.42) 58%,
        rgba(254, 198, 0, 0.42) 92%,
        transparent 92%
    );
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.reflection-experience__slide[data-reflection-slide="final"] .reflection-experience__slide-body,
.reflection-experience--with-stage-visual .reflection-experience__slide[data-reflection-slide="stage1"] .reflection-experience__slide-body,
.reflection-experience--with-stage-visual .reflection-experience__slide[data-reflection-slide="stage2"] .reflection-experience__slide-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    justify-content: center;
}

.reflection-experience__slide[data-reflection-slide="final"] .reflection-experience__slide-actions {
    margin-top: auto;
    padding: 14px 0 2px;
    flex-shrink: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}

@media (max-width: 767px) {
    .reflection-experience__final-card {
        grid-template-columns: 1fr;
        justify-items: center;
        gap: 14px;
    }

    .reflection-experience__final-visual {
        order: -1;
        width: min(46vw, 170px);
        max-width: min(46vw, 170px);
    }

    .reflection-experience__final-visual::before {
        inset: 8% -6% -4% 8%;
    }

    .reflection-experience__final-image {
        max-width: 170px;
        max-height: 200px;
    }

    .reflection-experience__final-text {
        text-align: right;
        width: 100%;
    }

    .reflection-experience--with-stage-visual.reflection-experience--checklist .reflection-check-row {
        flex: 0 0 auto;
        padding: 10px 12px;
    }
}

.reflection-experience__overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(18px, 3.2vw, 30px);
    box-sizing: border-box;
    border-radius: inherit;
    background: rgba(248, 246, 252, 0.58);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
    direction: rtl;
}

.reflection-experience__overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.reflection-experience__overlay[hidden] {
    display: none !important;
}

.reflection-experience__overlay:focus {
    outline: none;
}

.reflection-experience__overlay-card {
    width: min(100%, 480px);
    margin: 0 auto;
    padding: clamp(18px, 2.8vw, 26px) clamp(20px, 3vw, 28px);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(95, 61, 143, 0.14);
    box-shadow: 0 10px 28px rgba(50, 15, 91, 0.12);
    text-align: right;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.reflection-experience__overlay-selection[hidden] {
    display: none !important;
}

.reflection-experience__overlay-selection-label {
    margin: 0 0 8px;
    color: var(--brand-purple);
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1.3;
}

.reflection-experience__overlay-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-start;
}

.reflection-experience__overlay-chip {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(50, 15, 91, 0.07);
    border: 1px solid rgba(50, 15, 91, 0.12);
    color: var(--brand-purple);
    font-size: clamp(0.86rem, 1.05vw, 0.94rem);
    font-weight: 700;
    line-height: 1.35;
    pointer-events: none;
    user-select: none;
}

.reflection-experience__overlay--with-chips .reflection-experience__overlay-chip {
    max-width: min(100%, 360px);
    white-space: normal;
    border-radius: 12px;
}

.reflection-experience__overlay-text {
    color: #434c5c;
    font-size: clamp(1rem, 1.35vw, 1.08rem);
    line-height: 1.55;
    font-weight: 600;
    margin: 0;
}

.reflection-experience__overlay-text p {
    margin: 0 0 0.65em;
}

.reflection-experience__overlay-text p:last-child {
    margin-bottom: 0;
}

.reflection-experience--overlay-open .reflection-experience__layout {
    pointer-events: none;
    user-select: none;
}

.reflection-experience--overlay-open .reflection-card,
.reflection-experience--overlay-open .reflection-check-row,
.reflection-experience--overlay-open .reflection-experience__cta,
.reflection-experience--overlay-open .reflection-experience__other-input {
    pointer-events: none;
}

.reflection-experience__other-wrap {
    margin-top: 4px;
}

.reflection-experience__other-wrap[hidden] {
    display: none !important;
}

.reflection-experience__other-label {
    display: block;
    margin: 0 0 6px;
    color: #566274;
    font-size: 0.96rem;
    font-weight: 600;
}

.reflection-experience__other-input {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #d7dce5;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--brand-purple);
    resize: none;
    min-height: 52px;
    max-height: 52px;
    line-height: 1.4;
    background: #fff;
}

.reflection-experience__other-input:focus {
    outline: none;
    border-color: #9f8fc5;
    box-shadow: 0 0 0 3px rgba(50, 15, 91, 0.12);
}

@keyframes reflectionFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) and (min-height: 640px) {
    .reflection-experience__slide[data-reflection-slide="stage1"] .reflection-experience__intro,
    .reflection-experience__slide[data-reflection-slide="stage2"] .reflection-experience__supporting {
        max-width: none;
    }

    .chapter-step-host:has(.reflection-experience:has([data-reflection-slide="stage1"].is-active)),
    .chapter-step-host:has(.reflection-experience:has([data-reflection-slide="stage2"].is-active)),
    .chapter-step-host:has(.reflection-experience:has([data-reflection-slide="final"].is-active)) {
        justify-content: center;
    }

    .reflection-flanked-nav {
        flex: 0 0 auto;
        align-self: center;
    }

    .reflection-flanked-nav .video-flanked-nav-step__media {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .reflection-flanked-nav .reflection-experience {
        width: 100%;
    }

    .reflection-flanked-nav .reflection-experience__cards {
        gap: clamp(8px, 1.2vh, 14px);
    }

    .reflection-flanked-nav .reflection-experience--checklist .reflection-experience__checklist {
        flex: 1 1 auto;
    }

    .reflection-flanked-nav .reflection-card {
        padding: clamp(10px, 1.4vh, 14px) 14px clamp(10px, 1.4vh, 14px) 12px;
    }

    .reflection-card__body {
        gap: 3px;
    }
}

@media (max-width: 767px) {
    .reflection-experience__rail {
        flex-direction: row;
        align-items: center;
    }

    .reflection-experience__hero-wrap {
        width: 72px;
    }

    .reflection-experience__hero {
        height: 48px;
    }

    .reflection-experience__cards {
        grid-template-columns: 1fr;
    }

    .reflection-card--wide {
        grid-column: auto;
    }

    .reflection-experience__viewport,
    .reflection-experience__slide.is-active {
        overflow: visible;
    }

}

.snap-case-answers-stack {
    position: relative;
    margin-top: 6px;
}

.snap-case-question-panel--feedback .snap-case-answers-stack .options-list {
    filter: blur(1.5px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.35s ease;
}

/* Feedback state: the hidden submit button keeps occupying its exact space,
   so the vertically-centered question panel does not move by a single pixel
   between the question and feedback states. The button is fully invisible
   and non-interactive — visually removed, geometrically present. */
.snap-video-wrap--feedback .snap-video-wrap__question-mount > .step-actions .primary-step-btn[hidden] {
    /* !important needed to beat Bootstrap reboot's [hidden]{display:none!important} */
    display: block !important;
    visibility: hidden;
    /* The base .primary-step-btn has `transition: all` — without this the
       visibility flip waits out the transition and the button seems to
       linger after submission. Hide it instantly. */
    transition: none;
    pointer-events: none;
}

/* Snap-question feedback — design copied from the chapter-4 "איפוס מחשבתי"
   reframe quiz (.reframe-feedback-overlay / -card / -text / -btn), adapted to
   the snap selectors: dark blurred veil over the answers, centered light card,
   state-colored text and a state-colored pill button inside the card. */
.snap-case-question-panel--feedback .snap-case-answers-stack .snap-formative-feedback {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 12px;
    overflow-y: auto;
    background: rgba(17, 10, 33, 0.42);
    backdrop-filter: blur(2px);
    border: 0;
    border-radius: 10px;
    box-shadow: none;
    text-align: center;
}

.snap-case-question-panel--feedback .snap-case-answers-stack .snap-formative-feedback__body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: min(100%, 560px);
    flex: 0 1 auto;
    margin: 0;
    padding: 18px 16px;
    border-radius: 12px;
    border: 2px solid #e2d4fa;
    background: #f9f7ff;
    box-shadow: 0 10px 28px rgba(50, 15, 91, 0.18);
    text-align: center;
    font-size: clamp(1.12rem, 2.1vw, 1.28rem);
}

.snap-case-question-panel--feedback .snap-case-answers-stack .snap-formative-feedback__body p {
    margin: 0;
    font-weight: 600;
    line-height: 1.6;
    width: 100%;
    text-align: center;
    color: #374151;
}

.snap-case-question-panel--feedback .snap-case-answers-stack .snap-formative-feedback--correct .snap-formative-feedback__body p {
    color: #166534;
}

.snap-case-question-panel--feedback .snap-case-answers-stack .snap-formative-feedback--incorrect .snap-formative-feedback__body p {
    color: #991b1b;
}

.snap-case-question-panel--feedback .snap-formative-feedback .snap-formative-action-btn {
    width: auto;
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 800;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    min-width: 140px;
    background: var(--brand-purple);
    color: #fff;
    transition: background 0.15s ease;
}

.snap-case-question-panel--feedback .snap-formative-feedback--correct .snap-formative-action-btn {
    background: var(--brand-yellow);
    color: var(--brand-purple);
}

.snap-case-question-panel--feedback .snap-formative-feedback--correct .snap-formative-action-btn:hover {
    background: #e6b800;
}

.snap-case-question-panel--feedback .snap-formative-feedback--incorrect .snap-formative-action-btn {
    background: #dc2626;
    color: #fff;
}

.snap-case-question-panel--feedback .snap-formative-feedback--incorrect .snap-formative-action-btn:hover {
    background: #b91c1c;
}


.snap-video-wrap--feedback .snap-video-wrap__scrim {
    background: rgba(13, 6, 24, 0.45);
}

.snap-formative-feedback {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 2px solid #e2d4fa;
    background: #f9f7ff;
    font-size: clamp(1.05rem, 2vw, 1.18rem);
    line-height: 1.6;
    text-align: right;
    color: var(--brand-purple);
}

.snap-formative-feedback--correct {
    border-color: #86efac;
    background: #f0fdf4;
}

.snap-formative-feedback--incorrect {
    border-color: #fca5a5;
    background: #fff5f5;
}

.snap-video-wrap__question-mount > .step-actions.snap-case-actions,
.interaction-panel .step-actions:has(.snap-formative-action-btn) {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

.snap-formative-action-btn {
    width: 100%;
}

/* Live chat simulation */
.chat-sim {
    width: 100%;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.chat-sim__shell {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #ffffff 0%, #faf8ff 45%, #f3eef9 100%);
    border: 1px solid rgba(50, 15, 91, 0.11);
    border-radius: 18px;
    box-shadow: 0 12px 32px rgba(50, 15, 91, 0.1);
    overflow: hidden;
    box-sizing: border-box;
}

.chat-sim__view {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
    height: 100%;
}

.chat-sim__view.is-active {
    display: flex;
}

.chat-sim__setup {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: clamp(16px, 2.4vh, 24px);
    padding: clamp(18px, 3.2vh, 32px) clamp(22px, 4vw, 40px);
    text-align: right;
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat-sim__setup--intro {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: clamp(20px, 3.5vh, 32px);
    max-width: none;
    width: 100%;
    margin: 0;
    padding: clamp(16px, 2.6vh, 28px) clamp(20px, 3.2vw, 36px);
}

.chat-sim__setup-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(180px, 0.75fr);
    column-gap: clamp(18px, 2.8vw, 36px);
    row-gap: clamp(14px, 2vh, 20px);
    align-items: start;
    width: 100%;
    min-width: 0;
}

.chat-sim__activity-intro {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.chat-sim__setup-visual {
    position: relative;
    margin: 0;
    padding: 0;
    min-width: 0;
    width: 100%;
    max-width: min(280px, 100%);
    justify-self: end;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(50, 15, 91, 0.04);
    box-shadow:
        0 10px 28px rgba(50, 15, 91, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.7) inset;
    aspect-ratio: 1 / 1;
}

.chat-sim__setup-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.chat-sim__activity-title {
    margin: 0;
    color: var(--brand-purple);
    font-size: clamp(1.4rem, 2.3vw, 1.78rem);
    font-weight: 800;
    line-height: 1.3;
    text-align: right;
}

.chat-sim__activity-explanation {
    color: #4b5565;
    font-size: clamp(1.02rem, 1.35vw, 1.14rem);
    font-weight: 600;
    line-height: 1.65;
    text-align: right;
}

.chat-sim__activity-explanation p {
    margin: 0 0 0.85em;
}

.chat-sim__activity-explanation p:last-child {
    margin-bottom: 0;
}

.chat-sim__activity-emphasis {
    color: var(--brand-purple);
    font-weight: 800;
    margin-top: 1.35em;
}

.chat-sim__marker {
    background: linear-gradient(
        transparent 58%,
        rgba(254, 198, 0, 0.42) 58%,
        rgba(254, 198, 0, 0.42) 92%,
        transparent 92%
    );
    color: inherit;
    font-weight: 800;
    padding: 0 0.08em;
    border-radius: 2px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.chat-sim__personalization {
    display: flex;
    flex-direction: column;
    gap: clamp(12px, 1.8vh, 16px);
    min-width: 0;
    width: 100%;
    padding: clamp(16px, 2.4vh, 22px) clamp(16px, 2.2vw, 24px);
    border-radius: 16px;
    background: rgba(50, 15, 91, 0.045);
    border: 1px solid rgba(50, 15, 91, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
    box-sizing: border-box;
}

.chat-sim__personalization-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    column-gap: clamp(24px, 4vw, 48px);
    row-gap: 10px;
    align-items: start;
}

.chat-sim__personalization-title--gender,
.chat-sim__personalization-support--gender,
.chat-sim__personalization-control--gender {
    grid-column: 1;
}

.chat-sim__personalization-title--name,
.chat-sim__personalization-support--name,
.chat-sim__personalization-control--name {
    grid-column: 2;
}

.chat-sim__personalization-title--gender,
.chat-sim__personalization-title--name {
    grid-row: 1;
}

.chat-sim__personalization-support--gender,
.chat-sim__personalization-support--name {
    grid-row: 2;
}

.chat-sim__personalization-control--gender,
.chat-sim__personalization-control--name {
    grid-row: 3;
    align-self: stretch;
}

.chat-sim__personalization-control--name {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-sim__setup-title {
    margin: 0;
    color: var(--brand-purple);
    font-size: clamp(1.12rem, 1.7vw, 1.3rem);
    font-weight: 800;
    line-height: 1.3;
}

.chat-sim__setup-supporting {
    margin: 0;
    color: #4b5565;
    font-size: clamp(0.98rem, 1.25vw, 1.06rem);
    font-weight: 600;
    line-height: 1.5;
}

.chat-sim__setup--intro .chat-sim__name-instruction {
    display: none;
}

.chat-sim__setup--intro .chat-sim__name-label {
    display: block;
    cursor: default;
}

.chat-sim__setup--intro .chat-sim__name-input {
    width: 100%;
    min-height: 48px;
    box-sizing: border-box;
}

@media (max-width: 820px) {
    .chat-sim__setup-hero {
        grid-template-columns: 1fr;
    }

    .chat-sim__setup-visual {
        max-width: min(220px, 62%);
        justify-self: center;
    }

    .chat-sim__personalization-row {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }

    .chat-sim__personalization-title--gender,
    .chat-sim__personalization-support--gender,
    .chat-sim__personalization-control--gender,
    .chat-sim__personalization-title--name,
    .chat-sim__personalization-support--name,
    .chat-sim__personalization-control--name {
        grid-column: 1;
        grid-row: auto;
    }

    .chat-sim__personalization-title--gender { order: 1; }
    .chat-sim__personalization-support--gender { order: 2; }
    .chat-sim__personalization-control--gender { order: 3; }
    .chat-sim__personalization-title--name { order: 4; margin-top: 8px; }
    .chat-sim__personalization-support--name { order: 5; }
    .chat-sim__personalization-control--name { order: 6; }
}

.chat-sim__gender-label {
    margin: 2px 0 0;
    color: var(--brand-purple);
    font-weight: 800;
    font-size: 0.98rem;
}

.chat-sim__gender {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.chat-sim__gender-btn {
    appearance: none;
    border: 2px solid #d7dce5;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--brand-purple);
    font: inherit;
    font-weight: 800;
    font-size: 1.05rem;
    padding: 12px 14px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.chat-sim__gender-btn:hover {
    border-color: #b9a8d4;
}

.chat-sim__gender-btn:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 2px;
}

.chat-sim__gender-btn.is-selected,
.chat-sim__gender-btn[aria-pressed="true"] {
    border-color: var(--brand-purple);
    background: rgba(50, 15, 91, 0.08);
    box-shadow: inset 0 0 0 1px rgba(50, 15, 91, 0.08);
    font-weight: 800;
    position: relative;
}

.chat-sim__gender-btn.is-selected::after,
.chat-sim__gender-btn[aria-pressed="true"]::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 10px;
    width: 7px;
    height: 12px;
    border: solid var(--brand-purple);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.chat-sim__name-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-sim__name-fields.is-locked .chat-sim__name-input,
.chat-sim__personalization-control--name.is-locked .chat-sim__name-input,
.chat-sim__personalization-name.is-locked .chat-sim__name-input {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f3f4f7;
}

.chat-sim__name-instruction {
    margin: 2px 0 0;
    color: #4b5565;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1.4;
}

.chat-sim__name-instruction[hidden] {
    display: none !important;
}

.chat-sim__name-label {
    margin: 0;
    color: var(--brand-purple);
    font-weight: 700;
    font-size: 0.95rem;
}

.chat-sim__name-input {
    width: 100%;
    box-sizing: border-box;
    border: 2px solid #d7dce5;
    border-radius: 12px;
    padding: 12px 14px;
    font: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--brand-purple);
    background: #fff;
    text-align: right;
}

.chat-sim__name-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.chat-sim__name-input:focus {
    outline: none;
    border-color: var(--brand-purple);
    box-shadow: 0 0 0 3px rgba(254, 198, 0, 0.35);
}

.chat-sim__header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(50, 15, 91, 0.1);
    background: rgba(255, 255, 255, 0.88);
}

.chat-sim__agent-header {
    margin: 0;
    flex-shrink: 0;
    color: var(--brand-purple);
    font-size: 1rem;
    font-weight: 800;
    text-align: left;
}

.chat-sim__intro {
    flex-shrink: 0;
    padding: 8px 14px 10px;
    border-bottom: 1px solid rgba(50, 15, 91, 0.08);
    background: rgba(255, 255, 255, 0.72);
    text-align: right;
}

.chat-sim__intro[hidden] {
    display: none !important;
}

.chat-sim__intro-title {
    margin: 0 0 4px;
    color: var(--brand-purple);
    font-size: clamp(0.98rem, 1.2vw, 1.08rem);
    font-weight: 800;
    line-height: 1.3;
}

.chat-sim__intro-supporting,
.chat-sim__intro-instruction {
    margin: 0;
    color: #4b5565;
    font-size: clamp(0.84rem, 1.05vw, 0.92rem);
    font-weight: 600;
    line-height: 1.45;
}

.chat-sim__intro-instruction {
    margin-top: 4px;
    color: #566274;
}

.chat-sim__identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.chat-sim__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(145deg, #efe7f8 0%, #dfeaf5 100%);
    color: var(--brand-purple);
    font-weight: 800;
    font-size: 1.05rem;
    border: 2px solid rgba(50, 15, 91, 0.12);
}

.chat-sim__avatar[data-gender="female"] {
    background: linear-gradient(145deg, #f7e8f0 0%, #ebe4f8 100%);
}

.chat-sim__identity-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-sim__customer-line {
    margin: 0;
    color: var(--brand-purple);
    font-weight: 800;
    font-size: 1.12rem;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-sim__progress {
    margin: 0;
    color: #6b7280;
    font-size: 0.84rem;
    font-weight: 700;
}

.chat-sim__thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background:
        radial-gradient(circle at 12% 8%, rgba(254, 198, 0, 0.08), transparent 28%),
        radial-gradient(circle at 88% 18%, rgba(50, 15, 91, 0.05), transparent 30%),
        #f7f5fb;
}

.chat-sim__row {
    display: flex;
    width: 100%;
}

.chat-sim__row--customer {
    justify-content: flex-start;
    direction: ltr;
}

.chat-sim__row--customer .chat-sim__bubble {
    direction: rtl;
    text-align: right;
}

.chat-sim__row--agent {
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    direction: ltr;
}

.chat-sim__bubble-meta {
    max-width: min(78%, 420px);
    color: var(--brand-purple);
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1.2;
    padding-inline: 4px;
    text-align: right;
    direction: rtl;
    align-self: flex-end;
}

.chat-sim__bubble {
    max-width: min(78%, 420px);
    padding: 9px 12px;
    border-radius: 16px;
    font-size: clamp(1.02rem, 1.35vw, 1.12rem);
    font-weight: 600;
    line-height: 1.45;
    box-sizing: border-box;
    animation: chatSimBubbleIn 0.28s ease;
}

.chat-sim__bubble--customer {
    background: #fff;
    color: #2f3744;
    border: 1px solid rgba(50, 15, 91, 0.08);
    border-top-left-radius: 6px;
    box-shadow: 0 4px 12px rgba(50, 15, 91, 0.05);
}

.chat-sim__bubble--agent {
    background: var(--brand-purple);
    color: #fff;
    border-top-right-radius: 6px;
    box-shadow: 0 6px 14px rgba(50, 15, 91, 0.18);
    direction: rtl;
    text-align: right;
}

.chat-sim__bubble--typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-block: 10px;
}

.chat-sim__typing-label {
    color: #6b7280;
    font-size: 0.94rem;
    font-weight: 700;
}

.chat-sim__typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.chat-sim__typing-dots i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9aa3b2;
    animation: chatSimTyping 1.1s infinite ease-in-out;
}

.chat-sim__typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.chat-sim__typing-dots i:nth-child(3) { animation-delay: 0.3s; }

.chat-sim__feedback {
    align-self: stretch;
    width: auto;
    box-sizing: border-box;
    margin: 8px -10px 2px;
    padding: 15px 18px;
    border-radius: 12px;
    border: 1px solid rgba(50, 15, 91, 0.12);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 4px 14px rgba(50, 15, 91, 0.06);
    color: #3a4452;
    font-size: clamp(1.14rem, 1.55vw, 1.28rem);
    font-weight: 600;
    line-height: 1.6;
    text-align: right;
    animation: chatSimBubbleIn 0.3s ease;
}

.chat-sim__feedback p {
    margin: 0 0 0.5em;
}

.chat-sim__feedback p:last-child {
    margin-bottom: 0;
}

.chat-sim__feedback-label {
    margin: 0 0 8px !important;
    color: var(--brand-purple);
    font-size: clamp(1.02rem, 1.25vw, 1.12rem);
    font-weight: 800;
    letter-spacing: 0.02em;
    text-align: right;
}

.chat-sim__suggestions-title {
    flex-shrink: 0;
    margin: 0;
    padding: 8px 14px 0;
    color: var(--brand-purple);
    font-size: clamp(1.12rem, 1.4vw, 1.22rem);
    font-weight: 800;
    background: transparent;
}

.chat-sim__suggestions-title[hidden] {
    display: none !important;
}

.chat-sim__suggestions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 8px 12px 4px;
    border-top: none;
    background: transparent;
    max-height: min(38%, 200px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.chat-sim__suggestions[hidden] {
    display: none !important;
}

.chat-sim__suggestion {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    text-align: right;
    border: 1px solid rgba(50, 15, 91, 0.14);
    border-radius: 12px;
    background: rgba(247, 245, 251, 0.92);
    color: #3a4452;
    padding: 8px 10px;
    cursor: pointer;
    font: inherit;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.chat-sim__suggestion:hover {
    border-color: rgba(50, 15, 91, 0.28);
    background: rgba(255, 255, 255, 0.96);
}

.chat-sim__suggestion:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 1px;
}

.chat-sim__suggestion.is-selected,
.chat-sim__suggestion[aria-pressed="true"] {
    border-color: var(--brand-purple);
    background: rgba(50, 15, 91, 0.06);
    box-shadow: inset 0 0 0 1px rgba(50, 15, 91, 0.08);
}

.chat-sim__suggestion-index {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(50, 15, 91, 0.08);
    color: var(--brand-purple);
    font-size: 0.9rem;
    font-weight: 800;
    margin-top: 1px;
}

.chat-sim__suggestion.is-selected .chat-sim__suggestion-index {
    background: var(--brand-purple);
    color: #fff;
}

.chat-sim__suggestion-text {
    flex: 1;
    min-width: 0;
    font-size: clamp(1.05rem, 1.35vw, 1.16rem);
    font-weight: 650;
    line-height: 1.45;
}

.chat-sim__composer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 12px;
    border-top: 1px solid rgba(50, 15, 91, 0.1);
    background: rgba(255, 255, 255, 0.94);
}

.chat-sim__composer-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid rgba(50, 15, 91, 0.14);
    border-radius: 18px;
    padding: 10px 14px;
    font: inherit;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--brand-purple);
    background: #f8f6fc;
    text-align: right;
}

.chat-sim__composer-input:focus {
    outline: none;
}

.chat-sim__send {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--brand-purple);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.chat-sim__send:hover:not(:disabled) {
    transform: scale(1.04);
}

.chat-sim__send:focus-visible {
    outline: 3px solid var(--brand-yellow);
    outline-offset: 2px;
}

.chat-sim__send:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.chat-sim__send.is-sent:disabled {
    opacity: 1;
    background: #6b5a86;
    min-width: 42px;
    padding-inline: 8px;
    border-radius: 21px;
    width: auto;
}

.chat-sim__send-label {
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
}

.chat-sim__send-icon {
    width: 18px;
    height: 18px;
    display: block;
    transform: scaleX(-1);
}

.chat-sim__send-icon[hidden],
.chat-sim__send-label[hidden] {
    display: none !important;
}

@media (prefers-reduced-motion: reduce) {
    .chat-sim__bubble,
    .chat-sim__feedback {
        animation: none;
    }

    .chat-sim__typing-dots i {
        animation: none;
    }
}

.chat-sim__send-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.chat-sim__summary-card {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.chat-sim__summary-card.reflection-experience__final-card {
    padding: clamp(8px, 1.6vh, 16px) clamp(12px, 2vw, 22px);
    align-content: center;
}

.chat-sim__summary-copy {
    gap: clamp(10px, 1.6vh, 16px);
    min-height: 0;
}

.chat-sim__summary-title {
    margin: 0;
    color: var(--brand-purple);
    font-size: clamp(1.2rem, 1.9vw, 1.55rem);
    font-weight: 800;
    line-height: 1.3;
}

.chat-sim__summary-text {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 1.5vh, 16px);
    color: #3a4452;
    min-height: 0;
}

.chat-sim__summary-text p {
    margin: 0;
    font-size: clamp(0.96rem, 1.25vw, 1.1rem);
    font-weight: 600;
    line-height: 1.55;
}

.chat-sim__summary-text p.reflection-experience__final-text--question {
    color: var(--brand-purple);
    font-weight: 800;
    font-size: clamp(1.02rem, 1.4vw, 1.18rem);
    line-height: 1.45;
}

.chat-sim__summary-text p.reflection-experience__final-text--marker {
    color: #3a4452;
    font-weight: 700;
    font-size: clamp(0.96rem, 1.25vw, 1.08rem);
    line-height: 1.55;
    width: fit-content;
    max-width: 100%;
    margin-inline-start: auto;
    padding: 0.08em 0.28em;
    border-radius: 3px;
    background: linear-gradient(
        transparent 58%,
        rgba(254, 198, 0, 0.42) 58%,
        rgba(254, 198, 0, 0.42) 92%,
        transparent 92%
    );
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

@media (max-width: 767px) {
    .chat-sim__summary-card.reflection-experience__final-card {
        align-content: center;
        gap: 10px;
    }

    .chat-sim__summary-text p {
        font-size: clamp(0.9rem, 3.4vw, 1rem);
        line-height: 1.45;
    }
}

@keyframes chatSimBubbleIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes chatSimTyping {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.snap-case-header {
    margin: 0 0 12px;
    color: var(--brand-purple);
    font-weight: 800;
    font-size: 1.2rem;
}

.snap-stage-label {
    margin: 0 0 10px;
    color: #6b7280;
    font-size: 0.88rem;
    font-weight: 800;
}

.step-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 24px;
    width: 100%;
}

.step-actions--with-back {
    position: relative;
    justify-content: center;
    max-width: 100%;
    width: 100%;
    min-height: 52px;
    padding-inline: clamp(72px, 12vw, 120px);
    box-sizing: border-box;
}

.step-actions--with-back .back-step-btn {
    position: absolute;
    top: 50%;
    inset-inline-start: clamp(12px, 3vw, 32px);
    inset-inline-end: auto;
    transform: translateY(-50%);
}

.step-actions--with-back .back-step-btn:hover {
    transform: translateY(calc(-50% - 1px));
}

.step-actions--with-back .back-step-btn:focus-visible {
    transform: translateY(-50%);
}

.step-actions--with-back:has(.next-step-btn) {
    gap: clamp(12px, 2vw, 18px);
}

.step-actions--with-back:has(.primary-step-btn:not(.next-step-btn)) {
    gap: clamp(12px, 2vw, 18px);
}

.step-actions .next-step-btn {
    flex-shrink: 0;
}

.chapter-step-host:has(.video-flanked-nav-step) {
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.video-flanked-nav-step {
    position: relative;
    width: 100%;
    max-width: calc(100% - 2 * (var(--flanked-nav-arrow-size, 52px) + var(--flanked-nav-arrow-gap, 18px)));
    height: fit-content;
    margin: 0 auto;
    padding: 0;
    box-sizing: border-box;
    overflow: visible;
}

.video-flanked-nav-step__side {
    position: absolute;
    top: auto;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--flanked-nav-arrow-size, 52px);
    height: var(--flanked-nav-arrow-size, 52px);
    padding: 0;
    z-index: 2;
    transform: none;
}

.video-flanked-nav-step__side:first-child:not(.video-flanked-nav-step__media) {
    right: calc(-1 * (var(--flanked-nav-arrow-size, 52px) + var(--flanked-nav-arrow-gap, 18px)));
    left: auto;
}

.video-flanked-nav-step__side:last-child:not(.video-flanked-nav-step__media) {
    left: calc(-1 * (var(--flanked-nav-arrow-size, 52px) + var(--flanked-nav-arrow-gap, 18px)));
    right: auto;
}

.video-flanked-nav-step__media {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.video-flanked-nav-step__media .learning-video-embed,
.video-flanked-nav-step__media .post-video-experience {
    width: 100%;
    margin: 0;
}

.video-flanked-nav-step__back,
.video-flanked-nav-step__next {
    flex: 0 0 auto;
}

.back-step-btn,
.next-step-btn {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: 2px solid var(--brand-purple);
    border-radius: 50%;
    background: #fff;
    color: var(--brand-purple);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 4px 14px rgba(50, 15, 91, 0.12);
}

.back-step-btn:hover,
.next-step-btn:hover:not(:disabled) {
    background: #f5f0fc;
    border-color: #5a2d8a;
    transform: translateY(-1px);
}

.next-step-btn:disabled {
    cursor: not-allowed;
    background: #f8f6fc;
    border-color: #d4c2e8;
}

.next-step-btn:disabled .next-step-icon {
    opacity: 0.5;
}

.next-step-btn.next-step-btn--ready-pulse:not(:disabled) {
    animation: nextArrowReadyPulse 2.4s ease-in-out infinite;
}

@keyframes nextArrowReadyPulse {
    0%,
    100% {
        box-shadow:
            0 4px 14px rgba(50, 15, 91, 0.12),
            0 0 0 3px rgba(34, 197, 94, 0.65);
    }
    50% {
        box-shadow:
            0 6px 18px rgba(34, 197, 94, 0.35),
            0 0 0 10px rgba(34, 197, 94, 0.0);
    }
}

.next-step-btn.next-step-btn--ready-pulse:not(:disabled) {
    background: #eafbf1;
    border-color: #22c55e;
}

.next-step-btn.next-step-btn--ready-pulse:not(:disabled) .next-step-icon {
    color: #15803d;
}

@media (prefers-reduced-motion: reduce) {
    .next-step-btn.next-step-btn--ready-pulse:not(:disabled) {
        animation: none;
        box-shadow:
            0 4px 14px rgba(50, 15, 91, 0.12),
            0 0 0 3px rgba(34, 197, 94, 0.35);
    }
}

.back-step-btn:focus-visible,
.next-step-btn:focus-visible {
    outline: 3px solid rgba(50, 15, 91, 0.35);
    outline-offset: 3px;
}

.back-step-icon,
.next-step-icon {
    display: block;
}

.primary-step-btn,
.submit-answer-btn {
    border: none;
    border-radius: 999px;
    background: var(--brand-yellow);
    color: var(--brand-purple);
    font-size: 1.05rem;
    font-weight: 800;
    padding: 12px 28px;
    min-width: 200px;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: inherit;
}

.primary-step-btn:disabled,
.submit-answer-btn:disabled {
    cursor: not-allowed;
    background: #ebe6c8;
    color: #7a6896;
    box-shadow: none;
}

.primary-step-btn:hover:not(:disabled),
.submit-answer-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(254, 198, 0, 0.35);
}

.chapter-complete-panel {
    text-align: center;
    background: #fff;
    border-radius: 14px;
    padding: 28px 22px;
    box-shadow: 0 8px 22px rgba(50, 15, 91, 0.1);
}

.chapter-complete-panel p {
    margin: 0 0 18px;
    color: var(--brand-purple);
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1.55;
}

.chapter-step-host:has(.chapter-summary-flanked-step) {
    justify-content: center;
    align-items: center;
    overflow: visible;
}

/* Same outer frame as chapter videos */
.chapter-summary-flanked-step.video-flanked-nav-step,
.chapter-summary-flanked-step--wide.video-flanked-nav-step {
    width: var(--chapter-content-width, 100%);
    max-width: var(--chapter-content-width, 100%);
}

.chapter-summary-flanked-step .video-flanked-nav-step__media {
    width: 100%;
}

.chapter-summary-flanked-step .chapter-summary {
    width: 100%;
    height: var(--chapter-content-height, auto);
    max-height: var(--chapter-content-height, none);
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: clamp(10px, 1.6vh, 16px);
    padding: clamp(16px, 2.2vh, 24px) clamp(18px, 2.4vw, 28px);
    border: 2px solid #e2d4fa;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(50, 15, 91, 0.1);
    box-sizing: border-box;
    overflow: hidden;
}

.chapter-summary-flanked-step .chapter-summary.chapter-summary--accordion {
    justify-content: flex-start;
}

.chapter-summary--wide {
    padding: clamp(16px, 2.2vh, 24px) clamp(18px, 2.4vw, 28px);
}

.chapter-summary--wide .chapter-summary__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(14px, 2.2vh, 20px) clamp(18px, 2.4vw, 28px);
    align-items: stretch;
}

.chapter-summary--wide:not(.chapter-summary--accordion) .chapter-summary__item {
    align-items: flex-start;
    min-height: 100%;
    padding: clamp(10px, 1.4vh, 14px) clamp(10px, 1.2vw, 14px);
    border-radius: 12px;
    background: rgba(50, 15, 91, 0.03);
    border: 1px solid rgba(50, 15, 91, 0.06);
    box-sizing: border-box;
}

.chapter-summary--wide .chapter-summary__next {
    margin-top: clamp(16px, 2.4vh, 22px);
    padding-top: clamp(14px, 2vh, 18px);
    border-top: 1px solid rgba(50, 15, 91, 0.12);
    max-width: min(100%, 760px);
    margin-inline-start: auto;
}

.chapter-summary--wide .chapter-summary__item-body p {
    line-height: 1.55;
}

.chapter-summary--wide .chapter-summary__lead {
    color: var(--brand-purple);
    font-weight: 800;
}

.chapter-summary--wide .chapter-summary__actions {
    display: none;
}

.chapter-summary--accordion .chapter-summary__list {
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    gap: 10px;
}

.chapter-summary--accordion.chapter-summary--wide .chapter-summary__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chapter-summary__accordion {
    display: block;
    margin: 0;
    border-radius: 12px;
    background: rgba(50, 15, 91, 0.03);
    border: 1px solid rgba(50, 15, 91, 0.08);
    overflow: hidden;
    box-sizing: border-box;
}

.chapter-summary__accordion.chapter-summary__item {
    display: block;
    align-items: stretch;
    gap: 0;
}

.chapter-summary__accordion[open] {
    background: #fff;
    border-color: rgba(50, 15, 91, 0.16);
    box-shadow: 0 4px 14px rgba(50, 15, 91, 0.06);
}

.chapter-summary__summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    width: 100%;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    text-align: right;
    box-sizing: border-box;
}

.chapter-summary__summary::-webkit-details-marker {
    display: none;
}

.chapter-summary__summary::after {
    content: '+';
    grid-column: 3;
    justify-self: end;
    color: rgba(50, 15, 91, 0.45);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
}

.chapter-summary__accordion[open] .chapter-summary__summary::after {
    content: '−';
}

/* Bootstrap accordion structure: keep the exact legacy summary look.
   The markup now uses Bootstrap's accordion/collapse classes; these rules
   neutralize Bootstrap's default accordion skin in favor of the design above. */
.chapter-summary__list > .chapter-summary__accordion,
.chapter-summary__list > .chapter-summary__accordion:first-of-type,
.chapter-summary__list > .chapter-summary__accordion:last-of-type {
    border-radius: 12px;
    background: rgba(50, 15, 91, 0.03);
    border: 1px solid rgba(50, 15, 91, 0.08);
}

.chapter-summary__list > .chapter-summary__accordion:has(.accordion-button:not(.collapsed)) {
    background: #fff;
    border-color: rgba(50, 15, 91, 0.16);
    box-shadow: 0 4px 14px rgba(50, 15, 91, 0.06);
}

.chapter-summary__accordion .accordion-header {
    margin: 0;
}

.chapter-summary__accordion .accordion-button.chapter-summary__summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 12px;
    background: transparent;
    border: 0;
    border-radius: 12px;
    box-shadow: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.chapter-summary__accordion .accordion-button.chapter-summary__summary:not(.collapsed) {
    background: transparent;
    color: inherit;
    box-shadow: none;
}

.chapter-summary__accordion .accordion-button.chapter-summary__summary:focus {
    border-color: transparent;
    box-shadow: none;
}

.chapter-summary__accordion .accordion-button.chapter-summary__summary::after {
    content: '+';
    background-image: none;
    width: auto;
    height: auto;
    transform: none;
    transition: none;
    grid-column: 3;
    justify-self: end;
    color: rgba(50, 15, 91, 0.45);
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1;
    margin-left: 0;
}

.chapter-summary__accordion .accordion-button.chapter-summary__summary:not(.collapsed)::after {
    content: '−';
    background-image: none;
    transform: none;
}

.chapter-summary__accordion .accordion-body.chapter-summary__item-body {
    display: block;
    width: 100%;
    padding: 0 14px 14px;
    padding-inline-start: calc(14px + 34px + 12px);
    box-sizing: border-box;
}

.chapter-summary__accordion .chapter-summary__marker {
    grid-column: 1;
    margin-top: 0;
}

.chapter-summary__title {
    grid-column: 2;
    min-width: 0;
    color: var(--brand-purple);
    font-size: clamp(0.95rem, 1.35vw, 1.05rem);
    font-weight: 800;
    line-height: 1.4;
    text-align: right;
}

.chapter-summary__accordion .chapter-summary__item-body {
    display: block;
    width: 100%;
    padding: 0 14px 14px;
    padding-inline-start: calc(14px + 34px + 12px);
    box-sizing: border-box;
}

.chapter-summary--accordion.chapter-summary--wide .chapter-summary__next,
.chapter-summary--accordion .chapter-summary__next {
    flex: 0 0 auto;
    margin-block: auto;
    padding-top: 0;
    max-width: min(100%, 640px);
    margin-inline: auto;
    text-align: center;
    border-top: none;
}

.chapter-summary--accordion .chapter-summary__next-title {
    margin: 0 auto 10px;
    font-size: clamp(1.08rem, 1.55vw, 1.26rem);
    text-align: center;
    width: fit-content;
    max-width: 100%;
    color: #3a4452;
    font-weight: 700;
    line-height: 1.5;
    padding: 0.08em 0.28em;
    border-radius: 3px;
    background: linear-gradient(
        transparent 58%,
        rgba(254, 198, 0, 0.42) 58%,
        rgba(254, 198, 0, 0.42) 92%,
        transparent 92%
    );
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.chapter-summary--accordion .chapter-summary__next p {
    margin: 0 0 0.45em;
    font-size: clamp(1.02rem, 1.4vw, 1.16rem);
    line-height: 1.6;
    font-weight: 600;
    text-align: center;
}

.chapter-summary {
    width: 100%;
    background: linear-gradient(180deg, #ffffff 0%, #faf8fc 100%);
    border: 2px solid #e2d4fa;
    border-radius: 16px;
    padding: clamp(16px, 2.2vh, 24px) clamp(18px, 2.4vw, 28px);
    box-shadow: 0 10px 28px rgba(50, 15, 91, 0.1);
    text-align: right;
    box-sizing: border-box;
}

.chapter-summary__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.chapter-summary__item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.chapter-summary__marker {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-purple);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1;
    margin-top: 2px;
}

.chapter-summary__item-body p {
    margin: 0 0 0.55em;
    color: #4b5565;
    font-size: clamp(0.94rem, 1.6vw, 1.02rem);
    line-height: 1.65;
    font-weight: 600;
}

.chapter-summary__item-body p:last-child {
    margin-bottom: 0;
}

.chapter-summary__next {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid rgba(50, 15, 91, 0.12);
}

.chapter-summary__next-title {
    margin: 0 0 10px;
    color: var(--brand-purple);
    font-size: clamp(1.12rem, 1.8vw, 1.28rem);
    font-weight: 800;
    line-height: 1.3;
}

.chapter-summary__next p {
    margin: 0 0 0.7em;
    color: #4b5565;
    font-size: clamp(0.98rem, 1.35vw, 1.08rem);
    line-height: 1.65;
    font-weight: 600;
}

.chapter-summary__next p:last-child {
    margin-bottom: 0;
}

.chapter-summary__actions {
    margin-top: 22px;
    display: flex;
    justify-content: center;
}

.chapter-summary__cta {
    min-width: min(100%, 280px);
}

.nav-confirm-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 10, 33, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    padding: 16px;
}

.nav-confirm-backdrop[hidden] {
    display: none;
}

.nav-confirm-modal {
    width: min(92%, 430px);
    background: #fff;
    border: 2px solid #e2d4fa;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(50, 15, 91, 0.22);
    padding: 18px;
}

.nav-confirm-title {
    margin: 0 0 8px;
    color: var(--brand-purple);
    font-size: 1.25rem;
    font-weight: 800;
    text-align: center;
}

.nav-confirm-text {
    margin: 0 0 16px;
    color: #4b5565;
    text-align: center;
    font-size: 0.96rem;
    line-height: 1.5;
    font-weight: 600;
}

.nav-confirm-secondary {
    margin: 0 0 16px;
    color: #4b5565;
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.55;
    font-weight: 600;
}

.nav-confirm-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    /* Neutralize Bootstrap's .modal-footer skin (class added for structure). */
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.nav-confirm-actions > * {
    margin: 0;
}

.confirm-btn {
    border: none;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 0.95rem;
    font-weight: 800;
    min-width: 120px;
    cursor: pointer;
    font-family: inherit;
}

.confirm-btn-primary {
    background: var(--brand-yellow);
    color: var(--brand-purple);
}

.confirm-btn-secondary {
    background: #ececf3;
    color: #4b5565;
}

.instructions-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 20px 20px 0;
}

.chapter-page.instructions-page {
    padding: 20px;
    box-sizing: border-box;
}

.instructions-page .chapter-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
}

.instructions-page__header {
    flex-shrink: 0;
    width: 100%;
}

.instructions-sub-nav {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.instructions-footer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
}

.instructions-sub-nav .back-step-btn {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: 2px solid var(--brand-purple);
    border-radius: 50%;
    background: #fff;
    color: var(--brand-purple);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
    box-shadow: 0 4px 14px rgba(50, 15, 91, 0.12);
    font-family: inherit;
}

.instructions-sub-nav .back-step-btn:hover {
    background: #f5f0fc;
    border-color: #5a2d8a;
    transform: translateY(-1px);
}

.instructions-sub-nav .back-step-btn:focus-visible {
    outline: 3px solid rgba(50, 15, 91, 0.35);
    outline-offset: 3px;
}

.action-button--secondary {
    background: #fff;
    color: var(--brand-purple);
    border: 2px solid var(--brand-purple);
}

.action-button--secondary:hover {
    background: #f5f0fc;
    color: var(--brand-purple);
}

@media (max-width: 768px) {
    :root {
        /* Mobile value of the single geometry source — applies to ALL
           chapter and practice pages so the toolbar sits identically. */
        --chapter-page-padding: 12px;
    }

    .instructions-page {
        padding: 10px 12px 0;
    }

    .chapter-page.instructions-page {
        padding: 10px 12px;
    }

    .instructions-page .chapter-shell {
        min-height: calc(100vh - 24px);
        max-height: calc(100vh - 24px);
    }

    .instructions-footer-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .instructions-footer-actions .action-button {
        width: 100%;
    }

    .emergency-model-intro {
        flex-direction: column;
        align-items: stretch;
        height: auto;
        max-height: none;
    }

    .emergency-model-intro__image-wrap,
    .emergency-model-intro__image {
        max-width: 100%;
    }

    .chapter-progress {
        gap: 8px;
    }

    .progress-item {
        font-size: 0.88rem;
        padding: 9px 4px;
    }

    .interaction-panel,
    .video-placeholder-body {
        padding: 16px;
    }

    .nav-confirm-actions {
        flex-direction: column;
    }

    .confirm-btn {
        width: 100%;
    }

    .video-flanked-nav-step {
        --flanked-nav-arrow-size: 46px;
        --flanked-nav-arrow-gap: clamp(10px, 2.5vw, 14px);
    }

    .chapter-page {
        --flanked-nav-arrow-size: 46px;
        --flanked-nav-arrow-gap: clamp(10px, 2.5vw, 14px);
    }

    .video-flanked-nav-step__back.back-step-btn,
    .video-flanked-nav-step__next.next-step-btn {
        width: 46px;
        height: 46px;
    }

    .video-overlay-flanked-nav {
        gap: 10px;
        padding-inline: 4px;
    }

    .video-overlay-flanked-nav__side {
        padding-bottom: 0;
        align-items: flex-end;
    }

    .video-overlay-flanked-nav__back.back-step-btn {
        width: 46px;
        height: 46px;
    }


    .chapter-summary--wide:not(.chapter-summary--accordion) .chapter-summary__list {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Unified fixed placement for the step navigation arrows.
   Product decision: everywhere in the course, the BACK arrow sits
   in the extreme bottom-RIGHT corner of the screen and the NEXT
   arrow in the extreme bottom-LEFT corner — identical on every
   step and page. Only the buttons' geometry is overridden here;
   all click logic, disabled states, tooltips and the ready-pulse
   animation are untouched. z-index stays below every popup
   overlay (lowest overlay z-index in the project is 60).
   ============================================================ */
.back-step-btn {
    position: fixed !important;
    bottom: 18px !important;
    right: 18px !important;
    left: auto !important;
    top: auto !important;
    margin: 0 !important;
    z-index: 40;
}

.next-step-btn {
    position: fixed !important;
    bottom: 18px !important;
    left: 18px !important;
    right: auto !important;
    top: auto !important;
    margin: 0 !important;
    z-index: 40;
}

/* Explicit continue button in the chat-sim personalization step —
   sits directly under the name input, full width of the name column */
.chat-sim__setup-continue {
    margin-top: 14px;
    display: block;
    width: 100%;
    box-sizing: border-box;
}

.chat-sim__setup-continue:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* In-panel "בחירה" submit button on selection screens (reflection stages,
   post-video checklists) — replaces the next arrow as the submit control */
.reflection-stage-submit {
    margin-top: 18px;
    align-self: center;
    min-width: 220px;
    font-size: 1.05rem;
}

.reflection-stage-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* "המשך" button inside the feedback overlay popup — the popup no longer
   auto-dismisses; the learner closes it explicitly */
.reflection-overlay-continue {
    display: block;
    margin: 18px auto 0;
    min-width: 200px;
    font-size: 1.05rem;
}

/* Every enabled next arrow pulses green so it is always obvious when it
   is active (lecturer request — project-wide) */
.next-step-btn:not(:disabled) {
    animation: nextArrowReadyPulse 2.4s ease-in-out infinite;
    background: #eafbf1;
    border-color: #22c55e;
}

.next-step-btn:not(:disabled) .next-step-icon {
    color: #15803d;
}

.next-step-btn:hover:not(:disabled) {
    background: #d9f5e5;
    border-color: #16a34a;
}

@media (prefers-reduced-motion: reduce) {
    .next-step-btn:not(:disabled) {
        animation: none;
        box-shadow:
            0 4px 14px rgba(50, 15, 91, 0.12),
            0 0 0 3px rgba(34, 197, 94, 0.35);
    }
}

/* ============================================================
   Lecturer round 3 — readable line length: no text line runs
   longer than ~15 words anywhere (max-width in ch units caps
   the measure; layout/centering preserved).
   ============================================================ */
.env-lead,
.u4-select-lead,
.interaction-instruction,
.interaction-subinstruction,
.scenario-text,
.scenario-question,
.u4-final-summary__lead,
.u4-intro-body p,
.nav-confirm-text,
.chapter-summary__next p,
.chat-sim__activity-explanation p,
.post-video-experience__question,
.post-video-experience__subheading,
.post-video-experience__supporting {
    max-width: min(100%, 72ch);
    margin-inline: auto;
}

/* Right-aligned running text: cap the measure, keep the block
   anchored to the right (RTL inline-start) */
.chapter-summary__item-body p,
.reflection-experience__intro p,
.snap-formative-feedback__body p {
    max-width: 72ch;
    margin-inline-end: auto;
}

/* Lecturer round 4 — the guided-imagery subheading reads right-aligned:
   anchor its capped box to the right (RTL inline-start), overriding the
   centered measure-cap group above. */
.post-video-experience__subheading {
    margin-inline: 0 auto;
    text-align: right;
}

/* ============================================================
   Systemic widow/orphan control (lecturer UX round):
   `pretty` avoids a lone word on the last line of running text,
   `balance` evens out short headings. Unsupported browsers
   simply ignore these — no fallback needed, no layout risk.
   ============================================================ */
p,
li,
dt,
dd,
label,
figcaption,
blockquote,
.chat-sim__bubble,
.option-card,
.scenario-option,
.reflection-check-row,
.reflection-card,
.snap-formative-feedback__body,
.reflection-experience__overlay-text,
.reframe-feedback-text,
.u4-summary-option,
.practice-modal-option-label,
.customer-crm-row dd {
    text-wrap: pretty;
}

h1,
h2,
h3,
h4,
h5,
h6,
legend,
.u4-card-title,
.u4-card-sub,
.focus-name,
.gender-name,
.scenario-text,
.chapter-summary__title {
    text-wrap: balance;
}
