/* AI workforce: glance band, capability grid, capability drawer and records. Tokens only (DESIGN.md). */

/* Glance band ------------------------------------------------------------------------------------------------ */
.workforce-band { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--gutter); align-items: start; }
.workforce-band > .ui-panel { padding: var(--s-5); }
/* Chart headers carry a 28px table toggle; the plain panel title row matches that height so the three titles align. */
.workforce-band .ui-panel-head { align-items: center; min-height: 28px; }
.workforce-band .viz-donut-wrap { gap: var(--s-4) var(--s-6); }
.workforce-band-hint { margin-top: var(--s-3); color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }

.workforce-products { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.workforce-product {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  grid-template-areas: "mark name count" ". bar bar" ". detail detail";
  align-items: center;
  gap: 2px var(--s-3);
  width: 100%;
  min-height: 0;
  padding: var(--s-2);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--t-micro) var(--ease-move), border-color var(--t-micro) var(--ease-move);
}
.workforce-product:hover { background: var(--neutral-soft); }
.workforce-product[aria-pressed="true"] { border-color: var(--accent-line); background: var(--accent-soft); }
.workforce-product:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.workforce-product > .mark { grid-area: mark; }
.workforce-product-name { grid-area: name; min-width: 0; overflow: hidden; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.workforce-product-count { grid-area: count; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; font-variant-numeric: tabular-nums; }
.workforce-product-detail { grid-area: detail; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); font-variant-numeric: tabular-nums; }
.workforce-attention { color: var(--warn); }
.workforce-bar { grid-area: bar; display: block; height: 4px; border-radius: var(--r-full); background: var(--line-subtle); overflow: hidden; }
.workforce-bar-fill { display: block; width: calc(var(--share, 0) * 100%); height: 100%; border-radius: inherit; background: var(--c, var(--accent)); }

/* Capability grid -------------------------------------------------------------------------------------------- */
.workforce-capabilities { display: grid; gap: var(--s-5); }
.workforce-filters { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--s-3) var(--s-6); }
.workforce-filter { display: flex; align-items: center; gap: var(--s-3); min-width: 0; max-width: 100%; }
.workforce-filter-label { flex: none; color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.workforce-option { display: inline-flex; align-items: center; gap: var(--s-2); }
.workforce-shown { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }

.workforce-group { display: grid; gap: var(--s-3); }
.workforce-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); padding-bottom: var(--s-2); border-bottom: 1px solid var(--line-subtle); }
.workforce-group-name { font-size: var(--fs-md); line-height: var(--lh-md); font-weight: 600; }
.workforce-group-count { color: var(--text-3); font-size: var(--fs-sm); line-height: var(--lh-sm); font-variant-numeric: tabular-nums; }

