:root {
    --bg-black: #000000;
    --bg-dark05: #050505;
    --bg-dark0a: #0A0A0A;
    --bg-dark11: #111111;
    --text-white: #FFFFFF;
    --text-muted: #BDBDBD;
    --ylma-gold: #FFB700;
    --ylma-gold-glow: rgba(255, 183, 0, 0.35);
    --border-subtle: rgba(255, 255, 255, 0.12);
    --font-primary: 'Exo 2', 'Inter', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-black);
    color: var(--text-white);
    font-family: var(--font-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

.view-container {
    display: none;
    width: 100vw;
    height: 100vh;
}

.view-container.active {
    display: flex;
    flex-direction: column;
}

#landing-view {
    position: relative;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 24px;
}

.landing-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, #111111 0%, #000000 85%);
    z-index: 1;
}

.landing-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.brand-badge {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    color: var(--ylma-gold);
    margin-bottom: 16px;
    text-transform: uppercase;
}

.landing-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
}

.landing-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 300;
}

.ylma-btn {
    background: transparent;
    color: var(--text-white);
    border: 1px solid var(--border-subtle);
    padding: 12px 28px;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.25s ease;
    text-transform: uppercase;
}

.ylma-btn.primary-gold {
    background: var(--ylma-gold);
    color: #000000;
    border-color: var(--ylma-gold);
    box-shadow: 0 0 15px var(--ylma-gold-glow);
}

.ylma-btn.primary-gold:hover {
    background: #ffa200;
    box-shadow: 0 0 25px rgba(255, 183, 0, 0.5);
}

.ylma-btn.outline:hover {
    border-color: var(--ylma-gold);
    color: var(--ylma-gold);
}

.explorer-header {
    height: 64px;
    background: var(--bg-dark05);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
}

.header-left, .header-center, .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.brand-logo {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.15em;
    color: var(--ylma-gold);
    cursor: pointer;
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
}

.header-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
}

.user-badge {
    background: var(--bg-dark11);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.score-display {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ylma-gold);
}

.search-bar-section {
    background: var(--bg-dark0a);
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.search-form {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.input-group label {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
}

.input-group input {
    background: var(--bg-black);
    border: 1px solid var(--border-subtle);
    color: var(--text-white);
    padding: 8px 12px;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    width: 130px;
}

.input-group input:focus {
    outline: none;
    border-color: var(--ylma-gold);
}

.demo-badge-indicator {
    background: rgba(255, 183, 0, 0.1);
    border: 1px solid var(--ylma-gold);
    color: var(--ylma-gold);
    font-size: 0.7rem;
    font-weight: 600;
    padding: 6px 12px;
    letter-spacing: 0.1em;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 1fr 360px;
    flex-grow: 1;
    height: calc(100vh - 64px - 53px);
    overflow: hidden;
}

.visor-container {
    display: flex;
    flex-direction: column;
    background: var(--bg-black);
    border-right: 1px solid var(--border-subtle);
    position: relative;
    height: 100%;
}

.visor-toolbar {
    height: 52px;
    background: var(--bg-dark05);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    flex-shrink: 0;
}

.visor-mode-title {
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.visor-controls-group {
    display: flex;
    gap: 8px;
}

.control-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
}

.control-btn.active {
    background: var(--ylma-gold);
    color: #000000;
    border-color: var(--ylma-gold);
}

.visor-stage {
    flex-grow: 1;
    position: relative;
    background: #020202;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* --- ESTILOS VISTA DIVIDIDA (SPLIT VIEW) --- */
#split-view-container {
    display: none;
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
    z-index: 20;
    background: #000;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.split-pane {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.split-map {
    width: 100%;
    flex-grow: 1;
}

.split-hud-bar {
    background: rgba(5, 5, 5, 0.95);
    border-top: 1px solid var(--border-subtle);
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.split-hud-bar span {
    font-size: 0.7rem;
    color: var(--ylma-gold);
    font-weight: 700;
    letter-spacing: 0.1em;
}

.epoch-index-input {
    width: 104px;
    min-width: 72px;
    background: #080808;
    border: 1px solid rgba(255, 183, 0, 0.55);
    border-radius: 3px;
    color: var(--text-white);
    padding: 8px 10px;
    font: 600 0.85rem var(--font-primary);
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.epoch-index-input:focus {
    outline: 2px solid rgba(255, 183, 0, 0.3);
    border-color: var(--ylma-gold);
}
.epoch-index-input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-subtle);
    border-top-color: var(--ylma-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    color: var(--ylma-gold);
}

.visor-hud-coords {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--border-subtle);
    padding: 6px 10px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    z-index: 10;
    pointer-events: none;
}

/* --- HUD INFERIOR FIJO --- */
.hud-timeline-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(5, 5, 5, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 183, 0, 0.35);
    padding: 10px 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 30 !important;
}

.timeline-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-main-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--ylma-gold);
}

