/* ============================================================================
   EarthCARE Analysis Platform — "Aerospace Mission Console" design system
   ----------------------------------------------------------------------------
   Light, premium, atmospheric. Deep teal-cyan brand (replaces the default
   indigo via the Tailwind runtime config in base.html), Sora / IBM Plex type,
   glassy depth, and restrained motion.

   IMPORTANT: every selector the templates/JS depend on is preserved
   (.tab-btn/.tab-active, .ectools-plot, .cursor-zoom-in, #resultImage,
   .upload-*, .plot-doc-*, all .gp-*). New polish is layered on top, scoped to
   .ec-app so the admin console (separate shell) is untouched apart from fonts.
   Fonts load progressively; the system fallback stack renders if a restricted
   network blocks Google Fonts.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@500;600;700;800&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500;600&display=swap');

:root {
    --font-body: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Sora", "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

    /* Brand — deep "aerospace" teal-cyan */
    --brand-50:  #ecfdfb;
    --brand-100: #cffbf6;
    --brand-200: #a0f4ee;
    --brand-300: #67e8e2;
    --brand-400: #2dd1cf;
    --brand-500: #13b3b5;
    --brand-600: #0a8f95;
    --brand-700: #0c7176;
    --brand-800: #0f5a60;
    --brand-900: #114a50;
    --brand-950: #042e33;

    /* Ink / neutrals */
    --ink-900: #0b1f24;
    --ink-700: #294349;
    --ink-500: #5a747b;
    --ink-400: #87a0a7;

    --line: rgba(11, 143, 149, 0.14);
    --line-strong: rgba(11, 143, 149, 0.28);

    --accent-amber: #f59e0b;
    --success: #0f9d6b;
    --danger: #dc2626;

    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 8px;

    --shadow-sm: 0 1px 2px rgba(8, 40, 45, 0.06), 0 1px 3px rgba(8, 40, 45, 0.05);
    --shadow-md: 0 4px 12px -4px rgba(8, 40, 45, 0.12), 0 14px 30px -18px rgba(8, 40, 45, 0.20);
    --shadow-lg: 0 10px 24px -8px rgba(8, 40, 45, 0.20), 0 34px 60px -26px rgba(8, 40, 45, 0.32);
    --shadow-glow: 0 8px 22px -8px rgba(10, 143, 149, 0.55);

    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─────────────────────────────────────────────────────────────────────────
   Base
   ───────────────────────────────────────────────────────────────────────── */

body { font-family: var(--font-body); color: var(--ink-700); }

.ec-app {
    font-family: var(--font-body);
    color: var(--ink-700);
    background:
        radial-gradient(1150px 560px at 10% -10%, rgba(45, 209, 207, 0.12), transparent 60%),
        radial-gradient(1000px 520px at 102% -4%, rgba(56, 130, 246, 0.07), transparent 55%),
        radial-gradient(900px 700px at 80% 110%, rgba(13, 179, 181, 0.06), transparent 60%),
        linear-gradient(180deg, #f4f9fa 0%, #eaf3f3 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Ultra-subtle grain so large flat areas read as a surface, not a void. */
.ec-app::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.ec-app main { position: relative; z-index: 1; }

::selection { background: rgba(19, 179, 181, 0.22); color: var(--ink-900); }

/* Refined scrollbars */
.ec-app *::-webkit-scrollbar { width: 11px; height: 11px; }
.ec-app *::-webkit-scrollbar-thumb {
    background: rgba(12, 113, 118, 0.30);
    border-radius: 20px;
    border: 3px solid transparent;
    background-clip: content-box;
}
.ec-app *::-webkit-scrollbar-thumb:hover { background: rgba(12, 113, 118, 0.50); background-clip: content-box; }
.ec-app *::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; border-radius: 4px; }

/* ─────────────────────────────────────────────────────────────────────────
   Mission header (nav)
   ───────────────────────────────────────────────────────────────────────── */

.ec-nav {
    padding: 0.85rem 1.5rem;
    color: #dffaf8;
    background:
        radial-gradient(820px 240px at 16% -60%, rgba(45, 209, 207, 0.30), transparent 60%),
        linear-gradient(118deg, #042e33 0%, #0a585f 52%, #0c7176 100%);
    box-shadow: 0 14px 34px -16px rgba(4, 46, 51, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
/* Faint drifting star/scan field */
.ec-nav::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(1.4px 1.4px at 20% 30%, rgba(255, 255, 255, 0.5), transparent),
        radial-gradient(1.2px 1.2px at 60% 70%, rgba(167, 244, 238, 0.5), transparent),
        radial-gradient(1.2px 1.2px at 85% 20%, rgba(255, 255, 255, 0.4), transparent),
        radial-gradient(1px 1px at 42% 80%, rgba(255, 255, 255, 0.4), transparent);
    background-size: 240px 120px;
    opacity: 0.55;
    animation: ec-stars 24s linear infinite;
}
/* Glowing scan line along the bottom edge */
.ec-nav::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(45, 209, 207, 0.85), transparent);
    background-size: 50% 100%;
    background-repeat: no-repeat;
    animation: ec-scan 6.5s var(--ease) infinite;
    z-index: 15;
}
@keyframes ec-stars { to { background-position: 240px 0, -240px 0, 240px 0, -240px 0; } }
@keyframes ec-scan {
    0%   { background-position: -60% 0; }
    100% { background-position: 160% 0; }
}

.ec-nav-inner { gap: 1rem; }

.ec-brand { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.ec-brand-mark {
    width: 30px; height: 30px; border-radius: 50%;
    position: relative; flex-shrink: 0;
    background: radial-gradient(circle at 34% 30%, #7ff0ea, #0a8f95 58%, #06363b);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 18px rgba(45, 209, 207, 0.55);
}
/* Static orbit ring */
.ec-brand-mark::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px dashed rgba(94, 234, 212, 0.35);
}
/* Orbiting satellite dot */
.ec-brand-mark::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    width: 4px; height: 4px;
    margin: -2px 0 0 -2px;
    border-radius: 50%;
    background: #fde68a;
    box-shadow: 0 0 8px 1px rgba(251, 191, 36, 0.9);
    transform-origin: -8px center;
    animation: ec-orbit 5.5s linear infinite;
}
@keyframes ec-orbit { to { transform: rotate(360deg); } }

.ec-brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    color: #fff;
    line-height: 1;
    display: block;
}
.ec-brand-tag {
    display: block;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 0.56rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(167, 244, 238, 0.72);
}

