/* Opt-in window controls only. Map popups, tooltips and remove/clear actions
   deliberately do not use this class. Keep this stylesheet after page styles. */
.ff-window-close {
    position: absolute !important;
    inset: auto !important;
    top: max(8px, env(safe-area-inset-top)) !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    display: inline-grid;
    place-items: center;
    box-sizing: border-box !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    flex: 0 0 44px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--ff-window-close-color, #24332b) !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transform: none !important;
    filter: none !important;
    cursor: pointer;
    z-index: 30;
}
.ff-window-close::before,
.ff-window-close::after {
    content: "";
    position: absolute;
    left: 13px;
    top: 21px;
    width: 18px;
    height: 2px;
    background: currentColor;
    transform: rotate(45deg);
    pointer-events: none;
}
.ff-window-close::after { transform: rotate(-45deg); }
.ff-window-close:focus { outline: none; }
.ff-window-close:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: -4px;
}

/* A physical right gutter is intentional in both reading directions. */
.map-search-heading { min-height: 40px; padding-right: 48px; }
.map-search-panel .map-search-title { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; text-align: start; }
.ff-dialog__title { padding-inline-end: 0; padding-right: 36px; }
.discover-dialog > h2, .profile-photo-modal > h2 { padding-right: 32px; }
.content-post-reader__header { padding-inline-end: 0; padding-right: 44px; }
.crm-dialog, .nursery-modal, .privacy-dialog, .tree-measurement-map-panel { position: relative; }
.crm-dialog__header { min-height: 60px; box-sizing: border-box; padding-right: 60px; }
.nursery-form > header, .nursery-type-menu > header, .nursery-qr-modal > header { min-height: 30px; padding-right: 38px; }
.website-migration-header { min-height: 40px; padding-right: 44px; }
.planning-tools-panel__header { min-height: 52px; padding-right: 60px; }
.field-scan-panel__top { min-height: 44px; padding-right: 52px; }
.field-scan-panel { --ff-window-close-color: #fff; }
.privacy-dialog > h2 { min-height: 32px; padding-right: 32px; }
.tree-measurement-map-panel { box-sizing: border-box; padding-top: 60px; background: #fff; }
.popup-content:has(> .ff-window-close) { padding-top: 60px; }
.popup-content.tree-details-popup:has(> .ff-window-close) { padding-top: 60px; background: #fffdf8; }
.tree-details-popup #popup-body { max-height: calc(min(90vh, 760px) - 60px); }
.tree-details-popup .tree-validation-badge { top: 12px; }
body.staged-tree-form-active .tree-form-wrapper--staged .tree-staged-header { padding-inline-start: 0; padding-right: 48px; }
body.staged-tree-form-active .popup-content.tree-form-popup.tree-form-popup--staged { padding-top: 60px; }
@media (max-width: 600px) {
    .tree-details-popup #popup-body { max-height: calc(100vh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
