/* Pipeline data quality gate */
.gate { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: calc(var(--gap) * 1.4); align-items: start; }
.verdict-top { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 36px; }
.verdict-top .counts { flex-basis: 100%; }
.verdict .stamp-slot { min-height: 64px; display: flex; align-items: center; padding: 12px 8px 8px; }
.verdict .stamp.big { font-size: clamp(19px, 3.4vw, 38px); padding: 8px 18px 6px; border-width: 4.5px; }
.score { display: flex; align-items: baseline; gap: 6px; }
.score-n { font-size: clamp(44px, 5.5vw, 64px); font-weight: 850; font-variation-settings: "wdth" 115; line-height: 1; font-variant-numeric: tabular-nums; }
.score-of { color: var(--ink-2); font-weight: 600; }
.counts { margin: 0; font-size: 15px; color: var(--ink-2); }
.counts b { font-weight: 750; }
.counts .c { color: var(--deny); } .counts .w { color: var(--review); } .counts .p { color: var(--allow); }
.batch-label { margin: 10px 0 0; }

/* Pipeline run: a real sequence */
.run { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); }
.run li { padding: 12px 14px 14px 0; border-right: 1px solid var(--rule); position: relative; }
.run li + li { padding-left: 14px; }
.run li:last-child { border-right: 0; }
.run .stage { display: flex; align-items: baseline; gap: 8px; font-weight: 700; }
.run .stage .n { font-weight: 800; font-variation-settings: "wdth" 118; color: var(--ink-3); }
.run .state { display: inline-block; margin-top: 6px; font-size: 12.5px; font-weight: 700; padding: 2px 7px; border-radius: 3px; }
.run .state.ok { background: var(--allow-wash); color: var(--allow); }
.run .state.bad { background: var(--deny-wash); color: var(--deny); }
.run .state.warn { background: var(--review-wash); color: var(--review); }
.run .state.skip { background: var(--rule-2); color: var(--ink-2); }
.run p { margin: 6px 0 0; font-size: 13.5px; color: var(--ink-2); }

.note { margin-top: 20px; padding: 16px 18px; background: var(--sheet); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: 0 var(--radius) var(--radius) 0; }
.note h3 { margin: 0 0 6px; }
.note-text { margin: 0 0 12px; font-size: 15.5px; line-height: 1.6; max-width: 80ch; }

/* Data source panel */
.source { position: sticky; top: 16px; padding-left: 22px; border-left: 1px solid var(--rule); display: grid; gap: 10px; align-content: start; }
.source .h2 { font-size: 22px; margin: 0; }
.source p { margin: 0; }
.own-h { margin: 10px 0 0; font-size: 15px; }
.source input[type="file"] { font-size: 13.5px; padding: 8px; min-height: 0; }
.downloads { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.linklike { appearance: none; background: none; border: 0; padding: 2px 0; font: inherit; font-size: 14.5px; color: var(--cobalt); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; text-align: left; }
.linklike:disabled { color: var(--ink-3); cursor: default; text-decoration: none; }

/* Checks table */
.checks-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; }
.checks-head .sub { margin-bottom: 14px; }
.filter { display: inline-flex; border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; }
.filter button { appearance: none; border: 0; background: var(--sheet); font: inherit; font-size: 14px; font-weight: 600; padding: 7px 12px; cursor: pointer; color: var(--ink); }
.filter button + button { border-left: 1px solid var(--ink); }
.filter button[aria-pressed="true"] { background: var(--ink); color: #fff; }
table.checks td { font-size: 14px; }
table.checks td:first-child { width: 112px; padding-top: 12px; }
table.checks .stamp { font-size: 10.5px; padding: 2px 6px 1px; border-width: 2px; }
table.checks .t { font-weight: 650; display: block; }
table.checks .k { color: var(--ink-3); font-size: 12.5px; }
table.checks .ca { color: var(--ink-2); font-size: 13.5px; max-width: 46ch; }
table.checks .ca b { color: var(--ink); font-weight: 600; }
table.checks tr.sev-pass td { color: var(--ink-2); }
table.checks td.obs { font-variant-numeric: tabular-nums; }

/* Charts */
.charts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.chart { margin: 0; padding-top: 10px; border-top: 2px solid var(--ink); }
.chart figcaption { font-weight: 700; margin-bottom: 8px; font-variation-settings: "wdth" 105; }
.chart svg, #col-dist svg { display: block; width: 100%; height: auto; overflow: visible; }
#col-dist svg { max-width: 560px; }
.chart text, #col-dist text { font-family: var(--font); fill: var(--ink-2); }
.chart .lbl, #col-dist .lbl { font-size: 11px; }
.chart .val, #col-dist .val { font-size: 11px; font-weight: 650; fill: var(--ink); }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; }

/* Column view */
.col-pick { max-width: 320px; margin-bottom: 16px; }
.col-view { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.col-prof td, .col-prof th { font-size: 14px; }
#col-dist .empty { color: var(--ink-2); font-size: 14.5px; padding: 12px 0; }

.contract summary { cursor: pointer; font-weight: 650; color: var(--cobalt); }
pre.yaml { margin: 12px 0 0; padding: 14px 16px; background: var(--ink); color: #e8eef6; border-radius: var(--radius); font-size: 12.5px; line-height: 1.55; overflow: auto; max-height: 460px; }

.why { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: var(--gap); }
.why h2 { margin-bottom: 10px; }
.limits { border-left: 3px solid var(--ink); padding-left: 18px; }
.limits ul { padding-left: 18px; margin: 6px 0 0; }
.limits li { margin-bottom: 8px; }

@media (max-width: 980px) {
  .gate, .why, .col-view { grid-template-columns: minmax(0, 1fr); }
  .source { position: static; border-left: 0; padding-left: 0; border-top: 2px solid var(--ink); padding-top: 16px; }
  .charts { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .verdict .stamp.big { font-size: 5.6vw; padding: 6px 12px 4px; border-width: 3.5px; white-space: normal; } /* "Publish with warnings" wraps instead of widening the page */
  .run { grid-template-columns: 1fr 1fr; }
  .run li:nth-child(2) { border-right: 0; }
  .run li:nth-child(3) { padding-left: 0; }
  .run li:nth-child(n+3) { border-top: 1px solid var(--rule); }
  table.checks thead { display: none; }
  table.checks tr { display: grid; grid-template-columns: 1fr 1fr; padding: 10px 0; border-bottom: 1px solid var(--rule); }
  table.checks td { border: 0; padding: 4px 6px 4px 0; }
  table.checks td:first-child, table.checks td:nth-child(2), table.checks td:nth-child(5) { grid-column: 1 / -1; width: auto; }
  table.checks td.obs::before { content: "Observed: "; color: var(--ink-3); }
  table.checks td.exp::before { content: "Expected: "; color: var(--ink-3); }
}

/* Progress while your own files are checked in the worker */
.src-progress { display: block; width: 100%; height: 8px; margin-top: 6px; accent-color: var(--cobalt); }
.src-progress[hidden] { display: none; }