.timeline-clock-display {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-white);
    text-shadow: 0 0 10px var(--ylma-gold-glow);
}

.curved-slider-container {
    width: 100%;
    display: flex;
    align-items: center;
}
.curved-slider-container .epoch-index-input {
    width: 120px;
}

/* SIDEBAR PANEL */
.sidebar-panel {
    background: var(--bg-dark05);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: 100%;
}

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

.panel-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--text-white);
    margin-bottom: 16px;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.info-key {
    color: var(--text-muted);
}

.info-val {
    color: var(--text-white);
    font-weight: 500;
}

.ylma-status {
    color: var(--ylma-gold);
    font-weight: 600;
}

.doc-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.ylma-link {
    font-size: 0.8rem;
    color: var(--ylma-gold);
    text-decoration: none;
    letter-spacing: 0.05em;
}

.ylma-link:hover {
    text-decoration: underline;
}

/* MODALS */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-dark0a);
    border: 1px solid var(--border-subtle);
    width: 100%;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
}

.modal-header {
    padding: 16px 24px;
    background: var(--bg-dark05);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 0.85rem;
    letter-spacing: 0.15em;
    color: var(--ylma-gold);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--text-white);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

@media (max-width: 900px) {
    body { overflow: auto; height: auto; min-height: 100vh; }
    .view-container { width: 100%; min-height: 100vh; height: auto; }
    .view-container.active { min-height: 100vh; }
    .explorer-header { min-height: 64px; height: auto; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
    .search-bar-section { align-items: stretch; flex-direction: column; gap: 12px; }
    .search-form { flex-wrap: wrap; }
    .workspace-grid { grid-template-columns: 1fr; height: auto; overflow: visible; }
    .visor-container { min-height: 60vh; }
    .sidebar-panel { max-height: none; overflow: visible; }
}
@media (max-width: 560px) {
    .landing-title { font-size: 2.1rem; }
    .header-left, .header-center, .header-right { flex-wrap: wrap; }
    .search-form { display: grid; grid-template-columns: 1fr 1fr; }
    .input-group input { width: 100%; min-width: 0; }
    .visor-toolbar { height: auto; min-height: 52px; flex-wrap: wrap; gap: 8px; padding: 10px; }
    .visor-controls-group { flex-wrap: wrap; }
    .epoch-index-input { width: 82px; }
    .hud-timeline-bottom { padding: 8px 12px; }
}
.catalog-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.72rem;
    margin: 10px 0 5px;
    letter-spacing: 0.04em;
}
.catalog-input {
    display: block;
    width: 100%;
    background: #050505;
    border: 1px solid var(--border-subtle);
    color: var(--text-white);
    padding: 9px 10px;
    border-radius: 3px;
    font: 0.82rem var(--font-primary);
}
.catalog-input:focus { outline: 1px solid var(--ylma-gold); border-color: var(--ylma-gold); }
.catalog-search-btn { width: 100%; margin-top: 12px; padding: 10px 12px; font-size: 0.72rem; }
.catalog-results { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow: auto; margin-top: 8px; }
.catalog-entry {
    width: 100%;
    text-align: left;
    overflow-wrap: anywhere;
    padding: 9px 10px;
    border: 1px solid var(--border-subtle);
    background: #090909;
    color: var(--text-white);
    font: 0.76rem var(--font-primary);
    cursor: pointer;
}
.catalog-entry:hover, .catalog-entry:focus-visible { border-color: var(--ylma-gold); color: var(--ylma-gold); outline: none; }


