/*
 * Set analysis page
 */
.set-input {
    max-width: 760px;
    margin: 0 auto;
}


.set-names {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.875rem;
}


.set-input-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.5rem;
}


.set-input-actions,
.set-results-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}


.set-input-actions {
    margin-top: 1.5rem;
}


.set-results-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}


.set-results-heading > div:first-child {
    flex: 1 1 26rem;
    min-width: 0;
}


.set-title {
    margin-bottom: 0.25rem;
    font-size: 1.625rem;
    font-weight: 500;
}


.set-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}


.set-chips a,
.set-chips button {
    padding: 0.0625rem 0.4375rem;
    border: 0;
    border-radius: 999px;
    background: #e7f1f7;
    color: #1f6f97;
    font-size: 0.75rem;
    text-decoration: none;
}


.set-chips button {
    background: none;
    color: #495057;
    text-decoration: underline;
}


/* sticky bar: direction switch and section links */
.set-sticky {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem 1rem;
    margin: 1.25rem -0.75rem 0;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid #e9ecef;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(4px);
}


.set-direction {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}


.set-direction-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
}


.set-segmented {
    display: inline-flex;
    padding: 0.1875rem;
    border-radius: 999px;
    background: #f1f3f5;
}


.set-segmented button {
    padding: 0.25rem 0.875rem;
    border: 0;
    border-radius: 999px;
    background: none;
    color: #495057;
    font-size: 0.8125rem;
    transition: background 0.15s, color 0.15s;
}


.set-segmented button:hover {
    color: #212529;
}


.set-segmented button[aria-pressed="true"] {
    background: #fff;
    color: #1f6f97;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}


.set-sticky-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}


.set-sticky-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.375rem;
    color: #495057;
    font-size: 0.8125rem;
    text-decoration: none;
}


.set-sticky-links a:hover,
.set-sticky-links a.is-active {
    background: #e7f1f7;
    color: #1f6f97;
}


.set-step-number {
    display: inline-flex;
    flex: none;
    justify-content: center;
    align-items: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: #318dbb;
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1;
}


.set-step-number-lg {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.875rem;
}


/* summary: the workflow as connected cards */
.set-pipeline {
    display: grid;
    grid-template-columns:
        minmax(10rem, 0.9fr) 1.75rem minmax(12rem, 1fr) 1.75rem minmax(18rem, 1.7fr);
    align-items: center;
    margin-top: 1.5rem;
}


