:root {
    --green: #173129;
    --green-2: #23483b;
    --sand: #d6bc92;
    --cream: #f5f2e9;
    --paper: #fdfbf7;
    --border: #d8cdbd;
    --text: #1f2925;
    --muted: #627069;
    --blue: #2677b8;
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background: var(--paper);
    color: var(--text);
}

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.wok-map-app {
    position: absolute;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
        "topbar topbar"
        "actions actions"
        "progress progress"
        "tools tools"
        "map map"
        "footer footer";
    min-height: 100%;
    background: var(--paper);
}

.wok-map-topbar {
    grid-area: topbar;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem .8rem;
    color: #fff;
    background: var(--green);
}

.wok-map-eyebrow {
    display: block;
    margin-bottom: .15rem;
    color: var(--sand);
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.wok-map-topbar h1 {
    margin: 0;
    color: #fff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.55rem, 4vw, 2.2rem);
    line-height: 1;
}

.wok-map-status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    max-width: 48%;
    padding: .46rem .7rem;
    color: var(--green);
    background: var(--cream);
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.15;
    text-align: center;
}

.wok-map-status::before {
    width: .48rem;
    height: .48rem;
    flex: 0 0 auto;
    background: #aa7d35;
    border-radius: 50%;
    content: "";
}

.wok-map-status.is-ready::before {
    background: #2f8b59;
}

.wok-map-status.is-offline::before,
.wok-map-status.is-error::before {
    background: #b44b42;
}

.wok-map-actions {
    grid-area: actions;
    display: flex;
    gap: .55rem;
    overflow-x: auto;
    padding: .8rem 1rem .5rem;
    background: var(--paper);
    scrollbar-width: none;
}

.wok-map-actions::-webkit-scrollbar,
.wok-map-filters::-webkit-scrollbar {
    display: none;
}

.wok-location-help {
    margin: .1rem 1.2rem .8rem;
    padding: .75rem .9rem;
    color: #173129;
    background: #fff8e8;
    border: 1px solid #d6bc92;
    border-radius: 10px;
    font-size: .86rem;
    line-height: 1.45;
}

.wok-btn {
    flex: 0 0 auto;
    min-height: 42px;
    padding: .62rem .9rem;
    border: 1.5px solid var(--green);
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
}

.wok-btn:focus-visible,
.wok-map-filters button:focus-visible,
.wok-map-reset:focus-visible,
.wok-place-card button:focus-visible,
.wok-place-card a:focus-visible,
.wok-map-search input:focus-visible {
    outline: 3px solid rgba(214, 188, 146, .8);
    outline-offset: 2px;
}

.wok-btn-primary {
    color: #fff;
    background: var(--green);
}

.wok-btn-download {
    color: var(--green);
    background: var(--sand);
    border-color: var(--sand);
}

.wok-btn-quiet {
    color: var(--green);
    background: transparent;
}

.wok-btn:disabled {
    cursor: wait;
    opacity: .62;
}

.wok-download-progress {
    grid-area: progress;
    padding: .35rem 1rem .7rem;
    background: var(--paper);
}

.wok-download-progress-track {
    height: 7px;
    overflow: hidden;
    background: #e3ded4;
    border-radius: 999px;
}

.wok-download-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--green);
    border-radius: inherit;
    transition: width .2s ease;
}

.wok-download-progress p {
    margin: .3rem 0 0;
    color: var(--muted);
    font-size: .75rem;
}

.wok-map-tools {
    position: relative;
    z-index: 5;
    grid-area: tools;
    display: grid;
    grid-template-columns: minmax(210px, 340px) 1fr;
    gap: .65rem;
    align-items: center;
    padding: .4rem 1rem .85rem;
    background: var(--paper);
}

.wok-map-search {
    position: relative;
    display: block;
}

.wok-map-search input {
    width: 100%;
    min-height: 43px;
    padding: .66rem 2.2rem .66rem .85rem;
    color: var(--text);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.wok-map-search > span:last-child {
    position: absolute;
    top: 50%;
    right: .8rem;
    color: var(--green);
    font-size: 1.2rem;
    transform: translateY(-50%);
}

.wok-search-results {
    position: absolute;
    top: calc(100% - .65rem);
    left: 1rem;
    z-index: 20;
    width: min(340px, calc(100% - 2rem));
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(23, 49, 41, .18);
}

.wok-search-results button {
    display: block;
    width: 100%;
    padding: .72rem .85rem;
    color: var(--text);
    background: #fff;
    border: 0;
    border-bottom: 1px solid #eee7dc;
    text-align: left;
}

.wok-search-results button:last-child {
    border-bottom: 0;
}

.wok-search-results button:hover {
    background: var(--cream);
}

.wok-search-results small {
    display: block;
    margin-top: .1rem;
    color: var(--muted);
    text-transform: capitalize;
}

.wok-map-filters {
    display: flex;
    justify-content: flex-end;
    gap: .42rem;
    overflow-x: auto;
    scrollbar-width: none;
}

.wok-map-filters button {
    flex: 0 0 auto;
    min-height: 38px;
    padding: .53rem .78rem;
    color: var(--green);
    background: var(--cream);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 750;
}

.wok-map-filters button.is-active {
    color: #fff;
    background: var(--green);
}

.wok-map-stage {
    position: relative;
    grid-area: map;
    min-height: 470px;
}

#map {
    position: absolute;
    inset: 0;
}

.maplibregl-ctrl-top-right {
    top: .5rem;
    right: .5rem;
}

