:root {
    --atlas-primary: #1a3a5c;   /* deep navy */
    --atlas-accent: #c8102e;    /* NB red */
    --atlas-teal: #2c7a7b;
    --atlas-gold: #d4a017;
    --atlas-light: #f0f4f8;
    --atlas-border: #d1dae3;
}

body {
    font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #fafbfd;
    color: #1a1a1a;
    font-size: 0.92rem;
}

/* Navbar */
.atlas-nav {
    background: linear-gradient(135deg, var(--atlas-primary) 0%, #0f253a 100%);
    padding: 0.65rem 1.5rem;
    box-shadow: 0 2px 12px rgba(26,58,92,0.18);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
/* Brand: icon badge + two-line text */
.atlas-nav .navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0;
}
.brand-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--atlas-accent) 0%, #e0294a 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 3px 10px rgba(200,16,46,0.35);
    flex-shrink: 0;
}
.brand-badge svg { width: 22px; height: 22px; }
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}
.brand-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}
.brand-subtitle {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.55);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 500;
}
/* Nav links: underline animation on hover */
.atlas-nav .nav-link {
    font-weight: 500;
    color: rgba(255,255,255,0.78) !important;
    padding: 0.55rem 1rem !important;
    border-radius: 6px;
    position: relative;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
}
.atlas-nav .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0.15rem;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--atlas-accent);
    transition: width 0.25s ease, left 0.25s ease;
    border-radius: 1px;
}
.atlas-nav .nav-link:hover {
    color: #fff !important;
    background: transparent;
}
.atlas-nav .nav-link:hover::after {
    width: 60%;
    left: 20%;
}
.atlas-nav .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.08);
}
.atlas-nav .nav-link.active::after {
    width: 60%;
    left: 20%;
}

/* Main content */
.main-content {
    padding: 1.5rem 2.5rem;
    position: relative;
    z-index: 1;
}

/* Subtle DNA double-helix background — fixed SVG, behind all content.
   The SVG itself defines the helix pattern + fade gradient; this rule just
   pins it to the viewport and keeps it non-interactive. */
.bio-bg {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    /* Overall opacity kept low so the pattern is a faint texture, not focal */
    opacity: 0.32;
}

/* Hero section — clean, minimal, no background */
.hero {
    background: transparent;
    color: var(--atlas-primary);
    padding: 3rem 1rem 2.2rem;
    margin-bottom: 2.5rem;
    text-align: center;
    border-bottom: 1px solid var(--atlas-border);
}
.hero-eyebrow {
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--atlas-accent);
    margin-bottom: 1rem;
}
.hero-title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
    margin-bottom: 0.85rem;
    color: var(--atlas-primary);
}
.hero-tagline {
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--atlas-teal);
    margin-bottom: 1rem;
    line-height: 1.4;
}
.hero-desc {
    font-size: 1rem;
    color: #5a6878;
    max-width: 780px;
    margin: 0 auto 2rem;
    line-height: 1.55;
}

