/* ==========================================================================
   DESIGN TOKENS (CSS custom properties)

   Mirrors the token block in the molAOP Builder's static/css/main.css so both
   apps in the pair are styled from the same named scale. Variable names are
   kept identical across the two repos - grep for a token in one and the other
   answers the same way.
   ========================================================================== */

:root {
    /* VHP4Safety Color Palette */
    --color-primary-dark: #29235C;
    --color-primary-pink: #E6007E;
    --color-primary-blue: #307BBF;
    --color-secondary-light-blue: #93D5F6;
    --color-secondary-cyan: #009FE3;
    --color-secondary-orange: #EB5B25;
    --color-secondary-teal: #005A6C;
    --color-secondary-magenta: #9A1C57;
    --color-teal-accent: #45A6B2;

    /* Interaction states derived from the palette */
    --color-primary-pink-hover: #B8005F;

    /* Neutral Colors */
    --color-white: #ffffff;

    /* Page Layout */
    --color-bg-page: #f5f6fa;

    /* Semantic Status Colors */
    --color-status-high: #28a745;
    --color-status-low: #dc3545;
}


html, body {
    height: 100%;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-page);
    color: var(--color-primary-dark);
}

/* Legacy header — overridden by .site-nav in base.html */
header {
    display: none;
}

/* ==========================================================================
   STICKY NAVIGATION
   ========================================================================== */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--color-primary-dark);
    color: var(--color-white);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.site-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.site-nav__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 600;
    font-size: 18px;
}

.site-nav__logo {
    height: 36px;
    width: auto;
}

.site-nav__title {
    font-size: 18px;
    font-weight: 600;
}

.site-nav__links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
}

