@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");
:root {
  --font-heading: "Outfit", system-ui, sans-serif;
  --font-body: "Plus Jakarta Sans", system-ui, sans-serif;
  --bg-primary: #f6f7f9;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f3f6;
  --brand: #e5451e;
  --brand-hover: #c83a17;
  --brand-soft: #fdeee9;
  --border-color: #e6e9ee;
  --text-primary: #12161c;
  --text-secondary: #59636f;
  --text-muted: #8b95a1;
  --great: #1a8f4c;
  --fair: #c98a00;
  --bad: #d13b3b;
  --bad-hover: #b82e2e;
  --green-soft: #e7f6ee;
  --amber-soft: #fdf3dc;
  --red-soft: #fbe9e9;
  --neutral-soft: #eef1f4;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(18, 22, 28, 0.06);
  --shadow-md: 0 4px 14px rgba(18, 22, 28, 0.08);
}
* {
  box-sizing: border-box;
}
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  line-height: 1.55;
}
h1,
h2,
h3 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  line-height: 1.2;
}
h1 {
  font-size: 1.75rem;
  margin: 0 0 0.35rem;
}
h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}
h3 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}
a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--bg-tertiary);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.9em;
}
p {
  color: var(--text-secondary);
}

.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.logo span {
  color: var(--brand);
}
.logo small {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: -2px;
}
.nav {
  display: flex;
  gap: 0.35rem;
  margin-left: auto;
  align-items: center;
  flex-wrap: wrap;
}
.nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
}
.nav-link:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  text-decoration: none;
}
.nav-link.active {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}
.nav-mobile-shell {
  display: contents;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

.page-head {
  margin-bottom: 1.5rem;
}
.page-head p {
  margin: 0;
}

/* The UA rule for [hidden] loses to any component display rule (.btn is
     inline-flex), so el.hidden silently does nothing on those. Make the
     attribute authoritative. */
[hidden] {
  display: none !important;
}
/* Guided vendor wizard */
.wizard-rail {
  display: flex;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.wizard-rail-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.wizard-rail-item.active {
  border-color: var(--brand);
  color: var(--text-primary);
  font-weight: 600;
}
.wizard-rail-item.done {
  opacity: 0.75;
}
.wizard-rail-item[data-nav-active] {
  cursor: pointer;
}
.wizard-rail-item[data-nav-active]:hover {
  border-color: var(--brand);
}
.wizard-rail-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.wizard-rail-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--bg-primary);
  font-size: 0.7rem;
}
.wizard-step-title {
  margin: 0.5rem 0 0.25rem;
  font-size: 1.1rem;
}
.wizard-step-help {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.wizard-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.wizard-probe {
  margin: 0.5rem 0 1rem;
}
.wizard-probe .probe-ok {
  color: var(--ok, #15803d);
}
.wizard-probe .probe-bad {
  color: var(--danger, #b91c1c);
  font-weight: 600;
}
.wizard-probe .probe-warn {
  color: var(--warn, #b45309);
}
.probe-samples {
  margin: 0.25rem 0 0.5rem 1rem;
  padding: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-all;
}
.probe-samples-rejected {
  opacity: 0.8;
}
.wizard-access {
  margin: 1rem 0;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.wizard-selectors td {
  vertical-align: top;
}
.wizard-selectors .selector-result {
  font-size: 0.8rem;
  color: var(--text-muted);
  word-break: break-word;
}
.wizard-selectors .selector-result.probe-ok {
  color: var(--ok, #15803d);
}
.wizard-selectors .selector-result.probe-bad {
  color: var(--danger, #b91c1c);
}
.wizard-advanced {
  margin-top: 1rem;
}
.wizard-preset-preview {
  margin: 0.5rem 0;
  padding: 0.6rem;
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
}
.wizard-budget-over {
  color: var(--danger, #b91c1c);
  font-weight: 600;
}
.wizard-review-block {
  margin-bottom: 1.25rem;
}
.ai-findings {
  margin: 0.4rem 0 0 1rem;
  padding: 0;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ai-findings li.probe-bad {
  color: var(--danger, #b91c1c);
}
.ai-findings li.probe-warn {
  color: var(--warn, #b45309);
}
.field-invalid {
  color: var(--danger, #b91c1c);
  font-size: 0.8rem;
  margin: 0.25rem 0 0;
}
.draft-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.draft-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.btn-primary {
  background: var(--brand);
  color: #fff;
}
.btn-primary:hover {
  background: var(--brand-hover);
}
.btn-outline {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-outline:hover {
  background: var(--bg-tertiary);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
}
.btn-danger {
  background: var(--bad);
  color: #fff;
}
.btn-danger:hover {
  background: var(--bad-hover);
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.metric-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
.metric-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  background: var(--brand);
}
.metric-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.metric-value {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

dl.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}
dl.meta > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
dl.meta dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0;
}
dl.meta dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  word-break: break-word;
}
dl.meta code {
  font-size: 0.82rem;
}

table.data {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 1100px;
  margin: 1rem 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
table.data th,
table.data td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: middle;
}
table.data th {
  background: var(--bg-tertiary);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}
table.data tbody tr:last-child td,
table.data tr:last-child td {
  border-bottom: none;
}
table.data tbody tr:hover td {
  background: var(--bg-primary);
}
.col-status,
.col-actions,
.col-language,
.col-select {
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}
.col-url {
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 28rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.badge-great {
  background: var(--green-soft);
  color: var(--great);
}
.badge-fair {
  background: var(--amber-soft);
  color: var(--fair);
}
.badge-bad {
  background: var(--red-soft);
  color: var(--bad);
}
.badge-neutral {
  background: var(--neutral-soft);
  color: var(--text-secondary);
}

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  margin: 0 0 1rem;
}
.alert:empty {
  display: none;
}
.alert-danger {
  background: var(--red-soft);
  color: var(--bad);
}
.alert-info {
  background: var(--neutral-soft);
  color: var(--text-secondary);
}
.alert-warning {
  background: var(--amber-soft);
  color: var(--fair);
}

.run-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}
.run-kicker code {
  font-size: 0.78rem;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.run-detail-head h1 {
  overflow-wrap: anywhere;
}
.run-diagnosis {
  margin: 0 0 1.25rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--bad);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.run-diagnosis[data-tone="fair"] {
  border-left-color: var(--fair);
}
.run-diagnosis h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 0.35rem;
}
.run-diagnosis p {
  margin: 0 0 0.85rem;
  color: var(--text-primary);
  line-height: 1.45;
}
.run-diagnosis-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}
.run-diagnosis-actions .btn {
  min-height: 44px;
}
.run-diagnosis-fixes {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
}
.run-diagnosis-fixes li {
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}
.run-diagnosis-raw {
  margin: 0;
  padding: 0.7rem 0.85rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.counts-note {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
}
.run-autofix-disclaimer {
  margin: 0 0 0.85rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.run-autofix-notes {
  margin: 0;
  padding-left: 1.2rem;
}
.run-autofix-notes li {
  margin: 0 0 0.4rem;
  overflow-wrap: anywhere;
}

.listing-spec-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1rem 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.listing-spec-table th,
.listing-spec-table td {
  text-align: left;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  vertical-align: top;
}
.listing-spec-table tr:last-child th,
.listing-spec-table tr:last-child td {
  border-bottom: none;
}
.listing-spec-table th {
  width: 38%;
  max-width: 14rem;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  white-space: nowrap;
}
.listing-spec-table td {
  color: var(--text-primary);
  overflow-wrap: anywhere;
  word-break: break-word;
}
.listing-spec-table code {
  font-size: 0.82rem;
}
.visibility-badge {
  white-space: normal;
}
.visibility-reasons {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.listing-gallery {
  margin: 1rem 0 1.5rem;
}
.listing-gallery-stage {
  position: relative;
  background: #12161c;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 16 / 10;
}
.listing-gallery-stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #12161c;
}
.listing-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(18, 22, 28, 0.72);
  color: #fff;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}
.listing-gallery-nav:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.listing-gallery-nav[data-gallery-prev] {
  left: 0.6rem;
}
.listing-gallery-nav[data-gallery-next] {
  right: 0.6rem;
}
.listing-gallery-counter {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  background: rgba(18, 22, 28, 0.72);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.listing-gallery-thumbs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  margin-top: 0.65rem;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
}
.listing-gallery-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 56px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-tertiary);
  cursor: pointer;
}
.listing-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.listing-gallery-thumb.is-current {
  border-color: var(--brand);
}
@media (prefers-reduced-motion: reduce) {
  .listing-gallery-stage img {
    transition: none;
  }
}

form.inline {
  display: inline;
  margin: 0;
}

.run-overrides {
  display: inline-block;
  margin-left: 0.35rem;
  vertical-align: middle;
}
.run-overrides summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  text-decoration: underline;
}
.run-overrides input {
  margin-top: 0.35rem;
  width: 16rem;
  max-width: 60vw;
  padding: 0.4rem 0.55rem;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.breakdown-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1rem;
}
.breakdown-badges .badge {
  font-size: 0.85rem;
  padding: 0.35rem 0.7rem;
}

.form-grid {
  display: grid;
  gap: 0.9rem;
}
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}
.form-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.form-input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
}

.toolbar {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border-color);
}

.login-shell {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}
.login-card {
  width: 100%;
  max-width: 380px;
}

/* Guide page */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.steps li {
  position: relative;
  padding: 0 0 1.25rem 3rem;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--brand);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.9rem;
}
.steps li::after {
  content: "";
  position: absolute;
  left: 0.95rem;
  top: 2rem;
  bottom: 0;
  width: 2px;
  background: var(--border-color);
}
.steps li:last-child::after {
  display: none;
}
.steps strong {
  font-family: var(--font-heading);
}
.diagram {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1rem 0;
  overflow-x: auto;
}
.diagram svg {
  max-width: 100%;
  height: auto;
}
.explain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.explain .card h3 {
  margin-top: 0;
}

/* Interactive Pipeline Diagram & Simulator Styles */
.guide-controls-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.guide-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.guide-filter-btn {
  appearance: none;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.guide-filter-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}
.guide-filter-btn.is-active {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}
.guide-filter-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.pipeline-canvas {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1rem 0;
  overflow-x: auto;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.02);
}
.pipeline-canvas svg {
  min-width: 900px;
  width: 100%;
  height: auto;
  display: block;
}
.pipeline-node {
  cursor: pointer;
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
  outline: none;
}
.pipeline-node:hover rect {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
  stroke-width: 2px;
}
.pipeline-node:focus-visible rect {
  stroke: var(--brand);
  stroke-width: 2.5px;
}
.pipeline-node.is-active rect.p-box,
.pipeline-node.is-active rect.p-box-brand,
.pipeline-node.is-active rect.p-box-accent {
  stroke: var(--brand) !important;
  stroke-width: 2.5px !important;
  fill: var(--brand-soft) !important;
  filter: drop-shadow(0 0 10px rgba(229, 69, 30, 0.25));
}
.pipeline-node.is-active .stage-title {
  fill: var(--brand) !important;
  font-weight: 700;
}
.pipeline-node.is-dimmed {
  opacity: 0.35;
}

.flow-pulse {
  stroke-dasharray: 6 6;
  animation: flowPulse 1.2s linear infinite;
}
@keyframes flowPulse {
  from {
    stroke-dashoffset: 24;
  }
  to {
    stroke-dashoffset: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow-pulse {
    animation: none;
    stroke-dasharray: none;
  }
  .pipeline-node {
    transition: none;
  }
}

.simulator-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.simulator-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.simulator-progress {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.simulator-track {
  width: 140px;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.simulator-bar {
  height: 100%;
  width: 14.28%;
  background: var(--brand);
  transition: width 0.25s ease;
}

.inspector-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin: 1rem 0;
}
.inspector-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.inspector-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--brand-soft);
  color: var(--brand);
}
.inspector-pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.inspector-pill {
  font-size: 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  color: var(--text-primary);
}
.inspector-pill.guardrail {
  border-color: rgba(229, 69, 30, 0.25);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.inspector-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  margin: 1rem 0 0.75rem;
}
.inspector-tab-btn {
  appearance: none;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}
.inspector-tab-btn:hover {
  color: var(--text-primary);
}
.inspector-tab-btn.is-active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.inspector-tab-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.inspector-code-block {
  background: #0f141c;
  color: #f1f5f9;
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  line-height: 1.5;
  position: relative;
  margin: 0.5rem 0;
}
.inspector-code-block pre,
.inspector-code-block code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: inherit;
}
.inspector-code-block pre {
  margin: 0;
  white-space: pre;
}
.copy-snippet-btn {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
  font-size: 0.7rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.copy-snippet-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.deep-dive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.deep-dive-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.deep-dive-card h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.deep-dive-card p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-muted);
}

/* Table scrolling primitive — compact columns stay on one line; overflow scrolls inside the card. */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  min-height: 380px;
}
.table-scroll table {
  margin: 0;
  border: 0;
}
.table-scroll table.data {
  border-radius: 0;
  border: 0;
  overflow: visible;
}
#vendors-table {
  min-height: 380px;
}

