/* ====================== Actions: run detail view ====================== */

/* Left job rail: wider, so job names stop truncating at ~25 chars */
.action-view-body .action-view-left {
  max-width: 480px !important;
}

/* Job names: use the full row width and wrap to 2 lines instead of ellipsis */
.action-view-body .job-brief-item .job-brief-item-left .job-brief-name {
  width: auto !important;
  flex: 1;
  white-space: normal !important;
  overflow: hidden !important;
  overflow-wrap: anywhere;
  display: -webkit-box !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.35;
}

/* Job rows as bordered cards with a status-colored accent edge */
.action-view-body .job-brief-item {
  border: 1px solid var(--color-secondary);
  border-left-width: 3px;
  background: var(--color-box-body);
  padding: 8px 10px !important;
}
.action-view-body .job-brief-item.selected {
  border-color: var(--color-primary);
}
.action-view-body .job-brief-item:has(.octicon-check-circle-fill) {
  border-left-color: var(--color-green);
}
.action-view-body .job-brief-item:has(.octicon-x-circle-fill) {
  border-left-color: var(--color-red);
  background: color-mix(in srgb, var(--color-red) 8%, var(--color-box-body));
}
.action-view-body .job-brief-item:has(.octicon-meter) {
  border-left-color: var(--color-yellow);
}
.action-view-body .job-brief-item:has(.octicon-clock),
.action-view-body .job-brief-item:has(.octicon-blocked) {
  border-left-color: var(--color-yellow);
}
.action-view-body .job-brief-item:has(.octicon-stop) {
  border-left-color: var(--color-grey);
}
/* Skipped jobs recede instead of competing with real results */
.action-view-body .job-brief-item:has(.octicon-skip) {
  opacity: 0.55;
}
.action-view-body .job-brief-item:has(.octicon-skip):hover {
  opacity: 1;
}

/* Rail section label, GitLab-style */
.action-view-body .action-view-left .job-group-section::before {
  content: "Jobs";
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light-2);
  padding: 2px 2px 8px;
}
.action-view-body .action-view-left .job-artifacts-title {
  font-size: 12px !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light-2);
}

/* Durations as quiet monospace pills (rail + step rows share this class) */
.action-view-body .step-summary-duration {
  font-family: var(--fonts-monospace);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-light-2);
  background: var(--color-label-bg);
  border-radius: 10px;
  padding: 1px 8px;
  white-space: nowrap;
}

/* ====================== Actions: log console ====================== */

/* Clearer separation between the console header and the step list */
.action-view-right .job-info-header {
  border-bottom: 1px solid var(--color-console-border);
}

/* Step rows: slightly larger targets, subtle separators */
.action-view-right .job-step-section {
  margin: 6px 10px !important;
}
.action-view-right .job-step-summary {
  padding: 7px 10px !important;
  font-size: 13px;
}

/* Log text: bigger + more line air than the stock 12px */
.action-view-right .job-step-logs {
  font-size: 12.5px !important;
  line-height: 1.65;
  padding: 2px 0 8px;
}

/* ====================== Actions: runs list page ====================== */

/* Status accent bar + tint per run, so failures jump out while scanning */
.run-list > .flex-item {
  border-left: 3px solid var(--color-secondary);
  border-radius: var(--border-radius);
  padding-left: 8px;
  padding-right: 4px;
}
.run-list > .flex-item:hover {
  background: var(--color-hover);
}
.run-list > .flex-item:has(> .flex-item-leading .octicon-check-circle-fill) {
  border-left-color: var(--color-green);
}
.run-list > .flex-item:has(> .flex-item-leading .octicon-x-circle-fill) {
  border-left-color: var(--color-red);
  background: color-mix(in srgb, var(--color-red) 7%, transparent);
}
.run-list > .flex-item:has(> .flex-item-leading .octicon-meter) {
  border-left-color: var(--color-yellow);
}
.run-list > .flex-item:has(> .flex-item-leading .octicon-skip),
.run-list > .flex-item:has(> .flex-item-leading .octicon-stop) {
  opacity: 0.6;
}
.run-list > .flex-item:has(> .flex-item-leading .octicon-skip):hover,
.run-list > .flex-item:has(> .flex-item-leading .octicon-stop):hover {
  opacity: 1;
}
.run-list .run-list-meta {
  font-variant-numeric: tabular-nums;
}

/* ====================== Actions: pipeline graph ====================== */

