/* Shared colourful messages; the renderer retains a native fallback for older browsers. */
.gm-shell, .gm-shell *, .gm-toast, .gm-toast * { box-sizing: border-box; }
dialog.gm-shell {
    position: fixed; inset: 0; width: 560px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 24px);
    margin: auto; padding: 0; overflow: auto; border: 2px solid #60615b; border-radius: 4px;
    background: white; color: #252925; box-shadow: 3px 5px 0 #0003; text-align: left;
    font: 16px/1.5 Arial, Helvetica, sans-serif;
}
dialog.gm-shell::backdrop { background: #253b4d66; }
.gm-shell .gm-header { display: flex; align-items: center; gap: 12px; padding: 13px 16px; margin: 0; border: 0; background: #3e78ab; color: white; }
.gm-shell .gm-header.gm-warning { background: #e8ac25; color: #242821; }
.gm-shell .gm-header.gm-error { background: #c93a2f; }
.gm-shell .gm-header.gm-success { background: #559b29; }
.gm-shell .gm-header h2 { flex: 1; margin: 0; padding: 0; border: 0; background: none; color: inherit; font: bold 21px/1.25 Arial, sans-serif; text-align: left; }
.gm-icon { display: inline-flex; flex: 0 0 22px; width: 22px; height: 22px; vertical-align: middle; pointer-events: none; }
.gm-icon svg { display: block; width: 100%; height: 100%; margin: 0; pointer-events: none; }
.gm-header > .gm-icon { width: 28px; height: 28px; flex-basis: 28px; }
.gm-shell .gm-body { padding: 22px; overflow-wrap: anywhere; white-space: pre-line; text-align: left; }
.gm-shell .gm-body p { margin: 0 0 12px; padding: 0; font: inherit; }
.gm-shell .gm-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding: 14px 20px; margin: 0; border-top: 1px solid #d9ddd5; background: #f4f5f1; }
.gm-shell .gm-button, .gm-toast .gm-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; position: static; float: none;
    width: auto; height: auto; min-height: 40px; margin: 0; padding: 8px 13px; border: 1px solid #989f96;
    border-bottom-width: 3px; border-radius: 4px; background: #edf0e9; color: #292d29;
    box-shadow: none; font: bold 15px/1.3 Arial, sans-serif; text-align: center; text-transform: none; text-decoration: none; cursor: pointer;
}
.gm-shell .gm-button::before, .gm-shell .gm-button::after { content: none !important; }
.gm-shell .gm-button.gm-success { background: #559b29; color: white; border-color: #3c741b; }
.gm-shell .gm-button.gm-warning { background: #e8ac25; color: #252925; border-color: #ad7b13; }
.gm-shell .gm-button.gm-error { background: #c93a2f; color: white; border-color: #94291f; }
.gm-shell .gm-button.gm-info { background: #3e78ab; color: white; border-color: #2b5882; }
.gm-shell .gm-button:hover { filter: brightness(.96); }
.gm-shell .gm-button:active { border-bottom-width: 1px; padding-bottom: 10px; }
.gm-shell .gm-button:disabled { background: #e4e6e2; color: #797f78; border-color: #c0c5bd; cursor: not-allowed; filter: none; }
.gm-shell .gm-button.gm-close, .gm-toast .gm-button.gm-close { flex: 0 0 32px; width: 32px; min-height: 32px; padding: 4px; border: 1px solid currentColor; background: transparent; color: inherit; }
.gm-button.gm-close > span:not(.gm-icon) { display: none; }
.gm-shell :focus-visible, .gm-toast :focus-visible { outline: 3px solid #2375c7 !important; outline-offset: 3px; }
.gm-shell input { max-width: 100%; color: #252925; font: inherit; }
.gm-shell .gm-note { color: #5b625a; font-size: 13px; }

/* Legacy messages: only layout changes, original IDs and event handlers retained. */
html[data-map-messages="new"] .gm-shell .gm-adapted {
    display: block; position: static !important; float: none !important; inset: auto !important; transform: none !important;
    width: 100% !important; min-width: 0 !important; max-width: none !important; height: auto !important; min-height: 0 !important;
    margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important;
    background: white !important; color: #252925 !important; box-shadow: none !important; font: 16px/1.5 Arial, sans-serif !important;
    overflow: visible !important; text-align: left !important;
}
html[data-map-messages="new"] .gm-adapted .gm-body { white-space: normal; }
html[data-map-messages="new"] .gm-adapted .gm-body p { float: none; width: auto; height: auto; padding: 0; margin: 0 0 12px; font: inherit; text-align: left; }
html[data-map-messages="new"] .gm-adapted .gm-body .centerButtons,
html[data-map-messages="new"] .gm-adapted .gm-body .centerModalButtons,
html[data-map-messages="new"] .gm-adapted .gm-body #buyCancel,
html[data-map-messages="new"] .gm-adapted .gm-body #centerDialogButtons,
html[data-map-messages="new"] .gm-adapted .gm-body .dialog-content-sure { display: contents; }
/* Legacy ID rules reserve room for background icons using !important. A
 * scoped cascade layer gives these important resets priority over those
 * unlayered rules, without changing the originals or their action elements. */
@layer gb-message-actions {
    html[data-map-messages="new"] .gm-adapted .gm-button {
        display: inline-flex !important; align-items: center !important; justify-content: center !important; gap: 7px !important;
        position: static !important; float: none !important; inset: auto !important;
        width: auto !important; min-width: 0 !important; max-width: 100% !important; height: auto !important; min-height: 40px !important;
        margin: 0 !important; padding: 8px 13px !important; border: 1px solid #989f96 !important; border-bottom-width: 3px !important;
        border-radius: 4px !important; background: #edf0e9 !important; color: #292d29 !important; box-shadow: none !important;
        font: bold 15px/1.3 Arial,sans-serif !important; text-align: center !important; text-indent: 0 !important;
        text-transform: none !important; text-decoration: none !important; white-space: normal !important;
    }
    html[data-map-messages="new"] .gm-adapted .gm-button.gm-success { background: #559b29 !important; color: white !important; border-color: #3c741b !important; }
    html[data-map-messages="new"] .gm-adapted .gm-button.gm-warning { background: #e8ac25 !important; color: #252925 !important; border-color: #ad7b13 !important; }
    html[data-map-messages="new"] .gm-adapted .gm-button.gm-error { background: #c93a2f !important; color: white !important; border-color: #94291f !important; }
    html[data-map-messages="new"] .gm-adapted .gm-button.gm-info { background: #3e78ab !important; color: white !important; border-color: #2b5882 !important; }
    html[data-map-messages="new"] .gm-adapted .gm-button:active { border-bottom-width: 1px !important; padding-bottom: 10px !important; }
    html[data-map-messages="new"] .gm-adapted .gm-button:disabled { background: #e4e6e2 !important; color: #797f78 !important; border-color: #c0c5bd !important; }
}
html[data-map-messages="new"] .gm-adapted .gm-button a { display: block; color: inherit; text-decoration: none; background: none; font: inherit; }
html[data-map-messages="new"] .gm-adapted .filesMess { width: auto; margin: 0; font: inherit; }
html[data-map-messages="new"] .gm-adapted input { display: block; width: 100%; height: 40px; margin: 8px 0; padding: 8px; border: 1px solid #899682; border-radius: 3px; font: 16px Arial, sans-serif; }
html[data-map-messages="new"] #modal_window3 { border: 2px solid #60615b; border-radius: 4px; background: #3e78ab; color: white; font: 15px Arial, sans-serif; }

/* Existing form dialogs share the palette without changing fields or callbacks. */
html[data-map-messages="new"] :is(#saveUnlockDialog,#paymentDialog,#moreMapsProDialog,.aim-content,#dialog .eic-content,#faqDialog,#legendDetailsDialog,.overlay4 .popup) { border: 2px solid #60615b; border-radius: 4px; box-shadow: 3px 5px 0 #0003; color: #252925; }
html[data-map-messages="new"] :is(.aim-header,#dialog .eic-header,.payment-header) { background: #3e78ab; color: white; }
html[data-map-messages="new"] :is(.aim-header h2,#dialog #eicTitle,.payment-header h2) { color: white; }
html[data-map-messages="new"] #saveUnlockDialog { padding: 0 22px 16px; }
html[data-map-messages="new"] #saveUnlockDialog .save-unlock-symbol { display: none; }
html[data-map-messages="new"] #saveUnlockTitle { margin: 0 -22px 18px; padding: 16px 48px 16px 18px; background: #3e78ab; color: white; font-size: 21px; text-align: left; }
html[data-map-messages="new"] #saveUnlockDialog .save-unlock-close { color: white; }
html[data-map-messages="new"] #saveUnlockDialog .save-unlock-buy { background: #559b29; border-radius: 4px; border-bottom: 3px solid #3c741b; }
html[data-map-messages="new"] #saveUnlockDialog .save-unlock-price { border-radius: 4px; border-color: #e8ac25; }
html[data-map-messages="new"] :is(#moreMapsProDialog,.overlay4 .popup) > h2 { margin: -20px -20px 18px; padding: 16px 48px 16px 18px; background: #3e78ab; color: white; font: bold 21px/1.25 Arial,sans-serif; }
html[data-map-messages="new"] #moreMapsProDialog { padding: 20px; }
html[data-map-messages="new"] :is(#moreMapsProOpen,#csvImportAdvancedButton2,.aim-primary) { background: #559b29 !important; color: white; border-radius: 4px; border-bottom: 3px solid #3c741b !important; }
html[data-map-messages="new"] :is(.aim-status[data-state="warning"],#eicRowStatus[data-state="warning"],.gm-inline-warning) { padding: 10px 12px; border: 1px solid #e8ac25; border-left: 5px solid #e8ac25; border-radius: 3px; background: #fff5d9; color: #583b07; }
html[data-map-messages="new"] .aim-status[data-state="error"] { padding: 10px 12px; border: 1px solid #c93a2f; border-left: 5px solid #c93a2f; background: #fff0ed; color: #8b2016; }
html[data-map-messages="new"] :is(.aim-status[data-state="success"],#eicRowStatus[data-state="matched"]) { border-left: 5px solid #559b29; background: #f1f9e9; color: #336419; }
html[data-map-messages="new"] :is(#googleMapStatus,#googleMapSearchFeedback) { border: 2px solid #60615b; border-radius: 4px; font-family: Arial,sans-serif; }
html[data-map-messages="new"] .overlay4 { background: #253b4d66; }
html[data-map-messages="new"] .overlay4 .popup { padding: 20px; max-width: calc(100vw - 24px); max-height: calc(100dvh - 40px); overflow: auto; background: white; font: 15px/1.45 Arial,sans-serif; }
html[data-map-messages="new"] .overlay4 .closepop { top: 8px; right: 12px; color: white; }
html[data-map-messages="new"] #popup2 .popup > h2 { background: #e8ac25; color: #252925; }
html[data-map-messages="new"] #popup2 .closepop { color: #252925; }
html[data-map-messages="new"] :is(#transferButton,#convertButton,#cancelConvertButton) { min-height: 40px; padding: 9px 15px; border: 1px solid #ad7b13; border-bottom-width: 3px; border-radius: 4px; background: #e8ac25; color: #252925; font: bold 15px Arial,sans-serif; cursor: pointer; }
html[data-map-messages="new"] #cancelConvertButton { background: #edf0e9; border-color: #989f96; }

.gm-toast { position: fixed; right: 20px; bottom: 60px; z-index: 100100; display: flex; align-items: flex-start; gap: 12px; width: 410px; max-width: calc(100vw - 24px); padding: 14px; border: 2px solid #60615b; border-left: 7px solid #3e78ab; border-radius: 4px; background: white; color: #252925; box-shadow: 2px 4px 0 #0003; font: 15px/1.4 Arial,sans-serif; }
.gm-toast.gm-success { border-left-color: #559b29; }
.gm-toast.gm-warning { border-left-color: #e8ac25; }
.gm-toast.gm-error { border-left-color: #c93a2f; }
.gm-toast-copy { flex: 1; overflow-wrap: anywhere; }
.gm-toast-copy p { margin: 4px 0 0; }
.gm-toast.gm-success > .gm-icon { color: #559b29; }
.gm-toast.gm-error > .gm-icon { color: #c93a2f; }
.gm-progress { display: none; }
html[data-map-messages="new"] #spinnyWheel { position: fixed; z-index: 10040; left: 50%; top: 32%; transform: translateX(-50%); width: 330px; max-width: calc(100vw - 24px); height: auto; padding: 0; margin: 0; border: 2px solid #60615b; border-radius: 4px; background: white; background-image: none; animation: none; box-shadow: 2px 4px 0 #0003; }
html[data-map-messages="new"] #spinnyWheel .gm-progress { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px; padding: 16px; color: #252925; font: 15px/1.4 Arial,sans-serif; }
.gm-progress > .gm-icon { color: #3e78ab; }
.gm-progress p { margin: 0; }
.gm-spinner { display: inline-block; width: 26px; height: 26px; border: 4px solid #d9e6ed; border-top-color: #3e78ab; border-radius: 50%; animation: gm-spin 1s linear infinite; }
@keyframes gm-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .gm-spinner { animation: none; border-top-color: #559b29; } }
@media (max-width: 600px) { .gm-shell .gm-body { padding: 16px; } .gm-shell .gm-header { padding: 12px; gap: 8px; } .gm-shell .gm-header h2 { font-size: 19px; } .gm-shell .gm-actions { padding: 12px; } .gm-shell .gm-actions .gm-button { flex: 1 1 auto; } }
@media print { .gm-shell,.gm-toast,.gm-progress { display: none !important; } }

.gm-toast-region { position: fixed; right: 16px; bottom: 60px; z-index: 100100; display: flex; flex-direction: column; gap: 10px; max-height: 65vh; overflow: auto; }
.gm-toast-region .gm-toast { position: static; flex: none; }

html[data-map-messages="new"] .gm-adapted input { position: static !important; float: none !important; width: 100% !important; height: 40px !important; margin: 8px 0 !important; padding: 8px !important; font: 16px Arial,sans-serif !important; box-sizing: border-box; }
html[data-map-messages="new"] body:has(.gm-legacy-host[open]) :is(.dimScreen,.OTPoverlay,.renewalReminderOverlay,.OTPincorrectoverlay) { background: transparent !important; }
html[data-map-messages="new"] :is(#saveUnlockDialog,#paymentDialog,#moreMapsProDialog)::backdrop { background: #253b4d66; }

html[data-map-messages="new"] #moreMapsProDialog .mm-dialog-heading { margin: -20px -20px 18px; padding: 14px 46px 14px 16px; background: #3e78ab; color: white; }
html[data-map-messages="new"] #moreMapsProDialog #moreMapsProTitle { color: white; font: bold 21px/1.25 Arial,sans-serif; }
html[data-map-messages="new"] #moreMapsProDialog .mm-destination-icon { color: white; background: transparent; }
html[data-map-messages="new"] #moreMapsProDialog .mm-dialog-close { color: white; }
html[data-map-messages="new"] #moreMapsProDialog .mm-dialog-close:hover { background: #ffffff33; }
html[data-map-messages="new"] #warning { background: #e8ac25; color: #252925; border: 2px solid #60615b; border-radius: 4px; }
html[data-map-messages="new"] .overlay4 .popup :focus-visible { outline: 3px solid #2375c7; outline-offset: 3px; }

html[data-map-messages="new"] #sampWarnMess { padding: 10px 14px; border: 2px solid #60615b; border-left: 6px solid #e8ac25; border-radius: 4px; background: #fff5d9; color: #252925; font: bold 15px/1.4 Arial,sans-serif; }

dialog.gm-shell.gm-wide-actions { width: 680px; }
html[data-map-messages="new"] .gm-adapted .gm-body p { text-align: left !important; font: inherit !important; }
html[data-map-messages="new"] #popup2 .popup { width: 520px; }
html[data-map-messages="new"] #popup2 .popupContent { font: 15px/1.45 Arial,sans-serif; }
html[data-map-messages="new"] #popup2 .withUnlock { display: none; }
html[data-map-messages="new"] #popup2 .transHeadings { float: none; width: auto; margin: 10px 0 5px; text-align: left; font: bold 14px/1.4 Arial,sans-serif; }
html[data-map-messages="new"] #popup2 input { box-sizing: border-box; display: block; float: none; width: 100%; height: 38px; margin: 0 0 8px; padding: 7px 9px; border: 1px solid #a1aa9a; border-radius: 3px; font: 15px Arial,sans-serif; }
html[data-map-messages="new"] #popup2 .NBtext { clear: both; padding-top: 6px; font: 13px/1.5 Arial,sans-serif; }
html[data-map-messages="new"] #popup2 #greenDownArrow { display: none; }
html[data-map-messages="new"] #popup2 #transferButton { display: inline-flex; align-items: center; justify-content: center; float: none; width: auto; height: auto; margin: 8px 0 12px; }
