.aswl-world {
    --aswl-world-border: #d8d8d8;
    --aswl-world-bg: #fff;
    --aswl-world-soft: #f6f4ef;
    --aswl-world-text: #252525;
    color: var(--aswl-world-text);
}

.aswl-world-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.aswl-world-toolbar h2 {
    margin: 0 0 4px;
}

.aswl-world-toolbar-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.aswl-world-intro {
    margin: 0;
}

.aswl-world-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.32em;
    margin-top: 7px;
    font-size: 0.9em;
    color: #666;
}

.aswl-world-breadcrumb-link {
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    cursor: pointer;
}

.aswl-world-breadcrumb-link:hover {
    color: var(--aswl-world-text);
}

.aswl-world-breadcrumb-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 2px;
}

.aswl-world-breadcrumb-current {
    color: var(--aswl-world-text);
    font-weight: 600;
}

.aswl-world-breadcrumb-separator {
    color: #999;
}

.aswl-world-fit,
.aswl-world-reset,
.aswl-world-country,
.aswl-world-region {
    font: inherit;
}

.aswl-world-fit,
.aswl-world-reset {
    min-height: 44px;
    padding: 9px 14px;
    border: 1px solid var(--aswl-world-border);
    border-radius: 3px;
    background: var(--aswl-world-bg);
    color: var(--aswl-world-text);
    cursor: pointer;
}

.aswl-world-fit:hover,
.aswl-world-reset:hover {
    background: var(--aswl-world-soft);
    border-color: #777;
}

.aswl-world-map {
    width: 100%;
    height: min(68vh, 660px);
    min-height: 420px;
    border: 1px solid var(--aswl-world-border);
    background: #eef1f2;
}

.aswl-world-status {
    margin: 10px 0 14px;
    min-height: 1.4em;
}

.aswl-world-country-grid,
.aswl-world-region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 10px;
}

.aswl-world-country,
.aswl-world-region {
    text-align: left;
    padding: 12px 14px;
    border: 1px solid var(--aswl-world-border);
    background: var(--aswl-world-bg);
    cursor: pointer;
}

.aswl-world-country:hover,
.aswl-world-country:focus-visible,
.aswl-world-country[aria-current="true"],
.aswl-world-region:hover,
.aswl-world-region:focus-visible,
.aswl-world-region[aria-current="true"] {
    background: var(--aswl-world-soft);
    border-color: #777;
}

.aswl-world-country strong,
.aswl-world-country span,
.aswl-world-region strong,
.aswl-world-region span {
    display: block;
}

.aswl-world-country span,
.aswl-world-region span {
    margin-top: 3px;
    font-size: 0.92em;
}

.aswl-world-region-marker {
    stroke-dasharray: 3 2;
}

.aswl-world-popup p {
    margin: 7px 0 0;
}

.aswl-world-empty {
    padding: 16px;
    border: 1px solid var(--aswl-world-border);
    background: var(--aswl-world-soft);
}

@media (max-width: 650px) {
    .aswl-world-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .aswl-world-toolbar-actions {
        width: 100%;
    }

    .aswl-world-fit,
    .aswl-world-reset {
        flex: 1 1 auto;
    }

    .aswl-world-map {
        min-height: 360px;
        height: 58vh;
    }
}

/* Author CSS must never override the native hidden state. */
.aswl-world [hidden] {
    display: none !important;
}

.aswl-world-region-marker-empty {
    opacity: 0.72;
}

.aswl-world-geometry-note {
    margin: -5px 0 14px;
    font-size: 0.86em;
    color: #666;
}

.aswl-world .leaflet-interactive {
    cursor: pointer;
}

.aswl-world .leaflet-tooltip.aswl-world-region-label {
    border: 0;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: none;
    color: #252525;
    font-weight: 700;
    padding: 2px 5px;
    pointer-events: none;
}

.aswl-world .leaflet-tooltip.aswl-world-region-label::before {
    display: none;
}


.aswl-world .leaflet-tooltip.aswl-world-country-label {
    border: 1px solid rgba(178, 79, 112, 0.45);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
    color: #8f3555;
    font-weight: 700;
    padding: 2px 6px;
    pointer-events: none;
}

.aswl-world .leaflet-tooltip.aswl-world-country-label::before {
    display: none;
}


/* Intelligent distillery markers, clusters and richer ASWL popups. */
.aswl-world-distillery-icon-wrap,
.aswl-world-cluster-icon-wrap {
    background: transparent;
    border: 0;
}

.aswl-world-distillery-icon {
    display: block;
    width: 18px;
    height: 18px;
    margin: 3px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #2f5f7a;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.34);
}

.aswl-world-cluster-icon {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #2f5f7a;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.36);
    color: #fff;
    font-weight: 700;
    line-height: 1;
}

.aswl-world-popup {
    min-width: 220px;
}

.aswl-world-popup-title {
    display: block;
    margin-bottom: 2px;
    font-size: 1.04em;
}

.aswl-world-popup-location,
.aswl-world-popup-fact,
.aswl-world-popup-more {
    color: #5c5c5c;
    font-size: 0.92em;
}

.aswl-world-popup-whiskies {
    margin-top: 9px;
    padding-top: 8px;
    border-top: 1px solid #ddd;
}

.aswl-world-popup-heading {
    margin-bottom: 4px;
    font-weight: 700;
}

.aswl-world-popup-whiskies ul {
    margin: 4px 0 0 18px;
    padding: 0;
}

.aswl-world-popup-whiskies li {
    margin: 2px 0;
}

