.dataTables_wrapper {
    font-size: 0.85rem;
}


#report-card,
.methods-report-card {
    margin-bottom: 2rem;
}


#navbar-toc,
#methods-navbar-toc {
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}


#snohub2-loader,
#not-snoRNA {
    min-height: 2rem;
}


.dataTables_wrapper table.dataTable td,
.dataTables_wrapper table.dataTable th {
    vertical-align: middle;
}


.autoComplete_wrapper,
.autoComplete_wrapper > input {
    width: 100%;
}


.autoComplete_wrapper > ul {
    z-index: 10000 !important;
}


/* keep the search box and its buttons on one line */
.input-group:has(.autoComplete_wrapper) {
    flex-wrap: nowrap;
}


.input-group .autoComplete_wrapper {
    display: block;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}


.input-group .autoComplete_wrapper > input {
    width: 100%;
}


.thumbnail {
    border-radius: 3%;
}


/*
 * Shared page logo
 */
.site-logo {
    display: block;
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    height: auto;
    margin-right: auto;
    margin-left: auto;
}


.site-logo-link {
    display: inline-block;
    width: 120px;
    line-height: 0;
}


/* the title keeps the old logo's two-tone wordmark, in the button blue */
.brand-sno {
    color: #0d6efd;
}

.brand-hub {
    color: #4a4a4a;
}


/*
 * Shared Home and Methods navigation
 */
.site-page-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1.25rem;
}


/*
 * Homepage subtitle
 */
.home-subtitle {
    margin-bottom: 0;
    font-size: 1.6rem;
    font-weight: 200;
    line-height: 1.3;
}


/*
 * Overall highest-correlated terms
 */
#table-overall-highest {
    width: 100% !important;
}


#table-overall-highest th,
#table-overall-highest td {
    vertical-align: middle;
}


#table-overall-highest td:nth-child(3) {
    overflow-wrap: anywhere;
}


/*
 * Top genes for each library's highest-correlated terms
 */
#functions-by-library-results {
    width: 100%;
}


.term-genes-drawer {
    border: 1px solid #dee2e6;
    border-radius: 0.35rem;
    background-color: #ffffff;
}


.term-genes-drawer[open] {
    background-color: #f8f9fa;
}


.term-genes-summary {
    padding: 0.85rem 1rem;
    cursor: pointer;
    font-weight: 600;
}


.term-genes-summary:hover {
    color: #0d6efd;
}


.term-genes-summary::marker {
    color: #6c757d;
}


.term-genes-hint {
    color: #6c757d;
    font-size: 0.85rem;
    font-weight: 400;
}


.term-genes-body {
    padding: 0 1rem 1rem;
}


.term-genes-table {
    width: 100%;
    margin-bottom: 0;
    background-color: #ffffff;
    font-size: 0.82rem;
}


.term-genes-table th {
    white-space: nowrap;
}


.term-genes-table td {
    vertical-align: top;
}


.term-genes-table td:first-child {
    width: 2.5rem;
    color: #6c757d;
    text-align: center;
}


.term-genes-table td:nth-child(2) {
    width: 38%;
    overflow-wrap: anywhere;
}


.term-gene-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.75rem;
}


.term-gene {
    white-space: nowrap;
}


.term-gene-r {
    margin-left: 0.2rem;
    color: #6c757d;
    font-variant-numeric: tabular-nums;
}


.term-gene-more {
    padding: 0;
    border: 0;
    background: none;
    color: #0d6efd;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}


/*
 * Functions grouped by library
 */
.library-results {
    margin-top: 2rem;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #dee2e6;
}


.library-results:last-child {
    border-bottom: 0;
}


.library-name {
    margin-bottom: 1.25rem;
    font-weight: 600;
    overflow-wrap: anywhere;
}


.library-direction-heading {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
}


.library-result-columns {
    align-items: flex-start;
}


.library-figure {
    width: 100%;
    margin: 0;
}


.library-chart-card,
.library-table-card {
    width: 100%;
    border: 1px solid #dee2e6;
    border-radius: 0.35rem;
    background-color: #ffffff;
}


.library-chart-card {
    padding: 1rem 0.75rem 0.5rem;
}


.library-chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 330px;
}


.library-chart-canvas {
    width: 100% !important;
    height: 100% !important;
}


.library-table-card {
    overflow: auto;
}


.library-highest-table {
    width: 100%;
    min-width: 560px;
    margin-bottom: 0;
    font-size: 0.78rem;
}


