/* ===========================================
   Task aside (tasks/_sidebar, UI redesign Slice 3)

   A hairline-separated list of sections inside the shell's record aside
   (application.css owns the column and the sheet). Each section has an h2
   and a quiet glyph; nothing here is a card. tasks/_sidebar is broadcast
   into #task-sidebar-<id>, so a block may render inside its own copy.
   =========================================== */

.sidebar-blocks {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-block {
  min-width: 0;
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid var(--color-border-subtle);
}

.sidebar-block:first-child {
  padding-top: var(--spacing-xs);
}

.sidebar-block:last-child {
  border-bottom: 0;
}

.sidebar-block__header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  min-height: 1.5rem;
  margin-bottom: var(--spacing-sm);
}

.sidebar-block__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: var(--color-text-subtle);
}

.sidebar-block__icon svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
}

.sidebar-block__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--color-text-emphasis);
  font-size: var(--text-sm);
  font-weight: var(--font-semibold);
  line-height: var(--leading-snug);
}

/* A word, tinted neutral; context_usage.css tints it by usage status. */
.sidebar-block__status {
  flex-shrink: 0;
  padding: 0 var(--spacing-xs);
  border: 1px solid var(--color-neutral-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-neutral-surface);
  color: var(--color-neutral);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  line-height: 1.5;
  white-space: nowrap;
}

.sidebar-block__content {
  min-width: 0;
}

.sidebar-block__content p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Running work is info; the shared status badge has no in_progress state. */
.sidebar-blocks .status-badge--in_progress {
  border-color: var(--color-info-border);
  background-color: var(--color-info-surface);
  color: var(--color-info);
}

/* ===========================================
   Stats: label over a tabular value, no tiles
   =========================================== */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-md) var(--spacing-lg);
}

.stat-item {
  min-width: 0;
}

.stat-item__label {
  margin-bottom: 2px;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.stat-item__value {
  color: var(--color-text-emphasis);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  line-height: var(--leading-tight);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* ===========================================
   Failure details under the status badge
   =========================================== */

.status-details {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.status-details > p {
  margin: 0;
}

.error-suggestion {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
