/* ==================================================================================================
   Insights screens — owner: insights agent
   Home (.home) · Inbox (.inbox-page, .inbox-*) · bell popover (.notif-bell, .notif-popover, .pop-item)
   Activity entries (.activity-item, .activity-day — shared partials, used in drawers too) and the
   feed page (.activity-page) · Search (.search-page, .search-item) · command palette (.palette)
   Insights (.insights-page, .chart-card, .split, .bar-list) · Workload (.workload-page, .wl-*)
   Shared bits: .filter-bar / .filter-pill (pill <select>), .load-more, .chart-legend.
   Tokens only (app.css); decorative motion lives inside prefers-reduced-motion: no-preference.
   ================================================================================================== */

/* -- Filter bar + pill selects ------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}
.filter-bar__clear {
  color: var(--text-2);
}
.filter-bar__note {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.filter-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  height: var(--control-h-sm);
  border-radius: var(--radius-full);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  transition:
    background-color var(--dur-1) ease,
    box-shadow var(--dur-1) ease,
    color var(--dur-1) ease;
}
.filter-pill:hover {
  background: var(--surface-2);
}
.filter-pill.is-active {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 34%, transparent);
  color: var(--accent-ink);
}
.filter-pill > .icon:first-child {
  position: absolute;
  left: 10px;
  color: var(--text-2);
  pointer-events: none;
}
.filter-pill.is-active > .icon:first-child,
.filter-pill.is-active .filter-pill__chevron {
  color: currentColor;
}
.filter-pill__select {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  max-width: 220px;
  height: 100%;
  padding: 0 28px 0 30px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  field-sizing: content;
}
.filter-pill__select:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}
.filter-pill__select option {
  background: var(--surface-elevated);
  color: var(--text);
}
.filter-pill__chevron {
  position: absolute;
  right: 10px;
  color: var(--text-3);
  pointer-events: none;
}
@media (pointer: coarse) {
  .filter-pill__select {
    font-size: 16px;
  }
}
@media (max-width: 639px) {
  .filter-pill__select {
    max-width: 150px;
  }
  .filter-bar__note {
    width: 100%;
    margin-left: 4px;
  }
}

/* -- Load more ----------------------------------------------------------------------------------- */
.load-more {
  display: flex;
  justify-content: center;
  padding: var(--space-4) 0 var(--space-2);
}
.load-more__button {
  min-width: 160px;
}

/* -- Chart legends (swatch colors are the single source for the canvases: insights.js) ----------- */
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0 0 var(--space-3);
  padding: 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  list-style: none;
}
.chart-legend li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chart-legend__swatch {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--swatch, var(--accent));
}
[data-series="created"] { --swatch: color-mix(in srgb, var(--c-gray) 50%, var(--surface)); }
[data-series="completed"] { --swatch: var(--accent); }
[data-series="not_started"] { --swatch: color-mix(in srgb, var(--accent) 34%, var(--surface)); }
[data-series="in_progress"] { --swatch: var(--accent); }
[data-series="priorities-4"] { --swatch: var(--c-red); }
[data-series="priorities-3"] { --swatch: var(--c-orange); }
[data-series="priorities-2"] { --swatch: var(--c-yellow); }
[data-series="priorities-1"] { --swatch: var(--c-gray); }
[data-series="priorities-0"] { --swatch: color-mix(in srgb, var(--c-gray) 36%, var(--surface)); }
[data-series="types-task"] { --swatch: var(--c-gray); }
[data-series="types-bug"] { --swatch: var(--c-red); }
[data-series="types-feature"] { --swatch: var(--c-purple); }
[data-series="types-improvement"] { --swatch: var(--c-blue); }
[data-series="types-milestone"] { --swatch: var(--c-orange); }