.library-highest-table th,
.library-highest-table td {
    vertical-align: middle;
}


.library-highest-table th {
    white-space: nowrap;
}


.library-highest-table th:first-child,
.library-highest-table td:first-child {
    width: 3.5rem;
    text-align: center;
}


.library-highest-table td:nth-child(2) {
    min-width: 14rem;
    overflow-wrap: anywhere;
}


.library-highest-table th:nth-child(3),
.library-highest-table td:nth-child(3),
.library-highest-table th:nth-child(4),
.library-highest-table td:nth-child(4),
.library-highest-table th:nth-child(5),
.library-highest-table td:nth-child(5) {
    text-align: right;
}


/*
 * Figure and table legends
 */
.structure-sequence {
    max-height: 18rem;
    padding: 0.75rem;
    overflow: auto;
    font-size: 0.8rem;
    line-height: 1.35;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
}

.structure-figure {
    margin: 0 0 0.5rem;
    text-align: center;
}

/* some diagrams are several times taller than wide */
.structure-figure img {
    width: 100%;
    max-width: 640px;
    height: 32rem;
    object-fit: contain;
    background: #fff;
}

.figure-legend,
.table-legend {
    margin-top: 0.75rem;
    margin-bottom: 0;
    color: #6c757d;
    font-size: 0.78rem;
    line-height: 1.45;
    text-align: left;
}


.figure-legend {
    padding: 0 0.25rem;
}

/* report charts wrapped in <figure> so each carries a numbered caption */
.report-figure {
    margin: 0 0 1rem;
}


/*
 * Download controls
 */
.download-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}


.download-button {
    white-space: nowrap;
}


.download-button:disabled {
    cursor: wait;
}


/*
 * Methods page
 */
.methods-page {
    padding-bottom: 2rem;
}


.methods-subtitle {
    margin-top: 0;
    margin-bottom: 0;
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.5;
}


/*
 * Methods sidebar
 */
#methods-navbar-toc .nav-link {
    overflow-wrap: anywhere;
}


/*
 * Methods content card
 */
.methods-report-card {
    width: 100%;
}


.methods-card-body {
    padding: 1.5rem;
}


.methods-section {
    margin-top: 3rem;
    scroll-margin-top: 1.5rem;
}


.methods-section-first {
    margin-top: 0;
}


.methods-section h2 {
    margin-bottom: 1.1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
    font-size: 1.35rem;
    font-weight: 600;
}


.methods-section p {
    margin-bottom: 1rem;
    color: #212529;
    font-size: 1rem;
    line-height: 1.72;
    text-align: left;
}


.methods-section code {
    padding: 0.1rem 0.3rem;
    border-radius: 0.2rem;
    background-color: #f1f3f5;
    color: #212529;
    font-size: 0.88em;
}


.methods-equation {
    white-space: nowrap;
    font-family:
        "Cambria Math",
        "Times New Roman",
        serif;
}


.methods-formula {
    margin: 1.25rem 0;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    border-left: 3px solid #318dbb;
    background-color: #f8f9fa;
    font-family:
        "Cambria Math",
        "Times New Roman",
        serif;
    font-size: 1rem;
    line-height: 1.65;
}


.methods-library-list {
    margin-top: 0.25rem;
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
    color: #212529;
    font-size: 1rem;
    line-height: 1.65;
}


.methods-library-list li {
    margin-bottom: 0.2rem;
}


.methods-references p {
    margin-bottom: 0.6rem;
    padding-left: 1.8rem;
    text-indent: -1.8rem;
    color: #495057;
    font-size: 0.84rem;
    line-height: 1.55;
}


/*
 * Anchored sections
 */
#overview table th {
    width: 11rem;
    white-space: nowrap;
}


#overview-tissues,
#overview-cell-types,
#overview-cell-lines {
    overflow-wrap: anywhere;
}


#overview,
#similar-snornas,
#top-correlated-genes,
#overall-highest-terms,
#overall-overlap-genes,
#functions-by-library,
#references,
#methods-top,
#methods-overview,
#expression-data,
#sample-selection,
#normalization,
#coexpression,
#gene-sets,
#functional-scoring,
#report-generation,
#perturbseqr-analysis,
#similarity-views,
#top-correlated-genes-methods,
#software,
#methods-references {
    scroll-margin-top: 1rem;
}


/*
 * Perturb-Seqr results
 */
#perturbseqr-results-container {
    width: 100%;
}