/* Hero-integrated search bar */
.hero-search {
    display: flex;
    gap: 0.4rem;
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    border: 2px solid var(--atlas-primary);
    border-radius: 999px;           /* pill-shaped container to match button */
    padding: 0.35rem 0.4rem 0.35rem 0.5rem;
    box-shadow: 0 6px 24px rgba(26,58,92,0.10);
    transition: box-shadow 0.25s, border-color 0.25s;
}
.hero-search:focus-within {
    border-color: var(--atlas-accent);
    box-shadow: 0 8px 30px rgba(200,16,46,0.18);
}
.hero-search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}
.hero-search-icon {
    position: absolute;
    left: 0.85rem;
    color: #9aa7b5;
    display: inline-flex;
}
.hero-search-input {
    width: 100%;
    border: none;
    outline: none;
    padding: 0.65rem 0.85rem 0.65rem 2.5rem;
    font-size: 1rem;
    background: transparent;
    color: var(--atlas-primary);
}
.hero-search-btn {
    border: none;
    background: linear-gradient(135deg, var(--atlas-primary) 0%, #2c5278 100%);
    color: #fff;
    padding: 0.7rem 1.8rem;
    border-radius: 999px;          /* full pill shape */
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(26,58,92,0.28);
    transition: all 0.25s ease;
}
.hero-search-btn:hover {
    background: linear-gradient(135deg, var(--atlas-accent) 0%, #e0294a 100%);
    box-shadow: 0 6px 20px rgba(200,16,46,0.35);
    transform: translateY(-1px);
}
.hero-search-btn:active { transform: translateY(0); }
.hero-search-btn-arrow {
    transition: transform 0.25s ease;
    font-weight: 700;
}
.hero-search-btn:hover .hero-search-btn-arrow {
    transform: translateX(3px);
}

/* Example search tags (clickable pills) */
.hero-tags {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.2rem;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}
.hero-tags-label {
    font-size: 0.82rem;
    color: #8a96a3;
    font-weight: 500;
    margin-right: 0.3rem;
}
.hero-tag {
    background: #fff;
    border: 1px solid var(--atlas-border);
    color: var(--atlas-primary);
    padding: 0.28rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.2px;
}
.hero-tag:hover {
    background: var(--atlas-primary);
    border-color: var(--atlas-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(26,58,92,0.2);
}
/* Region tag (longer) — slightly different style to distinguish */
.hero-tag-region {
    font-size: 0.76rem;
    color: var(--atlas-teal);
    border-color: #b8d4d4;
}
.hero-tag-region:hover {
    background: var(--atlas-teal);
    border-color: var(--atlas-teal);
    color: #fff;
    box-shadow: 0 3px 10px rgba(44,122,123,0.25);
}

/* ===== Home page sections (rhythm & spacing) ===== */
.home-section {
    margin-bottom: 3rem;
    padding: 0 0.25rem;
}
.section-header {
    margin-bottom: 1rem;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    border-bottom: 2px solid var(--atlas-light);
    padding-bottom: 0.6rem;
}
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--atlas-primary);
    margin: 0;
    letter-spacing: -0.2px;
}
.section-subtitle {
    font-size: 0.92rem;
    color: #6c757d;
    margin: 0;
    line-height: 1.45;
    flex: 1 1 380px;
    min-width: 0;
}

/* Key stats — borderless, big numbers, dividers between */
.key-stats {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0;
    padding: 2rem 1.5rem;
    background: var(--atlas-light);
    border-radius: 14px;
}
.key-stat {
    flex: 1 1 220px;
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    transition: transform 0.2s ease;
}
.key-stat:hover { transform: translateY(-2px); }
.key-stat-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}
.key-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(26,58,92,0.18);
}
/* Per-stat theme colors (gradient badges) */
.key-stat-icon-navy {
    background: linear-gradient(135deg, #1a3a5c 0%, #2c5278 100%);
    box-shadow: 0 4px 12px rgba(26,58,92,0.25);
}
.key-stat-icon-teal {
    background: linear-gradient(135deg, #2c7a7b 0%, #3a9a9b 100%);
    box-shadow: 0 4px 12px rgba(44,122,123,0.25);
}
.key-stat-icon-red {
    background: linear-gradient(135deg, #c8102e 0%, #e0294a 100%);
    box-shadow: 0 4px 12px rgba(200,16,46,0.25);
}
.key-stat-icon-gold {
    background: linear-gradient(135deg, #d4a017 0%, #e8b830 100%);
    box-shadow: 0 4px 12px rgba(212,160,23,0.25);
}
.key-stat-icon svg {
    width: 24px;
    height: 24px;
    stroke-width: 2;
}
.key-stat-number {
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--atlas-primary);
    line-height: 1.05;
    letter-spacing: -0.5px;
}
.key-stat-label {
    font-size: 0.88rem;
    color: var(--atlas-primary);
    margin-top: 0.25rem;
    font-weight: 600;
    opacity: 0.75;
}
.key-stat-divider {
    width: 1px;
    background: var(--atlas-border);
    align-self: stretch;
    margin: 0.5rem 0;
}

/* Chart cards (replaces detail-section on home page) */
.chart-card {
    background: #fff;
    border: 1px solid var(--atlas-border);
    border-radius: 14px;
    padding: 1.5rem;
    height: 100%;
    transition: box-shadow 0.2s;
}
.chart-card:hover {
    box-shadow: 0 4px 18px rgba(26,58,92,0.08);
}
.chart-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--atlas-primary);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--atlas-light);
}
.chart-card-desc {
    font-size: 0.85rem;
    color: #6c757d;
    margin: -0.25rem 0 0.75rem;
    line-height: 1.45;
}

