/* ==========================================================================
   Shot-to-Track comparison with a measured image (release 7.9.0, lane L09;
   S-10 section 9): the view mounted in the Experiment Runs page. Built on the
   tokens of assets/lab-core/labs.css: one accent, plain text labels, no chips,
   badges, glows or gradients. Chart colours: the site's first two series
   colours (the synthetic side in the accent, the measured side in #b54708),
   checked for colour vision deficiency on the page colour; every chart has
   its values as a table too.
   ========================================================================== */

.mc-view { --mc-synthetic: var(--accent); --mc-measured: #b54708; --mc-out: #a9c4e0; color: var(--text); font-size: 13px; line-height: 20px; }
.mc-view[hidden], .mc-view [hidden] { display: none; }
.mc-block { margin: 0 0 20px; }
.mc-block:last-child { margin-bottom: 0; }
.mc-block > h3 { margin: 16px 0 8px; color: var(--text); font-size: 14px; font-weight: 600; line-height: 20px; }
.mc-view .message { margin: 0 0 8px; color: var(--text-2); }
.mc-view .message[data-kind="stale"] { color: var(--error); }
.mc-message:empty { display: none; }

/* ---- add a measured image ------------------------------------------------ */
.mc-file { display: grid; gap: 4px; max-width: 520px; margin: 8px 0; }
.mc-file label { color: var(--text); }
.mc-file input[type="file"] { max-width: 100%; font-size: 13px; }
.mc-view .buttonrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.mc-confirm { max-width: 720px; margin: 8px 0; padding: 8px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mc-confirm .message { color: var(--text); }

/* ---- plate and batch (fix round FX02, V790-Q01): the run's CR-39 batch and a documented substitute -------- */
.mc-plate { max-width: 720px; margin: 8px 0 16px; padding: 4px 0 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.mc-plate > h4 { margin: 8px 0 4px; color: var(--text); font-size: 13px; font-weight: 600; line-height: 20px; }
.mc-field { display: grid; gap: 4px; max-width: 520px; margin: 8px 0; }
.mc-field label { color: var(--text); }
.mc-field input, .mc-field textarea { box-sizing: border-box; width: 100%; max-width: 100%; font: inherit; }

/* ---- side by side -------------------------------------------------------- */
.mc-panes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.mc-panes[data-layout="stacked"] { grid-template-columns: minmax(0, 1fr); }
.mc-pane { min-width: 0; margin: 0; }
.mc-pane figcaption { display: grid; gap: 0; margin: 0 0 6px; }
.mc-pane-title { color: var(--text); font-weight: 600; }
.mc-pane-label { color: var(--text-2); font-size: 12px; line-height: 18px; overflow-wrap: anywhere; }
.mc-frame { line-height: 0; }
.mc-canvas { display: block; max-width: 100%; background: var(--surface-2); border: 1px solid var(--border); }
.mc-scale { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; color: var(--text-2); font-size: 12px; line-height: 16px; }
.mc-scale-bar { height: 4px; border-radius: 2px; background: var(--text); }
.mc-scale-line { margin-top: 8px; }
.mc-meta { margin-top: 12px; }
.mc-table td, .mc-table th { vertical-align: top; }
.mc-table th[scope="row"] { white-space: nowrap; }
@media (max-width: 600px) { .mc-table th[scope="row"] { white-space: normal; } }

/* ---- the prediction ------------------------------------------------------ */
.mc-status { margin: 0 0 8px; color: var(--text); font-size: 14px; font-weight: 600; line-height: 22px; }
.mc-status[data-status="discrepant"], .mc-status[data-status="refused"] { color: var(--error); }
.mc-list { margin: 4px 0 12px; padding: 0 0 0 20px; color: var(--text); }
.mc-list li { margin: 0 0 4px; }
.mc-places strong { font-weight: 600; }
.mc-caveat { margin: 8px 0 0; color: var(--text); font-weight: 600; }

/* ---- charts (SVG; the values are also in the tables beside them) --------- */
.mc-chart { max-width: 860px; margin: 8px 0 12px; }
.mc-chart-frame { position: relative; }
.mc-svg { display: block; width: 100%; height: auto; overflow: visible; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--page); }
.mc-svg:focus { outline: 2px solid var(--focus); outline-offset: 2px; }
.mc-svg text { fill: var(--text-2); font-family: var(--font); font-size: 12px; }
.mc-grid line { stroke: var(--surface-2); stroke-width: 1; }
.mc-axis { stroke: var(--border-strong); stroke-width: 1; }
.mc-tick-y text, .mc-rail-label { text-anchor: end; font-variant-numeric: tabular-nums; }
.mc-tick-x text { text-anchor: middle; font-variant-numeric: tabular-nums; }
.mc-bar-in, .mc-col-synthetic { fill: var(--mc-synthetic); }
.mc-bar-out { fill: var(--mc-out); }
.mc-col-measured { fill: var(--mc-measured); }
.mc-hot { opacity: .72; }
.mc-hits rect { fill: transparent; pointer-events: all; }
.mc-rail { stroke: var(--text-2); stroke-linecap: round; }
.mc-rail-95 { stroke-width: 2; }
.mc-rail-68 { stroke-width: 6; }
.mc-rail-end { stroke: var(--text-2); stroke-width: 1; }
.mc-rail-text { fill: var(--text); }
.mc-measured line { stroke: var(--text); stroke-width: 2; }
.mc-measured text, .mc-synthetic text { fill: var(--text); font-weight: 600; paint-order: stroke; stroke: var(--page); stroke-width: 3px; stroke-linejoin: round; }
.mc-synthetic path { fill: var(--mc-synthetic); stroke: var(--page); stroke-width: 2; }
.mc-halves text { fill: var(--text); paint-order: stroke; stroke: var(--page); stroke-width: 3px; stroke-linejoin: round; }
.mc-titles text { fill: var(--text); }
.mc-chart figcaption { margin: 6px 0 0; color: var(--text-2); font-size: 12px; line-height: 18px; }
.mc-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 6px; padding: 0; list-style: none; color: var(--text); }
.mc-legend li { display: flex; align-items: center; gap: 6px; }
.mc-key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; }
.mc-key-synthetic { background: var(--mc-synthetic); }
.mc-key-measured { background: var(--mc-measured); }
.mc-values { margin: 6px 0 0; }
.mc-values > summary { color: var(--accent); cursor: pointer; }
.mc-tip { position: absolute; z-index: 2; display: grid; gap: 2px; max-width: 220px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--page); color: var(--text-2); font-size: 12px; line-height: 16px; pointer-events: none; box-shadow: var(--shadow-menu); }
.mc-tip strong { color: var(--text); font-size: 13px; font-weight: 600; }
.mc-tip[hidden] { display: none; }
@media (forced-colors: active) {
  .mc-bar-in, .mc-col-synthetic, .mc-col-measured, .mc-bar-out { fill: CanvasText; }
  .mc-col-measured { fill: GrayText; }
}