.set-stage {
    display: block;
    min-width: 0;
    padding: 0.875rem 1rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    color: #212529;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}


a.set-stage:hover {
    border-color: #318dbb;
    color: #212529;
    box-shadow: 0 2px 8px rgba(49, 141, 187, 0.15);
}


.set-stage-input {
    background: #f8f9fa;
}


.set-stage-genes {
    border-color: #9cc8de;
    background: #f5fafd;
}


.set-stage-kicker {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #495057;
}


.set-stage-icon {
    color: #318dbb;
}


.set-stage-tool {
    margin-left: auto;
    padding: 0.0625rem 0.4375rem;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background: #fff;
    color: #6c757d;
    font-size: 0.6875rem;
    font-weight: 400;
    white-space: nowrap;
}


.set-stage-stat {
    margin-top: 0.375rem;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.3;
}


.set-stage-detail {
    font-size: 0.8125rem;
    color: #6c757d;
}


.set-stage-top {
    margin: 0.375rem 0 0;
    padding-left: 1.125rem;
    font-size: 0.8125rem;
    color: #343a40;
}


.set-stage-top li {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.set-stage-top li::marker {
    color: #adb5bd;
}


.set-stage-pairs {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
}


.set-stage-pairs > div {
    display: flex;
    gap: 0.5rem;
}


.set-stage-pairs dt {
    flex: none;
    width: 2.75rem;
    font-weight: 400;
    color: #6c757d;
}


.set-stage-pairs dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.set-pipeline .is-muted {
    color: #6c757d;
}


.set-pipeline ol.is-muted {
    padding-left: 0;
    list-style: none;
}


/* an arrow between stages */
.set-connector {
    position: relative;
    height: 2px;
    background: #9cc8de;
}


.set-connector::after {
    content: "";
    position: absolute;
    top: -4px;
    right: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid #9cc8de;
}


/* the related genes branch into three analyses */
.set-stage-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-left: 1.25rem;
}


.set-stage-group > .set-stage {
    position: relative;
}


.set-stage-group > .set-stage::before,
.set-stage-group > .set-stage::after {
    content: "";
    position: absolute;
    left: calc(-1.25rem - 1px);
    background: #9cc8de;
}


/* stub into each card */
.set-stage-group > .set-stage::before {
    top: 50%;
    width: 1.25rem;
    height: 2px;
}


/* the vertical line, from the first card's middle to the last's */
.set-stage-group > .set-stage::after {
    top: 0;
    bottom: -0.75rem;
    width: 2px;
}


.set-stage-group > .set-stage:first-child::after {
    top: 50%;
}


.set-stage-group > .set-stage:last-child::after {
    bottom: 50%;
}


.set-pipeline-note {
    margin-top: 0.75rem;
}


.set-spinner {
    width: 0.875rem;
    height: 0.875rem;
    border-width: 0.125em;
    margin-right: 0.375rem;
    color: #318dbb;
    vertical-align: -0.125em;
}


@media (max-width: 991.98px) {
    .set-pipeline {
        grid-template-columns: minmax(0, 1fr);
    }

    .set-connector {
        width: 2px;
        height: 1.25rem;
        margin-left: 1.5rem;
    }

    .set-connector::after {
        top: auto;
        right: -4px;
        bottom: 0;
        border-top: 7px solid #9cc8de;
        border-right: 5px solid transparent;
        border-bottom: 0;
        border-left: 5px solid transparent;
    }

    .set-stage-group {
        padding-left: 2.75rem;
    }

    .set-stage-group > .set-stage::before,
    .set-stage-group > .set-stage::after {
        left: calc(-1.25rem - 1px);
    }

    .set-stage-group > .set-stage:first-child::after {
        top: -0.75rem;
    }

    .set-stage-group {
        margin-top: -0.75rem;
        padding-top: 0.75rem;
    }

    .set-sticky-links {
        display: none;
    }
}


.set-heatmap-figure {
    margin: 0 0 1.5rem;
}


.set-heatmap-scroll {
    max-width: 100%;
    overflow-x: auto;
}


.set-heatmap {
    border-collapse: separate;
    border-spacing: 2px;
    font-size: 0.75rem;
}


.set-heatmap th {
    font-weight: 400;
    color: #495057;
    white-space: nowrap;
}


.set-heatmap thead th {
    height: 6.5rem;
    padding: 0 0 0.25rem;
    vertical-align: bottom;
}


.set-heatmap thead th span {
    display: inline-block;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}


.set-heatmap tbody th {
    padding-right: 0.5rem;
    text-align: right;
}


.set-heatmap td {
    width: 1.125rem;
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0;
    border-radius: 2px;
}


.set-heatmap td:hover {
    outline: 2px solid #212529;
}


.set-heatmap td.is-missing,
.set-heatmap-missing {
    background: repeating-linear-gradient(
        45deg, #e9ecef, #e9ecef 3px, #fff 3px, #fff 5px
    );
}


.set-heatmap-key {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #495057;
}


.set-heatmap-ramp {
    width: 8rem;
    height: 0.625rem;
    border-radius: 2px;
    background: linear-gradient(90deg, #2a78d6, #f0efec, #e34948);
}


.set-heatmap-missing {
    width: 0.75rem;
    height: 0.75rem;
    margin-left: 0.75rem;
    border-radius: 2px;
}


.set-row-weak td {
    color: #6c757d;
}


.set-step {
    margin-top: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: #fff;
    scroll-margin-top: 4.5rem;
}


.set-pipeline-note + .set-step {
    margin-top: 2.5rem;
}


.set-step-header {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f3f5;
}


.set-step-header .set-stage-tool {
    font-size: 0.75rem;
}


@media (max-width: 575.98px) {
    .set-step {
        padding: 1rem;
    }
}


.set-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    margin-bottom: 1rem;
}


.set-toolbar button {
    padding: 0.25rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    background: #fff;
    color: #495057;
    font-size: 0.8125rem;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}


.set-toolbar button:hover {
    border-color: #318dbb;
    color: #1f6f97;
}


.set-toolbar button[aria-pressed="true"] {
    border-color: #318dbb;
    background: #318dbb;
    color: #fff;
}


.set-chart {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}


.set-chart-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
}


.set-chart-label {
    flex: 1 1 21rem;
    min-width: 0;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}


.set-chart-value {
    display: flex;
    flex: 3 1 22rem;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}


.set-chart-track {
    flex: 1;
    height: 1rem;
    background: #f1f3f5;
}


.set-chart-bar {
    height: 100%;
    background: #adb5bd;
}


.set-chart-bar.is-significant {
    background: #318dbb;
}


.set-chart-number {
    width: 5.75rem;
    color: #495057;
    font-size: 0.8125rem;
}


.set-result-badge {
    padding: 0.125rem 0.5rem;
    border-radius: 0.1875rem;
    font-size: 0.78rem;
    white-space: nowrap;
}


.set-result-badge.is-significant {
    background: #d1e7dd;
    color: #0a3622;
}


.set-result-badge.is-weak {
    background: #e9ecef;
    color: #495057;
}
