.bd-article {
  --nx-primary: #2563eb;
  --nx-accent: #0f766e;
  --nx-warn: #e11d48;
  --nx-surface: #ffffff;
  --nx-surface-strong: #f6faff;
  --nx-border: #d8e4f2;
  --nx-border-strong: #9fb8e7;
  --nx-text: var(--pst-color-text-base, var(--ld-ink));
  --nx-muted: var(--pst-color-text-muted, var(--ld-muted));
  --nx-shadow: 0 12px 30px rgba(28, 45, 74, 0.07);
  --nx-shadow-float: 0 22px 54px rgba(28, 45, 74, 0.11);
}

html[data-bs-theme="dark"] .bd-article,
html[data-theme="dark"] .bd-article {
  --nx-primary: #7db7ff;
  --nx-accent: #5eead4;
  --nx-warn: #fb7185;
  --nx-surface: #11151c;
  --nx-surface-strong: #171d26;
  --nx-border: #2a3442;
  --nx-border-strong: #49627d;
  --nx-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
  --nx-shadow-float: 0 24px 58px rgba(0, 0, 0, 0.44);
}

.nexus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0 1.6rem;
}

.nexus-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.35rem;
  padding: 0.42rem 0.82rem;
  border: 1px solid var(--nx-border-strong);
  border-radius: 999px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--nx-primary) 14%, transparent), transparent 58%),
    var(--nx-surface);
  color: var(--nx-text);
  box-shadow: var(--nx-shadow);
  font-size: 0.9rem;
  font-weight: 750;
  letter-spacing: 0;
}

.nexus-tag strong {
  color: var(--nx-primary);
  font-weight: 850;
}

.nexus-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.8rem;
}

.nexus-metric {
  position: relative;
  overflow: hidden;
  min-height: 9.4rem;
  padding: 1rem 1rem 1.05rem;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--nx-primary) 8%, transparent), transparent 62%),
    var(--nx-surface);
  box-shadow: var(--nx-shadow-float);
}

.nexus-metric::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--nx-primary), var(--nx-accent));
  opacity: 0.86;
}

.nexus-metric__kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  min-height: 1.65rem;
  padding: 0.18rem 0.55rem;
  border: 1px solid color-mix(in srgb, var(--nx-primary) 32%, var(--nx-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--nx-primary) 9%, var(--pst-color-background, transparent));
  color: var(--nx-primary);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
  white-space: nowrap;
}

.nexus-metric__value {
  margin: 0.7rem 0 0.35rem;
  color: var(--nx-text);
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  font-weight: 900;
  line-height: 1.05;
}

.nexus-metric__label {
  margin: 0;
  color: var(--nx-text);
  font-size: 0.92rem;
  line-height: 1.55;
}

html[data-bs-theme="dark"] .nexus-metric__kicker,
html[data-theme="dark"] .nexus-metric__kicker {
  background: color-mix(in srgb, var(--nx-primary) 18%, transparent);
}

.nexus-pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.8rem;
}

.nexus-stage {
  min-height: 7.5rem;
  padding: 0.95rem;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow);
}

.nexus-stage span {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  margin-bottom: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--nx-primary), color-mix(in srgb, var(--nx-accent) 70%, var(--nx-primary)));
  color: var(--pst-color-on-background, #fff);
  font-size: 0.82rem;
  font-weight: 900;
}

.nexus-stage h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.nexus-stage p {
  margin: 0;
  color: var(--nx-text);
  color: var(--nx-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.nexus-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.9rem;
}

.nexus-shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow-float);
}

.nexus-shot img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: color-mix(in srgb, var(--nx-text) 8%, transparent);
}

.nexus-shot figcaption {
  min-height: 3.2rem;
  padding: 0.72rem 0.85rem;
  color: var(--nx-text);
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.45;
}

.nexus-source-note {
  margin: 0.7rem 0 1.5rem;
  padding: 0.8rem 0.95rem;
  border-left: 4px solid var(--nx-primary);
  border-radius: 0 8px 8px 0;
  background: color-mix(in srgb, var(--nx-primary) 9%, transparent);
  color: var(--nx-muted);
  font-size: 0.92rem;
}

