/* Space portal globe + layers panel. Mobile-first. */
.sp-globe-sec { max-width: 1100px; margin: 28px auto 0; }
.sp-globe {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 10px;
}
@media (min-width: 840px) {
    .sp-globe { grid-template-columns: minmax(0, 1fr) 260px; align-items: stretch; }
}
.sp-globe-stage {
    position: relative;
    min-height: 320px;
    height: min(70vh, 640px);
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--theme-card-bg);
}
.sp-globe-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 12px 14px 16px;
    background:
        linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.15) 42%, transparent 70%),
        url("../images/space-portal/kenya-firms-hotspots-7d-800.webp") center / cover no-repeat;
    color: #fff;
    text-align: center;
}
.sp-globe-fallback[hidden],
#sp-globe-map[hidden] { display: none !important; }
#sp-globe-map { position: absolute; inset: 0; }
.sp-globe-open {
    border: 0;
    border-radius: 40px;
    padding: 10px 18px;
    font: 600 1rem Inter, system-ui, sans-serif;
    background: var(--theme-primary, #00f3ff);
    color: #061018;
    cursor: pointer;
}
.sp-globe-open:focus { outline: 2px solid #fff; outline-offset: 3px; }
.sp-globe-fallback .af-credit,
.sp-globe-fallback .af-credit a { color: #f8fafc; }
.sp-globe-msg {
    position: absolute; left: 10px; right: 10px; top: 10px; z-index: 2;
    padding: 8px 10px; border-radius: 8px;
    background: rgba(0,0,0,.7); color: #fff; font-size: .85rem;
}
.sp-globe-toolbar {
    position: absolute; top: 8px; right: 8px; z-index: 3;
    display: flex; flex-direction: column; gap: 4px;
}
.sp-globe-toolbar button {
    min-width: 40px; min-height: 40px;
    border: 1px solid var(--theme-border-color);
    border-radius: 8px;
    background: var(--theme-card-bg);
    color: var(--theme-text-primary);
    cursor: pointer;
    font-size: 1rem;
}
.sp-globe-toolbar button:disabled { opacity: .45; cursor: not-allowed; }
.sp-globe-toolbar button:focus { outline: 2px solid var(--theme-primary); outline-offset: 1px; }
.sp-globe-status {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
    display: flex; flex-wrap: wrap; gap: 6px 14px;
    padding: 6px 10px 8px;
    font-size: .75rem;
    background: linear-gradient(to top, rgba(0,0,0,.7), rgba(0,0,0,.35), transparent);
    color: #f8fafc;
    pointer-events: none;
}
.sp-globe-status > span[hidden] { display: none !important; }
.sp-globe-panel {
    border: 1px solid var(--theme-border-color);
    border-radius: 12px;
    background: var(--theme-card-bg);
    padding: 10px 12px 12px;
    max-height: min(70vh, 640px);
    overflow: auto;
}
.sp-globe-panel h3 { margin: 0 0 8px; font-size: 1rem; }
.sp-globe-layer { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--theme-border-color); }
.sp-globe-layer:last-of-type { border-bottom: 0; margin-bottom: 0; }
.sp-globe-layer label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-weight: 600; }
.sp-globe-layer input { margin-top: 3px; }
.sp-globe-legend { list-style: none; padding: 6px 0 0 22px; margin: 0; font-size: .8rem; font-weight: 400; }
.sp-globe-legend li { display: flex; gap: 6px; align-items: center; margin: 2px 0; }
.sp-globe-swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255,255,255,.4); flex: 0 0 12px; }
.sp-globe-credit { display: block; margin: 6px 0 0 22px; font-size: .75rem; opacity: .85; font-weight: 400; line-height: 1.45; }
.sp-globe-layer[data-state="unavailable"] .sp-globe-credit { color: #f59e0b; }
@media (max-width: 839px) {
    .sp-globe-panel { max-height: none; }
    .sp-globe-stage { height: min(65vh, 520px); }
}