.site-nav__links a {
    display: inline-block;
    color: rgba(255,255,255,0.95);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.site-nav__links a:hover,
.site-nav__links a:focus-visible {
    background-color: rgba(255,255,255,0.20);
    border-color: rgba(255,255,255,0.40);
    color: var(--color-white);
    outline: none;
}

/* ==========================================================================
   PAGE LAYOUT
   ========================================================================== */

.page-main {
    min-height: calc(100vh - 60px - 52px);
    padding: 24px 0;
}

/* ==========================================================================
   CARD COMPONENT
   ========================================================================== */

.card {
    background: var(--color-white);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 28px 32px;
    margin-bottom: 24px;
}

.card--wide {
    max-width: none;
    width: 95%;
    margin-left: auto;
    margin-right: auto;
}

.card--narrow {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

/* Plotly stacking workaround. Plotly's own CSS positions main-svg children
   absolutely via the .js-plotly-plot scope, but on HTMX-swapped re-renders
   that class doesn't survive on the volcano div, so the three stacked
   main-svgs fall back to position:static and reflow vertically — pushing
   threshold lines, axis titles and the modebar far below the container.
   Force absolute positioning unconditionally so renders stay correct
   regardless of Plotly's class management. */
.svg-container > svg.main-svg {
    position: absolute;
    top: 0;
    left: 0;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    background-color: var(--color-primary-dark);
    padding: 16px 24px;
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-size: 14px;
    margin-top: auto;
}

.site-footer a {
    color: var(--color-secondary-light-blue);
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
    color: var(--color-white);
}

.site-footer__inner {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.site-footer__platform-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.site-footer__platform-logo {
    height: 28px;
    width: auto;
    background: var(--color-white);
    padding: 4px 8px;
    border-radius: 4px;
    vertical-align: middle;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

/* Base heading rules. Only `h1` was styled until 2026-08-18, which is why the
   templates hand-rolled every other heading inline — results.html alone carried
   69 `style=` attributes and 11 literal brand hex values, most of them some
   variant of `color: #29235C; font-size: 16px` on an h3 or h4. Defining the
   scale here lets those be deleted rather than duplicated. Sizes match what the
   inline styles were already asking for, so nothing changes visually. */
h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--color-primary-dark);
}

h2 {
    font-size: 22px;
    font-weight: 600;
}

h3 {
    font-size: 18px;
    font-weight: 600;
}

h4 {
    font-size: 16px;
    font-weight: 600;
}

h5 {
    font-size: 14px;
    font-weight: 600;
}

/* Available to assistive technology, absent from the visual layout. Used for
   page titles where the design already communicates the subject visually (the
   results page leads with a metadata strip, not a heading) but the document
   still needs an h1 to anchor its outline. */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   CONTAINER (legacy layout component)
   ========================================================================== */

.container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.table-container {
    max-height: 400px;
    overflow-y: auto;
}

/* ==========================================================================
   LOGO (legacy — nav uses .site-nav__logo instead)
   ========================================================================== */

img.logo {
    display: block;
    margin: 0 auto;
    width: 200px;
    height: auto;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

input[type=button], input[type=submit], input[type=reset], button {
    background-color: var(--color-primary-pink);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 12pt;
}

input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover, button:hover {
    background-color: var(--color-secondary-teal);
}

button {
    background-color: var(--color-primary-pink);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 12pt;
}

button:hover {
    background-color: var(--color-secondary-teal);
}

/* Button utility classes */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    text-decoration: none;
    color: white;
}

.btn--primary {
    background-color: var(--color-primary-blue);
}

.btn--primary:hover {
    background-color: var(--color-primary-dark);
}

.btn--accent {
    background-color: var(--color-primary-pink);
}

.btn--accent:hover {
    background-color: var(--color-secondary-magenta);
}

.btn--teal {
    background-color: var(--color-teal-accent);
}

.btn--teal:hover {
    background-color: var(--color-secondary-teal);
}

.btn--secondary {
    background-color: var(--color-white);
    color: var(--color-primary-dark);
    border: 1.5px solid var(--color-primary-dark);
}

.btn--secondary:hover {
    background-color: #f0f0f7;
    color: var(--color-primary-dark);
}

.btn--option,
.btn--option-pct {
    background-color: var(--color-white);
    color: var(--color-primary-dark);
    border: 1.5px solid var(--color-primary-blue);
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
    margin: 2px;
    width: auto;
    display: inline-block;
}

.btn--option:hover,
.btn--option-pct:hover {
    background-color: var(--color-primary-blue);
    color: var(--color-white);
}

.btn--option-pct {
    border-color: var(--color-teal-accent);
    color: var(--color-secondary-teal);
}

.btn--option-pct:hover {
    background-color: var(--color-teal-accent);
    color: var(--color-white);
}

/* Disabled state for any button — readable, clearly inactive */
button:disabled,
.btn:disabled,
.btn--primary:disabled,
.btn--secondary:disabled,
.btn--accent:disabled,
.btn--teal:disabled,
.btn--option:disabled,
.btn--option-pct:disabled {
    background-color: #d1d5db;
    color: #6b7280;
    border-color: #9ca3af;
    cursor: not-allowed;
    opacity: 1;
}

button:disabled:hover,
.btn:disabled:hover,
.btn--primary:disabled:hover,
.btn--secondary:disabled:hover,
.btn--accent:disabled:hover,
.btn--teal:disabled:hover,
.btn--option:disabled:hover,
.btn--option-pct:disabled:hover {
    background-color: #d1d5db;
    color: #6b7280;
}

/* ==========================================================================
   FORM INPUTS
   ========================================================================== */

input[type="text"], input[type="file"] {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    box-sizing: border-box;
    border: 2px solid #ccc;
    border-radius: 5px;
}

select, input[type="number"], button {
    font-size: 16px;
    padding: 10px;
    width: 250px;
    margin: 10px auto;
    display: block;
}

label {
    font-weight: bold;
    display: block;
    margin-top: 15px;
}

/* ==========================================================================
   TABLES
   ========================================================================== */

table.dataframe {
    border-collapse: collapse;
    width: 100%;
    font-size: 14px;
}

table.dataframe th, table.dataframe td {
    border: 1px solid #ccc;
    padding: 10px;
}

table.dataframe th {
    background-color: var(--color-primary-blue);
    color: white;
    text-align: center;
}

table.dataframe tr:nth-child(even) {
    background-color: #f9f9f9;
}

table.dataframe:hover {
    cursor: pointer;
}

table.dataframe th, table.dataframe td {
    border: 1px solid #ccc;
    padding: 10px;
    white-space: nowrap;
}

table.dataframe th {
    background-color: var(--color-primary-blue);
    color: white;
}

table.dataframe tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* ==========================================================================
   MODEL TILES
   ========================================================================== */

.model-tile {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
    background-color: #e9f6fd;
    position: relative;
    transition: background-color 0.3s ease;
}

.model-tile:hover, .model-tile.checked {
    background-color: #ffe6f4;
}

.model-tile input[type="checkbox"] {
    position: absolute;
    top: 10px;
    right: 10px;
}

.model-tile label {
    display: block;
    cursor: pointer;
    margin-right: 30px;
}

/* ==========================================================================
   DROPDOWN
   ========================================================================== */

.dropdown-container {
    margin-bottom: 20px;
}

.custom-dropdown {
    position: relative;
}

#dropdown-table {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
}

#dropdown-table table {
    width: 100%;
    border-collapse: collapse;
}

