/* All variables and rules belong to the chart component. */
.cyb-cl {
    --cl-bg: #fff;
    --cl-text: #172a32;
    --cl-heading: #173a49;
    --cl-muted: #49636e;
    --cl-border: #d7e2e6;
    --cl-input-border: #aebfc6;
    --cl-box: #f0f6f8;
    --cl-accent: #007386;
    --cl-button: #007f94;
    --cl-focus: #007f94;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 24px;
    margin: 20px 0;
    background: var(--cl-bg);
    color: var(--cl-text);
    border: 1px solid var(--cl-border);
    border-radius: 10px;
    font: 16px/1.5 Arial, sans-serif;
    color-scheme: light;
}
.cyb-cl[data-cl-theme="dark"] {
    --cl-bg: #152731;
    --cl-text: #e4f0f5;
    --cl-heading: #e6f3f8;
    --cl-muted: #b1c8d3;
    --cl-border: #486674;
    --cl-input-border: #78929e;
    --cl-box: #203944;
    --cl-accent: #75d3e4;
    --cl-button: #086c80;
    --cl-focus: #75d3e4;
    color-scheme: dark;
}
.cyb-cl *, .cyb-cl *::before, .cyb-cl *::after { box-sizing: border-box; }
.cyb-cl .cyb-cl-title { margin: 0 0 20px; color: var(--cl-heading); font: bold 24px/1.3 Arial, sans-serif; }
.cyb-cl .cyb-cl-heading { margin: 0 0 12px; color: var(--cl-heading); font: bold 20px/1.3 Arial, sans-serif; }
.cyb-cl .cyb-cl-controls, .cyb-cl .cyb-cl-downloads {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
}
.cyb-cl .cyb-cl-controls { margin: 0 0 24px; }
.cyb-cl .cyb-cl-label { display: flex; flex-direction: column; gap: 5px; margin: 0; color: var(--cl-text); font-size: 14px; }
.cyb-cl .cyb-cl-select, .cyb-cl .cyb-cl-number {
    width: auto;
    max-width: 100%;
    min-height: 42px;
    padding: 8px;
    background: var(--cl-bg);
    color: var(--cl-text);
    border: 1px solid var(--cl-input-border);
    border-radius: 5px;
    font: 16px Arial, sans-serif;
}
/* Public-page Nice Select initialization must not hide the native controls. */
.cyb-cl .cyb-cl-select { display: block !important; appearance: auto; }
.cyb-cl .cyb-cl-select + .nice-select { display: none !important; }
.cyb-cl .cyb-cl-number { width: 175px; }
.cyb-cl .cyb-cl-button {
    min-height: 42px;
    padding: 9px 15px;
    border: 1px solid var(--cl-input-border);
    border-radius: 5px;
    background: var(--cl-button);
    color: #fff;
    cursor: pointer;
    font: inherit;
}
.cyb-cl .cyb-cl-button:disabled, .cyb-cl .cyb-cl-select:disabled { opacity: .45; cursor: default; }
.cyb-cl .cyb-cl-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.cyb-cl .cyb-cl-pair.cyb-cl-single { grid-template-columns: minmax(0, 1fr); }
.cyb-cl .cyb-cl-chart-card, .cyb-cl .cyb-cl-chart { width: 100%; min-width: 0; }
.cyb-cl .cyb-cl-svg { display: block; width: 100%; height: auto; }
.cyb-cl .cyb-cl-downloads { margin: 12px 0; }
.cyb-cl .cyb-cl-point { margin-top: 16px; }
.cyb-cl .cyb-cl-point-head { margin: 8px 0; color: var(--cl-muted); font-size: 14px; }
.cyb-cl .cyb-cl-boxes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cyb-cl .cyb-cl-box { padding: 12px; border: 1px solid var(--cl-border); border-radius: 6px; background: var(--cl-box); overflow-wrap: anywhere; }
.cyb-cl .cyb-cl-box strong { display: block; margin-bottom: 6px; color: var(--cl-accent); font-size: 14px; }
.cyb-cl .cyb-cl-box div { font-size: 13px; line-height: 1.65; white-space: pre-line; font-variant-numeric: tabular-nums; }
.cyb-cl .cyb-cl-note { margin: 12px 0 0; color: var(--cl-muted); font-size: 14px; overflow-wrap: anywhere; }
.cyb-cl [hidden] { display: none !important; }
.cyb-cl :focus-visible { outline: 3px solid var(--cl-focus); outline-offset: 3px; }
@media (max-width: 1100px) {
    .cyb-cl .cyb-cl-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .cyb-cl { padding: 16px; }
    .cyb-cl .cyb-cl-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
    .cyb-cl { padding: 12px; }
    .cyb-cl .cyb-cl-boxes { grid-template-columns: minmax(0, 1fr); }
}
/* Side layout (evaluation pages, owner 2026-10-10): on a wide screen the measured-point boxes sit beside the chart, so one
   graph and its readout fit one screen. The host (code/psuMeasuredCharts.php) asks for it with data-cyb-cl-layout="side";
   title, controls and notes keep the full width; narrower screens stack as before. */
@media (min-width: 1200px) {
    .cyb-cl-host[data-cyb-cl-layout="side"] .cyb-cl { display: grid; grid-template-columns: minmax(0, 3fr) minmax(300px, 2fr); column-gap: 24px; align-items: start; }
    .cyb-cl-host[data-cyb-cl-layout="side"] .cyb-cl > * { grid-column: 1 / -1; }
    .cyb-cl-host[data-cyb-cl-layout="side"] .cyb-cl > .cyb-cl-pair { grid-column: 1; }
    .cyb-cl-host[data-cyb-cl-layout="side"] .cyb-cl > .cyb-cl-point { grid-column: 2; margin-top: 0; }
    .cyb-cl-host[data-cyb-cl-layout="side"] .cyb-cl .cyb-cl-boxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media print {
    .cyb-cl .cyb-cl-controls, .cyb-cl .cyb-cl-downloads { display: none !important; }
    .cyb-cl .cyb-cl-pair { grid-template-columns: minmax(0, 1fr); }
    .cyb-cl .cyb-cl-chart-card { break-inside: avoid; }
}