.nexus-whiteboard {
  position: relative;
  margin: 1rem 0 1.9rem;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  overflow: hidden;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  background:
    linear-gradient(var(--nx-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--nx-border) 1px, transparent 1px),
    var(--nx-surface);
  background-size: 28px 28px;
  box-shadow: var(--nx-shadow-float);
}

.nexus-whiteboard::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--nx-primary) 12%, transparent), transparent 36%),
    linear-gradient(315deg, color-mix(in srgb, var(--nx-accent) 10%, transparent), transparent 42%);
}

.nexus-whiteboard__head,
.nexus-board,
.nexus-board-lanes {
  position: relative;
  z-index: 1;
}

.nexus-whiteboard__head {
  max-width: 48rem;
  margin-bottom: 1.1rem;
}

.nexus-whiteboard__eyebrow {
  display: inline-flex;
  margin: 0 0 0.45rem;
  padding: 0.18rem 0.58rem;
  border: 1px solid var(--nx-border-strong);
  border-radius: 999px;
  background: color-mix(in srgb, var(--nx-primary) 10%, var(--pst-color-background, transparent));
  color: var(--nx-primary);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nexus-whiteboard__head h2 {
  margin: 0 0 0.5rem;
  color: var(--nx-text);
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  line-height: 1.28;
}

.nexus-whiteboard__head p:not(.nexus-whiteboard__eyebrow) {
  margin: 0;
  color: var(--nx-muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.nexus-board {
  display: grid;
  grid-template-columns: minmax(9.5rem, 1fr) 1.6rem minmax(9.5rem, 1fr) 1.6rem minmax(9.5rem, 1fr) 1.6rem minmax(9.5rem, 1fr) 1.6rem minmax(9.5rem, 1fr);
  align-items: center;
  gap: 0.55rem;
  margin: 1rem 0;
}

.nexus-board-card {
  min-height: 9.2rem;
  padding: 0.95rem;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--pst-color-background, #fff) 76%, var(--nx-surface) 24%);
  box-shadow: var(--nx-shadow);
}

html[data-bs-theme="dark"] .nexus-board-card,
html[data-theme="dark"] .nexus-board-card {
  background: color-mix(in srgb, var(--pst-color-background, #0f172a) 74%, var(--nx-surface) 26%);
}

.nexus-board-card span {
  display: inline-flex;
  margin-bottom: 0.55rem;
  padding: 0.16rem 0.48rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--nx-primary) 12%, transparent);
  color: var(--nx-primary);
  font-size: 0.72rem;
  font-weight: 850;
}

.nexus-board-card h3 {
  margin: 0 0 0.35rem;
  color: var(--nx-text);
  font-size: 1.02rem;
}

.nexus-board-card p {
  margin: 0;
  color: var(--nx-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.nexus-board-card--input {
  border-color: color-mix(in srgb, var(--nx-accent) 42%, var(--nx-border));
}

.nexus-board-card--protocol {
  border-color: color-mix(in srgb, var(--nx-primary) 46%, var(--nx-border));
}

.nexus-board-card--data {
  border-color: color-mix(in srgb, var(--nx-warn) 36%, var(--nx-border));
}

.nexus-board-card--output {
  border-color: color-mix(in srgb, var(--nx-accent) 30%, var(--nx-primary));
}

.nexus-board-arrow {
  position: relative;
  height: 2px;
  background: linear-gradient(90deg, var(--nx-border-strong), var(--nx-primary));
}

.nexus-board-arrow::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  width: 0.55rem;
  height: 0.55rem;
  border-top: 2px solid var(--nx-primary);
  border-right: 2px solid var(--nx-primary);
  transform: translateY(-50%) rotate(45deg);
}

.nexus-board-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 0.75rem;
}

.nexus-board-lanes div {
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--nx-surface) 76%, transparent);
}

.nexus-board-lanes strong {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--nx-text);
}

