.clients-section {
    padding-bottom: 30px;
}
.map-toolbar {
    display: flex;
    align-items: flex-end;
    gap: 20px;
}
.map-toolbar > div {
    flex: 1;
}
.map-toolbar label {
    display: block;
    font-size: 13px;
    font-weight: 650;
    margin-bottom: 8px;
}
.map-toolbar input {
    width: 100%;
    min-width: 0;
    padding: 15px 18px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
}
.map-toolbar input::placeholder {
    color: var(--muted);
}
.map-toolbar input:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}
.map-results {
    margin: 16px 0;
    font-size: 13px;
}
.map-frame {
    position: relative;
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
}
#client-map {
    height: 520px;
    width: 100%;
    z-index: 1;
    background: #e8eef4;
}

/* MapLibre GL custom styles */
#client-map .maplibregl-canvas {
    display: block;
}

.maplibregl-popup-anchor-top > .maplibregl-popup-content {
    border-radius: 8px;
}

.maplibregl-popup-content {
    padding: 12px 16px;
    border-radius: 8px;
}

.maplibregl-popup-close-button {
    width: 24px;
    height: 24px;
    color: #333;
    font-size: 24px;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.maplibregl-popup-close-button:hover {
    opacity: 1;
}

/* Dark theme adjustments - basato su data-theme del sito, non su sistema operativo */
html[data-theme="dark"] #client-map {
    background: #0a0f1a;
}

html[data-theme="dark"] .maplibregl-popup-content {
    background-color: #ffffff;
    color: #1a1a1a;
}

html[data-theme="dark"] .maplibregl-popup-tip {
    border-top-color: #ffffff;
}

html[data-theme="dark"] .maplibregl-popup-close-button {
    color: #999;
}

html[data-theme="dark"] .maplibregl-popup-close-button:hover {
    color: #666;
}
.map-status, .map-frame noscript p {
    padding: 16px 22px;
    margin: 0;
    font-size: 13px;
}
.map-privacy {
    font-size: 11px;
    margin: 16px 0 26px;
}
.map-privacy a {
    text-decoration: underline;
}
.client-pin {
    padding: 3px;
    border-radius: 50%;
    border: 2px solid #2876aa;
    background: #205d86;
    box-shadow: 0 2px 9px #152a3c55;
}
.client-pin-secondary {
    border-color: #66551e;
    background: #f5ce42;
}
.client-pin-unknown {
    background: #fff;
    border-color: #637180;
}
.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    margin: 16px 0;
    font-size: 12px;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.map-legend img {
    border-radius: 50%;
    background: #319cce;
    padding: 3px;
    width: 24px;
    height: 24px;
    border: 2px solid white;
}

.map-legend img[src*="client-secondary"] {
    background: #f5ce42;
    border-color: white;
}
.client-pin img {
    display: block;
    width: 24px;
    height: 24px;
}
.leaflet-container {
    font-family: inherit;
}
.leaflet-container .leaflet-control-attribution {
    background: #fff;
    color: #202b36;
}
.leaflet-container a {
    color: #25658f;
}
.leaflet-container .leaflet-control-zoom a {
    color: var(--text);
    background: var(--surface);
}
.leaflet-popup-content-wrapper {
    background: var(--surface);
    color: var(--text);
}
.leaflet-popup-tip {
    background: var(--surface);
}
.leaflet-popup-content h3 {
    font-size: 17px;
    letter-spacing: -.02em;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.leaflet-popup-content p {
    margin: 10px 0 0;
    font-size: 12px;
}
.leaflet-container a.leaflet-popup-close-button {
    color: var(--muted);
}
.client-directory {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}
.client-directory summary {
    font-size: 15px;
    font-weight: 650;
    cursor: pointer;
}
.client-directory ul {
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    max-height: 440px;
    overflow-y: auto;
}
.client-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 15px 0;
    border-top: 1px solid var(--line);
}
.client-entry > div {
    min-width: 0;
}
.client-name {
    font-size: 13px;
    font-weight: 600;
    overflow-wrap: anywhere;
}
.client-entry small {
    display: block;
    font-size: 11px;
    color: var(--muted);
}
.client-show {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--soft);
    color: var(--accent);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    font-size: 11px;
    flex-shrink: 0;
}
.client-show .icon {
    width: 16px;
    height: 16px;
}
@media (max-width: 640px) {
    .map-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }
    #client-map {
        height: 380px;
    }
    .client-directory {
        padding: 18px;
    }
    .client-entry {
        gap: 10px;
    }
    .client-show span {
        display: none;
    }
}
