/* Update sets page. Colours come from theme tokens: the palette follows the owner's mock (lane tints, state colours,
   six batch colours) and switches with the theme like app.css (system preference or the manual toggle). */
.view-updatesets, .view-dashboard, .view-instances, .us-key, dialog.us-drawer {
  --us-lane-0: #dfe9f1; --us-lane-1: #e6e4f2; --us-lane-2: #dfeee6;
  --us-st-progress: #b26f12; --us-st-complete: #2c5fc4; --us-st-loaded: #7a8896; --us-st-problems: #be372e; --us-st-previewed: #6e4cc0; --us-st-committed: #1f7f55;
  --us-b1: #138585; --us-b2: #ae3f7b; --us-b3: #4656c2; --us-b4: #9a6116; --us-b5: #5e7f1a; --us-b6: #b4472a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .view-updatesets, :root:not([data-theme="light"]) .view-dashboard, :root:not([data-theme="light"]) .view-instances, :root:not([data-theme="light"]) .us-key, :root:not([data-theme="light"]) dialog.us-drawer {
    --us-lane-0: #152636; --us-lane-1: #1d1e33; --us-lane-2: #14291f;
    --us-st-progress: #e2a447; --us-st-complete: #6f98ee; --us-st-loaded: #8e9caa; --us-st-problems: #ef6b61; --us-st-previewed: #a688f0; --us-st-committed: #4cc08a;
    --us-b1: #3dbdbd; --us-b2: #e06bac; --us-b3: #7c8bf2; --us-b4: #d79a45; --us-b5: #9cc75a; --us-b6: #ee8466;
  }
}
:root[data-theme="dark"] .view-updatesets, :root[data-theme="dark"] .view-dashboard, :root[data-theme="dark"] .view-instances, :root[data-theme="dark"] .us-key, :root[data-theme="dark"] dialog.us-drawer {
  --us-lane-0: #152636; --us-lane-1: #1d1e33; --us-lane-2: #14291f;
  --us-st-progress: #e2a447; --us-st-complete: #6f98ee; --us-st-loaded: #8e9caa; --us-st-problems: #ef6b61; --us-st-previewed: #a688f0; --us-st-committed: #4cc08a;
  --us-b1: #3dbdbd; --us-b2: #e06bac; --us-b3: #7c8bf2; --us-b4: #d79a45; --us-b5: #9cc75a; --us-b6: #ee8466;
}
.s-progress { --c: var(--us-st-progress); } .s-complete { --c: var(--us-st-complete); } .s-loaded { --c: var(--us-st-loaded); }
.s-problems { --c: var(--us-st-problems); } .s-previewed { --c: var(--us-st-previewed); } .s-committed { --c: var(--us-st-committed); }


/* page */
.view-updatesets { display: flex; flex-direction: column; gap: var(--space-3); }
#view .view-updatesets > .page-head, .view-updatesets > .tabs, .view-updatesets > .filter-row { margin: 0; } /* the page's gap spaces them: no doubled margins */

.us-count { margin: 0; }
.us-readat { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.us-key { margin-top: var(--space-3); }
.us-key-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 0.5rem 1.2rem; margin: 0.4rem 0; padding: 0; list-style: none; font-size: 0.85rem; }
.us-key-grid li { display: flex; align-items: flex-start; gap: 0.5rem; }
.us-key-grid .us-dot, .us-key-grid .icon, .us-key-grid .us-slot { margin-top: 0.2rem; flex: none; }
.us-key .us-slot { width: auto; }

/* sections: Igloo's table frame with the head holding the title, the count and the tools */
.table-frame-right .btn-link { white-space: nowrap; }

/* the table */
.us-table { table-layout: auto; }
.us-table thead th { position: sticky; top: 0; z-index: 3; background: var(--surface); box-shadow: inset 0 -1px 0 var(--border); }
.us-table tbody th.us-name { font-weight: 400; }
.us-table .us-row { cursor: pointer; }
.us-table .us-row.is-selected > * { background: var(--hover); }
.us-namewrap { display: flex; align-items: flex-start; gap: 0.5rem; }
.us-table.has-rail .us-namewrap { padding-left: var(--gw, 0); }
.us-slot { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; height: 1.3rem; color: var(--muted); }
.us-slot .icon svg { width: 1.05rem; height: 1.05rem; display: block; }
.us-slot.is-batch-test svg * { stroke-dasharray: 3 2.2; }
.us-namebody { min-width: 0; }
.us-gname { border: 0; background: none; padding: 0; text-align: left; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; overflow-wrap: anywhere; line-height: 1.3; }
.us-gname:hover { text-decoration: underline; }
.us-sub { color: var(--muted); font-size: 0.78rem; font-weight: 400; overflow-wrap: anywhere; }
.us-issues { min-width: 11rem; }
.us-pills { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0; }
.us-pills > li { margin: 0 !important; }
.us-cell { width: 9.5rem; min-width: 8.5rem; vertical-align: top; }
.us-h-cell { width: 9.5rem; text-align: left; }
.us-cell .us-bdg { margin-bottom: 0.25rem; }
.us-cell-line { font-size: 0.78rem; white-space: nowrap; }
.us-cell-note { font-size: 0.72rem; color: var(--muted); }


