body {
    min-height: 100vh;
    background-color: #f8f9fa;
}

/* GrainGenes banner with logo + links overlaid (single strip, no second gray bar) */
.gg-site-header {
    background-color: #dee2e6;
}

.gg-header-banner-wrap {
    position: relative;
    line-height: 0;
    background-color: #e9ecef;
}

.gg-header-banner-wrap.gg-header-banner-missing {
    min-height: 4.5rem;
}

.gg-header-banner {
    display: block;
    width: 100%;
    height: auto;
    max-height: 88px;
    object-fit: cover;
    object-position: center center;
    vertical-align: top;
}

.gg-header-overlay {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    z-index: 2;
}

.gg-header-overlay-inner {
    width: 100%;
}

/* Contrast on busy banner art */
.gg-header-brand-link {
    color: #212529;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.9), 0 0 12px rgba(255, 255, 255, 0.7);
}

.gg-header-brand-link:hover {
    color: #000;
}

/* Official GG logo from blast is 28×50; keep aspect ratio */
.gg-logo-img {
    width: 28px;
    height: 50px;
    object-fit: contain;
    display: block;
}

.gg-logo-img.gg-logo-fallback {
    width: 40px;
    height: 40px;
    object-fit: contain;
    padding: 4px;
    background: linear-gradient(135deg, #2d6a4f, #1b4332);
    border-radius: 6px;
}

.gg-brand-line-gg {
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.gg-brand-line-service {
    font-size: 1.05rem;
    font-weight: 600;
    margin-top: 0.1rem;
    line-height: 1.2;
}

.gg-header-resource-btns .gg-header-tool-btn {
    font-size: 0.9375rem;
    padding: 0.45rem 1rem;
    font-weight: 500;
    color: #212529 !important;
    background-color: #fff !important;
    border: 1px solid #ced4da !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.gg-header-resource-btns .gg-header-tool-btn:hover {
    background-color: #e9ecef !important;
    border-color: #adb5bd !important;
    color: #000 !important;
}

.gg-dataset-tab-bar {
    background-color: #f1f3f5;
}

/* Species index variant toggle (Pandagma / PanOat, etc.) */
.gg-variant-toggle-bar {
    background: linear-gradient(180deg, #f8f9fa 0%, #eef1f4 100%);
}

.gg-variant-toggle {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.65rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.gg-variant-toggle-btn {
    display: inline-block;
    padding: 0.55rem 1.35rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    color: #495057;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.gg-variant-toggle-btn:hover {
    color: #1b4332;
    background: #e8f5e9;
    border-color: #b7dfc8;
}

.gg-variant-toggle-btn.is-active {
    color: #fff;
    background: linear-gradient(180deg, #40916c 0%, #2d6a4f 100%);
    border-color: #1b4332;
    box-shadow: 0 2px 6px rgba(45, 106, 79, 0.35);
}

.gg-variant-toggle-btn.is-active:hover {
    color: #fff;
    background: linear-gradient(180deg, #52b788 0%, #2d6a4f 100%);
}

/* Expression tab */
.expression-tab-body {
    max-width: 100%;
}

.expression-methods-details {
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
}

.expression-methods-summary {
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    user-select: none;
}

.expression-methods-summary:hover {
    color: #1b4332;
}

.expression-section-label {
    line-height: 1.35;
    font-weight: 500;
}

.expression-gene-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expression-view-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    font-family: var(--bs-font-monospace);
    font-size: 0.8125rem;
    font-weight: 500;
    line-height: 1.25;
    color: #495057;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.expression-view-chip:hover {
    color: #1b4332;
    background: #e8f5e9;
    border-color: #b7dfc8;
}

.expression-view-chip.is-active {
    color: #fff;
    background: linear-gradient(180deg, #40916c 0%, #2d6a4f 100%);
    border-color: #1b4332;
    box-shadow: 0 2px 6px rgba(45, 106, 79, 0.3);
}

.expression-view-chip.is-active:hover {
    background: linear-gradient(180deg, #52b788 0%, #2d6a4f 100%);
}

.expression-compare-pool {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.expression-compare-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.8rem;
    font-family: var(--bs-font-monospace);
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.25;
    color: #495057;
    background: #fff;
    border: 1px dashed #ced4da;
    border-radius: 2rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, border-style 0.15s;
}

.expression-compare-chip:hover {
    color: #1b4332;
    background: #f1f8f4;
    border-color: #52b788;
}

.expression-compare-chip.is-selected {
    color: #1b4332;
    background: linear-gradient(180deg, #f1f8f4 0%, #e8f5e9 100%);
    border-style: solid;
    border-color: #40916c;
}

.expression-compare-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.75rem;
    border-radius: 50%;
    color: #6c757d;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.expression-compare-chip.is-selected .expression-compare-chip-remove {
    opacity: 1;
}

.expression-compare-chip.is-selected:hover .expression-compare-chip-remove {
    color: #842029;
    background: rgba(220, 53, 69, 0.12);
}

.expression-compare-order-wrap {
    padding: 0.65rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
}

.expression-compare-order {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-height: 2.25rem;
}

.expression-compare-order-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.65rem;
    font-family: var(--bs-font-monospace);
    font-size: 0.78rem;
    font-weight: 500;
    color: #1b4332;
    background: #fff;
    border: 1px solid #b7dfc8;
    border-radius: 0.4rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.15s, border-color 0.15s, opacity 0.15s;
}

.expression-compare-order-chip:active {
    cursor: grabbing;
}

.expression-compare-order-chip.is-dragging {
    opacity: 0.45;
}

.expression-compare-order-chip.is-drag-over {
    border-color: #40916c;
    box-shadow: 0 0 0 2px rgba(64, 145, 108, 0.25);
}

.expression-compare-order-grip {
    color: #6c757d;
    font-size: 0.85rem;
}

.expression-compare-order-arrow {
    color: #adb5bd;
    font-size: 0.7rem;
    padding: 0 0.1rem;
}

.expression-compare-scale-toggle {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 0.35rem 1rem;
    padding: 0.5rem 0.65rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
}

.expression-compare-scale-toggle .form-check-input {
    cursor: pointer;
}

.expression-compare-scale-toggle .form-check-label {
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
}

.expression-compare-scale-hint {
    flex: 1 1 100%;
    text-align: left;
    line-height: 1.35;
}

.expression-compare-plot {
    min-height: 0;
}

.expression-plot-card {
    border: 1px solid #dee2e6;
    border-radius: 0.65rem;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.expression-plot-card-header {
    padding: 0.55rem 0.85rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #343a40;
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
    border-bottom: 1px solid #e9ecef;
}

.expression-plot-card-body {
    padding: 0.5rem;
}

.alert-expression-unavailable {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffda6a;
}

.gg-footer-logo {
    opacity: 0.85;
    max-height: 36px;
    width: auto;
    object-fit: contain;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    max-height: 300px;
    overflow-y: auto;
}

.suggestions-dropdown.show {
    display: block;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    text-decoration: none;
    color: #212529;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.15s;
}

.suggestion-item:hover {
    background-color: #e9ecef;
    color: #212529;
}

.input-sanitize-warn {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    margin-bottom: 6px;
    max-width: 18rem;
    padding: 0.4rem 0.55rem;
    font-size: 0.75rem;
    line-height: 1.3;
    color: #d35400;
    background: #fff;
    border: 1px solid #f0ad4e;
    border-radius: 0.35rem;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
    z-index: 1080;
    text-align: left;
    pointer-events: none;
}

.input-sanitize-warn::after {
    content: '';
    position: absolute;
    left: 12px;
    top: 100%;
    border: 5px solid transparent;
    border-top-color: #f0ad4e;
}

.card {
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.nav-tabs .nav-link {
    color: #6c757d;
}

.nav-tabs .nav-link.active {
    font-weight: 600;
    color: #2d6a4f;
    border-color: #dee2e6 #dee2e6 #fff;
}

/* Pangene detail page: use most of the Bootstrap container width (avoid oversized side gutters) */
main.pangene-detail-wide.container {
    max-width: min(1600px, 96vw);
}

.tab-content {
    background: #fff;
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0.75rem 16px 16px;
}

#pangeneTabContent > .tab-pane > *:first-child {
    margin-top: 0;
}

.table {
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #6c757d;
}

.font-monospace {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* Dataset tabs (Wheat | Barley), centered below navbar */
.dataset-tabs {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
}
.dataset-tabs .nav-link {
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    padding: 0.65rem 1.5rem;
    font-size: 1.05rem;
}
.dataset-tabs .nav-link:hover {
    color: #2d6a4f;
    border-bottom-color: transparent;
}
.dataset-tabs .nav-link.active {
    color: #2d6a4f;
    font-weight: 600;
    background: transparent;
    border-bottom-color: #2d6a4f;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

footer {
    background: #fff;
}

/* Wheat results: local synteny SVG */
.synteny-wrap {
    overflow-x: auto;
    max-width: 100%;
}

.synteny-svg {
    display: block;
    min-width: 520px;
    font-family: system-ui, sans-serif;
}

.synteny-svg-equal {
    max-height: 120px;
}

/* Wheat pangene detail: cluster / pan-gene picker */
.wheat-cluster-collapse-head {
    cursor: pointer;
    user-select: none;
}

.wheat-cluster-collapse-head:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.pangene-cluster-card {
    cursor: pointer;
    border: 2px solid #dee2e6 !important;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pangene-cluster-card:hover {
    border-color: #adb5bd !important;
}

.pangene-cluster-card.pangene-cluster-selected {
    background-color: #d4edda !important;
    border-color: #7ab88c !important;
}

.pangene-cluster-card:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.pangene-cluster-open {
    position: relative;
    z-index: 2;
}

.pangene-cluster-legend-swatch {
    width: 1rem;
    height: 0.65rem;
    vertical-align: middle;
    background: #d4edda;
    border-color: #7ab88c !important;
}

.wheat-synteny-stack .synteny-track-block:last-child {
    margin-bottom: 0 !important;
}

/* Pangene detail: synteny — 3 text columns (no table chrome) + aligned arrow strip */
.wheat-synteny-row {
    display: grid;
    grid-template-columns: minmax(1.5rem, auto) minmax(5.5rem, 0.9fr) minmax(7rem, 1.1fr) minmax(8rem, 1fr) minmax(140px, 2.4fr);
    gap: 0.35rem 0.75rem;
    align-items: center;
    margin-bottom: 0.35rem;
    min-height: 0;
}

.synteny-remove-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

.synteny-meta-cell {
    min-width: 0;
    font-size: 0.875rem;
    line-height: 1.3;
}

.wheat-synteny-last {
    min-width: 0;
}

.wheat-synteny-svg {
    min-width: 0;
    line-height: 0;
}

.wheat-synteny-svg .synteny-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 44px;
}

/* Collinearity: HTML track cards + overlay SVG connectors */
.micro-collinearity-wrap {
    overflow-x: auto;
}

.micro-synteny-window-input {
    width: 4.35rem;
}

.micro-coll-root {
    min-width: min(100%, 520px);
}

/* Connectors sit behind gene arrows but above page background */
.micro-coll-connectors-svg {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

.micro-coll-cards-stack {
    position: relative;
    z-index: 2;
}

.micro-coll-track-row {
    cursor: default;
}

.micro-coll-card-grip {
    cursor: grab;
}

.micro-coll-card-grip:active {
    cursor: grabbing;
}

.micro-coll-card-dragging {
    opacity: 0.55;
}

.micro-coll-label-rail {
    width: 11.25rem;
    flex: 0 0 11.25rem;
    border-bottom: 1px solid #dee2e6;
}

.micro-coll-toolbar-row,
.micro-coll-toolbar {
    line-height: 1;
    min-height: 1.5rem;
    align-items: center !important;
}

.micro-coll-toolbar .btn,
.micro-coll-toolbar .micro-coll-card-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.micro-coll-toolbar .btn.btn-sm {
    min-height: 1.3rem;
    line-height: 1.15;
    padding-top: 0;
    padding-bottom: 0;
}

.micro-coll-toolbar .micro-coll-card-grip {
    font-size: 0.9rem;
    line-height: 1;
    margin-right: 0.1rem;
}

.micro-coll-toolbar-sep {
    display: inline-block;
    width: 1px;
    height: 0.95rem;
    margin: 0 0.2rem;
    background: linear-gradient(to bottom, transparent, #adb5bd 18%, #adb5bd 82%, transparent);
    flex-shrink: 0;
    align-self: center;
}

.micro-coll-flank-inline {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    white-space: nowrap;
    gap: 0;
}

.micro-coll-track-row.micro-coll-row-busy .micro-coll-strip-area {
    opacity: 0.55;
    pointer-events: none;
}

.micro-coll-track-row.micro-coll-row-busy .micro-coll-win-btn {
    pointer-events: none;
}

.micro-coll-flank-label {
    font-size: 0.68rem;
    line-height: 1;
    padding: 0 0.1rem;
}

.micro-coll-win-btn {
    font-size: 0.75rem;
    min-width: 1.15rem;
    padding: 0 0.25rem !important;
    line-height: 1.2;
}

.micro-collinearity-wrap.micro-coll-plot-busy {
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

#wheat-synteny-container.synteny-plot-busy {
    opacity: 0.72;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.micro-coll-cards-stack .micro-coll-track-row:last-child .micro-coll-label-rail {
    border-bottom: none;
}

.micro-coll-strip-area {
    border-bottom: none;
}

.micro-coll-strip-harness {
    min-height: 52px;
}

.micro-coll-strip-genomic {
    min-height: 52px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.micro-coll-strip-equal {
    min-height: 52px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.micro-coll-inner-rail-fill {
    position: relative;
    z-index: 0;
    min-height: 48px;
}

.micro-coll-region-backdrop {
    position: absolute;
    top: calc(50% + 6px);
    left: 0;
    transform: translateY(-50%);
    height: 8px;
    background: rgba(52, 58, 64, 0.45);
    border-radius: 5px;
    z-index: 0;
    pointer-events: none;
    box-sizing: border-box;
}

.micro-coll-region-backdrop-equal {
    left: 0;
    width: 100%;
}

.micro-coll-gene {
    position: relative;
    z-index: 1;
}

.micro-coll-gene-stack {
    justify-content: center;
}

.micro-coll-focal-slot {
    flex-shrink: 0;
    min-height: 14px;
    height: 14px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
}

.micro-coll-gene-svg {
    display: block;
}

.micro-coll-gene-body {
    border-radius: 0;
    box-sizing: border-box;
    border: none;
    flex-shrink: 0;
    filter:
        drop-shadow(1.2px 0 0 #000)
        drop-shadow(-1.2px 0 0 #000)
        drop-shadow(0 1.2px 0 #000)
        drop-shadow(0 -1.2px 0 #000)
        drop-shadow(0.75px 0.75px 0 #000)
        drop-shadow(-0.75px -0.75px 0 #000)
        drop-shadow(0.75px -0.75px 0 #000)
        drop-shadow(-0.75px 0.75px 0 #000);
}

.micro-coll-gene-body-fwd {
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.micro-coll-gene-body-rev {
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}

.micro-coll-focal-spacer {
    min-height: 0.35rem;
}

.micro-coll-gene-label {
    max-width: 100%;
    font-size: 0.65rem;
    line-height: 1.15;
}

.micro-coll-ellipsis {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    font-size: 0.7rem;
}

.micro-coll-reverse-btn.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #fff;
}

.micro-coll-plot {
    width: 100%;
}

.synteny-legend-swatch {
    width: 12px;
    height: 12px;
}

/* Immediate JS tooltip over synteny arrows (pointer-events none so cursor stays on SVG) */
.synteny-plot-tooltip {
    position: fixed;
    z-index: 1080;
    max-width: min(26rem, 92vw);
    padding: 0.45rem 0.55rem;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #f8f9fa;
    background: rgba(33, 37, 41, 0.96);
    border-radius: 6px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.synteny-plot-tooltip .cross-ann-stack {
    color: #e9ecef;
}

.synteny-plot-tooltip .cross-ann-desc-text {
    color: #dee2e6 !important;
}

.synteny-plot-tooltip .text-muted {
    color: #adb5bd !important;
}

.wheat-synteny-container .synteny-seg,
.micro-collinearity-container .synteny-seg {
    cursor: pointer;
}

/* Gene sequences modal (CDS / protein preview + copy) */
.gene-seq-pre {
    max-height: 5.75rem;
    overflow: auto;
    font-size: 0.72rem;
    line-height: 1.35;
    margin-bottom: 0;
    padding: 0.35rem 0.5rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    word-break: break-all;
    white-space: pre-wrap;
}

.gene-seq-gg-panel .gene-seq-gg-actions .btn {
  white-space: nowrap;
}

.gene-seq-copy-actions {
    margin-top: 0.5rem;
}

/* Pangene detail — Genes tab: click rows / A-B-D cells to include (green) or exclude (white); ref = yellow */
.gene-sel-row {
    cursor: pointer;
}

.gene-sel-row .gene-ref-cell {
    cursor: default;
}

.gene-sel-on td:not(.gene-ref-cell) {
    background-color: #d8f3dc !important;
}

.gene-sel-off td:not(.gene-ref-cell) {
    background-color: #fff !important;
}

.gene-sel-row.gene-sel-ref td {
    background-color: #fff3cd !important;
}

.gene-sel-row.gene-sel-ref.gene-sel-off td:not(.gene-ref-cell) {
    background-color: #ffe8a6 !important;
}

/* Genes tab — copy gene ID without toggling include/exclude */
.gene-id-copy-btn {
    font-size: 0.7rem;
    color: #212529 !important;
    opacity: 0.72;
    text-decoration: none !important;
    min-width: 1rem;
}

.gene-id-copy-btn:hover,
.gene-id-copy-btn:focus {
    color: #000 !important;
    opacity: 1;
}

/* Genes tab — external DB links (next to clipboard) */
.gene-db-links-btn {
    font-size: 0.7rem;
    color: #495057 !important;
    opacity: 0.85;
    text-decoration: none !important;
    min-width: 1rem;
}

.gene-db-links-btn:hover,
.gene-db-links-btn:focus {
    color: #212529 !important;
    opacity: 1;
}

.gene-seq-btn {
    font-size: 0.7rem;
    color: #495057 !important;
    opacity: 0.85;
    text-decoration: none !important;
    min-width: 1rem;
}

.gene-seq-btn:hover,
.gene-seq-btn:focus {
    color: #212529 !important;
    opacity: 1;
}

/* Genes tab — sortable column headers */
#genes-panel th.gene-sort-th {
    cursor: pointer;
    white-space: nowrap;
}
#genes-panel th.gene-sort-th:hover {
    background-color: rgba(45, 106, 79, 0.08);
}

/* Genes tab — tighter list */
#genes-panel .gene-list-click.table > :not(caption) > * > * {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
    vertical-align: middle;
}

#genes-panel .gene-list-click .gene-ref-cell {
    width: 2rem;
    padding-right: 0.25rem;
}

#genes-panel .gene-list-click .form-check-input {
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0;
}

.gene-subgenome-grid td {
    vertical-align: top;
    min-width: 5.5rem;
}

/* Match table-sm / Genes list typography (avoid extra-small grid-only fonts) */
.gene-subgenome-grid .gene-slot-grid {
    padding: 4px 6px;
    border-radius: 4px;
    margin-bottom: 3px;
}

.gene-subgenome-grid .gene-slot-grid:last-child {
    margin-bottom: 0;
}

.gene-subgenome-grid .gene-grid-radio {
    width: 0.85rem;
    height: 0.85rem;
    margin-top: 0 !important;
}

.gene-subgenome-grid thead th {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

/* Diploid / single-column Chr layout: keep grid readable without stretching full viewport */
.gene-subgenome-grid-narrow {
    max-width: 52rem;
}

.gene-col-toggles .gene-col-icon-btn {
    width: 1.45rem;
    height: 1.45rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.gene-col-toggles .gene-col-icon-btn i {
    font-size: 0.75rem;
}

.gene-slot {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 4px 6px;
    text-align: left;
    transition: filter 0.12s ease, box-shadow 0.12s ease;
}

.gene-slot:not(.gene-slot-disabled):hover {
    filter: brightness(0.97);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.gene-slot-on {
    background-color: #d8f3dc;
}

.gene-slot-off {
    background-color: #fff;
    opacity: 0.92;
}

.gene-slot-ref {
    box-shadow: inset 0 0 0 2px #ffc107;
    background-color: #fff3cd !important;
}

.gene-slot-ref.gene-slot-off {
    background-color: #ffe8a6 !important;
}

.gene-slot-disabled {
    cursor: not-allowed;
    opacity: 0.6;
    background-color: #f1f3f5;
}

.gene-legend-swatch {
    display: inline-block;
    width: 1rem;
    height: 0.65rem;
    border-radius: 3px;
    border: 1px solid #adb5bd;
    vertical-align: middle;
}

.gene-legend-swatch.on {
    background: #d8f3dc;
}

.gene-legend-swatch.ref {
    background: #fff3cd;
    box-shadow: inset 0 0 0 1px #ffc107;
}

.pangene-gene-actions-legend.gene-legend-grid-mode .gene-legend-row-actions {
    padding-left: 4.85rem;
}

/* Expression tab: PlantApp CTA label beside download buttons */
.expression-plantapp-banner {
    row-gap: 0.5rem;
}
.expression-plantapp-lead {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--bs-secondary-color);
    margin-right: 0.25rem;
}

/* About PanViewer documentation page */
.about-page-layout {
    scroll-behavior: smooth;
}
.about-sidebar {
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}
.about-sidebar .nav-link {
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    padding: 0.35rem 0.75rem;
    border-left: 2px solid transparent;
    border-radius: 0;
}
.about-sidebar .nav-link:hover,
.about-sidebar .nav-link:focus {
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
}
.about-sidebar .nav-link.active {
    color: var(--bs-primary);
    border-left-color: var(--bs-primary);
    font-weight: 600;
    background: transparent;
}
.about-doc section {
    scroll-margin-top: 1.5rem;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}
.about-doc section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}
.about-doc h2 {
    font-size: 1.35rem;
    margin-bottom: 0.75rem;
}
.about-doc h3 {
    font-size: 1.05rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}
.about-screenshot-placeholder {
    border: 2px dashed var(--bs-border-color);
    border-radius: 0.5rem;
    background: var(--bs-tertiary-bg);
    min-height: 10rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
    font-size: 0.875rem;
    margin: 1rem 0;
}
.about-figure {
    margin: 1.25rem 0 1.5rem;
}
.about-screenshot {
    display: block;
    max-width: 100%;
    height: auto;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.about-figure-caption {
    font-size: 0.875rem;
    color: var(--bs-secondary-color);
    margin-top: 0.4rem;
    margin-bottom: 0;
}

/* Expression tab (Plotly): left-align hover text; allow wrapped lines from JS <br> */
.js-plotly-plot .hovertext,
.js-plotly-plot .hovertext > * {
    text-align: left !important;
    white-space: normal !important;
    max-width: min(420px, 92vw);
}