.ec-nav-link {
    color: rgba(207, 251, 246, 0.78);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.3rem 0.55rem;
    border-radius: var(--radius-xs);
    transition: color 0.2s, background 0.2s;
}
.ec-nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.ec-nav-link-admin {
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
}
.ec-nav-link-admin:hover { background: rgba(255, 255, 255, 0.2); }
.ec-user {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(223, 250, 248, 0.92);
    font-family: var(--font-mono);
}

.ec-chip {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    color: #d7fbf7;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.16);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.ec-chip:hover {
    background: rgba(45, 209, 207, 0.28);
    box-shadow: 0 0 0 3px rgba(45, 209, 207, 0.18);
    transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────────────────
   Cards / surfaces (scoped to main so modals & nav are unaffected)
   ───────────────────────────────────────────────────────────────────────── */

.ec-app main .bg-white.rounded-lg {
    background: linear-gradient(180deg, #ffffff 0%, #f8fdfd 100%) !important;
    border: 1px solid var(--line);
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-md) !important;
    transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease), border-color 0.32s var(--ease);
}
.ec-app main .bg-white.rounded-lg:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg) !important;
    border-color: var(--line-strong);
}

/* Section headings inside cards get the display face + an accent tick */
.ec-app main .bg-white.rounded-lg > h2 {
    font-family: var(--font-display);
    color: var(--ink-900);
    letter-spacing: -0.015em;
}
.ec-app main .bg-white.rounded-lg > h2:not(.text-center) {
    position: relative;
    padding-left: 0.8rem;
}
.ec-app main .bg-white.rounded-lg > h2:not(.text-center)::before {
    content: "";
    position: absolute;
    left: 0; top: 0.12em; bottom: 0.12em;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--brand-400), var(--brand-700));
    box-shadow: 0 0 10px rgba(19, 179, 181, 0.5);
}

/* Intro / hint gradient card */
.ec-app main .bg-gradient-to-br {
    border-radius: var(--radius) !important;
    border: 1px solid var(--line) !important;
    box-shadow: var(--shadow-sm);
}

/* ─────────────────────────────────────────────────────────────────────────
   Form controls (scoped to .ec-app — covers app + auth pages)
   ───────────────────────────────────────────────────────────────────────── */

.ec-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
.ec-app select,
.ec-app textarea {
    font-family: var(--font-body);
    color: var(--ink-900);
    background: #fff;
    border-color: var(--line-strong);
    border-radius: var(--radius-sm) !important;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s;
}
.ec-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):hover,
.ec-app select:hover,
.ec-app textarea:hover { border-color: var(--brand-400); }
.ec-app input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):focus,
.ec-app select:focus,
.ec-app textarea:focus {
    outline: none;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 4px rgba(19, 179, 181, 0.16);
}
.ec-app ::placeholder { color: var(--ink-400); }

