/* ── Bug Report Widget (centered modal) ─────────────────────────────────────── */

/* Clickable error wrapper */
.brw-error-clickable {
    cursor: pointer;
    position: relative;
    transition: opacity 150ms;
}

.brw-error-clickable:hover { opacity: 0.85; }

.brw-click-hint {
    display: block;
    font-size: 11px;
    color: #9CA3AF;
    margin-top: 4px;
}

/* Backdrop */
.brw-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 8999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: brw-fade-in 0.2s ease;
}

/* Centered modal panel */
.brw-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 480px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    z-index: 9000;
    max-height: 85vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    animation: brw-scale-in 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes brw-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes brw-scale-in {
    from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@media (max-width: 640px) {
    .brw-panel {
        max-width: calc(100% - 32px);
        border-radius: 16px;
    }
}

.brw-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #F3F4F6;
    flex-shrink: 0;
}

.brw-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
}

.brw-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #F3F4F6;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s;
}

.brw-close-btn:hover { background: #E5E7EB; }

.brw-body {
    padding: 20px 24px;
    overflow-y: auto;
    flex: 1;
}

/* Context summary bar */
.brw-context-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    background: #F9FAFB;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 11px;
    color: #6B7280;
}

.brw-context-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: #EFEFEF;
    border-radius: 20px;
    font-size: 11px;
    color: #374151;
}

/* Captured error banner */
.brw-captured-error {
    padding: 10px 12px;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 8px;
    font-size: 12px;
    color: #991B1B;
    margin-bottom: 12px;
}

/* Severity pills */
.brw-severity-row {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.brw-severity-btn {
    flex: 1;
    padding: 8px 4px;
    border-radius: 8px;
    border: 2px solid transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s, background 0.15s;
    background: #F3F4F6;
    color: #6B7280;
}

.brw-severity-btn:hover { background: #E5E7EB; }

.brw-severity-btn--low.brw-severity-btn--active {
    border-color: #22C55E;
    background: #F0FDF4;
    color: #166534;
}

.brw-severity-btn--medium.brw-severity-btn--active {
    border-color: #EAB308;
    background: #FEFCE8;
    color: #713F12;
}

.brw-severity-btn--high.brw-severity-btn--active {
    border-color: #F97316;
    background: #FFF7ED;
    color: #9A3412;
}

.brw-severity-btn--critical.brw-severity-btn--active {
    border-color: #EF4444;
    background: #FEF2F2;
    color: #991B1B;
}

/* Form fields */
.brw-form-group {
    margin-bottom: 14px;
}

.brw-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 5px;
}

.brw-input,
.brw-textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
    font-family: inherit;
    resize: vertical;
}

.brw-input:focus,
.brw-textarea:focus { border-color: #6366f1; }

.brw-textarea { min-height: 80px; }

/* Footer */
.brw-footer {
    padding: 14px 24px 20px;
    border-top: 1px solid #F3F4F6;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    flex-shrink: 0;
}

.brw-btn-cancel {
    padding: 9px 20px;
    border-radius: 8px;
    border: 1.5px solid #E5E7EB;
    background: transparent;
    color: #6B7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.brw-btn-cancel:hover { background: #F3F4F6; }

.brw-btn-submit {
    padding: 9px 20px;
    border-radius: 8px;
    border: none;
    background: #6366f1;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.brw-btn-submit:hover:not(:disabled) { opacity: 0.88; }
.brw-btn-submit:disabled { opacity: 0.5; cursor: not-allowed; }

/* Success state */
.brw-success {
    padding: 32px 24px;
    text-align: center;
}

.brw-success-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.brw-success-title {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 6px;
}

.brw-success-subtitle {
    font-size: 13px;
    color: #6B7280;
}

/* ── Report button on error toasts ──────────────────────────────────────────── */
.sub-toast-report {
    background: transparent;
    border: 1px solid rgba(153, 27, 27, 0.3);
    border-radius: 4px;
    color: inherit;
    font-size: 11px;
    padding: 2px 8px;
    cursor: pointer;
    margin-left: 4px;
    opacity: 0.8;
    transition: opacity 150ms;
    white-space: nowrap;
    flex-shrink: 0;
}

.sub-toast-report:hover { opacity: 1; }
