/* Плаващ widget (долу вляво) */
.bug-report-portal {
    position: fixed;
    left: 1rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px));
    z-index: 11010;
    pointer-events: none;
}

.bug-report-portal .bug-report-fab,
.bug-report-portal .pnv-modal {
    pointer-events: auto;
}

.bug-report-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    min-height: 3rem;
    padding: 0 0.9rem 0 0.7rem;
    border: none;
    border-radius: 999px;
    background: #c41e3a;
    color: #fff;
    box-shadow: 0 4px 18px rgba(196, 30, 58, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bug-report-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(196, 30, 58, 0.55);
}

.bug-report-fab:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.bug-report-fab__icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.bug-report-fab__label {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.bug-report-portal .pnv-modal {
    position: fixed;
    inset: 0;
    z-index: 11020;
}

/* —— Модал / форма —— */
.bug-report-modal__dialog {
    max-width: 480px;
    max-height: calc(100vh - 40px);
    max-height: calc(100dvh - 40px);
}

.bug-report-modal .pnv-modal__content {
    display: flex;
    flex-direction: column;
    max-height: inherit;
    min-height: 0;
}

.bug-report-modal .pnv-modal__header,
.bug-report-modal .pnv-modal__footer {
    flex-shrink: 0;
}

.bug-report-modal .pnv-modal__body.bug-report-form {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0 20px 8px;
}

.bug-report-form__lead {
    margin: 0 0 1rem;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgba(240, 244, 250, 0.88);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.bug-report-form__fields {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.bug-report-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0;
}

.bug-report-field__label {
    display: block;
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.92);
}

.bug-report-field__req {
    color: #ff6b7a;
    font-weight: 700;
}

.bug-report-field__hint {
    font-size: 0.75rem;
    line-height: 1.4;
    color: rgba(240, 244, 250, 0.5);
}

.bug-report-field__error {
    display: block;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    font-weight: 500;
    color: #ff8a94;
}

.bug-report-field__error[hidden] {
    display: none;
}

.bug-report-field--invalid .bug-report-input {
    border-color: rgba(255, 107, 122, 0.75);
    box-shadow: 0 0 0 2px rgba(255, 107, 122, 0.2);
}

.bug-report-input--readonly {
    opacity: 1;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.03);
    color: rgba(240, 244, 250, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
}

.bug-report-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.45;
    color: #f0f4fa;
    background: rgba(0, 0, 0, 0.28);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bug-report-input::placeholder {
    color: rgba(240, 244, 250, 0.38);
}

.bug-report-input:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.bug-report-input:focus {
    outline: none;
    border-color: rgba(196, 30, 58, 0.65);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.22);
}

.bug-report-input--area {
    min-height: 7.5rem;
    resize: vertical;
}

select.bug-report-input {
    appearance: none;
    padding-right: 2.25rem;
    min-height: 44px;
    cursor: pointer;
    color-scheme: light;
    background-color: rgba(255, 255, 255, 0.08);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23aab4c4' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
}

select.bug-report-input option {
    color: #0d1117;
    background-color: #f0f4fa;
}

select.bug-report-input option:checked,
select.bug-report-input option:hover,
select.bug-report-input option:focus {
    color: #0d1117;
    background-color: #e2e8f0;
}

.bug-report-status {
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.45;
}

.bug-report-status--ok {
    background: rgba(46, 125, 50, 0.2);
    border: 1px solid rgba(76, 175, 80, 0.35);
    color: #a5d6a7;
}

.bug-report-success-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 11rem;
    padding: 1.5rem 1.25rem;
    text-align: center;
}

.bug-report-success-panel__text {
    margin: 0;
    padding: 0.85rem 1rem;
    max-width: 28rem;
    border-radius: 10px;
    font-size: 1rem;
    line-height: 1.55;
    font-weight: 600;
    color: #a5d6a7;
    background: rgba(46, 125, 50, 0.22);
    border: 1px solid rgba(76, 175, 80, 0.45);
}

.bug-report-modal--success .pnv-modal__header,
.bug-report-modal--success [data-bug-report-edit-panel],
.bug-report-modal--success [data-bug-report-footer] {
    display: none !important;
}

.bug-report-modal--success [data-bug-report-success-panel] {
    display: flex !important;
}

.bug-report-modal--success .pnv-modal__body {
    padding-bottom: 1.25rem;
}

.bug-report-status--err {
    background: rgba(183, 28, 28, 0.18);
    border: 1px solid rgba(244, 67, 54, 0.35);
    color: #ef9a9a;
}

.bug-report-form__footer {
    gap: 0.65rem;
}

.bug-report-form__footer .btn {
    min-height: 42px;
    padding: 0 1.1rem;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 8px;
}

/* Мобилен: FAB в ъгъла, не върху текста на footer */
@media (max-width: 768px) {
    .bug-report-portal {
        left: max(0.65rem, env(safe-area-inset-left, 0px));
        bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
    }

    .bug-report-fab__label {
        display: none;
    }

    .bug-report-fab {
        width: 3.1rem;
        height: 3.1rem;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .bug-report-modal {
        padding:
            max(10px, env(safe-area-inset-top, 0px))
            10px
            max(10px, env(safe-area-inset-bottom, 0px));
        align-items: center;
        justify-content: center;
    }

    .bug-report-modal__dialog {
        max-width: none;
        width: 100%;
        max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .bug-report-modal .pnv-modal__content {
        max-height: calc(100dvh - 20px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
        border-radius: 14px;
    }

    .bug-report-form__lead {
        margin-bottom: 0.75rem;
        padding: 0.5rem 0.65rem;
        font-size: 0.8125rem;
    }

    .bug-report-form__fields {
        gap: 0.85rem;
    }

    .bug-report-input--area {
        min-height: 5rem;
        max-height: 8rem;
    }

    .bug-report-form__footer {
        flex-direction: column-reverse;
        padding-top: 12px;
    }

    .bug-report-form__footer .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .bug-report-portal {
        bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
    }
}