/* Vendor row 3-dots action dropdown */
.vendor-actions {
  position: relative;
  text-align: right;
}
.action-menu {
  position: relative;
  display: inline-block;
  text-align: left;
}
.action-menu summary.action-menu-trigger {
  list-style: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s;
}
.action-menu summary::-webkit-details-marker {
  display: none;
}
.action-menu summary.action-menu-trigger:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.action-menu[open] summary.action-menu-trigger {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
}
.action-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 100;
  width: 210px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.4rem 0;
  text-align: left;
}
.action-menu.dropup .action-menu-dropdown {
  top: auto;
  bottom: calc(100% + 4px);
}
.action-menu-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  text-decoration: none;
  transition:
    background 0.12s ease,
    color 0.12s ease;
}
.action-menu-item:hover,
.action-menu-item:focus-visible {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.action-menu-item:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}
.action-menu-item.action-danger {
  color: var(--bad);
}
.action-menu-item.action-danger:hover,
.action-menu-item.action-danger:focus-visible {
  background: var(--red-soft);
  color: var(--bad);
}
.action-menu-form {
  margin: 0;
}
.action-menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.35rem 0;
}
.run-overrides-menu {
  padding: 0.2rem 0.85rem 0.45rem;
}
.run-overrides-summary {
  font-size: 0.75rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  margin-bottom: 0.25rem;
}
.run-overrides-box {
  margin-top: 0.3rem;
}
.run-overrides-box input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.vendor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 1rem 0 0.5rem;
}
.vendor-toolbar-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
dialog {
  width: min(620px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(18, 22, 28, 0.25);
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: rgba(18, 22, 28, 0.55);
}
.dialog-body {
  padding: 1.4rem;
  overflow: auto;
  max-height: calc(100vh - 2rem);
}
.dialog-head {
  margin-bottom: 1rem;
}
.dialog-head p {
  margin: 0;
  color: var(--text-secondary);
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}
.combobox-wrap {
  position: relative;
}
.search-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.search-row .form-input {
  flex: 1;
  min-width: 0;
}
.suggestions {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.35rem;
}
.suggestion {
  width: 100%;
  text-align: left;
  padding: 0.65rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  cursor: pointer;
}
.suggestion[aria-selected="true"],
.suggestion:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.suggestion span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
}
.field-help {
  margin: 0.3rem 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.check-field {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  min-height: 44px;
}
.check-field input {
  width: 20px;
  height: 20px;
}
.batch-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: start;
  padding: 0.55rem 0;
}
.batch-row > input {
  width: 20px;
  height: 20px;
  margin-top: 0.65rem;
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    flex-wrap: nowrap;
  }
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }
  .nav-mobile-shell {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.35rem 0 0.5rem;
    border-top: 1px solid var(--border-color);
  }
  .header-inner.nav-open {
    flex-wrap: wrap;
  }
  .header-inner.nav-open .nav-mobile-shell {
    display: flex;
  }
  .nav {
    width: 100%;
    margin-left: 0;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0.25rem;
  }
  .nav-link {
    padding: 0.7rem 0.85rem;
    font-size: 0.9rem;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .nav .inline {
    width: 100%;
  }
  .nav .inline .btn {
    width: 100%;
    min-height: 44px;
  }
  .container {
    padding: 1.25rem 1rem 3rem;
  }
  .table-scroll {
    border: 0;
  }
  table.data {
    font-size: 0.82rem;
  }
  table.data th,
  table.data td {
    padding: 0.55rem 0.6rem;
  }
  .card {
    padding: 1.1rem;
  }
  .login-shell {
    min-height: 60vh;
  }
  .metrics {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 0.65rem;
  }
  .metric-card {
    padding: 0.75rem 0.85rem;
  }
  .metric-value {
    font-size: 1.3rem;
  }
  .field label {
    font-size: 0.78rem;
  }
  .form-input {
    min-height: 44px;
    padding: 0.6rem 0.8rem;
  }
  .btn {
    min-height: 44px;
  }
  .listing-spec-table th {
    white-space: normal;
  }
  .listing-gallery-stage {
    aspect-ratio: 4 / 3;
  }
}
.nav-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  flex: 0 0 auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
}
.nav-icon-btn:hover {
  background: var(--bg-tertiary);
}
.operator-tour-popover.driver-popover,
.driver-popover.operator-tour-popover {
  max-width: min(360px, calc(100vw - 24px));
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 12px 32px rgba(18, 22, 28, 0.18);
}
.driver-popover.operator-tour-popover .driver-popover-title {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 1.05rem;
}
.driver-popover.operator-tour-popover .driver-popover-description {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.45;
}
.driver-popover.operator-tour-popover .driver-popover-next-btn,
.driver-popover.operator-tour-popover .driver-popover-done-btn {
  background: var(--brand);
  color: #fff;
  border: 0;
  text-shadow: none;
}
.driver-popover.operator-tour-popover .driver-popover-prev-btn {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  text-shadow: none;
}
.driver-popover.operator-tour-popover .driver-popover-close-btn {
  color: var(--text-secondary);
}

