/*
 * Parawatch panel. Colors come from the host through theme.css, which the desktop app and the
 * harness load. Words are kept for what a person must read (card
 * titles, options, names); counts and states are icons with numbers, worded in their tooltips.
 */

.pw-panel {
  --pw-gap: 10px;
  --pw-radius: 12px;
  --pw-surface: var(--background-primary);
  --pw-line: var(--background-modifier-border);
  --pw-hover: var(--background-modifier-hover);
  --pw-accent: var(--interactive-accent);
  --pw-decide: var(--interactive-accent);
  --pw-try: var(--color-cyan, #1a9fb3);
  --pw-block: var(--color-red, #d64545);
  --pw-todo: var(--text-muted);
  --pw-bad: var(--color-red, #d64545);
  --pw-who: 42%;
  --pw-well: color-mix(in srgb, var(--text-normal) 3.5%, transparent);
  font-size: var(--font-ui-small, 13px);
  padding: 4px 2px 24px;
}

.pw-icon,
.pw-btn-icon {
  display: inline-flex;
  flex: none;
}
.pw-icon svg,
.pw-btn-icon svg {
  width: 15px;
  height: 15px;
}

/* ---------------------------------------------------------------- status row */

.pw-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 4px 10px;
}
.pw-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  white-space: nowrap;
}
.pw-badge-n {
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-semibold, 600);
  color: var(--text-normal);
}
.pw-badge.is-zero {
  opacity: 0.45;
}
/* in the status row a count is a chip on a tint of its section's tone; a click goes there */
.pw-status .pw-badge:not(.pw-need) {
  --pw-t: var(--text-muted);
  padding: 2px 8px 2px 6px;
  margin: -2px 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pw-t) 12%, transparent);
  color: var(--pw-t);
}
.pw-status .pw-badge.is-zero {
  background: transparent;
}
.pw-status .pw-badge.pw-asks {
  --pw-t: var(--color-yellow, #a16207);
}
.pw-status .pw-badge.pw-chip-review {
  --pw-t: var(--color-cyan, #0e9384);
}
.pw-status .pw-badge.pw-chip-agents {
  --pw-t: var(--pw-accent);
}
.pw-status .pw-asks .pw-badge-n,
.pw-status .pw-chip-review .pw-badge-n,
.pw-status .pw-chip-agents .pw-badge-n {
  color: inherit;
}
.pw-badge.is-jump {
  cursor: pointer;
}
.pw-badge.is-jump:hover {
  filter: brightness(0.92);
}
.pw-need.is-urgent {
  background: var(--pw-accent);
  color: var(--text-on-accent, #fff);
  padding: 2px 8px 2px 6px;
  margin: -2px 0;
  border-radius: 999px;
}
.pw-need.is-urgent .pw-badge-n {
  color: inherit;
}
.pw-icon-btn {
  margin-left: auto;
  color: var(--text-muted);
}

.pw-error {
  border: 1px solid var(--pw-bad);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0 0 var(--pw-gap);
  background: color-mix(in srgb, var(--pw-bad) 8%, transparent);
}
.pw-error-title {
  font-weight: var(--font-semibold, 600);
}
.pw-error-text {
  font-family: var(--font-monospace);
  font-size: var(--font-ui-smaller, 12px);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 4px 0;
}
.pw-error-hint {
  color: var(--text-muted);
}

.pw-empty {
  color: var(--text-faint);
  padding: 6px 4px;
}
.pw-all-clear {
  display: flex;
  justify-content: center;
  padding: 28px 4px 20px;
}

/* ---------------------------------------------------------------- tiles */

/*
 * A section is told apart by a tile: an icon on a tint of its tone. Tones that need the human
 * (cards, asks, reviews) are colored; tones that wait on someone else are gray.
 */
.pw-tile {
  --pw-t: var(--text-muted);
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--pw-t);
  background: color-mix(in srgb, var(--pw-t) 14%, transparent);
}
.pw-tile svg {
  width: 14px;
  height: 14px;
}
.pw-tile-lg {
  width: 52px;
  height: 52px;
  border-radius: 16px;
}
.pw-tile-lg svg {
  width: 30px;
  height: 30px;
}
.pw-tone-project {
  --pw-t: var(--pw-accent);
}
.pw-tone-asks {
  --pw-t: var(--color-yellow, #a16207);
}
.pw-tone-review {
  --pw-t: var(--color-cyan, #0e9384);
}
.pw-tone-todo,
.pw-tone-wait {
  --pw-t: var(--text-muted);
}
.pw-tone-closed {
  --pw-t: var(--text-faint);
}
.pw-tone-clear {
  --pw-t: var(--color-green, #1f9d55);
}
.pw-sec-n {
  font-variant-numeric: tabular-nums;
  font-weight: var(--font-semibold, 600);
  color: var(--text-normal);
}
.pw-sec-wait > .pw-fold-head .pw-sec-n,
.pw-sec-closed > .pw-fold-head .pw-sec-n,
.pw-sec-todo > .pw-fold-head .pw-sec-n {
  color: var(--text-muted);
}
.pw-sec-asks > .pw-fold-head .pw-sec-n {
  color: var(--color-yellow, #a16207);
}
/* the turn changes here: above, the human's; below, someone else's */
.pw-turn-split {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 4px 8px;
  color: var(--text-faint);
}
.pw-turn-split::before,
.pw-turn-split::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--pw-line);
}
.pw-turn-mark {
  display: inline-flex;
}
.pw-turn-mark svg {
  width: 14px;
  height: 14px;
}
.pw-turn-split ~ .pw-fold-group .pw-card {
  box-shadow: none;
}
.pw-turn-split ~ .pw-answered-group,
.pw-turn-split ~ .pw-closed-group {
  margin-top: 6px;
}
@keyframes pw-flash {
  from {
    background: color-mix(in srgb, var(--pw-accent) 14%, transparent);
  }
  to {
    background: transparent;
  }
}
.is-flash > .pw-fold-head,
.pw-agents.is-flash {
  animation: pw-flash 900ms ease-out;
}

/* ---------------------------------------------------------------- folding */

.pw-fold-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.pw-fold-head:hover {
  background: var(--pw-hover);
}
.pw-chevron {
  display: inline-flex;
  color: var(--text-faint);
  transition: transform 120ms ease;
}
.pw-chevron svg {
  width: 14px;
  height: 14px;
}
.is-collapsed > .pw-fold-head .pw-chevron,
.pw-agents.is-collapsed > .pw-agents-head .pw-chevron {
  transform: rotate(-90deg);
}
.pw-fold-group.is-collapsed > .pw-fold-body {
  display: none;
}
.pw-fold-name {
  font-weight: var(--font-semibold, 600);
  color: var(--text-normal);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pw-fold-badges {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.pw-fold-badges .pw-icon svg {
  width: 14px;
  height: 14px;
}
.pw-badge.pw-kind-decide {
  color: var(--pw-decide);
}
.pw-badge.pw-kind-try {
  color: var(--pw-try);
}
.pw-badge.pw-kind-block {
  color: var(--pw-block);
}
.pw-badge.pw-kind-todo {
  color: var(--pw-todo);
}

/* ---------------------------------------------------------------- agents chart */

.pw-agents {
  container-type: inline-size;
  background: var(--pw-surface);
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius);
  margin: 0 0 16px;
  overflow: hidden;
}
.pw-agents-head,
.pw-run {
  display: grid;
  grid-template-columns: var(--pw-who) 1fr;
  align-items: center;
}
.pw-agents-head {
  padding: 9px 12px 7px;
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--pw-line);
}
.pw-agents.is-collapsed > .pw-agents-head {
  border-bottom: none;
}
.pw-agents.is-collapsed > .pw-agents-body,
.pw-agents.is-collapsed .pw-axis {
  display: none;
}
.pw-agents-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pw-axis {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-faint);
}
.pw-agents-body {
  padding: 2px 0 6px;
}
.pw-agents .pw-fold-head {
  padding: 7px 12px 3px;
  border-radius: 0;
  font-size: var(--font-ui-smaller, 12px);
}
.pw-agents .pw-fold-head:hover {
  background: transparent;
}
/* a project in the chart: a rule above, a tinted head row whose lane sums the project's runs */
.pw-proj + .pw-proj {
  border-top: 1px solid var(--pw-line);
}
.pw-agents .pw-proj-head {
  display: grid;
  grid-template-columns: var(--pw-who) 1fr;
  gap: 0;
  padding: 0 12px;
  min-height: 34px;
  background: var(--pw-well);
  font-size: var(--font-ui-small, 13px);
}
.pw-agents .pw-proj-head:hover {
  background: color-mix(in srgb, var(--text-normal) 6%, transparent);
}
.pw-proj-who {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding-right: 8px;
}
.pw-proj-working {
  margin-left: auto;
  color: var(--pw-accent);
}
.pw-proj-working .pw-badge-n {
  color: inherit;
}
.pw-agents .pw-proj > .pw-fold-body {
  padding: 2px 0 4px;
}
.pw-lane.pw-lane-sum {
  min-height: 34px;
}
.pw-lane.pw-lane-sum i {
  height: 12px;
  margin-top: -6px;
  background: color-mix(in srgb, var(--pw-accent) 35%, transparent);
}
.pw-lane.pw-lane-sum i.is-live {
  background: var(--pw-accent);
}
.pw-proj.is-collapsed .pw-proj-head {
  background: transparent;
}

.pw-run {
  min-height: 38px;
  padding: 2px 12px;
}
.pw-run:hover {
  background: var(--pw-hover);
}
.pw-run {
  position: relative;
}
/* hide: over the right end of the lane, only while the row is hovered or focused */
.pw-run-hide {
  position: absolute;
  top: 50%;
  /* at the end of the name column, clear of the lane and the cards it shows */
  left: calc(var(--pw-who) - 22px);
  transform: translateY(-50%);
  display: none;
  padding: 3px;
  border: none;
  border-radius: var(--radius-s);
  background: var(--background-primary);
  color: var(--text-muted);
  cursor: pointer;
}
.pw-run-hide svg {
  width: 14px;
  height: 14px;
}
.pw-run:hover > .pw-run-hide,
.pw-run:focus-within > .pw-run-hide {
  display: flex;
}
.pw-run-hide:hover {
  color: var(--text-normal);
}
@media (hover: none) {
  .pw-run > .pw-run-hide {
    display: flex;
    opacity: 0.5;
  }
}
.pw-run-who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 10px 0 calc(var(--pw-depth, 0) * 14px);
}
.pw-run-icon {
  display: inline-flex;
  flex: none;
  color: var(--text-faint);
}
.pw-run-icon svg {
  width: 15px;
  height: 15px;
}
/* a service's own icon, shown as fetched; the state moves to a dot and a lead gets a small mark */
.pw-run-mark {
  position: relative;
  display: inline-flex;
  flex: none;
}
.pw-site-img {
  display: block;
  width: 15px;
  height: 15px;
  object-fit: contain;
  border-radius: 3px;
  background: var(--pw-site-icon-bg, transparent);
}
.pw-run-icon.is-site,
.pw-pr-icon.is-site,
.pw-from .is-site {
  display: inline-flex;
}
.pw-run-dot,
.pw-run-lead {
  display: none;
  position: absolute;
}
.pw-run-mark.has-site .pw-run-dot {
  display: block;
  right: -3px;
  bottom: -3px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  box-shadow: 0 0 0 1.5px var(--pw-surface);
}
.pw-run-mark.has-site .pw-run-lead {
  display: inline-flex;
  left: -5px;
  top: -5px;
  color: var(--text-normal);
  background: var(--pw-surface);
  border-radius: 3px;
}
.pw-run-lead svg {
  width: 9px;
  height: 9px;
}
.pw-state-working .pw-run-mark .pw-run-dot,
.pw-state-waiting .pw-run-mark .pw-run-dot {
  background: var(--pw-accent);
}
.pw-state-stalled .pw-run-mark .pw-run-dot,
.pw-state-failed .pw-run-mark .pw-run-dot {
  background: var(--pw-bad);
}
.pw-pr-icon {
  display: inline-flex;
  flex: none;
  align-self: center;
  color: var(--text-faint);
}
.pw-pr-icon svg,
.pw-pr-icon .pw-site-img {
  width: 14px;
  height: 14px;
}
.pw-from .pw-site-img {
  width: 13px;
  height: 13px;
}
.pw-state-working .pw-run-icon,
.pw-state-waiting .pw-run-icon {
  color: var(--pw-accent);
}
.pw-state-stalled .pw-run-icon,
.pw-state-failed .pw-run-icon {
  color: var(--pw-bad);
}
.pw-run-text {
  min-width: 0;
  flex: 1;
}
.pw-run-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-normal);
  line-height: 1.3;
}
.pw-run.is-lead .pw-run-title {
  font-weight: var(--font-semibold, 600);
}
.pw-state-done .pw-run-title,
.pw-state-idle:not(.is-lead) .pw-run-title,
.pw-fold .pw-run-title {
  color: var(--text-muted);
}
.pw-run-title.is-link {
  cursor: pointer;
}
.pw-run-title.is-link:hover {
  color: var(--text-accent);
  text-decoration: underline;
}
.pw-run-sub {
  display: flex;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1.3;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
}
.pw-run-age {
  flex: none;
  font-variant-numeric: tabular-nums;
}
.pw-run-device {
  flex: none;
}
.pw-run-device::before {
  content: "· ";
}
.pw-run-action {
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-run-action::before {
  content: "· ";
}
.pw-state-stalled .pw-run-action,
.pw-state-failed .pw-run-action {
  color: var(--pw-bad);
}
.pw-fold {
  cursor: pointer;
}

/* one lane: quarter-hour grid lines, the active minutes as segments, now at the right edge */
.pw-lane {
  position: relative;
  align-self: stretch;
  min-height: 30px;
  background-image: linear-gradient(var(--pw-line), var(--pw-line)), linear-gradient(var(--pw-line), var(--pw-line)),
    linear-gradient(var(--pw-line), var(--pw-line));
  background-size: 1px 100%;
  background-position: 25% 0, 50% 0, 75% 0;
  background-repeat: no-repeat;
  border-right: 1.5px solid color-mix(in srgb, var(--pw-accent) 70%, transparent);
}
.pw-lane i {
  position: absolute;
  top: 50%;
  height: 8px;
  margin-top: -4px;
  min-width: 3px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--text-faint) 55%, transparent);
}
.pw-lane i.is-live {
  background: var(--pw-accent);
}
.pw-lane i.is-bad {
  background: var(--pw-bad);
}

