:root {
    --ink: #17211e;
    --ink-soft: #53625d;
    --ink-faint: #7c8985;
    --paper: #f5f7f5;
    --surface: #ffffff;
    --surface-soft: #edf3f0;
    --line: #dce5e1;
    --line-strong: #cbd8d3;
    --brand: #123d34;
    --brand-2: #176b5a;
    --brand-soft: #dff4eb;
    --accent: #c9f36b;
    --warning: #9a6700;
    --warning-soft: #fff6d9;
    --danger: #b42318;
    --danger-soft: #fff0ee;
    --info: #075985;
    --info-soft: #e8f6ff;
    --shadow-sm: 0 8px 24px rgba(24, 50, 42, .08);
    --shadow-md: 0 18px 50px rgba(17, 47, 39, .14);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --header-h: 68px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--paper);
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

button,
input {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    color: inherit;
}

svg {
    display: block;
}

.noscript {
    padding: 16px;
    color: #fff;
    background: var(--danger);
    text-align: center;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-h);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
    padding: 0 26px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
}

.brand {
    width: max-content;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--brand);
    text-decoration: none;
}

.brand-mark {
    width: 35px;
    height: 35px;
}

.brand-mark svg {
    width: 100%;
    height: 100%;
}

.brand-mark path:first-child {
    fill: var(--brand);
}

.brand-mark .brand-e {
    fill: var(--brand-soft);
}

.brand-word {
    font-size: 21px;
    font-weight: 760;
    letter-spacing: -.04em;
}

.brand-tag {
    margin-left: 2px;
    padding: 3px 6px 2px;
    color: var(--brand);
    border: 1px solid #a9d8c7;
    border-radius: 999px;
    background: var(--brand-soft);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f9fbfa;
}

.main-nav a {
    padding: 8px 14px;
    color: var(--ink-soft);
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    transition: .18s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--brand);
    background: var(--surface);
    box-shadow: 0 2px 10px rgba(28, 61, 52, .08);
}

.header-action {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 15px;
    color: #fff;
    border: 0;
    border-radius: 11px;
    background: var(--brand);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: .18s ease;
}

.header-action:hover {
    background: #0c3028;
    transform: translateY(-1px);
}

.header-action svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-app {
    height: calc(100svh - var(--header-h));
    min-height: 650px;
    display: grid;
    grid-template-columns: minmax(390px, 31vw) 1fr;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
}

.analysis-panel {
    position: relative;
    z-index: 10;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 34px 30px 44px;
    border-right: 1px solid var(--line);
    background: var(--paper);
    scrollbar-width: thin;
    scrollbar-color: #bccac5 transparent;
}

.analysis-panel::-webkit-scrollbar {
    width: 8px;
}

.analysis-panel::-webkit-scrollbar-thumb {
    border: 2px solid var(--paper);
    border-radius: 10px;
    background: #bccac5;
}

.intro-block {
    margin-bottom: 24px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--brand-2);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.eyebrow span {
    width: 21px;
    height: 2px;
    border-radius: 99px;
    background: var(--brand-2);
}

.intro-block h1 {
    max-width: 450px;
    margin: 0;
    font-size: clamp(30px, 2.5vw, 44px);
    line-height: 1.05;
    font-weight: 720;
    letter-spacing: -.045em;
}

.intro-block p {
    max-width: 560px;
    margin: 14px 0 0;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.65;
}

.coordinate-card,
.result-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.coordinate-card {
    padding: 20px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading.compact {
    margin: 0 2px 14px;
}

.section-heading > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
}

.step-number {
    display: grid;
    place-items: center;
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    color: var(--brand);
    border-radius: 9px;
    background: var(--brand-soft);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .05em;
}

.section-heading h2 {
    margin: 0;
    font-size: 15px;
    line-height: 1.2;
    font-weight: 760;
    letter-spacing: -.01em;
}

.icon-button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    color: var(--brand);
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #f8faf9;
    cursor: pointer;
    transition: .18s ease;
}

.icon-button:hover {
    border-color: #9fc9ba;
    background: var(--brand-soft);
}

