/* ==================================================================================================
   In progress ("live work") — Column.is_in_progress                               owner: projects
   A column flagged "Tasks here are in progress" means the team is working on its tasks right now.
   Shown as: the live dot (pulsing), the live chip on cards / rows, the column header badge with
   the people on it, the status pill in the task panel and the "In progress now" panel (project
   overview, team page). One accent for the whole feature: --live (system blue).
   ================================================================================================== */
:root {
  --live: var(--c-blue);
  --live-ink: var(--c-blue-ink);
  --live-soft: color-mix(in srgb, var(--live) 12%, transparent);
  --live-line: color-mix(in srgb, var(--live) 34%, transparent);
}

/* -- Live dot ------------------------------------------------------------------------------------ */
.live-dot {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--live) 22%, transparent);
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--live);
  opacity: 0;
}
@media (prefers-reduced-motion: no-preference) {
  .live-dot::after {
    animation: live-ping 2s var(--ease-out) infinite;
  }
}
:root[data-motion="reduced"] .live-dot::after {
  animation: none;
}
@keyframes live-ping {
  0% {
    opacity: 0.6;
    transform: scale(1);
  }
  75%,
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

/* -- Live chip (cards, rows) ---------------------------------------------------------------------- */
.live-chip {
  display: inline-flex;
  flex-shrink: 1;
  align-items: center;
  gap: 5px;
  min-width: 0;
  height: 18px;
  padding: 0 7px 0 6px;
  border-radius: var(--radius-full);
  background: var(--live-soft);
  color: var(--live-ink);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  line-height: 18px;
  white-space: nowrap;
}
.live-chip .live-dot {
  width: 6px;
  height: 6px;
  box-shadow: none;
}
.live-chip__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* On the board the column already says "in progress": the card keeps the dot only. */
.board-column .task-card__live {
  width: 18px;
  padding: 0;
  justify-content: center;
}
.board-column .task-card__live .live-chip__text {
  display: none;
}
.task-row__live {
  flex-shrink: 0;
}

/* Cards: the assignee wears a live ring — "this person is on it". */
.task-card.is-in-progress .task-card__assignee .avatar {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 3.5px var(--live);
}
.task-card.is-in-progress::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--live);
  opacity: 0.85;
  pointer-events: none;
}

/* -- Board column header badge -------------------------------------------------------------------- */
.board-column__live {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 4px 0 7px;
  border-radius: var(--radius-full);
  background: var(--live-soft);
}
.board-column__live:not(:has(.avatar)) {
  padding-right: 7px;
}
.board-column__live .avatar-stack .avatar {
  box-shadow: 0 0 0 1.5px var(--surface);
}

/* Lists, status picker, task panel */
.list-section__live,
.tp-live-mark {
  display: inline-grid;
  flex-shrink: 0;
  place-items: center;
  width: 14px;
  height: 14px;
}
.tp-live-mark {
  margin-left: auto;
}
.tp-status.is-live {
  color: var(--live-ink);
}

/* -- Workflow settings: second switch ------------------------------------------------------------- */
.workflow-col {
  grid-template-columns: 20px 28px minmax(140px, 1fr) auto 104px auto auto auto;
}
@media (max-width: 767px) {
  .workflow-col {
    grid-template-columns: 20px 28px minmax(0, 1fr) auto;
  }
  .workflow-col__wip {
    grid-column: 3;
    grid-row: 3;
  }
  .workflow-col__progress {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
  }
}

/* -- "In progress now" panel ---------------------------------------------------------------------- */
.live-panel {
  padding: var(--space-4) var(--space-4) var(--space-3);
}
.live-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px var(--space-3);
  margin-bottom: var(--space-3);
}
.live-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: var(--fs-md);
  font-weight: var(--fw-semibold);
}
.live-panel__badge {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--fill-1);
  color: var(--text-3);
}
.live-panel__badge.is-on {
  background: var(--live-soft);
}
.live-panel__summary {
  margin-left: auto;
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-variant-numeric: tabular-nums;
}
.live-panel__people {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.live-person {
  min-width: 0;
  padding: 10px 10px 6px;
  border-radius: var(--radius-md);
  background: var(--fill-1);
}
.live-person__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 4px;
}
.live-person__avatar {
  display: inline-flex;
  flex-shrink: 0;
  border-radius: 50%;
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 3.5px var(--live);
}
.live-person__avatar--empty {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  background: var(--fill-2);
  color: var(--text-3);
  box-shadow: none;
}
.live-person__name {
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-person__name--muted {
  color: var(--text-2);
  font-weight: var(--fw-medium);
}
.live-person__count {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--live-soft);
  color: var(--live-ink);
  font-size: var(--fs-2xs);
  font-weight: var(--fw-semibold);
  font-variant-numeric: tabular-nums;
  line-height: 20px;
  text-align: center;
}
.live-person__tasks {
  margin: 0;
  padding: 0;
  list-style: none;
}
.live-task {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 10px;
  min-width: 0;
  padding: 6px 0 6px 32px;
}
.live-task + .live-task {
  border-top: 0.5px solid var(--line);
}
.live-task__link {
  display: flex;
  flex: 1 1 220px;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.live-task__link:hover .live-task__title {
  color: var(--accent);
}
.live-task__link:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.live-task__link .task-key {
  flex-shrink: 0;
  color: var(--text-3-on-fill);
  font-size: var(--fs-xs);
}
.live-task__title {
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-sm);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-task__meta {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  color: var(--text-3-on-fill);
  font-size: var(--fs-xs);
}
.live-task__project,
.live-task__column {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 160px;
}
.live-task__project > span:last-child,
.live-task__column > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-task__since {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.live-panel__more {
  margin: var(--space-2) 0 0;
  color: var(--text-3);
  font-size: var(--fs-xs);
  text-align: center;
}
.live-panel__empty {
  padding: var(--space-2) 0 var(--space-1);
}
.live-panel__empty-text {
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-sm);
}
.live-panel__hint {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: var(--space-2) 0 0;
  color: var(--text-3);
  font-size: var(--fs-xs);
}
.live-panel__hint .icon {
  flex-shrink: 0;
  margin-top: 2px;
}
@media (max-width: 479px) {
  .live-task {
    padding-left: 0;
  }
}
@media (min-width: 1024px) {
  .team-layout:has(> .team-layout__live) {
    grid-template-areas:
      "live aside"
      "projects aside"
      "activity aside";
    grid-template-rows: auto auto 1fr;
  }
  .team-layout__live {
    grid-area: live;
  }
}

/* Title with an optional subtitle (Home: "The whole team, across all projects"). */
.live-panel__titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.live-panel__subtitle {
  color: var(--text-3);
  font-size: var(--fs-xs);
  font-weight: var(--fw-regular);
}
a.live-task__project {
  color: inherit;
  text-decoration: none;
}
a.live-task__project:hover {
  color: var(--accent);
}
a.live-task__project:focus-visible {
  border-radius: 4px;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Home: people side by side on wide screens. */
@media (min-width: 1280px) {
  .home-grid__main .live-panel__people {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