@container (max-width: 380px) {
  .pw-agents-head,
  .pw-run {
    grid-template-columns: 1fr;
  }
  .pw-lane,
  .pw-axis {
    display: none;
  }
}

/* ---------------------------------------------------------------- cards */

.pw-cards > .pw-fold-group {
  margin: 0 0 6px;
}
.pw-cards > .pw-fold-group > .pw-fold-head {
  margin: 0 0 6px;
}
.pw-card {
  --pw-spot-bg: var(--pw-surface);
  position: relative;
  background: var(--pw-surface);
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 14px 16px 14px;
  margin: 0 0 var(--pw-gap);
}
.pw-card.is-busy {
  opacity: 0.6;
}
/* where a click went: a ring that pulses twice and fades, with a tint, once the scroll lands */
@keyframes pw-spotlight {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--pw-accent) 0%, transparent);
    background-color: color-mix(in srgb, var(--pw-accent) 14%, var(--pw-spot-bg));
  }
  12% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pw-accent) 60%, transparent);
  }
  30% {
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--pw-accent) 35%, transparent);
  }
  48% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pw-accent) 60%, transparent);
    background-color: color-mix(in srgb, var(--pw-accent) 10%, var(--pw-spot-bg));
  }
  100% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--pw-accent) 0%, transparent);
    background-color: var(--pw-spot-bg);
  }
}
.pw-card.is-spotlight,
.pw-pr.is-spotlight {
  position: relative;
  z-index: 1;
  animation: pw-spotlight 2.2s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .pw-card.is-spotlight,
  .pw-pr.is-spotlight {
    animation: none;
    outline: 2px solid var(--pw-accent);
    outline-offset: 2px;
  }
}
.pw-card.is-drop {
  outline: 2px dashed var(--pw-accent);
  outline-offset: 2px;
}