.us-tablewrap { position: relative; }
/* like the Pipeline: the top of the page stays put and the table scrolls inside its frame (below a floor the page scrolls instead) */
.view-updatesets > .us-all { flex: 1; min-height: min(22rem, 60vh); }
.us-all > .table-frame { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.us-all .table-frame-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.us-all .table-frame-body > .us-tablewrap { flex: 1; min-height: 0; overflow: auto; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.us-rails { position: absolute; left: 4px; top: 0; z-index: 1; pointer-events: none; overflow: visible; }
.us-tablewrap > .us-rails { left: 0.6rem; }
.us-tag { padding: 0 0.45rem; border-radius: 6px; font-size: 0.72rem; font-weight: 600; background: var(--hover); color: var(--muted); }
.us-tag.is-test { border: 1px dashed var(--muted); }
.us-fold { flex: none; width: 1.3rem; height: 1.3rem; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); cursor: pointer; }
.us-fold svg { width: 0.85rem; height: 0.85rem; transition: transform 0.1s; }
.us-fold[aria-expanded="true"] svg { transform: rotate(90deg); }
@media (max-width: 720px) {
  .us-table, .us-table tbody { display: block; }
  .us-table thead { display: none; }
  .us-table tr { display: grid; grid-template-columns: 1fr auto; align-items: center; border-bottom: 1px solid var(--border); padding: 0.3rem 0; }
  .us-table tr > * { border: 0 !important; padding: 0.2rem 0.6rem !important; width: auto !important; }
  .us-table tr { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .us-table tr > th.us-name, .us-table tr > td.us-issues { grid-column: 1 / -1; }
  .us-cell { width: auto; }
  .us-issues { min-width: 0; }
}

/* dots and badges: filled = the state colour; dashed = not retrieved; dotted = not found; hatched = not here */
.us-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--c, transparent); border: 2px solid var(--c, var(--border)); display: inline-block; }
.us-dot.s-none { background: transparent; border: 2px dashed var(--muted); }
.us-dot.s-nf { background: transparent; border: 2px dotted var(--muted); }
.us-dot.s-na { background: transparent; border: 1px solid var(--border); }
.us-bdg { position: relative; display: grid; place-items: center; flex: none; box-sizing: border-box; width: 4.8rem; height: 1.7rem; padding: 0 0.4rem; border-radius: 7px; font-size: 0.75rem; font-weight: 700; background: var(--c); color: var(--surface); text-decoration: none; }
.us-bdg.is-small { width: 3.8rem; height: 1.45rem; font-size: 0.68rem; border-radius: 5px; }
.us-bdg-ext { position: absolute; right: 0.3rem; top: 50%; transform: translateY(-50%); display: inline-flex; opacity: 0; transition: opacity 0.1s; }
a.us-bdg.is-link:hover .us-bdg-ext, a.us-bdg.is-link:focus-visible .us-bdg-ext { opacity: 0.9; }
.us-bdg-ext svg { width: 0.68rem; height: 0.68rem; }
.us-bdg.is-link { padding: 0 1.1rem; }
.us-bdg.is-small.is-link { padding: 0 0.95rem; }
.us-bdg-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.us-bdg.is-link { cursor: pointer; }
a.us-bdg.is-link:hover { outline: 2px solid var(--focus); outline-offset: 1px; }
.us-bdg.s-none { background: transparent; color: var(--muted); border: 1.5px dashed var(--muted); }
.us-bdg.s-nf { background: transparent; color: var(--muted); border: 1.5px dotted var(--muted); }
.us-bdg.s-na { background: repeating-linear-gradient(135deg, var(--hover) 0 4px, transparent 4px 8px); color: var(--muted); border: 1px solid var(--border); }
.us-bdg-mark { position: absolute; right: -4px; top: -4px; width: 12px; height: 12px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--border); }
.us-bdg-mark svg { width: 9px; height: 9px; display: block; }
.us-bdg-mark .mark, .us-bdg-mark .icon, .us-bdg-mark .sev-icon { display: grid; place-items: center; width: 100%; height: 100%; }
.us-bdg.is-small .us-bdg-mark { width: 10px; height: 10px; right: -3px; top: -3px; }
.us-dot-glyph { width: 5px; height: 5px; border-radius: 50%; background: var(--text); display: block; }
.us-badges { display: flex; gap: 6px; flex: none; }
.us-pill { margin-left: 0.5rem; padding: 0.05rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; background: color-mix(in srgb, var(--c, var(--muted)) 16%, transparent); color: var(--c, var(--muted)); }