/* -- Activity entries (shared partials) ---------------------------------------------------------- */
.activity-day + .activity-day {
  margin-top: var(--space-5);
}
.activity-day:not(:has(> .activity-day__label)) {
  margin-top: 0;
}
.activity-day__label {
  margin: 0 0 var(--space-1);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.activity-day__items {
  position: relative;
  display: flex;
  flex-direction: column;
}
.activity-item {
  --avatar: 32px;
  position: relative;
  display: grid;
  grid-template-columns: var(--avatar) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
}
.activity-item--compact {
  --avatar: 24px;
  gap: 10px;
  padding: 7px 0;
}
/* Thread line linking the avatars of one day. */
.activity-day__items > .activity-item:not(:last-child)::before {
  content: "";
  position: absolute;
  top: calc(10px + var(--avatar) + 6px);
  bottom: -4px;
  left: calc(var(--avatar) / 2 - 0.5px);
  width: 1px;
  background: var(--line);
}
.activity-day__items > .activity-item--compact:not(:last-child)::before {
  top: calc(7px + var(--avatar) + 5px);
}
.activity-item__avatar {
  position: relative;
  width: var(--avatar);
  height: var(--avatar);
}
.activity-item__system {
  background: var(--fill-2);
  color: var(--text-2);
}
.activity-item__badge {
  position: absolute;
  right: -4px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tone-solid);
  box-shadow: 0 0 0 2px var(--badge-ring, var(--surface));
  color: var(--tone-on);
}
.activity-item--compact .activity-item__badge {
  right: -5px;
  bottom: -4px;
  width: 14px;
  height: 14px;
}
.activity-item__badge .icon {
  width: 9px;
  height: 9px;
}
.activity-item__body {
  min-width: 0;
}
.activity-item__text {
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.activity-item--compact .activity-item__text {
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.activity-item__text strong {
  color: var(--text);
  font-weight: var(--fw-semibold);
}
.activity-item__text a {
  color: var(--text);
  font-weight: var(--fw-medium);
  text-decoration: none;
  transition: color var(--dur-1) ease;
}
.activity-item__text a:hover {
  color: var(--accent-ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 2px;
}
.activity-item__details {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 4px 0 0;
  padding: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
  list-style: none;
}
.activity-item__detail {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.activity-item__quote {
  display: -webkit-box;
  margin: 6px 0 0;
  padding: 8px 12px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--fill-1);
  color: var(--text);
  font-size: var(--fs-sm);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}
.activity-item__quote--compact {
  margin-top: 4px;
  padding: 4px 10px;
  font-size: var(--fs-xs);
  -webkit-line-clamp: 1;
  line-clamp: 1;
}
.activity-item__time {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.activity-item__text > .activity-item__time {
  display: inline;
  margin: 0 0 0 2px;
  white-space: nowrap;
}
.activity-item__text > .activity-item__time::before {
  content: "· ";
}
.activity-item[data-panel-url] .activity-item__text a {
  cursor: pointer;
}

/* Activity feed page: each day is a card */
.activity-page__header {
  margin-bottom: var(--space-4);
}
.activity-page .activity-day__label {
  margin: 0 0 var(--space-2) 4px;
}
.activity-page .activity-day__items {
  padding: 6px 20px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-xs);
}
.activity-page .activity-day:not(:has(> .activity-day__label)) .activity-day__items {
  margin-top: -1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.activity-page .activity-day:has(+ .activity-day:not(:has(> .activity-day__label))) .activity-day__items {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* -- Inbox --------------------------------------------------------------------------------------- */
.inbox-toolbar {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  border-bottom: 1px solid var(--line);
}
.inbox-tabs.tabs {
  flex: 1;
  min-width: 0;
  border-bottom: 0;
}
.inbox-toolbar__action {
  flex-shrink: 0;
  padding-bottom: 4px;
}
.inbox-group + .inbox-group {
  margin-top: var(--space-6);
}
.inbox-group:not(:has(> .inbox-group__label)) {
  margin-top: 0;
}
.inbox-group__label {
  margin: 0 0 var(--space-2) 4px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.inbox-group__items {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-xs);
}
.inbox-group:not(:has(> .inbox-group__label)) .inbox-group__items {
  margin-top: -1px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}
.inbox-group:has(+ .inbox-group:not(:has(> .inbox-group__label))) .inbox-group__items {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.inbox-item {
  --swipe-x: 0px;
  position: relative;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  background: var(--surface);
  touch-action: pan-y;
}
.inbox-item + .inbox-item::before {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 62px;
  height: 1px;
  background: var(--line);
}
.inbox-item__link {
  position: relative;
  z-index: 1;
  display: grid;
  flex: 1;
  grid-template-columns: 10px 32px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  padding: 14px 8px 14px 10px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transform: translateX(var(--swipe-x));
  transition: background-color var(--dur-1) ease;
}
.inbox-item__link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.inbox-item:hover .inbox-item__link,
.inbox-item:hover .inbox-item__actions {
  background: var(--surface-2);
}
.inbox-item__dot {
  justify-self: center;
  width: 8px;
  height: 8px;
  margin-top: 12px;
  border-radius: 50%;
  background: transparent;
  transition:
    background-color var(--dur-2) ease,
    transform var(--dur-2) var(--ease-spring);
  transform: scale(0.4);
}
.inbox-item.is-unread .inbox-item__dot {
  background: var(--accent);
  transform: none;
}
.inbox-item__avatar {
  position: relative;
  width: 32px;
  height: 32px;
}
.inbox-item__badge {
  position: absolute;
  right: -4px;
  bottom: -3px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--tone-solid);
  box-shadow: 0 0 0 2px var(--surface);
  color: var(--tone-on);
}
.inbox-item__badge .icon {
  width: 9px;
  height: 9px;
}
.inbox-item__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.inbox-item__text {
  color: var(--text-2);
  font-size: var(--fs-md);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.inbox-item__text strong {
  color: var(--text);
  font-weight: var(--fw-semibold);
}
.inbox-item:not(.is-unread) .inbox-item__text strong {
  font-weight: var(--fw-medium);
}
.inbox-item__excerpt {
  display: -webkit-box;
  margin-top: 6px;
  padding-left: 10px;
  overflow: hidden;
  border-left: 2px solid var(--line-strong);
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.inbox-item__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 6px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.inbox-item__project {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 60%;
}
.inbox-item__project + time::before {
  content: "·";
  margin-right: 8px;
}
.inbox-item__actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 0 10px 0 2px;
  background: var(--surface);
  transform: translateX(var(--swipe-x));
  transition: background-color var(--dur-1) ease;
}
.inbox-item__toggle {
  color: var(--text-2);
  opacity: 0;
  transition: opacity var(--dur-1) ease;
}
.inbox-item:hover .inbox-item__toggle,
.inbox-item__toggle:focus-visible {
  opacity: 1;
}
@media (hover: none) {
  .inbox-item__toggle {
    opacity: 0.7;
  }
}
.inbox-item__swipe {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 0 22px;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  opacity: 0;
}
.inbox-item.is-swiping .inbox-item__swipe {
  opacity: 1;
}
.inbox-item.is-swipe-armed .inbox-item__swipe .icon {
  transform: scale(1.15);
}
.inbox-item.is-settling .inbox-item__link,
.inbox-item.is-settling .inbox-item__actions {
  transition: transform var(--dur-3) var(--ease-out);
}
@media (max-width: 639px) {
  .inbox-toolbar {
    flex-wrap: wrap;
    align-items: center;
  }
  .inbox-tabs.tabs {
    flex-basis: 100%;
    order: 2;
  }
  .inbox-toolbar__action {
    margin-left: auto;
    padding: 0;
  }
  .inbox-item__link {
    padding-right: 4px;
  }
}

/* -- Bell + notifications popover ---------------------------------------------------------------- */
.notif-bell {
  position: relative;
}
.notif-bell__button {
  position: relative;
  color: var(--text-2);
}
.notif-bell__badge .badge {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--bg);
  font-size: 10px;
  pointer-events: none;
}
.notif-popover.popover__panel {
  width: min(384px, calc(100vw - 16px));
  max-width: none;
  max-height: min(72vh, 580px);
  padding: 0;
  overflow: hidden;
}
.notif-popover__content {
  display: flex;
  flex-direction: column;
  max-height: min(72vh, 580px);
}
.notif-popover__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 10px 6px 16px;
}
.notif-popover__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
}
.notif-popover__mark {
  color: var(--accent-ink);
}
.notif-popover__list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 6px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.notif-popover__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  color: var(--accent-ink);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  transition: background-color var(--dur-1) ease;
}
.notif-popover__footer:hover {
  background: var(--fill-1);
}
.notif-popover__loading {
  display: grid;
  place-items: center;
  height: 180px;
}
.pop-item {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: var(--radius-md);
  transition: background-color var(--dur-1) ease;
}
.pop-item:hover {
  background: var(--fill-1);
}
.pop-item__link {
  display: flex;
  flex: 1;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: inherit;
  color: inherit;
}
.pop-item__link:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.pop-item__avatar {
  flex-shrink: 0;
  margin-top: 1px;
}
.pop-item__body {
  flex: 1;
  min-width: 0;
}
.pop-item__text {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-sm);
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.pop-item__text strong {
  color: var(--text);
  font-weight: var(--fw-medium);
}
.pop-item.is-unread .pop-item__text strong {
  font-weight: var(--fw-semibold);
}
.pop-item__time {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.pop-item__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 50%;
}
.pop-item.is-unread .pop-item__dot {
  background: var(--accent);
}
.pop-item__toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  color: var(--text-2);
  opacity: 0;
  translate: 0 -50%;
  transition: opacity var(--dur-1) ease;
}
.pop-item:hover .pop-item__toggle,
.pop-item__toggle:focus-visible {
  opacity: 1;
}
.pop-item:hover .pop-item__dot {
  opacity: 0;
}

/* -- Home ---------------------------------------------------------------------------------------- */
.home {
  container-type: inline-size;
}
.home-hero {
  margin: var(--space-1) 0 var(--space-6);
}
.home-hero__date {
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.home-hero__title {
  margin-top: 2px;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.375rem);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  overflow-wrap: anywhere;
}
.home-hero__subtitle {
  margin-top: var(--space-1);
  color: var(--text-2);
  font-size: var(--fs-lg);
}
.home-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: var(--space-5);
}
.home-stats .stat-card {
  --card-pad: 14px 16px;
}
.home-stats .stat__value {
  font-variant-numeric: normal;
}
@container (min-width: 720px) {
  .home-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
  }
  .home-stats .stat-card {
    --card-pad: 16px 20px;
  }
}
.home-grid {
  display: grid;
  gap: 16px;
}
.home-grid__main,
.home-grid__side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
@container (min-width: 940px) {
  .home-grid {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    align-items: start;
    gap: 20px;
  }
  .home-grid__main,
  .home-grid__side {
    gap: 20px;
  }
}
.home-card__header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin-bottom: var(--space-3);
}
.card--flush > .home-card__header {
  margin: 0;
  padding: 14px 12px 12px 16px;
  border-bottom: 1px solid var(--line);
}
.home-card__titles {
  flex: 1;
  min-width: 0;
}
.home-card__title {
  overflow: hidden;
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-card__subtitle {
  overflow: hidden;
  color: var(--text-3);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-card__more {
  flex-shrink: 0;
  gap: 2px;
  margin-right: -6px;
  color: var(--accent-ink);
}
.home-work .task-row {
  padding-left: 16px;
}
/* Every row is the viewer's own task: the assignee avatar and labels are noise here. */
.home-work .task-row__labels,
.home-work .task-row__cell--assignee,
.home-work .task-row__meta > .avatar {
  display: none;
}
.home-work .project-chip {
  max-width: 170px;
}
.home-work .empty-state {
  padding-block: var(--space-8);
}

/* Projects (rings) */
.home-projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 4px 8px;
  margin: 0 -8px -6px;
  padding: 0;
  list-style: none;
}
.home-project {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 10px;
  border-radius: var(--radius-md);
  color: inherit;
  transition: background-color var(--dur-1) ease;
}
.home-project:hover {
  background: var(--fill-1);
}
.home-project:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.home-project .progress-ring__label {
  font-size: 11px;
}
.home-project__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-project__name {
  display: block;
  overflow: hidden;
  font-weight: var(--fw-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-project__star {
  margin-left: 4px;
  color: var(--c-yellow);
  vertical-align: -1px;
}
.home-project__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.home-project__overdue {
  color: var(--danger-ink);
}

/* Team momentum (mini column chart) */
.momentum__figure {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 14px;
}
.momentum__total {
  font-family: var(--font-display);
  font-size: var(--fs-large);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: -0.03em;
}
.momentum__vs {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.momentum__chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 76px;
}
.momentum__bar {
  position: relative;
  display: flex;
  flex: 1 1 0;
  align-items: flex-end;
  height: 100%;
  min-width: 0;
}
.momentum__fill {
  width: 100%;
  max-width: 24px;
  height: max(4px, calc(var(--value) * 1%));
  margin: 0 auto;
  border-radius: 4px 4px 1px 1px;
  background: color-mix(in srgb, var(--accent) 34%, var(--surface));
  transform-origin: bottom;
  transition: background-color var(--dur-1) ease;
}
.momentum__bar.is-zero .momentum__fill {
  height: 3px;
  background: var(--fill-2);
}
.momentum__bar.is-today .momentum__fill,
.momentum__bar:hover .momentum__fill {
  background: var(--accent);
}
.momentum__axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--text-3);
  font-size: var(--fs-2xs);
}
@media (prefers-reduced-motion: no-preference) {
  .momentum__fill {
    animation: insights-grow-y var(--dur-4) var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 28ms + 120ms);
  }
}
@keyframes insights-grow-y {
  from {
    transform: scaleY(0);
  }
}
@keyframes insights-grow-x {
  from {
    transform: scaleX(0);
  }
}

