/* Ported from ../stackrecord/random-stack/index.html. Keep sg-* behavior aligned with source. */
    .random-stack-wrap {
      height: clamp(360px, 48vh, 430px);
      left: 50%;
      margin: 0.75rem auto 0;
      max-width: 1120px;
      overflow: hidden;
      position: relative;
      transform: translateX(-50%);
      width: 100vw;
    }
    @media (min-width: 640px) {
      .random-stack-wrap {
        height: clamp(500px, 64vh, 620px);
        width: min(100vw, 1120px);
      }
    }
    #stack-graph {
      display: block;
      width: 100%;
      height: 100%;
      background: transparent;
    }
    .sg-edges,
    .sg-nodes,
    .sg-labels {
      overflow: visible;
    }
    .sg-pp-edge {
      stroke: rgba(34, 211, 238, 0.68);
      stroke-linecap: round;
      stroke-opacity: var(--edge-opacity, 0.68);
      stroke-width: calc(var(--edge-width, 3.8) + 1.6px);
      transition: stroke-opacity 180ms ease, stroke-width 180ms ease;
    }
    .sg-pp-edge-reverse {
      stroke: rgba(20, 184, 166, 0.58);
    }
    .sg-pp-edge.is-active {
      stroke: rgba(34, 211, 238, 0.96);
      stroke-opacity: 1;
      stroke-width: calc(var(--edge-width, 3.8) + 2.6px);
    }
    .sg-pp-edge-reverse.is-active {
      stroke: rgba(20, 184, 166, 0.96);
    }
    .sg-persona-orbit-mount {
      align-items: center;
      display: flex;
      height: 264px;
      justify-content: center;
      overflow: visible;
      pointer-events: none;
      width: 264px;
    }
    .persona-orbit-svg {
      display: block;
      overflow: visible;
      pointer-events: none;
    }
    .sg-orbit-idle-layer {
      transform-box: fill-box;
      transform-origin: center;
    }
    .sg-node-persona {
      pointer-events: none;
    }
    .sg-persona-core {
      fill: #161628;
      stroke: rgba(148, 163, 184, 0.42);
      stroke-width: 2;
    }
    .sg-persona-ring {
      fill: none;
      stroke: rgba(255, 255, 255, 0.18);
      stroke-width: 2.2;
      transform-box: fill-box;
      transform-origin: center;
      transition: stroke 220ms ease, stroke-opacity 220ms ease, stroke-width 220ms ease;
    }
    .sg-persona-ring.is-thinking {
      animation: sg-ticker 1.2s linear infinite, sg-ring-glow 1s ease-in-out infinite;
      stroke: #22c55e;
      stroke-dasharray: 128 278;
      stroke-opacity: 1;
      stroke-width: 5;
    }
    .sg-avatar-image,
    .sg-integration-icon,
    .sg-wake-icon {
      pointer-events: none;
    }
    .sg-orbit-edge {
      stroke: rgba(125, 211, 252, 0.36);
      stroke-linecap: round;
      stroke-width: 1.9;
      pointer-events: none;
    }
    .sg-orbit-edge.is-active {
      animation: sg-orbit-edge-pulse 1125ms ease-in-out;
      stroke: rgba(250, 204, 21, 0.95);
      stroke-opacity: 1;
      stroke-width: 3;
    }
    .sg-orbit-guide {
      fill: none;
      stroke: rgba(148, 163, 184, 0.10);
      stroke-width: 1;
      pointer-events: none;
    }
    .sg-integration-node,
    .sg-wake-badge,
    .sg-provider-badge {
      cursor: default;
      pointer-events: auto;
    }
    .sg-integration-base,
    .sg-wake-base {
      fill: rgba(15, 23, 42, 0.96);
      stroke: rgba(148, 163, 184, 0.54);
      stroke-width: 1.2;
      transition: stroke 180ms ease, stroke-width 180ms ease;
    }
    .sg-integration-node[data-key="browserless"] .sg-integration-base,
    .sg-integration-node[data-key="github"] .sg-integration-base,
    .sg-integration-node[data-key="matrix"] .sg-integration-base,
    .sg-integration-node[data-key="notion"] .sg-integration-base,
    .sg-integration-node[data-key="signal"] .sg-integration-base,
    .sg-integration-node[data-key="telegram"] .sg-integration-base,
    .sg-integration-node[data-key="wikijs"] .sg-integration-base {
      fill: #fff;
    }
    .sg-integration-node[data-key="podman"] .sg-integration-base {
      fill: #faf5ff;
    }
    .sg-integration-node[data-key="x"] .sg-integration-base {
      fill: #000;
    }
    .sg-integration-node.is-active .sg-integration-base,
    .sg-wake-badge.is-active .sg-wake-base {
      animation: sg-integration-pulse 1125ms ease-in-out;
      stroke: rgba(250, 204, 21, 1);
      stroke-width: 2.6;
    }
    .sg-integration-blast {
      fill: none;
      pointer-events: none;
      stroke: rgba(34, 197, 94, 0.95);
      stroke-linecap: round;
      stroke-width: 2.2;
      transform-box: fill-box;
      transform-origin: center;
    }
    .sg-integration-blast-ring {
      animation: sg-integration-blast-ring 760ms ease-out forwards;
    }
    .sg-integration-blast-rays {
      animation: sg-integration-blast-rays 760ms ease-out forwards;
    }
    .sg-provider-badge .sg-wake-base {
      fill: rgba(17, 24, 39, 0.98);
    }
    .sg-provider-badge[data-provider-key="openai"] .sg-wake-base,
    .sg-provider-badge[data-provider-key="xai"] .sg-wake-base {
      fill: #fff;
    }
    .sg-persona-label {
      display: none;
    }
    #random-stack-tooltip.sg-tooltip {
      background: rgba(15, 23, 42, 0.96);
      border: 1px solid rgba(148, 163, 184, 0.36);
      border-radius: 8px;
      color: #e5e7eb;
      display: none;
      font-size: 12px;
      left: 0;
      line-height: 1.35;
      max-width: 260px;
      padding: 8px 10px;
      pointer-events: none;
      position: fixed;
      top: 0;
      z-index: 10;
    }
    #random-stack-tooltip.sg-tooltip.is-visible {
      display: block;
    }
    @keyframes sg-ticker {
      from { stroke-dashoffset: 0; }
      to { stroke-dashoffset: -407; }
    }
    @keyframes sg-ring-glow {
      0%, 100% { stroke-opacity: 0.58; }
      50% { stroke-opacity: 1; }
    }
    @keyframes sg-integration-pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.18); }
    }
    @keyframes sg-orbit-edge-pulse {
      0%, 100% { stroke-opacity: 0.35; }
      50% { stroke-opacity: 1; }
    }
    @keyframes sg-integration-blast-ring {
      0% { opacity: 0.95; transform: scale(0.55); }
      100% { opacity: 0; transform: scale(2.2); }
    }
    @keyframes sg-integration-blast-rays {
      0% { opacity: 0.9; transform: scale(0.8); }
      100% { opacity: 0; transform: scale(1.75); }
    }