@media (max-width: 860px) {
  .vendor-toolbar,
  .vendor-toolbar-actions {
    align-items: stretch;
  }
  .vendor-toolbar-actions {
    width: 100%;
  }
  .vendor-toolbar-actions .btn {
    flex: 1 1 100%;
    justify-content: center;
    min-height: 44px;
  }
  .action-menu summary.action-menu-trigger {
    width: 44px;
    height: 44px;
  }
  .action-menu-item {
    padding: 0.65rem 0.85rem;
    font-size: 0.9rem;
  }
  .vendor-select,
  #select-all-vendors {
    width: 44px;
    height: 44px;
    margin: 0;
  }
  .dialog-actions {
    position: sticky;
    bottom: -1.4rem;
    background: var(--bg-secondary);
    padding: 0.8rem 0 1.4rem;
  }
  .dialog-actions .btn {
    min-height: 44px;
    flex: 1 1 auto;
    justify-content: center;
  }
  .run-diagnosis-actions .btn {
    min-height: 44px;
  }
  .listing-gallery-nav {
    min-width: 44px;
    min-height: 44px;
  }
  .nav-icon-btn {
    min-width: 44px;
    width: 44px;
    height: 44px;
    min-height: 44px;
  }
  .tab-btn {
    min-height: 44px;
  }
  .driver-popover.operator-tour-popover .driver-popover-next-btn,
  .driver-popover.operator-tour-popover .driver-popover-prev-btn,
  .driver-popover.operator-tour-popover .driver-popover-done-btn,
  .driver-popover.operator-tour-popover .driver-popover-close-btn {
    min-height: 44px;
    min-width: 44px;
  }
}
@media (max-width: 380px) {
  .header-inner {
    padding: 0.65rem 0.85rem;
  }
  .logo {
    font-size: 1.05rem;
  }
  .nav {
    gap: 0.15rem;
  }
  .nav-link {
    padding: 0.45rem 0.45rem;
    font-size: 0.76rem;
  }
  .card {
    padding: 0.9rem;
  }
  dl.meta {
    grid-template-columns: 1fr;
  }
}