#dropdown-table th, #dropdown-table td {
    padding: 8px;
    border: 1px solid #ddd;
    text-align: left;
}

#dropdown-table th {
    background-color: var(--color-primary-blue);
    color: white;
    font-weight: bold;
}

#dropdown-table tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

/* ==========================================================================
   CENTERED CONTAINERS
   ========================================================================== */

.centered-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.centered-form {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.centered-form label,
.centered-form select,
.centered-form input,
.centered-form button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

/* ==========================================================================
   VOLCANO SECTION
   ========================================================================== */

.volcano-section {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.volcano-section form {
    margin-top: 20px;
}

.volcano-section input,
.volcano-section select,
.volcano-section button {
    margin: 5px;
    padding: 10px;
    font-size: 16px;
}

.volcano-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
}

.volcano-form label,
.volcano-form input,
.volcano-form button {
    margin: 5px;
    font-size: 16px;
}

/* ==========================================================================
   ANALYSIS SETTINGS PANELS (#57)
   Grouped option cards shown before "Run Enrichment Analysis". Two columns on
   wide viewports (significance settings | enrichment target), stacked on
   narrow. Behaviour (method/threshold mirroring, resource stickiness) is
   unchanged — this is presentation only.
   ========================================================================== */

.analysis-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
    align-items: stretch;
    max-width: 920px;
    margin: 20px auto 0;
    text-align: left;
}

.settings-group {
    border: 1px solid #e2e2ea;
    border-radius: 8px;
    padding: 18px 20px;
    background: #fff;
    display: flex;
    flex-direction: column;
    margin: 0;
}

.settings-group__title {
    color: var(--color-primary-dark);
    font-weight: 700;
    font-size: 16px;
    margin: 0 0 4px;
}

.settings-group__hint {
    font-size: 13px;
    color: #666;
    margin: 0 0 16px;
    line-height: 1.45;
}

.settings-subgroup {
    margin-bottom: 18px;
}

.settings-subgroup:last-child {
    margin-bottom: 0;
}

.settings-subgroup__label {
    display: block;
    font-weight: 600;
    color: var(--color-primary-dark);
    font-size: 14px;
    margin-bottom: 8px;
}

.settings-subgroup__hint {
    font-size: 12px;
    color: #777;
    margin: 6px 0 0;
    line-height: 1.4;
}

/* Batch-level provenance warning (issues #67 / #68) — same visual language as
   the results-page banner. */
.batch-resource-warning {
    margin: 16px 0;
    padding: 12px 14px;
    background: #fdf6ea;
    border-left: 4px solid var(--color-secondary-orange);
    font-size: 14px;
    color: var(--color-primary-dark);
}

.batch-resource-warning p {
    margin: 0 0 6px;
}

.batch-resource-warning p:last-child {
    margin-bottom: 0;
}

/* Inline caveat next to an option label — e.g. resources the mapping-confidence
   filter cannot apply to (issue #67). */
.settings-note {
    font-size: 12px;
    color: #777;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-options label {
    font-size: 14px;
    color: #333;
    margin: 0;
    cursor: pointer;
}

.settings-group input[type="number"] {
    width: 110px;
    padding: 7px 8px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    margin: 0;
}

