* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #02040b;
    color: #eef6ff;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
}

#app,
#globe {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#globe canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

#globe canvas:active {
    cursor: grabbing;
}

#labels {
    position: fixed;
    inset: 0;
    z-index: 3;
    pointer-events: none;
}

.sat-label {
    position: absolute;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border: 1px solid rgba(134, 215, 255, 0.42);
    border-radius: 999px;
    background: rgba(5, 13, 26, 0.62);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36), 0 0 18px rgba(77, 193, 255, 0.16);
    color: #ecf8ff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.07em;
    line-height: 1;
    text-transform: uppercase;
    text-shadow: 0 1px 8px #000;
    transform: translate(-50%, -50%);
    transition: opacity 0.16s ease;
    pointer-events: auto;
    user-select: none;
    white-space: nowrap;
}

.sat-label::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff27a;
    box-shadow: 0 0 12px #fff27a;
}

.glass-panel {
    position: fixed;
    z-index: 4;
    border: 1px solid rgba(151, 201, 255, 0.22);
    border-radius: 24px;
    background: linear-gradient(145deg, rgba(5, 12, 24, 0.78), rgba(11, 20, 38, 0.56));
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
}

#topbar {
    top: 18px;
    left: 18px;
    width: min(390px, calc(100vw - 36px));
    padding: 18px;
}

#details {
    top: 18px;
    right: 18px;
    bottom: 18px;
    width: min(390px, calc(100vw - 36px));
    padding: 18px;
    overflow: auto;
}

#legend {
    left: 18px;
    bottom: 18px;
    width: min(430px, calc(100vw - 36px));
    padding: 14px 16px;
    display: grid;
    grid-template-columns: repeat(5, auto);
    gap: 10px 14px;
    align-items: center;
    color: rgba(236, 247, 255, 0.82);
    font-size: 12px;
    font-weight: 800;
}

#legend p {
    grid-column: 1 / -1;
    margin: 1px 0 0;
    color: rgba(223, 238, 255, 0.58);
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
}

.dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    margin-right: 6px;
    border-radius: 50%;
    vertical-align: -1px;
}