/* the update set drawer reuses the app drawer's shell and content styles; these are its own lists */
.us-d-path { margin: 0 0 0.3rem; overflow-wrap: anywhere; }
.us-d-path .btn-link { text-align: left; }
.us-drawer .us-bdg { width: 3.8rem; height: 1.45rem; font-size: 0.68rem; border-radius: 5px; }
.us-drawer .detail-table td, .us-drawer .detail-table th { overflow-wrap: anywhere; }
.us-drawer .detail-table thead th { white-space: nowrap; }
.us-state-cell { display: inline-flex; align-items: center; gap: 0.5rem; white-space: nowrap; }
.us-contents { position: relative; margin: 0; padding: 0; list-style: none; }
.us-contents-row { margin: 0; padding: 0.45rem 0 0.45rem var(--gw); border-bottom: 1px solid var(--border); }
.us-contents-row .us-badges { justify-content: flex-end; margin-top: 0.3rem; }
.us-kid .us-badges { flex: none; }
.us-contents-row .us-gname, .us-kid .us-gname { font-weight: 400; }
.us-contents-row .us-gname[aria-current] { text-decoration: underline; }
.us-kids { margin: 0; }
.us-kid { display: flex; align-items: center; gap: 0.75rem; padding: 0.45rem 0; border-bottom: 1px solid var(--border); }
.us-kid-name { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 0.5rem; }
.us-kid-name .us-gname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.us-kid-name .us-tag { flex: none; }

@media (max-width: 520px) {
  .us-bdg { width: 3.8rem; }

}
.us-dot.s-nr { background: transparent; border: 2px dotted var(--sev-warn); }
.us-bdg.s-nr { background: transparent; color: var(--sev-warn); border: 1.5px dotted var(--sev-warn); }
/* filter row: search and the menus on one line, wrapping on smaller screens; Clear filters stays at the right */
.view-updatesets > .filter-row .toolbar-group { flex: 1 1 auto; min-width: 0; }
.view-updatesets > .filter-row .search-box { flex: 1 1 14rem; max-width: 24rem; }
.view-updatesets > .filter-row .search { width: 100%; }
.choice-menu .source-row, .show-menu .source-row { padding: 0; }
.choice-menu .source-label, .show-menu .source-label { padding: 0.4rem 0.6rem; border-radius: 8px; cursor: pointer; }
.choice-menu .source-label *, .show-menu .source-label * { cursor: pointer; }
.choice-menu .source-panel { min-width: 15rem; max-height: min(22rem, 60vh); overflow-y: auto; }
.choice-menu .source-button.is-active { border-color: var(--brand); }
.choice-menu .source-button-text { max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* the in-flight chart on the Dashboard uses the page's state colours */
.tone-us-progress { background: var(--us-st-progress); } .tone-us-complete { background: var(--us-st-complete); } .tone-us-loaded { background: var(--us-st-loaded); }
.tone-us-previewed { background: var(--us-st-previewed); } .tone-us-problems { background: var(--us-st-problems); }
.stack-seg[class*="tone-us-"] { color: var(--surface); }

/* one table: the view switch, and the sets of a shown batch tree that do not match the filters */
.us-all { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.us-viewswitch { display: inline-flex; align-items: center; gap: 0.4rem; }
.us-view-icon { color: var(--muted); }
.us-view-icon.is-on { color: var(--accent); }
.us-view-icon svg { width: 1.15rem; height: 1.15rem; }
.us-row.is-context > th, .us-row.is-context > td { color: var(--muted); }
.us-row.is-context .us-gname { color: var(--muted); font-weight: 400; }
.us-row.is-context .us-bdg, .us-row.is-context .us-pills, .us-row.is-context .us-slot { opacity: 0.6; }
