.analytics-page {
    --analytics-green: #0b7d53;
    --analytics-green-dark: #075e40;
    --analytics-green-soft: #eaf6f0;
    --analytics-green-faint: #f6fbf8;
    --analytics-border: #dfe9e4;
    --analytics-text: #243a31;
    --analytics-muted: #6a7b74;
    --analytics-shadow: 0 8px 24px rgba(23, 73, 52, .07);
    padding-top: 20px;
    padding-bottom: 36px;
    background: linear-gradient(180deg, #f8fcfa 0, #ffffff 260px);
}

.analytics-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 28px;
    margin-bottom: 18px;
    padding: 4px 2px 2px;
}

.analytics-hero h2 {
    margin: 2px 0 6px;
    color: var(--analytics-green-dark);
    font-size: 1.85rem;
    font-weight: 750;
}

.analytics-hero p {
    max-width: 760px;
    margin: 0;
    color: var(--analytics-muted);
    font-size: .98rem;
    line-height: 1.55;
}

.analytics-eyebrow,
.section-kicker {
    display: inline-block;
    color: var(--analytics-green);
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.analytics-note {
    width: min(420px, 100%);
    border: 1px solid #cfe4da;
    border-radius: 12px;
    background: rgba(240, 249, 245, .92);
    color: #456158;
}

.analytics-note summary {
    cursor: pointer;
    padding: 11px 14px;
    color: #315a49;
    font-weight: 700;
    list-style-position: inside;
}

.analytics-note > div {
    padding: 0 14px 13px;
    border-top: 1px solid #dcebe4;
    font-size: .87rem;
    line-height: 1.55;
}

.analytics-section {
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid var(--analytics-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--analytics-shadow);
}

.analytics-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 16px;
}

.analytics-section-heading h3 {
    margin: 3px 0 0;
    color: var(--analytics-text);
    font-size: 1.2rem;
    font-weight: 750;
}

.analytics-section-caption,
.analytics-total-note {
    color: var(--analytics-muted);
    font-size: .83rem;
}

.analytics-total-note {
    padding: 6px 10px;
    border: 1px solid #d9ebe3;
    border-radius: 999px;
    background: #f4faf7;
    color: var(--analytics-green-dark);
    font-weight: 650;
}

.analytics-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.analytics-kpi {
    position: relative;
    min-height: 132px;
    overflow: hidden;
    padding: 15px;
    border: 1px solid #dce9e3;
    border-radius: 14px;
    background: linear-gradient(145deg, #ffffff, #f7fbf9);
}

.analytics-kpi::after {
    position: absolute;
    right: -22px;
    bottom: -32px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: rgba(11, 125, 83, .055);
    content: "";
}

.analytics-kpi-primary {
    border-color: #b9dfce;
    background: linear-gradient(145deg, #0b7d53, #096744);
}

.analytics-kpi-primary::after {
    background: rgba(255,255,255,.09);
}

.analytics-kpi-label {
    display: block;
    min-height: 34px;
    color: #5b6d65;
    font-size: .82rem;
    font-weight: 650;
    line-height: 1.35;
}

.analytics-kpi strong {
    display: block;
    margin: 6px 0 5px;
    color: var(--analytics-green-dark);
    font-size: 2rem;
    line-height: 1;
}

.analytics-kpi small {
    color: #7a8983;
    font-size: .75rem;
}

.analytics-kpi-primary .analytics-kpi-label,
.analytics-kpi-primary strong,
.analytics-kpi-primary small {
    color: #fff;
}

.analytics-kpi-primary small {
    opacity: .82;
}

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

.analytics-mini-stats > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 54px;
    padding: 10px 12px;
    border: 1px solid #e1ebe6;
    border-radius: 10px;
    background: #fbfdfc;
}

.analytics-mini-stats span {
    color: #64756d;
    font-size: .78rem;
    line-height: 1.35;
}

.analytics-mini-stats strong {
    flex: 0 0 auto;
    color: var(--analytics-green-dark);
    font-size: 1.15rem;
}

.coverage-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 28px;
}

.coverage-row {
    min-width: 0;
}

.coverage-meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 7px;
    color: #4c6057;
    font-size: .88rem;
}

.coverage-meta strong {
    color: var(--analytics-text);
    font-size: .87rem;
}

.coverage-meta em {
    margin-left: 5px;
    color: var(--analytics-green);
    font-size: .75rem;
    font-style: normal;
    font-weight: 650;
}

.coverage-track,
.bar-track {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    background: #e9f1ed;
}

.coverage-track {
    height: 10px;
}

.coverage-track > span,
.bar-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0c8d5d, #58b98f);
}

.analytics-split,
.analytics-chart-grid,
.analytics-table-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.analytics-table-grid-spaced {
    margin-top: 16px;
}

.gap-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.gap-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 12px;
    align-items: center;
    min-height: 92px;
    padding: 14px 16px;
    border: 1px solid #f0dfb8;
    border-radius: 13px;
    background: #fffaf0;
}

