@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --bg: #0b1119;
    --panel: #111a25;
    --panel2: #162230;
    --line: #263444;
    --muted: #8293a6;
    --text: #eaf1f7;
    --accent: #58d6b0;
    --accent2: #3cbf9a;
    --blue: #7da9ff
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif
}

body {
    overflow: hidden
}

.topbar {
    height: 68px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 12px;
    background: #0e151f;
    border-bottom: 1px solid #243141;
    position: relative;
    z-index: 4
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(145deg, #66e5c0, #2ca889);
    color: #071a17;
    display: grid;
    place-items: center;
    font-family: 'Space Grotesk';
    font-weight: 700;
    box-shadow: 0 5px 20px #39c79a33
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 1px
}

.brand strong {
    font: 700 18px 'Space Grotesk';
    letter-spacing: -.4px
}

.brand span {
    font-size: 11px;
    color: #8495a8;
    letter-spacing: .4px
}

.topbar-spacer {
    flex: 1
}

.status-dot {
    height: 7px;
    width: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px #58d6b088
}

.status-text {
    font-size: 12px;
    color: #9aacbd
}

.app-shell {
    height: calc(100% - 68px);
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr)
}

.sidebar {
    background: var(--panel);
    border-right: 1px solid var(--line);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0
}

.panel-section {
    padding: 22px 20px;
    border-bottom: 1px solid var(--line)
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 17px
}

.step {
    width: 27px;
    height: 27px;
    border: 1px solid #355044;
    color: var(--accent);
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0
}

.section-heading h2 {
    font-size: 14px;
    margin: 1px 0 4px;
    font-weight: 700
}

.section-heading p {
    font-size: 11px;
    color: var(--muted);
    margin: 0
}

.dropzone {
    border: 1px dashed #405469;
    background: #0e1721;
    border-radius: 13px;
    min-height: 142px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    transition: .2s;
    text-align: center
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--accent);
    background: #12241f
}

.upload-icon {
    font-size: 24px;
    color: var(--accent);
    height: 28px
}

.dropzone strong {
    font-size: 13px
}

.dropzone span:not(.upload-icon) {
    font-size: 11px;
    color: #95a7b8
}

.dropzone small {
    margin-top: 6px;
    font-size: 10px;
    letter-spacing: .4px;
    color: var(--accent)
}

#fileInput {
    display: none
}

.hint {
    font-size: 10px;
    line-height: 1.55;
    color: #7e91a4;
    margin: 10px 1px 13px
}

.button-row {
    display: flex;
    gap: 8px
}

.button {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 11px;
    font: 600 11px 'DM Sans';
    cursor: pointer;
    transition: .15s
}

.button.secondary {
    background: #1d302f;
    border-color: #31574f;
    color: #8de5c9;
    flex: 1
}

.button.secondary:hover {
    background: #25423d
}

.button.quiet {
    background: #182330;
    border-color: #2b3b4c;
    color: #9baabc
}

.button.quiet:hover {
    color: white;
    border-color: #52667b
}

.load-status {
    font-size: 11px;
    color: #91a3b6;
    margin-top: 11px;
    min-height: 16px;
    line-height: 1.4
}

.load-status.error {
    color: #ff9e9e
}

.load-status.success {
    color: #83e5c5
}

.empty-state {
    text-align: center;
    padding: 17px 8px 20px;
    border: 1px solid #243342;
    border-radius: 10px;
    background: #0e1721
}

.empty-state>span {
    font-size: 22px;
    color: #526779
}

.empty-state p {
    margin: 8px 0 4px;
    font-size: 12px;
    color: #b9c5d0
}

.empty-state small {
    font-size: 10px;
    color: #73879a
}

.layer-list {
    display: flex;
    flex-direction: column;
    gap: 8px
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid #293949;
    border-radius: 9px;
    background: #101923
}

.layer-color {
    width: 9px;
    height: 28px;
    border-radius: 5px;
    flex-shrink: 0
}

.layer-meta {
    flex: 1;
    min-width: 0
}

.layer-meta strong {
    font-size: 11px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.layer-meta small {
    font-size: 10px;
    color: #8093a6;
    display: block;
    margin-top: 3px
}

.layer-actions {
    display: flex;
    gap: 4px
}

.mini-button {
    width: 27px;
    height: 27px;
    border: 1px solid #2a3b4c;
    background: #182431;
    color: #a9bac9;
    border-radius: 6px;
    cursor: pointer
}

.mini-button:hover {
    color: var(--accent);
    border-color: #477a6a
}

.settings-section {
    padding-bottom: 18px
}

.field-label {
    display: block;
    font-size: 11px;
    color: #9aabba;
    margin-bottom: 7px
}

.inline-control {
    display: flex;
    gap: 8px
}

.inline-control input {
    width: 100%;
    min-width: 0;
    background: #0d151e;
    border: 1px solid #2b3c4c;
    border-radius: 8px;
    padding: 9px 10px;
    color: white;
    font: 12px 'DM Sans'
}

.inline-control .button {
    flex-shrink: 0
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    cursor: pointer;
    position: relative
}

.toggle-row strong {
    display: block;
    font-size: 11px;
    font-weight: 600
}

.toggle-row small {
    display: block;
    color: #7e91a4;
    font-size: 10px;
    margin-top: 3px
}

.toggle-row input {
    position: absolute;
    opacity: 0;
    right: 0;
    width: 38px;
    height: 22px;
    cursor: pointer
}

.toggle {
    width: 35px;
    height: 20px;
    border-radius: 20px;
    background: #344251;
    position: relative;
    transition: .2s;
    flex-shrink: 0
}

.toggle:after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    top: 3px;
    left: 3px;
    background: #a5b3c1;
    border-radius: 50%;
    transition: .2s
}

