/* Collection Operations — the four subviews that extend the existing
 * Operations screen. Everything here is scoped so the legacy operations
 * panels (manual verification, sources, rounds, action history) keep their
 * exact look; only the new shapes are defined. Classes from the theme are
 * reused wherever they exist (opstable, opscards, opsalert, grouprow,
 * modeswitch, tablescroll, pill, opsline, opsnote, skeleton): this file
 * adds only what those cannot express.
 */

/* ---- Head panel: subview switch, window + refresh, freshness ---------- */
.colhead .modeswitch { flex-wrap: wrap; margin: 4px 0 12px; }
.coltools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 2px 0 4px; }
.colwindow { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.colwindow select { padding: 8px 10px; font-size: 13px; width: auto; }
.colhead #colrefresh { background: #fff; color: #33505f; border: 1px solid #cbd6dc; padding: 8px 13px; font-size: 13px; }
.colfresh { flex: 1 1 auto; text-align: right; min-width: 220px; }
.collegacyline { margin: 0 0 8px; }

/* ---- Group rows ---------------------------------------------------------
   The row is opened by a real <button> (keyboard reachable by default);
   the button is reset to look like the surrounding row text. */
.colgroup .groupopen {
  display: block; flex: 1 1 auto; min-width: 0; width: 100%;
  background: none; border: 0; padding: 0; margin: 0;
  color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.colgroup .groupopen:hover b, .colgroup .groupopen:focus-visible b { color: var(--accent); }
.colgroup .rowline { display: block; }
.colgroup .groupactions button { white-space: nowrap; }

/* Tone pills for collection states. The theme's base pill is deliberately
   neutral and legacy never defines warn/good; this view needs the
   distinction visible, and scoping it to #colroot leaves every other view
   (including the legacy operations panels) exactly as it was. */
#colroot .pill.good { background: #e7f6ee; border-color: #b8e2c6; color: #1c6b38; }
#colroot .pill.warn { background: #fff4d9; border-color: #f0dca8; color: #8a6100; }

/* ---- Inline group detail -----------------------------------------------
   An expanded panel under the group row, not a dialog: the keyword ×
   country matrix stays in reading flow and the page keeps its scroll. */
.coldetail {
  border-left: 3px solid var(--accent-soft);
  background: #fbfdfe; border-radius: 0 8px 8px 0;
  padding: 12px 16px; margin: 4px 0 10px;
}
.coldetail[hidden] { display: none; }
.coldetail h3.coldetailtitle { font-size: 15px; margin: 2px 0 6px; }
.coldetail h3.coldetailtitle:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.coldetail h4 { font-size: 13.5px; margin: 14px 0 6px; }
.coldetail .secondary { margin-top: 12px; }
#colroot .opstable td.num, #colroot .opstable th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Vocabulary and slice chips ---------------------------------------- */
.colchips { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 8px; }
.colselline { margin: 2px 0; }
.colselline .chip { display: inline-block; margin: 1px 0; }

/* ---- Action queue: failures grouped by cause ---------------------------- */
.colcause { border-top: 1px solid #e6edf0; padding: 12px 0 6px; }
.colcause:first-of-type { border-top: 0; }
.colcause h3 { font-size: 14px; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.colcause h3 .pill { font-size: 11.5px; }
.colaction { padding: 6px 0 10px; border-top: 1px dashed #edf2f5; }
.colaction:first-of-type { border-top: 0; }
.colaction .affected { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

/* ---- Narrow screens ------------------------------------------------------
   The legacy .grouprow already collapses to a column at 760px; these follow
   the same breakpoints so the two halves of the view switch together. */
@media (max-width: 700px) {
  .coltools { flex-direction: column; align-items: stretch; }
  .colfresh { text-align: left; min-width: 0; }
  .coldetail { padding: 10px 12px; }
  .colcause h3 { flex-wrap: wrap; }
}