/* Local FITS import */
.fits-dropzone {
    position: absolute;
    z-index: 12;
    top: 14px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-width: min(390px, calc(100% - 28px));
    padding: 12px 16px;
    border: 1px dashed rgba(255, 193, 7, 0.65);
    border-radius: 4px;
    background: rgba(5, 10, 13, 0.88);
    color: var(--text-white);
    cursor: pointer;
    font-size: 0.72rem;
    transition: border-color .15s ease, background .15s ease;
}
.fits-dropzone strong { color: var(--ylma-gold); letter-spacing: .08em; }
.fits-dropzone span { color: var(--text-muted); }
.fits-dropzone:hover, .fits-dropzone:focus-visible, .fits-dropzone.drag-active {
    outline: none;
    border-color: var(--ylma-gold);
    background: rgba(30, 24, 5, 0.94);
    box-shadow: 0 0 18px rgba(255, 193, 7, 0.14);
}


/* FITS import workspace */
.fits-dropzone {
    position: absolute;
    z-index: 12;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(520px, calc(100% - 40px));
    min-height: 245px;
    max-width: 520px;
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-align: center;
    border: 1px dashed rgba(255, 183, 0, .72);
    border-radius: 8px;
    background: linear-gradient(145deg, rgba(18, 17, 10, .96), rgba(5, 7, 9, .96));
    color: var(--text-white);
    cursor: pointer;
    box-shadow: 0 18px 55px rgba(0,0,0,.38), 0 0 32px rgba(255,183,0,.08);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.fits-dropzone strong { color: var(--ylma-gold); font-size: .94rem; letter-spacing: .1em; }
.fits-dropzone span { color: var(--text-white); font-size: .82rem; }
.fits-dropzone small { color: var(--text-muted); font-size: .7rem; line-height: 1.5; }
.fits-dropzone:hover, .fits-dropzone:focus-visible, .fits-dropzone.drag-active {
    outline: none;
    border-color: #ffd65c;
    background: linear-gradient(145deg, rgba(40, 31, 8, .98), rgba(5, 7, 9, .98));
    box-shadow: 0 0 35px rgba(255,183,0,.2);
}
.fits-drop-icon {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border: 1px solid var(--ylma-gold);
    border-radius: 12px;
    color: var(--ylma-gold);
    font-weight: 800;
    letter-spacing: .12em;
    background: rgba(255,183,0,.08);
}
.fits-drop-button { margin-top: 5px; }
.fits-progress-overlay {
    display: none;
    position: absolute;
    z-index: 50;
    inset: 0;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.82);
    backdrop-filter: blur(8px);
}
.fits-progress-overlay.active { display: flex; }
.fits-progress-card {
    width: min(440px, calc(100% - 36px));
    padding: 30px;
    border: 1px solid rgba(255,183,0,.55);
    border-radius: 8px;
    background: #090909;
    text-align: center;
    box-shadow: 0 18px 60px rgba(0,0,0,.5);
}
.fits-progress-card h3 { color: var(--ylma-gold); font-size: .95rem; letter-spacing: .12em; margin: 15px 0 10px; }
.fits-progress-card p { color: var(--text-muted); font-size: .82rem; margin-bottom: 18px; }
.fits-progress-track { height: 8px; background: #242424; border-radius: 20px; overflow: hidden; margin-bottom: 10px; }
.fits-progress-track div { width: 0; height: 100%; background: var(--ylma-gold); transition: width .18s ease; }
.fits-progress-card strong { color: var(--ylma-gold); font-size: .8rem; }
.fits-progress-orbit {
    width: 42px; height: 42px; margin: auto;
    border: 3px solid rgba(255,183,0,.2);
    border-top-color: var(--ylma-gold);
    border-radius: 50%;
    animation: fits-orbit .8s linear infinite;
}
@keyframes fits-orbit { to { transform: rotate(360deg); } }
.saved-sky-summary { color: var(--ylma-gold); font-size: .72rem; margin: 8px 0; }
.saved-sky-list { display: flex; flex-direction: column; gap: 7px; max-height: 230px; overflow: auto; }
.saved-sky-item {
    display: flex; flex-direction: column; gap: 4px; width: 100%;
    padding: 10px; border: 1px solid var(--border-subtle);
    background: #090909; color: var(--text-white); text-align: left;
    font: inherit; cursor: pointer;
}
.saved-sky-item:hover, .saved-sky-item:focus-visible { border-color: var(--ylma-gold); outline: none; }
.saved-sky-item strong { color: var(--ylma-gold); font-size: .72rem; overflow-wrap: anywhere; }
.saved-sky-item span { color: var(--text-muted); font-size: .66rem; }
.saved-sky-item button { align-self: flex-end; border: 0; background: transparent; color: #ff8b72; cursor: pointer; font-size: .65rem; }
@media (max-width: 900px) {
    .fits-dropzone { min-height: 205px; padding: 22px 18px; }
    .fits-dropzone strong { font-size: .8rem; }
}

.fits-dropzone.fits-loaded { opacity: .08; pointer-events: none; transition: opacity .35s ease; }

/* Independent FITS raster viewer: no Aladin/CDS runtime required */
.fits-local-viewer{position:absolute;inset:0;z-index:8;display:flex;flex-direction:column;background:#020405;min-height:300px}
.fits-local-viewer[hidden]{display:none!important}
.fits-local-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 14px;color:#ffbb00;border-bottom:1px solid rgba(255,187,0,.28);font-size:.72rem;flex-wrap:wrap}
.fits-local-toolbar span{color:#d4d9df}
.fits-local-toolbar button{background:#171717;color:#ffbb00;border:1px solid #806000;padding:6px 12px;cursor:pointer}
.fits-local-viewport{flex:1;min-height:0;overflow:hidden;display:flex;align-items:center;justify-content:center;cursor:grab;touch-action:none;background:radial-gradient(ellipse at center,#101820 0%,#020405 75%)}
.fits-local-viewport:active{cursor:grabbing}
.fits-local-viewport img{max-width:100%;max-height:100%;object-fit:contain;transform-origin:center center;user-select:none;-webkit-user-drag:none}
.fits-local-footer{padding:7px 12px;color:#89939d;font-size:.62rem;letter-spacing:.06em;border-top:1px solid rgba(255,187,0,.2)}

.catalog-actions{display:grid;grid-template-columns:auto 1fr;gap:8px;align-items:center;margin:8px 0}
.catalog-up-btn{padding:9px 10px;font-size:.68rem;white-space:nowrap}
.catalog-search-btn{width:100%;margin:0}
.catalog-download-entry{display:block;text-decoration:none;color:var(--ylma-gold);border:1px solid rgba(255,183,0,.25);padding:9px 10px;font-size:.72rem;overflow-wrap:anywhere}
.catalog-download-entry:hover{background:rgba(255,183,0,.1);border-color:var(--ylma-gold)}
.catalog-entry{width:100%;text-align:left}

/* Comparación de FITS locales: parpadeo y vista dividida */
.compare-upload-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;width:100%;justify-content:center}
.compare-upload-row span{font-size:.72rem;color:var(--text-muted)}
#blink-local-image{max-width:100%;max-height:100%;object-fit:contain}
.split-local-container{position:absolute;inset:0;z-index:9;grid-template-columns:1fr 1fr;background:#020405;min-height:0}
.split-local-pane{position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;border-right:1px solid rgba(255,187,0,.35);background:#020405}
.split-local-pane img{max-width:100%;max-height:100%;object-fit:contain}
.split-local-pane span{position:absolute;top:10px;left:10px;padding:6px 9px;background:rgba(0,0,0,.8);color:var(--ylma-gold);font-size:.72rem;overflow-wrap:anywhere}
@media(max-width:700px){.split-local-container{grid-template-columns:1fr 1fr}.split-local-pane span{font-size:.58rem;max-width:90%}}

.split-compare-upload{position:absolute;top:10px;right:10px;z-index:4;padding:7px 10px;font-size:.65rem}


/* Importación FITS remota: panel independiente, sin alterar la carga local */
.fits-url-import{position:relative;z-index:3;top:auto;right:auto;width:calc(100% - 24px);max-width:none;margin:10px 12px 14px;padding:10px 12px;border:1px solid rgba(255,187,0,.28);border-radius:6px;background:rgba(5,10,13,.96);box-shadow:0 4px 16px rgba(0,0,0,.22);display:flex;flex-direction:column;gap:7px;box-sizing:border-box}
.fits-url-import label{color:var(--ylma-gold);font-size:.68rem;font-weight:700;letter-spacing:.08em}
.fits-url-controls{display:flex;gap:8px;min-width:0}
.fits-url-controls input{flex:1;min-width:0;background:#050505;border:1px solid var(--border-subtle);border-radius:3px;color:var(--text-white);padding:9px 10px;font: .72rem var(--font-primary)}
.fits-url-controls input:focus{outline:1px solid var(--ylma-gold);border-color:var(--ylma-gold)}
.fits-url-controls button{white-space:nowrap;padding:8px 12px;font-size:.68rem}
.fits-url-import small{color:var(--text-muted);font-size:.62rem}
@media(max-width:700px){.fits-url-import{width:calc(100% - 16px);margin:8px}.fits-url-controls{flex-direction:column}.fits-url-controls button{width:100%}}


/* Comparación FITS local: el visor principal se conserva y ocupa media pantalla. */
.visor-stage.local-split-active #fits-local-viewer{
    display:flex!important;position:absolute;inset:0 auto 0 0;width:50%;height:100%;
    z-index:8;border-right:1px solid rgba(255,187,0,.55);box-sizing:border-box;
}
.visor-stage.local-split-active #split-local-container{
    display:block!important;position:absolute;inset:0 0 0 50%;width:50%;height:100%;
    z-index:9;background:#020405;box-sizing:border-box;
}
.visor-stage.local-split-active #split-local-container .split-local-pane:first-of-type{display:none}
.visor-stage.local-split-active #split-local-container .split-local-pane:last-of-type{
    position:absolute;inset:0;width:100%;height:100%;border:0;
}
.visor-stage.local-split-active #split-local-container .split-local-pane img{
    width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;
}
.visor-stage.local-split-active #fits-local-viewport img{
    width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;
}
.blink-rate-control{display:flex;flex-direction:column;gap:5px;min-width:170px}
.blink-rate-control label{font-size:.68rem;color:var(--ylma-gold);letter-spacing:.07em}
.blink-rate-control select{background:#111;color:#fff;border:1px solid var(--border-subtle);padding:7px 9px;font:inherit}
#blink-preview-box{overflow:hidden}
#blink-preview-box #blink-local-image{
    position:absolute;inset:0;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;
}
@media(max-width:700px){
    .visor-stage.local-split-active #fits-local-viewer,
    .visor-stage.local-split-active #split-local-container{width:50%}
    .blink-rate-control{min-width:130px}
}


/* Entrada al laboratorio multimagen independiente */
#open-multifits-tool{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;white-space:nowrap}
@media(max-width:900px){#open-multifits-tool{font-size:.65rem;padding:8px 10px}}


/* Landing shortcuts and compact scientific cursor HUD */
.landing-cta-container{display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap}
.landing-multifits-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none}
.visor-hud-coords{flex-wrap:wrap;max-width:calc(100% - 24px)}
.fits-local-toolbar span{font-size:.66rem;font-variant-numeric:tabular-nums}
@media(max-width:700px){.visor-hud-coords{right:12px;gap:6px;font-size:.62rem}.landing-cta-container{align-items:stretch}.landing-cta-container .ylma-btn{width:100%}}


/* Local FITS comparison panes */
.split-local-container {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px;
    background: #000;
    padding: 34px 8px 52px;
}
.split-local-pane {
    min-width: 0;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #050505;
    border: 1px solid rgba(255,183,0,.28);
}
.split-local-pane img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.split-local-pane > span {
    position: absolute;
    left: 10px;
    bottom: 10px;
    padding: 5px 8px;
    color: var(--ylma-gold);
    background: rgba(0,0,0,.8);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
}
.split-compare-upload {
    position: absolute;
    top: 6px;
    right: 8px;
    z-index: 3;
    padding: 7px 10px;
    font-size: .68rem;
}


/* Honest server-processing state for FITS uploads (upload transfer and FITS decoding are separate stages). */
#fits-progress-overlay.is-processing .fits-progress-track {
    position: relative;
    background: #242424;
}
#fits-progress-overlay.is-processing .fits-progress-track > div {
    width: 36% !important;
    background: linear-gradient(90deg, rgba(255,187,0,.25), #ffbb00, rgba(255,187,0,.25));
    animation: fits-server-processing 1.35s ease-in-out infinite;
}
@keyframes fits-server-processing {
    0% { transform: translateX(-115%); }
    100% { transform: translateX(300%); }
}
#fits-progress-overlay.is-processing .fits-progress-card strong {
    letter-spacing: .12em;
}
