.hero-tabs #tab-circuit { font-weight: 750; }
.compare-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.compare-dialog { width: min(1060px, calc(100% - 32px)); }

.network-stage, .sample-network {
  background-color: var(--surface-muted);
  background-image: radial-gradient(circle, #C8D3E1 1px, transparent 1px);
  background-size: 18px 18px;
}
.network-stage { height: 100%; min-height: 450px; position: relative; isolation: isolate; border-left: 1px solid var(--line); }
.network-stage::before { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(ellipse at center, transparent 32%, var(--surface-muted) 90%); pointer-events: none; }
.network-graph { position: absolute; inset: 51px 13px 59px; }
.network-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; pointer-events: none; }
.network-caption { position: absolute; left: 20px; top: 18px; display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 12px; letter-spacing: .045em; font-weight: 700; pointer-events: none; }
.network-caption span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-orange); box-shadow: 0 0 0 3px var(--brand-orange-tint); }
.network-node {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  touch-action: manipulation;
}
.network-node i { display: grid; place-items: center; width: 29px; height: 29px; border: 1.5px solid #9CAEC2; border-radius: 50%; background: var(--paper); box-shadow: 0 2px 5px #18212B14; }
.network-node i::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand-red); }
.network-node--hub i { width: 40px; height: 40px; border: 1.5px solid var(--brand-red); background: var(--paper); box-shadow: 0 0 0 5px #BF1E2D1F; }
.network-node--hub i::before { width: 14px; height: 14px; background: var(--brand-red); box-shadow: 0 0 0 4px var(--brand-red-tint); }
.network-node span { position: absolute; top: calc(50% + 19px); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--paper); border: 1px solid var(--line); border-radius: 5px; padding: 3px 6px; color: inherit; font-size: 11px; line-height: 1.2; font-weight: 650; }
.network-node--hub span { top: calc(50% + 27px); }
.network-node[data-related] i { border-color: var(--brand-orange); }
.network-node[data-related] i::before { background: var(--brand-orange); }
.network-node[data-active] { z-index: 1; color: var(--brand-red-hover); }
.network-node[data-active] i { border-color: var(--brand-red); background: var(--brand-red-tint); box-shadow: 0 0 0 5px #BF1E2D24; }
.network-node[data-active] span { border-color: #BF1E2D62; background: var(--brand-red-tint); }
.network-node:focus-visible { outline-offset: -1px; }
.network-controls { position: absolute; inset: auto 16px 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 9px; color: var(--muted); }
.network-controls p { font-size: 12px; }
.network-controls > div { display: flex; gap: 6px; }
.network-controls button { min-height: 38px; border: 1px solid var(--line); border-radius: 7px; padding-inline: 9px; background: var(--paper); color: var(--ink); font-size: 12px; font-weight: 650; }
.network-controls button:hover, .network-controls button[data-paused] { border-color: var(--brand-red); color: var(--brand-red-hover); background: var(--brand-red-tint); }

.circuit-stage, .sample-circuit {
  background-color: var(--surface-muted);
  background-image:
    linear-gradient(#CBD5E16E 1px, transparent 1px),
    linear-gradient(90deg, #CBD5E16E 1px, transparent 1px);
  background-size: 18px 18px;
}
.circuit-stage::before { background: radial-gradient(ellipse at center, #FFFFFFB3, transparent 76%); }
.circuit-graph { inset: 46px 12px 78px; }
.circuit-chip {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  place-items: center;
  width: clamp(72px, 9vw, 106px);
  height: 57px;
  transform: translate(-50%, -50%);
  border: 1px solid #D79599;
  border-radius: 9px;
  background: var(--paper);
  box-shadow: 0 0 0 5px #BF1E2D14, 0 4px 13px #18212B14;
  color: var(--brand-red);
  font-size: clamp(11px, 1.3vw, 14px);
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.circuit-node {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  height: auto;
  min-height: 48px;
  padding: 0 11px;
  border: 1px solid #BCCADA;
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 2px 8px #18212B0F;
  font-size: 12px;
  font-weight: 650;
}
.circuit-node::before {
  content: "";
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 2px;
  background: var(--brand-red);
}
.circuit-node:nth-of-type(even)::before { background: var(--brand-orange); }
.circuit-node[data-active], .circuit-node[aria-pressed="true"] {
  border-color: var(--brand-red);
  background: var(--brand-red-tint);
  color: var(--brand-red-hover);
  box-shadow: 0 0 0 3px #BF1E2D14;
}
.circuit-node:focus-visible { outline-offset: 3px; }
.circuit-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 48px; }
.circuit-controls > .circuit-description { display: block; }
.circuit-controls p { line-height: 1.35; }
.circuit-controls .circuit-detail { color: var(--ink); }
.circuit-controls .network-pause { min-height: 44px; min-width: 52px; justify-self: end; }

.sample-circuit { position: absolute; inset: 5% 3% 5% 50%; border-radius: 2px; background-size: 7px 7px; }
.sample-circuit i { position: absolute; top: 26%; left: 12%; width: 19%; height: 14%; background: var(--paper); border: 1px solid #ABBACD; border-radius: 2px; }
.sample-circuit i:nth-child(even) { left: auto; right: 12%; }
.sample-circuit i:nth-child(n+3) { top: auto; bottom: 26%; }
.sample-circuit b { position: absolute; width: 27%; height: 17%; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--brand-red-tint); border: 1px solid var(--brand-red); border-radius: 2px; }
.sample-circuit::before { content: ""; position: absolute; inset: 35% 21%; border: 1px solid #A5B4C5; border-inline-color: var(--brand-red); }
.sample-circuit::after { content: ""; position: absolute; top: 50%; inset-inline: 21%; border-top: 1px solid var(--brand-red); }

.sample-network { position: absolute; top: 5%; right: 3%; width: 47%; height: 90%; border-radius: 2px; background-size: 8px 8px; }
.sample-network::before, .sample-network::after { content: ""; position: absolute; width: 72%; top: 50%; left: 50%; height: 1px; background: #95A8BF; transform: translate(-50%, -50%) rotate(34deg); }
.sample-network::after { transform: translate(-50%, -50%) rotate(-34deg); }
.sample-network i { position: absolute; z-index: 1; width: 7%; aspect-ratio: 1; border-radius: 50%; background: var(--brand-red); transform: translate(-50%, -50%); }
.sample-network i:nth-child(1) { top: 27%; left: 22%; }
.sample-network i:nth-child(2) { top: 27%; left: 78%; background: var(--brand-orange); }
.sample-network i:nth-child(3) { top: 50%; left: 50%; width: 11%; box-shadow: 0 0 0 2px var(--paper); }
.sample-network i:nth-child(4) { top: 73%; left: 22%; background: var(--brand-orange); }
.sample-network i:nth-child(5) { top: 73%; left: 78%; }

@property --motion-edge {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
.service-explorer { position: relative; }
.service-explorer::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  pointer-events: none;
  opacity: 0;
  background: conic-gradient(from var(--motion-edge), transparent 0deg 19deg, var(--brand-orange) 46deg, var(--brand-red) 69deg, transparent 106deg 360deg);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}
.service-explorer.edge-sweep::after { animation: sweep-edge 1.15s ease-out both; }
@keyframes sweep-edge {
  0% { --motion-edge: 0deg; opacity: 0; }
  17%, 65% { opacity: .82; }
  100% { --motion-edge: 360deg; opacity: 0; }
}

@media (max-width: 960px) {
  .network-stage { min-height: 400px; }
  .compare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
  .network-stage { min-height: 0; height: clamp(300px, 85vw, 357px); border-left: 0; border-top: 1px solid var(--line); }
  .network-graph { inset: 42px 6px 63px; }
  .compare-grid { grid-template-columns: 1fr; }
  .hero-tabs .layout-icon { display: none; }
  .hero-tabs button { padding-inline: 6px; }
  .network-controls { inset: auto 10px 10px; }
  .network-controls p { font-size: 11px; }
  .network-caption { left: 13px; top: 13px; }
  .hero--network .hero-actions .button, .hero--circuit .hero-actions .button { padding-inline: 11px; font-size: 12px; }
  .circuit-graph { inset: 40px 9px 69px; }
}
@media (max-width: 480px) {
  .review-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding-block: 5px; }
  .hero-tabs { grid-column: 1 / -1; grid-row: 1; }
  .hero-tabs button { padding-inline: 4px; min-height: 38px; }
  .compare-launch { grid-column: 1; grid-row: 2; justify-self: start; min-height: 36px; }
  .review-tools > .review-hide { grid-column: 2; grid-row: 2; }
}
@media (max-width: 380px) {
  .hero-tabs { gap: 1px; padding: 2px; }
  .hero-tabs button { padding-inline: 2px; font-size: 11px; }
  .hero--network h1, .hero--circuit h1 { font-size: clamp(34px, 10vw, 42px); }
  .network-controls { gap: 5px; }
  .network-controls:not(.circuit-controls) button { min-height: 35px; }
  .circuit-node { gap: 5px; padding-inline: 8px; font-size: 11px; }
  .circuit-node:nth-of-type(-n+2) { top: 20%; }
  .circuit-node:nth-of-type(n+3) { top: 80%; }
}
@media (prefers-reduced-motion: reduce) {
  .service-explorer.edge-sweep::after { animation: none; }
}