/* Threshold layout (base rules; previously inherited from .volcano-form) */
.settings-group .threshold-quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.settings-group .threshold-custom {
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-group .threshold-custom-label {
    font-size: 14px;
    color: #555;
}

/* Run button anchored to the bottom of its card for a tidy two-column edge */
.settings-actions {
    margin-top: auto;
    padding-top: 18px;
}

.settings-actions .btn--primary {
    width: 100%;
}

@media (max-width: 700px) {
    .analysis-settings {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   PREVIEW TABLE
   ========================================================================== */

.preview-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

/* ==========================================================================
   COLUMN SELECTORS
   ========================================================================== */

.column-selectors {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin-top: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    text-align: left;
}

.column-selectors > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.column-selectors label {
    margin-bottom: 5px;
    font-weight: 600;
}

.column-selectors select {
    padding: 4px 8px;
}

.column-selectors label {
    display: block;
    margin-bottom: 5px;
    align-self: center;
}

select.wide-dropdown {
    min-width: 350px;
    max-width: 100%;
    padding: 6px;
    font-size: 14px;
}

/* ==========================================================================
   SUBHEADER ALERT BAND
   ========================================================================== */

.subheader {
    background-color: var(--color-secondary-orange);
    padding: 8px 20px;
    text-align: center;
    color: white;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

/* ==========================================================================
   COLUMN SUGGESTION STYLING
   ========================================================================== */

.column-selector-group {
    margin-bottom: 20px;
}

.auto-suggestion {
    background-color: var(--color-secondary-cyan);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    margin-left: 8px;
    border: 1px solid var(--color-primary-blue);
}

select option[data-suggested="true"] {
    background-color: var(--color-secondary-light-blue);
    font-weight: bold;
}

/* ==========================================================================
   CONFIDENCE INDICATORS
   ========================================================================== */

/* Confidence indicators using house style colors */
.confidence-high {
    color: var(--color-teal-accent); /* Teal - for high confidence */
}

.confidence-medium {
    color: var(--color-secondary-orange); /* Orange - for medium confidence */
}

.confidence-low {
    color: var(--color-secondary-magenta); /* Deep Magenta - for low confidence */
}

/* ==========================================================================
   CONFIDENCE BADGE — Phase 16 (AUTC-01)
   Promotes existing text-color .confidence-* classes to filled inline badges.
   Existing .confidence-high/.confidence-medium/.confidence-low kept for
   backward compatibility.
   ========================================================================== */

.confidence-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    margin-left: 8px;
    line-height: 1;
}

.confidence-badge--high {
    background-color: var(--color-teal-accent); /* Teal */
}

.confidence-badge--medium {
    background-color: var(--color-secondary-orange); /* Orange */
}

.confidence-badge--low {
    background-color: var(--color-secondary-magenta); /* Deep Magenta */
}

.confidence-badge--very-low {
    background-color: var(--color-secondary-magenta); /* Deep Magenta */
}

.confidence-badge--undetected {
    background-color: var(--color-secondary-orange); /* Orange */
    border: 1px solid var(--color-secondary-magenta); /* Deep Magenta outline — signals required action */
}

/* ==========================================================================
   REPRESENTATION BADGE — issue #70
   Which tail of Fisher's exact test a Key Event fell on. Depletion gets its
   own colour rather than reading as a null result; 'ns' stays deliberately
   quiet so the eye lands on the calls that carry information.
   ========================================================================== */

.rep-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    color: white;
}

.rep-badge--enriched {
    background-color: var(--color-primary-pink); /* Primary Magenta */
}

.rep-badge--depleted {
    background-color: var(--color-primary-blue); /* Primary Blue */
}

.rep-badge--ns {
    background-color: #f0f0f0;
    color: #666;
}

/* ==========================================================================
   PATHWAY VIEW SECTION (Phase 999.4 PinPath)
   ========================================================================== */

.pathway-view {
    margin-bottom: 24px;
}

.pathway-view__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 0 0 16px 0;
}

.pathway-view__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin: 0;
}

.pathway-view__caption {
    font-size: 12px;
    font-weight: 400;
    color: var(--color-primary-dark);
    margin: 4px 0 0 0;
}

.pathway-view__controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pathway-view__picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.pathway-view__picker {
    min-width: 320px;
    font-size: 14px;
    padding: 8px 16px;
    width: auto;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: var(--color-primary-dark);
}

/* Expression-overlay controls (checkbox + colour ramp + counts + disclosure). */
.pathway-view__overlay-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.pathway-view__overlay-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--color-primary-dark);
    cursor: pointer;
}

.pathway-view__overlay-scale {
    display: flex;
    align-items: center;
    gap: 5px;
}

.pathway-view__overlay-scale-label {
    font-size: 11px;
    color: #666;
}

/* Background is set from JS so the ramp is generated by the same function that
   picks the overlay colours, and the two can never disagree. */
.pathway-view__overlay-ramp {
    display: inline-block;
    width: 100px;
    height: 12px;
    border: 1px solid #999;
}

.pathway-view__overlay-scale-note {
    font-size: 11px;
    color: #666;
    margin-left: 5px;
}

.pathway-view__overlay-counts {
    font-size: 13px;
    color: #555;
    margin: 0 0 6px;
}

.pathway-view__overlay-disclosure {
    font-size: 12px;
    color: #666;
    margin: 0 0 16px;
}

.pathway-view__iframe-wrapper {
    position: relative;
}

.pathway-view__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: #666;
    pointer-events: none;
}

.pathway-view__iframe {
    display: block;
    width: 100%;
    height: 600px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 0;
    background-color: var(--color-white);
}

.pathway-view__popup-link {
    font-size: 14px;
    color: var(--color-primary-blue);
    text-decoration: none;
    white-space: nowrap;
}

.pathway-view__popup-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .pathway-view__iframe {
        height: 500px;
    }

    .pathway-view__picker {
        width: 100%;
        min-width: 0;
    }
}

/* ==========================================================================
   METADATA SUMMARY CARD
   ========================================================================== */