/* Team load */
.load-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.load-list__row {
  display: grid;
  grid-template-columns: 24px minmax(0, 7.5rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.load-list__name {
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.load-list__bar {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--fill-2);
}
.load-list__bar > span {
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform-origin: left;
}
@media (prefers-reduced-motion: no-preference) {
  .load-list__bar > span {
    animation: insights-grow-x var(--dur-4) var(--ease-out) 150ms both;
  }
}
.load-list__value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 3.25rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.load-list__overdue {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--danger-ink);
  font-size: var(--fs-xs);
}
.load-list__empty {
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.home-activity__list .activity-day + .activity-day {
  margin-top: var(--space-3);
}

/* Getting started */
.home-setup {
  display: grid;
  gap: 16px;
  margin-bottom: var(--space-5);
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-softer), transparent 55%),
    var(--surface);
}
@container (min-width: 720px) {
  .home-setup {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    align-items: center;
    gap: 24px;
  }
}
.home-setup__intro {
  display: flex;
  align-items: center;
  gap: 14px;
}
.home-setup__title {
  font-size: var(--fs-xl);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-snug);
}
.home-setup__text {
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.home-setup__steps {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-setup__step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}
.home-setup__check {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  color: transparent;
}
.home-setup__step.is-done .home-setup__check {
  background: var(--success);
  box-shadow: none;
  color: #ffffff;
}
.home-setup__label {
  flex: 1;
  min-width: 0;
  font-weight: var(--fw-medium);
}
.home-setup__step.is-done .home-setup__label {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}

/* -- Search -------------------------------------------------------------------------------------- */
.search-page__form {
  margin-bottom: var(--space-5);
}
.search-page__field {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 14px 0 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-sm);
  color: var(--text-3);
  transition: box-shadow var(--dur-1) ease;
}
.search-page__field:focus-within {
  box-shadow:
    0 0 0 1px var(--accent),
    0 0 0 4px var(--focus-ring);
}
.search-page__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-xl);
  outline: none;
}
.search-page__input::placeholder {
  color: var(--text-3);
}
.search-tabs.tabs {
  margin-bottom: var(--space-5);
}
.search-section + .search-section {
  margin-top: var(--space-6);
}
.search-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: var(--space-2);
  padding-left: 4px;
}
.search-section__title {
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
}
.search-list {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-xs);
}
.search-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  color: inherit;
  transition: background-color var(--dur-1) ease;
}
.search-item + .search-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 60px;
  height: 1px;
  background: var(--line);
}
.search-item:hover,
.search-item.is-active {
  background: var(--fill-1);
}
.search-item:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.search-item__icon--task {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--text-3);
}
.search-item__icon--task.is-done {
  color: var(--success);
}
.search-item__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.search-item__title {
  overflow: hidden;
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-item__title .task-key {
  margin-right: 4px;
}
.search-item__sub {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-sm);
  white-space: nowrap;
}
.search-item__sep {
  color: var(--text-3);
}
.search-item__trail {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}
.search-page mark,
.palette mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--c-yellow) 38%, transparent);
  color: inherit;
}
@media (max-width: 639px) {
  .search-item__trail .due {
    display: none;
  }
  .search-page__input {
    font-size: var(--fs-lg);
  }
}

