:root {
    color-scheme: light;
    --location-ink: #172033;
    --location-muted: #697386;
    --location-soft: #f6f7fb;
    --location-surface: #ffffff;
    --location-line: #e4e7ee;
    --location-accent: #4f46e5;
    --location-accent-dark: #3f37c9;
    --location-shadow: 0 18px 60px rgba(23, 32, 51, 0.09);
    --location-radius-large: 24px;
    --location-radius-medium: 16px;
    font-family: "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--location-ink);
    background: var(--location-soft);
    font-family: "Open Sans", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button,
select {
    cursor: pointer;
}

a {
    color: inherit;
}

.page-shell {
    width: min(1200px, calc(100% - 64px));
    margin-inline: auto;
}

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

.skip-link {
    position: fixed;
    left: 16px;
    top: -60px;
    z-index: 10000;
    padding: 10px 14px;
    border-radius: 8px;
    color: #fff;
    background: var(--location-ink);
}

.skip-link:focus {
    top: 16px;
}

.location-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--location-line);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
}

.header-inner,
.brand-group,
.header-actions {
    display: flex;
    align-items: center;
}

.header-inner {
    justify-content: space-between;
    gap: 24px;
}

.brand-group {
    min-width: 0;
    gap: 13px;
}

.brand-link {
    display: flex;
}

.brand-link img {
    display: block;
    width: 138px;
    height: auto;
}

.page-label {
    padding-left: 13px;
    border-left: 1px solid var(--location-line);
    color: var(--location-muted);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.header-actions {
    gap: 10px;
}

.language-control {
    position: relative;
    display: flex;
    align-items: center;
    gap: 9px;
}

.language-control label {
    color: var(--location-muted);
    font-size: 13px;
    font-weight: 700;
}

.language-control svg {
    position: absolute;
    left: 12px;
    top: 50%;
    width: 17px;
    height: 17px;
    transform: translateY(-50%);
    fill: #1ca6d9;
    pointer-events: none;
}

.language-control select {
    min-height: 42px;
    appearance: none;
    padding: 0 34px 0 38px;
    border: 1px solid var(--location-line);
    border-radius: 12px;
    color: var(--location-ink);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23697386' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m3 4.5 3 3 3-3'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-size: 14px;
    font-weight: 700;
}

.header-link,
.header-cta {
    padding: 10px 8px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.header-cta {
    padding: 11px 16px;
    border-radius: 12px;
    color: #fff;
    background: var(--location-ink);
    font-weight: 800;
}

main {
    padding: 22px 0 44px;
}

.location-intro {
    max-width: 830px;
    margin: 0 auto 34px;
    text-align: center;
}

.section-kicker,
.widget-kicker {
    margin: 0 0 14px;
    color: var(--location-accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.location-intro h1 {
    /* Matches the homepage hero h1 ("Location Intelligence for Real Estate"). */
    margin: 0;
    font-weight: 700;
    font-size: 2.4rem;
    line-height: 1.25;
    color: #111;
}

.intro-copy {
    max-width: 650px;
    margin: 20px auto 0;
    color: var(--location-muted);
    font-size: clamp(17px, 2vw, 20px);
    line-height: 1.6;
}

.search-card {
    position: relative;
    z-index: 20;
    max-width: 820px;
    margin: 0 auto 28px;
    padding: 18px;
    border: 1px solid var(--location-line);
    border-radius: var(--location-radius-medium);
    background: var(--location-surface);
    box-shadow: 0 12px 40px rgba(23, 32, 51, 0.07);
}

.search-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 10px;
}

.search-field-wrap {
    position: relative;
}

.search-card-header > #search-label {
    margin: 0 0 0 2px;
    font-size: 13px;
    font-weight: 800;
}

.search-input-wrap {
    position: relative;
}

.search-pin {
    position: absolute;
    left: 16px;
    top: 27px;
    width: 22px;
    height: 22px;
    transform: translateY(-50%);
    fill: var(--location-accent);
    pointer-events: none;
}

#location-search {
    width: 100%;
    height: 54px;
    padding: 0 48px 0 49px;
    border: 1px solid #cfd4df;
    border-radius: 12px;
    outline: none;
    color: var(--location-ink);
    background: #fff;
    appearance: none;
}

#location-search::-webkit-search-cancel-button {
    appearance: none;
}