.metadata-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.metadata-summary__item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.metadata-summary__label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metadata-summary__value {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary-dark);
}

/* ==========================================================================
   AOP TYPEAHEAD SEARCH
   ========================================================================== */

.typeahead-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 300px;
    overflow-y: auto;
    background: white;
    border: 1px solid #ccc;
    border-top: none;
    list-style: none;
    padding: 0;
    margin: 0;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.typeahead-dropdown li {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
    text-align: left;
}

.typeahead-dropdown li:hover {
    background-color: #f5f5f5;
}

.typeahead-dropdown li .mapped-info {
    color: var(--color-primary-blue);
    font-size: 12px;
}

.typeahead-dropdown li .unmapped-info {
    color: #999;
    font-size: 12px;
}

/* ==========================================================================
   NETWORK CONTROLS BAR
   ========================================================================== */

.network-controls-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.fdr-cutoff-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.fdr-cutoff-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin: 0;
    display: inline;
    white-space: nowrap;
}

.fdr-cutoff-group select {
    font-size: 13px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff;
    color: var(--color-primary-dark);
    cursor: pointer;
}

/* ==========================================================================
   KE DETAIL DRAWER
   ========================================================================== */

.ke-drawer {
    position: fixed;
    top: 60px;
    right: -380px;
    width: 360px;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    background: #fff;
    border-left: 2px solid var(--color-primary-blue);
    box-shadow: -4px 0 12px rgba(0,0,0,0.12);
    z-index: 200;
    transition: right 0.25s ease;
    padding: 0;
}

.ke-drawer--open {
    right: 0;
}

.ke-drawer__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.ke-drawer__title {
    margin: 0;
    font-size: 15px;
    color: var(--color-primary-dark);
}

.ke-drawer__close {
    background: transparent;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
    line-height: 1;
    width: auto;
    margin: 0;
}

.ke-drawer__close:hover {
    color: var(--color-primary-pink);
    background: transparent;
}

.ke-drawer__body {
    padding: 16px;
}

.ke-drawer__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.ke-drawer__type {
    background: var(--color-primary-dark);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.ke-drawer__fdr {
    font-size: 13px;
    color: #555;
}

.ke-drawer__ke-title {
    margin: 0 0 8px;
    font-size: 16px;
    color: var(--color-primary-dark);
    line-height: 1.3;
}

.ke-drawer__wiki-link {
    display: inline-block;
    font-size: 13px;
    color: var(--color-primary-blue);
    text-decoration: none;
    margin-bottom: 16px;
}

.ke-drawer__wiki-link:hover {
    text-decoration: underline;
}

.ke-drawer__gene-list h5 {
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--color-primary-dark);
}

.ke-drawer__gene-scroll {
    max-height: 400px;
    overflow-y: auto;
}

.ke-drawer__gene {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.ke-drawer__gene:last-child {
    border-bottom: none;
}

.ke-drawer__gene--sig {
    background: #f0fff0;
}

.ke-drawer__gene-name {
    flex: 1;
    font-weight: 500;
    color: var(--color-primary-dark);
}

.ke-drawer__gene-fc {
    color: #555;
    font-size: 12px;
    min-width: 50px;
    text-align: right;
}

.ke-drawer__gene-sig-badge {
    background: var(--color-teal-accent);
    color: white;
    padding: 1px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
}

/* Compare page drawer: percentage-based responsive width */
#compare-ke-drawer {
    width: clamp(320px, 30vw, 500px);
    right: calc(-1 * clamp(320px, 30vw, 500px));
}
#compare-ke-drawer.ke-drawer--open {
    right: 0;
}

/* Bottom sheet on narrow screens */
@media (max-width: 767px) {
    .ke-drawer {
        top: auto;
        bottom: -80vh;
        right: 0;
        left: 0;
        width: 100%;
        height: 80vh;
        max-height: 80vh;
        border-left: none;
        border-top: 2px solid var(--color-primary-blue);
        border-radius: 12px 12px 0 0;
        transition: bottom 0.25s ease;
    }
    .ke-drawer--open {
        bottom: 0;
        right: 0;
    }
}

/* ==========================================================================
   DROP ZONE (file upload)
   ========================================================================== */

.drop-zone {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 32px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    background: #fafafa;
    margin-bottom: 16px;
}

.drop-zone--active {
    border: 2px solid var(--color-primary-blue);
    background-color: #e8f4fb;
}

.drop-zone__icon {
    font-size: 32px;
    color: #aaa;
    margin-bottom: 8px;
}

.drop-zone__text {
    font-size: 16px;
    font-weight: 500;
    color: var(--color-primary-dark);
    margin: 0 0 4px;
}

