.rundetail {
  padding: 24px;
  max-width: 900px;

  &__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  &__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 12px 0 24px;
    font-size: 0.875rem;
  }

  &__error {
    color: #dc2626;
  }

  &__live {
    color: #16a34a;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
  }

  // Console-styled, reusable log viewer — built once per the spec's own advice
  // (don't build separate log viewers per persona).
  &__console {
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 0.8125rem;
    padding: 12px;
    border-radius: 6px;
    max-height: 360px;
    overflow-y: auto;
    margin-bottom: 24px;
  }

  &__logline {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-word;
  }

  &__logtime {
    color: #64748b;
    flex-shrink: 0;
  }

  &__loglevel {
    flex-shrink: 0;
    font-weight: 600;
  }

  .level--error { .rundetail__loglevel { color: #f87171; } }
  .level--warn  { .rundetail__loglevel { color: #fbbf24; } }
  .level--info  { .rundetail__loglevel { color: #60a5fa; } }

  &__table {
    width: 100%;
    border-collapse: collapse;

    th, td {
      text-align: left;
      padding: 8px 10px;
      border-bottom: 1px solid #e2e8f0;
      font-size: 0.875rem;
    }

    th { background: #f1f5f9; font-weight: 600; }
  }

  &__empty {
    color: #94a3b8;
    text-align: center;
    padding: 12px;
  }
}

.badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 8px;

  &--queued    { background: #e2e8f0; color: #475569; }
  &--running   { background: #dbeafe; color: #1d4ed8; }
  &--success   { background: #dcfce7; color: #16a34a; }
  &--failed    { background: #fee2e2; color: #dc2626; }
  &--cancelled { background: #f1f5f9; color: #64748b; }
}
