/* Copyright (c) 2026 Dung1412. All Rights Reserved. */
/* Satellite Split-Swipe Comparison & Live 10m Sentinel-2 / 3m Planet NDVI Intelligence UI
   Studio-Grade Glassmorphism • Spring Animations • iOS Pill Toggles • Dark & Light Parity */

/* --- 1. Split-Screen Before Map & Precision Studio Curtain Divider --- */
#map-compare-before {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 6;
    pointer-events: none;
    display: none;
    clip-path: inset(0 calc(100% - var(--swipe-pct, 50%)) 0 0);
    will-change: clip-path;
}

#map-compare-before.active {
    display: block;
}

#sat-swipe-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--swipe-pct, 50%);
    width: 48px;
    transform: translateX(-50%);
    z-index: 25;
    cursor: ew-resize;
    touch-action: none;
    display: none;
    user-select: none;
    -webkit-user-select: none;
}

#sat-swipe-divider.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

#sat-swipe-divider::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2.5px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.92), rgba(52, 211, 153, 0.98), rgba(56, 189, 248, 0.92));
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.85), 0 0 3px rgba(0, 0, 0, 0.95);
    transition: width 0.14s ease, box-shadow 0.14s ease;
}

#sat-swipe-divider.dragging::before {
    width: 3px;
    box-shadow: 0 0 22px rgba(52, 211, 153, 0.95), 0 0 4px rgba(0, 0, 0, 1);
}

.sat-swipe-handle {
    position: relative;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 25%, rgba(30, 58, 95, 0.96), rgba(9, 17, 30, 0.96));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 2px solid rgba(56, 189, 248, 0.92);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.68),
                0 0 18px rgba(56, 189, 248, 0.55),
                inset 0 1px 1px rgba(255, 255, 255, 0.25);
    transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.18s ease,
                box-shadow 0.18s ease,
                background 0.18s ease;
    pointer-events: none;
}

#sat-swipe-divider:hover .sat-swipe-handle,
#sat-swipe-divider.dragging .sat-swipe-handle {
    transform: scale(1.12);
    border-color: #34d399;
    background: radial-gradient(circle at 30% 25%, rgba(16, 185, 129, 0.95), rgba(6, 78, 59, 0.96));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.72),
                0 0 24px rgba(52, 211, 153, 0.78),
                inset 0 1px 1px rgba(255, 255, 255, 0.35);
}

.sat-swipe-pct-pill {
    position: absolute;
    top: calc(50% + 32px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #f8fafc;
    background: rgba(6, 15, 28, 0.92);
    border: 1px solid rgba(52, 211, 153, 0.65);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
    white-space: nowrap;
}

#sat-swipe-divider.dragging .sat-swipe-pct-pill {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* Floating Left / Right Date Badges */
.sat-swipe-badges {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 24;
    display: none;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100% - 140px);
}

.sat-swipe-badges.active {
    display: flex;
}

.sat-swipe-badge {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    color: #f8fafc;
    background: rgba(8, 16, 30, 0.88);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40vw;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.sat-swipe-badge.left {
    border-color: rgba(251, 191, 36, 0.65);
    color: #fde68a;
}

.sat-swipe-badge.left::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fbbf24;
    box-shadow: 0 0 8px #fbbf24;
    flex-shrink: 0;
}

.sat-swipe-badge.right {
    border-color: rgba(52, 211, 153, 0.68);
    color: #a7f3d0;
}

.sat-swipe-badge.right::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px #34d399;
    flex-shrink: 0;
}

