:root {
    --ink: #16231e;
    --muted: #65736c;
    --line: #dbe3de;
    --paper: #f7f9f7;
    --green: #096b48;
    --dark: #12332a;
    --lime: #c6f36c;
    --blue: #3cc6dd;
}
* {
    box-sizing: border-box;
}
body {
    margin: 0;
    font:
        14px/1.4 Inter,
        Segoe UI,
        Arial,
        sans-serif;
    color: var(--ink);
    background: #dce4df;
    display: flex;
    height: 100vh;
    overflow: hidden;
}
.sidebar {
    width: 360px;
    background: var(--paper);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    z-index: 2;
}
.brand {
    padding: 25px 22px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.brand strong {
    font-size: 19px;
    display: block;
}
.brand small,
.eyebrow,
.tool-label {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.brand-mark {
    background: var(--green);
    color: white;
    border-radius: 10px;
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    font-size: 22px;
}
.button,
.tool-group button,
.icon-button {
    border: 0;
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    padding: 8px 11px;
    color: var(--ink);
    background: #edf1ee;
}
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.primary {
    background: var(--green);
    color: #fff;
}
.secondary {
    border: 1px solid var(--line);
    background: white;
}
.search {
    margin: 0 18px 12px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 8px 10px;
    display: flex;
    gap: 8px;
}
.search input {
    border: 0;
    outline: 0;
    width: 100%;
    font: inherit;
}
.catalog-summary {
    padding: 0 22px 10px;
    color: var(--muted);
    font-size: 12px;
}
.catalog {
    overflow: auto;
    padding: 0 10px 10px;
}
.service {
    width: 100%;
    background: transparent;
    border: 0;
    border-radius: 8px;
    text-align: left;
    padding: 12px;
    cursor: pointer;
    display: flex;
    gap: 10px;
}
.service:hover,
.service.active {
    background: #e6f1eb;
}
.service .pin {
    color: var(--green);
    font-size: 18px;
    line-height: 18px;
}
.service strong {
    display: block;
    font-size: 13px;
}
.service small {
    display: block;
    color: var(--muted);
    margin-top: 3px;
    font-size: 11px;
}
.sidebar-footer {
    font-size: 11px;
    color: var(--muted);
    padding: 12px 22px;
    border-top: 1px solid var(--line);
}
.viewer-shell {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.topbar {
    height: 74px;
    flex: 0 0 74px;
    background: white;
    position: relative;
    z-index: 4;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 1px 4px #122a1c14;
}
.topbar h1 {
    font-size: 17px;
    margin: 1px 0 0;
}
.top-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}
.icon-button {
    font-size: 20px;
    width: 38px;
    height: 38px;
    padding: 0;
    background: var(--dark);
    color: var(--lime);
    border: 1px solid #2a5b4c;
    transition:
        transform 0.2s,
        background 0.2s;
}
.icon-button:hover {
    transform: rotate(18deg) scale(1.08);
    background: var(--green);
}
.top-actions .button {
    min-width: 130px;
}
#viewDiv {
    height: auto;
    width: 100%;
    flex: 1;
    min-height: 0;
}
.analysis-panel {
    position: absolute;
    z-index: 3;
    top: 92px;
    right: 22px;
    width: min(440px, calc(100% - 44px));
    max-height: calc(100vh - 152px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(145deg, #fcfffd, #e8f5ed);
    border: 1px solid #b7d9c4;
    border-radius: 16px;
    box-shadow: 0 18px 48px #0d2c2040;
    overflow: hidden;
}
.analysis-panel[hidden] {
    display: none;
}
.analysis-panel__header {
    padding: 16px 18px 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    background: linear-gradient(110deg, #123b30, #096b48);
    color: #fff;
}
.analysis-panel__eyebrow {
    font-size: 10px;
    letter-spacing: 0.12em;
    color: var(--lime);
    font-weight: 700;
}
.analysis-panel h2 {
    font-size: 18px;
    margin: 2px 0 0;
}
.analysis-panel__close {
    border: 1px solid #ffffff55;
    background: #ffffff18;
    color: #fff;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}
.analysis-panel__close:hover {
    background: #ffffff32;
}
.analysis-panel__hint {
    margin: 0;
    padding: 10px 18px;
    color: #496359;
    font-size: 12px;
    background: #f6fcf8;
    border-bottom: 1px solid #d5e9dc;
}
.analysis-panel__content {
    overflow: auto;
    overscroll-behavior: contain;
    min-height: 170px;
    max-height: calc(100vh - 306px);
    padding: 4px 8px 12px;
}
.analysis-panel__content .esri-elevation-profile {
    min-height: 300px;
}
.tools {
    position: absolute;
    bottom: 30px;
    left: 22px;
    z-index: 1;
    background: linear-gradient(135deg, #112e26ef, #1b4c3ee8);
    border: 1px solid #bdf06d66;
    border-radius: 14px;
    box-shadow: 0 14px 35px #0e231e55;
    padding: 12px;
    display: flex;
    gap: 18px;
    align-items: flex-end;
    backdrop-filter: blur(12px);
}
.tool-group {
    display: flex;
    gap: 7px;
    align-items: center;
    position: relative;
    padding-top: 18px;
}
.tool-label {
    position: absolute;
    top: 0;
    left: 1px;
    white-space: nowrap;
    font-size: 9px;
    color: #d5e6dd;
}
.tool-button {
    font-size: 12px !important;
    padding: 7px 10px !important;
    background: #ffffff12 !important;
    color: #f4fff8 !important;
    border: 1px solid #ffffff26 !important;
    display: flex;
    align-items: center;
    gap: 6px;
    transition:
        transform 0.18s,
        background 0.18s,
        border-color 0.18s,
        box-shadow 0.18s;
}
.tool-button:hover {
    transform: translateY(-2px);
    background: #ffffff24 !important;
    border-color: var(--lime) !important;
    box-shadow: 0 5px 13px #0004;
}
.tool-button.active {
    background: var(--lime) !important;
    color: #123329 !important;
    border-color: var(--lime) !important;
    font-weight: 700;
    box-shadow: 0 0 0 3px #c6f36c30;
}
.tool-icon {
    width: 17px;
    height: 17px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ffffff1d;
    color: var(--lime);
    font-size: 14px;
    font-weight: 700;
}
.tool-button.active .tool-icon {
    background: #123329;
    color: var(--lime);
}
.clear-tool {
    color: #ffcaca !important;
}
.clear-tool .tool-icon {
    color: #ffb6b6;
}
.lighting input,
.lighting select {
    height: 33px;
    border: 1px solid #ffffff3b;
    border-radius: 7px;
    background: #ffffffec;
    padding: 4px 6px;
    font: 12px inherit;
}
.status {
    position: absolute;
    right: 22px;
    bottom: 18px;
    background: #173d31dc;
    color: #fff;
    padding: 7px 10px;
    border-radius: 5px;
    font-size: 12px;
    margin: 0;
    z-index: 1;
}
.weather-overlay {
    pointer-events: none;
    position: absolute;
    inset: 74px 0 0;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.3s;
}
.weather-overlay.rain {
    opacity: 0.4;
    background: repeating-linear-gradient(112deg, transparent 0 18px, #cfe7f155 19px 20px, transparent 21px 38px);
}
.weather-overlay.fog {
    opacity: 0.4;
    background: linear-gradient(180deg, #dfe8e8bb, #dfe8e822 60%, #fff8);
}
.weather-overlay.cloudy {
    opacity: 0.24;
    background: #82939e;
}
@media (max-width: 800px) {
    body {
        display: block;
    }
    .sidebar {
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(330px, 82vw);
    }
    .viewer-shell {
        height: 100vh;
        margin-left: 330px;
    }
    .tools {
        max-width: calc(100% - 44px);
        overflow: auto;
    }
    .lighting {
        display: none;
    }
    .analysis-panel {
        right: 12px;
        top: 84px;
        width: calc(100% - 24px);
        max-height: calc(100vh - 148px);
    }
    .analysis-panel__content {
        max-height: calc(100vh - 298px);
    }
}
@media (max-width: 560px) {
    .sidebar {
        display: none;
    }
    .viewer-shell {
        margin-left: 0;
    }
    .tools {
        bottom: 8px;
        left: 8px;
    }
    .tool-group:nth-child(2) {
        display: none;
    }
    .status {
        right: 8px;
        bottom: 70px;
    }
    .analysis-panel {
        top: 82px;
    }
    .analysis-panel__hint {
        font-size: 11px;
    }
}