.workforce-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 248px), 1fr)); gap: var(--gutter); margin: 0; padding: 0; list-style: none; }
/* Grid lists own their spacing; the base `li + li` margin would offset every item but the first. */
.workforce-grid > li, .workforce-products > li { display: grid; min-width: 0; margin: 0; }
.workforce-notes > li { margin: 0; }
.workforce-grid .ui-card { gap: var(--s-3); padding: var(--s-4); }
.workforce-grid .ui-card-head { gap: var(--s-2); }
/* Titles hold two lines whether or not they wrap, so the identity row and footer sit at the same height across a row. */
.workforce-grid .ui-card-title { display: -webkit-box; min-height: calc(2 * var(--lh-sm)); overflow: hidden; font-size: var(--fs-sm); line-height: var(--lh-sm); font-weight: 600; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.workforce-grid .ui-card-footer { justify-content: space-between; padding-top: var(--s-2); }
.workforce-card-meta { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.workforce-action { color: var(--text-2); font-family: var(--font-mono); font-size: var(--fs-xs); line-height: var(--lh-xs); overflow-wrap: anywhere; }
.workforce-card-text { display: grid; gap: 2px; min-width: 0; }
.workforce-runs { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); font-variant-numeric: tabular-nums; }
.workforce-version { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.workforce-last { font-variant-numeric: tabular-nums; }
.workforce-unknown { color: var(--text-3); font-style: italic; }

/* Agent identity: generative avatar with the product mark as a corner badge. */
.workforce-identity { position: relative; display: inline-grid; flex: none; }
.workforce-identity-mark { position: absolute; right: -4px; bottom: -4px; display: grid; padding: 1px; border-radius: var(--r-xs); background: var(--surface); }
.ui-card.is-interactive:hover .workforce-identity-mark { background: var(--raised); }
.workforce-identity.is-large .workforce-identity-mark { right: -6px; bottom: -6px; padding: 2px; background: var(--overlay); }

/* Capability drawer -------------------------------------------------------------------------------------------- */
.workforce-drawer { display: grid; gap: var(--s-6); }
.workforce-drawer .ui-section + .ui-section { margin-top: 0; }
.workforce-drawer .ui-section-header { margin-bottom: var(--s-2); }
.workforce-drawer .ui-section-title { font-size: var(--fs-lg); line-height: var(--lh-lg); }
.workforce-drawer .ui-section-body { display: grid; gap: var(--s-3); }
.workforce-drawer-intro { display: flex; align-items: center; gap: var(--s-4); }
.workforce-drawer-intro > div { display: grid; justify-items: start; gap: var(--s-2); min-width: 0; }
.workforce-reason { color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }
.workforce-description { color: var(--text); font-size: var(--fs-md); line-height: var(--lh-md); }
.workforce-note { color: var(--text-3); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.workforce-figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2); }
.workforce-figure { display: grid; gap: 2px; padding: var(--s-3); border: 1px solid var(--line-subtle); border-radius: var(--r-sm); background: var(--raised); }
.workforce-figure-value { color: var(--text); font-size: var(--fs-xl); line-height: var(--lh-xl); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.workforce-figure-label { display: flex; align-items: center; gap: var(--s-1); color: var(--text-2); font-size: var(--fs-xs); line-height: var(--lh-xs); }
.workforce-figure-label::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: var(--r-full); background: var(--tone, var(--chart-1)); }
.workforce-hash { font-family: var(--font-mono); font-size: var(--fs-xs); line-height: var(--lh-xs); overflow-wrap: anywhere; }

/* Records ------------------------------------------------------------------------------------------------------ */
.workforce-cell-product { display: inline-flex; align-items: center; gap: var(--s-2); white-space: nowrap; }
.workforce-method { display: grid; gap: var(--s-4); max-width: 72ch; }
.workforce-notes { display: grid; gap: var(--s-2); margin: 0; padding-left: var(--s-5); color: var(--text-2); font-size: var(--fs-sm); line-height: var(--lh-sm); }

@media (max-width: 1199px) {
  .workforce-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workforce-band > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 639px) {
  .workforce-band { grid-template-columns: minmax(0, 1fr); }
  .workforce-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workforce-drawer-intro { align-items: flex-start; }
}
/* Phones: each capability becomes a compact row (avatar, name, state, action) so the grid stays scannable. */
@media (max-width: 639px) {
  .workforce-grid { gap: var(--s-2); }
  .workforce-grid .ui-card { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; grid-template-areas: "id title pill" "id text text"; align-items: center; gap: 2px var(--s-3); padding: var(--s-3); }
  .workforce-grid :is(.ui-card-head, .ui-card-body, .workforce-card-meta) { display: contents; }
  .workforce-grid .ui-card-title { grid-area: title; min-height: 0; }
  .workforce-grid .ui-card-actions { grid-area: pill; }
  .workforce-grid .workforce-identity { grid-area: id; }
  .workforce-grid .workforce-card-text { grid-area: text; }
  .workforce-grid :is(.ui-card-footer, .workforce-runs) { display: none; }
}
@media (max-width: 639px) {
  .workforce-filter { flex-direction: column; align-items: flex-start; gap: var(--s-2); }
}