.drop-zone__hint {
    font-size: 13px;
    color: #888;
    margin: 0 0 8px;
}

.drop-zone__filename {
    font-size: 14px;
    color: var(--color-primary-blue);
    font-weight: 500;
    margin: 8px 0 0;
}

.drop-zone__remove {
    background: transparent;
    color: var(--color-primary-pink);
    border: 1px solid var(--color-primary-pink);
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
    margin-top: 6px;
    cursor: pointer;
    width: auto;
    display: inline-block;
}

.drop-zone__remove:hover {
    background: var(--color-primary-pink);
    color: white;
}

/* ==========================================================================
   BATCH ANALYSIS STYLES
   ========================================================================== */

.batch-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.batch-modal__content {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.batch-progress__files {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.batch-progress__file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--color-bg-page);
}

.batch-progress__file--running {
  background: #e8f4fb;
  border-left: 3px solid var(--color-primary-blue);
}

.batch-progress__file--complete {
  background: #e8f8e8;
  border-left: 3px solid var(--color-status-high);
}

.batch-progress__file--failed {
  background: #fde8e8;
  border-left: 3px solid var(--color-status-low);
}

.batch-progress__label {
  flex: 1;
  font-weight: 500;
}

.batch-progress__error {
  color: var(--color-status-low);
  font-weight: 600;
  margin-top: 1rem;
}

.batch-meta {
  background: var(--color-bg-page);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}

.batch-meta p {
  margin: 0.25rem 0;
}

.batch-harmonisation-note {
  background: #e8f4fb;
  border-left: 3px solid var(--color-primary-blue);
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-primary-dark);
}

.batch-conditions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.batch-condition-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.batch-condition-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--color-bg-page);
}

.batch-condition-card__header h3 {
  margin: 0;
  font-size: 1rem;
}

.batch-condition-card__status {
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.batch-condition-card__status--complete {
  background: #d4edda;
  color: #155724;
}

.batch-condition-card__status--failed {
  background: #f8d7da;
  color: #721c24;
}

.batch-condition-card__body {
  padding: 0.75rem 1rem;
}

.btn--small {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  background: #fff;
}

.file-card__name {
  flex: 1;
  font-weight: 500;
}

.file-card__info {
  color: #666;
  font-size: 0.85rem;
}

.file-card__remove {
  background: none;
  border: none;
  color: var(--color-status-low);
  cursor: pointer;
  font-size: 1.2rem;
  width: auto;
  display: inline-block;
}

.tag-row {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  background: var(--color-bg-page);
  border-radius: 6px;
}

.tag-row input {
  width: 100%;
  padding: 0.3rem 0.5rem;
}

.demo-group {
  margin-bottom: 0.75rem;
}

.demo-group h4 {
  margin: 0.25rem 0;
  color: var(--color-primary-dark);
}

.demo-group label {
  display: block;
  padding: 0.15rem 0;
  font-size: 0.9rem;
}

.error-text {
  color: var(--color-status-low);
}

.breadcrumb-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--color-primary-blue);
  text-decoration: none;
  font-size: 14px;
}

.breadcrumb-link:hover {
  text-decoration: underline;
  color: var(--color-primary-dark);
}

/* ==========================================================================
   TAG ROW PREVIEW (collapsible data preview in batch Step 2)
   ========================================================================== */

.tag-row__preview {
    grid-column: 1 / -1;
    font-size: 12px;
    margin-top: 4px;
}

.tag-row__preview summary {
    cursor: pointer;
    color: var(--color-primary-blue);
    font-weight: 500;
    font-size: 12px;
    margin-bottom: 4px;
}

.tag-row__preview summary:hover {
    color: var(--color-primary-dark);
}

.tag-row__preview table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 4px;
}

.tag-row__preview th {
    background: var(--color-primary-dark);
    color: #fff;
    padding: 4px 8px;
    text-align: left;
    font-weight: 500;
    white-space: nowrap;
}

.tag-row__preview td {
    padding: 3px 8px;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag-row__preview tr:nth-child(even) {
    background: #f9f9f9;
}

/* ==========================================================================
   LANDING TABS
   ========================================================================== */

.landing-tabs {
    display: flex;
    gap: 0;
    max-width: 800px;
    margin: 0 auto 24px;
    border-bottom: 2px solid #e0e0e0;
}

.landing-tab {
    padding: 12px 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: color 0.15s, border-color 0.15s;
    width: auto;
    display: inline-block;
    margin-top: 0;
}

.landing-tab:hover {
    color: var(--color-primary-dark);
    background: transparent;
}

.landing-tab--active {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-primary-blue);
    font-weight: 600;
}

