.bug-report-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(var(--ink-rgb), 0.78);
}

.bug-report-overlay[hidden] {
    display: none;
}

.bug-report-dialog {
    position: relative;
    width: min(35rem, 100%);
    /* Audit #4453 (BUG-3220): 100vh is the LARGE viewport on mobile browsers — it excludes the retracting URL bar, so
       the dialog could stand taller than the screen actually showing it and put the submit
       button off the bottom. dvh tracks the visible viewport; the vh line stays first as the
       fallback for browsers without dynamic units. */
    max-height: calc(100vh - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    padding: 1.375rem;
    color: var(--theme-text);
    background: var(--theme-surface-raised);
    border: 1px solid var(--theme-rule-strong);
    border-radius: var(--radius-lg);
    box-shadow: 0 1.25rem 3.75rem rgba(var(--ink-rgb), 0.45);
}

.bug-report-dialog h2 {
    /* Audit #4453 fixes BUG-3220. The gap is room for .bug-report-close, which is anchored with inset-inline-end and so
       mirrors under RTL. As a physical `margin-right` this gap did not, leaving the heading
       running underneath the close button in Arabic and Urdu. Identical computed result in the
       20 LTR locales. */
    margin-block: 0 1rem;
    margin-inline: 0 2.25rem;
}

.bug-report-dialog > form > label {
    display: grid;
    gap: 0.375rem;
    margin: 0.75rem 0;
    font-size: 0.875rem;
}

.bug-report-dialog input,
.bug-report-dialog textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 0.625rem;
    color: inherit;
    font: inherit;
    background: var(--theme-veil);
    border: 1px solid var(--theme-rule-strong);
    border-radius: var(--radius-sm);
}

.bug-report-dialog input:focus-visible,
.bug-report-dialog textarea:focus-visible,
.bug-report-dialog button:focus-visible {
    outline: 2px solid var(--theme-primary);
    outline-offset: 2px;
}

.bug-report-type {
    display: flex;
    gap: 1.125rem;
    padding: 0;
    margin: 0 0 0.5rem;
    border: 0;
}

.bug-report-type label {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.bug-report-type input {
    width: auto;
}

.bug-report-close {
    position: absolute;
    inset-block-start: 0.75rem;
    inset-inline-end: 0.875rem;
    color: inherit;
    font-size: 1.625rem;
    background: transparent;
    border: 0;
    cursor: pointer;
}

/* Audit #4452 (BUG-3208): the form's own explanatory copy — what the form is for, and what is
   attached to a report automatically. Neither existed while the labels were scavenged. */
.bug-report-intro,
.bug-report-privacy {
    margin-block: 0 0.75rem;
    color: var(--theme-text-muted);
    font-size: 0.8125rem;
    line-height: 1.5;
}

.bug-report-privacy {
    margin-block-start: 0.75rem;
}

/* IMP-0761: dictation. Hidden until bug-report.js confirms the browser can actually do it. */
.bug-report-mic {
    margin-block: 0 0.25rem;
    padding: 0.25rem 0;
    color: var(--theme-accent);
    font-size: 0.8125rem;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.bug-report-mic[hidden] {
    display: none;
}

.bug-report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.625rem;
    margin-top: 1rem;
}

.bug-report-actions button,
.support-bug-report {
    padding: 0.5625rem 0.8125rem;
    color: var(--theme-primary);
    background: transparent;
    border: 1px solid var(--theme-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.bug-report-actions [type="submit"] {
    color: var(--ink);
    background: var(--theme-primary);
}

.bug-report-actions button:disabled {
    opacity: 0.55;
    cursor: wait;
}

#bugReportStatus {
    min-height: 1.25rem;
    margin-top: 0.625rem;
}

.support-bug-report {
    width: 100%;
    margin-bottom: 0.5rem;
}

@media (max-width: 34rem) {
    .bug-report-actions {
        flex-direction: column-reverse;
    }

    .bug-report-actions button {
        width: 100%;
    }
}
