/* Module beta-reporting — bouton BUG flottant */
.beta-bug-fab {
    position: fixed;
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: max(88px, calc(72px + env(safe-area-inset-bottom, 0px)));
    z-index: 99960;
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    opacity: 0.88;
    filter: drop-shadow(0 8px 16px rgba(53, 39, 26, 0.28));
    transition: transform 0.15s ease, opacity 0.15s ease, filter 0.15s ease;
}
.beta-bug-fab:hover {
    opacity: 1;
    filter: drop-shadow(0 10px 20px rgba(53, 39, 26, 0.34));
}
.beta-bug-fab:active { transform: scale(0.96); }
.beta-bug-fab.is-busy { opacity: 0.55; pointer-events: none; }
.beta-bug-fab.is-sent { opacity: 1; transform: scale(1.06); }
.beta-bug-fab__img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: transparent;
    pointer-events: none;
}
.beta-bug-fab__fallback {
    display: none;
    width: 64px;
    height: 64px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(192, 227, 159, 0.85);
    color: #35271A;
    font-family: Nunito, system-ui, -apple-system, sans-serif;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.beta-bug-fab.is-fallback .beta-bug-fab__img { display: none; }
.beta-bug-fab.is-fallback .beta-bug-fab__fallback { display: flex; }

html.cafe-native-android .beta-bug-fab {
    right: 14px;
    bottom: 88px;
}

.beta-bug-modal[hidden],
.beta-bug-fab[hidden] { display: none !important; }

.beta-bug-modal {
    position: fixed;
    inset: 0;
    z-index: 99970;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
}
html.cafe-native-android .beta-bug-modal {
    padding-bottom: 16px;
}
.beta-bug-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(53, 39, 26, 0.35);
}
.beta-bug-modal__panel {
    position: relative;
    width: min(440px, 100%);
    box-sizing: border-box;
    height: auto;
    max-height: calc(100% - 32px);
    overflow: auto;
    border-radius: 22px;
    background: #FCF9F0;
    border: 1px solid rgba(53, 39, 26, 0.12);
    box-shadow: 0 18px 48px rgba(53, 39, 26, 0.22);
    padding: 18px 16px 16px;
    font-family: Nunito, system-ui, -apple-system, sans-serif;
    color: #35271A;
}
.beta-bug-modal__content {
    min-width: 0;
}
.beta-bug-modal__form-area {
    min-width: 0;
}
.beta-bug-modal__title {
    margin: 0 0 6px;
    font-size: 1.2rem;
    font-weight: 800;
}
.beta-bug-modal__hint {
    margin: 0 0 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    color: rgba(53, 39, 26, 0.62);
}
.beta-bug-modal__preview-wrap {
    margin: 0 0 12px;
    border-radius: 14px;
    overflow: hidden;
    background: rgba(53, 39, 26, 0.06);
    border: 1px solid rgba(53, 39, 26, 0.1);
    min-height: 80px;
}
.beta-bug-modal__preview {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    background: #fff;
}
.beta-bug-modal__preview[hidden],
.beta-bug-modal__fallback[hidden] {
    display: none !important;
}
.beta-bug-modal__fallback {
    margin: 0;
    padding: 18px 12px;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(53, 39, 26, 0.55);
}
.beta-bug-modal__label {
    display: block;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.beta-bug-modal__textarea {
    width: 100%;
    min-height: 110px;
    resize: vertical;
    border-radius: 14px;
    border: 1px solid rgba(53, 39, 26, 0.16);
    background: #fff;
    padding: 12px;
    font-family: inherit;
    font-size: 16px;
    color: #35271A;
    box-sizing: border-box;
}
.beta-bug-modal__textarea:focus {
    outline: none;
    border-color: rgba(158, 189, 243, 0.9);
    box-shadow: 0 0 0 3px rgba(158, 189, 243, 0.35);
}
.beta-bug-modal__error {
    margin: 8px 0 0;
    color: #7f1d1d;
    font-size: 0.85rem;
    font-weight: 700;
}
.beta-bug-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}
.beta-bug-btn {
    flex: 1;
    min-height: 46px;
    border-radius: 999px;
    border: 0;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    cursor: pointer;
}
.beta-bug-btn--ghost {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(53, 39, 26, 0.14);
    color: #35271A;
}
.beta-bug-btn--primary {
    background: #35271A;
    color: #fff;
}
.beta-bug-btn:disabled { opacity: 0.55; cursor: wait; }

/* Ne pas capturer le FAB / modal */
.beta-bug-fab.beta-bug-capture-hide,
.beta-bug-modal.beta-bug-capture-hide {
    visibility: hidden !important;
}

@media (min-width: 600px) and (max-height: 650px) {
    .beta-bug-modal {
        align-items: center;
        padding: 12px;
    }

    html.cafe-native-android .beta-bug-modal {
        padding: 12px;
    }

    .beta-bug-modal__panel {
        width: min(760px, 100%);
        max-height: calc(100% - 24px);
        padding: 14px;
    }

    .beta-bug-modal__hint {
        margin-bottom: 10px;
    }

    .beta-bug-modal__content {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr);
        gap: 14px;
        align-items: start;
    }

    .beta-bug-modal__preview-wrap {
        margin: 0;
        min-height: 150px;
    }

    .beta-bug-modal__preview {
        max-height: 265px;
    }

    .beta-bug-modal__textarea {
        min-height: 88px;
        resize: none;
    }

    .beta-bug-modal__actions {
        margin-top: 10px;
    }
}
