/* testing pages: structure styles (portal UX rework 2026-11-21). Loaded after app.css. */
.sec[hidden] { display: none; }
.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--clamp, 2); line-clamp: var(--clamp, 2); overflow: hidden; }
.clamp.open { display: block; overflow: visible; }
.clamp-wrap { min-width: 0; }
.clamp-more { padding: 0 4px; margin-top: 2px; font-size: 12px; }
.clamp-more[hidden] { display: none; }

/* test plan */
.plan-tools .form-row { margin-bottom: 8px; }
.plan-tools .plan-expand { margin-left: auto; display: inline-flex; gap: 4px; }
.plan-count { font-size: 12px; margin-top: 8px; }
.plan-groups { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.plan-groups > .sec { margin-top: 0; }
.plan-sum { display: inline-flex; align-items: center; gap: 10px; }
.plan-sum .pbar { width: 90px; flex: none; }
.plan-match { color: var(--accent-text); font-weight: 600; }
.plan-table mark, mark { background: var(--accent-wash); color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: 0 0 0 1px var(--accent); }
.plan-table .tag { white-space: normal; overflow-wrap: anywhere; }
.tstack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tstack > .sec, .tstack > .card { margin: 0; }
details.inline-more { display: inline-block; margin-left: 8px; vertical-align: top; }
details.inline-more > summary { cursor: pointer; color: var(--text-secondary); font-size: 12.5px; }
details.inline-more[open] { display: block; margin: 4px 0 0; }

/* issue page: folded system events */
details.sys-events { border: 1px dashed var(--border); border-radius: 8px; padding: 6px 10px; background: var(--surface-1); }
details.sys-events > summary { cursor: pointer; display: flex; align-items: baseline; gap: 6px; font-size: 13px; list-style: none; flex-wrap: wrap; }
details.sys-events > summary::-webkit-details-marker { display: none; }
details.sys-events > summary::before { content: "▸"; color: var(--text-muted); font-size: 11px; }
details.sys-events[open] > summary::before { content: "▾"; }
details.sys-events .sys-list { margin: 8px 0 2px; }
.issue-layout > div > .sec + .sec, .issue-layout > div > .sec + .card, .issue-layout > div > .card + .sec { margin-top: 12px; }

.stepref-card.sec { padding: 0; }
.stepref-card .stepref-list { margin-top: 8px; }
.stepref-help .secondary { display: inline; }

/* phones: KPI tiles stay compact so the case results come first */
@media (max-width: 700px) {
  .run-tiles .tile { padding: 8px 10px; }
  .run-tiles .tile .value { font-size: 18px; overflow-wrap: anywhere; }
  .run-tiles .tile .delta { display: none; }
  .plan-sum { flex-wrap: wrap; gap: 4px 8px; }
  .plan-sum .pbar { width: 60px; }
  .plan-tools .plan-expand { margin-left: 0; }
}
@media (max-width: 700px) {
  .issue-layout .sec-head, .tstack .sec-head, .plan-groups .sec-head, .editor-layout .sec-head { flex-wrap: wrap; }
  .issue-layout .sec-toggle, .tstack .sec-toggle, .plan-groups .sec-toggle, .editor-layout .sec-toggle { flex-wrap: wrap; flex-basis: 100%; }
  .issue-layout .sec-toggle .sec-title, .tstack .sec-toggle .sec-title, .plan-groups .sec-toggle .sec-title, .editor-layout .sec-toggle .sec-title { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; }
  .issue-layout .sec-sum, .tstack .sec-sum, .plan-groups .sec-sum, .editor-layout .sec-sum { flex-basis: 100%; white-space: normal; }
  .issue-layout .sec-actions, .tstack .sec-actions, .plan-groups .sec-actions, .editor-layout .sec-actions { margin-left: 26px; }
}

/* ---- council round 1 ---- */
/* filter rows: the secondary filters fold behind "Filters (n)" on phones */
.tfilters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.tfilters > .tfold-btn { display: none; }
.tfold { display: contents; }
.tfold > .plan-more { flex-basis: 100%; }
.plan-search { width: 260px; max-width: 100%; }
.tfilters > input[type=search], .tfilters > .dl-search { min-width: 0; }
@media (max-width: 700px) {
  .tfilters { flex: 1 1 100%; }
  .tfilters > input[type=search] { flex: 1 1 140px; width: auto; }
  .tfilters > .tfold-btn { display: inline-flex; }
  .tfold { display: none; }
  .tfold.open { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; min-width: 0; }
  .tfold.open > * { flex: 1 1 140px; min-width: 0; max-width: 100%; }
  .tfold.open > .plan-more { flex-basis: 100%; }
  .tfold select { max-width: 100%; }
}

/* run page: case title is the row's toggle button; the failure shows its step first */
.case-toggle { white-space: normal; display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%; padding: 2px 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600;
  text-align: left; cursor: pointer; border-radius: 4px; }
.case-toggle:hover .case-name { text-decoration: underline; }
.case-toggle .case-twist { color: var(--text-muted); font-size: 11px; flex: none; width: 10px; }
.dl-card-title { min-width: 0; }
.case-toggle .case-name { white-space: normal; min-width: 0; overflow-wrap: anywhere; }
.case-id { font-size: 11.5px; font-weight: 400; overflow-wrap: anywhere; padding-left: 16px; }
.case-fail-col { max-width: 380px; }
.case-fail { min-width: 0; overflow-wrap: anywhere; }
.case-fail-step { font-weight: 600; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-fail-raw { --clamp: 2; }
.case-table td { min-width: 0; }

/* resolve menu (issue page) */
.tmenu { position: relative; display: inline-block; }
.tmenu-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 220px; max-width: min(320px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 2px; padding: 6px;
  background: var(--surface-1); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.tmenu-pop[hidden] { display: none; }
.tmenu-item { justify-content: flex-start; text-align: left; border: 0; background: transparent; width: 100%; min-height: 36px; }
.tmenu-item:hover, .tmenu-item:focus-visible { background: var(--surface-2); }
.tmenu-item.danger { color: var(--critical-text); }
.status-actions { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* suites list: descriptions clamp to 2 lines with an ellipsis (full text in the tooltip) */
.suite-desc-cell { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }

/* touch: 40 px targets for the testing pages' own controls */
@media (pointer: coarse), (max-width: 700px) {
  #main:has(.t-head) :is(.actions, .action-bar, .form-row, .card-head, .cli-row, .status-actions, .editor-actions) :is(button, .btn):not(.info-i):not(.doc-link) { min-height: 40px; }
  #main:has(.t-head) .chip, #main:has(.t-head) .cli-box > summary, #main:has(.t-head) .case-toggle { min-height: 40px; }
  #main:has(.t-head) .cli-box > summary { display: flex; align-items: center; }
  #main:has(.t-head) .case-toggle { align-items: center; }
  #main:has(.t-head) .tmenu-item { min-height: 44px; }
}
a.row-link { color: inherit; text-decoration: none; }
a.row-link:hover { text-decoration: underline; }
.tfilters { margin-bottom: 10px; }
.tfilters .plan-more { min-width: 0; }
#main:has(.t-head) .adv-toggle { white-space: normal; max-width: 100%; text-align: left; flex-wrap: wrap; }
@media (pointer: coarse), (max-width: 700px) {
  #main:has(.t-head) details > summary { min-height: 40px; display: flex; align-items: center; }
}
.t-head h1, .t-head .title { overflow-wrap: anywhere; min-width: 0; }
.issue-layout .md, .issue-layout .hblk, .issue-layout p { overflow-wrap: anywhere; min-width: 0; }
.issue-layout > div { min-width: 0; }

/* ---- council round 2 ---- */
/* test plan: tab strip on desktop, a labelled "View" select on phones (every view reachable, current one named) */
.t-tabbar { margin-bottom: 18px; }
.t-tabbar > .tabs { margin-bottom: 0; }
.t-tabsel-wrap { display: none; }
.plan-more .adv { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.plan-more .adv > .adv-body { flex-basis: 100%; }
.plan-groups .sec-chev { flex: none; }
.plan-groups .sec-title { overflow-wrap: normal; }
/* run page: key tiles vs the rest */
.run-more-btn { display: none; }
/* test library: category tree folds behind a button on phones */
.tree-toggle { display: none; }
@media (max-width: 700px) {
  /* chevron and title stay on one line (the title wraps inside its own box, never below the chevron) */
  .issue-layout .sec-toggle .sec-title, .tstack .sec-toggle .sec-title, .plan-groups .sec-toggle .sec-title, .editor-layout .sec-toggle .sec-title { flex: 1 1 9em; }
  .t-tabbar > .tabs { display: none; }
  .t-tabsel-wrap { display: flex; align-items: center; gap: 10px; }
  .t-tabsel-wrap select { flex: 1; min-width: 0; min-height: 40px; }
  /* key tiles Cases / Passed / Failed / Duration (2 per row); the rest folds behind "More stats" */
  .run-tiles-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 10px; }
  .run-tiles-wrap > .run-tiles { display: contents; }
  .run-tiles .tile.t-more { display: none; }
  .run-tiles-wrap.show-more .tile.t-more { display: block; }
  .run-more-btn { display: inline-flex; margin: -2px 0 10px; max-width: 100%; white-space: normal; text-align: left; }
  /* the tree folds: only the "Categories" button (naming the selection and count) shows */
  .tree-card { max-height: none; padding: 6px 10px; }
  .tree-card > .card-head { display: none; }
  .tree-toggle { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; background: none; border: 0; padding: 4px 6px; font: inherit; color: inherit; text-align: left; cursor: pointer; border-radius: 6px; }
  .tree-toggle:hover { background: var(--hover); }
  .tree-toggle .tree-label { min-width: 0; overflow-wrap: anywhere; }
  .tree-card.tree-open > .tree-toggle .sec-chev { transform: rotate(90deg); }
  .tree-card > #lib-tree { display: none; }
  .tree-card.tree-open > #lib-tree { display: block; max-height: 50vh; overflow-y: auto; margin-top: 6px; }
  .tree-row { min-height: 40px; }
}

/* ---- council round 3 ---- */
/* run page: two equal-width rows of tiles (outcomes, then duration / cost / issues) */
.run-tiles-wrap > .run-tiles { grid-template-columns: repeat(var(--n, 6), minmax(0, 1fr)); margin-bottom: 12px; }
.run-tiles .tile .value { overflow-wrap: anywhere; }
.run-tiles .tile .delta { overflow-wrap: anywhere; }
/* issue page: "Where it applies" is a table on desktop and one labelled card per target on phones */
.targets-cards { display: none; }
.target-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--surface-1); min-width: 0; }
.target-card.pending { border-color: var(--accent); }
.target-card + .target-card { margin-top: 8px; }
.target-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; min-width: 0; }
.target-card .dl-kv { margin: 0; }
.target-card dd { overflow-wrap: anywhere; min-width: 0; }
.target-acts { margin-top: 8px; gap: 6px; }
@media (max-width: 700px) {
  .targets-wide { display: none; }
  .targets-cards { display: block; }
}
@media (pointer: coarse), (max-width: 700px) {
  #main:has(.t-head) .targets-tbl button.small, #main:has(.t-head) .target-acts button.small { min-width: 40px; min-height: 40px; }
}
/* list toolbars: the "More filters" disclosure sits on its own line inside the toolbar's filter group */
.dl-tools > .plan-more { min-width: 0; }
@media (max-width: 700px) { .dl-tools.open > .plan-more { flex-basis: 100%; } }

/* nightly builds: run vs baseline (pages/testing/nightly.js) */
.cmp-head { margin: 4px 0 8px; }
.cmp-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cmp-group { margin: 6px 0; }
.cmp-group > summary { cursor: pointer; padding: 4px 0; }
.cmp-tools { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
/* --- Remulator requests (pages/requests.js) ---------------------------------------------- */
.rprog { display: inline-flex; align-items: center; gap: 6px; }
.rprog .pbar { width: 70px; min-width: 0; }
.rtype-capability { border-color: var(--accent); color: var(--accent-text); }
.rtype-bug { border-color: var(--critical); color: var(--critical-text); }
.rboard-tools { margin-bottom: 12px; }
.rcols { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(165px, 1fr); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.rcol { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; min-height: 120px; display: flex; flex-direction: column; gap: 8px; }
.rcol-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 13px; color: var(--text-secondary); }
.rcol-head .count { font-weight: 500; color: var(--text-muted); }
.rcol-empty { text-align: center; padding: 12px 0; }
.rcard { display: flex; flex-direction: column; gap: 6px; background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; color: inherit; text-decoration: none; }
.rcard:hover, .rcard:focus-visible { border-color: var(--accent); background: var(--hover); }
.rcard-head { display: flex; gap: 6px; align-items: center; font-size: 12px; }
.rcard-title { font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
.rcard-foot { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; }
.rsimilar ul { margin: 4px 0 0; padding-left: 18px; }
.rsimilar li { margin: 2px 0; overflow-wrap: anywhere; }
.rsim-group { margin-top: 8px; }
.rcheck { list-style: none; margin: 0; padding: 0; }
.rcheck li { display: flex; align-items: center; gap: 4px; padding: 4px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rcheck li:last-child { border-bottom: none; }
.rcheck li label { flex: 1; min-width: 0; overflow-wrap: anywhere; display: inline-flex; gap: 6px; align-items: baseline; }
.rcheck li.done label { color: var(--text-secondary); text-decoration: line-through; text-decoration-color: var(--text-muted); }
.rcommits, .rlinks { margin: 0; padding-left: 18px; }
.rcommits li, .rlinks li { margin: 3px 0; overflow-wrap: anywhere; }
.yaml-view { white-space: pre; overflow-x: auto; max-height: 420px; }
.yaml-view mark { background: var(--accent-wash); color: inherit; font-weight: 600; }
.eta-hist ul { margin: 4px 0 0; padding-left: 16px; font-size: 12px; }
.help.keep.good { color: var(--good-text); }
.help.keep.bad { color: var(--critical-text); }
.help.keep.warn { color: var(--warning-text); }
@media (max-width: 700px) {
  .rcols { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: minmax(0, 1fr); overflow-x: visible; }
  .rcol { min-height: 0; }
}

/* Remulator requests: plans and approval (pages/requests.js) */
.rplan { margin: 6px 0 0; }
.rplan-items { margin: 0 0 4px; padding-left: 18px; }
.rplan-items li { padding: 1px 0; overflow-wrap: anywhere; }
.rplan-items li.add { color: var(--good); }
.rplan-items li.add::marker { content: "+  "; }
.rplan-items li.del { color: var(--critical); text-decoration: line-through; }
.rplan-items li.del::marker { content: "−  "; }
.rproposal-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 4px; }
.rproposal-who { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ap-actions { flex-wrap: wrap; }
.rawaiting { border-left: 3px solid var(--warning); }
.rawaiting.mine { border-left-color: var(--accent); }
.rawaiting-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; margin-bottom: 6px; }
.rawaiting-head .ic { color: var(--warning); }
.rapproval { margin-bottom: 10px; }
.rapproval > summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; list-style: none; }
.rapproval > summary::-webkit-details-marker { display: none; }
.rapproval > summary::before { content: "▸"; color: var(--text-muted); }
.rapproval[open] > summary::before { content: "▾"; }
.rapproval[open] > summary { margin-bottom: 8px; }
.rcheck li.pending label { color: var(--text-muted); font-style: italic; }
.rdash-list { list-style: none; margin: 0; padding: 0; }
.rdash-list li { display: flex; gap: 6px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.rdash-list li:last-child { border-bottom: none; }
.rdash-list li a.t { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Remulator requests: decisions, plan risk, code reviews (pages/requests.js) */
.rdecision { border-left: 3px solid var(--warning); margin-bottom: 10px; }
.rdecision.mine { border-left-color: var(--accent); }
.rdecision-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; margin-bottom: 6px; }
.rdecision-req { flex-basis: 100%; overflow-wrap: anywhere; }
.rdecision-ask { font-weight: 600; font-size: 1.15em; overflow-wrap: anywhere; }
.rdecision-opts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 10px; align-items: center; margin-top: 10px; }
.rdecision-effect { overflow-wrap: anywhere; }
.rdecision-note { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.rdecision-note[hidden] { display: none; }
.rdecision-note textarea { flex: 1 1 220px; min-width: 0; min-height: 60px; font-family: var(--font); }
.rdecision-wait { margin-top: 8px; }
.rdecision-detail { margin-top: 8px; }
.rdecision-detail > summary { cursor: pointer; }
@media (max-width: 600px) { .rdecision-opts { grid-template-columns: minmax(0, 1fr); } }
.rq-sub-h { font-size: 14px; margin: 14px 0 8px; }
.rpolicy { margin-bottom: 10px; }
.rpolicy-head { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
.rpolicy-head button { margin-left: auto; }
.rpolicy-modes { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.rpolicy-rules { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 7.5em; overflow-y: auto; }
.rpolicy-off { margin-top: 4px; color: var(--warning); }
.rpolicy-scopes { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.rpolicy-scope { border: 0; padding: 0; margin: 0; min-width: 0; }
.rpolicy-scope legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.rpolicy-radio { display: flex; align-items: center; gap: 4px; padding: 2px 0; cursor: pointer; }
.rpolicy-line { margin-top: 6px; overflow-wrap: anywhere; }
.rpolicy-line.good b { color: var(--good); }
.rrisk { overflow-wrap: anywhere; }
.rrisk.elevated { color: var(--warning); }
.rrisk-effect { margin-top: 6px; }
.rreview > summary { cursor: pointer; overflow-wrap: anywhere; }
.rreview-list { margin: 4px 0 0; padding-left: 18px; }
.rreview-list li { padding: 1px 0; overflow-wrap: anywhere; }
.rout-fixed { color: var(--good); }
.rout-kept { color: var(--warning); }
