@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
    --ink: #17211f;
    --paper: #fbfaf6;
    --accent: #cb4b2f;
    --teal: #136f63;
    --line: #d8d7cf;
}

* { box-sizing: border-box; }

html, body, .map-shell { height: 100%; margin: 0; }

body {
    color: var(--ink);
    background: var(--paper);
    font-family: "Source Sans 3", sans-serif;
}

button, input { font: inherit; }

.map-shell { display: grid; }

.map-workspace { position: relative; min-height: 0; overflow: hidden; }
#map { width: 100%; height: 100%; background: #dce5df; }
.map-unavailable { background: repeating-linear-gradient(135deg, #e7ebe6 0, #e7ebe6 18px, #dde3de 18px, #dde3de 36px); }

.search-control {
    position: absolute;
    z-index: 2;
    top: 18px;
    left: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    width: min(420px, calc(100% - 36px));
    border: 1px solid rgba(23, 33, 31, 0.18);
    border-radius: 4px;
    background: white;
    box-shadow: 0 5px 22px rgba(23, 33, 31, 0.18);
}

.search-control input {
    min-width: 0;
    height: 46px;
    padding: 0 14px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 17px;
}

.search-control input:focus { box-shadow: inset 3px 0 var(--accent); }

.icon-button {
    border: 0;
    background: transparent;
    color: #5d6663;
    cursor: pointer;
    font-size: 25px;
}

.icon-button:hover { color: var(--accent); }

.locate-button {
    position: absolute;
    z-index: 2;
    top: 118px;
    right: 10px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 2px;
    background: white;
    color: #666;
    box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.locate-button:hover { color: #333; }
.locate-button:active { color: #111; }

.gm-fullscreen-control { top: 58px !important; }
.gm-bundled-control > .gm-svpc { top: 10px !important; }
.gm-bundled-control > .gm-svpc ~ .gmnoprint { top: 60px !important; }

.location-target {
    position: relative;
    display: block;
    width: 32px;
    height: 32px;
    margin: auto;
    background:
        linear-gradient(currentColor, currentColor) center / 100% 3px no-repeat,
        linear-gradient(currentColor, currentColor) center / 3px 100% no-repeat;
}

.location-target::before {
    position: absolute;
    inset: 5px;
    border: 3px solid currentColor;
    border-radius: 50%;
    background: white;
    content: "";
}

.location-target::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
    transform: translate(-50%, -50%);
}

.boundary-panel {
    position: absolute;
    z-index: 2;
    top: 82px;
    left: 18px;
    width: min(420px, calc(100% - 36px));
    max-height: calc(100% - 118px);
    padding: 20px;
    overflow: auto;
    border-left: 5px solid var(--accent);
    border-radius: 0 4px 4px 0;
    background: var(--paper);
    box-shadow: 0 8px 28px rgba(23, 33, 31, 0.22);
}

.panel-close { position: absolute; top: 5px; right: 7px; }
.selection-label, .boundary-type { margin: 0 32px 8px 0; color: #68716e; font-size: 14px; }
.boundary-type { margin-top: 18px; color: var(--teal); font-weight: 700; text-transform: uppercase; }
.boundary-panel h2 { margin: 0; font-size: 25px; letter-spacing: 0; }
.detail-loading { margin: 18px 0 0; }

.boundary-tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.boundary-tabs button {
    padding: 8px 10px;
    border: 0;
    border-bottom: 3px solid transparent;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
}
.boundary-tabs button[aria-selected="true"] { border-color: var(--accent); font-weight: 700; }

.map-status {
    position: absolute;
    z-index: 3;
    right: 72px;
    top: 18px;
    max-width: min(430px, calc(100% - 90px));
    padding: 10px 14px;
    border-radius: 4px;
    background: var(--ink);
    color: white;
    box-shadow: 0 4px 16px rgba(23, 33, 31, 0.2);
}
.map-status--error { background: #8f2f20; }
.is-loading::before {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 8px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    vertical-align: -2px;
    content: "";
    animation: spin 0.7s linear infinite;
}

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

.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;
}

[hidden] { display: none !important; }

@media (max-width: 620px) {
    .search-control { top: 12px; left: 12px; width: calc(100% - 76px); }
    .boundary-panel { top: auto; bottom: 0; left: 0; width: 100%; max-height: 48%; border-left: 0; border-top: 5px solid var(--accent); border-radius: 0; }
    .map-status { top: 70px; right: 12px; }
}