/* OpenWorldEngineer: streaming ETL load ramp (artifacts-etl.html, assets/art/etl.js). Builds on styles.css (tokens,
   .card, .seg, .select, .note, .tip); adds only etl- classes. One emphasis colour: the indigo accent marks a missed
   level or a p99 over its limit; everything that held is grey. The load generator's own limit is hatched grey (it is
   not the pipeline's doing). */

.etl {
  container-type: inline-size;
  --etl-ok: #9AA0A8;           /* held: 2.6:1 on the light sheet */
  --etl-miss: var(--accent);   /* missed / over the limit */
  --etl-hatch: #7D838B;
  --etl-limit: var(--ink-2);
  display: grid; gap: 16px; min-width: 0; color: var(--ink); font-size: var(--fs-ui);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .etl { --etl-ok: #6B7078; --etl-hatch: #8B9098; }
}
:root[data-theme="dark"] .etl { --etl-ok: #6B7078; --etl-hatch: #8B9098; }

.etl-head p { max-width: 74ch; }
.etl-quiet { margin: 0; padding: 18px 0; color: var(--muted); }

/* picker row */
.etl-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; min-width: 0; }
.etl-pick label { font-size: var(--fs-small); color: var(--muted); }
.etl-pick .select { min-width: 0; max-width: 100%; }
.etl-att { flex-wrap: wrap; }
.etl-att button { min-width: 34px; padding: 5px 9px; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.etl-note { margin: 0; max-width: 80ch; }

/* main card */
.etl-card { position: relative; padding: 16px; min-width: 0; }
.etl-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.etl-title { margin: 0; font-size: 1.0625rem; font-weight: 650; letter-spacing: -0.02em; }
.etl-link { font-size: var(--fs-small); white-space: nowrap; }
.etl-meta { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.etl-rw { font-family: var(--font-mono); font-size: var(--fs-small); color: var(--muted); white-space: nowrap; }
.etl-sum { margin: 6px 0 0; color: var(--ink-2); line-height: 1.5; max-width: 80ch; }
.etl-stop { margin: 4px 0 0; color: var(--ink); line-height: 1.5; max-width: 80ch; font-weight: 560; }
.etl-src { margin: 4px 0 0; }

.etl-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 12px 0 4px; font-size: 0.75rem; color: var(--muted); }
.etl-lk { display: inline-flex; align-items: center; gap: 6px; }
.etl-sw { width: 12px; height: 12px; border-radius: 0; flex: none; box-sizing: border-box; }
.etl-sw.ok { background: var(--etl-ok); }
.etl-sw.miss { background: var(--etl-miss); }
.etl-sw.forgiven { border: 2px solid var(--etl-miss); background: var(--sheet); }
.etl-sw.cap { border: 1px solid var(--etl-hatch); background: repeating-linear-gradient(135deg, var(--etl-hatch) 0 1.5px, transparent 1.5px 4px); }
.etl-sw.probe { border: 1.5px dashed var(--muted); background: transparent; }
.etl-sw.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--etl-ok); }
.etl-sw.limit { width: 14px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--etl-limit); }

.etl-plot { position: relative; margin-top: 8px; min-width: 0; }
.etl-plot svg { display: block; width: 100%; height: auto; overflow: visible; }
.etl-plot svg:focus { outline: none; }
.etl-plot svg:focus-visible .etl-focus { stroke: var(--accent); }
.etl-empty { padding: 28px 0 18px; color: var(--muted); }

/* svg parts */
.etl-grid { stroke: var(--rule); stroke-width: 1; shape-rendering: crispEdges; }
.etl-axis { stroke: var(--rule-strong); stroke-width: 1; shape-rendering: crispEdges; }
.etl-t { fill: var(--muted); font-size: 11px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.etl-lane-t { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.etl-lane-s { fill: var(--muted); font-size: 11px; }
.etl-b.ok { fill: var(--etl-ok); }
.etl-b.miss { fill: var(--etl-miss); }
.etl-b.forgiven { fill: var(--sheet); stroke: var(--etl-miss); stroke-width: 2; }
.etl-b.cap { fill: url(#etl-hatch); stroke: var(--etl-hatch); stroke-width: 1; }
.etl-b.aborted, .etl-b.probe { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 2; }
.etl-hatch-l { stroke: var(--etl-hatch); stroke-width: 1.5; }
.etl-pl { fill: none; stroke: var(--etl-ok); stroke-width: 1.5; stroke-linejoin: round; }
.etl-dot { stroke: var(--sheet); stroke-width: 1.5; }
.etl-dot.ok { fill: var(--etl-ok); }
.etl-dot.miss { fill: var(--etl-miss); }
.etl-dot.probe { fill: var(--sheet); stroke: var(--muted); stroke-dasharray: none; }
.etl-x { stroke: var(--accent-ink); stroke-width: 2; stroke-linecap: round; }
.etl-limit { stroke: var(--etl-limit); stroke-width: 1.5; stroke-dasharray: 4 3; }
.etl-end { stroke: var(--ink-2); stroke-width: 1.5; }
.etl-end-t { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.etl-col { fill: transparent; }
.etl-fband { fill: var(--hover); }
.etl-fd { fill: var(--ink-2); }
.etl-fd.probe { fill: var(--muted); }
.etl-fk { font-size: 10px; }
.etl-col.is-on { fill: var(--hover); }
.etl-focus { fill: none; stroke: transparent; stroke-width: 2; }

/* all attempts */
.etl-all-h { margin: 0; font-size: 1rem; font-weight: 650; letter-spacing: -0.02em; }
.etl-all-s { margin: 4px 0 12px; }
.etl-grid6 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 20px; }
.etl-m { min-width: 0; }
.etl-m-n { font-size: 0.8125rem; font-weight: 620; color: var(--ink-2); margin-bottom: 6px; }
.etl-m-plot { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 0 4px; }
.etl-m-y { position: relative; height: 96px; }
.etl-m-y span { position: absolute; right: 0; transform: translateY(-50%); font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.etl-m-bars { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; height: 96px; border-bottom: 1px solid var(--rule-strong); }
.etl-m-g { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid var(--rule); pointer-events: none; }
.etl-a {
  position: relative; display: block; height: 100%; min-width: 0; padding: 0; margin: 0; border: 0; border-radius: 0;
  background: transparent; cursor: pointer; z-index: 1;
}
.etl-a:hover { background: var(--hover); }
.etl-a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.etl-a i { position: absolute; left: 50%; bottom: 0; width: min(18px, 70%); transform: translateX(-50%); border-radius: 0; background: var(--etl-ok); }
.etl-a.is-sel i { background: var(--ink-2); }
.etl-a b { position: absolute; left: 50%; transform: translate(-50%, 50%); font-size: 12px; line-height: 1; font-weight: 700; color: var(--accent-ink); }
.etl-a em { position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--muted); }
.etl-m-x { display: grid; grid-template-columns: 30px repeat(8, minmax(0, 1fr)); gap: 0 2px; margin-top: 3px; padding-left: 0; }
.etl-m-x span { text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--muted); }
.etl-m-x span.is-sel { color: var(--ink); font-weight: 700; }
.etl-key { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: 0.75rem; color: var(--muted); }
.etl-key b { color: var(--accent-ink); font-weight: 700; }

@container (max-width: 760px) { .etl-grid6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 420px) {
  .etl-card { padding: 12px; }
  .etl-grid6 { gap: 14px 12px; }
  .etl-m-plot { grid-template-columns: 26px minmax(0, 1fr); }
  .etl-m-x { grid-template-columns: 26px repeat(8, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: no-preference) {
  .etl-a i { transition: background-color 140ms; }
}