/* Validation strip — horizontal band, not separate cards */
.validation-strip {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid var(--atlas-border);
    border-radius: 14px;
    padding: 1.5rem;
    gap: 0;
}
.validation-item {
    flex: 1 1 220px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1.2rem;
    justify-content: center;
    transition: transform 0.2s ease;
}
.validation-item:hover { transform: translateY(-2px); }
.validation-badge {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}
.validation-badge svg { width: 22px; height: 22px; stroke-width: 2; }
.validation-badge-green {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 3px 10px rgba(39,174,96,0.25);
}
.validation-badge-red {
    background: linear-gradient(135deg, #c8102e 0%, #e0294a 100%);
    box-shadow: 0 3px 10px rgba(200,16,46,0.25);
}
.validation-badge-blue {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    box-shadow: 0 3px 10px rgba(41,128,185,0.25);
}
.validation-icon {
    display: inline-flex;
    flex-shrink: 0;
}
.validation-number {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--atlas-primary);
}
.validation-label {
    font-size: 0.88rem;
    color: var(--atlas-primary);
    margin-top: 0.25rem;
    font-weight: 600;
    opacity: 0.75;
}
.validation-divider {
    width: 1px;
    background: var(--atlas-border);
    align-self: stretch;
    margin: 0.5rem 0;
}

/* Entry cards — flat style: left accent bar + tinted bg, no heavy border */
.entry-card {
    display: block;
    background: var(--atlas-light);
    border: none;
    border-left: 4px solid var(--atlas-border);
    border-radius: 8px;
    padding: 1rem 1.4rem;
    text-decoration: none !important;
    color: inherit;
    transition: all 0.2s ease;
    height: 100%;
    position: relative;
}
.entry-card:hover {
    background: #fff;
    transform: translateX(3px);
}
.entry-card-navy { border-left-color: var(--atlas-primary); }
.entry-card-navy:hover { box-shadow: -8px 0 0 -4px var(--atlas-primary); }
.entry-card-gold { border-left-color: var(--atlas-gold); }
.entry-card-gold:hover { box-shadow: -8px 0 0 -4px var(--atlas-gold); }
.entry-card-teal { border-left-color: var(--atlas-teal); }
.entry-card-teal:hover { box-shadow: -8px 0 0 -4px var(--atlas-teal); }
.entry-card .card-icon {
    color: var(--atlas-primary);
    margin-bottom: 0.5rem;
    display: inline-flex;
    opacity: 0.85;
}
.entry-card-gold .card-icon { color: var(--atlas-gold); }
.entry-card-teal .card-icon { color: var(--atlas-teal); }
.entry-card h5 {
    color: var(--atlas-primary);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 0.3rem;
}
.entry-card p {
    color: #6c757d;
    font-size: 0.86rem;
    line-height: 1.45;
    margin-bottom: 0.5rem;
}
.entry-link {
    color: var(--atlas-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s;
    display: inline-block;
}
.entry-card:hover .entry-link {
    transform: translateX(3px);
}

/* Search box */
.search-box {
    background: var(--atlas-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.search-box .form-control-lg {
    border-radius: 8px;
}

/* Filters sidebar (legacy, kept for backward compat) */
.filter-sidebar {
    background: #fff;
    border: 1px solid var(--atlas-border);
    border-radius: 14px;
    padding: 1.25rem;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(26,58,92,0.04);
}
.filter-sidebar-header {
    font-weight: 700;
    color: var(--atlas-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--atlas-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.filter-sidebar-icon {
    color: var(--atlas-accent);
    display: inline-flex;
}

/* ===== Filter panel (browse page, horizontal layout) ===== */
.filter-panel {
    margin-top: 1.5rem;
    background: #fff;
    border: 1px solid var(--atlas-border);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    box-shadow: 0 2px 10px rgba(26,58,92,0.05);
}
.filter-panel-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    color: var(--atlas-primary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 0.85rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--atlas-light);
}
.filter-clear-btn {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--atlas-accent);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-transform: none;
    letter-spacing: 0;
    transition: background 0.2s;
}
.filter-clear-btn:hover {
    background: rgba(200,16,46,0.08);
}
.filter-panel-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr) 1.5fr;
    gap: 0.85rem 1rem;
    align-items: end;
}
.filter-field {
    display: flex;
    flex-direction: column;
}
.filter-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 0.3rem;
    display: block;
}
.filter-field .form-select,
.filter-field .form-control {
    font-size: 0.85rem;
    border-color: var(--atlas-border);
}
.filter-field .form-select:focus,
.filter-field .form-control:focus {
    border-color: var(--atlas-primary);
    box-shadow: 0 0 0 2px rgba(26,58,92,0.08);
}
/* Evidence toggle pills (MYCN / STARR / HiChIP) */
.filter-toggles {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--atlas-light);
    border: 1px solid var(--atlas-border);
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    font-size: 0.78rem;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}
.filter-pill input {
    display: none;
}
.filter-pill span {
    font-weight: 500;
}
.filter-pill:hover {
    border-color: var(--atlas-primary);
}
.filter-pill:has(input:checked) {
    background: var(--atlas-primary);
    border-color: var(--atlas-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,58,92,0.2);
}

