:root {
    --explorer-blue: #0b63ce;
    --explorer-blue-dark: #1e3a8a;
    --explorer-teal: #0f766e;
    --explorer-text: #1f2937;
    --explorer-muted: #64748b;
    --explorer-border: #d8e2ef;
    --explorer-soft-border: #e2e8f0;
    --explorer-surface: rgba(255, 255, 255, .94);
    --explorer-soft-bg: #f6f9fc;
    --explorer-radius: 20px;
    --explorer-shadow: 0 22px 60px rgba(34, 72, 116, .12);
}

.explorer-section-header {
    min-width: 0;
    max-width: 100%;
    margin: 0 0 24px;
    padding: 0 4px;
}

.explorer-section-header h1 {
    margin: 0;
    color: #20344b;
    font-size: clamp(32px, 3vw, 40px);
    font-weight: 750;
    letter-spacing: 0;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.explorer-section-header p {
    max-width: 820px;
    margin: 10px 0 0;
    color: #111827;
    font-size: 16px;
    line-height: 1.6;
}

.explorer-shell.umap-explorer {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
    margin: 0 0 34px;
    border: 1px solid rgba(216, 226, 239, .94);
    border-radius: var(--explorer-radius);
    background: var(--explorer-surface);
    box-shadow: var(--explorer-shadow);
}

.explorer-shell .umap-explorer-head {
    min-height: 48px;
    padding: 13px 18px;
    border-bottom: 1px solid var(--explorer-soft-border);
    border-radius: var(--explorer-radius) var(--explorer-radius) 0 0;
    background: linear-gradient(90deg, rgba(241, 247, 255, .92), rgba(248, 252, 255, .96));
}

.explorer-data-overview {
    color: #111827;
    font-size: 13px;
    font-weight: 750;
}

.explorer-shell .control-toolbar {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) minmax(220px, 1fr) minmax(160px, .72fr) auto auto;
    gap: 12px;
    align-items: end;
    margin: 14px;
    padding: 14px;
    border: 1px solid #e0e8f2;
    border-radius: 15px;
    background: #f8fbff;
}

.explorer-shell .umap-field label {
    margin-bottom: 7px;
    color: #52667b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .035em;
}

.explorer-shell .umap-field select,
.explorer-shell .umap-field input {
    height: 42px;
    border: 1px solid #cedbea;
    border-radius: 10px;
    background: #fff;
    color: var(--explorer-text);
    font-size: 14px;
    padding: 0 12px;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.explorer-shell .umap-field select:focus,
.explorer-shell .umap-field input:focus {
    border-color: rgba(11, 99, 206, .72);
    box-shadow: 0 0 0 3px rgba(11, 99, 206, .10);
    outline: 0;
}

.explorer-shell .umap-native-select {
    display: none;
}

.explorer-shell .umap-gene-field {
    position: relative;
}

.explorer-shell .umap-dataset-picker {
    position: relative;
}

.explorer-shell .umap-dataset-button {
    position: relative;
    width: 100%;
    height: 42px;
    border: 1px solid #cedbea;
    border-radius: 10px;
    background: #fff;
    color: var(--explorer-text);
    font-size: 14px;
    line-height: 42px;
    padding: 0 38px 0 12px;
    text-align: left;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.explorer-shell .umap-dataset-button::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 14px;
    width: 9px;
    height: 9px;
    border-right: 2px solid #3458ab;
    border-bottom: 2px solid #3458ab;
    transform: translateY(-65%) rotate(45deg);
    transition: transform .18s ease;
}

.explorer-shell .umap-dataset-button.is-open::after {
    transform: translateY(-35%) rotate(225deg);
}

.explorer-shell .umap-dataset-button:focus {
    border-color: rgba(11, 99, 206, .72);
    box-shadow: 0 0 0 3px rgba(11, 99, 206, .10);
    outline: 0;
}

.explorer-shell .umap-dataset-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 30;
    max-height: 260px;
    overflow-y: scroll;
    padding: 8px;
    border: 1px solid #cedbea;
    border-radius: 12px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 34px rgba(37, 76, 120, .18);
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 88, 171, .42) rgba(232, 239, 247, .82);
}