.perturbseqr-library-results {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.35rem;
    background-color: #ffffff;
}


.perturbseqr-library-results[open] {
    background-color: #f8f9fa;
}


.perturbseqr-library-summary {
    padding: 0.9rem 1rem;
    cursor: pointer;
    font-weight: 600;
    overflow-wrap: anywhere;
}


.perturbseqr-library-summary:hover {
    color: #0d6efd;
}


.perturbseqr-library-summary::marker {
    color: #6c757d;
}


.perturbseqr-library-body {
    padding: 0 1rem 1rem;
}


.perturbseqr-metadata {
    margin-bottom: 1rem;
}


.perturbseqr-chart-card {
    width: 100%;
    padding: 1rem 0.75rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.35rem;
    background-color: #ffffff;
}


.perturbseqr-chart-wrapper {
    position: relative;
    width: 100%;
    min-height: 360px;
}


.perturbseqr-chart-canvas {
    width: 100% !important;
    height: 100% !important;
}


.perturbseqr-direction-headers {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
    margin-bottom: 0.75rem;
    padding-right: 10px;
    padding-left: 10px;
}


.perturbseqr-direction-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}


.perturbseqr-direction-header strong {
    font-size: 0.9rem;
    font-weight: 600;
}


.perturbseqr-direction-header span {
    color: #6c757d;
    font-size: 0.72rem;
    font-weight: 400;
}


.perturbseqr-direction-down {
    align-items: flex-end;
    padding-right: 1rem;
    color: rgb(193, 70, 70);
    text-align: right;
}


.perturbseqr-direction-up {
    align-items: flex-start;
    padding-left: 1rem;
    color: rgb(49, 141, 187);
    text-align: left;
}


#perturbseqr-results {
    scroll-margin-top: 1rem;
}


/*
 * Print behavior
 */
@media print {
    .download-actions,
    .site-page-nav,
    #navbar-toc,
    #methods-navbar-toc {
        display: none !important;
    }

    .methods-report-card {
        border: 0;
    }

    .methods-section {
        break-inside: avoid;
    }
}


/*
 * Tablet layout
 */
@media (max-width: 991.98px) {
    #navbar-toc,
    #methods-navbar-toc {
        position: static !important;
        max-height: none;
        margin-bottom: 1rem;
        overflow-y: visible;
    }

    .library-result-columns > div + div {
        margin-top: 1.5rem;
    }

    .methods-card-body {
        padding: 1.25rem;
    }
}


/*
 * Mobile layout
 */
@media (max-width: 767.98px) {
    .site-logo,
    .site-logo-link {
        width: 110px;
        min-width: 110px;
        max-width: 110px;
    }

    .home-subtitle {
        font-size: 1.35rem;
    }

    .dataTables_wrapper {
        font-size: 0.78rem;
    }

    .term-genes-table {
        font-size: 0.76rem;
    }

    .term-genes-table td:nth-child(2) {
        width: 45%;
    }

    .term-genes-summary,
    .term-genes-body {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .library-chart-card {
        padding: 0.75rem 0.35rem 0.4rem;
    }

    .library-highest-table,
    .figure-legend,
    .table-legend {
        font-size: 0.72rem;
    }

    .download-actions {
        justify-content: flex-start;
    }

    .methods-subtitle {
        font-size: 1rem;
    }

    .methods-card-body {
        padding: 1rem;
    }

    .methods-section {
        margin-top: 2.5rem;
    }

    .methods-section-first {
        margin-top: 0;
    }

    .methods-section h2 {
        font-size: 1.2rem;
    }

    .methods-section p,
    .methods-library-list {
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .methods-formula {
        padding: 0.85rem;
        font-size: 0.9rem;
    }

    .perturbseqr-library-summary,
    .perturbseqr-library-body {
        padding-right: 0.75rem;
        padding-left: 0.75rem;
    }

    .perturbseqr-chart-card {
        padding: 0.75rem 0.35rem 0.4rem;
    }

    .perturbseqr-direction-header strong {
        font-size: 0.8rem;
    }

    .perturbseqr-direction-header span {
        display: none;
    }

    .perturbseqr-direction-down {
        padding-right: 0.5rem;
    }

    .perturbseqr-direction-up {
        padding-left: 0.5rem;
    }
}


.similarity-toolbar,
.expression-toolbar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}


.similarity-plot {
    position: relative;
    width: 100%;
    height: 560px;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background: #fff;
}


#similarity-neighbors a,
#expression-table a {
    text-decoration: none;
}


