body { margin: 0; background: #eef2f7; font-family: Helvetica, Arial, sans-serif; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--primary-lightest); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); }

.dash-table-container .dash-spreadsheet-container {
    scrollbar-color: var(--primary) var(--table-scrollbar-track);
    scrollbar-width: thin;
}
.dash-table-container .dash-spreadsheet-container::-webkit-scrollbar { width: 10px; height: 10px; }
.dash-table-container .dash-spreadsheet-container::-webkit-scrollbar-track { background: var(--table-scrollbar-track); }
.dash-table-container .dash-spreadsheet-container::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 8px; }

.umap-loading {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    z-index: 7; pointer-events: none;
}
.umap-loading .dash-spinner,
.umap-loading .dash-spinner > div {
    border: 4px solid rgba(250, 204, 21, 0.25) !important;
    border-top-color: #facc15 !important;
    border-right-color: transparent !important;
    border-bottom-color: transparent !important;
    border-left-color: transparent !important;
    border-radius: 50% !important;
    width: 42px !important; height: 42px !important;
    animation: umap-ring-spin 0.75s linear infinite !important;
}
@keyframes umap-ring-spin { to { transform: rotate(360deg); } }

.enrich-category-tile {
    display: block; margin-top: 6px;
    border: 1px solid var(--accent-border); border-radius: 6px;
    padding: 4px 6px; background: var(--primary-light);
    cursor: pointer; font-size: 13px; font-weight: 700; text-align: center;
}
.enrich-category-tile.selected {
    background: var(--accent); border-color: var(--primary); color: var(--tab-text);
}

.enrich-color-swatch {
    width: 26px; height: 26px;
    border: 2px solid var(--swatch-border); border-radius: 4px;
    cursor: pointer; opacity: 0.6;
}
.enrich-color-swatch.selected {
    opacity: 1.0;
    box-shadow: 0 0 0 2px var(--primary), 0 0 10px rgba(31, 78, 107, 0.6);
}

.dash-table-container .column-header--sort { display: flex; align-items: center; }
.dash-table-container .column-header--sort .column-header-name { flex: 1 1 auto; }
.dash-table-container .column-header--sort .column-header-sort { margin-left: auto; }

@media (max-width: 900px) {
    #app-shell { height: auto !important; min-height: 100vh !important; overflow: auto !important; }
    #top-header-bar { height: 70px !important; padding: 10px 12px !important; }
    #logo-home { height: 46px !important; }
    #top-header-title { font-size: 14px !important; margin-left: 10px !important; margin-top: 0 !important; white-space: normal !important; line-height: 1.2 !important; }
    #sub-nav-bar { top: 70px !important; height: 46px !important; padding: 0 8px !important; overflow-x: auto !important; }
    #sub-nav-inner { display: flex !important; gap: 6px !important; min-width: max-content !important; }
    #sub-nav-inner button { min-width: auto !important; white-space: nowrap !important; font-size: 13px !important; padding: 6px 10px !important; }
    #main-layout-grid { margin-top: 116px !important; height: auto !important; min-height: calc(100vh - 116px) !important; }
    #left-sidebar-wrap, #right-sidebar-wrap {
        position: static !important; width: 100% !important;
        top: auto !important; bottom: auto !important; left: auto !important; right: auto !important;
        border-left: 1px solid var(--primary-border) !important;
        border-right: 1px solid var(--primary-border) !important;
        border-radius: 12px !important;
        box-shadow: 0 6px 16px rgba(15,23,42,0.08) !important;
        overflow-y: visible !important; padding: 12px !important; background: #ffffff !important;
    }
    #left-sidebar-wrap { margin-bottom: 10px !important; }
    #right-sidebar-wrap { margin-top: 10px !important; }
    #left-sidebar-explore > div:last-child, #left-sidebar-enrich > div:last-child { display: none !important; }
    #center-wrap { margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; height: auto !important; overflow-y: visible !important; padding: 10px !important; }
    #umap-frame { height: 52vh !important; min-height: 320px !important; margin-bottom: 12px !important; }
}

[data-tip] { position: relative; cursor: default; }
[data-tip]::after {
    content: attr(data-tip);
    position: absolute; left: 50%; bottom: 130%; transform: translateX(-50%);
    white-space: pre-wrap; max-width: 280px; min-width: 120px;
    background: rgba(15,23,42,0.93); color: #f1f5f9;
    border-radius: 6px; padding: 6px 10px;
    font-size: 12px; font-weight: 400; line-height: 1.5;
    z-index: 99999; pointer-events: none; opacity: 0; transition: opacity 0.08s; display: block;
}
[data-tip]:hover::after { opacity: 1; }