/* Results header */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--atlas-light);
}
.results-header .chart-card-title {
    margin: 0;
    border: none;
    padding: 0;
}
.result-count-badge {
    background: var(--atlas-light);
    color: var(--atlas-primary);
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Small hero variant (for inner pages like browse) */
.hero-sm {
    padding: 2rem 1rem 1.5rem;
    margin-bottom: 1.5rem;
}
.hero-sm .hero-title {
    font-size: 1.85rem;
    margin-bottom: 0;
}

/* DataTables custom */
table.dataTable {
    font-size: 0.85rem;
}
table.dataTable thead th {
    background: var(--atlas-primary);
    color: #fff;
    font-weight: 600;
    border-bottom: 2px solid var(--atlas-accent);
}
table.dataTable tbody tr:hover {
    background: var(--atlas-light) !important;
}

/* DataTables pagination — override Bootstrap5 blue (.page-link) with atlas theme.
   Bootstrap5 integration uses .page-item/.page-link, NOT .paginate_button. */
.dataTables_wrapper .dataTables_paginate .page-link {
    color: var(--atlas-primary) !important;
    border-color: var(--atlas-border) !important;
    border-radius: 6px !important;
    margin: 0 2px !important;
    padding: 0.3rem 0.7rem !important;
    background: #fff;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.15s ease;
}
.dataTables_wrapper .dataTables_paginate .page-link:hover {
    background: var(--atlas-light) !important;
    border-color: var(--atlas-primary) !important;
    color: var(--atlas-primary) !important;
}
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link,
.dataTables_wrapper .dataTables_paginate .page-item.active .page-link:hover {
    background: var(--atlas-primary) !important;
    color: #fff !important;
    border-color: var(--atlas-primary) !important;
}
.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link,
.dataTables_wrapper .dataTables_paginate .page-item.disabled .page-link:hover {
    color: #adb5bd !important;
    background: #fff !important;
    border-color: var(--atlas-border) !important;
}
/* Length selector + search input + info text */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info {
    color: #6c757d;
    font-size: 0.82rem;
}
.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border-color: var(--atlas-border);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
    font-size: 0.82rem;
}
/* Length selector ("Show N entries") — widen so the number + arrow don't overlap */
.dataTables_wrapper .dataTables_length select.form-select {
    min-width: 60px;
    padding-left: 0.5rem;
    padding-right: 1.8rem;   /* override the 0.5rem above, room for custom arrow */
    margin: 0 0.3rem;
}
.dataTables_wrapper .dataTables_filter input:focus,
.dataTables_wrapper .dataTables_length select:focus {
    border-color: var(--atlas-primary);
    box-shadow: 0 0 0 2px rgba(26,58,92,0.08);
    outline: none;
}
.star-badge {
    display: inline-block;
    background: var(--atlas-gold);
    color: #fff;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.75rem;
    font-weight: 700;
}
.tier-badge {
    display: inline-block;
    border-radius: 4px;
    padding: 1px 6px;
    font-size: 0.72rem;
    font-weight: 600;
}
.tier-Core { background: #c8102e; color: #fff; }
.tier-Shared { background: #e67e22; color: #fff; }
.tier-WeakShared { background: #f1c40f; color: #333; }
.tier-Private { background: #95a5a6; color: #fff; }
.true-badge { color: #27ae60; font-weight: 700; }
.false-text { color: #ccc; }

/* Detail page */
.detail-section {
    background: #fff;
    border: 1px solid var(--atlas-border);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.detail-section h3 {
    color: var(--atlas-primary);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 2px solid var(--atlas-border);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}
.info-row {
    display: flex;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.info-row:last-child { border-bottom: none; }
.info-label {
    width: 220px;
    font-weight: 500;
    color: #495057;
}
.info-value {
    flex: 1;
    color: #212529;
    font-family: "SF Mono", "Fira Code", monospace;
    font-size: 0.88rem;
}

/* Star dimension display */
.star-dim {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    margin: 2px;
    font-size: 0.82rem;
}
.star-dim.active {
    background: #fff8e1;
    border: 1px solid var(--atlas-gold);
}
.star-dim.inactive {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    color: #aaa;
}

/* Gene table */
.gene-link-row {
    padding: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}
.gene-link-row:hover {
    background: var(--atlas-light);
}
.gene-name {
    font-weight: 600;
    color: var(--atlas-primary);
}
.gene-name:hover {
    color: var(--atlas-accent);
}

/* Peak ID link in tables (browse/detail) */
.peak-link {
    font-weight: 600;
    color: var(--atlas-primary);
    text-decoration: none;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.85rem;
    transition: color 0.15s;
}
.peak-link:hover {
    color: var(--atlas-accent);
    text-decoration: underline;
}

/* Prognosis calculator */
.calc-input-table th {
    background: var(--atlas-light);
    font-size: 0.82rem;
    color: var(--atlas-primary);
    font-weight: 600;
}
.calc-input-table td {
    font-size: 0.82rem;
}
/* Prognosis right column: simple stack, forest plot has explicit height
   to roughly match the left column (signature table ~30 rows). */
.prog-right-col {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.prog-forest-card {
    /* no flex tricks — let the plot have its own height */
}
.prog-forest-plot {
    width: 100%;
    height: 620px;
}

/* About-signature metadata: 2-column compact grid (3 rows × 2 cols) */
.sig-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1.5rem;
    padding: 0.25rem 0;
}
.sig-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.sig-meta-item .info-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    font-weight: 600;
}
.sig-meta-item .info-value {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--atlas-primary);
}
/* Action buttons row (Load Example / Upload / Clear / Calculate) */
.prog-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}
.prog-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    background: none;
    color: var(--atlas-primary);
}
.prog-btn-outline {
    background: #fff;
    border-color: var(--atlas-border);
    color: var(--atlas-primary);
}
.prog-btn-outline:hover {
    border-color: var(--atlas-primary);
    background: var(--atlas-light);
}
.prog-btn-ghost {
    color: var(--atlas-accent);
    border-color: transparent;
}
.prog-btn-ghost:hover {
    background: rgba(200,16,46,0.08);
}
.prog-btn-primary {
    background: linear-gradient(135deg, var(--atlas-primary) 0%, #2c5278 100%);
    color: #fff;
    border: none;
    box-shadow: 0 3px 10px rgba(26,58,92,0.25);
    margin-left: auto;   /* push Calculate to the right */
}
.prog-btn-primary:hover {
    background: linear-gradient(135deg, var(--atlas-accent) 0%, #e0294a 100%);
    box-shadow: 0 4px 14px rgba(200,16,46,0.3);
    transform: translateY(-1px);
}
.risk-result {
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    margin: 1.5rem 0;
}
.risk-high {
    background: linear-gradient(135deg, #fee, #fcc);
    border: 2px solid var(--atlas-accent);
}
.risk-low {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    border: 2px solid #27ae60;
}
.risk-score-value {
    font-size: 2.5rem;
    font-weight: 800;
}
.risk-group-label {
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Plot containers */
.plot-container {
    width: 100%;
    border: 1px solid var(--atlas-border);
    border-radius: 12px;
    padding: 0.5rem;
    margin-bottom: 1.5rem;
}

/* UCSC link button */
.ucsc-btn {
    background: linear-gradient(135deg, var(--atlas-primary) 0%, #2c5278 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    box-shadow: 0 3px 10px rgba(26,58,92,0.25);
    transition: all 0.25s ease;
}
.ucsc-btn:hover {
    background: linear-gradient(135deg, var(--atlas-accent) 0%, #e0294a 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(200,16,46,0.3);
    transform: translateY(-1px);
}

/* Form-select: custom arrow to avoid overlap with DataTables/Bootstrap defaults.
   Applies to all dropdowns (filters + DataTables length selector). */
.form-select {
    /* Remove the default Bootstrap background-image arrow (it overlaps with
       the browser's native arrow on some integrations, e.g. DataTables). */
    background-image: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    /* Reserve padding on the right for our custom SVG arrow */
    padding-right: 2rem;
    /* Custom arrow via inline SVG (chevron-down, themed gray) */
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    background-size: 14px 14px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23607488' viewBox='0 0 16 16'%3E%3Cpath d='M3.204 5h9.592L8 10.481 3.204 5zm-.753.659 4.796 5.48a1 1 0 0 0 1.506 0l4.796-5.48c.566-.647.106-1.659-.753-1.659H3.204a1 1 0 0 0-.753 1.659z'/%3E%3C/svg%3E");
}

/* ===== Cart / Favorites ===== */
/* Navbar dropdown (Tools menu) */
.atlas-dropdown {
    background: #fff;
    border: 1px solid var(--atlas-border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(26,58,92,0.15);
    padding: 0.4rem;
    margin-top: 0.3rem;
    min-width: 240px;
}
.atlas-dropdown .dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.85rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--atlas-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s;
}
.atlas-dropdown .dropdown-item:hover {
    background: var(--atlas-light);
    color: var(--atlas-accent);
}
.atlas-dropdown .dropdown-item .icon-wrap {
    color: var(--atlas-accent);
}
/* Dropdown toggle inherits nav-link styling */
.atlas-tools-toggle::after {
    display: none !important;
}

/* Navbar cart link */
.cart-nav-link {
    position: relative;
    display: inline-flex !important;
    align-items: center;
}
.cart-count {
    background: var(--atlas-accent);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    margin-left: 4px;
}

/* Star toggle in DataTables */
.cart-star {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #ccc;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: color 0.15s, transform 0.15s;
}
.cart-star:hover {
    color: var(--atlas-gold);
    transform: scale(1.2);
}
.cart-star-active {
    color: var(--atlas-gold);
}

/* Cart row button (browse table — pill style) */
.cart-row-btn {
    border: 1px solid var(--atlas-border);
    background: #fff;
    color: var(--atlas-primary);
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.cart-row-btn:hover {
    border-color: var(--atlas-primary);
    background: var(--atlas-light);
}
.cart-row-active {
    background: var(--atlas-primary) !important;
    color: #fff !important;
    border-color: var(--atlas-primary) !important;
}

/* Detail page cart button (variant of ucsc-btn) */
.cart-toggle-detail {
    background: #fff;
    color: var(--atlas-primary);
    border: 1px solid var(--atlas-border) !important;
    box-shadow: none !important;
}
.cart-toggle-detail:hover {
    border-color: var(--atlas-gold) !important;
    color: var(--atlas-gold);
    transform: none;
}
.cart-toggle-active {
    background: var(--atlas-gold) !important;
    color: #fff !important;
    border-color: var(--atlas-gold) !important;
}

/* Cart modal */
#cartModal .modal-header {
    background: var(--atlas-primary);
    color: #fff;
}
#cartModal .modal-title { font-weight: 700; }
#cartTable { font-size: 0.85rem; }
.cart-remove-btn {
    background: none;
    border: none;
    color: var(--atlas-accent);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0 4px;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.cart-remove-btn:hover { opacity: 1; }

/* Cart action buttons */
.cart-action-btn {
    padding: 0.5rem 1.2rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}
.cart-action-export {
    background: var(--atlas-light);
    color: var(--atlas-primary);
    border-color: var(--atlas-border);
}
.cart-action-export:hover { border-color: var(--atlas-primary); }
.cart-action-report {
    background: linear-gradient(135deg, var(--atlas-primary) 0%, #2c5278 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(26,58,92,0.25);
}
.cart-action-report:hover {
    background: linear-gradient(135deg, var(--atlas-accent) 0%, #e0294a 100%);
}
.cart-action-clear {
    background: none;
    color: var(--atlas-accent);
    border-color: transparent;
}
.cart-action-clear:hover { background: rgba(200,16,46,0.08); }

/* ===== Batch query page ===== */
.batch-sidebar {
    display: flex;
    flex-direction: column;
}
#geneInput {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.6;
    border-color: var(--atlas-border);
}
#geneInput:focus {
    border-color: var(--atlas-primary);
    box-shadow: 0 0 0 2px rgba(26,58,92,0.08);
}
.batch-stats {
    display: flex;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--atlas-light);
}
.batch-stat {
    display: flex;
    flex-direction: column;
}
.batch-stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--atlas-primary);
    line-height: 1;
}
.batch-stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
}
.batch-table { font-size: 0.82rem; }

/* Report page print styles */
@media print {
    .atlas-nav, .atlas-footer, .bio-bg, .no-print { display: none !important; }
    .main-content { padding: 0 !important; }
    .chart-card { border: 1px solid #ddd !important; box-shadow: none !important; page-break-inside: avoid; }
    body { background: #fff !important; }
}

/* Responsive */
@media (max-width: 768px) {
    .hero { padding: 2.5rem 1rem 1.8rem; }
    .hero-title { font-size: 1.85rem; }
    .hero-tagline { font-size: 1.02rem; }
    .hero-eyebrow { font-size: 0.68rem; letter-spacing: 1.8px; }
    .main-content { padding: 1rem; }
    .home-section { margin-bottom: 2.5rem; }
    .section-title { font-size: 1.25rem; }
    /* Stack key stats vertically, hide dividers */
    .key-stats { flex-direction: column; padding: 1.2rem; }
    .key-stat { flex-basis: auto; padding: 0.8rem 0; }
    .key-stat-number { font-size: 2rem; }
    .key-stat-divider { display: none; }
    /* Stack validation strip */
    .validation-strip { flex-direction: column; padding: 1rem; }
    .validation-item { flex-basis: auto; padding: 0.6rem 0; }
    .validation-divider { display: none; }
    /* Hero search becomes column on very small screens */
    .hero-search { flex-direction: column; padding: 0.5rem; gap: 0.5rem; }
    .hero-search-btn { width: 100%; }
    /* Browse filter panel: stack vertically on small screens */
    .filter-panel-grid { grid-template-columns: 1fr; }
    .filter-field-toggles { margin-top: 0.25rem; }
    /* Prognosis: signature meta stack to single column on small screens */
    .sig-meta-grid { grid-template-columns: 1fr; }

    /* ===== Mobile-specific additions ===== */
    /* Charts: 3-up grid → single column on mobile */
    .home-section .row.g-3 > .col-md-4,
    .home-section .row.g-3 > .col-lg-4 { width: 100%; }
    /* KM modal: side-by-side plots → vertical stack on mobile */
    #kmModal .modal-dialog { max-width: 95vw; margin: 0.5rem auto; }
    #kmModal .row > div { width: 100% !important; }
    /* Forest plot: reduce height on mobile */
    .prog-forest-plot { height: 400px !important; }
    /* DataTables: smaller font + horizontal scroll fallback */
    table.dataTable { font-size: 0.78rem; }
    table.dataTable thead th { white-space: nowrap; }
    /* Cart modal: full width */
    #cartModal .modal-dialog { max-width: 95vw; margin: 0.5rem auto; }
    /* Prognosis actions: wrap + center on mobile */
    .prog-actions { justify-content: center; }
    .prog-btn-primary { margin-left: 0; width: 100%; }
    /* Detail page: header buttons stack */
    .detail-content-header { flex-direction: column; gap: 0.5rem; align-items: flex-start !important; }
    /* Navbar: hide link text on mobile, show only icons */
    .nav-link span:not(.cart-count) { display: none; }
    .nav-link { padding: 0.55rem 0.6rem !important; }
    /* Batch/Overlap textarea: smaller */
    #geneInput, #bedInput { font-size: 0.78rem; }
    /* Report charts: reduce height */
    #rTierChart, #rClassChart, #rStarChart { height: 220px !important; }
}

/* Extra small screens (phones < 480px) */
@media (max-width: 480px) {
    .hero { padding: 1.5rem 0.5rem 1rem; }
    .hero-title { font-size: 1.45rem; }
    .hero-tagline { font-size: 0.88rem; }
    .hero-desc { font-size: 0.82rem; }
    .key-stat-number { font-size: 1.6rem; }
    .hero-tag { font-size: 0.7rem; padding: 0.2rem 0.6rem; }
    .main-content { padding: 0.5rem; }
    .chart-card { padding: 1rem; border-radius: 10px; }
    .prog-forest-plot { height: 300px !important; }
}

/* ===== Inline SVG Icons ===== */
/* SVGs use stroke="currentColor", so color follows the parent element's
   `color`. .icon-wrap is a display:inline-flex wrapper for vertical
   alignment with adjacent text. */
.icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    vertical-align: -0.18em;   /* optical baseline alignment with text */
}
.icon-wrap svg {
    display: block;
    flex-shrink: 0;
}

/* Inline icons inside headings inherit the heading color */
h2 .icon-wrap, h3 .icon-wrap, h5 .icon-wrap {
    vertical-align: -0.22em;
    margin-right: 0.3rem;
}

/* Stat card icon (top of card, above number) */
.stat-card .stat-icon {
    color: var(--atlas-primary);
    margin-bottom: 0.35rem;
    opacity: 0.85;
}
.stat-card .stat-icon svg { width: 22px; height: 22px; }

/* Large entry-card icons */
.entry-card .card-icon {
    color: var(--atlas-accent);
}
.entry-card .card-icon svg { width: 32px; height: 32px; }

/* Nav link icons */
.nav-link .icon-wrap { vertical-align: -0.15em; margin-right: 0.25rem; }

/* Button icons */
.btn .icon-wrap { vertical-align: -0.15em; margin-right: 0.3rem; }

/* KM button icon inherits btn text color */
.km-btn .icon-wrap { margin-right: 0.2rem; }

/* ===== KM Survival Modal ===== */
#kmModal .modal-dialog { max-width: 900px; }
#kmModal .modal-body { padding: 1.25rem 1.5rem; }

.km-stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--atlas-light);
    border-radius: 8px;
    border: 1px solid var(--atlas-border);
}
/* Per-cohort stats block (TARGET | SEQC side by side) */
.km-stat-cohort {
    flex: 1 1 280px;
    min-width: 280px;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border-radius: 6px;
    border: 1px solid var(--atlas-border);
}
.km-stat-cohort-h {
    font-weight: 700;
    color: var(--atlas-primary);
    margin-bottom: 0.35rem;
    font-size: 0.95rem;
}
.km-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem 0.75rem;
}
.km-stat {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.km-stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.km-stat-val {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--atlas-primary);
}
.km-subtitle {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--atlas-primary);
    margin-bottom: 0.25rem;
}
.km-empty {
    padding: 2rem 1rem;
    text-align: center;
    color: #999;
    font-style: italic;
    border: 1px dashed var(--atlas-border);
    border-radius: 6px;
    font-size: 0.85rem;
}
.km-loading {
    display: inline-block;
    padding: 0.5rem 1rem;
    color: #6c757d;
}

.km-plot, .km-violin {
    width: 100%;
    min-height: 240px;
    /* Plotly's SVG can overflow its container during the modal's show
       animation (it sizes to the pre-animation width). overflow:hidden
       contains it so adjacent plots don't overlap. */
    overflow: hidden;
}
/* KM modal layout: ensure the two side-by-side columns don't let Plotly's
   SVG push past their width. min-width:0 is the standard flex/grid fix for
   children whose content refuses to shrink. */
#kmModal .row > [class*="col-"] {
    min-width: 0;
    padding: 0 0.5rem;
}
#kmModal .row.g-2 {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}
.km-subtitle {
    padding: 0 0.25rem;
}
.km-footnote {
    font-size: 0.72rem;
    color: #6c757d;
    margin-top: 0.75rem;
    font-style: italic;
}

/* Inline KM button (gene rows in prognosis / detail tables) */
.km-btn {
    margin-left: 0.5rem;
    padding: 0.05rem 0.4rem;
    font-size: 0.72rem;
    line-height: 1.2;
    vertical-align: middle;
}