/* mean CPM bars with +1 SD whiskers, one row per group */
.expression-chart {
    display: grid;
    grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr) auto;
    column-gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.expression-chart-label {
    grid-column: 1;
    align-self: center;
    text-align: right;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.expression-chart-track {
    grid-column: 2;
    position: relative;
    height: 26px;
}

.expression-chart-value {
    grid-column: 3;
    align-self: center;
    color: #6c757d;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.expression-chart-value b {
    color: #212529;
    font-weight: 600;
}

.expression-chart-grid {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #e9ecef;
}

.expression-chart-bar {
    position: absolute;
    left: 0;
    top: 50%;
    height: 16px;
    min-width: 1px;
    transform: translateY(-50%);
    border-radius: 0 4px 4px 0;
    background: #318dbb;
}

.expression-chart-track:hover .expression-chart-bar {
    background: #24708f;
}

.expression-chart-whisker {
    position: absolute;
    top: 50%;
    height: 1.5px;
    transform: translateY(-50%);
    background: #495057;
}

.expression-chart-whisker::before,
.expression-chart-whisker::after {
    content: "";
    position: absolute;
    top: -5px;
    width: 1.5px;
    height: 11px;
    background: #495057;
}

.expression-chart-whisker::before {
    left: -0.75px;
}

.expression-chart-whisker::after {
    right: -0.75px;
}

/* no end cap where the whisker is cut off at zero */
.expression-chart-whisker.is-clipped::before {
    display: none;
}

.expression-chart-axis {
    grid-column: 2;
    position: relative;
    height: 1.4rem;
    border-top: 1px solid #dee2e6;
}

.expression-chart-tick {
    position: absolute;
    top: 0.2rem;
    transform: translateX(-50%);
    color: #6c757d;
    font-size: 0.75rem;
    white-space: nowrap;
}

.expression-chart-axis-title {
    grid-column: 2;
    text-align: center;
    color: #6c757d;
    font-size: 0.75rem;
}

@media (max-width: 576px) {
    .expression-chart {
        grid-template-columns: minmax(0, 1fr) auto;
        column-gap: 0.5rem;
    }

    .expression-chart-label {
        grid-column: 1 / -1;
        text-align: left;
        padding-top: 0.35rem;
    }

    .expression-chart-track,
    .expression-chart-axis,
    .expression-chart-axis-title {
        grid-column: 1;
    }

    .expression-chart-value {
        grid-column: 2;
    }
}

/* generated abstract at the top of a report */
.snorna-abstract {
    margin: 0.75rem 0 1rem;
    padding: 0.75rem 1rem;
    border-left: 3px solid #0d6efd;
    background: #f8f9fa;
    border-radius: 0.25rem;
}

/* Perturb-Seqr consensus tables, between the section intro and the charts */
.perturbseqr-consensus-table {
    margin-top: 1.5rem;
}

.perturbseqr-consensus-table h5 {
    margin-bottom: 0.25rem;
}

/* expanded row: what each library found in both directions */
.perturbseqr-library-results {
    width: 100%;
    font-size: 0.8rem;
}

.perturbseqr-library-results th,
.perturbseqr-library-results td {
    padding: 0.2rem 0.5rem;
    vertical-align: top;
}

.perturbseqr-library-results tr.opposite-direction {
    background: #fff3cd;
}

/* shown when the wheel is used over a plot that has not been clicked */
.plot-scroll-hint {
    position: absolute;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(33, 37, 41, 0.45);
    color: #fff;
    font-size: 1rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
}

.plot-scroll-hint.visible {
    opacity: 1;
}


/* ChEA-KG transcription factor network, drawn by cheakg_network.js */
.cheakg-frame {
    position: relative;
    max-width: 940px;
    border: 1px solid var(--bs-border-color, #dee2e6);
    border-radius: 8px;
    background: #fff;
}

.cheakg-frame + .download-actions {
    max-width: 940px;
}

.cheakg-canvas {
    width: 100%;
    height: 520px;
}

@media (max-width: 576px) {
    .cheakg-canvas {
        height: 400px;
    }
}

.cheakg-tooltip {
    position: absolute;
    z-index: 5;
    max-width: 320px;
    padding: 0.35rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    color: #212529;
    font-size: 0.8rem;
    pointer-events: none;
}


/* home page graphical abstract (static/graphical_abstract.svg, 5:2) */
.graphical-abstract {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}