/* Numeric / coordinate inputs read as data */
.ec-app input[type="number"], .ec-app input[type="date"] { font-family: var(--font-mono); }

/* Range slider */
.ec-app input[type="range"] { accent-color: var(--brand-600); }

/* File input button */
.ec-app input[type="file"]::file-selector-button {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--brand-700);
    background: var(--brand-50);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-xs);
    padding: 0.4rem 0.8rem;
    margin-right: 0.7rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.ec-app input[type="file"]::file-selector-button:hover { background: var(--brand-100); color: var(--brand-800); }

.ec-app input[type="checkbox"] { accent-color: var(--brand-600); }

/* ─────────────────────────────────────────────────────────────────────────
   Buttons & button-like links (scoped to main / auth surfaces)
   ───────────────────────────────────────────────────────────────────────── */

.ec-app main button,
.ec-app main a[class*="bg-"],
.ec-app form button {
    position: relative;
    overflow: hidden;
    font-family: var(--font-body);
    transition: transform 0.16s var(--ease), box-shadow 0.26s var(--ease), filter 0.2s;
}
.ec-app main button:not(:disabled):hover,
.ec-app main a[class*="bg-"]:hover,
.ec-app form button:hover { transform: translateY(-1px); filter: saturate(1.06) brightness(1.03); }
.ec-app main button:not(:disabled):active,
.ec-app main a[class*="bg-"]:active,
.ec-app form button:active { transform: translateY(0) scale(0.99); }
.ec-app main button:disabled { filter: grayscale(0.2); }

/* Gradient fills replacing flat brand/utility backgrounds */
.ec-app .bg-indigo-600,
.ec-app .bg-indigo-700,
.ec-app form button[type="submit"] {
    background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 100%) !important;
    color: #fff !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: var(--shadow-glow);
}
.ec-app .bg-amber-500, .ec-app .bg-amber-600 {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%) !important;
    color: #422006 !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 8px 20px -8px rgba(245, 158, 11, 0.55);
}
.ec-app .bg-emerald-600, .ec-app .bg-green-600, .ec-app .bg-green-700 {
    background: linear-gradient(135deg, #14b88a 0%, #0f9d6b 100%) !important;
    color: #fff !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 8px 20px -8px rgba(15, 157, 107, 0.5);
}
.ec-app .bg-blue-600, .ec-app .bg-blue-700 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important;
    color: #fff !important;
    border-radius: var(--radius-sm) !important;
    box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.5);
}

/* Sheen sweep on primary CTAs (scoped so pseudo can't leak outside content) */
.ec-app main .bg-indigo-600::after,
.ec-app form button[type="submit"]::after {
    content: "";
    position: absolute;
    top: 0; left: -120%;
    width: 70%; height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent);
    transform: skewX(-18deg);
    transition: left 0.6s var(--ease);
}
.ec-app main .bg-indigo-600:hover::after,
.ec-app form button[type="submit"]:hover::after { left: 130%; }

/* Subtle pill buttons in the My-Files / globe trigger areas keep their look */

/* ─────────────────────────────────────────────────────────────────────────
   Tabs — sliding underline indicator
   ───────────────────────────────────────────────────────────────────────── */

.tab-btn {
    position: relative;
    border-bottom-color: transparent !important;
    transition: color 0.2s var(--ease), background 0.2s;
    border-top-left-radius: var(--radius-xs);
    border-top-right-radius: var(--radius-xs);
}
.tab-btn:hover { color: var(--brand-700); background: rgba(19, 179, 181, 0.06); }
.tab-btn::after {
    content: "";
    position: absolute;
    left: 50%; right: 50%; bottom: -1px;
    height: 2.5px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--brand-400), var(--brand-700));
    transition: left 0.28s var(--ease), right 0.28s var(--ease);
}
.tab-active { color: var(--brand-700) !important; }
.tab-active::after { left: 0; right: 0; box-shadow: 0 0 10px rgba(19, 179, 181, 0.5); }

/* ─────────────────────────────────────────────────────────────────────────
   Progress bars — animated gradient + shimmer
   ───────────────────────────────────────────────────────────────────────── */

