/* 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-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; max-width: 72ch; }
.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; letter-spacing: 0.04em; text-transform: uppercase; 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; }
.cmp-scroll svg { display: block; font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif; }

.cmp-tooltip {
    position: fixed;
    z-index: 10000;
    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; }
.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: four top-bar links (with Clade deviation) must fit beside the brand. */
@media (max-width: 520px) {
    .ra-topbar-right { gap: 10px; }
    .ra-topbar-link { font-size: 12px; }
    .ra-brand-name { font-size: 16px; }
}
@media (max-width: 400px) {
    .ra-topbar-link[aria-current="page"] { display: none; }
}

/* 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; }
