/* The interactive view's only stylesheet (style-src 'self'; no inline style). */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #4d4d4d;
  --line: #c4c4c4;
  --accent: #0b5cad;
  --error: #a3161b;
  --warn-bg: #fff4d6;
  --head-bg: #eef2f7;
  --focus: #b35c00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --fg: #eceff3;
    --muted: #b8bec6;
    --line: #4a5058;
    --accent: #7fb6f0;
    --error: #ff8f8f;
    --warn-bg: #3a3015;
    --head-bg: #23272d;
    --focus: #ffb366;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  padding: 0 16px 32px;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
header, main, footer { max-width: 72rem; margin: 0 auto; }
h1 { font-size: 1.5rem; margin: 1rem 0 0.25rem; }
h2 { font-size: 1.2rem; margin-top: 2rem; }
h3 { font-size: 1.05rem; }
.sub, .help, footer { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; }

.skip { position: absolute; left: -999px; top: 0; }
.skip:focus { left: 16px; background: var(--bg); padding: 0.25rem 0.5rem; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.notice:empty { display: none; }
.notice { padding: 0.5rem 0.75rem; border-left: 4px solid var(--accent); }
.notice.error, .error { color: var(--error); border-color: var(--error); }
.warning { background: var(--warn-bg); padding: 0.5rem 0.75rem; }

label { display: block; margin-top: 0.75rem; font-weight: 600; }
input[type="text"], input[type="password"], select {
  width: 100%;
  max-width: 28rem;
  padding: 0.45rem;
  font: inherit;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--muted);
  border-radius: 4px;
}
input[type="file"] { margin-top: 0.25rem; max-width: 100%; }
fieldset { border: 1px solid var(--line); margin: 1rem 0; padding: 0.5rem 1rem 1rem; }
legend { font-weight: 700; padding: 0 0.25rem; }
button {
  font: inherit;
  margin: 0.5rem 0.5rem 0 0;
  padding: 0.4rem 0.9rem;
  min-height: 2.25rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--bg);
  color: var(--accent);
  cursor: pointer;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
a { color: var(--accent); }

.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; }
.problems { color: var(--error); }
.problems:empty { display: none; }

.table-wrap { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; margin-top: 0.5rem; }
caption { text-align: left; color: var(--muted); padding-bottom: 0.25rem; overflow-wrap: anywhere; }
th, td { border: 1px solid var(--line); padding: 0.3rem 0.5rem; text-align: left; vertical-align: top; }
thead th { background: var(--head-bg); }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }

.seal { border-top: 1px solid var(--line); margin-top: 1rem; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.2rem 1rem; }
dt { font-weight: 600; }
dd { margin: 0; }
.outputs li { margin: 0.75rem 0; }
.live-log li { margin: 0.2rem 0; }
.info { color: var(--muted); }