.aswl-world-popup-more {
    margin-top: 5px;
}

.aswl-world-popup-action {
    margin: 10px 0 0 !important;
}

.aswl-world-popup-empty {
    margin: 8px 0 0 !important;
    color: #666;
    font-size: 0.92em;
}

/* Direct search across visible distilleries and linked whiskies. */
.aswl-world-search {
    position: relative;
    z-index: 700;
    width: min(100%, 680px);
    margin: 0 0 14px;
}

.aswl-world-search-field {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.aswl-world-search-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--aswl-world-border);
    border-radius: 3px;
    background: var(--aswl-world-bg);
    color: var(--aswl-world-text);
    font: inherit;
}

.aswl-world-search-input:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.aswl-world-search-clear {
    flex: 0 0 auto;
    padding: 9px 12px;
    border: 1px solid var(--aswl-world-border);
    border-radius: 3px;
    background: var(--aswl-world-bg);
    cursor: pointer;
    font: inherit;
}

.aswl-world-search-results {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    left: 0;
    z-index: 1000;
    max-height: min(55vh, 420px);
    overflow-y: auto;
    border: 1px solid var(--aswl-world-border);
    border-radius: 3px;
    background: var(--aswl-world-bg);
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.18);
}

.aswl-world-search-result {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid #e5e5e5;
    background: var(--aswl-world-bg);
    color: var(--aswl-world-text);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.aswl-world-search-result:last-child {
    border-bottom: 0;
}

.aswl-world-search-result:hover,
.aswl-world-search-result:focus-visible {
    background: var(--aswl-world-soft);
    outline: none;
}

.aswl-world-search-result strong,
.aswl-world-search-result span {
    display: block;
}

.aswl-world-search-result span {
    margin-top: 2px;
    color: #666;
    font-size: 0.9em;
}

.aswl-world-search-empty {
    padding: 11px 12px;
    color: #666;
}

.aswl-world-popup-whisky-highlight {
    padding: 2px 4px;
    border-radius: 2px;
    background: var(--aswl-world-soft);
    font-weight: 700;
}

.aswl-world .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 650px) {
    .aswl-world-search {
        width: 100%;
    }

    .aswl-world-search-field {
        gap: 6px;
    }

    .aswl-world-search-clear {
        padding-inline: 10px;
    }
}


/* Client-side member filtering across map, counts, clusters and search. */
.aswl-world-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin: -2px 0 14px;
}

.aswl-world-filter-label {
    font-weight: 700;
}

.aswl-world-filter-buttons {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
}

.aswl-world-filter {
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--aswl-world-border);
    border-radius: 999px;
    background: var(--aswl-world-bg);
    color: var(--aswl-world-text);
    cursor: pointer;
    font: inherit;
}

.aswl-world-filter:hover,
.aswl-world-filter:focus-visible,
.aswl-world-filter.is-active {
    border-color: #777;
    background: var(--aswl-world-soft);
}

.aswl-world-filter.is-active {
    box-shadow: inset 0 0 0 1px #777;
    font-weight: 700;
}

.aswl-world-filter-note {
    color: #666;
    font-size: 0.86em;
}

.aswl-world-country.is-empty,
.aswl-world-country:disabled {
    opacity: 0.48;
    cursor: default;
}

@media (max-width: 650px) {
    .aswl-world-filters {
        align-items: flex-start;
        flex-direction: column;
    }

    .aswl-world-filter-buttons {
        width: 100%;
    }

    .aswl-world-filter {
        flex: 1 1 auto;
    }
}

.aswl-world-region.is-empty {
    opacity: 0.68;
}

/* Accessibility, mobile and resilience hardening. */
.aswl-world-fit,
.aswl-world-reset,
.aswl-world-search-clear,
.aswl-world-filter {
    min-height: 44px;
}

.aswl-world-fit:focus-visible,
.aswl-world-reset:focus-visible,
.aswl-world-search-clear:focus-visible,
.aswl-world-filter:focus-visible,
.aswl-world-country:focus-visible,
.aswl-world-region:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.aswl-world-map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

@media (max-width: 650px) {
    .aswl-world-breadcrumb-link {
        padding: 4px 2px;
    }
}

@media (max-width: 420px) {
    .aswl-world-map {
        min-height: 320px;
        height: 55vh;
    }

    .aswl-world-country-grid,
    .aswl-world-region-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aswl-world *,
    .aswl-world *::before,
    .aswl-world *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* Tablet map controls and safe return navigation from ASWL details. */
@media (any-pointer: coarse) {
    .aswl-world .leaflet-control-zoom a {
        width: 44px;
        height: 44px;
        font-size: 22px;
        line-height: 44px;
    }

    .aswl-world .leaflet-control-zoom-in,
    .aswl-world .leaflet-control-zoom-out {
        touch-action: manipulation;
    }
}

.aswl-world-return-link {
    position: fixed;
    left: 12px;
    bottom: 12px;
    left: max(12px, env(safe-area-inset-left));
    bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 99999;
    box-sizing: border-box;
    max-width: calc(100vw - 24px);
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #cfcfcf;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.18);
    color: #252525;
    font: inherit;
    font-weight: 600;
    line-height: 1.35;
    text-decoration: none;
}

.aswl-world-return-link:hover,
.aswl-world-return-link:focus-visible {
    border-color: #777;
    background: #f6f4ef;
    color: #252525;
}

.aswl-world-return-link:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (max-width: 420px) {
    .aswl-world-return-link {
        right: 12px;
        right: max(12px, env(safe-area-inset-right));
        text-align: center;
    }
}