/* Pagination controls ---------------------------------------------------- */
.pagination {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  margin: 1.5rem 0 0.5rem;
  flex-wrap: wrap;
}
.pagination-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-right: 0.5rem;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.pagination a:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.pagination .current {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}
.pagination-ellipsis {
  border: 0 !important;
  background: transparent !important;
  color: var(--text-muted) !important;
}
.pagination-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.pagination-size select {
  padding: 0.25rem 0.35rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: var(--bg-secondary);
}

/* Sortable column headers ------------------------------------------------ */
.sort-header {
  white-space: nowrap;
}
.sort-header a {
  color: var(--text-secondary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.sort-header a:hover {
  color: var(--brand);
}
.sort-header .sort-dir {
  font-size: 0.7rem;
  opacity: 0.5;
}
.sort-header a[aria-current] {
  color: var(--brand);
}
.sort-header a[aria-current] .sort-dir {
  opacity: 1;
}

/* Filter bar -------------------------------------------------------------- */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  margin: 0 0 0.75rem;
}
.filter-bar .filter-input,
.filter-bar .filter-select {
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  min-width: 0;
}
.filter-bar .filter-input {
  flex: 1 1 160px;
  max-width: 280px;
}
.filter-bar .filter-select {
  flex: 0 0 auto;
}
@media (max-width: 768px) {
  .filter-bar .filter-input {
    max-width: none;
    flex: 1 1 100%;
  }
  .pagination {
    gap: 0.2rem;
  }
  .pagination a,
  .pagination span {
    min-width: 1.6rem;
    height: 1.6rem;
    font-size: 0.78rem;
  }
}

/* Run Detail Tabs & Execution Terminal ----------------------------------- */
.tab-nav {
  display: flex;
  gap: 0.5rem;
  border-bottom: 2px solid var(--border-color);
  margin: 1.5rem 0 1.25rem;
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  border: none;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.tab-btn:hover {
  color: var(--text-primary);
}
.tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.tab-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.tab-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--neutral-soft);
  color: var(--text-secondary);
}
.tab-btn.active .tab-badge {
  background: var(--brand-soft);
  color: var(--brand);
}