#location-search:focus,
.language-control select:focus,
button:focus-visible,
a:focus-visible {
    border-color: var(--location-accent);
    outline: 3px solid rgba(79, 70, 229, 0.22);
    outline-offset: 2px;
}

.search-spinner {
    display: none;
    position: absolute;
    right: 17px;
    top: 17px;
    width: 20px;
    height: 20px;
    border: 2px solid #d8dbe4;
    border-top-color: var(--location-accent);
    border-radius: 50%;
    animation: location-spin 0.7s linear infinite;
}

.search-card.is-loading .search-spinner {
    display: block;
}

@keyframes location-spin {
    to { transform: rotate(360deg); }
}

.search-help {
    margin: 9px 0 0 2px;
    color: var(--location-muted);
    font-size: 12px;
}

.location-suggestions {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 7px);
    z-index: 30;
    max-height: 310px;
    margin: 0;
    padding: 7px;
    overflow-y: auto;
    list-style: none;
    border: 1px solid var(--location-line);
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(23, 32, 51, 0.16);
}

.location-suggestions.is-open {
    display: block;
}

.location-suggestion {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 11px 12px;
    border: 0;
    border-radius: 9px;
    color: var(--location-ink);
    background: transparent;
    text-align: left;
}

.location-suggestion:hover,
.location-suggestion.is-active,
.location-suggestion:focus-visible {
    outline: none;
    background: rgba(79, 70, 229, 0.07);
}

.suggestion-pin {
    margin-top: 3px;
    color: var(--location-accent);
    font-size: 11px;
}

.suggestion-primary,
.suggestion-secondary {
    display: block;
}

.suggestion-primary {
    font-size: 14px;
    font-weight: 700;
}

.suggestion-secondary {
    margin-top: 3px;
    color: var(--location-muted);
    font-size: 12px;
}

.map-card {
    position: relative;
    height: 560px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid #d7dbe4;
    border-radius: 8px;
    background: #e7ebf0;
    box-shadow: var(--location-shadow);
}

#location-map {
    width: 100%;
    height: 100%;
    --mpl-color-accent: #3db87a;
    --mpl-color-on-accent: #fff;
    --mpl-color-text-primary: #16352f;
    --mpl-color-text-muted: #6d8b83;
    --mpl-color-surface-glass: rgba(245, 250, 248, 0.97);
    --mpl-color-surface-subtle: rgba(61, 184, 122, 0.08);
    --mpl-color-surface-hover: rgba(61, 184, 122, 0.06);
    --mpl-color-border-subtle: rgba(61, 184, 122, 0.08);
    --mpl-color-border-tooltip: rgba(61, 184, 122, 0.15);
    --mpl-color-border-bar: rgba(61, 184, 122, 0.12);
    --mpl-panel-width: 170px;
    --mpl-font-size-small: 12px;
    --mpl-radius-panel: 14px;
    --mpl-radius-button: 9px;
    --mpl-shadow-panel: 0 12px 30px rgba(61, 184, 122, 0.16);
    --mpl-checklist-box-border: rgba(61, 184, 122, 0.46);
    --mpl-checklist-hover-bg: rgba(61, 184, 122, 0.05);
    --mpl-checklist-hover-border: rgba(61, 184, 122, 0.09);
    --mpl-checklist-selected-hover-bg: rgba(61, 184, 122, 0.03);
    --mpl-checklist-selected-hover-border: rgba(61, 184, 122, 0.11);
}

.location-marker-icon {
    border: 0;
    background: transparent;
}

.location-marker-icon svg {
    overflow: visible;
    filter: drop-shadow(0 3px 6px rgba(23, 32, 51, 0.38));
    transition: transform 0.15s ease;
    transform-origin: 50% 100%;
}

.location-marker-icon path {
    fill: var(--location-accent);
    stroke: #fff;
    stroke-width: 2px;
    stroke-linejoin: round;
}