.explorer-shell .umap-dataset-menu::-webkit-scrollbar {
    width: 12px;
}

.explorer-shell .umap-dataset-menu::-webkit-scrollbar-track {
    margin: 8px 0;
    border-radius: 999px;
    background: rgba(232, 239, 247, .82);
}

.explorer-shell .umap-dataset-menu::-webkit-scrollbar-thumb {
    border: 3px solid rgba(255, 255, 255, .96);
    border-radius: 999px;
    background: rgba(52, 88, 171, .42);
}

.explorer-shell .umap-dataset-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(52, 88, 171, .58);
}

.explorer-shell .umap-dataset-option {
    display: block;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #33414b;
    font-size: 14px;
    line-height: 1.25;
    padding: 9px 12px;
    text-align: left;
    cursor: pointer;
    transition: background-color .16s ease, color .16s ease;
}

.explorer-shell .umap-dataset-option:hover,
.explorer-shell .umap-dataset-option.is-active {
    background: #eef6ff;
    color: #0a68b7;
}

.explorer-shell .umap-gene-menu {
    position: absolute;
    z-index: 30;
    top: calc(100% + 6px);
    right: 0;
    left: 0;
    display: grid;
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid #cedbea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(37, 76, 120, .18);
}

.explorer-shell .umap-gene-menu[hidden] {
    display: none;
}

.explorer-shell .umap-gene-menu button {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #edf3f7;
    background: #fff;
    color: #24323d;
    cursor: pointer;
    font-size: 14px;
    padding: 9px 12px;
    text-align: left;
    transition: background-color .16s ease, color .16s ease;
}

.explorer-shell .umap-gene-menu button:hover,
.explorer-shell .umap-gene-menu button:focus {
    background: #eef7fd;
    color: var(--explorer-blue);
    outline: 0;
}

.explorer-shell .umap-button {
    appearance: none;
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: var(--explorer-blue);
    box-shadow: 0 8px 18px rgba(11, 99, 206, .18);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    padding: 0 15px;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.explorer-shell .umap-button:hover {
    background: #0959b9;
    box-shadow: 0 10px 22px rgba(11, 99, 206, .26);
    transform: translateY(-1px);
}

.explorer-shell .umap-button-secondary {
    border: 1px solid #cbd8e6;
    background: #fff;
    box-shadow: none;
    color: #41566b;
}

.explorer-shell .umap-button-secondary:hover {
    border-color: #9fb6cc;
    background: #f2f7fb;
    box-shadow: none;
}

.explorer-shell .umap-main {
    display: grid;
    grid-template-columns: minmax(0, 74%) minmax(250px, 26%);
    gap: 0;
    padding: 0 14px 14px;
}

.umap-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--explorer-border);
    border-radius: 16px 0 0 16px;
    background: #fff;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, .08);
}

.umap-card .umap-hint {
    position: absolute;
    z-index: 5;
    top: 12px;
    right: 14px;
    border-color: rgba(203, 216, 230, .9);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 5px 14px rgba(51, 65, 85, .08);
    color: #577087;
    font-size: 12px;
    padding: 7px 10px;
    pointer-events: none;
}

.explorer-shell .umap-canvas-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1.66 / 1;
    margin: 0;
    background: #f8fafc;
    cursor: grab;
    touch-action: none;
}

.explorer-shell .umap-canvas-wrap.is-panning {
    cursor: grabbing;
}

.explorer-shell #UmapCanvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.explorer-shell .umap-tooltip {
    position: absolute;
    z-index: 6;
    display: none;
    min-width: 180px;
    padding: 11px 13px;
    border: 1px solid #d4e1ec;
    border-radius: 10px;
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 12px 28px rgba(46, 74, 102, .16);
    color: #26384a;
    font-size: 13px;
    line-height: 1.45;
    pointer-events: none;
}

.explorer-shell .analysis-panel {
    min-width: 0;
    border: 1px solid var(--explorer-border);
    border-left: 0;
    border-radius: 0 16px 16px 0;
    background: #fbfdff;
    padding: 17px;
}

.analysis-panel-head {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--explorer-soft-border);
}

