/* "Compare variables" section of the plot panel (static/plots/compare.js).
   Reuses the controls, facts and figure styles of evolution.css (te-*);
   only what is new lives here. */

.tp-compare:empty { display: none; }

.tc-root {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    color: var(--tp-ink, #0b0b0b);
}

/* Variable toggles */
.tc-vars { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.tc-var {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font: inherit;
    font-size: 0.8rem;
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: var(--tp-ink-2, #52514e);
    cursor: pointer;
}
.tc-var .te-dot { background: #fff; box-shadow: inset 0 0 0 1.5px var(--tc-c); }
.tc-var[aria-pressed="true"] {
    border-color: var(--tc-c);
    color: var(--tp-ink, #0b0b0b);
    font-weight: 600;
    background: color-mix(in srgb, var(--tc-c) 9%, #fff);
}
.tc-var[aria-pressed="true"] .te-dot { background: var(--tc-c); box-shadow: none; }
.tc-var:disabled { opacity: 0.5; cursor: not-allowed; }
.tc-var:focus-visible { outline: 2px solid var(--tc-c); outline-offset: 1px; }
.tc-unit { font-weight: 400; color: var(--tp-muted, #898781); font-size: 0.74rem; }
.tc-site { font-weight: 400; color: var(--tp-muted, #898781); font-size: 0.72rem; margin-left: 0.3rem; }

/* Figures: the time plots use the full width, the pair figures sit side by side. */
.tc-figs { display: flex; flex-direction: column; gap: 0.9rem; min-width: 0; }
.tc-figs-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
    gap: 0.9rem 1.2rem;
}
.tc-chart { border-radius: 4px; position: relative; }
.tc-chart svg text { font-variant-numeric: tabular-nums; }
.tc-row { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tc-row + .tc-row { margin-top: 2px; }
.tc-figs .te-fig figcaption { display: flex; flex-direction: column; gap: 2px; }
.tc-row-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--tp-ink, #0b0b0b);
}
.tc-row-head .te-dot { background: var(--tc-c); }

/* Correlation */
.tc-corr { display: flex; flex-direction: column; gap: 0.6rem; min-width: 0; }
.tc-sub {
    margin: 0.3rem 0 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tp-ink, #0b0b0b);
}
/* Greek letters in upper-case labels (ρ would turn into a Latin-looking Ρ). */
.tc-nocase { text-transform: none; }
.tc-swap { align-self: flex-end; padding-bottom: 5px; }
.tc-bar { cursor: pointer; }
.tc-bar:hover { opacity: 0.75; }

.tc-matrix-wrap { overflow-x: auto; max-width: 100%; }
.tc-matrix {
    border-collapse: collapse;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
}
.tc-matrix caption {
    caption-side: bottom;
    text-align: left;
    font-size: 0.72rem;
    color: var(--tp-muted, #898781);
    padding-top: 4px;
}
.tc-matrix th {
    font-weight: 600;
    color: var(--tp-ink-2, #52514e);
    padding: 3px 8px;
    white-space: nowrap;
    text-align: left;
}
.tc-matrix th .te-dot { margin-right: 5px; vertical-align: middle; }
/* Human labels are long: let the column heads wrap. */
.tc-matrix thead th { white-space: normal; max-width: 9rem; vertical-align: bottom; line-height: 1.25; }
.tc-cell { padding: 0; border: 1px solid #fff; min-width: 4.2rem; text-align: center; }
.tc-cell button {
    font: inherit;
    color: inherit;
    width: 100%;
    padding: 5px 8px;
    border: 0;
    background: none;
    cursor: pointer;
}
.tc-cell.is-on { outline: 2px solid var(--tp-ink, #0b0b0b); outline-offset: -2px; }
.tc-diag { color: var(--tp-muted, #898781); background: #f3f3f1; padding: 5px 8px; }