.dot.leo { background: #5ee7ff; box-shadow: 0 0 10px #5ee7ff; }
.dot.meo { background: #b8ff7a; box-shadow: 0 0 10px #b8ff7a; }
.dot.geo { background: #ffce66; box-shadow: 0 0 10px #ffce66; }
.dot.heo { background: #ff7ad9; box-shadow: 0 0 10px #ff7ad9; }
.dot.aircraft { background: #ffb45e; box-shadow: 0 0 10px #ffb45e; }
.dot.aircraft {
    border-radius: 2px 50% 50% 50%;
    transform: rotate(45deg);
}

.eyebrow {
    margin: 0 0 8px;
    color: #7fdbff;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 10px;
    color: #fff;
    font-size: clamp(30px, 4.2vw, 48px);
    line-height: 0.92;
    letter-spacing: -0.06em;
    text-wrap: balance;
}

h2 {
    margin-bottom: 8px;
    color: #fff;
    font-size: 25px;
    line-height: 1;
    letter-spacing: -0.04em;
}

h3 {
    margin: 0 0 9px;
    color: #dcf4ff;
    font-size: 13px;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

#feedStatus,
#selectedSummary {
    margin-bottom: 14px;
    color: rgba(230, 241, 255, 0.72);
    font-size: 13px;
    line-height: 1.45;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 9px;
    margin: 13px 0;
}

.metrics > div,
.data-grid > div {
    border: 1px solid rgba(145, 210, 255, 0.16);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
}

.metrics > div {
    padding: 9px 10px;
}

.metric-label,
dt {
    display: block;
    color: rgba(140, 215, 255, 0.72);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.metrics strong {
    display: block;
    margin-top: 5px;
    color: #fff;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.view-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin: 0 0 9px;
}

.toggle-control,
.select-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid rgba(145, 210, 255, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.055);
    color: rgba(234, 246, 255, 0.86);
    font-size: 11px;
    font-weight: 850;
}

.toggle-control:has(input:disabled) {
    opacity: 0.42;
}

.toggle-control input {
    width: 14px;
    height: 14px;
    accent-color: #84ecff;
}

.select-control {
    grid-column: 1 / -1;
    justify-content: space-between;
}

.select-control select {
    min-width: 112px;
    padding: 6px 28px 6px 9px;
    border: 1px solid rgba(153, 218, 255, 0.24);
    border-radius: 10px;
    color: #eef8ff;
    background: rgba(1, 7, 18, 0.72);
}

.layer-status {
    display: flex;
    gap: 6px;
    margin: -1px 0 10px;
    flex-wrap: wrap;
}

.layer-status span {
    padding: 4px 7px;
    border: 1px solid rgba(139, 213, 255, 0.16);
    border-radius: 999px;
    color: rgba(224, 240, 255, 0.65);
    background: rgba(255, 255, 255, 0.045);
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.search-row,
.button-row {
    display: flex;
    gap: 9px;
}

.search-row input {
    min-width: 0;
    flex: 1;
    padding: 11px 12px;
    border: 1px solid rgba(153, 218, 255, 0.28);
    border-radius: 15px;
    outline: none;
    background: rgba(1, 7, 18, 0.56);
    color: #fff;
}

.search-row input::placeholder {
    color: rgba(234, 243, 255, 0.42);
}

.search-row input:focus {
    border-color: rgba(132, 220, 255, 0.72);
    box-shadow: 0 0 0 3px rgba(83, 194, 255, 0.12);
}

button {
    padding: 11px 14px;
    border-radius: 15px;
    color: #04101c;
    background: linear-gradient(135deg, #85ecff, #fff07a);
    box-shadow: 0 14px 28px rgba(79, 205, 255, 0.18);
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
}

button:hover {
    filter: brightness(1.06);
}

button:disabled {
    cursor: wait;
    filter: grayscale(0.4) brightness(0.72);
}

button.ghost {
    color: #eaf8ff;
    background: rgba(255, 255, 255, 0.09);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.button-row {
    margin-top: 10px;
    flex-wrap: wrap;
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin: 14px 0 16px;
}

.data-grid > div {
    padding: 9px 10px;
}

dd {
    margin: 5px 0 0;
    color: #fff;
    font-size: 15px;
    font-weight: 850;
    line-height: 1.2;
}

.detail-section {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

ul {
    margin: 0;
    padding-left: 18px;
    color: rgba(235, 246, 255, 0.75);
    font-size: 13px;
    line-height: 1.5;
}

li + li {
    margin-top: 5px;
}

.chips {
    grid-column: 1 / -1;
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-top: 3px;
}

.chips button {
    flex: 0 0 auto;
    padding: 7px 9px;
    border-radius: 999px;
    color: #ecf8ff;
    background: rgba(122, 211, 255, 0.13);
    box-shadow: inset 0 0 0 1px rgba(122, 211, 255, 0.2);
    font-size: 11px;
    letter-spacing: 0.05em;
}

.fatal {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #030712;
}

.fatal > div {
    width: min(520px, 100%);
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.06);
    line-height: 1.55;
}

@media (max-width: 940px) {
    #topbar {
        top: 10px;
        left: 10px;
        width: min(390px, calc(100vw - 20px));
        padding: 16px;
    }

    #details {
        top: auto;
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
        max-height: 43vh;
        padding: 16px;
    }

    #legend {
        display: none;
    }

    h1 {
        font-size: 35px;
    }

    h2 {
        font-size: 23px;
    }
}

@media (max-width: 560px) {
    #topbar {
        max-height: 40vh;
        overflow: auto;
    }

    .metrics,
    .data-grid {
        grid-template-columns: 1fr 1fr;
    }

    .metrics > div:last-child {
        grid-column: 1 / -1;
    }

    .search-row {
        flex-direction: column;
    }

    .button-row button,
    .search-row button {
        flex: 1;
    }

    .sat-label {
        font-size: 10px;
    }
}