.gap-card > span {
    color: #6b604a;
    font-size: .82rem;
    font-weight: 650;
}

.gap-card > strong {
    grid-row: span 2;
    color: #a75f00;
    font-size: 1.65rem;
    line-height: 1;
}

.gap-card > small {
    color: #8b806a;
    font-size: .75rem;
}

.distribution-highlight {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.distribution-number {
    display: flex;
    min-height: 122px;
    flex-direction: column;
    justify-content: center;
    padding: 14px;
    border: 1px solid #d9e9e1;
    border-radius: 14px;
    background: var(--analytics-green-faint);
    text-align: center;
}

.distribution-number strong {
    margin-bottom: 6px;
    color: var(--analytics-green-dark);
    font-size: 1.8rem;
    line-height: 1;
}

.distribution-number span {
    color: #5f7169;
    font-size: .78rem;
    line-height: 1.4;
}

.distribution-species-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.distribution-species-card {
    min-width: 0;
    padding: 14px;
    border: 1px solid #dfe9e4;
    border-radius: 14px;
    background: #fbfdfc;
}

.distribution-species-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.distribution-species-heading h4 {
    margin: 0 0 3px;
    color: #315247;
    font-size: .92rem;
    font-weight: 750;
}

.distribution-species-heading small {
    color: #7a8983;
    font-size: .72rem;
}

.distribution-species-heading > strong {
    flex: 0 0 auto;
    min-width: 36px;
    color: var(--analytics-green-dark);
    font-size: 1.35rem;
    line-height: 1;
    text-align: right;
}

.distribution-species-list {
    max-height: 260px;
    margin: 0;
    padding: 0 0 0 28px;
    overflow: auto;
}

.distribution-species-list li {
    padding: 7px 8px 7px 2px;
    border-bottom: 1px solid #edf2ef;
    color: #4f6259;
    font-size: .8rem;
}

.distribution-species-list li:last-child {
    border-bottom: 0;
}

.distribution-species-list li::marker {
    color: #789288;
    font-size: .72rem;
}

.distribution-species-list li span {
    float: right;
    margin-left: 12px;
    color: #789087;
    font-size: .72rem;
    font-style: normal;
    white-space: nowrap;
}

.combination-list {
    overflow: hidden;
    border: 1px solid #e0eae5;
    border-radius: 14px;
    background: #fff;
}

.combination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 54px;
    padding: 11px 14px;
    border-bottom: 1px solid #edf2ef;
}

.combination-row:last-child {
    border-bottom: 0;
}

.combination-row span {
    color: #50635a;
    font-size: .82rem;
    line-height: 1.4;
}

.combination-row strong {
    min-width: 32px;
    color: var(--analytics-green-dark);
    font-size: 1.05rem;
    text-align: right;
}

.analytics-chart-card {
    min-width: 0;
    padding: 16px;
    border: 1px solid #e0eae5;
    border-radius: 14px;
    background: #fcfefd;
}

.analytics-chart-grid-visual {
    margin-bottom: 16px;
}

.analytics-chart-card-visual {
    min-height: 410px;
}

.analytics-canvas-wrap {
    position: relative;
    width: 100%;
    min-height: 330px;
}

.analytics-canvas-wrap-bar {
    height: 350px;
}

.analytics-canvas-wrap-pie {
    height: 350px;
}

.analytics-canvas-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.chart-card-heading h4,
.analytics-detail-body h4 {
    margin: 0;
    color: #315247;
    font-size: .95rem;
    font-weight: 700;
}

.chart-card-heading > span {
    padding: 4px 8px;
    border-radius: 999px;
    background: #edf7f2;
    color: #54806d;
    font-size: .7rem;
}

.bar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bar-list-wide {
    max-width: 980px;
}

.bar-row {
    min-width: 0;
}

.bar-label {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 5px;
    color: #52655c;
    font-size: .8rem;
}

.bar-label span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.bar-label strong {
    flex: 0 0 auto;
    color: var(--analytics-green-dark);
    font-size: .8rem;
}

.bar-track {
    height: 8px;
}

