:root {
    --explorer-border: #d8e2ef;
    --explorer-muted: #62738a;
    --explorer-panel: #ffffff;
    --explorer-blue-pale: #eef6ff;
}

.explorer-hero {
    padding: 122px 0 58px;
    color: var(--white);
    background:
        radial-gradient(circle at 88% 0%, rgba(59, 130, 246, 0.28), transparent 28rem),
        linear-gradient(135deg, var(--navy) 0%, #102849 100%);
}

.eyebrow {
    margin-bottom: 12px;
    color: #a9c9f8;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.explorer-hero h1 {
    max-width: 900px;
    font-size: clamp(2.4rem, 5vw, 4.4rem);
    line-height: 1;
    letter-spacing: -0.04em;
}

.hero-copy {
    max-width: 780px;
    margin-top: 18px;
    color: #d7e5f7;
    font-size: clamp(1rem, 2vw, 1.22rem);
}

.scope-note {
    max-width: 880px;
    margin-top: 18px;
    padding: 14px 17px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 9px;
    background: rgba(5, 18, 38, 0.38);
    color: #dce9f9;
    font-size: 0.88rem;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-actions a { display: inline-flex; align-items: center; min-height: 42px; padding: 9px 15px; border-radius: 7px; font-size: 0.88rem; font-weight: 800; text-decoration: none; }
.hero-action-primary { border: 1px solid #f0f6ff; background: #f0f6ff; color: #102849; }
.hero-action-primary:hover { background: #fff; }
.hero-action-secondary { border: 1px solid rgba(255, 255, 255, 0.4); color: #f3f7fc; }
.hero-action-secondary:hover { background: rgba(255, 255, 255, 0.08); }

.hero-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 32px;
}

.hero-stat {
    min-height: 94px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
}

.stat-number { display: block; color: var(--white); font-size: 1.55rem; font-weight: 800; line-height: 1.1; }
.stat-label { display: block; margin-top: 6px; color: #b9cbe3; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }

.findings-section { padding: 58px 0 68px; background: #fff; }
.findings-header { display: flex; align-items: end; justify-content: space-between; gap: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--explorer-border); }
.findings-header h2 { color: var(--gray-900); font-size: clamp(1.85rem, 4vw, 2.8rem); line-height: 1.08; }
.findings-header > div > p:last-child { max-width: 760px; margin-top: 10px; color: var(--explorer-muted); }
.section-label { margin-bottom: 8px; color: #275f91; font-size: 0.74rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.findings-freshness { flex: 0 0 auto; color: var(--explorer-muted); font-size: 0.76rem; font-weight: 700; }

.finding-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--explorer-border); }
.finding-metric { padding: 22px 20px 20px 0; }
.finding-metric + .finding-metric { padding-left: 20px; border-left: 1px solid var(--explorer-border); }
.finding-metric strong { display: block; color: #102849; font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1; }
.finding-metric span { display: block; margin-top: 8px; color: var(--explorer-muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.finding-metric small { display: block; margin-top: 5px; color: var(--gray-500); font-size: 0.75rem; }

.finding-highlights { counter-reset: finding; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 28px 0 32px; border-top: 2px solid #173d65; border-bottom: 1px solid var(--explorer-border); }
.finding-highlight { counter-increment: finding; position: relative; padding: 22px 22px 22px 42px; }
.finding-highlight + .finding-highlight { border-left: 1px solid var(--explorer-border); }
.finding-highlight::before { content: counter(finding, decimal-leading-zero); position: absolute; top: 24px; left: 0; color: #7390ae; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 700; }
.finding-highlight h3 { color: var(--gray-900); font-size: 1rem; line-height: 1.3; }
.finding-highlight p { margin-top: 7px; color: var(--gray-600); font-size: 0.86rem; line-height: 1.55; }

.findings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.findings-grid-primary { grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr); }
.finding-panel, .relationship-panel { border: 1px solid var(--explorer-border); border-radius: 10px; background: #fbfdff; }
.finding-panel { padding: 20px; }
.relationship-panel { margin-top: 18px; padding: 22px; background: #f7fafE; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading h3 { color: var(--gray-900); font-size: 1.08rem; line-height: 1.25; }
.panel-heading p { margin-top: 5px; color: var(--explorer-muted); font-size: 0.8rem; line-height: 1.45; }
.chart-note { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--explorer-border); color: var(--gray-500); font-size: 0.74rem; }

.metric-switch { display: flex; flex: 0 0 auto; padding: 2px; border: 1px solid #c7d5e5; border-radius: 7px; background: #eef3f8; }
.metric-switch button { min-height: 30px; padding: 4px 9px; border: 0; border-radius: 5px; background: transparent; color: #52677f; cursor: pointer; font: inherit; font-size: 0.72rem; font-weight: 800; }
.metric-switch button.active { background: #fff; color: #123e68; box-shadow: var(--shadow-sm); }

.bar-chart { display: grid; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(120px, 0.8fr) minmax(150px, 1.6fr) 126px; align-items: center; gap: 10px; width: 100%; padding: 2px; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.bar-row:hover .bar-fill, .bar-row:focus-visible .bar-fill { background: #1d64a0; }
.bar-row:focus-visible { border-radius: 5px; outline: 3px solid rgba(37, 99, 235, 0.2); }
.bar-label { color: #263a51; font-size: 0.77rem; font-weight: 750; line-height: 1.25; }
.bar-track { position: relative; height: 13px; overflow: hidden; border-radius: 2px; background: #e5edf5; }
.bar-fill { display: block; width: var(--bar-share); height: 100%; min-width: 2px; background: #2b78b9; transition: width 180ms ease, background 120ms ease; }
.bar-value { justify-self: end; color: #40566e; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.bar-chart.compact .bar-row { grid-template-columns: minmax(145px, 1fr) minmax(100px, 1.1fr) 112px; gap: 8px; }
.bar-chart.compact .bar-label { font-size: 0.73rem; }

.client-chart { display: grid; gap: 16px; }
.client-total-track { display: flex; height: 18px; overflow: hidden; border-radius: 3px; background: #e5edf5; }
.client-segment { min-width: 2px; border: 0; cursor: pointer; }
.client-segment:nth-child(1) { background: #174f80; }
.client-segment:nth-child(2) { background: #4d88b8; }
.client-segment:nth-child(3) { background: #91b7d5; }
.client-segment:focus-visible { outline: 3px solid #f59e0b; outline-offset: -3px; }
.client-legend { display: grid; gap: 12px; }
.client-row { display: grid; grid-template-columns: 11px 1fr auto; gap: 9px; align-items: start; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.client-row::before { content: ""; width: 10px; height: 10px; margin-top: 5px; border-radius: 2px; background: #174f80; }
.client-row:nth-child(2)::before { background: #4d88b8; }
.client-row:nth-child(3)::before { background: #91b7d5; }
.client-row strong { display: block; color: #243a51; font-size: 0.76rem; line-height: 1.35; }
.client-row small { display: block; margin-top: 2px; color: var(--gray-500); font-size: 0.69rem; }
.client-row > span:last-child { color: #29445f; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; }

.relationship-map { display: grid; gap: 11px; }
.relationship-row { display: grid; grid-template-columns: minmax(180px, 0.68fr) 28px minmax(0, 2fr); align-items: stretch; }
.relationship-client { display: flex; flex-direction: column; justify-content: center; padding: 13px 14px; border: 1px solid #a9bfd4; border-radius: 7px; background: #fff; }
.relationship-client strong { color: #173d65; font-size: 0.8rem; line-height: 1.35; }
.relationship-client span { margin-top: 4px; color: var(--gray-500); font-size: 0.7rem; }
.relationship-connector { position: relative; }
.relationship-connector::before { content: ""; position: absolute; top: 50%; right: 0; left: 0; height: 1px; background: #9db2c8; }
.relationship-connector::after { content: ""; position: absolute; top: calc(50% - 4px); right: 0; border-top: 4px solid transparent; border-bottom: 4px solid transparent; border-left: 6px solid #7893ad; }
.relationship-firms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; padding: 7px; border-left: 2px solid #7893ad; }
.relationship-firm { display: flex; justify-content: space-between; gap: 10px; padding: 9px 10px; border: 1px solid #d2deea; border-radius: 6px; background: #fff; cursor: pointer; text-align: left; font: inherit; }
.relationship-firm:hover { border-color: #77a4cb; background: #f3f8fd; }
.relationship-firm strong { display: block; color: #233a52; font-size: 0.74rem; }
.relationship-firm small { display: block; margin-top: 2px; color: var(--gray-500); font-size: 0.65rem; }
.relationship-firm > span:last-child { flex: 0 0 auto; color: #315979; font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700; }

.people-chart { display: grid; gap: 9px; }
.person-row { display: grid; grid-template-columns: 24px minmax(130px, 0.95fr) minmax(110px, 1fr) 82px; align-items: center; gap: 8px; padding: 3px; border: 0; background: transparent; cursor: pointer; color: inherit; text-align: left; font: inherit; }
.person-rank { color: #7890a8; font-family: var(--font-mono); font-size: 0.68rem; }
.person-name strong { display: block; color: #263d54; font-size: 0.74rem; }
.person-name small { display: block; overflow: hidden; color: var(--gray-500); font-size: 0.64rem; text-overflow: ellipsis; white-space: nowrap; }
.person-row .bar-track { height: 10px; }
.person-row .bar-fill { background: #4c86b5; }
.person-row:hover .bar-fill { background: #1e5e91; }

.entity-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.entity-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 9px 11px; border: 1px solid #d4dfeb; border-radius: 6px; background: #fff; color: inherit; cursor: pointer; text-align: left; font: inherit; }
.entity-item:hover { border-color: #8eb1d1; background: #f4f8fc; }
.entity-item strong { color: #2b4056; font-size: 0.73rem; }
.entity-item span { color: #41617e; font-family: var(--font-mono); font-size: 0.7rem; font-weight: 700; }

.finding-method { margin-top: 18px; padding: 18px 20px; border-left: 4px solid #b7791f; background: #fff9ed; color: #5f4a2b; font-size: 0.8rem; }
.finding-method strong { color: #493618; }
.finding-method a { font-weight: 800; }

.explorer-shell { min-height: 62vh; padding: 48px 0 72px; background: #f5f8fc; }
.search-heading-row { display: flex; gap: 24px; align-items: end; justify-content: space-between; margin-bottom: 18px; }
.search-heading-row h2 { color: var(--gray-900); font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.12; }
.search-heading-row p { margin-top: 6px; color: var(--explorer-muted); }

.text-button, .download-button, .pagination button {
    border: 1px solid var(--explorer-border);
    border-radius: 7px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}
.text-button { padding: 9px 12px; color: var(--blue); background: transparent; white-space: nowrap; }
.text-button:hover { background: var(--explorer-blue-pale); }

.filter-panel {
    padding: 20px;
    border: 1px solid var(--explorer-border);
    border-radius: 12px;
    background: var(--explorer-panel);
    box-shadow: var(--shadow-sm);
}

.filter-panel label { display: flex; flex-direction: column; gap: 6px; color: var(--gray-700); font-size: 0.77rem; font-weight: 800; letter-spacing: 0.02em; }
.filter-panel input, .filter-panel select {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid #bdcce0;
    border-radius: 7px;
    background: #fff;
    color: var(--gray-900);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 400;
}
.filter-panel input:focus, .filter-panel select:focus { border-color: var(--blue); outline: 3px solid rgba(37, 99, 235, 0.15); }
.search-field { margin-bottom: 18px; }
.search-field input { min-height: 52px; font-size: 1.05rem; }
.filter-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.result-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin: 24px 0 12px; }
#result-summary { color: var(--gray-700); font-size: 0.94rem; font-weight: 600; }
.download-button { padding: 10px 14px; color: var(--white); border-color: var(--blue); background: var(--blue); }
.download-button:hover:not(:disabled) { background: #1d4ed8; }
.download-button:disabled { cursor: not-allowed; border-color: #bdcce0; background: #aebfd4; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid #bdd7f5; border-radius: 999px; background: #edf6ff; color: #17466f; font-size: 0.78rem; font-weight: 700; }
.filter-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 1rem; line-height: 1; }

.loading-state, .empty-state { margin-top: 18px; padding: 32px; border: 1px dashed #b7c7dc; border-radius: 10px; color: var(--explorer-muted); background: #fff; text-align: center; }
.empty-state h3 { color: var(--gray-800); }
.empty-state p { margin-top: 6px; }

.result-list { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.result-card { padding: 18px 20px; border: 1px solid var(--explorer-border); border-radius: 10px; background: #fff; box-shadow: var(--shadow-sm); }
.result-card:hover { border-color: #99bee9; box-shadow: var(--shadow-md); }
.result-description { color: #15253b; font-size: 0.98rem; line-height: 1.58; }
.result-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 14px; color: var(--explorer-muted); font-size: 0.8rem; }
.result-meta strong { color: var(--gray-800); }
.result-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.result-tag { padding: 3px 7px; border-radius: 999px; background: #edf5ff; color: #17518a; font-size: 0.72rem; font-weight: 700; }
.source-link { color: #17518a; font-weight: 700; }
.redacted { color: #8a4b12; font-weight: 700; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 24px; }
.pagination button { padding: 8px 13px; background: #fff; color: #164e86; }
.pagination button:hover:not(:disabled) { background: #edf6ff; }
.pagination button:disabled { color: #9aacbf; cursor: not-allowed; }
#page-status { color: var(--explorer-muted); font-size: 0.85rem; font-weight: 700; }

.footer-single { display: block; }
.footer-single .footer-col { max-width: 900px; }

@media (max-width: 980px) {
    .filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finding-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .finding-metric:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--explorer-border); }
    .finding-metric:nth-child(4) { border-top: 1px solid var(--explorer-border); }
    .finding-highlights { grid-template-columns: 1fr; }
    .finding-highlight + .finding-highlight { border-top: 1px solid var(--explorer-border); border-left: 0; }
    .findings-grid, .findings-grid-primary { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
    .explorer-hero { padding-top: 96px; }
    .container { padding-left: 16px; padding-right: 16px; }
    .explorer-shell { padding-top: 30px; }
    .search-heading-row, .result-toolbar { align-items: flex-start; flex-direction: column; }
    .filter-grid, .hero-stats { grid-template-columns: 1fr; }
    .findings-section { padding: 38px 0 46px; }
    .findings-header { align-items: flex-start; flex-direction: column; gap: 10px; }
    .finding-metrics { grid-template-columns: 1fr; }
    .finding-metric, .finding-metric + .finding-metric, .finding-metric:nth-child(3), .finding-metric:nth-child(4) { padding: 18px 0; border-top: 1px solid var(--explorer-border); border-left: 0; }
    .finding-metric:first-child { border-top: 0; }
    .finding-highlights { margin-top: 22px; }
    .finding-highlight { padding: 20px 0 20px 38px; }
    .finding-panel, .relationship-panel { padding: 18px 16px; }
    .panel-heading { align-items: stretch; flex-direction: column; }
    .metric-switch { align-self: stretch; width: 100%; }
    .metric-switch button { flex: 1 1 0; min-height: 44px; font-size: 0.78rem; }
    .bar-chart, .bar-chart.compact { gap: 5px; }
    .bar-row, .bar-chart.compact .bar-row {
        grid-template-areas:
            "label value"
            "track track";
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 7px 12px;
        min-height: 58px;
        padding: 7px 3px;
    }
    .bar-label { grid-area: label; font-size: 0.78rem; }
    .bar-track { grid-area: track; height: 11px; }
    .bar-value { grid-area: value; align-self: start; font-size: 0.7rem; text-align: right; }
    .chart-note { margin-top: 12px; font-size: 0.76rem; line-height: 1.5; }
    .client-row { grid-template-columns: 11px minmax(0, 1fr) auto; min-height: 44px; }
    .client-row > span:last-child { padding-left: 8px; }
    .relationship-row { grid-template-columns: 1fr; }
    .relationship-connector { height: 20px; }
    .relationship-connector::before { top: 0; bottom: 0; left: 24px; width: 1px; height: auto; }
    .relationship-connector::after { top: auto; right: auto; bottom: 0; left: 20px; border-top: 6px solid #7893ad; border-right: 4px solid transparent; border-bottom: 0; border-left: 4px solid transparent; }
    .relationship-firms { grid-template-columns: 1fr; border-top: 2px solid #7893ad; border-left: 0; }
    .relationship-firm { align-items: flex-start; min-height: 52px; }
    .person-row {
        grid-template-areas:
            "rank name value"
            ". track track";
        grid-template-columns: 24px minmax(0, 1fr) auto;
        gap: 6px 9px;
        min-height: 62px;
        padding: 7px 3px;
    }
    .person-rank { grid-area: rank; align-self: start; padding-top: 2px; }
    .person-name { grid-area: name; min-width: 0; }
    .person-name strong { font-size: 0.78rem; }
    .person-name small { margin-top: 2px; font-size: 0.68rem; }
    .person-row .bar-track { grid-area: track; height: 10px; }
    .person-row .bar-value { grid-area: value; }
    .entity-list { grid-template-columns: 1fr; }
    .entity-item { min-height: 48px; }
    .finding-method { padding: 16px; font-size: 0.82rem; line-height: 1.55; }
    .text-button, .download-button { width: 100%; }
    .result-card { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    .bar-fill { transition: none; }
}