.analysis-panel-head span,
.current-mode-card span {
    display: block;
    margin-bottom: 5px;
    color: var(--explorer-blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.explorer-shell .analysis-panel h3 {
    margin: 0;
    color: #273b50;
    font-size: 18px;
    font-weight: 800;
}

.explorer-shell .umap-legend {
    display: grid;
    gap: 6px;
}

.explorer-shell .umap-legend button {
    appearance: none;
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: transparent;
    padding: 8px 7px;
    color: #364b5f;
    cursor: pointer;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    transition: background-color .16s ease, opacity .16s ease;
}

.explorer-shell .umap-legend button:hover {
    background: #edf5fb;
}

.explorer-shell .umap-legend button.is-active {
    color: #2d455d;
}

.explorer-shell .umap-legend button.is-muted {
    background: #f3f6f8;
    opacity: .42;
}

.explorer-shell .umap-swatch {
    width: 13px;
    height: 13px;
    border-radius: 2px;
    box-shadow: 0 0 0 1px rgba(71, 85, 105, .12);
}

.celltype-count {
    color: #475569;
    font-size: 13px;
    font-weight: 400;
    text-align: right;
}

.current-mode-card {
    display: grid;
    gap: 5px;
    margin-top: 15px;
    padding: 12px;
    border: 1px solid #dce7f1;
    border-radius: 11px;
    background: #fff;
}

.current-mode-card strong {
    color: #2b445c;
    font-size: 13px;
}

.current-mode-card small {
    color: #718296;
    font-size: 11px;
    line-height: 1.35;
}

.explorer-shell .umap-expression-status {
    margin-top: 14px;
    border-color: #e5edf4;
    color: #3b556b;
}

.explorer-shell .umap-expression-status:empty {
    display: none;
}

.explorer-shell .umap-expression-legend {
    color: #6a7b8b;
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.explorer-shell .umap-expression-legend[hidden] {
    display: none;
}

.explorer-shell .umap-expression-legend strong {
    color: #334155;
    font-size: 13px;
    font-weight: 850;
    line-height: 1.2;
}

.explorer-shell .umap-expression-legend i {
    display: block;
    width: 100%;
    height: 14px;
    border: 1px solid rgba(71, 85, 105, .2);
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, .08);
}

.explorer-shell .umap-expression-labels {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.explorer-shell .umap-expression-labels span:nth-child(2) {
    text-align: center;
}

.explorer-shell .umap-expression-labels span:last-child {
    text-align: right;
}

.explorer-shell .umap-note {
    margin: 14px 0 0;
    color: #718296;
    font-size: 12px;
    line-height: 1.5;
}

.explorer-shell .umap-note:empty {
    display: none;
}

@media only screen and (max-width: 1180px) {
    .explorer-shell .control-toolbar {
        grid-template-columns: minmax(240px, 1.4fr) minmax(200px, 1fr) minmax(150px, .75fr);
    }

    .explorer-shell .umap-button {
        width: 100%;
    }
}

@media only screen and (max-width: 996px) {
    .explorer-section-header h1 {
        font-size: clamp(29px, 6vw, 36px);
    }

    .explorer-shell .control-toolbar,
    .explorer-shell .umap-main {
        grid-template-columns: 1fr;
    }

    .umap-card {
        border-radius: 15px 15px 0 0;
    }

    .explorer-shell .umap-canvas-wrap {
        min-height: 420px;
        aspect-ratio: auto;
    }

    .explorer-shell .analysis-panel {
        border-top: 0;
        border-left: 1px solid var(--explorer-border);
        border-radius: 0 0 15px 15px;
    }
}

@media only screen and (max-width: 560px) {
    .explorer-section-header {
        padding: 0;
    }

    .explorer-section-header h1 {
        font-size: 27px;
        line-height: 1.18;
    }

    .explorer-section-header p {
        font-size: 15px;
    }

    .explorer-shell .control-toolbar {
        margin: 10px;
        padding: 12px;
    }

    .explorer-shell .umap-main {
        padding: 0 10px 10px;
    }

    .explorer-shell .umap-canvas-wrap {
        min-height: 340px;
    }
}