#progressBar, #qlProgressBar, #icProgressBar, #cvProgressBar {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg, var(--brand-400), var(--brand-600)) !important;
    box-shadow: 0 0 12px rgba(19, 179, 181, 0.5);
}
#progressBar::after, #qlProgressBar::after, #icProgressBar::after, #cvProgressBar::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    background-size: 40% 100%;
    background-repeat: no-repeat;
    animation: ec-shimmer 1.3s linear infinite;
}
@keyframes ec-shimmer {
    0%   { background-position: -50% 0; }
    100% { background-position: 150% 0; }
}

/* Progress track */
.ec-app .h-2.bg-gray-200 { background: rgba(11, 143, 149, 0.12) !important; border-radius: 999px; overflow: hidden; }

/* ─────────────────────────────────────────────────────────────────────────
   Result images & error panels
   ───────────────────────────────────────────────────────────────────────── */

.cursor-zoom-in { cursor: zoom-in; }

#resultImage, #cvResultImage {
    max-height: 520px;
    object-fit: contain;
    border-radius: var(--radius-xs);
}

/* ectools plots are often very large (25x35 inch figures) */
.ectools-plot { max-height: 80vh; object-fit: contain; }

.ec-app main .overflow-auto.border.rounded {
    border-color: var(--line) !important;
    border-radius: var(--radius-sm) !important;
    background:
        linear-gradient(#fff, #fff) padding-box,
        repeating-linear-gradient(45deg, #f1f6f6, #f1f6f6 8px, #eef4f4 8px, #eef4f4 16px) border-box;
    box-shadow: inset 0 1px 3px rgba(8, 40, 45, 0.05);
}

/* Error card with collapsible technical details (see renderErrorInto in app.js) */
.ec-app [id$="ErrorCard"], #errorCard {
    border-radius: var(--radius) !important;
    box-shadow: var(--shadow-sm);
}
.ec-app [id$="ErrorText"] summary { list-style: none; }
.ec-app [id$="ErrorText"] summary::-webkit-details-marker { display: none; }
.ec-app [id$="ErrorText"] summary::before { content: "▸ "; }
.ec-app [id$="ErrorText"] details[open] summary::before { content: "▾ "; }

/* ─────────────────────────────────────────────────────────────────────────
   Entrance motion — staggered card reveal on load & tab switch
   ───────────────────────────────────────────────────────────────────────── */

@keyframes ec-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

.ec-app .tab-panel:not(.hidden) .space-y-4 > * { animation: ec-rise 0.5s var(--ease) both; }
.ec-app .tab-panel:not(.hidden) .space-y-4 > *:nth-child(1) { animation-delay: 0.03s; }
.ec-app .tab-panel:not(.hidden) .space-y-4 > *:nth-child(2) { animation-delay: 0.09s; }
.ec-app .tab-panel:not(.hidden) .space-y-4 > *:nth-child(3) { animation-delay: 0.15s; }
.ec-app .tab-panel:not(.hidden) .space-y-4 > *:nth-child(4) { animation-delay: 0.21s; }
.ec-app .tab-panel:not(.hidden) .space-y-4 > *:nth-child(5) { animation-delay: 0.27s; }
.ec-app .tab-panel:not(.hidden) .space-y-4 > *:nth-child(6) { animation-delay: 0.33s; }
.ec-app .tab-panel:not(.hidden) .space-y-4 > *:nth-child(7) { animation-delay: 0.39s; }
.ec-app .tab-panel:not(.hidden) .space-y-4 > *:nth-child(n+8) { animation-delay: 0.45s; }

/* Auth cards drop in */
.ec-app main > .flex > .bg-white { animation: ec-rise 0.5s var(--ease-spring) both; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ─────────────────────────────────────────────────────────────────────────
   My-Files modal polish
   ───────────────────────────────────────────────────────────────────────── */

#mf-backdrop { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
#mf-backdrop > div {
    border-radius: 18px !important;
    box-shadow: 0 40px 90px -30px rgba(4, 46, 51, 0.6), 0 0 0 1px rgba(11, 143, 149, 0.10);
    animation: ec-rise 0.32s var(--ease-spring) both;
}
.mf-filter { transition: background 0.18s, color 0.18s, transform 0.12s; }
.mf-filter:hover { transform: translateY(-1px); }

/* ─────────────────────────────────────────────────────────────────────────
   Upload satellite progress bar (kept verbatim — JS-coupled animation)
   ───────────────────────────────────────────────────────────────────────── */

.upload-track {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 20;
    transition: opacity 0.4s ease;
}
.upload-track-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2dd1cf, #fbbf24, #34d399);
    border-radius: 0 3px 3px 0;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(45, 209, 207, 0.6);
}
.upload-satellite {
    position: absolute;
    bottom: 6px;
    left: 0%;
    transform: translateX(-50%);
    transition: left 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.7));
    animation: satellite-bob 2s ease-in-out infinite;
}
.upload-percent {
    position: absolute;
    bottom: 36px;
    left: 0%;
    transform: translateX(-50%);
    transition: left 0.3s ease;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: #fbbf24;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    pointer-events: none;
}
@keyframes satellite-bob {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-3px); }
}
.upload-track.upload-done .upload-satellite { animation: satellite-arrive 0.6s ease forwards; }
@keyframes satellite-arrive {
    0% { filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.7)); }
    50% { filter: drop-shadow(0 0 16px rgba(52, 211, 153, 1)); }
    100% { filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.5)); }
}
.upload-track.upload-done .upload-track-fill {
    background: linear-gradient(90deg, #34d399, #34d399);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.6);
}
.upload-track.upload-done .upload-percent { color: #34d399; }

/* ─────────────────────────────────────────────────────────────────────────
   Plot documentation slide-over modal
   ───────────────────────────────────────────────────────────────────────── */

.plot-doc-backdrop { opacity: 0; transition: opacity 0.25s ease-out; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.plot-doc-backdrop.active { opacity: 1; }
.plot-doc-panel { transform: translateX(100%); transition: transform 0.3s var(--ease); box-shadow: -30px 0 60px -20px rgba(4, 46, 51, 0.4); }
.plot-doc-panel.active { transform: translateX(0); }

/* ─────────────────────────────────────────────────────────────────────────
   Globe Picker (retuned accents to the new brand)
   ───────────────────────────────────────────────────────────────────────── */

.gp-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(13, 179, 181, 0.35);
    font-size: 13px;
    font-weight: 700;
    color: #e3fffb;
    background: linear-gradient(135deg, #06363b 0%, #0a585f 50%, #0c7176 100%);
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
    box-shadow: 0 2px 10px rgba(10, 143, 149, 0.3);
    letter-spacing: 0.01em;
}
.gp-trigger-btn svg { width: 16px; height: 16px; flex-shrink: 0; color: #5eead4; }
.gp-trigger-btn:hover {
    background: linear-gradient(135deg, #0a585f 0%, #0c7176 50%, #13b3b5 100%);
    box-shadow: 0 4px 18px rgba(19, 179, 181, 0.45);
    transform: translateY(-1px);
}
.gp-trigger-btn:active { transform: translateY(0); box-shadow: 0 1px 6px rgba(10, 143, 149, 0.25); }

.gp-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 12, 14, 0.7);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}
.gp-backdrop.gp-hidden { display: none; }
.gp-backdrop.gp-active { opacity: 1; visibility: visible; }

.gp-modal {
    width: 100%;
    max-width: 620px;
    background: #061319;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: scale(0.88) translateY(24px);
    opacity: 0;
    transition: transform 0.38s var(--ease-spring), opacity 0.26s ease;
}
.gp-backdrop.gp-active .gp-modal { transform: scale(1) translateY(0); opacity: 1; }

.gp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: linear-gradient(135deg, #042e33 0%, #0a585f 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.gp-title { display: flex; align-items: center; gap: 10px; color: #e0fffb; font-size: 15px; font-weight: 700; letter-spacing: -0.01em; font-family: var(--font-display); }
.gp-title svg { width: 20px; height: 20px; color: #5eead4; }
.gp-close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: none; cursor: pointer;
    color: rgba(255, 255, 255, 0.65);
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.gp-close svg { width: 15px; height: 15px; }
.gp-close:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }

.gp-canvas-wrap { background: #020607; position: relative; display: flex; align-items: center; justify-content: center; padding: 16px; }
#gp-canvas { display: block; max-width: 100%; height: auto; cursor: grab; border-radius: 50%; touch-action: none; user-select: none; }
#gp-canvas:active { cursor: grabbing; }

.gp-loading {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px;
    background: rgba(2, 6, 7, 0.82);
    color: rgba(255, 255, 255, 0.55);
    font-size: 13px;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.gp-loading.hidden { opacity: 0; pointer-events: none; }
.gp-spinner {
    width: 34px; height: 34px;
    border: 3px solid rgba(19, 179, 181, 0.2);
    border-top-color: var(--brand-400);
    border-radius: 50%;
    animation: gp-spin 0.75s linear infinite;
}
@keyframes gp-spin { to { transform: rotate(360deg); } }

.gp-hint { text-align: center; font-size: 11px; color: rgba(255, 255, 255, 0.3); padding: 5px 20px 8px; letter-spacing: 0.03em; }

.gp-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 14px 20px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(255, 255, 255, 0.025);
    flex-wrap: wrap;
}
.gp-coords { flex: 1; min-width: 0; font-size: 13px; min-height: 22px; display: flex; align-items: center; gap: 2px; }
.gp-coord-placeholder { color: rgba(255, 255, 255, 0.3); font-style: italic; font-size: 12px; }
.gp-coord-val { color: #fbbf24; font-weight: 700; font-size: 15px; font-family: var(--font-mono); letter-spacing: -0.02em; }
.gp-coord-sep { color: rgba(255, 255, 255, 0.3); margin: 0 4px; }

.gp-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gp-clear-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px; font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.gp-clear-btn svg { width: 13px; height: 13px; }
.gp-clear-btn:hover { background: rgba(255, 255, 255, 0.07); color: rgba(255, 255, 255, 0.85); border-color: rgba(255, 255, 255, 0.22); }
.gp-confirm-btn {
    display: flex; align-items: center; gap: 6px;
    padding: 9px 20px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--brand-600), var(--brand-500));
    color: #fff;
    font-size: 13px; font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(19, 179, 181, 0.45);
    letter-spacing: 0.01em;
}
.gp-confirm-btn svg { width: 13px; height: 13px; }
.gp-confirm-btn:hover:not(:disabled) { background: linear-gradient(135deg, var(--brand-500), var(--brand-400)); box-shadow: 0 6px 22px rgba(19, 179, 181, 0.55); transform: translateY(-1px); }
.gp-confirm-btn:active:not(:disabled) { transform: translateY(0); }
.gp-confirm-btn:disabled { opacity: 0.38; cursor: not-allowed; box-shadow: none; }

/* ════════════════════════════════════════════════════════════════════
   Download Data section — three-column acquisition console (.dl-*)
   and the flat 2-D track map chrome (.tm-*). Self-contained; reuses the
   brand tokens above. Nothing here affects the other tabs.
   ════════════════════════════════════════════════════════════════════ */

.dl-console {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr) 332px;
    gap: 16px;
    height: calc(100vh - 212px);
    min-height: 600px;
}
@media (max-width: 1100px) {
    .dl-console { grid-template-columns: 1fr; height: auto; }
    .dl-mapwrap { height: 460px; }
}

.dl-filters, .dl-results {
    display: flex; flex-direction: column; min-height: 0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fdfd 100%);
    border: 1px solid var(--brand-100);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 60, 71, 0.05);
    overflow: hidden;
}
.dl-filter-scroll { flex: 1 1 auto; overflow-y: auto; padding: 14px; }

.dl-group { margin-bottom: 15px; }
.dl-group:last-child { margin-bottom: 4px; }
.dl-group-h {
    font-family: var(--font-display); font-size: 0.72rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand-800);
    margin-bottom: 7px; display: flex; align-items: center; justify-content: space-between;
}
.dl-opt { font-weight: 400; text-transform: none; letter-spacing: 0; color: #94a3b8; }
.dl-group-actions { display: flex; gap: 9px; }
.dl-link { font-size: 0.68rem; color: var(--brand-600); background: none; border: 0; cursor: pointer; text-transform: none; letter-spacing: 0; padding: 0; }
.dl-link:hover { text-decoration: underline; }

.dl-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* Instrument chips — quiet, monochrome controls. Colour belongs to the data
   (map tracks, legend, result rows), not the filter, so the selector reads as a
   calm control panel; the active filter is marked in the single brand teal. */
.dl-chip {
    display: inline-flex; align-items: center; cursor: pointer;
    font-size: 0.74rem; font-weight: 600; letter-spacing: 0.01em; line-height: 1;
    padding: 7px 12px; border-radius: 8px;
    border: 1px solid var(--brand-200); background: #fff; color: var(--ink-700);
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.dl-chip:hover { background: var(--brand-50); border-color: var(--brand-300); }
.dl-chip:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 1px; }
.dl-chip-on {
    color: #fff; font-weight: 700;
    background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
    border-color: var(--brand-600);
    box-shadow: 0 2px 7px rgba(10, 143, 149, 0.28);
}

/* Level tags — compact monospace technical tags (levels carry no colour). */
.dl-tag {
    cursor: pointer; padding: 5px 10px; border-radius: 7px;
    border: 1px solid var(--brand-200); background: #fff; color: var(--ink-600);
    font-family: var(--font-mono); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.04em;
    transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.dl-tag:hover { background: var(--brand-50); border-color: var(--brand-300); }
.dl-tag:focus-visible { outline: 2px solid var(--brand-400); outline-offset: 1px; }
.dl-tag-on { color: var(--brand-800); background: var(--brand-50); border-color: var(--brand-400); box-shadow: inset 0 0 0 1px var(--brand-200); }

/* Instrument colour swatch for the data lists only (product picker + results) —
   a small rounded technical square. Colour lives here and on the map, not on the
   filter chips. */
.dl-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.45), 0 0 0 1px rgba(8,40,46,0.12); }