.maplibregl-ctrl-group {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(23, 49, 41, .18) !important;
}

.maplibregl-ctrl-attrib {
    font-size: 9px;
}

.wok-marker {
    position: absolute;
    display: grid;
    width: 31px;
    height: 31px;
    place-items: center;
    color: #fff;
    background: var(--green);
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 3px 9px rgba(0, 0, 0, .28);
    font-size: .7rem;
    font-weight: 900;
}

.wok-marker span {
    transform: none;
}

.wok-marker[data-type="gate"] {
    color: var(--green);
    background: var(--sand);
}

.wok-marker[data-type="lodge"] {
    color: #fff;
    background: #7d5638;
    border-radius: 9px 9px 9px 2px;
}

.wok-marker[data-type="nearby"] {
    color: var(--green);
    background: #fff;
    border-color: var(--sand);
    border-radius: 9px 9px 9px 2px;
}

.wok-marker.is-saved::after {
    position: absolute;
    top: -7px;
    right: -7px;
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    color: #fff;
    background: #a34843;
    border: 1px solid #fff;
    border-radius: 50%;
    content: "♥";
    font-size: 8px;
    transform: none;
}

.wok-user-marker {
    width: 20px;
    height: 20px;
    background: var(--blue);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 7px rgba(38, 119, 184, .24), 0 3px 10px rgba(0, 0, 0, .24);
}

.wok-map-legend {
    position: absolute;
    bottom: .8rem;
    left: .7rem;
    z-index: 4;
    display: grid;
    grid-template-columns: auto auto;
    gap: .35rem .8rem;
    padding: .58rem .68rem;
    color: var(--text);
    background: rgba(253, 251, 247, .94);
    border: 1px solid rgba(216, 205, 189, .9);
    border-radius: 9px;
    box-shadow: 0 4px 15px rgba(23, 49, 41, .12);
    font-size: .68rem;
    font-weight: 700;
    backdrop-filter: blur(7px);
}

.wok-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.legend-line {
    display: inline-block;
    width: 20px;
    height: 0;
    border-top: 3px solid #735c3c;
}

.legend-gravel {
    border-top: 2px dashed #a78c63;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border: 1px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px var(--green);
}

.legend-gate {
    background: var(--sand);
}

.legend-camp {
    background: var(--green);
}

.legend-lodge {
    background: #7d5638;
    border-radius: 3px 3px 3px 1px;
}

.wok-map-reset {
    position: absolute;
    top: .7rem;
    left: .7rem;
    z-index: 4;
    padding: .53rem .7rem;
    color: var(--green);
    background: rgba(253, 251, 247, .95);
    border: 1px solid var(--border);
    border-radius: 9px;
    box-shadow: 0 4px 15px rgba(23, 49, 41, .13);
    font-size: .72rem;
    font-weight: 800;
}

.wok-place-card {
    position: absolute;
    right: 1rem;
    bottom: 4.7rem;
    z-index: 12;
    width: min(340px, calc(100% - 2rem));
    padding: 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 16px 42px rgba(23, 49, 41, .24);
}

.wok-place-close {
    position: absolute;
    top: .65rem;
    right: .7rem;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: var(--green);
    background: var(--cream);
    border: 0;
    border-radius: 50%;
    font-size: 1.25rem;
}

.wok-place-type {
    display: block;
    margin: 0 2.2rem .35rem 0;
    color: #806a47;
    font-size: .69rem;
    font-weight: 850;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.wok-place-card h2 {
    margin: 0 2.2rem .5rem 0;
    color: var(--green);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    line-height: 1.08;
}

.wok-place-card p {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: .87rem;
    line-height: 1.5;
}

.wok-place-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.wok-place-actions a,
.wok-place-actions button {
    color: var(--green);
    font-size: .8rem;
    font-weight: 850;
    text-decoration: none;
}

.wok-place-actions button {
    padding: .48rem .7rem;
    background: var(--cream);
    border: 0;
    border-radius: 999px;
}

.wok-map-footer {
    grid-area: footer;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .78rem 1rem;
    color: var(--muted);
    background: var(--cream);
    font-size: .69rem;
}

.wok-map-footer p {
    margin: 0;
    line-height: 1.4;
}

@media (max-width: 680px) {
    .wok-map-topbar {
        padding: .85rem .9rem .72rem;
    }

    .wok-map-status {
        max-width: 52%;
        padding: .4rem .55rem;
        font-size: .68rem;
    }

    .wok-map-actions {
        padding: .7rem .75rem .4rem;
    }

    .wok-btn {
        min-height: 40px;
        padding: .56rem .72rem;
        font-size: .76rem;
    }

    .wok-map-tools {
        grid-template-columns: 1fr;
        gap: .5rem;
        padding: .35rem .75rem .7rem;
    }

    .wok-search-results {
        top: 55px;
        left: .75rem;
        width: calc(100% - 1.5rem);
    }

    .wok-map-filters {
        justify-content: flex-start;
    }

    .wok-map-stage {
        min-height: 410px;
    }

    .wok-map-legend {
        grid-template-columns: 1fr 1fr;
        right: .55rem;
        bottom: .55rem;
        left: .55rem;
        font-size: .62rem;
    }

    .wok-place-card {
        right: .6rem;
        bottom: 4.6rem;
        width: calc(100% - 1.2rem);
        padding: 1.05rem;
    }

    .wok-map-footer {
        display: block;
        padding: .7rem .8rem;
    }

    .wok-map-footer p + p {
        margin-top: .3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