.toggle-row input:checked+.toggle {
    background: #278c71
}

.toggle-row input:checked+.toggle:after {
    left: 18px;
    background: #e8fff7
}

.sidebar-footer {
    margin-top: auto;
    padding: 14px 20px;
    color: #667b8e;
    font-size: 10px;
    line-height: 1.5
}

.map-area {
    position: relative;
    min-width: 0;
    min-height: 0;
    background: #0b1722
}

#cesiumContainer {
    position: absolute;
    inset: 0
}

.map-toolbar {
    position: absolute;
    top: 18px;
    left: 18px;
    right: 18px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none
}

.map-title,
.toolbar-actions {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px
}

.map-title {
    padding: 10px 13px;
    border: 1px solid #334658;
    background: #101b27eF;
    backdrop-filter: blur(12px);
    border-radius: 11px;
    box-shadow: 0 8px 24px #0003
}

.map-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px #58d6b088
}

.map-title strong {
    font-size: 12px;
    display: block
}

.map-title small {
    font-size: 10px;
    color: #91a5b7;
    display: block;
    margin-top: 3px
}

.fit-button,
.icon-button {
    background: #101b27ed;
    color: #dbe6ee;
    border: 1px solid #3a4c5e;
    border-radius: 9px;
    padding: 10px 13px;
    font: 600 11px 'DM Sans';
    cursor: pointer;
    backdrop-filter: blur(12px)
}

.icon-button {
    font-size: 19px;
    padding: 5px 12px
}

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

.map-legend {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 2;
    padding: 10px 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #334658;
    background: #101b27eF;
    border-radius: 9px;
    font-size: 10px;
    color: #b3c2ce;
    backdrop-filter: blur(12px)
}

.legend-dot {
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%
}

.legend-divider {
    height: 13px;
    width: 1px;
    background: #405164;
    margin: 0 3px
}

.map-coordinates {
    position: absolute;
    right: 18px;
    bottom: 18px;
    z-index: 2;
    color: #8295a7;
    font-size: 10px;
    text-shadow: 0 1px 4px #000;
    background: #101b27c9;
    padding: 8px 10px;
    border-radius: 7px
}

.attribute-panel {
    position: absolute;
    right: 18px;
    top: 85px;
    bottom: 68px;
    width: min(330px, calc(100% - 36px));
    z-index: 3;
    background: #111b27f5;
    border: 1px solid #36495a;
    border-radius: 13px;
    box-shadow: 0 20px 50px #0006;
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    overflow: hidden
}

.attribute-panel.hidden {
    display: none
}

.attribute-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #2b3a49
}

.attribute-header small {
    font-size: 9px;
    letter-spacing: 1.1px;
    color: var(--accent)
}

.attribute-header h3 {
    font-size: 15px;
    margin: 6px 0 0;
    overflow-wrap: anywhere
}

.close-button {
    border: 0;
    background: transparent;
    color: #8fa1b2;
    font-size: 23px;
    cursor: pointer;
    line-height: 1
}

.attribute-body {
    padding: 10px 16px;
    overflow: auto
}

.attribute-row {
    padding: 10px 0;
    border-bottom: 1px solid #243341
}

.attribute-row:last-child {
    border-bottom: 0
}

.attribute-row small {
    display: block;
    color: #8295a7;
    font-size: 10px;
    margin-bottom: 5px;
    overflow-wrap: anywhere
}

.attribute-row div {
    font-size: 11px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    color: #e1eaf0
}

.map-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    max-width: 360px;
    text-align: center;
    background: #101b27ed;
    border: 1px solid #34485a;
    padding: 15px 18px;
    border-radius: 11px;
    color: #b7c8d5;
    font-size: 12px;
    line-height: 1.6;
    box-shadow: 0 10px 35px #0004
}

.map-message.hidden {
    display: none
}

.cesium-viewer-bottom {
    display: none !important
}

.cesium-widget-credits {
    display: none !important
}

.cesium-viewer-toolbar {
    top: 78px !important;
    right: 18px !important
}

.cesium-viewer-fullscreenContainer {
    display: none !important
}

@media(max-width:850px) {
    body {
        overflow: auto
    }

    .app-shell {
        height: auto;
        min-height: calc(100% - 68px);
        grid-template-columns: 1fr
    }

    .sidebar {
        order: 2;
        overflow: visible;
        border-right: 0
    }

    .map-area {
        order: 1;
        height: 60vh;
        min-height: 420px
    }

    .panel-section {
        padding: 18px
    }

    .sidebar-footer {
        margin-top: 0
    }

    .attribute-panel {
        top: 80px;
        bottom: 60px;
        width: min(320px, calc(100% - 30px));
        right: 12px
    }

    .map-toolbar {
        left: 12px;
        right: 12px;
        top: 12px
    }

    .map-legend {
        left: 12px;
        bottom: 12px
    }

    .map-coordinates {
        display: none
    }
}

@media(max-width:440px) {
    .status-text {
        display: none
    }

    .topbar {
        padding: 0 15px
    }

    .map-title {
        padding: 8px 10px
    }

    .fit-button {
        font-size: 10px;
        padding: 9px
    }

    .toolbar-actions {
        gap: 5px
    }
}