/* =========================================================
   PAV MDG — AIDE & TUTORIEL CONTEXTUEL
   ========================================================= */

.pav-help-launcher {
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 7000;
    min-width: 58px;
    height: 42px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #ffcc00;
    border-radius: 999px;
    background: #080808;
    color: #ffcc00;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .24);
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.pav-help-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .30);
}

.pav-help-launcher:focus-visible,
.pav-help-panel button:focus-visible,
.pav-guide-tooltip button:focus-visible {
    outline: 3px solid rgba(255, 204, 0, .40);
    outline-offset: 3px;
}

.pav-help-launcher__mark {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #ffcc00;
    color: #080808;
    font-size: 14px;
    line-height: 1;
}

.pav-help-panel {
    position: fixed;
    right: 22px;
    bottom: 144px;
    z-index: 8000;
    width: min(360px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid rgba(255, 204, 0, .55);
    border-radius: 18px;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .30);
    transform-origin: bottom right;
    animation: pavGuidePanelIn .18s ease-out;
}

@keyframes pavGuidePanelIn {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pav-help-panel[hidden],
.pav-guide-spotlight[hidden],
.pav-guide-tooltip[hidden] {
    display: none !important;
}

.pav-help-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 18px 15px;
    border-bottom: 3px solid #ffcc00;
    background: #0b0b0b;
    color: #ffffff;
}

.pav-help-panel__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #ffcc00;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.pav-help-panel__title {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
}

.pav-help-panel__close {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font-size: 19px;
    cursor: pointer;
}

.pav-help-panel__body {
    padding: 14px;
}

.pav-help-panel__intro {
    margin: 0 2px 12px;
    color: #565656;
    font-size: 13px;
    line-height: 1.5;
}

.pav-help-choice {
    width: 100%;
    display: grid;
    grid-template-columns: 38px 1fr 18px;
    align-items: center;
    gap: 10px;
    margin: 8px 0 0;
    padding: 12px;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    background: #ffffff;
    color: #111111;
    text-align: left;
    font: inherit;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.pav-help-choice:hover {
    border-color: #ffcc00;
    background: #fffdf2;
    transform: translateY(-1px);
}

.pav-help-choice__number {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #111111;
    color: #ffcc00;
    font-size: 13px;
    font-weight: 900;
}

.pav-help-choice__text strong {
    display: block;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 900;
}

.pav-help-choice__text span {
    display: block;
    color: #6b6b6b;
    font-size: 11px;
    line-height: 1.35;
}

.pav-help-choice__arrow {
    color: #8a8a8a;
    font-size: 18px;
    line-height: 1;
}

.pav-guide-spotlight {
    position: fixed;
    z-index: 90000;
    border: 3px solid #ffcc00;
    border-radius: 12px;
    background: transparent;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .72), 0 0 0 6px rgba(255, 204, 0, .16);
    pointer-events: none;
    transition: top .22s ease, left .22s ease, width .22s ease, height .22s ease;
}

.pav-guide-spotlight.is-general {
    inset: 0 !important;
    width: 0 !important;
    height: 0 !important;
    border: 0;
    border-radius: 0;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .72);
}

.pav-guide-tooltip {
    position: fixed;
    z-index: 90002;
    width: min(360px, calc(100vw - 28px));
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 204, 0, .80);
    border-radius: 16px;
    background: #ffffff;
    color: #111111;
    box-shadow: 0 22px 55px rgba(0, 0, 0, .38);
}

.pav-guide-tooltip.is-general {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
}

.pav-guide-tooltip__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    background: #0b0b0b;
    color: #ffffff;
}

.pav-guide-tooltip__counter {
    color: #ffcc00;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.pav-guide-tooltip__skip {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: #cfcfcf;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.pav-guide-tooltip__content {
    padding: 16px 16px 14px;
}

.pav-guide-tooltip__title {
    margin: 0 0 7px;
    color: #111111;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.25;
}

.pav-guide-tooltip__text {
    margin: 0;
    color: #565656;
    font-size: 13px;
    line-height: 1.55;
}

.pav-guide-tooltip__text strong {
    color: #111111;
}

.pav-guide-tooltip__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px 16px;
}

.pav-guide-btn {
    min-height: 38px;
    padding: 9px 14px;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.pav-guide-btn--back {
    border: 1px solid #dadada;
    background: #ffffff;
    color: #333333;
}

.pav-guide-btn--next {
    margin-left: auto;
    border: 1px solid #ffcc00;
    background: #ffcc00;
    color: #080808;
}

html.pav-guide-open,
body.pav-guide-open {
    scroll-behavior: auto !important;
}

@media (max-width: 768px) {
    .pav-help-launcher {
        right: 16px;
        bottom: 82px;
        min-width: 54px;
        height: 40px;
        padding: 0 12px;
        font-size: 12px;
    }

    .pav-help-panel {
        right: 16px;
        bottom: 132px;
        width: calc(100vw - 32px);
    }

    .pav-guide-tooltip,
    .pav-guide-tooltip.is-general {
        top: auto !important;
        right: 12px !important;
        bottom: 12px !important;
        left: 12px !important;
        width: auto;
        transform: none;
    }

    .pav-guide-spotlight {
        border-width: 2px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pav-help-panel,
    .pav-help-launcher,
    .pav-guide-spotlight,
    .pav-help-choice {
        animation: none !important;
        transition: none !important;
    }
}

/* =========================================================
   V3 — CORRECTION DE LA SURBRILLANCE SUR MOBILE
   ========================================================= */
@media (max-width: 768px) {
    /* Le cadre suit immédiatement sa cible pendant le scroll mobile. */
    .pav-guide-spotlight {
        transition: none !important;
    }

    /* Évite qu'une bulle haute déborde sur les petits écrans. */
    .pav-guide-tooltip,
    .pav-guide-tooltip.is-general {
        bottom: max(12px, env(safe-area-inset-bottom)) !important;
        max-height: calc(100dvh - 24px);
    }

    .pav-guide-tooltip__content {
        max-height: 42vh;
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}


/* =========================================================
   V4 — REPÈRE VISUEL MOBILE + CADRES SUR CONTRÔLES EXACTS
   ========================================================= */
.pav-guide-spotlight {
    box-sizing: border-box;
}

@media (max-width: 768px) {
    /* Pas d'interpolation : le cadre doit suivre pixel par pixel la vraie cible. */
    .pav-guide-spotlight {
        transition: none !important;
    }
}
