#gm-statistics-dialog {
    width: min(36rem, calc(100% - 2rem));
    border: 1px solid var(--gm-border);
    border-radius: var(--gm-radius-md);
    padding: 2rem 1.5rem 1.5rem;
    color: var(--gm-text);
    background: var(--gm-surface-strong, #fffdfa);
    box-sizing: border-box;
    max-height: calc(100% - 2rem);
}

#gm-statistics-title {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.3;
}

#gm-statistics-title:focus {
    outline: none;
}

.gm-statistics-intro {
    --gm-statistics-line-height: 1.45em;
    display: flow-root;
    line-height: var(--gm-statistics-line-height);
    margin-top: calc(2 * var(--gm-statistics-line-height) + .25rem);
}

#gm-statistics-description {
    margin: 0;
}

.gm-statistics-mascot {
    float: left;
    width: calc(5 * var(--gm-statistics-line-height));
    height: calc(5 * var(--gm-statistics-line-height));
    /* Use the transparent right and bottom padding for close, two-line wrapping. */
    margin: calc(-2.5 * var(--gm-statistics-line-height)) calc(.25rem + 1px) calc(-.5 * var(--gm-statistics-line-height) + 2px) 0;
    transform: translateX(-2px);
    object-fit: contain;
    shape-outside: inset(0 calc(.5 * var(--gm-statistics-line-height)) calc(.5 * var(--gm-statistics-line-height)) 0);
    shape-margin: .375rem;
}

#gm-statistics-dialog p {
    line-height: 1.45;
}

#gm-statistics-dialog [hidden] {
    display: none;
}

#gm-statistics-dialog::backdrop {
    background: rgb(0 0 0 / 30%);
}

.gm-statistics-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.gm-statistics-actions button {
    flex: 1;
    min-height: 44px;
    padding: .6rem 1rem;
    border: 1px solid #ab1530;
    border-radius: 5px;
    background: #ab1530;
    color: white;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.gm-statistics-actions button:focus-visible {
    outline: 2px solid var(--gm-accent, #ab1530);
    outline-offset: 3px;
}

.gm-statistics-actions button:not(:disabled):hover {
    background: #8f1028;
}

.gm-statistics-actions button[data-statistics-choice='false'] {
    border-color: #929292;
    background: #e2e2e2;
    color: #252525;
}

.gm-statistics-actions button[data-statistics-choice='false']:not(:disabled):hover {
    background: #d2d2d2;
}

.gm-statistics-actions button:disabled {
    cursor: default;
}

#gm-statistics-feedback {
    min-height: 1.5rem;
    margin: .75rem 0 0;
}

#gm-statistics-feedback:empty {
    min-height: 0;
    margin-top: 0;
}

.gm-statistics-details {
    margin-top: 1rem;
}

.gm-statistics-details a {
    text-decoration: underline;
    text-underline-offset: .15em;
}

.gm-statistics-details a:hover {
    text-decoration-thickness: 2px;
}

.gm-statistics-details summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 44px;
    cursor: pointer;
    list-style: none;
}

.gm-statistics-details summary::-webkit-details-marker {
    display: none;
}

.gm-statistics-details summary .flexicon {
    flex: 0 0 16px;
}

.gm-statistics-details[open] summary .flexicon {
    transform: rotate(180deg);
}

.gm-statistics-close {
    margin-top: .5rem;
    min-height: 44px;
    padding: .5rem;
    border: 1px solid var(--gm-border);
    border-radius: 5px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.gm-statistics-details summary:hover,
.gm-statistics-close:not(:disabled):hover {
    background: var(--gm-bg-soft, #f7f1ea);
}

.gm-statistics-details summary:focus-visible,
.gm-statistics-close:focus-visible {
    outline: 2px solid var(--gm-accent, #ab1530);
    outline-offset: 3px;
}

.gm-statistics-close:disabled {
    cursor: default;
}

@media (max-width: 380px) {
    #gm-statistics-dialog .gm-statistics-actions {
        flex-direction: column;
        align-items: stretch;
    }
}

#statistics-browser-feedback {
    min-height: 2lh;
    margin-bottom: 0;
}