@media (max-width: 40rem) {
  dl { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------ the exploration (st-181) */
/* Group colour slots: explore-lib.js GROUP_PALETTE (U9's colour rule and 3:1 on the page, tested). */
:root {
  --slot-0: #0072b2; --slot-1: #e07000; --slot-2: #52141b; --slot-3: #050561;
  --slot-4: #aa2909; --slot-5: #204a55; --slot-6: #1500d1; --slot-7: #3896f5;
  --slot-bg: #767676; --slot-other: #767676;
}
@media (prefers-color-scheme: dark) {
  :root {
    --slot-0: #56b4e9; --slot-1: #c22700; --slot-2: #fbebad; --slot-3: #356a8d;
    --slot-4: #c7a10a; --slot-5: #c0e7db; --slot-6: #8164f7; --slot-7: #e6ff00;
    --slot-bg: #8c8c8c; --slot-other: #8c8c8c;
  }
}
.exploration { margin-top: 2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.explore-controls { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; align-items: end; }
.explore-controls label { margin-top: 0.5rem; }
.explore-controls select { width: auto; }
.explore-groups { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.75rem 0; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 0.4rem; }
.chip[aria-pressed="true"] { outline: 2px solid var(--fg); }
.swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border: 1px solid var(--fg); }
.swatch.s0 { background: var(--slot-0); } .swatch.s1 { background: var(--slot-1); }
.swatch.s2 { background: var(--slot-2); } .swatch.s3 { background: var(--slot-3); }
.swatch.s4 { background: var(--slot-4); } .swatch.s5 { background: var(--slot-5); }
.swatch.s6 { background: var(--slot-6); } .swatch.s7 { background: var(--slot-7); }
.swatch.other { background: var(--slot-other); } .swatch.bg { background: transparent; border-style: dashed; }
/* The line naming the focused well stays in view while the charts scroll. */
.focus-line { position: sticky; top: 0; z-index: 1; background: var(--bg); border-bottom: 1px solid var(--line); padding: 0.4rem 0; margin: 0; }
/* Nothing a scroll or a focus brings into view lands under the sticky line (WCAG 2.2 2.4.11; code review CR181-2). */
.explore-panel, .explore-panel h4, .explore-panel summary, .well { scroll-margin-top: 5rem; }
.explore-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 64rem) { .explore-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.explore-panel { min-width: 0; }
.explore-panel h4 { margin: 0.5rem 0 0.25rem; font-size: 1rem; }
/* A chart is drawn at its container's width in CSS pixels; on a narrow screen it scrolls rather than shrinks. */
.chart-scroll { overflow-x: auto; }
svg.chart { display: block; overflow: visible; }
svg.chart text { font-size: 12px; fill: var(--fg); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }
svg.chart .axis-label { fill: var(--muted); }
svg.chart .axis path, svg.chart .axis line { stroke: var(--line); }
svg.chart .axis text { fill: var(--muted); }
svg.chart .gridline line { stroke: var(--line); stroke-opacity: 0.5; }
svg.chart .gridline path { display: none; }
svg.chart .boundary { stroke: var(--muted); stroke-dasharray: 3 3; }
svg.chart .band { fill: var(--line); fill-opacity: 0.25; }
svg.chart .ramp { stroke: var(--fg); stroke-width: 1; }
/* plate map chart: every cell outlined; missing values hatched and marked NA */
.well { cursor: pointer; outline: none; }
.well .cell { stroke: var(--fg); stroke-width: 1; }
.well .ring { fill: none; stroke: none; }
.well.sel .ring { stroke: var(--accent); stroke-width: 3; }
.well.focus .ring, .well:focus-visible .ring { stroke: var(--focus); stroke-width: 3; }
.well .bg-outline { fill: none; stroke: var(--slot-bg); stroke-width: 1.5; stroke-dasharray: 4 3; }
svg.chart .well .mark { font-weight: 700; fill: var(--fg); paint-order: stroke; stroke: var(--bg); stroke-width: 3px; }
.hatch { stroke: var(--fg); stroke-width: 1.5; }
.stripe.s0, .dot.s0 { fill: var(--slot-0); } .stripe.s1, .dot.s1 { fill: var(--slot-1); }
.stripe.s2, .dot.s2 { fill: var(--slot-2); } .stripe.s3, .dot.s3 { fill: var(--slot-3); }
.stripe.s4, .dot.s4 { fill: var(--slot-4); } .stripe.s5, .dot.s5 { fill: var(--slot-5); }
.stripe.s6, .dot.s6 { fill: var(--slot-6); } .stripe.s7, .dot.s7 { fill: var(--slot-7); }
.stripe.other, .dot.other { fill: var(--slot-other); } .stripe.bg, .dot.bg { fill: var(--slot-bg); }
/* traces: selected wells keep full strength, others dim; the focused well is drawn thick */
.trace { fill: none; stroke-width: 1.5; stroke-linejoin: round; }
.trace.s0 { stroke: var(--slot-0); } .trace.s1 { stroke: var(--slot-1); }
.trace.s2 { stroke: var(--slot-2); } .trace.s3 { stroke: var(--slot-3); }
.trace.s4 { stroke: var(--slot-4); } .trace.s5 { stroke: var(--slot-5); }
.trace.s6 { stroke: var(--slot-6); } .trace.s7 { stroke: var(--slot-7); }
.trace.other { stroke: var(--slot-other); } .trace.bg { stroke: var(--slot-bg); }
.trace.dashed { stroke-dasharray: 5 3; }
.trace.dim { stroke-opacity: 0.15; }
.trace.focus { stroke: var(--fg); stroke-width: 3; stroke-opacity: 1; stroke-dasharray: none; }
.hit { fill: none; stroke: transparent; stroke-width: 10; pointer-events: stroke; cursor: pointer; }
.dot { stroke: var(--bg); stroke-width: 1; cursor: pointer; }
.dot.dim { opacity: 0.2; }
.dot.focus { stroke: var(--fg); stroke-width: 2.5; }
.empty { padding: 1rem; border: 1px dashed var(--line); text-align: center; }
.tableview summary { cursor: pointer; }
.tablewrap { overflow: auto; max-height: 24rem; }
.tablewrap tr.sel th, .tablewrap tr.sel td { background: var(--head-bg); }
@media (prefers-reduced-motion: reduce) { .exploration * { transition: none !important; animation: none !important; } }