.icon-button svg,
.text-button svg,
.primary-button svg,
.map-tools svg,
.screening-note svg,
.layers-foot svg,
.feature-card svg,
.result-icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.icon-button svg {
    width: 17px;
    height: 17px;
}

.mode-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
    margin-bottom: 17px;
    border-radius: 12px;
    background: var(--surface-soft);
}

.mode-tab {
    min-height: 36px;
    padding: 6px 10px;
    color: var(--ink-soft);
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    font-size: 12px;
    font-weight: 720;
    transition: .18s ease;
}

.mode-tab:hover {
    color: var(--ink);
}

.mode-tab.is-active {
    color: var(--brand);
    background: var(--surface);
    box-shadow: 0 2px 9px rgba(30, 57, 49, .09);
}

.mode-panel[hidden] {
    display: none !important;
}

.input-grid {
    display: grid;
    gap: 11px;
}

.input-grid.two-columns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: grid;
    gap: 6px;
}

.field > span {
    color: var(--ink-soft);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .02em;
}

.field input {
    width: 100%;
    height: 45px;
    padding: 0 12px;
    color: var(--ink);
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    outline: none;
    background: #fbfcfc;
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    transition: .18s ease;
}

.field input::placeholder {
    color: #a1aba7;
}

.field input:hover {
    border-color: #a7b9b2;
}

.field input:focus {
    border-color: var(--brand-2);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(23, 107, 90, .11);
}

.field input.is-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .09);
}

.field-help {
    margin: 8px 0 14px;
    color: var(--ink-faint);
    font-size: 11px;
    line-height: 1.45;
}

.primary-button,
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 750;
    transition: .18s ease;
}

.primary-button {
    width: 100%;
    min-height: 45px;
    padding: 0 16px;
    color: #fff;
    border: 0;
    background: var(--brand);
    box-shadow: 0 7px 16px rgba(18, 61, 52, .17);
    font-size: 13px;
}

.primary-button:hover {
    background: #0d332b;
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(18, 61, 52, .2);
}

.primary-button:active {
    transform: translateY(0);
}

.primary-button:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
}

.primary-button svg {
    width: 18px;
    height: 18px;
}

.secondary-button {
    min-height: 38px;
    padding: 0 14px;
    color: var(--brand);
    border: 1px solid #b9d7cc;
    background: var(--brand-soft);
    font-size: 12px;
}

.secondary-button:hover {
    border-color: #8dbba9;
    background: #d0eee2;
}

.map-mode-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 4px 0 0;
}

.map-mode-panel .secondary-button {
    grid-column: 1 / -1;
}

.map-mode-icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    color: var(--brand);
    border-radius: 12px;
    background: var(--brand-soft);
}

.map-mode-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.map-mode-panel strong {
    display: block;
    margin-top: 1px;
    font-size: 13px;
}

.map-mode-panel p {
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.5;
}

.form-message {
    margin-top: 12px;
    padding: 10px 12px;
    color: var(--danger);
    border: 1px solid #f2c8c3;
    border-radius: 10px;
    background: var(--danger-soft);
    font-size: 11px;
    line-height: 1.45;
}

.results-section {
    margin-top: 25px;
}

.text-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    color: var(--brand-2);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
}

.text-button:hover {
    color: var(--brand);
}

.text-button svg {
    width: 15px;
    height: 15px;
}

.empty-state {
    padding: 26px 24px;
    color: var(--ink-soft);
    border: 1px dashed #c8d5d0;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .5);
    text-align: center;
}

.empty-visual {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    margin: 0 auto 12px;
    color: #82a198;
    border-radius: 20px;
    background: #e7efec;
}

.empty-visual svg {
    width: 38px;
    height: 38px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.45;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.empty-state h3 {
    margin: 0;
    color: var(--ink);
    font-size: 14px;
}

.empty-state p {
    max-width: 340px;
    margin: 7px auto 0;
    font-size: 11px;
    line-height: 1.55;
}

.results-content {
    display: grid;
    gap: 12px;
}

.result-card {
    padding: 17px;
}

.result-card-head {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 14px;
}

.result-card-head.is-split {
    justify-content: space-between;
}

.result-card-head.is-split > div:first-child {
    display: flex;
    align-items: center;
    gap: 11px;
}

.result-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 12px;
}