.dl-prodlist {
    max-height: 156px; overflow-y: auto; padding: 4px;
    border: 1px solid var(--brand-100); border-radius: 10px; background: #fff;
}
.dl-prod { display: flex; align-items: center; gap: 7px; padding: 3px 6px; border-radius: 7px; cursor: pointer; font-size: 0.74rem; }
.dl-prod:hover { background: var(--brand-50); }
.dl-prod input { width: 14px; height: 14px; }
.dl-prod-code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-800); }
.dl-prod-lvl { margin-left: auto; font-size: 0.6rem; color: #94a3b8; font-family: var(--font-mono); }

.dl-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.dl-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.dl-row2 label, .dl-row3 label { display: flex; flex-direction: column; gap: 2px; font-size: 0.6rem; color: #64748b; }
.dl-row2 input, .dl-row3 input, .dl-orbit { padding: 5px 7px !important; font-size: 0.78rem !important; }

.dl-modes { display: flex; gap: 5px; margin-bottom: 9px; }
.dl-mode {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px;
    cursor: pointer; font-size: 0.68rem; font-weight: 600; padding: 7px 4px;
    border-radius: 9px; border: 1px solid var(--brand-200); background: #fff;
    color: var(--ink-600); transition: all 0.15s;
}
.dl-mode svg { width: 13px; height: 13px; flex: none; }
.dl-mode:hover { background: var(--brand-50); border-color: var(--brand-300); }
.dl-mode-on {
    background: linear-gradient(180deg, var(--brand-500), var(--brand-600));
    border-color: var(--brand-600); color: #fff;
    box-shadow: 0 2px 8px rgba(10, 143, 149, 0.28);
}
.dl-loc-fields { display: flex; flex-direction: column; gap: 8px; }
.dl-map-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; font-size: 0.72rem; font-weight: 600; padding: 8px 10px;
    border-radius: 9px; border: 1px solid var(--brand-200);
    background: var(--brand-50); color: var(--brand-700); transition: all 0.15s;
}
.dl-map-btn svg { width: 13px; height: 13px; flex: none; }
.dl-map-btn:hover { background: var(--brand-100); border-color: var(--brand-300); }
.dl-orbit { width: 100%; }

.dl-search-foot { flex: none; padding: 12px 14px; border-top: 1px solid var(--brand-100); background: #fff; }
.dl-search-btn {
    width: 100%; padding: 11px; border-radius: 10px; cursor: pointer;
    font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; color: #fff;
    background: linear-gradient(180deg, var(--brand-500), var(--brand-700));
    box-shadow: 0 3px 12px rgba(10, 143, 149, 0.32); transition: all 0.15s;
}
.dl-search-btn:hover:not(:disabled) { filter: brightness(1.07); box-shadow: 0 5px 18px rgba(10, 143, 149, 0.42); }
.dl-search-btn:disabled { opacity: 0.6; cursor: progress; }

.dl-progress { margin-top: 10px; }
.dl-progress-bar { height: 6px; border-radius: 999px; background: var(--brand-100); overflow: hidden; }
.dl-progress-bar > div { height: 100%; width: 4%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-400), var(--brand-600)); transition: width 0.3s ease; }
.dl-progress-bar > div.dl-indet { width: 38% !important; animation: dl-indet 1.1s ease-in-out infinite; }
@keyframes dl-indet { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
.dl-progress-text { font-size: 0.66rem; color: #64748b; margin-top: 4px; font-family: var(--font-mono); }

.dl-hint { font-size: 0.66rem; color: #94a3b8; margin-top: 4px; }
.dl-warn { color: #b45309 !important; }
.dl-error { font-size: 0.72rem; color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 7px 9px; margin-top: 8px; }

/* Map column */
.dl-mapwrap { min-height: 0; position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--brand-200); box-shadow: 0 1px 4px rgba(15, 60, 71, 0.08); }
.dl-map { width: 100%; height: 100%; }

/* Results column */
.dl-results-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--brand-100); }
.dl-results-count { font-family: var(--font-display); font-weight: 700; color: var(--brand-800); font-size: 0.84rem; }
.dl-results-count span { font-size: 1rem; }
.dl-selall { font-size: 0.7rem; color: #64748b; display: flex; align-items: center; gap: 5px; cursor: pointer; }
.dl-results-filter { flex: none; display: flex; gap: 6px; padding: 8px 12px; border-bottom: 1px solid var(--brand-100); }
.dl-results-filter input { flex: 1; padding: 5px 8px !important; font-size: 0.74rem !important; }
.dl-results-filter select { padding: 5px 6px !important; font-size: 0.72rem !important; }
.dl-batchbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); }
.dl-sel-info { font-size: 0.68rem; color: var(--brand-800); font-family: var(--font-mono); }
.dl-batch-btns { display: flex; gap: 6px; }
.dl-bbtn { cursor: pointer; font-size: 0.72rem; font-weight: 600; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--brand-300); background: #fff; color: var(--brand-700); transition: all 0.15s; }
.dl-bbtn:hover:not(:disabled) { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.dl-bbtn:disabled { opacity: 0.55; cursor: progress; }

.dl-result-list { flex: 1 1 auto; overflow-y: auto; padding: 6px; }
.dl-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 10px; border: 1px solid transparent; }
.dl-row:hover, .dl-row-hover { background: var(--brand-50); }
.dl-row-sel { background: var(--brand-100); border-color: var(--brand-200); }
.dl-row-chk { flex: none; width: 15px; height: 15px; }
.dl-row-main { flex: 1; min-width: 0; }
.dl-row-title { font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600; color: var(--ink-900); display: flex; align-items: center; gap: 6px; }
.dl-row-lvl { font-size: 0.58rem; color: #94a3b8; font-weight: 400; }
.dl-row-meta { font-size: 0.63rem; color: #94a3b8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-row-acts { display: flex; gap: 3px; flex: none; }
.dl-row-acts button { width: 25px; height: 25px; border-radius: 6px; border: 1px solid var(--brand-100); background: #fff; color: var(--brand-700); cursor: pointer; font-size: 0.82rem; line-height: 1; transition: all 0.15s; }
.dl-row-acts button:hover { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.dl-act-err { color: #b91c1c !important; border-color: #fecaca !important; }
.dl-empty { padding: 28px 18px; text-align: center; color: #94a3b8; font-size: 0.78rem; line-height: 1.5; }

/* ── flat track map (track-map.js) ── */
.tm-root { position: relative; width: 100%; height: 100%; background: #06222f; }
.tm-canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.tm-canvas:active { cursor: grabbing; }
.tm-toolbar { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 3px; padding: 4px; border-radius: 10px; background: rgba(6, 34, 47, 0.74); border: 1px solid rgba(125, 200, 205, 0.25); backdrop-filter: blur(6px); }
.tm-toolbar button { display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; color: #cdeef0; background: transparent; border: 0; padding: 5px 8px; border-radius: 7px; cursor: pointer; transition: background 0.15s; }
.tm-toolbar button:hover { background: rgba(45, 209, 207, 0.18); }
.tm-armed { background: var(--brand-500) !important; color: #fff !important; }
.tm-toolbar svg { width: 14px; height: 14px; display: block; }
.tm-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35); }
.tm-sep { width: 1px; height: 18px; background: rgba(125, 200, 205, 0.25); margin: 0 2px; }
.tm-hint { position: absolute; bottom: 10px; left: 10px; font-size: 0.64rem; color: rgba(205, 238, 240, 0.85); background: rgba(6, 34, 47, 0.6); padding: 4px 9px; border-radius: 8px; pointer-events: none; }
.tm-legend { position: absolute; top: 10px; right: 10px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 58%; padding: 6px 9px; border-radius: 9px; background: rgba(6, 34, 47, 0.6); border: 1px solid rgba(125, 200, 205, 0.2); }
.tm-leg-item { display: inline-flex; align-items: center; gap: 5px; font-size: 0.65rem; color: #e2f5f6; }
.tm-leg-n { color: #8fc7cc; font-family: var(--font-mono); font-size: 0.6rem; }
.tm-tooltip { position: absolute; pointer-events: none; z-index: 5; min-width: 124px; padding: 7px 9px; border-radius: 8px; background: rgba(6, 34, 47, 0.93); border: 1px solid rgba(125, 200, 205, 0.3); color: #e2f5f6; font-size: 0.65rem; transition: opacity 0.12s; }
.tm-tt-h { display: flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-weight: 600; margin-bottom: 2px; }
.tm-tt-r { color: #a9d6da; font-size: 0.62rem; }
