.baptiste.modal {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease;
}

.baptiste.modal.show {
    opacity: 1;
    pointer-events: all;
}

.baptiste.modal .modal-panel {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 80rem;
    width: fit-content;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform .3s ease, opacity .3s ease;
    opacity: 0;
    max-height: 50rem;
    overflow-y: scroll;
    scrollbar-color: rgba(62, 62, 62, 0.2) transparent;
}

.baptiste.modal.small .modal-panel {
    max-width: 50rem;
}

.baptiste.modal.show .modal-panel {
    transform: scale(1);
    opacity: 1;
}


/* Adaptation pour mobile */
@media (max-width: 768px) {
    .baptiste.modal {
        padding: 1rem; /* Éviter que le modal ne touche les bords */
    }
    .baptiste.modal .modal-panel {
        -webkit-overflow-scrolling: touch; /* Pour iOS */
    }
    .baptiste.modal .modal-panel * {
        max-width: 100%;
        box-sizing: border-box;
    }
    .baptiste.modal .modal-panel {
        width: 95% !important; /* Force l'écrasement du fit-content */
        max-width: none;
        margin: 1rem;
        padding: 1rem;
        max-height: 90vh;
        box-sizing: border-box;
        overflow-x: hidden;
    }
}