.result-icon svg {
    width: 19px;
    height: 19px;
}

.result-icon.neutral {
    color: var(--brand);
    background: var(--brand-soft);
}

.result-icon.success {
    color: #12633d;
    background: #e1f7e9;
}

.result-icon.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.result-icon.info {
    color: var(--info);
    background: var(--info-soft);
}

.result-kicker {
    display: block;
    margin-bottom: 1px;
    color: var(--ink-faint);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.result-card h3 {
    margin: 0;
    font-size: 14px;
    line-height: 1.25;
}

.result-status {
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.result-status.clear {
    color: #166534;
    background: #dcfce7;
}

.result-status.intersects {
    color: #9a3412;
    background: #ffedd5;
}

.result-status.unavailable {
    color: #596662;
    background: #edf1ef;
}

.coordinate-output-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.coordinate-output {
    min-width: 0;
    padding: 11px;
    color: inherit;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafcfb;
    cursor: copy;
    text-align: left;
    transition: .18s ease;
}

.coordinate-output:hover {
    border-color: #a9c8bd;
    background: #f2f8f5;
}

.coordinate-output > span {
    display: block;
    margin-bottom: 3px;
    color: var(--ink-faint);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.coordinate-output strong {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 11px;
    font-weight: 720;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coordinate-output small {
    display: block;
    margin-top: 3px;
    color: var(--ink-faint);
    font-size: 8px;
}

.result-body {
    color: var(--ink-soft);
    font-size: 12px;
}

.result-lead {
    margin: 0 0 13px;
    color: var(--ink);
    font-size: 13px;
    line-height: 1.5;
}

.result-lead strong {
    color: var(--brand);
    font-weight: 780;
}

.metric-grid {
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    gap: 8px;
}

.metric {
    min-width: 0;
    padding: 10px 11px;
    border-radius: 11px;
    background: #f4f7f6;
}

.metric span {
    display: block;
    margin-bottom: 2px;
    color: var(--ink-faint);
    font-size: 9px;
    font-weight: 760;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 12px;
    font-weight: 740;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metric small {
    display: block;
    margin-top: 2px;
    color: var(--ink-faint);
    font-size: 9px;
}

.site-list {
    display: grid;
    gap: 6px;
    margin: 10px 0 0;
    padding: 0;
    list-style: none;
}

.site-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfc;
}

.site-list li div {
    min-width: 0;
}

.site-list strong {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.site-list span {
    color: var(--ink-faint);
    font-size: 9px;
}

.site-list b {
    flex: 0 0 auto;
    color: var(--brand);
    font-size: 10px;
}

.result-meta {
    margin: 12px 0 0;
    padding-top: 10px;
    color: var(--ink-faint);
    border-top: 1px solid var(--line);
    font-size: 9px;
    line-height: 1.5;
}

.result-placeholder {
    min-height: 142px;
}

.skeleton-card {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.skeleton-line,
.skeleton-box {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #e9efec;
}

.skeleton-line::after,
.skeleton-box::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
    transform: translateX(-100%);
    animation: shimmer 1.25s infinite;
}

.skeleton-line {
    width: 58%;
    height: 12px;
    margin-bottom: 12px;
}

.skeleton-line.short {
    width: 34%;
    height: 9px;
}

.skeleton-box {
    width: 100%;
    height: 58px;
    margin-top: 12px;
}

@keyframes shimmer {
    to { transform: translateX(100%); }
}

.local-results {
    display: grid;
    gap: 12px;
}

.pending-layers-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 14px;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .68);
    font-size: 10px;
    line-height: 1.5;
}

.pending-layers-card svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin-top: 1px;
    color: var(--brand-2);
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.screening-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px 13px;
    color: #6b5b32;
    border: 1px solid #eadca8;
    border-radius: 14px;
    background: #fffaf0;
}

.screening-note svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.screening-note p {
    margin: 0;
    font-size: 9px;
    line-height: 1.55;
}

.map-stage {
    position: relative;
    min-width: 0;
    overflow: hidden;
    background: #d9e1de;
}

#map {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: #dbe4e0;
}

.leaflet-container {
    font-family: inherit;
}

.leaflet-control-zoom,
.leaflet-control-layers {
    overflow: hidden;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 9px 30px rgba(20, 47, 39, .18) !important;
}

.leaflet-control-zoom a {
    width: 36px !important;
    height: 36px !important;
    color: var(--brand) !important;
    border-color: var(--line) !important;
    line-height: 35px !important;
}

.leaflet-control-layers-toggle {
    width: 38px !important;
    height: 38px !important;
    background-size: 20px 20px !important;
}

.leaflet-control-layers-expanded {
    padding: 10px 12px !important;
    color: var(--ink);
    border-radius: 13px !important;
    font-size: 12px;
}

.leaflet-control-scale-line {
    color: var(--ink) !important;
    border-color: rgba(23, 33, 30, .55) !important;
    background: rgba(255, 255, 255, .78) !important;
    backdrop-filter: blur(6px);
}

.leaflet-popup-content-wrapper {
    border-radius: 14px;
    box-shadow: 0 12px 38px rgba(17, 44, 36, .22);
}

.leaflet-popup-content {
    margin: 14px 16px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.5;
}

.map-badge,
.cursor-coordinates,
.map-pick-notice,
.map-tools,
.layers-panel,
.toast {
    position: absolute;
    z-index: 600;
}

.source-badge {
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    color: var(--brand);
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 7px 24px rgba(18, 52, 43, .13);
    backdrop-filter: blur(8px);
    font-size: 10px;
    font-weight: 750;
}

.live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #1fa66b;
    box-shadow: 0 0 0 4px rgba(31, 166, 107, .13);
}