.landing-tab--active:hover {
    background: transparent;
}

.landing-tab-panel {
    display: none;
}

.landing-tab-panel--active {
    display: block;
}

/* ==========================================================================
   COMPARISON PAGE
   ========================================================================== */

.compare-subtitle { color: #666; margin-top: 4px; margin-bottom: 16px; }

.compare-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid #e0e0e0; margin-bottom: 16px;
}
.compare-controls__mode { display: flex; align-items: center; gap: 8px; }
.compare-controls__mode label { font-weight: 600; font-size: 14px; }
.compare-controls__ref { display: flex; align-items: center; gap: 8px; }
.compare-controls__ref label { font-weight: 600; font-size: 14px; }
.compare-controls__ref select { padding: 4px 8px; border-radius: 4px; border: 1px solid #ccc; }

.compare-legend {
  display: flex; flex-wrap: wrap; gap: 10px; margin-left: auto;
}
.compare-legend__item { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.compare-legend__swatch {
  width: 14px; height: 14px; border-radius: 3px; display: inline-block; flex-shrink: 0;
}

.compare-tabs {
  display: flex; gap: 0; border-bottom: 2px solid #e0e0e0; margin-bottom: 0;
}
.compare-tab {
  padding: 10px 24px; border: none; background: transparent; cursor: pointer;
  font-size: 15px; font-weight: 500; color: #666; border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: color 0.15s, border-color 0.15s;
}
.compare-tab:hover { color: var(--color-primary-dark); }
.compare-tab--active {
  color: var(--color-primary-dark); border-bottom-color: var(--color-primary-pink); font-weight: 600;
}

.compare-tab-panels { padding-top: 16px; }
.compare-tab-panel { /* visible by default; hidden via inline style or JS */ }

.batch-summary-actions { margin-top: 24px; text-align: center; }

/* ==========================================================================
   RESPONSIVE LAYOUT
   ========================================================================== */

/* 1024px breakpoint — laptop/small desktop */
@media (max-width: 1024px) {
    .card--wide {
        width: 100%;
        padding: 20px 16px;
    }
}

/* 768px breakpoint — tablet */
@media (max-width: 768px) {
    .card--wide,
    .card--narrow {
        width: 100%;
        padding: 16px 12px;
        border-radius: 0;
        margin-bottom: 12px;
    }

    .site-nav__links {
        gap: 16px;
    }

    .site-nav__links a {
        font-size: 13px;
    }

    /* Network container fixed height on tablet */
    #cy {
        height: 500px !important;
    }

    /* Stack network controls vertically */
    .network-controls-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .fdr-cutoff-group {
        margin-left: 0;
        flex-wrap: wrap;
    }

    /* Legend grid: single column on tablet */
    .network-legend__grid {
        grid-template-columns: 1fr;
    }

    /* Metadata summary: tighter spacing */
    .metadata-summary {
        gap: 12px;
    }

    /* Column selectors: stack vertically */
    .column-selectors {
        flex-direction: column;
        align-items: stretch;
    }

    select.wide-dropdown {
        min-width: unset;
        width: 100%;
    }

    /* Dose grid: 2 columns instead of 3 */
    .dose-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Metadata form: single column */
    .metadata-grid-row {
        grid-template-columns: 1fr;
    }

    /* Threshold controls: wrap better */
    .threshold-quick-options {
        justify-content: flex-start;
    }

    .threshold-custom {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    /* Comparison page: stack controls vertically */
    .compare-controls { flex-direction: column; align-items: flex-start; }
    .compare-legend { margin-left: 0; }
    .compare-tab { padding: 8px 16px; font-size: 14px; }
}

/* ==========================================================================
   PHASE 10.1: DEMOS PAGE RESTRUCTURE
   ========================================================================== */

/* Banner card on / linking to /demos (D-03, D-04). */
.card--banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    margin-bottom: 16px;
}

.card--banner__text {
    flex: 1;
    min-width: 0;
}

.card--banner__text h3 {
    margin: 0 0 4px 0;
    color: var(--color-primary-dark);
    font-size: 18px;
    font-weight: 600;
}

.card--banner__text p {
    margin: 0;
    color: var(--color-primary-dark);
    font-size: 16px;
    line-height: 1.5;
}

.card--banner__cta {
    flex-shrink: 0;
    background-color: var(--color-primary-pink);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.card--banner__cta:hover {
    background-color: var(--color-primary-pink-hover); /* 20% darken of var(--color-primary-pink) per UI-SPEC §Copywriting Contract */
    text-decoration: none;
}

@media (max-width: 768px) {
    .card--banner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .card--banner__cta {
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
}

/* Demo cards on /demos page (used by Plan 01's demos.html). */
.card--demo {
    cursor: default;
    transition: border-color 0.2s, box-shadow 0.2s;
    border: 1.5px solid transparent;
    margin-bottom: 16px;
}

.card--demo:hover {
    border-color: var(--color-primary-dark);
    box-shadow: 0 2px 8px rgba(41, 35, 92, 0.08);
}

.card--demo h3 {
    margin: 0 0 8px 0;
    color: var(--color-primary-dark);
    font-size: 18px;
}

.card--demo p {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

.card--demo button[type="submit"] {
    background-color: var(--color-primary-pink);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
}

.card--demo button[type="submit"]:hover {
    background-color: var(--color-primary-pink-hover); /* 20% darken of var(--color-primary-pink) per UI-SPEC §Copywriting Contract */
}

/* AOP picker recommended-only filter toggle (D-06). */
.aop-filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 8px auto;
    max-width: 600px;
    font-size: 14px;
    color: var(--color-primary-dark);
}

.aop-filter-toggle__label {
    flex: 1;
    font-weight: 500;
}

.aop-filter-toggle__btn {
    background: transparent;
    border: 1px solid var(--color-primary-blue);
    color: var(--color-primary-blue);
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    width: auto;
    display: inline-block;
    margin: 0;
}

.aop-filter-toggle__btn:hover {
    background-color: #e8f4fb;
}

/* Recommended AOP highlight in the typeahead dropdown (D-06 + UI-SPEC §Color). */
.typeahead-dropdown li.aop-recommended {
    border-left: 2px solid var(--color-primary-blue);
}

/* Layout for demo card grids on /demos. */
.demos-section {
    margin-bottom: 32px;
}

.demos-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Batch comparison call-to-action below the PXR demo grid */
.demo-batch-cta {
    margin-top: 16px;
    padding: 16px 20px;
    border: 1px solid #e0e0e0;
    border-left: 4px solid var(--color-primary-pink);
    border-radius: 6px;
    background: #fbfbfd;
}
.demo-batch-cta h3 {
    margin: 0 0 6px;
    color: var(--color-primary-dark);
}
.demo-batch-cta p {
    margin: 0 0 12px;
    color: #555;
    font-size: 14px;
}

@media (min-width: 1024px) {
    .demos-grid--cisplatin {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .demos-grid,
    .demos-grid--cisplatin {
        grid-template-columns: 1fr;
    }
}

/* Info callout box used on multiple pages (/demos unavailable notice, single-analysis intro). */
.info-callout {
    background-color: #f1f9ff;
    border-left: 5px solid var(--color-primary-blue);
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.info-callout h2 {
    margin-top: 0;
}

/* Timepoint group headings inside the "Show all 54" expander on /demos. */
.demos-timepoint-group {
    margin-top: 20px;
}

.demos-timepoint-group h4 {
    margin: 0 0 8px 0;
    color: var(--color-primary-dark);
    font-size: 15px;
    font-weight: 600;
}

/* ==========================================================================
   Phase 15: Hub genes panel BEM components (HUBG-01..07)
   Tokens: xs=4px, sm=8px, md=16px, lg=24px, xl=32px
   Palette: var(--color-primary-dark) (brand dark), var(--color-primary-blue) (supporting blue), var(--color-primary-pink) (magenta)
   ========================================================================== */

/* Hub genes panel card — wraps .card .card--wide, no extra box-shadow needed */
.hub-panel {
    margin-bottom: 24px;
}

/* Flex row: panel heading + subtext on the left, toggle group on the right */
.hub-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 16px 0;
    flex-wrap: wrap;
    gap: 16px;
}

/* Panel h3 heading */
.hub-panel__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-primary-dark);
    margin: 0;
}

/* Flex row holding the two toggle controls */
.hub-panel__controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

/* Individual toggle group: label + checkbox pair */
.hub-panel__toggle-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Toggle wrapper — label element acting as clickable row */
.hub-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Toggle label text */
.hub-toggle__label {
    font-weight: 400;
    color: var(--color-primary-dark);
}

/* Native checkbox base — accent-color scoped per toggle id below */
.hub-toggle__input {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* "Show gene nodes" toggle — network-layer control uses supporting blue */
#show-gene-nodes-toggle {
    accent-color: var(--color-primary-blue);
}

/* "Significant genes only" toggle — significance filter uses Primary Magenta */
#sig-only-toggle {
    accent-color: var(--color-primary-pink);
}

/* ==========================================================================
   END OF STYLESHEET
   ========================================================================== */
