/* static/style.css */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8f9fa;
    color: #1a1a2e;
}

nav {
    background: #1a1a2e;
    color: white;
    display: flex;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    gap: 24px;
}

.nav-brand { font-weight: bold; font-size: 16px; white-space: nowrap; }

.nav-tabs { display: flex; gap: 4px; }
.nav-tabs button {
    background: none; border: none; color: rgba(255,255,255,0.6);
    padding: 8px 14px; border-radius: 6px; cursor: pointer; font-size: 14px;
}
.nav-tabs button.active { background: rgba(255,255,255,0.1); color: white; }
.nav-tabs button:hover { color: white; }

.nav-status { margin-left: auto; font-size: 12px; color: rgba(255,255,255,0.7); display: flex; align-items: center; gap: 6px; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-dot.idle { background: #4ecdc4; }
.status-dot.running { background: #fdcb6e; animation: pulse 1s infinite; }
.status-dot.failed { background: #ff6b6b; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

main { max-width: 1200px; margin: 24px auto; padding: 0 24px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }

.nerds {
    background: white; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 16px 20px; margin-bottom: 24px;
}
.nerds summary {
    cursor: pointer; font-weight: 600; font-size: 14px; color: #1a1a2e;
    list-style: none; padding: 4px 0;
}
.nerds summary::-webkit-details-marker { display: none; }
.nerds summary::before { content: "▸ "; color: #888; transition: transform 0.15s; display: inline-block; }
.nerds[open] summary::before { content: "▾ "; }
.nerds-content { padding-top: 12px; font-size: 13px; line-height: 1.6; color: #333; }
.nerds-content h4 { font-size: 13px; color: #1a1a2e; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.5px; }
.nerds-content h4:first-child { margin-top: 0; }
.nerds-content p { margin-bottom: 10px; }
.nerds-content ul { padding-left: 20px; margin-bottom: 10px; }
.nerds-content li { margin-bottom: 4px; }
.nerds-content code { background: #f0f0f0; padding: 1px 5px; border-radius: 3px; font-size: 12px; }
.stat-card { background: white; padding: 20px; border-radius: 8px; border: 1px solid #e0e0e0; }
.stat-label { font-size: 12px; color: #888; margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: bold; }

.filters { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.filters input, .filters select {
    padding: 8px 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
}
.filters input { width: 200px; }

.table-container { background: white; border-radius: 8px; border: 1px solid #e0e0e0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead tr { background: #fafafa; border-bottom: 2px solid #e0e0e0; }
th { text-align: left; padding: 12px; color: #666; cursor: pointer; white-space: nowrap; }
td { padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
tbody tr:hover { background: #f8f9ff; }

.positive { color: #4ecdc4; }
.negative { color: #ff6b6b; }

.pagination { display: flex; align-items: center; gap: 12px; margin-top: 12px; justify-content: flex-end; font-size: 13px; }
.pagination button { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; background: white; cursor: pointer; }
.pagination button:disabled { opacity: 0.4; cursor: default; }

.chart-controls { margin-bottom: 16px; }
.presets { display: flex; gap: 6px; align-items: center; margin-bottom: 12px; font-size: 13px; }
.presets button { padding: 5px 12px; border: 1px solid #ddd; border-radius: 4px; background: white; cursor: pointer; font-size: 12px; }
.presets button:hover { border-color: #4ecdc4; }

.person-search { position: relative; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: #fafafa; border: 1px solid #ddd; border-radius: 6px; padding: 8px; }
.tags input { border: none; outline: none; background: transparent; font-size: 13px; min-width: 120px; }
.tag { color: white; padding: 3px 10px; border-radius: 12px; font-size: 12px; display: flex; align-items: center; gap: 4px; }
.tag-remove { cursor: pointer; opacity: 0.8; }

.autocomplete { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 10; margin-top: 4px; }
.autocomplete-item { padding: 10px 14px; cursor: pointer; display: flex; justify-content: space-between; font-size: 13px; }
.autocomplete-item:hover { background: #f0f8ff; }

.chart-area { background: white; padding: 20px; border-radius: 8px; border: 1px solid #e0e0e0; margin-bottom: 24px; }

.aggregate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.aggregate-card { background: white; padding: 16px; border-radius: 8px; border: 1px solid #e0e0e0; }
.aggregate-card h3 { font-size: 13px; margin-bottom: 12px; }
.chart-wrap { position: relative; height: 280px; }
.chart-wrap-tall { height: 360px; }

.profile-header { margin-bottom: 16px; }
.profile-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; }
.profile-avatar { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid #e0e0e0; flex-shrink: 0; }
.profile-signature { max-width: 200px; max-height: 60px; opacity: 0.85; }
.profile-stats { display: flex; gap: 16px; }
.profile-stat { display: flex; flex-direction: column; gap: 2px; min-width: 100px; }
.profile-stat-value { font-size: 18px; font-weight: 600; }
.profile-badge {
    display: inline-block; font-size: 11px; padding: 3px 9px;
    border-radius: 10px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.04em;
}
.profile-badge-deceased { background: #f0eef5; color: #4a4458; border: 1px solid #d8d4e0; }
.profile-badge-dropped { background: #fff3e6; color: #b6651a; border: 1px solid #f0d4b0; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.profile-grid .aggregate-card { margin-bottom: 0; }
@media (max-width: 720px) {
    .profile-grid { grid-template-columns: 1fr; }
    .profile-header-row { flex-direction: column; }
}

.smoothing-control { display: flex; align-items: center; gap: 8px; }
.smoothing-control input[type=range] { width: 140px; accent-color: #4ecdc4; }
.smoothing-control .smoothing-value { min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }

.scraper-status-card, .schedule-card, .runs-card, .export-card {
    background: white; padding: 20px; border-radius: 8px; border: 1px solid #e0e0e0; margin-bottom: 16px;
}
.scraper-status-card { display: flex; justify-content: space-between; align-items: center; }

/* Section header for the grouped Scraper-panel sub-sections */
.scraper-section-h {
    font-size: 11px; color: #888;
    text-transform: uppercase; letter-spacing: 0.06em;
    margin: 24px 0 8px;
}
.scraper-section-h:first-child { margin-top: 0; }
.scraper-status-card .muted.small { display: block; margin-top: 4px; max-width: 720px; }
.scraper-status-card a { color: #6c5ce7; }

/* Auth gate for the Scraper tab — full-screen overlay + centered
   modal. Shown when SCRAPER_PASSWORD is set on the server and the
   visitor doesn't yet hold the cookie. */
.auth-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
}
.auth-modal {
    background: white;
    width: 380px; max-width: 90vw;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    display: flex; flex-direction: column; gap: 12px;
}
.auth-modal h3 { margin: 0; font-size: 18px; }
.auth-modal input[type="password"] {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d8d6de;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}
.auth-modal input[type="password"]:focus {
    outline: none; border-color: #6c5ce7;
}
.auth-error {
    color: #c0392b; font-size: 12px;
}
.auth-buttons {
    display: flex; justify-content: flex-end; gap: 8px;
}

/* Job progress — generic bar used by news refresh, news backfill,
   bootstrap. Uses --pct on the parent so the fill animates smoothly
   between polls. */
.job-progress { margin-top: 10px; }
.progress-bar {
    position: relative;
    height: 18px;
    background: #eef0f4;
    border-radius: 9px;
    overflow: hidden;
}
.progress-bar-fill {
    position: absolute; inset: 0;
    width: var(--pct, 0%);
    background: linear-gradient(90deg, #6c5ce7 0%, #5ad1c7 100%);
    transition: width 0.4s ease;
}
.progress-bar-fill.done {
    background: #4ecdc4;
}
.progress-bar-label {
    position: relative; z-index: 1;
    display: block; line-height: 18px; text-align: center;
    font-size: 11px; color: #1a1a2e; font-weight: 600;
    text-shadow: 0 0 2px rgba(255,255,255,0.7);
}
.job-progress-detail {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.5;
}

/* Bootstrap pipeline step list — one row per data-load job, with
   a coloured status dot so the user can see at a glance which
   step succeeded / failed / is currently running. */
.bootstrap-steps {
    list-style: none; padding: 0; margin: 10px 0 0;
    font-size: 12px;
}
.bootstrap-steps li {
    padding: 3px 0; display: flex; align-items: center; gap: 8px;
}
.bootstrap-step-status {
    width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
    background: #ddd;
}
.bootstrap-step-status.ok { background: #4ecdc4; }
.bootstrap-step-status.error { background: #ff6b6b; }
.bootstrap-step-status.running {
    background: #fdcb6e; animation: pulse 1s infinite;
}

.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.form-row label { color: #666; width: 80px; font-size: 13px; }
.form-row select, .form-row input[type="time"], .form-row input[type="date"] {
    padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px;
}
.radio-group { display: flex; gap: 12px; font-size: 13px; }

.time-inputs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.time-input-group { display: flex; align-items: center; gap: 4px; }

.schedule-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.schedule-header h3 { margin-bottom: 0; }

.toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.toggle input { width: 16px; height: 16px; accent-color: #4ecdc4; }
.toggle-label { color: #666; }

.schedule-times { display: flex; flex-direction: column; gap: 10px; }

.schedule-time-card {
    display: flex; align-items: center; gap: 16px; padding: 12px 16px;
    background: #f8f9fa; border: 1px solid #e8e8e8; border-radius: 8px;
}
.schedule-time-main { display: flex; align-items: baseline; gap: 6px; min-width: 120px; }
.schedule-time-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.schedule-time-tz { font-size: 12px; color: #888; }
.schedule-time-next { flex: 1; }
.schedule-time-actions { display: flex; gap: 8px; align-items: center; }
.time-edit { padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; }
.btn-remove { background: none; border: 1px solid #ddd; padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; color: #888; }
.btn-remove:hover { border-color: #ff6b6b; color: #ff6b6b; }
.btn-add-time {
    background: none; border: 2px dashed #ddd; padding: 12px; border-radius: 8px;
    cursor: pointer; font-size: 13px; color: #888; width: 100%;
}
.btn-add-time:hover { border-color: #4ecdc4; color: #4ecdc4; }

.schedule-paused { padding: 20px; text-align: center; }

.btn-primary {
    background: #1a1a2e; color: white; border: none; padding: 10px 20px;
    border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 14px; text-decoration: none; display: inline-block;
}
.btn-primary:hover { background: #2a2a4e; }
.btn-small { background: none; border: 1px solid #ddd; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 12px; }

.muted { color: #888; font-size: 12px; }
code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 12px; }

h3 { font-size: 15px; margin-bottom: 12px; }

.field-selector { margin-bottom: 16px; }
.field-selector-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.field-selector-header label { color: #666; width: 80px; font-size: 13px; }
.field-selector-actions { display: flex; gap: 8px; }
.btn-sm { background: none; border: 1px solid #ddd; padding: 5px 12px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.btn-sm:hover { border-color: #4ecdc4; color: #4ecdc4; }
.field-groups { background: #fafafa; border: 1px solid #e8e8e8; border-radius: 8px; padding: 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.field-group h4 { font-size: 11px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.field-checkbox { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; font-size: 13px; cursor: pointer; }
.field-checkbox input { accent-color: #4ecdc4; }

.clickable-row { cursor: pointer; }
.clickable-row:hover { background: #f0f8ff !important; }

.historical-row {
    opacity: 0.75;
    /* Forbes-only rows are real data but lack a Bloomberg profile; the
       muted styling tells the user that clicking won't do anything. */
}
.historical-row td:nth-child(2)::after {
    content: " ⓘ";
    color: #aaa;
    font-size: 11px;
}

.panel-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 100;
}

.detail-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 90vw;
    background: white; z-index: 101; box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    transform: translateX(100%); transition: transform 0.25s ease;
    overflow-y: auto;
}
.detail-panel.open { transform: translateX(0); }

.panel-content { padding: 24px; }

.panel-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.panel-header h2 { font-size: 20px; margin-bottom: 4px; }
.panel-close { background: none; border: none; font-size: 28px; cursor: pointer; color: #888; line-height: 1; padding: 0 4px; }
.panel-close:hover { color: #333; }

.panel-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.panel-stat { background: #f8f9fa; padding: 12px; border-radius: 6px; text-align: center; }
.panel-stat-label { display: block; font-size: 11px; color: #888; margin-bottom: 2px; }
.panel-stat-value { display: block; font-size: 15px; font-weight: 600; }

.panel-summary { font-size: 13px; color: #555; line-height: 1.5; margin-bottom: 20px; }

.panel-chart { margin-bottom: 20px; background: #fafafa; border-radius: 8px; padding: 12px; }

.range-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.range-tabs button {
    background: none; border: 1px solid #ddd; padding: 4px 12px; border-radius: 4px;
    cursor: pointer; font-size: 12px; color: #666;
}
.range-tabs button:hover { border-color: #4ecdc4; color: #4ecdc4; }
.range-tabs button.active { background: #1a1a2e; color: white; border-color: #1a1a2e; }

.panel-section { margin-bottom: 20px; }
.panel-section h4 { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.panel-section p { font-size: 13px; line-height: 1.6; }
.panel-section ul { list-style: disc; padding-left: 18px; font-size: 13px; }
.panel-section li { margin-bottom: 4px; }
.panel-bio { max-height: 200px; overflow-y: auto; }

.milestones { display: flex; flex-direction: column; gap: 6px; }
.milestone { font-size: 13px; display: flex; gap: 10px; }
.milestone-year { font-weight: 600; color: #4ecdc4; min-width: 36px; }

.news-list { list-style: none; padding: 0; margin: 0; }
.news-item {
    padding: 8px 0; border-bottom: 1px solid #f0f0f0;
    font-size: 13px; line-height: 1.4;
}
.news-item:last-child { border-bottom: none; }
.news-item a { color: #1a1a2e; text-decoration: none; font-weight: 500; }
.news-item a:hover { color: #f39c12; text-decoration: underline; }
.news-meta { font-size: 11px; color: #888; margin-top: 2px; }

.news-year-tabs {
    display: flex; flex-wrap: wrap; gap: 4px;
    margin-bottom: 10px; max-height: 64px; overflow-y: auto;
}
.news-year-tabs button {
    background: none; border: 1px solid #ddd;
    padding: 3px 9px; border-radius: 4px;
    cursor: pointer; font-size: 11px; color: #666;
    font-variant-numeric: tabular-nums;
}
.news-year-tabs button:hover { border-color: #f39c12; color: #f39c12; }
.news-year-tabs button.active {
    background: #f39c12; color: white; border-color: #f39c12;
}

.news-show-more { margin-top: 10px; }

.chart-footnote {
    margin-top: 10px; padding: 6px 0;
    font-size: 11px; line-height: 1.5; color: #888;
    border-top: 1px dashed #eee;
}

.range-change {
    display: flex; align-items: baseline; gap: 8px;
    font-variant-numeric: tabular-nums;
}
.range-change-pct {
    font-size: 18px; font-weight: 700;
}
.range-change-abs { font-size: 12px; }
.range-change-period {
    text-transform: uppercase; letter-spacing: 0.04em;
    font-size: 10px;
}

.time-travel-card {
    background: white; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 16px 18px; margin-bottom: 16px;
}
.time-travel-header {
    display: flex; align-items: center; gap: 18px;
    flex-wrap: wrap; margin-bottom: 14px;
}
.time-travel-mode {
    display: inline-flex; background: #f0f1f5; border-radius: 8px;
    padding: 3px;
}
.time-travel-mode button {
    background: transparent; border: none; padding: 7px 18px;
    border-radius: 6px; font-size: 13px; cursor: pointer;
    color: #666; font-weight: 500; transition: all 0.15s ease;
}
.time-travel-mode button.active {
    background: white; color: #1a1a2e;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.time-travel-mode button:hover:not(.active) { color: #1a1a2e; }

.time-travel-headline {
    flex: 1; font-size: 13px; display: flex; align-items: center; gap: 8px;
    min-width: 240px;
}
.time-travel-headline strong { color: #1a1a2e; font-weight: 600; }

/* ─── Snapshot mode ─── */

.time-travel-snapshot { display: flex; flex-direction: column; gap: 12px; }
.tt-row { display: flex; align-items: center; gap: 10px; }
.tt-date-big {
    padding: 9px 14px; border: 1px solid #ddd; border-radius: 6px;
    font-size: 15px; font-variant-numeric: tabular-nums;
    background: white; color: #1a1a2e; font-weight: 500;
}
.tt-date-big:focus { outline: 2px solid #6c5ce7; outline-offset: 1px; border-color: #6c5ce7; }

.tt-slider-wrap { padding: 0 4px; }
.tt-slider {
    width: 100%; accent-color: #6c5ce7; height: 24px;
}
.tt-tick-row {
    display: flex; justify-content: space-between;
    margin-top: 2px; padding: 0 4px;
    font-size: 10px; color: #aaa;
    font-variant-numeric: tabular-nums;
}
.tt-tick { user-select: none; }

.tt-presets {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 12px;
}
.tt-presets .btn-sm {
    padding: 4px 10px; font-size: 12px;
    border-radius: 14px; border: 1px solid #e0e0e0;
}
.tt-presets .btn-sm:hover {
    background: #6c5ce7; color: white; border-color: #6c5ce7;
}
.tt-presets .btn-sm.active {
    background: #6c5ce7; color: white; border-color: #6c5ce7;
}

/* ─── Compare mode ─── */

.time-travel-compare { display: flex; flex-direction: column; gap: 14px; }
.tt-compare-row {
    display: flex; align-items: center; justify-content: center;
    gap: 16px; flex-wrap: wrap;
}
.tt-compare-side {
    display: flex; flex-direction: column; gap: 2px;
}
.tt-side-label {
    text-transform: uppercase; letter-spacing: 0.04em;
    font-size: 10px; color: #888;
}
.tt-compare-arrow {
    font-size: 22px; color: #6c5ce7; font-weight: 300;
    margin-top: 14px;
}

.tt-diff-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    padding: 12px 14px;
    background: #fafbff; border-radius: 8px;
    border: 1px solid #e0e6ff;
}
.tt-stat { text-align: center; }
.tt-stat-value {
    display: block; font-size: 22px; font-weight: 700;
    color: #1a1a2e; font-variant-numeric: tabular-nums;
    line-height: 1.1;
}
.tt-stat-label {
    display: block; font-size: 11px; color: #888;
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-top: 4px;
}

.diff-cols {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.diff-col {
    background: #fafbff; border: 1px solid #e0e6ff;
    border-radius: 6px; padding: 10px 12px;
}
.diff-col h4 {
    font-size: 11px; color: #6c5ce7; text-transform: uppercase;
    letter-spacing: 0.05em; margin: 0 0 8px;
}
.diff-col ul { list-style: none; padding: 0; margin: 0; }
.diff-col li {
    display: flex; justify-content: space-between; align-items: baseline;
    padding: 4px 0; font-size: 12px; gap: 8px;
    border-bottom: 1px solid #eef0f4;
}
.diff-col li:last-child { border-bottom: none; }
.diff-col .metric-link { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.diff-row-meta {
    display: inline-flex; align-items: center; gap: 6px;
    flex: 0 0 auto;
}
.diff-rank-badge {
    display: inline-block; padding: 1px 6px; border-radius: 8px;
    font-size: 10px; font-weight: 600;
    background: #d1f2eb; color: #2e8b6e;
    font-variant-numeric: tabular-nums;
}
.diff-rank-badge.negative {
    background: #fde7e7; color: #c14545;
}

.tt-show-more {
    display: flex; justify-content: center;
    margin-top: 6px;
}

.out-of-range-hint {
    margin-top: 12px; padding: 8px 12px;
    background: #fff8ec; border: 1px solid #f0d4b0; border-radius: 6px;
    font-size: 12px; color: #8a5a1a;
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}
.out-of-range-hint .btn-sm {
    background: white; border-color: #f39c12; color: #b6651a;
}
.out-of-range-hint .btn-sm:hover { background: #f39c12; color: white; }

.asset-group { margin-bottom: 12px; }
.asset-group h5 { font-size: 11px; color: #666; margin-bottom: 6px; }
.asset-row { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }

@media (max-width: 768px) {
    .stats-grid { grid-template-columns: 1fr; }
    .aggregate-grid { grid-template-columns: 1fr; }
    .nav-tabs { overflow-x: auto; }
    .detail-panel { width: 100%; }
}

.families-header {
    background: white; padding: 16px 20px; border-radius: 8px;
    border: 1px solid #e0e0e0; margin-bottom: 16px;
    display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
}
.families-header h3 { font-size: 15px; }

.families-status {
    background: white; padding: 12px 16px; border-radius: 8px;
    border: 1px solid #e0e0e0; margin-bottom: 16px; font-size: 13px;
}
.refresh-progress {
    margin-top: 10px; height: 6px; background: #eef0f4;
    border-radius: 3px; overflow: hidden;
}
.refresh-progress-bar {
    height: 100%; background: linear-gradient(90deg, #6c5ce7, #4ecdc4);
    transition: width 0.4s ease;
}
.refresh-stages {
    display: flex; flex-wrap: wrap; gap: 6px 14px;
    margin-top: 8px; font-size: 11px;
}
.refresh-stage { color: #999; }
.refresh-stage.stage-done { color: #4ecdc4; }
.refresh-stage.stage-active { color: #1a1a2e; font-weight: 600; }
.refresh-stage.stage-active::after {
    content: '…'; margin-left: 2px;
}

.family-graph {
    background: white; border: 1px solid #e0e0e0; border-radius: 8px;
    height: 70vh; min-height: 480px;
}

.family-empty {
    background: white; border: 1px dashed #ddd; border-radius: 8px;
    padding: 32px; text-align: center;
}

.family-legend {
    display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px;
    font-size: 12px; color: #666;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }

.entity-relation-list { list-style: none; padding: 0; margin: 8px 0 0; }
.entity-relation-list li {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: 13px;
}
.entity-relation-list li a { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relation-pill {
    flex: 0 0 auto;
    background: #eef0f4; color: #1a1a2e;
    padding: 2px 8px; border-radius: 10px;
    font-size: 11px; font-weight: 500;
}
.small { font-size: 11px; }

.path-finder {
    background: white; padding: 12px 16px; border-radius: 8px;
    border: 1px solid #e0e0e0; margin-bottom: 12px;
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px;
}
.path-finder select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 4px; min-width: 180px; }
.path-slot { position: relative; flex: 1; min-width: 200px; }
.path-slot .tags { padding: 5px; }
.path-slot .tags input { padding: 2px 4px; }

.path-result {
    background: #fafbff; border: 1px solid #e0e6ff; border-radius: 8px;
    padding: 12px 16px; margin-bottom: 12px; font-size: 13px; line-height: 1.8;
}
.path-step { display: inline; }
.path-arrow { font-family: ui-monospace, SFMono-Regular, monospace; font-size: 11px; }
.path-person { font-weight: 600; color: #1a1a2e; }
.path-entity { color: #555; font-style: italic; }

.metrics-card {
    background: white; padding: 14px 18px; border-radius: 8px;
    border: 1px solid #e0e0e0; margin-bottom: 12px;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px; font-size: 13px;
}
.metrics-card h4 { margin: 0 0 6px 0; font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 0.04em; }
.metrics-card ol { margin: 0; padding-left: 20px; }
.metrics-card li { margin-bottom: 2px; line-height: 1.5; }
.metric-link { cursor: pointer; color: #1a1a2e; }
.metric-link:hover { color: #0984e3; text-decoration: underline; }
.metrics-card .metric-count { color: #888; font-size: 11px; margin-left: 4px; }
.metrics-card .metric-sublist {
    margin: 4px 0 8px 0; padding-left: 16px;
    border-left: 2px solid #eef0f4; font-size: 12px;
}
.metrics-card .metric-sublist li { margin: 2px 0; display: flex; gap: 8px; align-items: center; }

.metric-count { color: #888; font-size: 11px; margin-left: 4px; font-weight: normal; }
.metric-sublist {
    list-style: none; margin: 4px 0 0 0; padding: 0; font-size: 13px;
}
.metric-sublist li {
    margin: 0; padding: 4px 0;
    display: flex; gap: 8px; align-items: baseline;
    border-bottom: 1px solid #f0f2f5;
}
.metric-sublist li:last-child { border-bottom: none; }
.metric-sublist li > span:first-child { flex: 1; }

.six-degrees-strip {
    background: white; padding: 10px 16px; border-radius: 8px;
    border: 1px solid #e0e0e0; margin-bottom: 12px; font-size: 13px;
}
.six-degrees-strip strong { font-size: 16px; color: #6c5ce7; }

.compare-result {
    background: #fafbff; border: 1px solid #e0e6ff; border-radius: 8px;
    padding: 14px 18px; margin-bottom: 12px; font-size: 13px;
}
.compare-result h4 { margin: 0 0 6px 0; font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 0.04em; }
.compare-result section { margin-bottom: 12px; }
.compare-result section:last-child { margin-bottom: 0; }
.compare-result ul { margin: 0; padding-left: 18px; }
.compare-result li { margin-bottom: 3px; line-height: 1.5; }
.compare-result .role-pill {
    display: inline-block; background: #eef; color: #335; border-radius: 10px;
    padding: 1px 8px; font-size: 11px; margin: 0 2px;
}
.compare-result .compare-empty { color: #999; font-style: italic; }

.movers-strip {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-bottom: 16px;
}
.movers-col {
    background: white; padding: 12px 16px; border-radius: 8px;
    border: 1px solid #e0e0e0;
}
.movers-col h4 {
    font-size: 11px; color: #888; text-transform: uppercase;
    letter-spacing: 0.5px; margin-bottom: 8px;
}
.movers-col ul { list-style: none; padding: 0; margin: 0; }
.movers-col li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0; font-size: 13px; border-bottom: 1px solid #f0f0f0;
}
.movers-col li:last-child { border-bottom: none; }

.column-picker {
    background: white; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 12px 16px; margin-bottom: 12px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px;
}

/* ─── Insights tab ────────────────────────────────────────────────── */

.insights-filter-bar {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px;
    background: white; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 10px 16px; margin-bottom: 16px;
}
.insights-filter-bar-left,
.insights-filter-bar-right {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.insights-filter-bar-right label { font-size: 12px; color: #666; }
.insights-year-input {
    width: 70px; padding: 4px 8px; border: 1px solid #ddd;
    border-radius: 4px; font-variant-numeric: tabular-nums; font-size: 13px;
}
.insights-select {
    padding: 4px 10px; border: 1px solid #ddd; border-radius: 4px;
    font-size: 13px; background: white;
}
.filter-chip {
    display: inline-flex; align-items: center; gap: 4px;
    background: #6c5ce7; color: white;
    padding: 3px 4px 3px 10px; border-radius: 12px;
    font-size: 12px; font-weight: 500;
}
.filter-chip button {
    background: rgba(255,255,255,0.25); border: none; color: white;
    width: 18px; height: 18px; border-radius: 50%; cursor: pointer;
    font-size: 12px; line-height: 1; padding: 0;
}
.filter-chip button:hover { background: rgba(255,255,255,0.4); }

.insights-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.insights-card {
    background: white; border: 1px solid #e0e0e0; border-radius: 8px;
    padding: 16px 18px;
}
.insights-card-wide { grid-column: 1 / -1; }
.insights-card-header {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px; margin-bottom: 12px;
}
.insights-card-header h3 { margin: 0; }
.insights-card-controls {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.insights-race-year {
    font-size: 22px; font-weight: 700; color: #6c5ce7;
    font-variant-numeric: tabular-nums;
    min-width: 60px; text-align: center;
}

.race-canvas-wrap {
    position: relative; width: 100%; height: 480px;
    background: linear-gradient(180deg, #fafbff 0%, white 100%);
    border-radius: 6px;
}
.race-canvas-wrap canvas {
    width: 100%; height: 100%;
    display: block;
}

.help-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px;
    margin-left: 6px;
    font-size: 11px; font-weight: 600;
    color: #888; background: #f0f1f5;
    border-radius: 50%; cursor: help;
    user-select: none; vertical-align: middle;
    transition: background 0.15s ease, color 0.15s ease;
}
.help-icon:hover { background: #6c5ce7; color: white; }

/* News on/off toggle on the profile wealth chart */
.news-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; font-size: 12px;
    border: 1px solid #ddd; background: white;
    color: #888;
}
.news-toggle .news-toggle-dot {
    display: inline-block; width: 8px; height: 8px;
    border-radius: 50%; background: #ccc;
    transition: background 0.15s ease;
}
.news-toggle.active {
    border-color: #f39c12; color: #1a1a2e;
}
.news-toggle.active .news-toggle-dot { background: #f39c12; }
.news-toggle:hover { border-color: #f39c12; }

/* ─── Deep-dive panel ─────────────────────────────────────────────── */

.deep-dive-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.3);
    z-index: 100;
}
.deep-dive-panel {
    position: fixed; top: 0; right: 0; bottom: 0;
    width: 540px; max-width: 95vw;
    background: white; z-index: 101;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    transform: translateX(100%); transition: transform 0.25s ease;
    overflow-y: auto;
}
.deep-dive-panel.open { transform: translateX(0); }

/* Pair-comparison panel — slightly wider than the country deep-dive
   so the side-by-side cards fit comfortably. Inherits everything else
   from .deep-dive-panel. */
.compare-pair-panel { width: 640px; }
.compare-correlation-banner {
    display: flex; align-items: center; gap: 12px;
    padding: 12px 14px; margin-bottom: 14px;
    background: #f5f3ff; border-radius: 8px;
}
.compare-r {
    font-size: 28px; font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.compare-r.pos { color: #2e8b6e; }
.compare-r.neg { color: #c0392b; }
.compare-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
    margin-bottom: 14px;
}
.compare-card {
    background: #f7f7fa; border-radius: 8px; padding: 12px;
}
.compare-card-header {
    display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.compare-photo {
    width: 44px; height: 44px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
    background: #ddd;
}
.compare-name {
    font-weight: 600; font-size: 14px; cursor: pointer;
}
.compare-stats {
    list-style: none; padding: 0; margin: 0;
    font-size: 13px;
}
.compare-stats li {
    display: flex; justify-content: space-between;
    padding: 3px 0;
    border-top: 1px solid #ebe8f1;
}
.compare-stats li:first-child { border-top: none; }
.compare-stats .pos { color: #2e8b6e; font-weight: 600; }
.compare-stats .neg { color: #c0392b; font-weight: 600; }

/* Asset breakdown — single horizontal bar split into public /
   private / cash segments, with a tiny dot legend below. */
.compare-assets { margin-top: 10px; }
.compare-assets-h { margin-bottom: 4px; }
.compare-asset-bar {
    display: flex; height: 8px; border-radius: 4px;
    overflow: hidden; background: #ddd;
}
.compare-asset-seg {
    height: 100%;
}
.compare-asset-public  { background: #5ad1c7; }
.compare-asset-private { background: #a37fdc; }
.compare-asset-cash    { background: #6ec1e4; }
.compare-asset-legend {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 4px; font-size: 11px;
}
.compare-asset-legend-item { display: inline-flex; align-items: center; gap: 4px; }
.compare-asset-dot {
    width: 8px; height: 8px; border-radius: 2px;
    display: inline-block;
}

/* Bio + overview text under each compare card. The biography is
   line-clamped to 3 lines until expanded — Bloomberg bios run
   long enough to push everything else off-screen otherwise. */
.compare-bio { margin-top: 12px; }
.compare-overview {
    font-size: 12px;
    line-height: 1.45;
    color: #333;
    margin: 0 0 6px;
    font-style: italic;
}
.compare-bio-text {
    font-size: 12px;
    line-height: 1.5;
    color: #333;
    margin: 0;
    /* line-clamp keeps the card compact until the user opts in */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.compare-bio-text.expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}
.compare-bio-toggle {
    background: none; border: none; padding: 0;
    color: #6c5ce7; cursor: pointer;
    font-size: 11px; margin-top: 4px;
}
.compare-bio-toggle:hover { text-decoration: underline; }

.compare-hints {
    font-size: 12px;
    margin: 8px 0 14px;
}
.compare-tag {
    display: inline-block; margin-left: 8px;
    padding: 2px 8px; border-radius: 10px;
    background: #e0d7ff; color: #4a3d8c;
    font-size: 11px; font-weight: 600;
}
.compare-chart-wrap {
    height: 280px;
    margin-top: 6px;
}
.compare-chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.deep-dive-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    padding: 20px 24px 12px; border-bottom: 1px solid #eee;
}
.deep-dive-header h2 { font-size: 22px; margin: 4px 0 0; }
.deep-dive-header .panel-close {
    background: none; border: none; font-size: 28px; line-height: 1;
    cursor: pointer; color: #888; padding: 0 4px;
}
.deep-dive-header .panel-close:hover { color: #1a1a2e; }

.deep-dive-tabs {
    display: flex; gap: 4px; padding: 12px 24px;
    border-bottom: 1px solid #eee;
}
.deep-dive-tabs button {
    background: none; border: none; padding: 8px 16px;
    border-radius: 6px; font-size: 13px; cursor: pointer;
    color: #666; font-weight: 500;
}
.deep-dive-tabs button.active {
    background: #1a1a2e; color: white;
}
.deep-dive-tabs button:hover:not(.active) {
    background: #f0f1f5; color: #1a1a2e;
}

.deep-dive-content { padding: 16px 24px; }

.deep-dive-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    margin-bottom: 16px;
}
.deep-dive-stat {
    background: #fafbff; border: 1px solid #e0e6ff;
    border-radius: 6px; padding: 10px 12px; text-align: center;
}
.deep-dive-stat-num {
    display: block; font-size: 18px; font-weight: 700;
    color: #1a1a2e; font-variant-numeric: tabular-nums;
}
.deep-dive-stat-label {
    display: block; font-size: 11px; color: #888;
    text-transform: uppercase; letter-spacing: 0.04em; margin-top: 2px;
}

.deep-dive-section-h {
    font-size: 11px; color: #6c5ce7;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin: 16px 0 8px;
}

.deep-dive-list {
    list-style: none; padding: 0; margin: 0 0 8px;
}
.deep-dive-list li {
    display: flex; align-items: baseline; gap: 8px;
    padding: 5px 0; font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}
.deep-dive-list li:last-child { border-bottom: none; }
.deep-dive-rank {
    flex: 0 0 auto; min-width: 32px;
    color: #888; font-variant-numeric: tabular-nums;
    font-size: 11px;
}
.deep-dive-company {
    flex: 1; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.wd-tag {
    background: #f0eef5; color: #4a4458;
    padding: 1px 6px; border-radius: 8px; font-size: 10px;
}

.deep-dive-breakdown {
    list-style: none; padding: 0; margin: 0;
}
.deep-dive-breakdown li {
    display: flex; justify-content: space-between;
    padding: 3px 0; font-size: 12px;
}

.deep-dive-treemap-wrap {
    position: relative;
    width: 100%;
    height: 380px;
    margin: 12px 0 4px;
    border-radius: 8px;
    overflow: hidden;
    background: #f7f7fa;
}
.deep-dive-treemap-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Profile Assets donut — wealth-composition split (public / private /
   cash). Same visual language as the deep-dive sector donut for
   consistency. */
.profile-assets-donut-row {
    display: flex; align-items: flex-start; gap: 18px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}
.profile-assets-donut-row canvas {
    flex: 0 0 auto;
}
.profile-assets-donut-legend {
    list-style: none; padding: 0; margin: 0;
    flex: 1; min-width: 180px;
    font-size: 13px;
}
.profile-assets-donut-legend li {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0;
    border-top: 1px solid #f0f0f0;
}
.profile-assets-donut-legend li:first-child { border-top: none; }
.profile-assets-donut-legend li > span:nth-child(2) { flex: 1; }
.profile-assets-donut-swatch {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 2px; flex-shrink: 0;
}

/* Sector / country breakdown — donut on the left, legend list right.
   Wraps on narrow panels so a 540px deep-dive still reads cleanly.
   The donut canvas is sized in JS (renderDeepDiveDonut sets explicit
   pixel dimensions for a sharp render); CSS only owns the layout. */
.deep-dive-donut-row {
    margin-top: 18px;
}
.deep-dive-donut-wrap {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    flex-wrap: wrap;
}
.deep-dive-donut-wrap canvas {
    flex: 0 0 auto;     /* don't let flex stretch / shrink the donut */
}
.deep-dive-donut-legend {
    list-style: none; padding: 0; margin: 0;
    flex: 1; min-width: 200px;
    font-size: 12px;
}
.deep-dive-donut-legend li {
    display: flex; align-items: center; gap: 8px;
    padding: 3px 0;
}
.deep-dive-donut-legend li > span:nth-child(2) {
    flex: 1; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.deep-dive-donut-swatch {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 2px;
    flex-shrink: 0;
}
.btn-sm {
    border: 1px solid #d8d6de;
    background: white;
    padding: 5px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: #4a4458;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-sm:hover {
    background: #f5f5f7;
    border-color: #6c5ce7;
}

.race-legend {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-top: 10px; padding: 6px 0;
    font-size: 11px;
}
.race-legend-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: #f5f5f7; padding: 3px 9px; border-radius: 12px;
    color: #444;
}
.race-legend-swatch {
    display: inline-block; width: 10px; height: 10px;
    border-radius: 50%;
}
.race-legend-chip-btn {
    border: 1px solid transparent;
    cursor: pointer;
    font-size: inherit; font-family: inherit;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.race-legend-chip-btn:hover {
    background: white; border-color: #6c5ce7; color: #1a1a2e;
}

@media (max-width: 768px) {
    .insights-grid { grid-template-columns: 1fr; }
    .insights-card-wide { grid-column: auto; }
}

/* Cohort survival */
.cohort-stats {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-bottom: 12px;
}
.cohort-stat {
    text-align: center; padding: 10px 8px;
    border-radius: 6px; border: 1px solid;
}
.cohort-num {
    display: block; font-size: 22px; font-weight: 700;
    font-variant-numeric: tabular-nums; line-height: 1;
}
.cohort-label {
    display: block; font-size: 10px; color: #666;
    text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px;
}
.cohort-still { background: #d1f2eb; border-color: #a3e4d3; color: #2e8b6e; }
.cohort-dropped { background: #fdebd0; border-color: #f5cba7; color: #b9770e; }
.cohort-died { background: #f0eef5; border-color: #d8d4e0; color: #4a4458; }
.cohort-untracked { background: #f5f5f5; border-color: #ddd; color: #777; }

.cohort-bar-wrap { padding: 4px 0; }
.cohort-bar {
    display: flex; height: 18px; border-radius: 4px; overflow: hidden;
}
.cohort-bar .cohort-seg {
    height: 100%; min-width: 1px;
}
.cohort-bar .cohort-still { background: #4ecdc4; }
.cohort-bar .cohort-dropped { background: #f39c12; }
.cohort-bar .cohort-died { background: #6c5ce7; }
.cohort-bar .cohort-untracked { background: #bbb; }

/* Source-gap list */
.source-gap-list {
    list-style: none; padding: 0; margin: 0;
}
.source-gap-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0; border-bottom: 1px solid #f0f0f0;
    font-size: 13px; gap: 10px;
}
.source-gap-row:last-child { border-bottom: none; }
.source-gap-row .metric-link {
    flex: 1; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}
.source-gap-vals {
    display: flex; align-items: center; gap: 8px;
    font-variant-numeric: tabular-nums;
}
.source-gap-pct {
    font-weight: 600; min-width: 56px; text-align: right;
}

/* Correlation heatmap */
.corr-layout {
    display: grid; grid-template-columns: minmax(0, 440px) 1fr;
    gap: 16px;
}
@media (max-width: 768px) {
    .corr-layout { grid-template-columns: 1fr; }
}

/* Canvas-based heatmap. Replaces the old DOM-grid version: a single
   canvas can render a 500×500 cell matrix in milliseconds, where the
   DOM version stalled the browser past N≈100. The wrap is positioned
   so the absolute-positioned tooltip can sit on top of the cursor. */
.corr-heatmap-wrap {
    position: relative;
    width: max-content; max-width: 100%;
}
.corr-heatmap-canvas {
    display: block;
    border: 1px solid #ccc;
    image-rendering: pixelated;     /* keep cell edges crisp at any zoom */
    cursor: crosshair;
}
.corr-tooltip {
    position: absolute;
    z-index: 10;
    background: rgba(26,26,46,0.92);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    line-height: 1.4;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.corr-pairs h4, .migration-col h4 {
    font-size: 11px; color: #6c5ce7;
    text-transform: uppercase; letter-spacing: 0.05em;
    margin: 0 0 8px;
}
.corr-pairs ul, .migration-col ul {
    list-style: none; padding: 0; margin: 0 0 10px;
}
.corr-pairs li {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 0; font-size: 13px;
    border-bottom: 1px solid #f0f0f0;
}
.corr-r {
    display: inline-block; width: 48px; text-align: right;
    font-variant-numeric: tabular-nums; font-weight: 600;
    color: #2e8b6e;
}
.corr-r-strong { color: #1a1a2e; background: #d1f2eb; padding: 1px 6px; border-radius: 8px; }

/* Geographic migration */
.migration-layout {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.migration-col li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 0; font-size: 13px; gap: 8px;
    border-bottom: 1px solid #f0f0f0;
}
.migration-route { display: inline-flex; align-items: center; gap: 6px; }
.migration-col .metric-link.active {
    background: #6c5ce7; color: white; padding: 1px 8px;
    border-radius: 8px;
}
@media (max-width: 768px) {
    .migration-layout { grid-template-columns: 1fr; }
}