/* --- 2. Floating Satellite Intelligence Control Dock --- */
@keyframes satDockEnter {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

#sat-intel-dock {
    position: absolute;
    top: 56px;
    left: 52px;
    width: 374px;
    max-width: calc(100vw - 70px);
    max-height: calc(100% - 130px);
    z-index: 32;
    background: linear-gradient(175deg, rgba(10, 20, 35, 0.94) 0%, rgba(6, 13, 24, 0.96) 100%);
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    border: 1px solid rgba(56, 189, 248, 0.36);
    border-radius: 16px;
    box-shadow: 0 20px 54px rgba(0, 0, 0, 0.66),
                0 0 28px rgba(14, 165, 233, 0.12),
                inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: inherit;
    transition: width 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                max-height 0.24s cubic-bezier(0.22, 1, 0.36, 1),
                border-radius 0.2s ease,
                box-shadow 0.2s ease,
                border-color 0.2s ease;
}

#sat-intel-dock.open {
    display: flex;
    animation: satDockEnter 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

#sat-intel-dock.collapsed .sat-intel-body {
    display: none;
}

#sat-intel-dock.collapsed {
    width: 292px !important;
    min-width: 244px !important;
    max-height: 92px !important;
    border-radius: 14px !important;
}

#sat-intel-dock.collapsed .sat-intel-header {
    padding: 6px 10px;
    gap: 8px;
}

#sat-intel-dock.dragging {
    transition: none !important;
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.78), 0 0 0 2px rgba(56, 189, 248, 0.75), 0 0 30px rgba(14, 165, 233, 0.35);
    user-select: none;
    -webkit-user-select: none;
}

/* Always-accessible Change Highlight Opacity Strip (moves with dock even when collapsed!) */
.sat-opacity-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 11px;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.08), rgba(2, 6, 23, 0.72));
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.sat-opacity-strip:active {
    cursor: grabbing;
}

#sat-intel-dock.collapsed .sat-opacity-strip {
    border-bottom: none;
    padding: 6px 11px 8px;
}

.sat-opacity-strip-label {
    font-size: 10.5px;
    font-weight: 800;
    color: #fca5a5;
    white-space: nowrap;
    letter-spacing: 0.15px;
}

.sat-opacity-strip input[type="range"] {
    flex: 1;
    min-width: 88px;
    background: linear-gradient(90deg, rgba(248, 113, 113, 0.28), rgba(239, 68, 68, 0.85));
    cursor: pointer;
    touch-action: pan-x;
}

.sat-opacity-strip-val {
    font-size: 11px;
    font-weight: 800;
    color: #f8fafc;
    min-width: 36px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.sat-peek-btn {
    background: rgba(30, 41, 59, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.32);
    color: #e2e8f0;
    border-radius: 7px;
    padding: 3px 7px;
    font-size: 12px;
    cursor: pointer;
    line-height: 1.2;
    flex-shrink: 0;
    transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-peek-btn:hover {
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.25);
    transform: scale(1.06);
}

.sat-peek-btn:active {
    transform: scale(0.95);
}

.sat-peek-btn.peeking {
    border-color: #fbbf24;
    background: rgba(251, 191, 36, 0.22);
    color: #fde68a;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.sat-intel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: linear-gradient(105deg, rgba(14, 165, 233, 0.24) 0%, rgba(16, 185, 129, 0.2) 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.sat-intel-header:active {
    cursor: grabbing;
}

.sat-drag-grip {
    opacity: 0.65;
    font-size: 13px;
    letter-spacing: -1px;
    margin-right: 2px;
    transition: opacity 0.15s ease;
}

.sat-intel-header:hover .sat-drag-grip {
    opacity: 1;
}

/* --- Compact Pill Collapse for Basemap Picker (#basemap-picker.collapsed) --- */
#basemap-picker.collapsed {
    width: auto !important;
    min-width: 0 !important;
    max-width: fit-content !important;
    padding: 6px 12px !important;
    border-radius: 999px !important;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

#basemap-picker.collapsed:hover {
    border-color: rgba(56, 189, 248, 0.65) !important;
    transform: translateY(-1px);
}

#basemap-picker.collapsed .basemap-header {
    border-bottom: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 8px !important;
}

