/* Isotherm panel (isotherm_panel.js): the MOF detail modal's isotherm view, also used by the
   report isotherm cards (.rp-iso overrides at the end). */
/* Isotherm plot */
/* Must stay gated on .active — an unconditional display here would override
   the .mof-dtl-panel { display: none } toggle and always show this panel. */
.mof-dtl-iso-panel.active {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: min(62vh, 760px);
    align-items: center;
}
.mof-dtl-iso-grid {
    width: 100%;
    min-height: min(62vh, 760px);
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(220px, 1fr);
    gap: 14px;
    align-items: stretch;
}
.mof-dtl-iso-plot-col { min-width: 0; }
.mof-dtl-iso-plot-wrap {
    width: 100%;
    height: 100%;
    min-height: 395px;
    padding: 8px;
    border: none;
    border-radius: 0;
    background: transparent;
}
.mof-dtl-plot { width: 100%; height: 100%; min-height: 420px; }
.mof-dtl-iso-controls-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    justify-content: flex-start;
}
.mof-dtl-cc-controls {
    display: none;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-sizing: border-box;
}
.mof-dtl-cc-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.mof-dtl-cc-row {
    border: 1px solid #dbe7ec;
    border-radius: 8px;
    padding: 6px 8px;
    background: #f7fbfc;
}
.mof-dtl-cc-row[hidden] { display: none; }
.mof-dtl-cc-row.mof-dtl-cc-row--disabled {
    background: #f0f4f6;
    border-color: #d5e0e6;
}
.mof-dtl-cc-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}
.mof-dtl-cc-title {
    font-size: 0.64rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #546e7a;
    flex: 1 1 auto;
}
.mof-dtl-cc-temp {
    font-size: 0.8rem;
    font-weight: 700;
    color: #22a6b3;
    min-width: 2.3em;
    text-align: right;
}
.mof-dtl-cc-unit {
    font-size: 0.64rem;
    color: #90a4ae;
}
.mof-dtl-cc-note {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #7f8c8d;
    background: #eceff1;
    border: 1px solid #cfd8dc;
    border-radius: 999px;
    padding: 2px 6px;
    white-space: nowrap;
}
.mof-dtl-cc-slider {
    width: 100%;
    accent-color: #22a6b3;
    cursor: pointer;
    height: 14px;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
}
.mof-dtl-cc-slider:disabled {
    accent-color: #b0bec5;
    cursor: not-allowed;
    opacity: 0.55;
}
.mof-dtl-cc-scale {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: #b0bec5;
    margin-top: 1px;
}
/* Mol badge */
.mof-dtl-mol-tabs {
    gap: 6px;
    width: 100%;
    align-items: flex-start;
    padding-bottom: 1rem;
}
.mof-dtl-mol-tab {
    padding: 3px 10px; font-size: 0.75rem; font-weight: 600;
    border: 1px solid var(--mol-color-mid, #dde3ea); border-radius: 4px;
    background: var(--mol-color-soft, #eef1f4); color: var(--mol-color, #455a64); cursor: pointer;
    width: fit-content;
    max-width: 100%;
    text-align: left;
    margin-bottom: 4px;
    font-size: 0.8rem;
    margin-right: 4px;
}
.mof-dtl-mol-tab.active { background: var(--mol-color, #22a6b3); color: #fff; border-color: var(--mol-color, #22a6b3); }
.mof-dtl-mol-sep {
    width: 100%;
    border-top: 1px solid #d9e4ea;
    margin: 8px 0 20px;

}
.mof-dtl-ctrl-heading {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #46697c !important;
    border-bottom: #46697c 1px solid;
}
.mof-dtl-mol-toggle-hint {
    margin: 1px 0;
    align-self: stretch;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
    white-space: normal;
    background: #43c6cf;
    border: 1px solid #36b6bf;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 1px 3px rgba(54, 182, 191, 0.3);
    padding: 4px;
}
.mof-dtl-mol-toggle-hint:hover {
    background: #4fd2db;
}
.mof-dtl-mol-toggle-hint.mof-dtl-mol-toggle-hint--off {
    background: #b0bec5;
    border-color: #90a4ae;
    color: #eceff1;
    box-shadow: none;
}
.mof-dtl-mol-toggle-hint:disabled,
.mof-dtl-mol-toggle-hint[disabled] {
    cursor: not-allowed;
    background: #cfd8dc;
    border-color: #b0bec5;
    color: #607d8b;
    text-decoration: line-through;
    box-shadow: none;
    transform: none;
    filter: none;
}
.mof-dtl-plot-toggle-row {
    width: 100%;
    display: flex;
    gap: 4px;
}
.mof-dtl-plot-toggle-row .mof-dtl-mol-toggle-hint {
    flex: 1 1 0;
    min-width: 0;
    margin: 1px 0;
}
@media (max-width: 700px) {
    .mof-dtl-iso-panel { min-height: 0; }
    .mof-dtl-iso-grid {
        grid-template-columns: 1fr;
        min-height: 0;
    }
    .mof-dtl-iso-controls-col { order: 1; }
    .mof-dtl-iso-plot-col { order: 2; }
    .mof-dtl-iso-plot-wrap { width: 100%; min-height: 300px; }
    .mof-dtl-iso-controls-col { padding-top: 0; }
    .mof-dtl-cc-controls { width: 100%; }
}

/* Report cards: sized by the card, themed by its --sp-* tokens, controls stacked above the plot
   when the card is narrow (a half-width card). */
.rp-iso { container-type: inline-size; width: 100%; }
.rp-iso .mof-dtl-iso-grid { min-height: 0; }
/* Plot then legend in the plot column: the wrap takes the plot's own height, not 100% of the
   column (which stretches to the controls column and pushed the legend out of view). */
.rp-iso .mof-dtl-iso-plot-col { display: flex; flex-direction: column; }
.rp-iso .mof-dtl-iso-plot-wrap { min-height: 0; padding: 0; height: auto; flex: 0 0 auto; }
.rp-iso .mof-dtl-iso-legend { margin-top: 6px; padding-left: 50px; }
.rp-iso .mof-dtl-plot { min-height: 320px; }
.rp-iso .mof-dtl-facet-set { padding-bottom: 0.5rem; }
.rp-iso .mof-dtl-ctrl-heading { margin-top: 0.25rem; }
.rp-iso .mof-dtl-ctrl-heading { color: var(--sp-muted, #46697c) !important; border-bottom-color: var(--sp-line, #46697c); }
.rp-iso .mof-dtl-cc-row { background: var(--sp-panel, #f7fbfc); border-color: var(--sp-line, #dbe7ec); }
.rp-iso .mof-dtl-cc-title { color: var(--sp-muted, #546e7a); }
.rp-iso .mof-dtl-mol-sep { border-top-color: var(--sp-line, #d9e4ea); margin: 4px 0 8px; }
/* Legend under the plot (opts.legend): one entry per style, grouped. */
.mof-dtl-iso-legend { display: flex; flex-wrap: wrap; gap: 4px 22px; width: 100%; margin-top: 4px; font-size: 0.75rem; color: #546e7a; }
.mof-dtl-legend-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.mof-dtl-legend-title { font-size: 0.64rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #90a4ae; text-decoration: underline; text-underline-offset: 2px; }
.mof-dtl-legend-item { display: inline-flex; align-items: center; gap: 3px; transition: opacity 0.15s; }
.mof-dtl-legend-item[hidden], .mof-dtl-legend-group[hidden] { display: none; }
.rp-iso .mof-dtl-iso-legend { color: var(--sp-ink, #546e7a); }
.rp-iso .mof-dtl-legend-title { color: var(--sp-muted, #90a4ae); }
/* View switch (report cards): two buttons side by side at the top of the controls. */
.mof-dtl-view-switch { display: flex; gap: 4px; width: 100%; margin-bottom: 6px; }
.mof-dtl-view-switch .mof-dtl-mol-toggle-hint { flex: 1 1 0; min-width: 0; margin: 1px 0; font-size: 0.72rem; }
/* C-C sliders in one row under the plot (ccRow): equal widths, reset button on the left. */
.mof-dtl-cc-controls--row { margin-top: 6px; }
.mof-dtl-cc-bar { display: flex; align-items: stretch; gap: 6px; width: 100%; }
.mof-dtl-cc-controls--row .mof-dtl-cc-list { flex: 1 1 auto; flex-direction: row; gap: 6px; min-width: 0; }
.mof-dtl-cc-controls--row .mof-dtl-cc-row { flex: 1 1 0; min-width: 0; }
.mof-dtl-cc-controls--row .mof-dtl-cc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mof-dtl-cc-controls--row .mof-dtl-cc-scale span:nth-child(2) { display: none; }
.mof-dtl-cc-reset {
    flex: 0 0 auto;
    width: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #dbe7ec;
    border-radius: 6px;
    background: transparent;
    color: #90a4ae;
    cursor: pointer;
}
.mof-dtl-cc-reset:hover { color: #22a6b3; border-color: #22a6b3; }
.mof-dtl-cc-reset .material-symbols-outlined { font-size: 15px; }
.rp-iso .mof-dtl-cc-reset { border-color: var(--sp-line, #dbe7ec); color: var(--sp-muted, #90a4ae); }
@container (max-width: 640px) {
    .rp-iso .mof-dtl-iso-grid { grid-template-columns: 1fr; }
    .rp-iso .mof-dtl-iso-controls-col { order: 1; padding-top: 0; }
    .rp-iso .mof-dtl-iso-plot-col { order: 2; }
    .rp-iso .mof-dtl-mol-tabs { padding-bottom: 0.25rem; }
}
/* Text toggle after a control heading, e.g. TEMPERATURE (colour-code). */
.mof-dtl-heading-toggle { background: none; border: 0; padding: 0 2px; margin: 0; font: inherit; font-weight: 600; text-transform: none; letter-spacing: 0.02em; color: #90a4ae; cursor: pointer; }
.mof-dtl-heading-toggle:hover { color: #46697c; text-decoration: underline; }
.mof-dtl-heading-toggle--on { color: #00838f; }
.rp-iso .mof-dtl-heading-toggle { color: var(--sp-faint, #90a4ae); }
.rp-iso .mof-dtl-heading-toggle:hover { color: var(--sp-ink, #46697c); }
.rp-iso .mof-dtl-heading-toggle--on { color: var(--sp-focus, #00838f); }