.location-marker-icon circle {
    fill: #fff;
}

.location-marker-icon:hover svg,
.location-marker-icon:focus-visible svg {
    transform: translateY(-2px) scale(1.06);
}

.location-marker-icon:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

#location-map .mpl-consent-facade {
    background: radial-gradient(circle at top, #ffffff 0%, #f4f6fa 55%, #e9edf4 100%) !important;
}

/* Leaflet's default attribution includes a small Ukraine-flag icon
   (.leaflet-attribution-flag) next to the "Leaflet" credit link; hide the
   icon only, keep the required attribution link/text intact. */
.leaflet-attribution-flag {
    display: none !important;
}

.map-scroll-zoom-hint {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(22, 53, 47, 0.82);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.map-scroll-zoom-hint.is-visible {
    opacity: 1;
}

#location-map .mpl-consent-button {
    min-height: 44px;
    padding: 10px 20px !important;
    border-radius: 11px !important;
    background: var(--location-accent) !important;
}

/* Toolbar Design - Checklist Panel */
/* Add to your stylesheet */
.mpl.mpl-sidebar {
    --mpl-color-accent: #775dae;
    --mpl-color-on-accent: #ffffff;
    --mpl-color-surface-hover: rgba(119, 93, 174, 0.14);
    --mpl-color-border-subtle: rgba(119, 93, 174, 0.08);
    --mpl-color-border-tooltip: rgba(119, 93, 174, 0.15);
    --mpl-color-border-bar: rgba(119, 93, 174, 0.12);
    --mpl-panel-width: 170px;
    --mpl-font-size-small: 12px;
    --mpl-radius-panel: 14px;
    --mpl-radius-button: 9px;
    --mpl-color-text-primary: #16352f;
    --mpl-color-text-muted: #6d8b83;
    --mpl-color-surface-glass: rgba(245, 250, 248, 0.97);
    --mpl-color-surface-subtle: rgba(119, 93, 174, 0.08);
    --mpl-shadow-panel: 0 12px 30px rgba(119, 93, 174, 0.16);
    --mpl-checklist-box-border: rgba(119, 93, 174, 0.46);
    --mpl-checklist-hover-bg: rgba(119, 93, 174, 0.05);
    --mpl-checklist-hover-border: rgba(119, 93, 174, 0.09);
    --mpl-checklist-selected-hover-bg: rgba(119, 93, 174, 0.03);
    --mpl-checklist-selected-hover-border: rgba(119, 93, 174, 0.11);
}