.wg-pipeline {
  border: 1px solid var(--color-secondary);
  border-radius: var(--border-radius);
  background: var(--color-box-body);
  margin-top: 12px;
}
.wg-pipeline-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-light-2);
}
.wg-pipeline-meta {
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-text-light-3);
}
.wg-pipeline-header .wg-caret {
  transition: transform 0.15s;
}
.wg-pipeline.wg-collapsed .wg-caret {
  transform: rotate(-90deg);
}
.wg-pipeline.wg-collapsed .wg-pipeline-scroll {
  display: none;
}
.wg-pipeline-scroll {
  overflow-x: auto;
  padding: 8px 16px 18px;
}
.wg-pipeline-canvas {
  position: relative;
  display: inline-block;
  min-width: 100%;
}
.wg-pipeline-edges {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.wg-pipeline-edges path.wg-edge {
  fill: none;
  stroke: color-mix(in srgb, var(--color-text) 28%, transparent);
  stroke-width: 1.5;
  transition: stroke 0.1s;
}
.wg-pipeline-edges path.wg-edge-fail {
  stroke: color-mix(in srgb, var(--color-red) 45%, transparent);
}
.wg-pipeline-edges path.wg-edge-flow {
  stroke: color-mix(in srgb, var(--color-yellow) 60%, transparent);
  stroke-dasharray: 7 5;
  animation: wg-flow 0.9s linear infinite;
}
.wg-pipeline-edges path.wg-edge-hl {
  stroke: var(--color-primary);
  stroke-width: 2.25;
}
@keyframes wg-flow {
  to { stroke-dashoffset: -12; }
}
.wg-pipeline-stages {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 64px;
  width: max-content;
}
.wg-stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wg-stage::before {
  content: attr(data-label);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-light-3);
  padding-left: 12px;
}
.wg-node {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 170px;
  max-width: 300px;
  padding: 8px 14px 8px 11px;
  border: 1px solid var(--color-secondary);
  border-radius: 10px;
  background: var(--color-box-body);
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.25;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: opacity 0.12s, transform 0.12s, box-shadow 0.12s;
  animation: wg-in 0.25s ease both;
}
@keyframes wg-in {
  from { opacity: 0; transform: translateY(4px); }
}
.wg-node:hover {
  background: var(--color-hover);
  color: var(--color-text);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}
.wg-node-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.wg-node-meta {
  font-size: 11px;
  color: var(--color-text-light-2);
  font-variant-numeric: tabular-nums;
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wg-node.wg-dim {
  opacity: 0.3;
}
.wg-node.wg-selected {
  box-shadow: 0 0 0 2px var(--color-primary);
}
.wg-node.wg-orphan {
  border-style: dashed;
  opacity: 0.55;
}
.wg-node.wg-orphan:hover {
  opacity: 1;
}
.wg-node-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
}
.wg-node-dot {
  position: relative;
  box-sizing: border-box;
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--color-grey);
  color: #fff;
}
.wg-node-dot::after {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}
/* small status dot in the panel header (same status classes) */
.wg-pipeline-header .wg-node-dot {
  width: 11px;
  height: 11px;
}
.wg-pipeline .wg-pipeline-header .wg-node-dot::after {
  content: none;
}
.wg-status-success { border-color: color-mix(in srgb, var(--color-green) 55%, transparent); }
.wg-status-success .wg-node-dot { background: var(--color-green); }
.wg-status-success .wg-node-dot::after { content: "\2713"; }
.wg-status-failure { border-color: color-mix(in srgb, var(--color-red) 65%, transparent); background: color-mix(in srgb, var(--color-red) 7%, var(--color-box-body)); }
.wg-status-failure .wg-node-dot { background: var(--color-red); }
.wg-status-failure .wg-node-dot::after { content: "\2715"; }
.wg-status-running { border-color: color-mix(in srgb, var(--color-yellow) 65%, transparent); box-shadow: 0 0 6px color-mix(in srgb, var(--color-yellow) 30%, transparent); }
.wg-status-running .wg-node-dot { background: var(--color-yellow); animation: wg-pulse 1.2s ease-in-out infinite; }
.wg-status-waiting .wg-node-dot { background: var(--color-yellow); }
/* blocked (deps unmet) reads as "not going yet": hollow, not filled */
.wg-status-blocked .wg-node-dot { background: transparent; border: 2px solid var(--color-yellow); }
.wg-status-cancelled .wg-node-dot { background: var(--color-grey); }
.wg-status-cancelled .wg-node-dot::after { content: "\2205"; }
.wg-status-skipped { opacity: 0.55; }
.wg-status-skipped:hover { opacity: 1; }
.wg-status-skipped .wg-node-dot::after { content: "\2013"; }
@keyframes wg-pulse {
  50% { opacity: 0.35; }
}

/* ====================== Actions: rail grouping (set by wg-pipeline.js) ====================== */

/* children of a reusable-workflow caller: indented with a tree connector */
.action-view-left .job-brief-item[data-wg-child] {
  margin-left: 20px;
  position: relative;
}
.action-view-left .job-brief-item[data-wg-child]::before {
  content: "\2514";
  position: absolute;
  left: -15px;
  top: 50%;
  transform: translateY(-58%);
  color: var(--color-text-light-3);
  font-size: 13px;
  line-height: 1;
}

/* ====================== PR pages: Actions tab ====================== */

.wg-pr-tab .wg-run-status {
  display: inline-flex;
  margin-right: 6px;
}
.wg-pr-tab .wg-node-dot {
  width: 11px;
  height: 11px;
}
.ui.menu .wg-pr-tab .wg-node-dot::after {
  content: none;
}

/* ====================== flat mode: workflows without needs ====================== */

.wg-pipeline-flat .wg-stage {
  flex-direction: row;
  flex-wrap: wrap;
  max-width: 100%;
}
.wg-pipeline-flat .wg-stage::before {
  content: none;
}
.wg-pipeline-flat .wg-pipeline-stages {
  width: 100%;
}
