dialog.forest-bf-popup {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    margin: auto;
    padding: 0;
    width: max-content;
    max-width: min(640px, calc(100% - 24px));
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    overscroll-behavior: contain;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #161616;
    box-shadow: 0 12px 48px #0006;
}

dialog.forest-bf-popup::backdrop {
    background: rgb(0 0 0 / 66%);
}

body:has(dialog.forest-bf-popup[open]) {
    overflow: hidden;
}

.forest-bf-popup-panel {
    display: grid;
    justify-items: center;
    min-width: 0;
}

.forest-bf-popup-toolbar {
    display: flex;
    justify-content: flex-end;
    width: 100%;
}

.forest-bf-popup-toolbar button {
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    margin: 2px 4px;
    padding: 0;
    border: 0;
    background: #fff;
    color: #161616;
    font: 400 30px / 1 sans-serif;
    cursor: pointer;
}

.forest-bf-popup :is(button, a):focus-visible {
    outline: 2px solid #315fc1;
    outline-offset: -3px;
}

.forest-bf-popup img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: max(120px, calc(100vh - 124px));
    max-height: max(120px, calc(100dvh - 124px));
    object-fit: contain;
    margin: auto;
}

.forest-bf-popup-link {
    display: grid;
    justify-items: center;
    width: 100%;
    text-decoration: none;
}

.forest-bf-popup-link span {
    display: block;
    margin: 8px 10px 10px;
    padding: 10px 18px;
    border-radius: 5px;
    background: #161616;
    color: #fff;
    font-weight: 600;
}