.nexus-board-lanes p {
  margin: 0;
  color: var(--nx-muted);
  font-size: 0.88rem;
  line-height: 1.58;
}

.nexus-floating {
  margin: 1rem 0 1.7rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--nx-accent) 10%, transparent), transparent 48%),
    var(--nx-surface);
  box-shadow: var(--nx-shadow);
}

.nexus-floating h3 {
  margin: 0 0 0.45rem;
  color: var(--nx-text);
  font-size: 1rem;
}

.nexus-floating p {
  margin: 0;
  color: var(--nx-muted);
  line-height: 1.7;
}

.nexus-spec-grid,
.nexus-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
  margin: 1rem 0 1.7rem;
}

.nexus-spec,
.nexus-menu-card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow);
}

.nexus-spec h3,
.nexus-menu-card h3 {
  margin: 0 0 0.45rem;
  color: var(--nx-primary);
  font-size: 0.98rem;
}

.nexus-spec p,
.nexus-menu-card p {
  margin: 0;
  color: var(--nx-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

html[data-bs-theme="dark"] .nexus-shot img,
html[data-theme="dark"] .nexus-shot img {
  filter: brightness(0.92) contrast(1.05);
}

body:has(.nexus-doc-scope) .bd-article table {
  width: 100%;
  margin: 1rem 0 1.4rem;
  overflow: hidden;
  border: 1px solid var(--nx-border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  background: var(--nx-surface);
  box-shadow: var(--nx-shadow);
}

body:has(.nexus-doc-scope) .bd-article table thead th {
  border-bottom: 1px solid var(--nx-border);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--nx-primary) 12%, transparent), transparent),
    var(--nx-surface-strong);
  color: var(--nx-text);
  font-size: 0.9rem;
  font-weight: 850;
}

body:has(.nexus-doc-scope) .bd-article table th,
body:has(.nexus-doc-scope) .bd-article table td {
  padding: 0.72rem 0.86rem;
  border-right: 1px solid color-mix(in srgb, var(--nx-border) 74%, transparent);
  vertical-align: top;
}

body:has(.nexus-doc-scope) .bd-article table th:last-child,
body:has(.nexus-doc-scope) .bd-article table td:last-child {
  border-right: 0;
}

body:has(.nexus-doc-scope) .bd-article table tbody td {
  border-top: 1px solid color-mix(in srgb, var(--nx-border) 74%, transparent);
}

body:has(.nexus-doc-scope) .bd-article table tbody tr:first-child td {
  border-top: 0;
}

body:has(.nexus-doc-scope) .bd-article table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--nx-primary) 4%, transparent);
}

body:has(.nexus-doc-scope) .bd-article table tbody tr:hover {
  background: color-mix(in srgb, var(--nx-primary) 8%, transparent);
}

body:has(.nexus-doc-scope) .bd-article table p {
  margin: 0;
}

body:has(.nexus-doc-scope) .bd-article table code {
  border: 1px solid color-mix(in srgb, var(--nx-primary) 24%, var(--nx-border));
  border-radius: 6px;
  background: color-mix(in srgb, var(--nx-primary) 7%, transparent);
  color: var(--nx-text);
}

@media (max-width: 980px) {
  .nexus-board {
    grid-template-columns: 1fr;
  }

  .nexus-board-arrow {
    width: 2px;
    height: 1.4rem;
    margin: 0 auto;
    background: linear-gradient(180deg, var(--nx-border-strong), var(--nx-primary));
  }

  .nexus-board-arrow::after {
    right: 50%;
    top: auto;
    bottom: -1px;
    transform: translateX(50%) rotate(135deg);
  }
}

@media (max-width: 520px) {
  .nexus-metric,
  .nexus-stage {
    min-height: auto;
  }

  .nexus-shot img {
    aspect-ratio: 4 / 3;
  }

  body:has(.nexus-doc-scope) .bd-article table {
    display: block;
    overflow-x: auto;
  }
}
