.market-workspace {
    --market-accent: #2563eb;
    --market-competitor: #dc2626;
    --market-complementary: #059669;
}

.market-map-shell {
    position: relative;
    min-height: 34rem;
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(127, 127, 127, .28));
    border-radius: .9rem;
    background: var(--background-secondary, #eef2f7);
}

.market-map {
    width: 100%;
    min-height: 34rem;
}

.market-location-map-shell {
    overflow: hidden;
    border: 1px solid var(--border-color, rgba(127, 127, 127, .28));
    border-radius: .8rem;
    background: var(--background-secondary, #eef2f7);
}

.market-location-map {
    width: 100%;
    min-height: 18rem;
}

.market-map:focus-within,
.market-map-shell:focus-within {
    outline: 3px solid color-mix(in srgb, var(--market-accent) 40%, transparent);
    outline-offset: 2px;
}

.market-map-overlay {
    position: absolute;
    z-index: 3;
    top: .75rem;
    left: .75rem;
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    max-width: calc(100% - 5rem);
    padding: .45rem .6rem;
    border-radius: .7rem;
    background: color-mix(in srgb, var(--background-primary, #fff) 92%, transparent);
    box-shadow: 0 .35rem 1.2rem rgba(15, 23, 42, .14);
    backdrop-filter: blur(8px);
}

.market-map-overlay label {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    margin: 0;
    font-size: .82rem;
    font-weight: 600;
}

.market-location-results {
    position: absolute;
    z-index: 20;
    width: min(42rem, calc(100vw - 3rem));
    max-height: 18rem;
    overflow-y: auto;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: .6rem;
    background: var(--background-primary, #fff);
    box-shadow: 0 .6rem 1.4rem rgba(15, 23, 42, .16);
}

.market-location-result {
    display: block;
    width: 100%;
    padding: .65rem .8rem;
    border: 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    color: inherit;
    text-align: left;
    background: transparent;
}

.market-location-result:hover,
.market-location-result:focus-visible {
    background: color-mix(in srgb, var(--market-accent) 9%, transparent);
}

.market-metric {
    height: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color, rgba(127, 127, 127, .24));
    border-radius: .8rem;
    background: color-mix(in srgb, var(--background-primary, #fff) 94%, var(--market-accent) 6%);
}

.market-metric-value {
    margin-top: .35rem;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    font-weight: 750;
    line-height: 1.1;
}

.market-score {
    display: grid;
    place-items: center;
    width: 7rem;
    height: 7rem;
    border: .65rem solid color-mix(in srgb, var(--market-accent) 80%, #fff);
    border-radius: 50%;
    font-size: 1.6rem;
    font-weight: 800;
}

.market-legend-dot {
    display: inline-block;
    width: .65rem;
    height: .65rem;
    margin-right: .3rem;
    border-radius: 50%;
}

.market-legend-dot.competitor { background: var(--market-competitor); }
.market-legend-dot.complementary { background: var(--market-complementary); }

[data-bs-theme="dark"] .market-map-overlay,
[data-bs-theme="dark"] .market-location-results {
    color: #f8fafc;
}

@media (max-width: 767.98px) {
    .market-map-shell,
    .market-map { min-height: 26rem; }
    .market-map-overlay { right: .75rem; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
    .market-workspace * { scroll-behavior: auto !important; }
}