.map-tools {
    top: 70px;
    right: 12px;
    display: grid;
    gap: 1px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 13px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 10px 30px rgba(18, 50, 41, .17);
    backdrop-filter: blur(8px);
}

.map-tools button {
    width: 39px;
    height: 39px;
    display: grid;
    place-items: center;
    color: var(--brand);
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    cursor: pointer;
    transition: .15s ease;
}

.map-tools button:last-child {
    border-bottom: 0;
}

.map-tools button:hover {
    background: var(--brand-soft);
}

.map-tools svg {
    width: 18px;
    height: 18px;
}

.cursor-coordinates {
    right: 14px;
    bottom: 18px;
    max-width: calc(100% - 28px);
    padding: 7px 10px;
    color: #263934;
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 9px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 7px 20px rgba(18, 47, 39, .12);
    backdrop-filter: blur(8px);
    font-size: 9px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cursor-coordinates b {
    color: var(--brand);
    font-weight: 760;
}

.map-pick-notice {
    top: 18px;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px 9px 13px;
    color: #fff;
    border-radius: 999px;
    background: rgba(18, 61, 52, .95);
    box-shadow: 0 12px 32px rgba(18, 61, 52, .28);
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.map-pick-notice button {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    padding: 0;
    color: #fff;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
}

.pulse-ring {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(201, 243, 107, .55);
    animation: pulse 1.45s infinite;
}

@keyframes pulse {
    70% { box-shadow: 0 0 0 8px rgba(201, 243, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(201, 243, 107, 0); }
}

.layers-panel {
    top: 14px;
    right: 14px;
    width: min(350px, calc(100% - 28px));
    max-height: calc(100% - 28px);
    overflow-y: auto;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 20px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    opacity: 0;
    pointer-events: none;
    transform: translateX(16px) scale(.985);
    transform-origin: top right;
    transition: opacity .18s ease, transform .18s ease;
}

.layers-panel.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0) scale(1);
}

.layers-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.layers-head span {
    display: block;
    margin-bottom: 2px;
    color: var(--brand-2);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.layers-head h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: -.02em;
}

.layers-head button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--ink-soft);
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #f7f9f8;
    cursor: pointer;
    font-size: 21px;
    line-height: 1;
}

.layers-intro {
    margin: 8px 0 17px;
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.55;
}

.layers-list {
    display: grid;
    gap: 15px;
}