/* -- Command palette ------------------------------------------------------------------------------ */
html:has(.palette[open]) {
  overflow: hidden;
}
.palette {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: clamp(16px, 11vh, 120px) 16px 16px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--text);
}
.palette::backdrop {
  background: light-dark(rgb(0 0 0 / 0.18), rgb(0 0 0 / 0.5));
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 1;
  transition: opacity var(--dur-2) var(--ease-out);
}
.palette__panel {
  display: flex;
  flex-direction: column;
  width: min(660px, 100%);
  max-height: min(580px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: saturate(180%) blur(32px);
  backdrop-filter: saturate(180%) blur(32px);
  box-shadow:
    0 0 0 1px var(--glass-line),
    var(--shadow-xl);
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-2) var(--ease-out),
    transform var(--dur-3) var(--ease-spring);
}
@starting-style {
  .palette[open] .palette__panel {
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
  }
  .palette[open]::backdrop {
    opacity: 0;
  }
}
.palette.is-closing .palette__panel {
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition:
    opacity var(--dur-1) ease,
    transform var(--dur-2) var(--ease-out);
}
.palette.is-closing::backdrop {
  opacity: 0;
}
.palette__search {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 12px;
  height: 60px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--line);
}
.palette__search-icon {
  flex-shrink: 0;
  color: var(--text-3);
}
.palette__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: var(--fs-xl);
  outline: none;
}
.palette__input::placeholder {
  color: var(--text-3);
}
.palette__busy {
  display: inline-flex;
  opacity: 0;
  transition: opacity var(--dur-2) ease;
}
.palette.is-busy .palette__busy {
  opacity: 1;
  transition-delay: 160ms;
}
.palette__close {
  flex-shrink: 0;
  padding: 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--accent-ink);
  font: inherit;
  font-size: var(--fs-md);
  cursor: pointer;
}
.palette__list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 8px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-padding: 8px;
}
.palette__results {
  transition: opacity var(--dur-1) ease;
}
.palette.is-busy .palette__results {
  opacity: 0.6;
}
.palette__section + .palette__section,
.palette__recent + .palette__results > .palette__section:first-child {
  margin-top: 6px;
}
.palette__label {
  padding: 8px 12px 4px;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
}
.palette__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--text);
  scroll-margin: 8px;
  cursor: pointer;
  user-select: none;
}
.palette__item.is-active {
  background: var(--fill-2);
}
.palette__item.is-active::after {
  content: "\21B5";
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 22px;
  height: 20px;
  border-radius: 5px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: var(--fs-2xs);
}
.palette__icon {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--fill-1);
  color: var(--text-2);
}
.palette__icon--task {
  background: none;
  color: var(--text-3);
}
.palette__icon--task.is-done {
  color: var(--success);
}
.palette__item .avatar,
.palette__item .icon-tile,
.palette__item .ws-tile {
  flex-shrink: 0;
}
.palette__item > .avatar--sm,
.palette__item > .icon-tile--sm {
  margin-inline: 2px;
}
.palette__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}
.palette__title {
  overflow: hidden;
  font-size: var(--fs-md);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette__title .task-key {
  margin-right: 4px;
}
.palette__sub {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
  color: var(--text-2);
  font-size: var(--fs-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette__meta,
.palette__kbd {
  flex-shrink: 0;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.palette__item.is-active .palette__kbd,
.palette__item.is-active .palette__meta {
  display: none;
}
.palette__empty {
  padding: 18px 12px 10px;
  color: var(--text-2);
  font-size: var(--fs-sm);
  text-align: center;
}
.palette__footer {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 18px;
  padding: 9px 18px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.palette__footer span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.palette__footer kbd {
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
}
@media (pointer: coarse), (max-width: 639px) {
  .palette__footer {
    display: none;
  }
  .palette__input {
    font-size: max(16px, var(--fs-xl));
  }
}
/* Phones: full-screen sheet */
@media (max-width: 639px) {
  .palette {
    padding: 0;
  }
  .palette__panel {
    width: 100%;
    height: 100%;
    max-height: none;
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    border-radius: 0;
    background: var(--surface-elevated);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  @starting-style {
    .palette[open] .palette__panel {
      opacity: 0;
      transform: translateY(24px);
    }
  }
  .palette.is-closing .palette__panel {
    transform: translateY(24px);
  }
  .palette__search {
    height: 56px;
    padding: 0 12px 0 16px;
  }
}

/* -- Insights ------------------------------------------------------------------------------------ */
.insights-body {
  container-type: inline-size;
}
.insights-content {
  transition: opacity var(--dur-2) ease;
}
.insights-body:has(.filter-bar.htmx-request) .insights-content {
  opacity: 0.55;
}
.insights-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.insights-kpis > :last-child {
  grid-column: 1 / -1;
}
.insights-kpis .stat-card {
  --card-pad: 14px 16px;
}
.insights-kpis .stat__value {
  font-variant-numeric: normal;
}
@container (min-width: 600px) {
  /* 3 + 2 tiles on a 6-column track: no orphan gap */
  .insights-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .insights-kpis > * {
    grid-column: span 2;
  }
  .insights-kpis > :nth-child(n + 4) {
    grid-column: span 3;
  }
}
@container (min-width: 900px) {
  .insights-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
  }
  .insights-kpis > *,
  .insights-kpis > :nth-child(n + 4) {
    grid-column: auto;
  }
}
.insights-grid {
  display: grid;
  grid-auto-flow: row dense;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}
@container (min-width: 760px) {
  .insights-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .insights-grid__throughput,
  .insights-grid__stages,
  .insights-grid__overdue,
  .insights-grid__health {
    grid-column: 1 / -1;
  }
}
@container (min-width: 1080px) {
  .insights-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
  .insights-grid__throughput,
  .insights-grid__stages {
    grid-column: span 2;
  }
  .insights-grid__overdue {
    grid-column: auto;
  }
}
.chart-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}
.chart-card__header {
  margin-bottom: var(--space-3);
}
.chart-card__header--padded {
  margin: 0;
  padding: 16px 20px 12px;
}
.chart-card__title {
  font-size: var(--fs-lg);
  font-weight: var(--fw-semibold);
  letter-spacing: -0.01em;
}
.chart-card__subtitle {
  margin-top: 1px;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.chart-card__canvas {
  position: relative;
  height: var(--chart-h, 240px);
  min-width: 0;
}
.chart-card__canvas--rows {
  height: calc(var(--rows, 4) * 34px + 34px);
}
.chart-card__canvas canvas {
  position: absolute;
  inset: 0;
}
.chart-data {
  margin-top: var(--space-3);
}
.chart-data > summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  margin-left: -6px;
  border-radius: var(--radius-xs);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  list-style: none;
  cursor: pointer;
}
.chart-data > summary::-webkit-details-marker {
  display: none;
}
.chart-data > summary::before {
  content: "";
  width: 10px;
  height: 10px;
  background: currentColor;
  -webkit-mask: var(--chevron-mask) center / contain no-repeat;
  mask: var(--chevron-mask) center / contain no-repeat;
  transition: transform var(--dur-2) var(--ease-out);
}
.chart-data[open] > summary::before {
  transform: rotate(90deg);
}
.chart-data > summary:hover {
  background: var(--fill-1);
  color: var(--text);
}
.chart-data[open] > summary {
  margin-bottom: var(--space-2);
}
.chart-data .table-wrap {
  max-height: 280px;
  overflow: auto;
  box-shadow: 0 0 0 1px var(--line);
}
.chart-data .table td,
.chart-data .table th {
  height: 34px;
}

/* Doughnut + legend */
.split {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 20px;
}
.split__chart {
  position: relative;
  flex-shrink: 0;
  width: 148px;
  height: 148px;
}
.split__chart canvas {
  position: absolute;
  inset: 0;
}
.split__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.split__total {
  font-family: var(--font-display);
  font-size: var(--fs-title-2);
  font-weight: var(--fw-bold);
  line-height: 1;
  letter-spacing: -0.02em;
}
.split__caption {
  margin-top: 2px;
  color: var(--text-3);
  font-size: var(--fs-2xs);
}
.split__legend {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.split__row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 2.75rem;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-sm);
}
.split__row.is-empty {
  opacity: 0.5;
}
.split__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.split__value {
  font-weight: var(--fw-semibold);
  text-align: right;
}
.split__pct {
  color: var(--text-3);
  font-size: var(--fs-xs);
  text-align: right;
}
@media (max-width: 459px) {
  .split {
    flex-direction: column;
    align-items: stretch;
  }
  .split__chart {
    margin: 0 auto;
  }
}

/* Ranked bar list (one series → one color) */
.bar-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.bar-list__row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 32px;
  padding: 0 10px;
}
.bar-list__bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--value) * 1%);
  min-width: 4px;
  border-radius: 7px;
  background: var(--accent-soft);
  transform-origin: left;
}
.bar-list--danger .bar-list__bar {
  background: color-mix(in srgb, var(--danger) 13%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .bar-list__bar {
    animation: insights-grow-x var(--dur-4) var(--ease-out) both;
    animation-delay: 120ms;
  }
}
.bar-list__label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
}
a.bar-list__label:hover {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 2px;
}
.bar-list__value {
  position: relative;
  flex-shrink: 0;
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
}

