.global-location-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.global-location-modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.global-location-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.64);
    backdrop-filter: blur(2px);
}

.global-location-modal-shell {
    position: relative;
    z-index: 1;
    width: min(96vw, 780px);
    max-height: 92vh;
    overflow: auto;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--content-bg);
    padding: 18px;
    display: grid;
    gap: 10px;
}

.global-location-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: #0f172a;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
}

.global-location-modal-subtitle {
    margin: 0;
    color: var(--secondary-color);
    font-size: 0.86rem;
}

.global-location-modal-current {
    margin: 0;
    font-size: 0.95rem;
    color: var(--text-color);
}

.global-location-modal-current strong {
    font-weight: 700;
}

.global-location-detected-city {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(0, 113, 227, 0.25);
    background: rgba(0, 113, 227, 0.08);
    color: var(--primary-color);
    font-size: 1.05rem;
    font-weight: 700;
}

.global-location-panel {
    display: grid;
    gap: 10px;
}

.global-location-actions-top {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.global-location-row {
    display: grid;
    gap: 6px;
    font-size: 0.84rem;
    color: var(--secondary-color);
}

.global-location-field {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 0.92rem;
    background: #ffffff;
    color: #0f172a;
    box-sizing: border-box;
}

.global-location-results {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 180px;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--content-bg);
}

.global-location-results:empty {
    display: none;
}

.global-location-results li {
    border-bottom: 1px solid var(--border-color);
}

.global-location-results li:last-child {
    border-bottom: 0;
}

.global-location-results button {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 9px 10px;
    text-align: left;
    color: var(--text-color);
    cursor: pointer;
}

.global-location-results button:hover,
.global-location-results button:focus {
    background: rgba(0, 113, 227, 0.08);
}

.global-location-map {
    width: 100%;
    height: 280px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.global-location-map.is-focus-pulse {
    animation: global-location-map-pulse 0.7s ease;
}

@keyframes global-location-map-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0.45);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(0, 113, 227, 0);
        transform: scale(1.01);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 113, 227, 0);
        transform: scale(1);
    }
}

.global-location-status {
    margin: 0;
    min-height: 1.2em;
    font-size: 0.82rem;
    color: var(--secondary-color);
}

.global-location-status.is-error {
    color: #b91c1c;
}

.global-location-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.global-location-btn-primary,
.global-location-btn-secondary {
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.global-location-btn-primary {
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: #ffffff;
}

.global-location-btn-secondary {
    border: 1px solid var(--border-color);
    background: var(--content-bg);
    color: var(--text-color);
}

@media (max-width: 700px) {
    .global-location-actions-top {
        flex-direction: column;
    }

    .global-location-btn-primary,
    .global-location-btn-secondary {
        width: 100%;
        text-align: center;
    }

    .global-location-actions {
        width: 100%;
    }
}

body.dark-mode .global-location-modal-shell {
    background: #0b1220;
    border-color: #334155;
}

body.dark-mode .global-location-modal-close {
    background: #111827;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .global-location-field,
body.dark-mode .global-location-results,
body.dark-mode .global-location-map {
    background: #020617;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .global-location-results button:hover,
body.dark-mode .global-location-results button:focus {
    background: rgba(59, 130, 246, 0.18);
}