.progress-bar {
  background: var(--bg-tertiary, #eee);
  border-radius: 999px;
  height: 0.5rem;
  overflow: hidden;
  max-width: 22rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent, #2563eb);
}
.coverage-legend {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.coverage-legend li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 0.45rem 0.85rem;
  align-items: start;
}
.coverage-legend li.legend-note {
  grid-template-columns: 1fr;
}
.coverage-legend .legend-token {
  min-width: 0;
}
.coverage-legend .legend-token .progress-bar {
  width: 6.5rem;
  max-width: 6.5rem;
}
.coverage-legend p {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.coverage-legend strong {
  font-size: 0.88rem;
}
.guide-coverage {
  margin: 1.25rem 0;
  scroll-margin-top: 4.5rem;
}
.guide-coverage ul {
  margin: 0.6rem 0 0;
  padding-left: 1.15rem;
}
.guide-coverage li {
  margin: 0.35rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-secondary);
}
@media (max-width: 560px) {
  .coverage-legend li {
    grid-template-columns: 1fr;
  }
}

.stages-pipeline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 1rem 0 1.5rem;
}
@media (max-width: 960px) {
  .stages-pipeline {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .stages-pipeline {
    grid-template-columns: 1fr;
  }
}
.stage-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  position: relative;
  overflow: visible;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    transform 0.12s,
    border-color 0.12s,
    box-shadow 0.12s;
}
.stage-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.stage-card.status-completed {
  border-left: 4px solid var(--great);
}
.stage-card.status-running {
  border-left: 4px solid var(--brand);
}
.stage-card.status-failed {
  border-left: 4px solid var(--bad);
}
.stage-card.status-skipped {
  border-left: 4px solid var(--text-muted);
  opacity: 0.75;
}
.stage-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  position: relative;
}
.stage-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.stage-index {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--neutral-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  flex-shrink: 0;
}
.stage-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stage-status-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  position: relative;
  flex-shrink: 0;
}
.stage-status-tag {
  font-size: 0.65rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.stage-card.status-completed .stage-status-tag {
  background: var(--green-soft);
  color: var(--great);
}
.stage-card.status-running .stage-status-tag {
  background: var(--brand-soft);
  color: var(--brand);
}
.stage-card.status-failed .stage-status-tag {
  background: var(--red-soft);
  color: var(--bad);
}
.stage-card.status-skipped .stage-status-tag {
  background: var(--neutral-soft);
  color: var(--text-muted);
}
.stage-reason-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.stage-reason-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.stage-reason-btn:hover,
.stage-reason-btn:focus-visible {
  color: var(--text-primary);
  border-color: var(--brand);
  background: var(--neutral-soft);
  outline: none;
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.stage-card.status-failed .stage-reason-btn {
  border-color: var(--bad);
  color: var(--bad);
  background: var(--red-soft);
}
.stage-card.status-failed .stage-reason-btn:hover,
.stage-card.status-failed .stage-reason-btn:focus-visible {
  background: var(--bad);
  color: #fff;
  box-shadow: 0 0 0 2px var(--red-soft);
}
.stage-reason-popover {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 260px;
  max-width: calc(100vw - 2rem);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  padding: 0.7rem 0.85rem;
  z-index: 60;
  font-size: 0.78rem;
  color: var(--text-primary);
  line-height: 1.45;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  font-weight: normal;
  cursor: default;
}
.stage-reason-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border-color);
}
.stage-reason-popover-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.stage-reason-popover-body {
  font-size: 0.78rem;
  color: var(--text-primary);
  word-break: break-word;
}
@media (max-width: 860px) {
  .stage-reason-btn {
    width: 44px;
    height: 44px;
  }
}
.stage-metrics {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.stage-duration {
  font-family: ui-monospace, monospace;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.82rem;
}
.stage-events-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
}

