/* Self-contained styling for the cross-cutting bug reporter (edge tab + dialog).
   Lives OUTSIDE pa-pages so it may carry fallback colors — the reporter must render on
   themeless layouts (MainLayout loads no ProAuditThemeAssets, so --pa-* tokens are absent
   there). Every color uses var(--pa-*, fallback): it blends into the Audit Journal theme
   where the tokens exist, and stands alone where they don't. */

/* ---- Edge launcher (30 x 40 collapsed, expands left from the viewport edge) ---- */
.br-fab {
    position: fixed;
    right: 0;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    /* Sit BELOW the app's drawers/dialogs (--pa-z-drawer: 1100) so a right-anchored detail panel
       renders OVER the button instead of colliding with it — the FAB tucks away while a panel is
       open and returns when it closes. Still above normal page content. */
    z-index: calc(var(--pa-z-drawer, 1100) - 10);
    width: 30px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    border: none;
    border-radius: 12px 0 0 12px;
    font-family: var(--pa-font-body, 'Figtree', sans-serif);
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--pa-orange-fg, #16120e);
    background: transparent;
    transition: width .22s cubic-bezier(.2, .8, .2, 1);
}

.br-fab__surface {
    display: flex;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: inherit;
    background: var(--pa-orange, #dd9142);
    box-shadow: var(--pa-shadow-btn, -3px 3px 13px rgba(139, 82, 28, .18));
}

.br-fab:focus-visible {
    outline: 2px solid var(--pa-orange-fg, #16120e);
    outline-offset: -3px;
}

.br-fab__icon {
    display: flex;
    flex: 0 0 30px;
    align-items: center;
    justify-content: center;
    height: 40px;
}

.br-fab__icon .mud-icon-root {
    width: 18px;
    height: 18px;
}

.br-fab__label {
    padding: 0 14px 0 4px;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity .12s ease, transform .18s ease;
}

.br-fab:is(:focus-visible, .br-fab--expanded) {
    width: 154px;
}

.br-fab:is(:focus-visible, .br-fab--expanded) .br-fab__label {
    opacity: 1;
    transform: translateX(0);
}

@media (hover: hover) and (pointer: fine) {
    .br-fab:hover {
        width: 154px;
    }

    .br-fab:hover .br-fab__label {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (any-pointer: coarse) {
    /* The visible tab stays small while its transparent hit area reaches 44 x 44. */
    .br-fab::after {
        content: "";
        position: absolute;
        inset: -2px 0 -2px -14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .br-fab,
    .br-fab__label {
        transition: none;
    }
}

/* ---- Dialog ---- */
.br-dialog {
    --br-ink: var(--pa-ink, #191510);
    --br-muted: var(--pa-muted, #706358);
    --br-card: var(--pa-card, #fffaf3);
    --br-hair: var(--pa-hair-strong, #d9cab7);
    --br-orange: var(--pa-orange, #dd9142);
    color: var(--br-ink);
}

.br-dialog__eyebrow {
    display: block;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--pa-orange-deep, #9b672f);
}

.br-dialog__title {
    margin: 2px 0 0;
    font-family: var(--pa-font-display, 'Source Serif 4', Georgia, serif);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--br-ink);
}

.br-field {
    display: block;
    margin-top: 14px;
}

.br-field > span {
    display: block;
    margin-bottom: 5px;
    font-size: .78rem;
    font-weight: 600;
    color: var(--br-muted);
}

.br-input {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--pa-font-body, 'Figtree', sans-serif);
    font-size: .86rem;
    color: var(--br-ink);
    background: var(--br-card);
    border: 1px solid var(--br-hair);
    border-radius: var(--pa-radius-sm, 8px);
    padding: 9px 12px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.br-input:focus {
    border-color: var(--br-orange);
    box-shadow: var(--pa-focus-ring, 0 0 0 3px rgba(221, 145, 66, .18));
}

.br-textarea {
    resize: vertical;
    min-height: 96px;
}

.br-counter {
    display: block;
    margin-top: 4px;
    text-align: right;
    font-size: .72rem;
    color: var(--br-muted);
}

.br-error {
    margin-top: 12px;
    padding: 8px 12px;
    border-radius: var(--pa-radius-sm, 8px);
    font-size: .8rem;
    color: var(--pa-bad-fg, #963d30);
    background: var(--pa-bad-bg, #f8e9e6);
    border: 1px solid var(--pa-bad-border, #c0584a);
}

.br-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.br-btn {
    font-family: var(--pa-font-body, 'Figtree', sans-serif);
    font-size: .84rem;
    font-weight: 700;
    border-radius: var(--pa-radius, 10px);
    padding: 10px 22px;
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background .15s ease, color .15s ease;
}

.br-btn--primary {
    background: var(--br-orange);
    color: var(--pa-orange-fg, #16120e);
    box-shadow: var(--pa-shadow-btn, 0 6px 14px rgba(139, 82, 28, .16));
}

.br-btn--primary:hover {
    background: var(--pa-orange-hover, #d0832f);
}

.br-btn--ghost {
    background: transparent;
    color: var(--pa-orange-deep, #9b672f);
    font-weight: 600;
}

.br-btn--ghost:hover {
    color: var(--br-orange);
}

.br-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}