/* Projects health */
.insights-health {
  overflow-x: auto;
}
.insights-health .table {
  min-width: 760px;
}
.insights-health .table tbody th {
  padding-left: 20px;
  font-weight: var(--fw-regular);
  text-align: left;
}
.health-project {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
}
.health-project:hover .health-project__name {
  color: var(--accent-ink);
}
.health-project__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.health-project__name {
  overflow: hidden;
  font-weight: var(--fw-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--dur-1) ease;
}
.health-project__team {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.health-progress {
  min-width: 140px;
}
.health-overdue {
  color: var(--danger-ink);
  font-weight: var(--fw-semibold);
}

/* -- Workload ------------------------------------------------------------------------------------ */
.workload-body {
  container-type: inline-size;
}
.workload-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin: calc(var(--space-1) * -1) 0 var(--space-4);
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.workload-summary__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.workload-summary__item strong {
  color: var(--text);
  font-weight: var(--fw-semibold);
}
.workload-summary__item.is-danger strong {
  color: var(--danger-ink);
}
.workload-summary__item.is-warning,
.workload-summary__item.is-warning strong {
  color: var(--warning-ink);
}
.workload-summary__note {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.wl-table {
  --wl-cols: minmax(200px, 2.2fr) repeat(5, minmax(60px, 0.7fr)) minmax(180px, 1.8fr) 28px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow:
    0 0 0 1px var(--card-ring),
    var(--shadow-xs);
}
.wl-head,
.wl-row__main {
  display: grid;
  grid-template-columns: var(--wl-cols);
  align-items: center;
  gap: 0 14px;
  padding: 0 14px 0 20px;
}
.wl-head {
  min-height: 38px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
.wl-sort {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: inherit;
  transition: color var(--dur-1) ease;
}
.wl-sort:hover,
.wl-sort.is-active {
  color: var(--text);
}
.wl-col--open,
.wl-col--overdue,
.wl-col--due_week,
.wl-col--done,
.wl-col--logged {
  justify-self: end;
  text-align: right;
}
.wl-row + .wl-row {
  border-top: 1px solid var(--line);
}
.wl-row__main {
  width: 100%;
  min-height: 62px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-1) ease;
}
.wl-row__main:hover,
.wl-row.is-open .wl-row__main {
  background: var(--surface-2);
}
.wl-row__main:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.wl-col--person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.wl-person {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.wl-person__name,
.wl-person__title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wl-person__name {
  font-weight: var(--fw-semibold);
}
.wl-person__title {
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.wl-num {
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  font-variant-numeric: tabular-nums;
}
.wl-num.is-danger {
  color: var(--danger-ink);
  font-weight: var(--fw-semibold);
}
.wl-num.is-success {
  color: var(--success-ink);
}
.wl-row {
  --load-color: var(--success);
}
.wl-row.is-busy {
  --load-color: var(--warning);
}
.wl-row.is-over {
  --load-color: var(--danger);
}
.wl-load {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.wl-load__track {
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--fill-2);
}
.wl-load__fill {
  display: block;
  width: calc(var(--value) * 1%);
  height: 100%;
  border-radius: inherit;
  background: var(--load-color);
  transform-origin: left;
}
@media (prefers-reduced-motion: no-preference) {
  .wl-load__fill {
    animation: insights-grow-x var(--dur-4) var(--ease-out) 100ms both;
  }
}
.wl-load__text {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  color: var(--text-2);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.wl-load__pct {
  color: var(--text);
  font-weight: var(--fw-semibold);
}
.wl-row.is-busy .wl-load__pct {
  color: var(--warning-ink);
}
.wl-row.is-over .wl-load__pct {
  color: var(--danger-ink);
}
.wl-load__hint {
  margin-left: auto;
  color: var(--text-3);
}
.wl-row__chevron {
  color: var(--text-3);
  transition: transform var(--dur-2) var(--ease-out);
}
.wl-row.is-open .wl-row__chevron {
  transform: rotate(180deg);
}
.wl-row__tasks {
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.wl-tasks {
  margin: 0;
  padding: 6px 14px 10px 64px;
  list-style: none;
}
.wl-task {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: inherit;
  transition: background-color var(--dur-1) ease;
}
.wl-task:hover {
  background: var(--fill-1);
}
.wl-task:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.wl-task__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: var(--fw-medium);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wl-task__meta {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
  font-size: var(--fs-xs);
}
.wl-task__project {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 160px;
}
.wl-tasks__empty,
.wl-tasks__loading {
  padding: 14px 20px 14px 64px;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
@container (max-width: 1099px) {
  .wl-table {
    --wl-cols: minmax(170px, 2fr) repeat(5, minmax(48px, 0.6fr)) minmax(150px, 1.6fr) 24px;
  }
  .wl-task__project,
  .wl-task__meta .chip {
    display: none;
  }
}
/* Narrow: each person becomes a card-like row (labels from data-label) */
@container (max-width: 859px) {
  .wl-head {
    display: none;
  }
  .wl-row__main {
    grid-template-columns: repeat(5, minmax(0, 1fr)) 24px;
    grid-template-areas:
      "person person person person person toggle"
      "load load load load load load"
      "open overdue week done logged logged";
    gap: 12px 8px;
    padding: 14px 16px;
  }
  .wl-col--person { grid-area: person; }
  .wl-col--toggle { grid-area: toggle; justify-self: end; }
  .wl-col--load { grid-area: load; }
  .wl-col--open { grid-area: open; }
  .wl-col--overdue { grid-area: overdue; }
  .wl-col--due_week { grid-area: week; }
  .wl-col--done { grid-area: done; }
  .wl-col--logged { grid-area: logged; }
  .wl-col[data-label] {
    display: flex;
    flex-direction: column;
    gap: 1px;
    justify-self: start;
    min-width: 0;
    text-align: left;
  }
  .wl-col[data-label]::after {
    content: attr(data-label);
    overflow: hidden;
    color: var(--text-3);
    font-size: var(--fs-2xs);
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .wl-tasks {
    padding: 4px 8px 8px;
  }
  .wl-tasks__empty,
  .wl-tasks__loading {
    padding-left: 16px;
  }
}
@container (max-width: 479px) {
  .wl-row__main {
    grid-template-columns: repeat(3, minmax(0, 1fr)) 24px;
    grid-template-areas:
      "person person person toggle"
      "load load load load"
      "open overdue week ."
      "done logged logged .";
  }
  .workload-summary__note {
    width: 100%;
    margin-left: 0;
  }
  .wl-task {
    flex-wrap: wrap;
    row-gap: 2px;
  }
  .wl-task__title {
    flex-basis: calc(100% - 90px);
  }
  .wl-task__meta {
    width: 100%;
    padding-left: 22px;
  }
}