.terminal-container {
  background: #12161c;
  border-radius: var(--radius-lg);
  border: 1px solid #232a35;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 1.25rem 0;
  color: #e6e9ee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.terminal-header {
  background: #181f29;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #283240;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  justify-content: space-between;
}
.terminal-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.terminal-title {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a0aec0;
}
.terminal-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1a8f4c;
  display: inline-block;
  box-shadow: 0 0 8px #1a8f4c;
  animation: live-pulse 1.5s infinite;
}
@keyframes live-pulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
  100% {
    opacity: 1;
  }
}
.terminal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.terminal-select,
.terminal-search {
  background: #0c1015;
  border: 1px solid #2c3848;
  color: #e6e9ee;
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
}
.terminal-select:focus,
.terminal-search:focus {
  outline: none;
  border-color: var(--brand);
}
.terminal-search {
  width: 180px;
}
.terminal-btn {
  background: #232d3d;
  border: 1px solid #364459;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}
.terminal-btn:hover {
  background: #2f3c50;
  color: #fff;
}
.terminal-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.terminal-toggle-label {
  font-size: 0.78rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
}
.terminal-toggle-label input {
  accent-color: var(--brand);
}
.terminal-body {
  height: 480px;
  max-height: 65vh;
  overflow-y: auto;
  overflow-x: auto;
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  line-height: 1.6;
  background: #0d1117;
}
.terminal-body::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.terminal-body::-webkit-scrollbar-track {
  background: #12161c;
}
.terminal-body::-webkit-scrollbar-thumb {
  background: #283344;
  border-radius: 4px;
}
.log-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.log-line:hover {
  background: rgba(255, 255, 255, 0.04);
}
.log-ts {
  color: #64748b;
  font-size: 0.78rem;
  min-width: 80px;
  flex-shrink: 0;
}
.log-lvl {
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0 0.3rem;
  border-radius: 3px;
  min-width: 48px;
  text-align: center;
  flex-shrink: 0;
}
.log-lvl.lvl-info {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
}
.log-lvl.lvl-warn {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
}
.log-lvl.lvl-err {
  background: rgba(248, 113, 113, 0.22);
  color: #f87171;
  font-weight: 800;
}
.log-lvl.lvl-debug {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
}
.log-stage {
  color: #818cf8;
  font-weight: 600;
  font-size: 0.78rem;
  flex-shrink: 0;
  min-width: 90px;
}
.log-msg {
  color: #e2e8f0;
  flex: 1 1 12rem;
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.log-msg mark {
  background: rgba(229, 69, 30, 0.35);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}
.log-meta {
  flex-basis: 100%;
  margin-top: 0.2rem;
  width: 100%;
}
.meta-toggle {
  color: #60a5fa;
  cursor: pointer;
  font-size: 0.75rem;
  user-select: none;
}
.meta-json {
  background: #161e29;
  border: 1px solid #283547;
  border-radius: 4px;
  padding: 0.5rem;
  margin: 0.3rem 0;
  color: #a5b4fc;
  font-size: 0.75rem;
  overflow-x: auto;
}
.btn-jump-record {
  background: #243042;
  border: 1px solid #3b4c66;
  color: #93c5fd;
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 0.5rem;
}
.btn-jump-record:hover {
  background: #3b82f6;
  color: #fff;
}
.terminal-empty {
  padding: 3rem;
  text-align: center;
  color: #64748b;
  font-style: italic;
}
.highlight-row {
  animation: highlight-flash 3s;
}
@keyframes highlight-flash {
  0% {
    background: #fdeee9;
  }
  70% {
    background: #fdeee9;
  }
  100% {
    background: transparent;
  }
}
