/* compare.html -- two-selection comparison. Builds on style.css's ra-* shell. */

.cmp-brand-link { color: inherit; text-decoration: none; }
.cmp-intro { margin: 4px 0 0; font-size: 12px; color: #5b6470; line-height: 1.5; }
.cmp-note { font-size: 11px; color: #8a929c; line-height: 1.4; }
.cmp-note:empty { display: none; }

.cmp-side {
    border: 1px solid #e1e4e8;
    border-left: 4px solid var(--side-color);
    border-radius: 8px;
    padding: 8px 10px 10px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.cmp-side[data-side="a"] { --side-color: #2a6fdb; }
.cmp-side[data-side="b"] { --side-color: #d9730d; }
.cmp-side legend { font-size: 12px; font-weight: 600; color: #3d4450; padding: 0 4px; }
.cmp-side .ra-select, .cmp-side .ra-input { height: 32px; }
.cmp-name-wrap { display: block; width: 100%; }
.cmp-name-wrap[hidden], .cmp-side .ra-select[hidden] { display: none; }

/* "My species list": an uploaded file of GTDB accessions as one side. */
.cmp-list { display: flex; flex-direction: column; gap: 6px; }
.cmp-list[hidden] { display: none; }
.cmp-list-row { display: flex; gap: 6px; align-items: center; }
.cmp-list-upload, .cmp-list-clear {
    font: inherit; font-size: 12px; font-weight: 600; color: #3d4450;
    border: 1px solid #d0d5db; border-radius: 6px; background: #fff;
    padding: 5px 10px; cursor: pointer;
}
.cmp-list-upload { flex: 1; text-align: center; }
.cmp-list-upload:hover, .cmp-list-clear:hover { border-color: var(--side-color); }
.cmp-list-upload:focus-within { outline: 2px solid var(--side-color); outline-offset: 1px; }
.cmp-list-file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.cmp-side .cmp-list-text {
    height: auto; min-height: 72px; resize: vertical;
    font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 12px; line-height: 1.4;
}
.cmp-list .cmp-note { margin: 0; }
.cmp-list-status { font-size: 12px; color: #3d4450; line-height: 1.45; overflow-wrap: anywhere; }
.cmp-list-status:empty { display: none; }
.cmp-list-status > div + div { margin-top: 3px; }
.cmp-list-status summary { cursor: pointer; color: #5b6470; }
.cmp-list-bad { color: #b42318; }

.cmp-chip {
    display: inline-block;
    min-width: 18px;
    padding: 0 4px;
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    line-height: 18px;
}
.cmp-chip-a { background: #2a6fdb; }
.cmp-chip-b { background: #d9730d; }

.cmp-swap {
    align-self: center;
    margin: -8px 0;
    height: 26px;
    padding: 0 12px;
    border: 1px solid #c9cfd6;
    border-radius: 13px;
    background: #fff;
    font-size: 12px;
    color: #3d4450;
    cursor: pointer;
}
.cmp-swap:hover { background: #f4f5f7; }

.cmp-linkbtn {
    border: none;
    background: none;
    padding: 0;
    margin-left: 6px;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #1a56db;
    cursor: pointer;
}
.cmp-linkbtn:hover { text-decoration: underline; }
.cmp-advanced-row { padding-top: 10px; }
.cmp-advanced-row .ra-select { width: 128px; }
.cmp-pct-input { display: inline-flex; align-items: center; gap: 4px; color: #5b6470; }
.cmp-pct-input .ra-input { width: 64px; text-align: right; }
.cmp-advanced-note { margin: 6px 0 0; font-size: 11px; line-height: 1.45; color: #8a929c; }

.cmp-error { color: #b42318; font-size: 12px; line-height: 1.45; }
.cmp-error:empty { display: none; }

.ra-card h3 { margin: 0; font-size: 15px; font-weight: 600; }
.cmp-empty p { font-size: 13px; color: #3d4450; line-height: 1.6; }
.cmp-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 12px;
}

/* Summary */
.cmp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.cmp-who {
    border-left: 4px solid var(--side-color);
    padding: 4px 12px;
}
.cmp-who[data-side="a"] { --side-color: #2a6fdb; }
.cmp-who[data-side="b"] { --side-color: #d9730d; }
.cmp-who-name { font-size: 16px; font-weight: 600; font-style: italic; color: #1c2128; word-break: break-word; }
.cmp-who-meta { font-size: 12px; color: #5b6470; margin-top: 2px; }
.cmp-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.cmp-tile { background: #f7f8fa; border-radius: 8px; padding: 10px 12px; }
.cmp-tile-label { font-size: 11px; font-weight: 600; color: #5b6470; }
.cmp-tile-value { font-size: 22px; font-weight: 600; color: #1c2128; margin-top: 2px; font-variant-numeric: tabular-nums; }
.cmp-tile-sub { font-size: 11px; color: #8a929c; margin-top: 2px; }
.cmp-lost { margin: 12px 0 0; font-size: 12px; color: #8a5a00; background: #fff8e6; border-radius: 6px; padding: 8px 10px; line-height: 1.5; }
.cmp-lost:empty { display: none; }

/* Tracks */
.cmp-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: #3d4450; }
.cmp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cmp-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.cmp-legend i.cmp-line { height: 3px; border-radius: 2px; }
.cmp-scroll { overflow-x: auto; overflow-y: hidden; padding-bottom: 6px; }
/* Sticky position ruler (compare.js stickyRuler): zero height so it takes no
   room; its box hangs below the top bar while the tracks scroll under it. */
.cmp-ruler-sticky { position: sticky; top: 56px; height: 0; z-index: 30; }
.cmp-ruler-box { position: absolute; left: 0; top: 0; overflow: hidden; background: #fff; border-bottom: 1px solid #e1e4e8; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06); pointer-events: none; }
.cmp-ruler-box[hidden] { display: none; }
.cmp-ruler-box svg { display: block; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
.cmp-scroll svg { display: block; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }

.cmp-tooltip {
    position: fixed;
    z-index: 10001;   /* above a pinned .cmp-bc-panel */
    pointer-events: none;
    background: #fff;
    border: 1px solid #c9cfd6;
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.14);
    padding: 8px 10px;
    font-size: 12px;
    color: #1c2128;
    line-height: 1.45;
    max-width: 340px;
}
.cmp-tooltip b { font-weight: 600; }
/* A clicked tooltip: same box, but it takes clicks (close button) and sits
   under the live tooltip and level with a pinned Base/Count panel. */
.cmp-tt-hint { margin-top: 4px; font-size: 11px; color: #8a929c; }
.cmp-tooltip-pinned { pointer-events: auto; z-index: 10000; padding-right: 26px; }
.cmp-tooltip-pinned .cmp-bc-close { position: absolute; top: 4px; right: 6px; }
.cmp-tooltip table { border-collapse: collapse; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cmp-tooltip td, .cmp-tooltip th { padding: 1px 6px 1px 0; text-align: right; font-weight: 400; }
.cmp-tooltip th { color: #5b6470; text-align: left; }
.cmp-tooltip .cmp-tt-fixed { color: #1c2128; font-weight: 600; }

/* Table */
.cmp-table-tools { display: flex; align-items: center; gap: 14px; font-size: 12px; color: #3d4450; }
.cmp-table-tools label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.cmp-btn {
    height: 28px;
    padding: 0 12px;
    border: 1px solid #c9cfd6;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #1c2128;
    cursor: pointer;
}
.cmp-btn:hover { background: #f4f5f7; }
.cmp-more { margin-top: 10px; }
.cmp-table-wrap { overflow-x: auto; }
.cmp-table { border-collapse: collapse; width: 100%; font-size: 12px; font-variant-numeric: tabular-nums; }
.cmp-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #5b6470;
    border-bottom: 1px solid #e1e4e8;
    padding: 6px 8px;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
}
.cmp-table th.cmp-num, .cmp-table td.cmp-num { text-align: right; }
.cmp-table th[aria-sort="descending"]::after { content: " ↓"; }
.cmp-table th[aria-sort="ascending"]::after { content: " ↑"; }
.cmp-table td { padding: 5px 8px; border-bottom: 1px solid #f0f1f3; white-space: nowrap; }
.cmp-table tr:hover td { background: #f7f8fa; }
.cmp-table .cmp-base { font-family: "IBM Plex Mono", "Courier New", monospace; font-weight: 600; }
.cmp-table .cmp-sub { color: #8a929c; }
.cmp-table .cmp-flag { font-size: 11px; font-weight: 600; color: #1c2128; background: #e4e7eb; box-shadow: inset 0 0 0 1px #1c2128; border-radius: 3px; padding: 1px 5px; }
.cmp-table svg { vertical-align: middle; }

@media (max-width: 900px) {
    .ra-layout { flex-direction: column; align-items: stretch; padding: 16px; }
    .ra-main { width: 100%; }
    .ra-brand-name { font-size: 19px; }
    .ra-topbar-right { gap: 14px; }
    .ra-topbar-link { white-space: nowrap; }
    .ra-topbar-divider { display: none; }
    .ra-panel { position: static; width: 100%; flex: none; max-height: none; }
    .ra-topbar { padding: 0 16px; }
    .ra-logos { display: none; }
    .cmp-pair { grid-template-columns: 1fr; }
}
/* Phone width: all six top-bar links stay, so the bar grows and the links wrap
   under the brand instead of any being dropped. */
@media (max-width: 520px) {
    .ra-topbar { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 16px; row-gap: 6px; }
    .ra-topbar-right { flex-wrap: wrap; gap: 4px 10px; }
    .ra-topbar-link { font-size: 12px; }
    .ra-brand-name { font-size: 16px; }
}

/* Base/count panel over the composition tracks: the home page's bar panel. */
.cmp-bc-panel {
    position: fixed; z-index: 10000; padding: 8px 10px; background: #fff;
    border: 1px solid #aaa; border-radius: 7px; box-shadow: 0 3px 12px rgba(0,0,0,0.15);
    font-size: 12px; color: #1c2128; cursor: default;
}
.cmp-bc-panel[hidden] { display: none; }
.cmp-bc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-weight: 700; font-size: 13px; }
.cmp-bc-head i { font-weight: 600; }
.cmp-bc-close { background: none; border: none; font-size: 16px; line-height: 1; cursor: pointer; color: #888; padding: 0 2px; }
.cmp-bc-panel table { border-collapse: collapse; font-size: 12px; }
.cmp-bc-panel th { padding: 3px 14px 3px 4px; border-bottom: 1px solid #ccc; text-align: left; font-weight: 600; }
.cmp-bc-panel td { padding: 3px 14px 3px 4px; font-weight: 600; }
.cmp-bc-panel .cmp-num { text-align: right; padding-right: 4px; }
.cmp-bc-panel td.cmp-num, .cmp-bc-panel td.cmp-bc-book { font-weight: 400; }
.cmp-bc-foot { font-size: 11px; color: #888; margin-top: 6px; }
.cmp-bc-foot a { color: #2563eb; text-decoration: underline; }
#cmp-shell-status.ra-shell-error { color: #b42318; }
.cmp-th-name { display: inline-block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; font-style: italic; }

/* Optional secondary-structure card (compare.js renderSecondary). Reuses the
   home page's .ra-ss2d / .sv-* styles from style.css. */
.cmp-ss-card > summary { display: flex; align-items: baseline; gap: 12px; cursor: pointer; list-style: none; }
.cmp-ss-card > summary::-webkit-details-marker { display: none; }
.cmp-ss-card > summary::before { content: "▸"; color: #8a929c; width: 10px; }
.cmp-ss-card[open] > summary::before { content: "▾"; }
.cmp-ss-card > summary h3 { margin: 0; }
.cmp-ss-card[open] > summary .cmp-note { display: none; }
.cmp-ss-body { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.cmp-ss2d { height: 640px; }
.cmp-ss2d .ra-ss2d-svg g.nt.dark circle.dot { fill: #fff; }
.cmp-ss2d .ra-ss2d-svg g.nt.cmp text { cursor: help; }
.cmp-ss2d .ra-ss2d-svg g.nt:not(.cmp) { cursor: inherit; }
.cmp-legend i.cmp-ss-ramp { display: inline-block; width: 90px; height: 10px; border-radius: 2px; }

/* query.html -- the pasted sequence in place of selection A. */
.q-seq {
    height: auto;
    min-height: 120px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.45;
    resize: vertical;
    word-break: break-all;
}
.cmp-side .q-seq { height: auto; }
.q-seq-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.q-file { cursor: pointer; }
.q-align-table td, .q-align-table th { white-space: nowrap; }
.q-align-table tr.q-used td { background: #f3f7fe; }
.q-flag { margin-left: 4px; }
.q-notes { margin: 10px 0 6px; padding-left: 18px; font-size: 13px; color: #3d4450; line-height: 1.5; }
.q-notes li + li { margin-top: 3px; }
#q-align .cmp-note { display: block; margin-top: 8px; }

/* Domain tag on a name when searching Bacteria and Archaea together. */
.cmp-combo-dom {
    margin-left: 6px;
    font-size: 11px;
    color: #8a929c;
}

/* One tab per rRNA when several were compared in one run (compare.js drawTabs). */
.cmp-rna-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-rna-tab {
    padding: 6px 14px;
    border: 1px solid #c9cfd6;
    border-radius: 6px;
    background: #fff;
    font: inherit;
    font-size: 13px;
    color: #1c2128;
    cursor: pointer;
}
.cmp-rna-tab span { color: #5b6470; font-size: 12px; }
.cmp-rna-tab:hover:not(:disabled) { background: #f4f5f7; }
.cmp-rna-tab[aria-selected="true"] { border-color: #1c2128; box-shadow: inset 0 0 0 1px #1c2128; }
.cmp-rna-tab:disabled { cursor: progress; opacity: .6; }
.cmp-rna-tab-err span { color: #b42318; }