#basemap-picker.collapsed .basemap-list,
#basemap-picker.collapsed .layer-opacity-control,
#basemap-picker.collapsed .map-extra-actions,
#basemap-picker.collapsed #btn-quick-export-satellite,
#basemap-picker.collapsed #btn-scale-basemap,
#basemap-picker.collapsed .panel-resizer-w,
#basemap-picker.collapsed .panel-resizer-s,
#basemap-picker.collapsed .panel-resizer-sw {
    display: none !important;
}

#basemap-picker.collapsed .basemap-title {
    white-space: nowrap !important;
    font-size: 11px !important;
    color: #f1f5f9 !important;
    letter-spacing: 0.3px;
}

.sat-intel-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.2px;
    font-weight: 800;
    color: #f8fafc;
    letter-spacing: 0.25px;
}

.sat-intel-hdr-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.sat-intel-icon-btn {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: #cbd5e1;
    border-radius: 8px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.3;
    transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-intel-icon-btn:hover {
    background: rgba(56, 189, 248, 0.26);
    border-color: #38bdf8;
    color: #fff;
    transform: translateY(-1px);
}

.sat-intel-icon-btn:active {
    transform: scale(0.93);
}

.sat-intel-icon-btn.close-btn:hover {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
    color: #fecaca;
}

.sat-intel-body {
    padding: 10px 12px 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Segmented Mode Tabs */
.sat-intel-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    background: rgba(2, 6, 23, 0.68);
    padding: 4px;
    border-radius: 11px;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.sat-intel-tab {
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 11.5px;
    font-weight: 700;
    padding: 7px 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-intel-tab:hover:not(.active) {
    color: #e2e8f0;
    background: rgba(148, 163, 184, 0.1);
}

.sat-intel-tab.active {
    background: linear-gradient(135deg, #0284c7, #10b981);
    color: #ffffff;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.sat-intel-pane {
    display: none;
    flex-direction: column;
    gap: 9px;
}

.sat-intel-pane.active {
    display: flex;
    animation: ptSpringDrop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Status Banner */
.sat-intel-status {
    font-size: 11px;
    color: #bae6fd;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.14), rgba(16, 185, 129, 0.08));
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
    padding: 7px 10px;
    line-height: 1.45;
}

/* Quick Preset Pills */
.sat-preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sat-preset-btn {
    flex: 1 1 calc(50% - 6px);
    min-width: 140px;
    padding: 7px 9px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 28, 46, 0.72);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.17s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-preset-btn:hover {
    border-color: rgba(56, 189, 248, 0.65);
    background: rgba(14, 165, 233, 0.2);
    color: #ffffff;
    transform: translateY(-1px);
}

.sat-preset-btn:active {
    transform: scale(0.97);
}

.sat-preset-btn.active {
    border-color: rgba(52, 211, 153, 0.85);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(14, 165, 233, 0.18));
    color: #ecfdf5;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

/* Side Config Cards */
.sat-side-card {
    background: rgba(11, 22, 37, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 11px;
    padding: 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.2s ease, background 0.2s ease;
}

.sat-side-card:hover {
    border-color: rgba(148, 163, 184, 0.34);
}

.sat-side-card.left-side {
    border-left: 3px solid #fbbf24;
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.06), rgba(11, 22, 37, 0.78) 28%);
}

.sat-side-card.right-side {
    border-left: 3px solid #34d399;
    background: linear-gradient(90deg, rgba(52, 211, 153, 0.06), rgba(11, 22, 37, 0.78) 28%);
}

.sat-side-label {
    font-size: 10.6px;
    font-weight: 800;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sat-side-card.left-side .sat-side-label { color: #fde68a; }
.sat-side-card.right-side .sat-side-label { color: #6ee7b7; }

.sat-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.sat-month-stepper {
    display: grid;
    grid-template-columns: 30px 1fr 30px;
    gap: 5px;
    align-items: center;
}

.sat-month-btn {
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(20, 34, 54, 0.9);
    color: #e2e8f0;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-month-btn:hover {
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.26);
    color: #fff;
    transform: translateY(-1px);
}

.sat-month-btn:active {
    transform: scale(0.93);
}

.sat-month-input {
    width: 100%;
    height: 30px;
    box-sizing: border-box;
    background: rgba(3, 9, 20, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.38);
    color: #f8fafc;
    border-radius: 8px;
    padding: 0 9px;
    font-size: 11.5px;
    font-weight: 700;
    color-scheme: dark;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.sat-month-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

.sat-select {
    width: 100%;
    background: rgba(3, 9, 20, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #f1f5f9;
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.sat-select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
}

/* Action Buttons Row */
.sat-action-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.sat-btn {
    padding: 8px 9px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(20, 34, 54, 0.88);
    color: #f1f5f9;
    font-size: 11.2px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-btn:hover {
    border-color: #38bdf8;
    background: rgba(14, 165, 233, 0.24);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35);
}

.sat-btn:active {
    transform: translateY(0) scale(0.96);
}

.sat-btn.primary {
    background: linear-gradient(135deg, #0284c7, #10b981);
    border-color: rgba(52, 211, 153, 0.85);
    color: #fff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.sat-btn.primary:hover {
    box-shadow: 0 7px 22px rgba(16, 185, 129, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.sat-btn.active {
    background: rgba(16, 185, 129, 0.26);
    border-color: #34d399;
    color: #a7f3d0;
}

.sat-btn.danger {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(248, 113, 113, 0.52);
    color: #fecaca;
}

.sat-btn.danger:hover {
    background: rgba(239, 68, 68, 0.28);
    border-color: #ef4444;
}

/* Spectral Mode Grid (NDVI / ΔNDVI / NIR / NBR) */
.sat-spectral-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.sat-spectral-btn {
    padding: 9px 9px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(11, 22, 37, 0.82);
    color: #cbd5e1;
    font-size: 11.2px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    transition: all 0.17s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-spectral-btn small {
    font-size: 9.8px;
    font-weight: 500;
    color: #94a3b8;
}

.sat-spectral-btn:hover {
    border-color: #38bdf8;
    background: rgba(20, 38, 62, 0.92);
    transform: translateY(-1px);
}

.sat-spectral-btn.active {
    border-color: #34d399;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(14, 165, 233, 0.14));
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.28);
}

.sat-spectral-btn[data-spectral="delta"].active {
    border-color: #f87171;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.26), rgba(249, 115, 22, 0.14));
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.28);
}

/* Sliders & Sleek iOS Pill Toggle Switches */
.sat-slider-block {
    background: rgba(11, 22, 37, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 11px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 11px;
}

.sat-slider-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #cbd5e1;
    font-weight: 700;
}

.sat-slider-block input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.sat-check-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: #cbd5e1;
    cursor: pointer;
    user-select: none;
}

.sat-check-row input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 34px;
    height: 19px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.2s ease,
                box-shadow 0.2s ease;
}

.sat-check-row input[type="checkbox"]::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #e2e8f0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.sat-check-row input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #0ea5e9, #10b981);
    border-color: rgba(110, 231, 183, 0.8);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.38);
}

.sat-check-row input[type="checkbox"]:checked::after {
    transform: translateX(15px);
    background: #ffffff;
}

/* Changed Forest Plots List Card */
.sat-changed-plots-box {
    background: rgba(3, 9, 20, 0.84);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 11px;
    padding: 8px 10px;
    display: none;
    flex-direction: column;
    gap: 6px;
    font-size: 11px;
}

.sat-changed-plots-box.visible {
    display: flex;
    animation: ptSpringDrop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-changed-plot-list {
    max-height: 132px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding-right: 2px;
}

.sat-changed-plot-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px 8px;
    border-radius: 8px;
    background: rgba(15, 27, 45, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.18);
    cursor: pointer;
    font-size: 10.6px;
    color: #e2e8f0;
    transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-changed-plot-item:hover {
    border-color: rgba(248, 113, 113, 0.7);
    background: rgba(239, 68, 68, 0.16);
    transform: translateX(2px);
}

.sat-changed-plot-item.harvest { border-left: 3px solid #ef233c; }
.sat-changed-plot-item.degrade { border-left: 3px solid #f97316; }
.sat-changed-plot-item.regrowth { border-left: 3px solid #10b981; }

.sat-changed-plot-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.sat-mini-meter {
    height: 3.5px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
}

.sat-mini-meter > i {
    display: block;
    height: 100%;
    border-radius: 999px;
}

/* Legend Box */
.sat-legend-box {
    background: rgba(3, 9, 20, 0.74);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 10.5px;
}

.sat-ndvi-ramp {
    height: 10px;
    border-radius: 99px;
    background: linear-gradient(90deg, #a50026 0%, #f46d43 25%, #fee08b 48%, #66bd63 72%, #006837 100%);
    margin: 5px 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sat-ramp-labels {
    display: flex;
    justify-content: space-between;
    color: #94a3b8;
    font-size: 9.8px;
}

.sat-delta-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 5px;
}

.sat-delta-item {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #e2e8f0;
    font-size: 10.5px;
}

.sat-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

/* Quantitative Inspection Results Card */
.sat-inspect-card {
    background: rgba(3, 9, 20, 0.86);
    border: 1px solid rgba(56, 189, 248, 0.34);
    border-radius: 11px;
    padding: 9px 10px;
    display: none;
    flex-direction: column;
    gap: 7px;
    font-size: 11px;
}

.sat-inspect-card.visible {
    display: flex;
    animation: ptSpringDrop 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.sat-verdict {
    padding: 6px 9px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 11px;
    line-height: 1.38;
}

.sat-verdict.danger { background: rgba(239, 68, 68, 0.2); border: 1px solid #ef4444; color: #fecaca; }
.sat-verdict.warning { background: rgba(249, 115, 22, 0.2); border: 1px solid #f97316; color: #fed7aa; }
.sat-verdict.growth { background: rgba(16, 185, 129, 0.2); border: 1px solid #10b981; color: #a7f3d0; }
.sat-verdict.success { background: rgba(34, 197, 94, 0.18); border: 1px solid #22c55e; color: #bbf7d0; }
.sat-verdict.neutral { background: rgba(148, 163, 184, 0.18); border: 1px solid #94a3b8; color: #e2e8f0; }

.sat-kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.sat-kpi {
    background: rgba(20, 34, 54, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 8px;
    padding: 6px 6px;
    text-align: center;
}

.sat-kpi small {
    display: block;
    font-size: 9.5px;
    color: #94a3b8;
}

.sat-kpi strong {
    font-size: 12.5px;
    color: #f8fafc;
    font-variant-numeric: tabular-nums;
}

.sat-stacked-bar {
    height: 10px;
    border-radius: 99px;
    overflow: hidden;
    display: flex;
    background: rgba(51, 65, 85, 0.8);
}

.sat-inspect-cursor #map,
.sat-inspect-cursor #map canvas {
    cursor: crosshair !important;
}

/* Forensic Glass Popup Card (Used inside MapLibre Popups) */
.sat-popup-card {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11.5px;
    line-height: 1.45;
    min-width: 246px;
}

.sat-popup-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 4px;
    padding-right: 18px;
}

.sat-popup-meta {
    font-size: 11px;
    opacity: 0.84;
    margin-bottom: 2px;
}

.sat-popup-badge {
    padding: 6px 9px;
    border-radius: 9px;
    font-weight: 800;
    font-size: 11px;
    margin: 7px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sat-popup-badge.harvest,
.sat-popup-badge.danger {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.72);
    color: #fecaca;
}

.sat-popup-badge.degrade,
.sat-popup-badge.warning {
    background: rgba(249, 115, 22, 0.2);
    border: 1px solid rgba(251, 146, 60, 0.72);
    color: #fed7aa;
}

.sat-popup-badge.regrowth,
.sat-popup-badge.growth,
.sat-popup-badge.success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(52, 211, 153, 0.72);
    color: #a7f3d0;
}

.sat-popup-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 6px 0;
}

.sat-popup-metric {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    padding: 5px 6px;
    text-align: center;
}

.sat-popup-metric small {
    display: block;
    font-size: 9.5px;
    opacity: 0.72;
}

.sat-popup-metric b {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

/* Header button accent */
#btn-open-sat-intel.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.45), rgba(16, 185, 129, 0.45)) !important;
    border-color: #34d399 !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
}

/* --- 3. Light Theme Full Parity --- */
html[data-theme="light"] #sat-intel-dock {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(14, 165, 233, 0.34);
    color: #0f172a;
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

html[data-theme="light"] .sat-intel-header {
    background: linear-gradient(105deg, rgba(14, 165, 233, 0.14), rgba(16, 185, 129, 0.12));
    border-bottom-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .sat-intel-title,
html[data-theme="light"] .sat-opacity-strip-val,
html[data-theme="light"] .sat-slider-head,
html[data-theme="light"] .sat-check-row,
html[data-theme="light"] .sat-kpi strong {
    color: #0f172a;
}

html[data-theme="light"] .sat-opacity-strip {
    background: rgba(241, 245, 249, 0.92);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .sat-opacity-strip-label {
    color: #dc2626;
}

html[data-theme="light"] .sat-intel-tabs,
html[data-theme="light"] .sat-side-card,
html[data-theme="light"] .sat-slider-block,
html[data-theme="light"] .sat-legend-box,
html[data-theme="light"] .sat-changed-plots-box,
html[data-theme="light"] .sat-inspect-card {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(15, 23, 42, 0.12);
    color: #0f172a;
}

html[data-theme="light"] .sat-select,
html[data-theme="light"] .sat-month-input,
html[data-theme="light"] .sat-month-btn,
html[data-theme="light"] .sat-btn,
html[data-theme="light"] .sat-preset-btn,
html[data-theme="light"] .sat-spectral-btn,
html[data-theme="light"] .sat-intel-icon-btn,
html[data-theme="light"] .sat-peek-btn,
html[data-theme="light"] .sat-changed-plot-item {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.16);
    color: #0f172a;
    color-scheme: light;
}

html[data-theme="light"] .sat-intel-status {
    background: rgba(224, 242, 254, 0.9);
    color: #0369a1;
}

html[data-theme="light"] .sat-popup-badge.harvest,
html[data-theme="light"] .sat-popup-badge.danger {
    background: #fee2e2;
    color: #991b1b;
}

html[data-theme="light"] .sat-popup-badge.degrade,
html[data-theme="light"] .sat-popup-badge.warning {
    background: #ffedd5;
    color: #9a3412;
}

html[data-theme="light"] .sat-popup-badge.regrowth,
html[data-theme="light"] .sat-popup-badge.growth,
html[data-theme="light"] .sat-popup-badge.success {
    background: #d1fae5;
    color: #065f46;
}

html[data-theme="light"] #basemap-picker.collapsed .basemap-title {
    color: #0f172a !important;
}

/* --- 4. Mobile Responsive Drawer (Phone & Tablet) --- */
@media (max-width: 768px) {
    #sat-intel-dock {
        top: auto;
        left: 8px;
        right: 8px;
        bottom: 12px;
        z-index: 8650;
        width: auto;
        max-width: none;
        max-height: 56dvh;
        border-radius: 16px;
    }

    #sat-intel-dock .sat-select {
        padding: 7px 8px;
        font-size: 13px !important;
    }

    #sat-intel-dock.collapsed {
        width: 286px !important;
        max-height: 92px !important;
    }

    .sat-swipe-badges {
        top: 8px;
        gap: 6px;
        max-width: calc(100% - 16px);
    }

    .sat-swipe-badge {
        font-size: 10px;
        padding: 4px 8px;
        max-width: 45vw;
    }

    .sat-swipe-handle {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .sat-preset-btn {
        min-width: 120px;
        font-size: 10.5px;
    }
}