.experiment-summary {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.experiment-summary > small {
    color: #7a8983;
    font-size: .7rem;
    font-weight: 600;
}

.experiment-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.experiment-badges span {
    padding: 6px 9px;
    border: 1px solid #d8e8e0;
    border-radius: 999px;
    background: #f5faf7;
    color: #5f7169;
    font-size: .72rem;
}

.experiment-badges strong {
    margin-left: 4px;
    color: var(--analytics-green-dark);
}

.pharmacology-subsection-heading {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid #e7efeb;
}

.analytics-empty {
    display: flex;
    min-height: 110px;
    align-items: center;
    justify-content: center;
    border: 1px dashed #d8e6df;
    border-radius: 10px;
    background: #fafcfb;
    color: #87948e;
    font-size: .82rem;
}

.analytics-details-section {
    padding-bottom: 12px;
}

.analytics-detail-group {
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid #e0e9e4;
    border-radius: 12px;
    background: #fff;
}

.analytics-detail-group:last-child {
    margin-bottom: 0;
}

.analytics-detail-group > summary {
    position: relative;
    cursor: pointer;
    padding: 13px 42px 13px 15px;
    background: #fbfdfc;
    color: #35584a;
    font-size: .88rem;
    font-weight: 700;
    list-style: none;
}

.analytics-detail-group > summary::-webkit-details-marker {
    display: none;
}

.analytics-detail-group > summary::after {
    position: absolute;
    top: 50%;
    right: 16px;
    color: var(--analytics-green);
    content: "+";
    font-size: 1.15rem;
    line-height: 1;
    transform: translateY(-50%);
}

.analytics-detail-group[open] > summary::after {
    content: "−";
}

.analytics-detail-group[open] > summary {
    border-bottom: 1px solid #e6eeea;
    background: #f5faf7;
}

.analytics-detail-body {
    padding: 14px;
}

.analytics-detail-body h4 {
    margin-bottom: 9px;
}

.analytics-table {
    margin: 0;
    font-size: .82rem;
}

.analytics-table th {
    background: #edf7f2;
    color: #315a49;
    white-space: nowrap;
}

.analytics-table td,
.analytics-table th {
    padding: 8px 9px !important;
    vertical-align: top !important;
}

.analytics-table td {
    color: #4b5c55;
}

.analytics-long-table {
    max-height: 480px;
    overflow: auto;
}

.analytics-long-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.analytics-record-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.analytics-record-card {
    min-height: 122px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px 16px;
    border: 1px solid #dfe9e4;
    border-radius: 13px;
    background: linear-gradient(180deg, #fbfefc 0%, #f5faf7 100%);
}

.analytics-record-card > span {
    color: #40584f;
    font-size: .87rem;
    font-weight: 700;
    line-height: 1.35;
}

.analytics-record-card > strong {
    margin-top: 8px;
    color: var(--analytics-green-dark);
    font-size: 1.7rem;
    font-weight: 800;
    line-height: 1;
}

.analytics-record-card > small {
    margin-top: 5px;
    color: var(--analytics-muted);
    font-size: .75rem;
}

@media (max-width: 1280px) {
    .analytics-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .analytics-mini-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-record-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 992px) {
    .analytics-hero,
    .analytics-section-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .analytics-note {
        width: 100%;
    }

    .analytics-split,
    .analytics-chart-grid,
    .analytics-table-grid,
    .distribution-species-grid,
    .coverage-list {
        grid-template-columns: 1fr;
    }

    .experiment-summary {
        align-items: flex-start;
    }

    .experiment-badges {
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .analytics-page {
        padding-top: 14px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .analytics-section {
        padding: 15px;
        border-radius: 13px;
    }

    .analytics-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-mini-stats,
    .distribution-highlight,
    .gap-card-grid,
    .analytics-record-grid {
        grid-template-columns: 1fr;
    }

    .analytics-kpi {
        min-height: 118px;
    }

    .analytics-hero h2 {
        font-size: 1.55rem;
    }
}

@media (max-width: 440px) {
    .analytics-kpi-grid {
        grid-template-columns: 1fr;
    }

    .analytics-kpi {
        min-height: 104px;
    }
}

/* ===== Analytics compact mode 2026-09-20 ===== */
.analytics-kpi-compounds {
    border-color: #c7e4d7;
    background: linear-gradient(145deg, #f2fbf6, #ffffff);
}

.analytics-kpi-compounds > strong {
    color: #08764f;
}

.analytics-more-toggle-wrap {
    display: grid;
    justify-items: center;
    gap: 7px;
    margin: 2px 0 18px;
    padding: 4px 0;
    text-align: center;
}

.analytics-more-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 14px;
    border: 1px solid #c9e1d6;
    border-radius: 11px;
    background: #f5faf7;
    color: #245b48;
    font-size: .84rem;
    font-weight: 800;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.analytics-more-toggle:hover,
.analytics-more-toggle:focus-visible {
    border-color: #91c8b1;
    background: #eaf6f0;
    color: #075e40;
    outline: none;
}

.analytics-more-toggle__chevron {
    transition: transform .18s ease;
}

.analytics-more-toggle[aria-expanded="true"] .analytics-more-toggle__chevron {
    transform: rotate(180deg);
}

.analytics-more-toggle-wrap p {
    margin: 0;
    color: var(--analytics-muted);
    font-size: .75rem;
}

.analytics-advanced-section[hidden] {
    display: none !important;
}

@media (max-width: 720px) {
    .analytics-more-toggle {
        width: 100%;
    }

    .analytics-more-toggle-wrap {
        margin-bottom: 14px;
    }
}