/* Structural layout overrides */
.mpl.mpl-sidebar .mpl-maincontainer {
    border-top-left-radius: 14px !important;
    border-bottom-left-radius: 14px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.mpl.mpl-sidebar .mpl-toolbar-title::before {
    content: "Scores";
    font-size: var(--mpl-font-size-title) !important;
    font-weight: var(--mpl-font-weight-title) !important;
    color: var(--mpl-color-text-primary) !important;
    letter-spacing: -0.1px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
}

.mpl.mpl-sidebar .mpl-toolbar-title span {
    display: none !important;
}

.mpl.mpl-sidebar .mpl-toolbar-title {
    gap: 0 !important;
}

.mpl.mpl-sidebar .mpl-category-button-wrapper {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
    padding: 2px 10px 8px !important;
}

.mpl.mpl-sidebar .mpl-category-toggle-button {
    flex-direction: row !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 10px !important;
    min-height: 30px !important;
    padding: 0 28px 0 8px !important;
    border: none !important;
    background: transparent !important;
    border-top-left-radius: 9px !important;
    border-bottom-left-radius: 9px !important;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    transition: background-color 160ms ease, box-shadow 160ms ease !important;
}

.mpl.mpl-sidebar .mpl-category-toggle-button::before {
    content: "";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: 1.5px solid currentColor;
    border-radius: 4px;
    flex-shrink: 0;
    color: transparent;
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    background: transparent;
    border-color: var(--mpl-checklist-box-border);
}

.mpl.mpl-sidebar .mpl-category-toggle-button.mpl-category-selected::before {
    content: "✓";
    background: var(--mpl-color-accent);
    border-color: var(--mpl-color-accent);
    color: var(--mpl-color-on-accent);
    box-shadow: none;
}

.mpl.mpl-sidebar .mpl-category-toggle-button.mpl-category-selected {
    background: transparent !important;
    color: var(--mpl-color-text-primary) !important;
}

.mpl.mpl-sidebar .mpl-category-toggle-button:hover,
.mpl.mpl-sidebar .mpl-category-toggle-button.mpl-category-hover {
    background: var(--mpl-checklist-hover-bg) !important;
    box-shadow: inset 0 0 0 1px var(--mpl-checklist-hover-border) !important;
}

.mpl.mpl-sidebar .mpl-category-toggle-button.mpl-category-selected:hover,
.mpl.mpl-sidebar .mpl-category-toggle-button.mpl-category-selected.mpl-category-hover {
    background: var(--mpl-checklist-selected-hover-bg) !important;
    box-shadow: inset 0 0 0 1px var(--mpl-checklist-selected-hover-border) !important;
}

.mpl.mpl-sidebar .mpl-cat-main {
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    justify-content: flex-start !important;
}

.mpl.mpl-sidebar .mpl-cat-main span {
    margin-top: 0 !important;
    text-align: left !important;
}

.mpl.mpl-sidebar .mpl-category-toggle-button span,
.mpl.mpl-sidebar .mpl-category-toggle-button svg {
    margin: 0 !important;
    text-align: left !important;
}

.mpl.mpl-sidebar .mpl-category-toggle-button svg {
    width: 16px !important;
    flex-shrink: 0;
}

.mpl.mpl-sidebar .mpl-category-toggle-button.mpl-category-selected span,
.mpl.mpl-sidebar .mpl-category-toggle-button.mpl-category-selected svg,
.mpl.mpl-sidebar .mpl-category-toggle-button:hover svg {
    color: var(--mpl-color-text-primary) !important;
    fill: var(--mpl-color-text-primary) !important;
}

.mpl.mpl-sidebar .mpl-info-icon {
    top: 50% !important;
    right: 8px !important;
    transform: translateY(-50%) !important;
}


.widget-content {
    min-height: 116px;
}

.marker-widget-popup {
    width: min(440px, calc(100vw - 100px));
    color: var(--location-ink);
    font-family: "Open Sans", sans-serif;
}

.marker-widget-popup h2 {
    margin: 0 0 12px;
    font-size: 18px;
}

.marker-widget-popup .widget-kicker {
    margin-bottom: 5px;
    font-size: 10px;
}

.widget-loading,
.widget-error {
    min-height: 100px;
    display: grid;
    place-items: center;
    padding: 20px;
    border-radius: 12px;
    color: var(--location-muted);
    background: #f8fafc;
    font-size: 13px;
    text-align: center;
}

.widget-error {
    color: #9f342d;
    background: #fff5f4;
}

.mobile-widget-sheet {
    display: none;
}

.location-overview {
    margin-top: 28px;
    padding: 32px;
    border: 1px solid var(--location-line);
    border-radius: var(--location-radius-large);
    background: var(--location-surface);
    box-shadow: 0 12px 46px rgba(23, 32, 51, 0.06);
}

.section-kicker {
    margin-bottom: 8px;
}

.location-overview > h2,
.conversion-card h2 {
    margin: 0;
    font-size: clamp(28px, 3vw, 38px);
    letter-spacing: -0.035em;
}

.overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 9fr) minmax(0, 11fr);
    gap: 38px;
    align-items: baseline;
    margin-top: 28px;
}

.address-label {
    margin: 0 0 10px;
    color: var(--location-muted);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.12em;
}

.selected-address {
    margin: 0;
    font-size: 24px;
    line-height: 1.35;
    letter-spacing: -0.025em;
}

.selected-coordinates {
    margin: 10px 0 22px;
    color: var(--location-muted);
    font-size: 14px;
}

