/* Themed dropdown popup: the highlighted/selected option uses the site accent
   (yellow) instead of the browser-default blue. Firefox honors these directly
   on the native popup; Chromium 135+ needs the customizable-select opt-in
   below. Browsers without support keep their native dropdown unchanged. */

.map-select option:checked,
.map-select option:hover {
    background-color: var(--accent);
    color: var(--bg);
}

@supports (appearance: base-select) {
    .map-select,
    .map-select::picker(select) {
        appearance: base-select;
    }

    /* Keep the closed control identical to before: our own chevron stays, and
       the base-appearance picker icon and selected-row checkmark are hidden. */
    .map-select::picker-icon {
        display: none;
    }

    .map-select::checkmark {
        display: none;
    }

    .map-select::picker(select) {
        background: var(--panel-dark);
        border: 2px solid var(--border);
        border-radius: 0;
        padding: 0;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    }

    .map-select option {
        padding: 8px 12px;
        color: var(--text);
        background: var(--panel-dark);
        font-weight: 600;
    }

    .map-select option:hover,
    .map-select option:checked,
    .map-select option:active {
        background-color: var(--accent);
        color: var(--bg);
    }
}

.map-display-toggles {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.map-switch-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    font-family: var(--font-ui);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    user-select: none;
}

.map-switch-copy {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.map-switch-copy i {
    width: 16px;
    color: var(--accent);
    text-align: center;
}

.map-switch-item input {
    display: none;
}

.map-switch-track {
    position: relative;
    width: 38px;
    height: 20px;
    flex: 0 0 auto;
    border: 2px solid var(--border);
    background: var(--panel-deep);
    box-shadow: var(--shadow-xs);
}

.map-switch-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: var(--muted);
    box-shadow: var(--shadow-xs);
    transition: transform 0.14s ease, background 0.14s ease;
}

.map-switch-item input:checked + .map-switch-track {
    border-color: var(--accent);
    background: rgba(244, 197, 66, 0.12);
}

.map-switch-item input:checked + .map-switch-track::after {
    background: var(--accent);
    transform: translateX(18px);
}

.map-position-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-position-heading {
    justify-content: space-between;
}

.map-position-heading > span:first-child {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.map-help-tooltip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    color: var(--muted);
    cursor: help;
    outline: none;
}

.map-help-tooltip:hover,
.map-help-tooltip:focus-visible {
    color: var(--accent);
}

.map-help-tooltip-content {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    z-index: 100010;
    width: 230px;
    padding: 9px 10px;
    background: var(--panel-deep);
    border: 2px solid var(--accent);
    box-shadow: 3px 3px 0 #000000;
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0;
    text-transform: none;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-3px);
    transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s ease;
}

.map-help-tooltip-content strong {
    color: var(--accent);
    font-family: var(--font-code);
}

.map-help-tooltip:hover .map-help-tooltip-content,
.map-help-tooltip:focus-visible .map-help-tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