/* dismiss: an x in the card head beside the fold button, shown while the card is hovered;
   armed, it turns into a red "Dismiss" until the second click */
.pw-card-dismiss {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px;
  border-radius: var(--radius-s, 4px);
  color: var(--text-faint);
  opacity: 0;
  transition:
    opacity 120ms ease,
    color 120ms ease,
    background-color 120ms ease;
}
.pw-card:hover > .pw-card-head > .pw-card-dismiss,
.pw-card-dismiss:focus-visible,
.pw-card-dismiss.is-armed {
  opacity: 1;
}
.pw-card-dismiss:hover {
  color: var(--text-normal);
  background: var(--pw-hover);
}
.pw-card-dismiss svg {
  width: 14px;
  height: 14px;
}
.pw-card-dismiss-label {
  display: none;
  font-size: var(--font-ui-smaller, 12px);
  font-weight: var(--font-semibold, 600);
  line-height: 1;
}
.pw-card-dismiss.is-armed,
.pw-card-dismiss.is-armed:hover {
  padding: 3px 8px 3px 5px;
  color: var(--pw-bad);
  background: color-mix(in srgb, var(--pw-bad) 13%, transparent);
}
.pw-card-dismiss.is-armed .pw-card-dismiss-label {
  display: inline;
}
/* armed, the red Dismiss takes the place of the age and id for those few seconds */
.pw-card-head:has(> .pw-card-dismiss.is-armed) > .pw-card-age,
.pw-card-head:has(> .pw-card-dismiss.is-armed) > .pw-card-id {
  display: none;
}
.pw-card-head:has(> .pw-card-dismiss.is-armed) > .pw-card-dismiss {
  margin-left: auto;
}
.pw-close-note.is-dismissed {
  color: var(--text-faint);
}
.pw-card-fold {
  display: inline-flex;
  padding: 2px;
  color: var(--text-faint);
}
.pw-card-fold:hover {
  color: var(--text-normal);
}
.pw-card.is-folded > .pw-card-head .pw-chevron {
  transform: rotate(-90deg);
}
.pw-card.is-folded {
  padding-top: 10px;
  padding-bottom: 10px;
}
.pw-card.is-folded > .pw-card-main {
  display: none;
}
.pw-card.is-folded > .pw-card-head {
  margin-bottom: 4px;
}
.pw-card.is-folded > .pw-card-title {
  font-size: var(--font-ui-small, 13px);
  cursor: pointer;
}
.pw-card-head {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  font-size: var(--font-ui-smaller, 12px);
  color: var(--text-muted);
  margin-bottom: 8px;
}
.pw-kind {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: var(--pw-k);
  background: color-mix(in srgb, var(--pw-k) 13%, transparent);
}
.pw-kind svg {
  width: 15px;
  height: 15px;
}
.pw-kind-decide {
  --pw-k: var(--pw-decide);
}
.pw-kind-try {
  --pw-k: var(--pw-try);
}
.pw-kind-block {
  --pw-k: var(--pw-block);
}
.pw-kind-todo {
  --pw-k: var(--pw-todo);
}
.pw-card-project {
  font-weight: var(--font-semibold, 600);
  color: var(--text-normal);
}
.pw-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  min-width: 0;
}
.pw-meta .pw-icon svg {
  width: 13px;
  height: 13px;
}
a.pw-from {
  text-decoration: none;
}
a.pw-from:hover {
  color: var(--text-accent);
}
/* one line: the task and who asked give way, the age, id and buttons keep their size */
.pw-card-head > * {
  flex-shrink: 0;
}
.pw-card-head > .pw-card-project {
  max-width: 40%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pw-card-head > .pw-from {
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pw-card-head > .pw-from > .pw-from-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-card-age {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.pw-card-id {
  padding: 0 4px;
  border: none;
  border-radius: var(--radius-s);
  background: none;
  color: var(--text-faint);
  font-family: var(--font-monospace);
  font-size: var(--font-ui-smaller);
  cursor: pointer;
}
.pw-card-id:hover {
  color: var(--text-normal);
  background: var(--pw-hover);
}
.pw-card-title {
  font-weight: 650;
  color: var(--text-normal);
  font-size: 15.5px;
  line-height: 1.35;
  letter-spacing: -0.005em;
}
.pw-card-body {
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}
.pw-card-body > :first-child {
  margin-top: 0;
}
.pw-card-body > :last-child {
  margin-bottom: 0;
}
.pw-look {
  margin-top: 8px;
  display: flex;
  gap: 6px;
  color: var(--text-muted);
}
.pw-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
button.pw-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  max-width: 100%;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid var(--pw-line);
  background: transparent;
  box-shadow: none;
  font-size: var(--font-ui-smaller, 12px);
  color: var(--text-normal);
}
button.pw-ref:hover {
  background: var(--pw-hover);
}
button.pw-ref.is-missing {
  border-style: dashed;
  color: var(--text-muted);
}
.pw-ref .pw-btn-icon {
  color: var(--text-muted);
}
.pw-ref .pw-btn-icon svg {
  width: 13px;
  height: 13px;
}
.pw-ref span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* rows of one height that fill the width; the sizes come from layoutMedia in panel.ts */
.pw-media {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.pw-media-item {
  flex: none;
  position: relative;
  max-width: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: var(--background-secondary);
}
.pw-media-img,
.pw-media-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pw-media-img {
  cursor: zoom-in;
}
.pw-media-expand {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  opacity: 0;
  transition: opacity 120ms ease;
  cursor: pointer;
}
.pw-media-item:hover .pw-media-expand,
.pw-media-expand:focus-visible {
  opacity: 1;
}
.pw-media-expand:hover {
  background: rgba(0, 0, 0, 0.75);
}
.pw-media-expand svg {
  width: 14px;
  height: 14px;
}

/* the viewer: over the whole window, the page dimmed behind it; dark in both themes */
.pw-viewer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 8, 10, 0.86);
  backdrop-filter: blur(6px);
  color: #f2f2f3;
  outline: none;
  animation: pw-viewer-in 140ms ease-out;
}
.pw-viewer.is-closing {
  animation: pw-viewer-out 120ms ease-in forwards;
}
@keyframes pw-viewer-in {
  from {
    opacity: 0;
  }
}
@keyframes pw-viewer-out {
  to {
    opacity: 0;
  }
}
.pw-viewer-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
.pw-viewer-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  cursor: zoom-in;
  user-select: none;
  opacity: 0;
}
.pw-viewer-img.is-ready {
  opacity: 1;
  animation: pw-viewer-pop 160ms ease-out;
}
@keyframes pw-viewer-pop {
  from {
    opacity: 0;
    scale: 0.97;
  }
}
.pw-viewer.is-zoomed .pw-viewer-img {
  cursor: grab;
}
.pw-viewer.is-panning .pw-viewer-img {
  cursor: grabbing;
}
.pw-viewer-video {
  max-width: calc(100% - 48px);
  max-height: calc(100% - 120px);
  border-radius: 6px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  background: #000;
  cursor: default;
}
.pw-viewer-bar {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(32, 32, 36, 0.82);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.pw-viewer.is-video .pw-viewer-zoom {
  display: none;
}
.pw-viewer-btn,
.pw-viewer-level {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.pw-viewer-btn:hover,
.pw-viewer-level:hover {
  background: rgba(255, 255, 255, 0.12);
}
.pw-viewer-btn:disabled {
  opacity: 0.35;
  cursor: default;
  background: transparent;
}
.pw-viewer-btn svg {
  width: 16px;
  height: 16px;
}
.pw-viewer-level {
  min-width: 52px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.pw-viewer-sep {
  width: 1px;
  height: 18px;
  margin: 0 4px;
  background: rgba(255, 255, 255, 0.18);
}
.pw-viewer-prev,
.pw-viewer-next {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(32, 32, 36, 0.72);
}
.pw-viewer-prev {
  left: 12px;
}
.pw-viewer-next {
  right: 12px;
}
.pw-viewer-prev[hidden],
.pw-viewer-next[hidden] {
  display: none;
}
.pw-viewer-caption {
  position: absolute;
  left: 50%;
  bottom: 14px;
  translate: -50% 0;
  max-width: calc(100% - 32px);
  padding: 5px 12px;
  border-radius: 8px;
  background: rgba(32, 32, 36, 0.72);
  font-size: 12px;
  white-space: pre;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .pw-viewer,
  .pw-viewer-img.is-ready {
    animation: none;
  }
}

.pw-comments {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.pw-comment {
  display: flex;
  gap: 6px;
  line-height: 1.45;
}
.pw-comment .pw-icon {
  margin-top: 1px;
}
.pw-comment .pw-icon svg {
  width: 13px;
  height: 13px;
}
.pw-comment.pw-by-human {
  color: var(--text-normal);
}

/* ---------------------------------------------------------------- reply */

.pw-reply {
  margin-top: 12px;
}
.pw-options {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--pw-line);
  border-radius: 9px;
  overflow: hidden;
  margin-bottom: 10px;
}
button.pw-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: auto;
  min-height: 38px;
  padding: 8px 12px;
  margin: 0;
  border: none;
  border-top: 1px solid var(--pw-line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  white-space: normal;
  justify-content: flex-start;
  color: var(--text-normal);
}
button.pw-option:first-child {
  border-top: none;
}
button.pw-option:hover {
  background: var(--pw-hover);
}
.pw-option-n {
  flex: none;
  min-width: 1.3em;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}
.pw-option-n::after {
  content: ".";
}
.pw-option-text {
  flex: 1;
  line-height: 1.4;
}
button.pw-option.is-recommended {
  background: color-mix(in srgb, var(--pw-accent) 8%, transparent);
  box-shadow: inset 3px 0 0 var(--pw-accent);
}
.pw-option-rec {
  color: var(--pw-accent);
}
.pw-option-rec svg {
  width: 16px;
  height: 16px;
}

.pw-reply-line {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.pw-note {
  flex: 1;
  resize: none;
  height: 34px;
  min-height: 34px;
  border-radius: 9px;
  border: 1px solid var(--pw-line);
  background: var(--background-secondary);
  font-size: var(--font-ui-small, 13px);
  transition: height 120ms ease;
}
.pw-note:focus,
.pw-reply.has-draft .pw-note {
  height: 64px;
  resize: vertical;
}
button.pw-round {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--pw-line);
  background: var(--pw-surface);
  box-shadow: none;
  color: var(--text-muted);
}
button.pw-round:hover {
  background: var(--pw-hover);
  color: var(--text-normal);
}
button.pw-round.pw-send {
  background: var(--pw-accent);
  border-color: transparent;
  color: var(--text-on-accent, #fff);
}
button.pw-round.pw-send:disabled {
  opacity: 0.3;
}
.pw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.pw-chips:empty {
  display: none;
}
.pw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 4px 1px 8px;
  border-radius: 999px;
  background: var(--pw-hover);
  font-size: var(--font-ui-smaller, 12px);
  max-width: 100%;
}
.pw-chip .pw-icon svg {
  width: 12px;
  height: 12px;
}
.pw-chip-x {
  all: unset;
  cursor: pointer;
  padding: 0 4px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------- answered */

.pw-section {
  display: flex;
  align-items: center;
  margin: 18px 4px 8px;
}
.pw-card-past {
  background: transparent;
  box-shadow: none;
  padding: 0;
}
.pw-past-top {
  padding: 10px 14px;
  border-radius: var(--pw-radius);
  cursor: pointer;
}
.pw-past-top:hover {
  background: var(--pw-hover);
}
.pw-past-top:focus-visible {
  outline: 2px solid var(--interactive-accent);
  outline-offset: -2px;
}
.pw-card-past .pw-card-head {
  margin-bottom: 4px;
}
.pw-card-past .pw-kind {
  --pw-k: var(--text-faint);
}
.pw-past-title {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pw-card-past .pw-card-title {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  font-weight: var(--font-normal, 400);
  font-size: var(--font-ui-small, 13px);
}
.pw-past-title .pw-chevron {
  color: var(--text-faint);
  transition: transform 120ms ease;
}
.pw-card-past.is-open .pw-past-title .pw-chevron {
  transform: rotate(180deg);
}
.pw-card-past.is-open {
  background: var(--pw-surface);
}
.pw-card-past.is-open .pw-card-title {
  color: var(--text-normal);
}
.pw-past-detail {
  padding: 0 14px 14px;
}
.pw-past-detail > :first-child {
  margin-top: 0;
}
.pw-past-empty {
  padding-top: 2px;
}
.pw-card-closed .pw-past-top {
  opacity: 0.85;
}
.pw-closed-group {
  margin-top: 18px;
}
.pw-closed-group > .pw-fold-head .pw-fold-badges,
.pw-answered-group > .pw-fold-head .pw-fold-badges {
  margin-left: 0;
}
.pw-answered-group {
  margin-top: 18px;
}
.pw-answer {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  color: var(--text-muted);
}
.pw-answer.is-late > span:first-of-type {
  text-decoration: line-through;
  opacity: 0.7;
}

.pw-answer .pw-icon svg {
  width: 13px;
  height: 13px;
}

/*
 * A group inside a project's group (its to-dos) is a well: a tinted box whose head is its first
 * line. Folded, it is one line; opened, the box grows and the cards sit inside it.
 */
.pw-nested {
  margin: 2px 0 var(--pw-gap);
  padding: 2px 6px;
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius);
  background: var(--pw-well);
}
.pw-nested > .pw-fold-head {
  padding: 6px 4px;
}
.pw-nested > .pw-fold-head .pw-fold-name {
  font-weight: var(--font-normal, 400);
  color: var(--text-muted);
}
.pw-nested > .pw-fold-head .pw-fold-badges {
  margin-left: 0;
}
.pw-nested > .pw-fold-body {
  padding: 2px 0 0;
}
.pw-nested .pw-card {
  margin-bottom: 6px;
  box-shadow: none;
}

/* ---------------------------------------------------------------- approvals */

.pw-action {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
  color: var(--text-muted);
}
.pw-action .pw-icon svg {
  width: 13px;
  height: 13px;
  margin-top: 3px;
}
.pw-action-main {
  min-width: 0;
  flex: 1;
}
.pw-action-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.pw-action-text,
.pw-action-full {
  font-family: var(--font-monospace);
  font-size: var(--font-ui-smaller);
  color: var(--text-normal);
  background: var(--background-secondary);
  border-radius: var(--radius-s);
  padding: 2px 6px;
  white-space: pre-wrap;
  word-break: break-word;
}
.pw-action-text {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pw-action-full {
  display: block;
  margin-top: 4px;
}
.pw-action-more summary {
  cursor: pointer;
  font-size: var(--font-ui-smaller);
  color: var(--text-faint);
}
.pw-changed {
  color: var(--text-faint);
  font-size: var(--font-ui-smaller);
}
.pw-preview-wrap {
  margin-top: 8px;
}
.pw-preview {
  margin: 0;
  overflow: auto;
  padding: 8px 10px;
  font-family: var(--font-monospace);
  font-size: var(--font-ui-smaller);
  line-height: 1.45;
  color: var(--text-normal);
  background: var(--background-secondary);
  border-radius: var(--radius-s);
  white-space: pre-wrap;
  word-break: break-word;
}
.pw-preview.markdown-rendered {
  font-family: inherit;
  font-size: var(--font-ui-small);
  white-space: normal;
}
/* about six lines, whatever the content */
.pw-preview.is-collapsed {
  max-height: 9em;
  overflow: hidden;
}
.pw-preview-toggle {
  margin-top: 4px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  height: auto;
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  cursor: pointer;
}
.pw-delivery {
  margin-top: 4px;
  font-size: var(--font-ui-smaller);
  color: var(--text-faint);
}

/* ---------------------------------------------------------------- asked in chat, pull requests */

.pw-ask,
.pw-pr {
  --pw-spot-bg: transparent;
  border-radius: var(--radius-s, 6px);
  padding: 8px 14px;
  border-radius: var(--pw-radius);
}
.pw-ask:hover,
.pw-pr:hover {
  background: var(--pw-hover);
}
.pw-ask-top,
.pw-pr-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.pw-ask-who,
.pw-pr-label {
  font-weight: var(--font-semibold);
  color: var(--text-normal);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-ask-who:hover,
.pw-pr-label:hover {
  color: var(--text-accent);
}
.pw-ask-age {
  margin-left: auto;
}
.pw-ask-text {
  margin-top: 2px;
  color: var(--color-yellow);
  line-height: 1.45;
}
.pw-ask.is-blocked .pw-ask-text {
  color: var(--color-red);
}
.pw-pr-wait {
  color: var(--color-yellow);
  white-space: nowrap;
}
.pw-pr.is-stuck .pw-pr-wait {
  color: var(--color-red);
}
.pw-pr-top .pw-meta {
  margin-left: auto;
}
.pw-pr-title {
  margin-top: 2px;
  color: var(--text-muted);
  line-height: 1.45;
}
.pw-pr-owner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 3px;
  text-decoration: none;
}
a.pw-pr-owner:hover {
  color: var(--text-accent);
}
.pw-badge.is-stuck .pw-badge-n,
.pw-prs.is-stuck .pw-badge-n {
  color: var(--color-red);
}
.pw-asks .pw-badge-n {
  color: var(--color-yellow);
}
.pw-run-repeats {
  margin-left: 6px;
  font-size: var(--font-ui-smaller);
  color: var(--text-faint);
}
.pw-run-sub.is-asking .pw-run-action {
  color: var(--color-yellow);
}
.pw-run-sub.is-blocked .pw-run-action {
  color: var(--color-red);
}

/* ---------------------------------------------------------------- what a run waits on */

/* the cards a run opened and has no answer for, at the "now" end of its lane */
.pw-lane-cards {
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
}
.pw-lane-card {
  --pw-k: var(--pw-decide);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px 1px 4px;
  border: 1px solid color-mix(in srgb, var(--pw-k) 45%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--pw-k) 12%, var(--pw-surface));
  color: var(--pw-k);
  font-family: var(--font-monospace);
  font-size: 11px;
  line-height: 16px;
  cursor: pointer;
}
.pw-lane-card:hover {
  background: color-mix(in srgb, var(--pw-k) 22%, var(--pw-surface));
}
.pw-lane-card .pw-icon svg {
  width: 12px;
  height: 12px;
}
.pw-lane-card.pw-kind-try {
  --pw-k: var(--pw-try);
}
.pw-lane-card.pw-kind-block {
  --pw-k: var(--pw-block);
}
.pw-lane-card.pw-kind-todo {
  --pw-k: var(--pw-todo);
}
.pw-lane-pr {
  --pw-k: var(--text-muted);
  font-family: inherit;
}
.pw-lane-pr.pw-pr-review {
  --pw-k: var(--color-cyan, #0e9384);
}
.pw-lane-pr.pw-pr-held {
  --pw-k: var(--color-yellow, #a16207);
}
.pw-lane-pr.pw-pr-bad,
.pw-lane-pr.is-stuck {
  --pw-k: var(--pw-bad);
}
.pw-run-sub.is-waiting-pr .pw-run-action {
  color: var(--text-muted);
}
.pw-run-sub.is-waiting-pr-stuck .pw-run-action {
  color: var(--pw-bad);
}
.pw-lane-more {
  font-size: 11px;
  color: var(--text-muted);
}
.pw-run-sub.is-waiting-card .pw-run-action {
  color: var(--pw-decide);
}

/* ---------------------------------------------------------------- no session gets these */

.pw-help-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  height: auto;
  border-radius: 999px;
  border: 1px solid var(--background-modifier-border);
  background: var(--background-primary);
  box-shadow: none;
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  cursor: pointer;
}
.pw-help-btn:hover {
  color: var(--text-normal);
  border-color: var(--text-faint);
}
.pw-help-btn .pw-icon,
.pw-help-btn svg {
  width: 13px;
  height: 13px;
}
.pw-no-session {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.pw-lead-help {
  margin: 6px 0 8px;
  padding: 10px 12px;
  border-radius: var(--pw-radius, 8px);
  border: 1px solid var(--background-modifier-border);
  background: var(--background-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--font-ui-small);
}
.pw-lead-help-text {
  color: var(--text-normal);
  line-height: 1.45;
}
.pw-lead-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pw-lead-row .pw-icon {
  flex: none;
  color: var(--text-muted);
}
.pw-lead-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.pw-lead-row .pw-meta {
  flex: none;
}
.pw-lead-pick {
  margin-left: auto;
  flex: none;
  padding: 2px 10px;
  height: auto;
  font-size: var(--font-ui-smaller);
  cursor: pointer;
}

/* ---------------------------------------------------------------- board and views */

/* narrow: one view at a time; wide: the board beside the feed */
.pw-panel.pw-view-feed > .pw-board,
.pw-panel.pw-view-board > .pw-feed {
  display: none;
}
.pw-panel.pw-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 560px);
  grid-template-rows: auto 1fr;
  column-gap: 16px;
  align-items: start;
}
.pw-panel.pw-split > .pw-head {
  grid-column: 1 / -1;
}
.pw-panel.pw-split > .pw-board {
  position: sticky;
  top: 56px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}

.pw-board {
  --pw-you: var(--pw-accent);
  --pw-stopped: var(--pw-bad);
  --pw-running: var(--color-green, #1f9d55);
  --pw-others: var(--color-yellow, #a16207);
  --pw-quiet: var(--text-faint);
  font-size: 12.5px;
}
.pw-mark-you { --pw-m: var(--pw-you); }
.pw-mark-stopped { --pw-m: var(--pw-stopped); }
.pw-mark-running { --pw-m: var(--pw-running); }
.pw-mark-others { --pw-m: var(--pw-others); }
.pw-mark-quiet { --pw-m: var(--pw-quiet); }

.pw-board-sum {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.pw-board-count,
.pw-board-extra {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: 1px solid var(--pw-line);
  border-radius: 999px;
  background: var(--pw-surface);
  color: var(--text-normal);
  font: inherit;
  cursor: pointer;
}
.pw-board-count.is-zero {
  color: var(--text-faint);
}
.pw-board-count.is-zero .pw-board-dot {
  opacity: 0.35;
}
.pw-board-count.is-on {
  border-color: var(--pw-m);
  background: color-mix(in srgb, var(--pw-m) 12%, var(--pw-surface));
}
.pw-board-n {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.pw-board-word {
  color: var(--text-muted);
}
.pw-board-extra {
  color: var(--text-muted);
}
.pw-board-extra .pw-icon svg {
  width: 13px;
  height: 13px;
}
.pw-board-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pw-m);
}
.pw-mark-running > .pw-board-dot,
.pw-board-count.pw-mark-running:not(.is-zero) .pw-board-dot {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pw-running) 22%, transparent);
}

.pw-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px;
  align-items: start;
}
.pw-bt {
  background: var(--pw-surface);
  border: 1px solid var(--pw-line);
  border-left: 3px solid var(--pw-m);
  border-radius: 10px;
  padding: 6px 0 4px;
  min-width: 0;
}
.pw-bt.pw-mark-quiet {
  border-left-color: var(--pw-line);
}
.pw-bt-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 4px;
  font-weight: 650;
}
.pw-bt-head .pw-icon svg {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}
.pw-bt-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pw-bt-marks {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}
.pw-bt-mark {
  min-width: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--pw-m) 15%, transparent);
  color: var(--pw-m);
  font-size: 11px;
  font-weight: 650;
  line-height: 16px;
  text-align: center;
}
.pw-br {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 1px 10px;
}
.pw-br:hover {
  background: var(--pw-hover);
}
.pw-br-title {
  flex: 0 1 auto;
  min-width: 6.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-normal);
  text-decoration: none;
}
a.pw-br-title:hover {
  text-decoration: underline;
}
.pw-br.pw-mark-quiet .pw-br-title {
  color: var(--text-muted);
}
.pw-br-subs {
  flex: none;
  color: var(--text-faint);
  font-size: 11px;
}
.pw-br-chips {
  display: inline-flex;
  flex: 0 2 auto;
  min-width: 0;
  overflow: hidden;
  gap: 3px;
}
.pw-br-chips > * {
  flex: none;
}
.pw-br-note {
  flex: 0 3 auto;
  min-width: 0;
  max-width: 40%;
  margin-left: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--pw-m);
  font-size: 11.5px;
}
.pw-br.pw-mark-quiet .pw-br-note,
.pw-br.pw-mark-running .pw-br-note {
  color: var(--text-faint);
}
.pw-br-device,
.pw-br-age {
  flex: none;
  color: var(--text-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.pw-br-age {
  min-width: 26px;
  text-align: right;
}
.pw-br-more {
  display: block;
  width: 100%;
  padding: 2px 10px 2px 24px;
  border: none;
  background: none;
  color: var(--text-faint);
  font: inherit;
  font-size: 11.5px;
  text-align: left;
  cursor: pointer;
}
.pw-br-more:hover {
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ Codex conversation */
.pw-panel.pw-chatting > .pw-board,
.pw-panel.pw-chatting > .pw-feed {
  display: none !important;
}
.pw-panel.pw-split.pw-chatting {
  display: block;
}
.pw-chat {
  display: flex;
  flex-direction: column;
  min-height: 240px;
  background: var(--pw-surface);
  border: 1px solid var(--pw-line);
  border-radius: var(--pw-radius);
  overflow: hidden;
}
.pw-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--pw-line);
  flex: none;
}
.pw-chat-title {
  flex: 1;
  min-width: 0;
}
.pw-chat-name {
  font-weight: var(--font-semibold);
  font-size: var(--font-ui-small);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-chat-sub {
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: var(--font-ui-small);
}
.pw-chat-empty,
.pw-chat-earlier,
.pw-chat-sys {
  color: var(--text-muted);
  font-size: var(--font-ui-smaller);
  text-align: center;
  padding: 4px 0;
}
.pw-chat-empty.is-error,
.pw-chat-sys.is-error {
  color: var(--text-error);
}
.pw-chat-msg.is-user {
  align-self: flex-end;
  max-width: 85%;
}
.pw-chat-bubble {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 8px 11px;
  border-radius: 12px 12px 4px 12px;
  background: var(--interactive-accent);
  color: var(--text-on-accent);
  max-height: 320px;
  overflow-y: auto;
}
.pw-chat-meta {
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  text-align: right;
  margin-top: 2px;
}
.pw-chat-msg.is-agent {
  max-width: 100%;
  overflow-wrap: anywhere;
}
.pw-chat-msg.is-commentary {
  color: var(--text-muted);
}
.pw-chat-text > :first-child {
  margin-top: 0;
}
.pw-chat-text > :last-child {
  margin-bottom: 0;
}
.pw-chat-text pre {
  overflow-x: auto;
  background: var(--background-secondary);
  padding: 8px;
  border-radius: var(--radius-s);
}
.pw-chat-fold-head,
.pw-chat-tool,
.pw-chat-files-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
  text-align: left;
}
.pw-chat-fold-head {
  background: none;
  border: none;
  box-shadow: none;
  padding: 3px 6px;
  height: auto;
  border-radius: var(--radius-s);
  cursor: pointer;
  font: inherit;
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
}
.pw-chat-fold-head:hover {
  background: var(--pw-hover);
  color: var(--text-normal);
}
.pw-chat-tool {
  padding: 3px 6px;
}
.pw-chat-fold-head svg,
.pw-chat-tool svg,
.pw-chat-files-head svg {
  width: 14px;
  height: 14px;
  flex: none;
}
.pw-chat-prompt {
  font-family: var(--font-monospace);
  color: var(--text-faint);
  flex: none;
}
.pw-chat-step-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-monospace);
}
a.pw-chat-step-text {
  font-family: inherit;
  color: var(--text-accent);
}
.pw-chat-steps-count,
.pw-chat-tool-name {
  flex: none;
  color: var(--text-normal);
}
.pw-chat-exit {
  flex: none;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--background-secondary);
}
.pw-chat-exit.is-bad {
  color: var(--pw-bad);
}
.pw-chat-fold-body {
  margin: 2px 0 4px 20px;
}
.pw-chat-steps-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 2px solid var(--pw-line);
  padding-left: 6px;
}
.pw-chat-output,
.pw-chat-diff {
  margin: 0;
  max-height: 320px;
  overflow: auto;
  padding: 8px 10px;
  font-family: var(--font-monospace);
  font-size: 11.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: var(--background-secondary);
  border-radius: var(--radius-s);
}
.pw-chat-output-cmd {
  color: var(--text-muted);
  margin-bottom: 4px;
}
.pw-chat-output-cmd::before {
  content: "$ ";
}
.pw-chat-diff .is-add {
  color: var(--color-green);
}
.pw-chat-diff .is-del {
  color: var(--color-red);
}
.pw-chat-diff .is-hunk {
  color: var(--text-faint);
}
.pw-chat-files {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.pw-chat-files-head {
  padding: 3px 6px;
}
.pw-chat-file .pw-chat-fold-head {
  padding-left: 20px;
}
.pw-chat-change {
  flex: none;
  width: 14px;
  font-family: var(--font-monospace);
  font-weight: var(--font-semibold);
  color: var(--color-yellow);
}
.pw-chat-change.is-add {
  color: var(--color-green);
}
.pw-chat-change.is-delete {
  color: var(--color-red);
}
.pw-chat-status {
  flex: none;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px;
  font-size: var(--font-ui-smaller);
  color: var(--text-muted);
}
.pw-chat-status:empty {
  display: none;
}
.pw-chat-status.is-working,
.pw-chat-status:has(.pw-chat-error) {
  padding: 6px 12px;
  border-top: 1px solid var(--pw-line);
}
.pw-chat-live {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pw-chat-spin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--pw-line);
  border-top-color: var(--pw-accent);
  animation: pw-chat-spin 0.8s linear infinite;
  flex: none;
}
@keyframes pw-chat-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pw-chat-spin {
    animation: none;
  }
}
.pw-chat-stop {
  height: auto;
  padding: 2px 10px;
  font-size: var(--font-ui-smaller);
}
.pw-chat-error {
  width: 100%;
  color: var(--text-error);
  white-space: pre-wrap;
}
.pw-chat-compose {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 10px 4px;
  border-top: 1px solid var(--pw-line);
}
.pw-chat-input {
  flex: 1;
  resize: none;
  min-height: 34px;
  max-height: 180px;
  padding: 7px 10px;
  font: inherit;
  font-size: var(--font-ui-small);
  line-height: 1.4;
  color: var(--text-normal);
  background: var(--background-secondary);
  border: 1px solid var(--pw-line);
  border-radius: var(--radius-m);
}
.pw-chat-input:focus {
  outline: none;
  border-color: var(--pw-accent);
}
.pw-chat-send {
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-m);
  border: none;
  background: var(--interactive-accent);
  color: var(--text-on-accent);
  cursor: pointer;
}
.pw-chat-send:disabled {
  opacity: 0.4;
  cursor: default;
}
.pw-chat-send svg {
  width: 16px;
  height: 16px;
}
.pw-chat-note {
  flex: none;
  padding: 2px 12px 8px;
  font-size: 11px;
  color: var(--text-faint);
}
.pw-chat-note.is-blocked {
  color: var(--color-yellow);
}