.layer-group {
    display: grid;
    gap: 7px;
}

.layer-group-title {
    color: var(--ink-faint);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.layer-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fbfcfc;
}

.layer-row.is-unavailable {
    opacity: .65;
}

.layer-copy {
    min-width: 0;
}

.layer-copy strong {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    font-size: 11px;
}

.layer-copy strong span {
    padding: 2px 5px;
    color: var(--brand-2);
    border-radius: 999px;
    background: var(--brand-soft);
    font-size: 7px;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.layer-copy p {
    margin: 3px 0 0;
    color: var(--ink-faint);
    font-size: 9px;
    line-height: 1.4;
}

.layer-switch {
    position: relative;
    width: 38px;
    height: 22px;
    display: inline-block;
}

.layer-switch input {
    width: 1px;
    height: 1px;
    position: absolute;
    opacity: 0;
}

.layer-switch span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #cbd5d1;
    cursor: pointer;
    transition: .18s ease;
}

.layer-switch span::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(31, 52, 46, .22);
    content: "";
    transition: .18s ease;
}

.layer-switch input:checked + span {
    background: var(--brand-2);
}

.layer-switch input:checked + span::after {
    transform: translateX(16px);
}

.layer-switch input:focus-visible + span {
    outline: 3px solid rgba(23, 107, 90, .18);
    outline-offset: 2px;
}

.layer-switch input:disabled + span {
    cursor: not-allowed;
}

.layers-foot {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding-top: 14px;
    color: var(--ink-faint);
    border-top: 1px solid var(--line);
}

.layers-foot svg {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin-top: 1px;
}

.layers-foot p {
    margin: 0;
    font-size: 9px;
    line-height: 1.5;
}

.layer-loading {
    display: grid;
    gap: 8px;
}

.layer-loading span {
    height: 58px;
    border-radius: 13px;
    background: linear-gradient(90deg, #edf2f0, #f8faf9, #edf2f0);
    background-size: 200% 100%;
    animation: loadingGradient 1.2s linear infinite;
}

@keyframes loadingGradient {
    to { background-position: -200% 0; }
}

.toast {
    left: 50%;
    bottom: 52px;
    max-width: min(420px, calc(100% - 28px));
    padding: 10px 14px;
    color: #fff;
    border-radius: 11px;
    background: rgba(17, 44, 36, .94);
    box-shadow: 0 12px 35px rgba(17, 44, 36, .25);
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 650;
    text-align: center;
}

.selected-marker-wrap {
    background: transparent;
    border: 0;
}

.selected-marker {
    position: relative;
    width: 26px;
    height: 26px;
    border: 4px solid #fff;
    border-radius: 50% 50% 50% 0;
    background: var(--brand);
    box-shadow: 0 7px 18px rgba(7, 41, 33, .36);
    transform: rotate(-45deg);
}

.selected-marker::after {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    content: "";
}

.nearest-point-marker {
    width: 12px;
    height: 12px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #d97706;
    box-shadow: 0 3px 10px rgba(90, 53, 10, .32);
}

.map-stage.is-picking #map {
    cursor: crosshair;
}

.content-section {
    padding: 90px 30px;
}

.content-wrap {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.tools-section {
    background: #fff;
}

.section-copy {
    max-width: 690px;
}

.section-label {
    display: block;
    margin-bottom: 13px;
    color: var(--brand-2);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.section-copy h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 50px);
    line-height: 1.07;
    font-weight: 680;
    letter-spacing: -.045em;
}

.section-copy p {
    margin: 17px 0 0;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.7;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 46px;
}

.feature-card {
    position: relative;
    min-height: 245px;
    padding: 26px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #f8faf9;
}

.feature-card::after {
    position: absolute;
    right: -50px;
    bottom: -70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(201,243,107,.22), rgba(201,243,107,0) 70%);
    content: "";
}

.feature-number {
    position: absolute;
    top: 24px;
    right: 24px;
    color: #9eaaa6;
    font-size: 11px;
    font-weight: 800;
}

.feature-card > svg {
    width: 36px;
    height: 36px;
    margin-bottom: 39px;
    color: var(--brand-2);
}