.address-explanation {
    max-width: 440px;
    margin: 0;
    color: var(--location-muted);
    font-size: 14px;
    line-height: 1.7;
}

.widget-panel {
    min-width: 0;
    padding: 20px 22px;
    border: 1px solid var(--location-line);
    border-radius: 16px;
    background: #f9fafc;
}

.widget-panel h3 {
    margin: 0 0 14px;
    font-size: 20px;
}

.widget-panel .mpl.mpl-widget {
    background: inherit !important;
    --mpl-color-text-muted: #666;
}

.conversion-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    margin-top: 28px;
    padding: 32px 36px;
    border-radius: var(--location-radius-large);
    color: #fff;
    background: var(--location-ink);
}

.conversion-card h2 {
    font-size: clamp(24px, 3vw, 34px);
}

.conversion-card p {
    margin: 8px 0 0;
    color: #c9d0de;
}

.conversion-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

.conversion-primary,
.conversion-secondary {
    padding: 13px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.conversion-primary {
    color: var(--location-ink);
    background: #fff;
}

.conversion-secondary {
    border: 1px solid #576176;
    color: #fff;
}

.location-footer {
    padding: 32px 0 40px;
    color: var(--location-muted);
    font-size: 12px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-inner p {
    margin: 0;
}

.footer-inner div {
    display: flex;
    gap: 18px;
}

@media (width < 1000px) {
    main {
        padding-top: 30px;
    }

    .map-card {
        height: 500px;
    }

    .overview-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .address-explanation {
        max-width: 660px;
    }

    .conversion-card {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (width < 768px) {
    .page-shell {
        width: 100%;
        max-width: min(calc(100vw - 32px), 680px);
    }

    .location-header {
        height: 62px;
    }

    .brand-link img {
        width: 116px;
    }

    .page-label,
    .header-link,
    .header-cta {
        display: none;
    }

    .language-control select {
        max-width: 124px;
        min-height: 40px;
    }

    main {
        padding-top: 30px;
    }

    .location-intro {
        margin-bottom: 26px;
    }

    .location-intro h1 {
        font-size: 1.75rem;
    }

    .intro-copy {
        margin-top: 16px;
        font-size: 16px;
    }

    .search-card {
        padding: 14px;
    }

    .search-card-header {
        gap: 10px;
    }

    .language-control label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .language-control svg {
        left: 13px;
    }

    .marker-widget-popup {
        width: min(320px, calc(100vw - 80px));
    }

    .map-card {
        height: clamp(390px, 112vw, 460px);
    }

    .mobile-widget-sheet {
        position: absolute;
        z-index: 1600;
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-height: calc(100% - 24px);
        padding: 15px 12px;
        overflow-y: auto;
        border: 1px solid rgba(215, 219, 228, 0.95);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 20px 52px rgba(23, 32, 51, 0.24);
        backdrop-filter: blur(12px);
    }

    .mobile-widget-sheet:not([hidden]) {
        display: block;
    }

    .widget-sheet-header {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 16px;
        margin-bottom: 12px;
    }

    .widget-kicker {
        margin-bottom: 4px;
        font-size: 10px;
    }

    .widget-sheet-header h2 {
        margin: 0;
        font-size: 17px;
    }

    .widget-close {
        width: 38px;
        height: 38px;
        flex: 0 0 auto;
        border: 1px solid var(--location-line);
        border-radius: 10px;
        color: var(--location-muted);
        background: #fff;
        font-size: 22px;
        line-height: 1;
    }

    .location-overview {
        margin-top: 18px;
        padding: 23px 18px;
        border-radius: 18px;
    }

    .overview-grid {
        margin-top: 22px;
        gap: 24px;
    }

    .selected-address {
        font-size: 21px;
    }

    .marker-instruction {
        padding: 16px;
    }

    .conversion-card {
        margin-top: 18px;
        padding: 26px 20px;
        border-radius: 18px;
    }

    .conversion-actions {
        width: 100%;
        flex-direction: column;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (width < 360px) {
    .page-shell {
        width: calc(100% - 24px);
    }

    .language-control select {
        width: 112px;
        padding-right: 25px;
        padding-left: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
