/* A page's header, and the list frame under it: search, filters, the table, the selection bar and the empty states. */

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; padding: 0; list-style: none; color: var(--dim); font-size: 12px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--ln2); }
.crumbs a:hover { color: var(--tx); text-decoration: underline; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 18px 20px 14px; }
.page-head > div { min-width: 0; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.page-sub { margin: 3px 0 0; color: var(--dim); font-size: 12.5px; max-width: 760px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag-future { padding: 0 6px; border: 1px solid var(--ln2); border-radius: 4px; color: var(--dim); font-size: 10px; font-weight: 700; line-height: 15px; }

.empty { margin: 0; padding: 14px 20px; color: var(--dim); }
.page-empty { margin: 4px 20px 20px; padding: 28px 20px; border: 1px dashed var(--ln2); border-radius: 8px; background: var(--pn); }

.selection-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 6px 4px 10px; border: 1px solid var(--accln); border-radius: 8px; background: var(--accbg); }
.selection-count { margin-right: 4px; color: var(--acct); font-weight: 700; }

.frame { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.panel-host { display: contents; }
.filter-bar { border-top: 1px solid var(--ln); border-bottom: 1px solid var(--ln); }
.filter-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 20px 8px; }
.search { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 8px; border: 1px solid var(--ctl); border-radius: 6px; background: var(--inp); color: var(--dim); }
.search input { border: 0; background: none; outline: none; width: 240px; max-width: 60vw; color: var(--tx); }
.search input::placeholder { color: var(--dim); }
.search:focus-within { outline: 2px solid var(--accm); outline-offset: 1px; }
.filter-rows { display: flex; flex-direction: column; gap: 6px; padding: 2px 20px 10px; }
.filter-line { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px 22px; overflow-x: auto; scrollbar-width: thin; min-width: 0; padding: 2px 0; }
/* A line wider than the bar scrolls inside it, and fades out on the side that has more, so that no chip is simply cut off (ui/scroll-edges.js says which sides). */
.filter-line.is-more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent); }
.filter-line.is-more-left { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 34px), transparent); }
.filter-line.is-more-left.is-more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 34px, #000 calc(100% - 34px), transparent); mask-image: linear-gradient(to right, transparent, #000 34px, #000 calc(100% - 34px), transparent); }
.filter-group { display: flex; align-items: center; gap: 8px; flex: none; }
.filter-label { font-size: 11.5px; font-weight: 600; color: var(--dim); white-space: nowrap; }
/* A row of chips wraps onto more lines rather than widen what holds it (a form's Validity row, in a panel as wide as the window); a filter line scrolls sideways instead, so its chips stay on one. */
.filter-chips { display: flex; flex-wrap: wrap; gap: 5px; flex: none; }
.filter-line .filter-chips { flex-wrap: nowrap; }
.filter-chip { height: 24px; padding: 0 10px; border: 1px solid var(--ln2); border-radius: 999px; background: var(--pn); color: var(--tx); font-size: 12px; cursor: pointer; white-space: nowrap; }
.filter-chip:hover { border-color: var(--accm); }
.filter-chip[aria-pressed="true"] { background: var(--acc); border-color: var(--acc); color: var(--on-acc); font-weight: 600; }

.work { flex: 1; display: flex; align-items: flex-start; min-width: 0; }
.list { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
/* A table wider than its box scrolls inside it, and the page never does. --pad and --gap are the row's side padding and the gap between its tracks; the stuck cells and the handles read them. */
.table { --pad: 20px; --gap: 8px; overflow-x: auto; }
.row {
  --lead-bg: var(--bg);
  position: relative; display: grid; grid-template-columns: var(--columns); gap: var(--gap); align-items: center;
  min-height: 54px; padding: 0 12px 0 var(--pad); border-bottom: 1px solid var(--ln);
}
.row-head { --lead-bg: var(--pn2); min-height: 30px; color: var(--dim); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; background: var(--pn2); }
/* The whole row opens the panel (ui/table.js), so the pointer says so; a control inside keeps its own. */
.row:not(.row-head) { cursor: pointer; }
.row[data-selected] { --lead-bg: linear-gradient(var(--accbg), var(--accbg)), var(--bg); background: var(--accbg); box-shadow: inset 3px 0 0 var(--accm); }
.row:not(.row-head):hover { --lead-bg: var(--hov); background: var(--hov); }
.row[data-selected]:hover { --lead-bg: linear-gradient(var(--accbg), var(--accbg)), var(--bg); background: var(--accbg); }
.row input[type="checkbox"] { position: relative; z-index: 1; accent-color: var(--accm); width: 15px; height: 15px; margin: 0; }
/* A cell keeps to its column. Its words break at spaces only: a value wider than its cell on a line of its own (a hash, a long name) breaks where it must, and an ordinary word
   never does, since no column is drawn narrower than its widest word (`Column.fit`). */
.row > [role="cell"] { min-width: 0; overflow-wrap: break-word; }
.table .row .two b, .table .row .two small, .table .row .status { white-space: normal; overflow: visible; text-overflow: clip; }
.table .row .status { align-items: flex-start; }
.table .row .status i { margin-top: 5px; }
.table .row .mono { overflow-wrap: anywhere; }
.nb { white-space: nowrap; }
.row-pick { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; overflow-wrap: break-word; }
.row-pick:focus-visible { outline-offset: -2px; }
/* The checkbox and the first cell stay in view while the table scrolls sideways. Each is drawn on what its row is drawn on (--lead-bg), above the cells that scroll under it, and reaches
   back over the padding or the gap before it, so that nothing shows between them. 22px is the checkbox's track (CHECK_PX in ui/columns.js). */
.lead-check, .lead-first { position: sticky; z-index: 4; display: flex; align-items: center; align-self: stretch; background: var(--lead-bg); }
.lead-check { left: 0; margin-left: calc(-1 * var(--pad)); padding-left: var(--pad); }
.row[data-selected] .lead-check { box-shadow: inset 3px 0 0 var(--accm); }
.lead-first { left: calc(var(--pad) + 22px + var(--gap)); margin-left: calc(-1 * var(--gap)); padding-left: var(--gap); }
.table:not(.is-narrow) .row { min-width: var(--table-min); }
/* The panel open beside the list: every column stays, in tighter tracks (ui/columns.js), a cell never draws over the next one, and a column whose control the panel has too goes. */
.table.is-narrow { --pad: 14px; --gap: 6px; }
.table.is-narrow .row { grid-template-columns: var(--columns-narrow); min-width: var(--table-min-narrow); padding: 0 8px 0 var(--pad); }
.table.is-narrow .no-beside { display: none; }
.table.is-narrow .row > [role="cell"], .table.is-narrow .row-pick { min-width: 0; overflow: clip; overflow-clip-margin: 2px; }

@media (max-width: 1080px) { .work { flex-direction: column; } .list { width: 100%; flex: none; } }
@media (max-width: 599px) {
  .table.is-narrow { --pad: 20px; --gap: 8px; }
  .table.is-narrow .row { grid-template-columns: var(--columns-phone); min-width: var(--table-min-phone); padding: 0 12px 0 var(--pad); }
  .table.is-narrow .secondary { display: none; }
  .page-head { padding: 14px 14px 10px; }
  .page-actions { width: 100%; }
  .filter-top { padding: 10px 14px 8px; }
  .filter-rows { padding: 2px 14px 10px; }
}
/* A table wider than its box fades out at its right edge while there is more to scroll to; its left edge holds the cells that stay in view. */
.table.is-more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
