.map-search-input-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 9px;
    border: 1px solid var(--line-strong);
    border-radius: 7px;
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.map-search-input-shell:focus-within {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.map-search-input-shell input {
    width: 100%;
    min-width: 0;
    padding: 9px 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 12px;
}

.map-search-input-shell input::placeholder {
    color: var(--soft);
}

.map-search-input-shell kbd {
    display: inline-grid;
    place-items: center;
    min-width: 23px;
    height: 23px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--panel-2);
    color: var(--muted);
    font: 750 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.map-search-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 9px;
}

.map-search-groups button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 800;
}

.map-search-groups button:hover,
.map-search-groups button.is-active {
    border-color: var(--line-strong);
    background: var(--accent-soft);
    color: var(--accent-2);
}

.map-search-groups button span {
    min-width: 13px;
    color: var(--soft);
    font-size: 8px;
    font-variant-numeric: tabular-nums;
}

.map-search-groups button.is-active span {
    color: var(--muted);
}

.map-search-panel [data-map-search-status] {
    min-height: 16px;
    margin: 9px 0 0;
}

.map-search-results {
    display: grid;
    gap: 6px;
    max-height: 380px;
    margin-top: 8px;
    overflow: auto;
    overscroll-behavior: contain;
}

.map-search-result {
    display: grid;
    grid-template-columns: minmax(48px, auto) minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    background: linear-gradient(180deg, color-mix(in srgb, var(--panel-2) 90%, transparent), var(--surface));
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.map-search-result:hover,
.map-search-result:focus-visible {
    border-color: var(--line-strong);
    background: linear-gradient(180deg, var(--panel-2), var(--surface));
    outline: 0;
}

.map-search-result-kind {
    display: -webkit-box;
    max-width: 68px;
    padding: 4px 6px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--accent-soft);
    color: var(--accent-2);
    font-size: 8px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-transform: uppercase;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.map-search-result[data-search-group="items"] .map-search-result-kind { color: var(--gold-2); }
.map-search-result[data-search-group="trainers"] .map-search-result-kind { color: var(--orange); }
.map-search-result[data-search-group="pokemon"] .map-search-result-kind { color: var(--purple); }
.map-search-result[data-search-group="shops"] .map-search-result-kind { color: var(--blue); }
.map-search-result[data-search-group="events"] .map-search-result-kind { color: var(--pink); }
.map-search-result[data-search-group="places"] .map-search-result-kind { color: var(--green); }

.map-search-result-copy {
    min-width: 0;
}

.map-search-result-copy strong,
.map-search-result-copy span,
.map-search-result-copy small {
    display: block;
}

.map-search-result-copy strong {
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-search-result-copy span {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.map-search-result-copy small {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    color: var(--soft);
    font-size: 9px;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.map-search-result-arrow {
    color: var(--accent-2);
    font-size: 17px;
}

.map-search-empty {
    margin: 0;
    padding: 10px;
    border: 1px dashed var(--line);
    border-radius: 7px;
    color: var(--soft);
    font-size: 11px;
    line-height: 1.45;
    text-align: center;
}

.map-search-empty .map-search-retry {
    margin-left: 5px;
}

.map-search-focus-flash {
    animation: map-search-focus-pulse 1.6s ease-out;
}

@keyframes map-search-focus-pulse {
    0%, 24% { box-shadow: 0 0 0 0 var(--accent-glow), var(--shadow); }
    48% { box-shadow: 0 0 0 7px var(--accent-glow), var(--shadow); }
    100% { box-shadow: 0 0 0 0 transparent, var(--shadow); }
}

@media (max-width: 820px) {
    .map-search-results {
        max-height: min(460px, 60vh);
    }
}

@media (prefers-reduced-motion: reduce) {
    .map-search-focus-flash {
        animation: none;
        outline: 3px solid var(--accent-glow);
        outline-offset: 3px;
    }
}