.feature-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
    letter-spacing: -.02em;
}

.feature-card p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.65;
}

.sources-section {
    color: #eaf2ef;
    background: var(--brand);
}

.sources-layout {
    display: grid;
    grid-template-columns: .86fr 1.14fr;
    gap: 80px;
    align-items: start;
}

.sources-section .section-label {
    color: #9ee1c8;
}

.sources-section .section-copy p {
    color: #b9cbc5;
}

.source-list {
    display: grid;
    gap: 10px;
}

.source-list article {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    padding: 18px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 16px;
    background: rgba(255,255,255,.055);
}

.source-status {
    min-width: 57px;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .06em;
    text-align: center;
    text-transform: uppercase;
}

.source-status.active {
    color: #113e31;
    background: #bdf4d8;
}

.source-status.pending {
    color: #e7f1ed;
    background: rgba(255,255,255,.13);
}

.source-list h3 {
    margin: 0 0 4px;
    font-size: 14px;
}

.source-list p {
    margin: 0;
    color: #b9cbc5;
    font-size: 11px;
    line-height: 1.55;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 25px 30px;
    border-top: 1px solid var(--line);
    background: #fff;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-brand img {
    border-radius: 9px;
}

.footer-brand strong,
.footer-brand span {
    display: block;
}

.footer-brand strong {
    color: var(--brand);
    font-size: 13px;
}

.footer-brand span,
.site-footer > p {
    color: var(--ink-faint);
    font-size: 9px;
}

.site-footer > p {
    margin: 0;
    text-align: right;
}

@media (max-width: 1100px) {
    .site-header {
        grid-template-columns: 1fr auto;
    }

    .main-nav {
        display: none;
    }

    .map-app {
        grid-template-columns: minmax(370px, 42vw) 1fr;
    }

    .analysis-panel {
        padding-inline: 24px;
    }

    .sources-layout {
        gap: 46px;
    }
}

@media (max-width: 820px) {
    :root {
        --header-h: 62px;
    }

    .site-header {
        padding: 0 16px;
    }

    .brand-mark {
        width: 32px;
        height: 32px;
    }

    .brand-word {
        font-size: 19px;
    }

    .header-action {
        min-height: 38px;
        padding: 0 12px;
    }

    .map-app {
        height: auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .analysis-panel {
        width: 100%;
        max-height: none;
        overflow: visible;
        padding: 28px 18px 34px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .intro-block h1 {
        font-size: 36px;
    }

    .map-stage {
        height: 68svh;
        min-height: 500px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .feature-card {
        min-height: 215px;
    }

    .sources-layout {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .content-section {
        padding: 68px 20px;
    }
}

@media (max-width: 520px) {
    .brand-tag {
        display: none;
    }

    .header-action {
        width: 40px;
        padding: 0;
        justify-content: center;
        font-size: 0;
    }

    .header-action svg {
        width: 19px;
        height: 19px;
    }

    .analysis-panel {
        padding-inline: 14px;
    }

    .intro-block h1 {
        font-size: 32px;
    }

    .intro-block p {
        font-size: 13px;
    }

    .coordinate-card,
    .result-card {
        border-radius: 19px;
    }

    .coordinate-card {
        padding: 16px;
    }

    .input-grid.two-columns,
    .coordinate-output-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .coordinate-output strong {
        white-space: normal;
    }

    .map-stage {
        min-height: 470px;
    }

    .source-badge {
        top: 12px;
        left: 12px;
    }

    .map-tools {
        top: 60px;
        right: 10px;
    }

    .cursor-coordinates {
        right: 10px;
        bottom: 15px;
        max-width: calc(100% - 20px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .map-pick-notice {
        top: 12px;
        max-width: calc(100% - 110px);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .layers-panel {
        top: 10px;
        right: 10px;
        width: calc(100% - 20px);
        max-height: calc(100% - 20px);
        border-radius: 18px;
    }

    .content-section {
        padding: 56px 16px;
    }

    .section-copy h2 {
        font-size: 34px;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px 18px;
    }

    .site-footer > p {
        text-align: left;
    }
}

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