/**
 * 8bitflow How It Works — Production-Grade Visualization Styles
 * Premium glassmorphism, GPU-accelerated keyframes, mobile responsive.
 */

/* ── Container base ── */
.hiw-viz {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(145deg, #0a0a0d 0%, #0f0f14 40%, #0d0d11 100%);
  content-visibility: auto;
  contain: layout style paint;
}

/* ── Mobile V2: release command center ── */
@media (max-width: 767.98px) {
  .dm-mobile-root.dm-mobile-v2 {
    min-height: 420px;
    padding: 14px;
    background:
      radial-gradient(circle at 14% 10%, rgba(96,165,250,0.24), transparent 32%),
      radial-gradient(circle at 88% 36%, rgba(167,139,250,0.18), transparent 34%),
      radial-gradient(circle at 48% 96%, rgba(52,211,153,0.14), transparent 34%),
      linear-gradient(145deg, #08080a 0%, #101019 48%, #09090b 100%);
  }

  .dm-mobile-root.dm-mobile-v2::before {
    background-image:
      linear-gradient(rgba(96,165,250,0.032) 1px, transparent 1px),
      linear-gradient(90deg, rgba(167,139,250,0.024) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at 50% 45%, #000 0%, transparent 84%);
  }

  .dmm-v2-aurora {
    position: absolute;
    left: 50%;
    top: 44%;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: conic-gradient(from 160deg, rgba(96,165,250,0.2), rgba(167,139,250,0.18), rgba(52,211,153,0.22), rgba(96,165,250,0.2));
    filter: blur(40px);
    opacity: 0.8;
    animation: dmmV2Aurora 8s ease-in-out infinite alternate;
    pointer-events: none;
  }

  @keyframes dmmV2Aurora {
    from { transform: translate(-52%, -48%) rotate(-12deg) scale(0.92); opacity: 0.58; }
    to { transform: translate(-48%, -52%) rotate(14deg) scale(1.08); opacity: 0.9; }
  }

  .dmm-v2-header {
    align-items: center;
  }

  .dmm-v2-header > div > span {
    color: #60a5fa;
  }

  .dmm-v2-header strong {
    max-width: 218px;
    font-size: 15px;
    letter-spacing: -0.035em;
  }

  .dm-mobile-run.dmm-v2-run {
    padding: 7px 10px;
    border-color: rgba(96,165,250,0.28);
    color: #dbeafe;
    background: linear-gradient(135deg, rgba(96,165,250,0.16), rgba(167,139,250,0.1));
    box-shadow: 0 12px 28px -20px rgba(96,165,250,0.7);
  }

  .dmm-v2-stage {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 164px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-top: 10px;
  }

  .dmm-v2-rollout {
    position: relative;
    width: 164px;
    height: 164px;
    display: grid;
    place-items: center;
  }

  .dmm-v2-rollout svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
  }

  .dmm-v2-rollout-track,
  .dmm-v2-rollout-progress {
    fill: none;
    stroke-width: 9;
  }

  .dmm-v2-rollout-track {
    stroke: rgba(63,63,70,0.62);
  }

  .dmm-v2-rollout-progress {
    stroke: url(#dmm-v2-rollout-grad);
    stroke-dasharray: 421;
    stroke-dashoffset: 421;
    stroke-linecap: round;
    filter: drop-shadow(0 0 12px rgba(96,165,250,0.34));
    transition: stroke-dashoffset 0.8s cubic-bezier(0.16,1,0.3,1);
  }

  .dmm-v2-core {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 96px;
    height: 96px;
    border: 1px solid rgba(52,211,153,0.25);
    border-radius: 30px;
    background:
      linear-gradient(145deg, rgba(18,18,25,0.94), rgba(8,18,15,0.92)),
      radial-gradient(circle at 50% 0%, rgba(52,211,153,0.16), transparent 60%);
    box-shadow: 0 22px 48px -28px rgba(52,211,153,0.82), inset 0 1px 0 rgba(255,255,255,0.05);
  }

  .dmm-v2-core .material-symbols-outlined {
    color: #34d399;
    font-size: 22px;
    font-variation-settings: 'FILL' 1;
  }

  .dmm-v2-core strong {
    color: #fafafa;
    font-size: 25px;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.05em;
    font-variant-numeric: tabular-nums;
  }

  .dmm-v2-core small {
    color: #9d9db5;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .dmm-v2-pulse {
    position: absolute;
    border: 1px solid rgba(52,211,153,0.22);
    border-radius: 50%;
    animation: dmmV2Pulse 2.8s ease-out infinite;
    pointer-events: none;
  }

  .dmm-v2-pulse-a { inset: 25px; }
  .dmm-v2-pulse-b { inset: 10px; animation-delay: 0.9s; border-color: rgba(96,165,250,0.18); }

  @keyframes dmmV2Pulse {
    0% { transform: scale(0.82); opacity: 0.75; }
    100% { transform: scale(1.08); opacity: 0; }
  }

  .dmm-v2-service-grid {
    display: grid;
    gap: 8px;
  }

  .dmm-v2-service {
    display: grid;
    grid-template-columns: 7px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 9px;
    border: 1px solid rgba(39,39,42,0.72);
    border-radius: 14px;
    background: rgba(18,18,25,0.62);
    transition: border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease, transform 0.28s cubic-bezier(0.16,1,0.3,1);
  }

  .dmm-v2-service i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px rgba(52,211,153,0.58);
  }

  .dmm-v2-service span {
    color: #d4d4d8;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: -0.01em;
  }

  .dmm-v2-service b {
    color: #34d399;
    font-size: 10px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
  }

  .dmm-v2-service.is-pulsing {
    transform: translateY(-2px);
    border-color: rgba(52,211,153,0.38);
    background: rgba(52,211,153,0.075);
    box-shadow: 0 18px 38px -25px rgba(52,211,153,0.8);
  }

  .dmm-v2-rail {
    margin-top: 10px;
    padding: 8px;
    border: 1px solid rgba(39,39,42,0.58);
    border-radius: 18px;
    background: rgba(12,12,15,0.62);
  }

  .dmm-v2-rail::before {
    top: 22px;
    left: 14%;
    right: 14%;
    background: linear-gradient(90deg, rgba(96,165,250,0.36), rgba(167,139,250,0.32), rgba(52,211,153,0.36));
  }

  .dmm-v2-rail .dm-mobile-stage {
    gap: 4px;
  }

  .dmm-v2-rail .dm-mobile-stage .material-symbols-outlined {
    width: 31px;
    height: 31px;
    border-radius: 12px;
    background: rgba(18,18,25,0.86);
  }

  .dmm-v2-observability {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 9px;
  }

  .dmm-v2-observability div {
    padding: 9px 7px;
    border: 1px solid rgba(39,39,42,0.68);
    border-radius: 14px;
    background: rgba(18,18,25,0.58);
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
  }

  .dmm-v2-observability span {
    display: block;
    color: #fafafa;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

  .dmm-v2-observability small {
    display: block;
    margin-top: 5px;
    color: #8b8ba3;
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .dmm-v2-console {
    margin-top: 9px;
    border-radius: 16px;
    background: rgba(6,6,8,0.84);
  }

  .dmm-v2-console .dm-mobile-console-body {
    min-height: 58px;
  }

  .dmm-v2-console .dm-mobile-log {
    font-size: 12px;
  }

  .dm-mobile-root.dm-mobile-v2.is-running .dmm-v2-core {
    box-shadow: 0 22px 54px -24px rgba(96,165,250,0.84), inset 0 1px 0 rgba(255,255,255,0.05);
  }

  .dm-mobile-root.dm-mobile-v2.is-complete .dmm-v2-core {
    animation: dmmV2Complete 0.95s cubic-bezier(0.16,1,0.3,1);
  }

  @keyframes dmmV2Complete {
    0%, 100% { transform: scale(1); }
    38% { transform: scale(1.08); box-shadow: 0 24px 60px -18px rgba(52,211,153,0.95); }
  }

  .dmm-v2-aurora {
    animation: none !important;
  }

  .dmm-v2-pulse {
    animation: none !important;
  }
}

@media (max-width: 374.98px) {
  .dmm-v2-stage {
    grid-template-columns: 1fr;
  }

  .dmm-v2-rollout {
    width: 150px;
    height: 150px;
    margin-inline: auto;
  }

  .dmm-v2-service-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dmm-v2-service {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    text-align: center;
  }
}

/* Mobile V3: release control */
@media (max-width: 767.98px) {
  .dm-mobile-root.dm-mobile-story {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 14px;
    overflow: hidden;
    border-radius: inherit;
    background:
      radial-gradient(circle at 52% 18%, rgba(96,165,250,0.16), transparent 34%),
      radial-gradient(circle at 84% 80%, rgba(52,211,153,0.10), transparent 32%),
      linear-gradient(145deg, #08080a 0%, #101016 52%, #09090b 100%);
    font-family: 'Geist', sans-serif;
  }

  .dm-mobile-root.dm-mobile-story::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(96,165,250,0.028) 1px, transparent 1px),
      linear-gradient(90deg, rgba(167,139,250,0.022) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, #000 0%, transparent 88%);
    pointer-events: none;
  }

  .dmm-story-glow {
    position: absolute;
    inset: 72px 36px auto;
    height: 120px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(96,165,250,0.18), rgba(167,139,250,0.16), rgba(52,211,153,0.14));
    filter: blur(30px);
    opacity: 0.66;
    pointer-events: none;
  }

  .dmm-story-head {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
  }

  .dmm-story-head span {
    display: block;
    margin-bottom: 4px;
    color: #60a5fa;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
  }

  .dmm-story-head strong {
    display: block;
    max-width: 224px;
    color: #fafafa;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: 0;
  }

  .dm-mobile-run.dmm-story-run {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(96,165,250,0.30);
    border-radius: 999px;
    color: #dbeafe;
    background: linear-gradient(135deg, rgba(96,165,250,0.16), rgba(167,139,250,0.10));
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .dm-mobile-run.dmm-story-run .material-symbols-outlined {
    font-size: 16px;
    font-variation-settings: 'FILL' 1;
  }

  .dmm-story-rail {
    position: absolute;
    z-index: 1;
    top: 136px;
    left: 58px;
    right: 58px;
    height: 2px;
    pointer-events: none;
  }

  .dmm-story-line,
  .dmm-story-pulse {
    position: absolute;
    inset: 0;
    display: block;
  }

  .dmm-story-line {
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(96,165,250,0.24), rgba(167,139,250,0.28), rgba(52,211,153,0.28));
  }

  .dmm-story-pulse {
    top: -4px;
    left: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #60a5fa;
    box-shadow: 0 0 16px rgba(96,165,250,0.76);
    animation: dmmStoryPulse 2.8s cubic-bezier(0.16,1,0.3,1) infinite;
  }

  @keyframes dmmStoryPulse {
    0%, 12% { left: 0; opacity: 0.35; }
    46%, 58% { left: calc(50% - 5px); opacity: 1; }
    88%, 100% { left: calc(100% - 10px); opacity: 0.55; }
  }

  .dmm-story-nodes {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
  }

  .dmm-story-node,
  .dmm-story-health {
    border: 1px solid rgba(39,39,42,0.74);
    background: linear-gradient(145deg, rgba(18,18,25,0.88), rgba(9,9,12,0.82));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 18px 38px -32px rgba(0,0,0,0.9);
  }

  .dmm-story-node {
    display: flex;
    min-height: 92px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 7px;
    border-radius: 14px;
    text-align: center;
    transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), border-color 0.28s ease, background 0.28s ease;
  }

  .dmm-story-node .material-symbols-outlined {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 1px solid rgba(63,63,70,0.58);
    border-radius: 11px;
    color: #bfdbfe;
    background: rgba(24,24,31,0.72);
    font-size: 18px;
    font-variation-settings: 'FILL' 1;
  }

  .dmm-story-node strong {
    color: #f4f4f5;
    font-size: 12px;
    line-height: 1.1;
  }

  .dmm-story-node small {
    color: #a1a1aa;
    font-size: 11px;
    line-height: 1.15;
  }

  .dmm-story-node.is-active {
    transform: translateY(-2px);
    border-color: rgba(96,165,250,0.46);
    background: linear-gradient(145deg, rgba(96,165,250,0.12), rgba(11,11,16,0.88));
  }

  .dmm-story-node.is-done {
    border-color: rgba(52,211,153,0.28);
  }

  .dmm-story-node.is-done .material-symbols-outlined {
    color: #6ee7b7;
    border-color: rgba(52,211,153,0.34);
  }

  .dmm-story-health {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border-color: rgba(52,211,153,0.20);
    border-radius: 14px;
    background: rgba(7,10,10,0.82);
  }

  .dmm-story-health div {
    padding: 10px 6px;
    text-align: center;
    background: rgba(18,18,25,0.54);
  }

  .dmm-story-health span,
  .dmm-story-health small {
    display: block;
  }

  .dmm-story-health span {
    color: #6ee7b7;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.1;
  }

  .dmm-story-health small {
    margin-top: 3px;
    color: #8f8fa3;
    font-size: 11px;
    line-height: 1.1;
  }
}

@media (max-width: 374.98px) {
  .dmm-story-head strong { max-width: 190px; font-size: 13px; }
  .dmm-story-node { min-height: 86px; padding-inline: 5px; }
  .dmm-story-node strong,
  .dmm-story-health span { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .dmm-story-pulse {
    animation: none !important;
    left: calc(100% - 10px);
  }

  .dmm-story-node,
  .dmm-story-pulse {
    transition: none !important;
  }
}

@media (max-width: 767.98px) {
  .dm-mobile-root.dm-mobile-v3 {
    min-height: 420px;
    padding: 14px;
    background:
      radial-gradient(circle at 14% 10%, rgba(96,165,250,0.24), transparent 32%),
      radial-gradient(circle at 84% 24%, rgba(167,139,250,0.18), transparent 34%),
      radial-gradient(circle at 50% 94%, rgba(52,211,153,0.14), transparent 34%),
      linear-gradient(145deg, #08080a 0%, #101019 48%, #09090b 100%);
  }

  .dm-mobile-root.dm-mobile-v3::before {
    background-image:
      linear-gradient(rgba(96,165,250,0.03) 1px, transparent 1px),
      linear-gradient(90deg, rgba(167,139,250,0.024) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 84%);
  }

  .dmm-v3-aurora {
    position: absolute;
    inset: 54px 18px auto;
    height: 210px;
    border-radius: 999px;
    background: conic-gradient(from 190deg, rgba(96,165,250,0), rgba(96,165,250,0.22), rgba(167,139,250,0.22), rgba(52,211,153,0.18), rgba(96,165,250,0));
    filter: blur(34px);
    opacity: 0.82;
    animation: dmmV3Aurora 8s ease-in-out infinite alternate;
    pointer-events: none;
  }

  @keyframes dmmV3Aurora {
    from { transform: translate3d(-8px, 6px, 0) rotate(-9deg) scale(0.94); opacity: 0.58; }
    to { transform: translate3d(8px, -8px, 0) rotate(10deg) scale(1.06); opacity: 0.9; }
  }

  .dmm-v3-header {
    position: relative;
    z-index: 4;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .dmm-v3-header span {
    display: block;
    margin-bottom: 4px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  .dmm-v3-header strong {
    display: block;
    max-width: 214px;
    color: #fafafa;
    font-size: 15px;
    line-height: 1.1;
    letter-spacing: -0.04em;
  }

  .dm-mobile-run.dmm-v3-run {
    padding: 7px 10px;
    border-color: rgba(96,165,250,0.28);
    color: #dbeafe;
    background: linear-gradient(135deg, rgba(96,165,250,0.16), rgba(167,139,250,0.1));
    box-shadow: 0 12px 28px -20px rgba(96,165,250,0.7);
  }

  .dmm-v3-rollout,
  .dmm-v3-stage,
  .dmm-v3-metric,
  .dmm-v3-service,
  .dmm-v3-console {
    position: relative;
    z-index: 3;
    overflow: hidden;
    border: 1px solid rgba(39,39,42,0.76);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(18,18,25,0.88), rgba(10,10,14,0.86));
    box-shadow: 0 20px 48px -34px rgba(0,0,0,0.92), inset 0 1px 0 rgba(255,255,255,0.04);
    transition: transform 0.32s cubic-bezier(0.16,1,0.3,1), border-color 0.32s ease, box-shadow 0.32s ease, background 0.32s ease;
  }

  .dmm-v3-rollout {
    margin-top: 12px;
    padding: 12px;
    background:
      linear-gradient(160deg, rgba(18,22,28,0.94), rgba(10,12,18,0.88)),
      radial-gradient(circle at 0% 0%, rgba(96,165,250,0.16), transparent 50%);
  }

  .dmm-v3-rollout-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
  }

  .dmm-v3-rollout-top span,
  .dmm-v3-rollout-top b,
  .dmm-v3-progress-meta small,
  .dmm-v3-metric small {
    display: block;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .dmm-v3-rollout-top span,
  .dmm-v3-progress-meta small,
  .dmm-v3-metric small {
    color: #71717a;
  }

  .dmm-v3-rollout-top strong,
  .dmm-v3-progress-meta strong,
  .dmm-v3-metric span {
    display: block;
    color: #fafafa;
    line-height: 1.1;
    letter-spacing: -0.03em;
  }

  .dmm-v3-rollout-top strong {
    margin-top: 6px;
    font-size: 16px;
  }

  .dmm-v3-rollout-top b {
    padding: 6px 8px;
    border-radius: 999px;
    color: #c4b5fd;
    background: rgba(167,139,250,0.1);
    border: 1px solid rgba(167,139,250,0.18);
  }

  .dmm-v3-progress-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
  }

  .dmm-v3-progress-meta strong {
    margin-top: 5px;
    font-size: 20px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
  }

  .dmm-v3-progress {
    height: 6px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(63,63,70,0.56);
  }

  .dmm-v3-progress-fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #60a5fa, #a78bfa, #34d399);
    box-shadow: 0 0 16px rgba(96,165,250,0.32);
    transition: width 0.8s cubic-bezier(0.16,1,0.3,1);
  }

  .dmm-v3-stage-grid {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
  }

  .dmm-v3-stage {
    display: grid;
    gap: 4px;
    padding: 10px 7px;
    text-align: center;
    color: #71717a;
  }

  .dmm-v3-stage .material-symbols-outlined {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin: 0 auto;
    border-radius: 11px;
    border: 1px solid rgba(63,63,70,0.56);
    background: rgba(18,18,25,0.76);
    color: inherit;
    font-size: 16px;
    font-variation-settings: 'FILL' 0;
    transition: transform 0.28s cubic-bezier(0.16,1,0.3,1), border-color 0.28s ease, color 0.28s ease;
  }

  .dmm-v3-stage b {
    color: inherit;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .dmm-v3-stage small {
    color: #52525b;
    font-size: 12px;
  }

  .dmm-v3-stage.is-active {
    color: #c4b5fd;
    border-color: rgba(167,139,250,0.34);
    box-shadow: 0 18px 36px -28px rgba(167,139,250,0.76);
  }

  .dmm-v3-stage.is-active .material-symbols-outlined {
    color: #c4b5fd;
    border-color: rgba(167,139,250,0.38);
    transform: translateY(-1px);
  }

  .dmm-v3-stage.is-done {
    color: #6ee7b7;
    border-color: rgba(52,211,153,0.28);
  }

  .dmm-v3-stage.is-done .material-symbols-outlined {
    color: #6ee7b7;
    border-color: rgba(52,211,153,0.28);
  }

  .dmm-v3-observability {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 10px;
  }

  .dmm-v3-metric {
    padding: 10px 8px;
    text-align: center;
  }

  .dmm-v3-metric span {
    font-size: 13px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
  }

  .dmm-v3-metric small {
    margin-top: 5px;
  }

  .dmm-v3-services {
    position: relative;
    z-index: 3;
    display: grid;
    gap: 6px;
    margin-top: 10px;
  }

  .dmm-v3-service {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
  }

  .dmm-v3-service > div {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .dmm-v3-service i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 10px rgba(52,211,153,0.55);
    flex-shrink: 0;
  }

  .dmm-v3-service span {
    color: #d4d4d8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.01em;
  }

  .dmm-v3-service b {
    color: #34d399;
    font-size: 10px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
  }

  .dmm-v3-service.is-pulsing {
    transform: translateY(-1px);
    border-color: rgba(52,211,153,0.36);
    background: rgba(52,211,153,0.06);
    box-shadow: 0 18px 38px -28px rgba(52,211,153,0.78);
  }

  .dmm-v3-console {
    margin-top: 10px;
    background: rgba(7,7,9,0.84);
  }

  .dmm-v3-rollout.is-live,
  .dmm-v3-observability.is-live,
  .dmm-v3-services.is-live,
  .dmm-v3-console.is-live {
    transform: translateY(-1px);
    border-color: rgba(96,165,250,0.36);
    box-shadow: 0 22px 48px -28px rgba(96,165,250,0.56), 0 0 0 1px rgba(96,165,250,0.08);
  }

  .dmm-v3-aurora {
    animation: none !important;
  }

  .dmm-v3-stage i,
  .dmm-v3-badge {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dmm-v3-aurora {
    animation: none !important;
  }

  .dmm-v3-rollout,
  .dmm-v3-stage,
  .dmm-v3-metric,
  .dmm-v3-service,
  .dmm-v3-console,
  .dmm-v3-progress-fill,
  .dmm-v3-stage .material-symbols-outlined {
    transition: none !important;
  }
}

.hiw-viz::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.025) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}

.hiw-viz svg {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
}

/* ── Mobile: keep visuals identical, remove expensive compositor work off-screen ── */
@media (max-width: 767.98px) {
  .hiw-viz::before {
    /* keep grid visible but skip backdrop-filter compositing */
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .hiw-conn,
  .hiw-conn-active,
  .hiw-conn-glow {
    will-change: stroke-dashoffset;
  }

  .hiw-connect-ripple,
  .hiw-hub-pulse,
  .hiw-burst,
  .hiw-particle {
    will-change: transform, opacity;
  }

  .hiw-progress-bar,
  .hiw-progress-glow {
    will-change: width;
  }
}

/* ── Instant tap feedback for mobile (no visual change to desktop) ── */
.hiw-tool.tapped .hiw-tool-card {
  fill: rgba(25, 25, 32, 0.98) !important;
  stroke: rgba(167, 139, 250, 0.4) !important;
  filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.12)) !important;
  transition: fill 0.08s ease, stroke 0.08s ease, filter 0.08s ease !important;
}

.hiw-tool.tapped .hiw-tool-shadow {
  opacity: 0.1 !important;
  transition: opacity 0.08s ease !important;
}

.hiw-tool.tapped .hiw-tool-accent {
  opacity: 0.85 !important;
  transition: opacity 0.08s ease, stroke-width 0.08s ease !important;
}

.hiw-tool.tapped .hiw-tool-logo {
  opacity: 1 !important;
  transform: scale(1.1) !important;
  transition: opacity 0.08s ease, transform 0.08s ease !important;
}

.hiw-tool.tapped .hiw-tool-highlight {
  opacity: 0.1 !important;
  transition: opacity 0.08s ease !important;
}

/* ═══════════════════════════════════════════════
   SCENE 1 — CONNECT STACK (Premium)
   ═══════════════════════════════════════════════ */

/* ── Orbit ring ── */
.hiw-orbit-group {
  pointer-events: none;
}

.hiw-orbit-group circle:first-child {
  animation: orbitSpin 24s linear infinite;
  transform-origin: center;
}

.hiw-orbit-group circle:last-child {
  animation: orbitSpin 20s linear infinite reverse;
  transform-origin: center;
}

@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ── Tool cards ── */
.hiw-tool {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  will-change: fill, stroke, filter;
}

.hiw-tool:active:not(.connected) .hiw-tool-card {
  fill: rgba(25, 25, 32, 0.95);
  stroke: rgba(167, 139, 250, 0.35);
  filter: drop-shadow(0 0 10px rgba(167, 139, 250, 0.1));
}

.hiw-tool-card {
  fill: rgba(18, 18, 25, 0.85);
  stroke: rgba(63, 63, 70, 0.35);
  stroke-width: 0.75;
  backdrop-filter: blur(8px);
  transition: fill 0.35s cubic-bezier(0.16,1,0.3,1), stroke 0.35s cubic-bezier(0.16,1,0.3,1), filter 0.35s cubic-bezier(0.16,1,0.3,1);
}

.hiw-tool.connected .hiw-tool-card {
  fill: rgba(12, 22, 18, 0.9);
  stroke: rgba(52, 211, 153, 0.5);
  filter: drop-shadow(0 0 16px rgba(52, 211, 153, 0.1));
}

.hiw-tool-shadow {
  transition: opacity 0.3s ease;
}

.hiw-tool:active:not(.connected) .hiw-tool-shadow {
  opacity: 0.1;
}

@media (hover: hover) {
  .hiw-tool.hovered .hiw-tool-card {
    fill: rgba(22, 22, 28, 0.95);
    stroke: rgba(167, 139, 250, 0.35);
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.1));
  }

  .hiw-tool.hovered .hiw-tool-shadow {
    opacity: 0.1;
  }
}

.hiw-tool.connected .hiw-tool-shadow {
  fill: #34d399;
  opacity: 0.08;
}

.hiw-tool-highlight {
  transition: opacity 0.3s ease;
}

.hiw-tool:active:not(.connected) .hiw-tool-highlight {
  opacity: 0.1;
}

@media (hover: hover) {
  .hiw-tool.hovered .hiw-tool-highlight {
    opacity: 0.1;
  }
}

.hiw-tool-accent {
  opacity: 0.45;
  transition: opacity 0.35s ease, stroke-width 0.35s cubic-bezier(0.16,1,0.3,1);
}

.hiw-tool.connected .hiw-tool-accent {
  opacity: 0.85;
}

@media (hover: hover) {
  .hiw-tool.hovered .hiw-tool-accent {
    opacity: 0.85;
    stroke-width: 2.5;
  }
}

.hiw-tool-logo {
  transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16,1,0.3,1);
  opacity: 0.7;
}

.hiw-tool.connected .hiw-tool-logo {
  opacity: 1;
}

@media (hover: hover) {
  .hiw-tool.hovered .hiw-tool-logo {
    opacity: 1;
    transform: scale(1.1);
  }
}

.hiw-tool-label {
  fill: #dfdfe5;
  font-family: 'Geist', sans-serif;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  pointer-events: none;
  transition: fill 0.35s ease;
}

.hiw-tool.connected .hiw-tool-label {
  fill: #d1fae5;
}

.hiw-tool-sub {
  fill: #505060;
  font-family: 'Geist', sans-serif;
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  transition: fill 0.35s ease;
}

.hiw-tool.connected .hiw-tool-sub {
  fill: rgba(52, 211, 153, 0.7);
}

.hiw-tool-dot {
  opacity: 0.25;
  transition: opacity 0.4s ease, r 0.35s cubic-bezier(0.16,1,0.3,1);
}

.hiw-tool.connected .hiw-tool-dot {
  opacity: 0.85;
  r: 4;
  animation: dotPulse 2.5s ease-in-out infinite;
}

@media (hover: hover) {
  .hiw-tool.hovered .hiw-tool-dot {
    opacity: 0.9;
    r: 4.5;
  }
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.35; }
}

/* ── Connect ripple ── */
.hiw-connect-ripple {
  pointer-events: none;
  transform-box: fill-box;
}

.hiw-hub-pulse {
  fill: none;
  stroke: #a78bfa;
  stroke-width: 1.5;
  opacity: 0;
  transform-box: fill-box;
  will-change: transform, opacity;
}

.hiw-ambient {
  animation: ambientPulse 4s ease-in-out infinite;
  will-change: opacity;
}

.hiw-burst {
  pointer-events: none;
  transform-box: fill-box;
}

.hiw-particle {
  pointer-events: none;
  transform-box: fill-box;
}

/* ── Stats ── */
.hiw-stat-bg {
  fill: rgba(18, 18, 25, 0.65);
  stroke: rgba(52, 211, 153, 0.12);
  stroke-width: 0.5;
}

.hiw-stat-label {
  fill: #505060;
  font-family: 'Geist', sans-serif;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.hiw-stat-value {
  fill: #34d399;
  font-family: 'Geist', sans-serif;
  font-size: 10px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ── Hub ── */
.hiw-hub-body {
  fill: rgba(18, 18, 25, 0.92);
  stroke: #a78bfa;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 18px rgba(167, 139, 250, 0.18));
  transition: filter 0.4s ease, stroke 0.4s ease;
}

.hiw-hub-highlight {
  fill: #ffffff;
  pointer-events: none;
}

.hiw-hub-icon {
  font-family: 'Material Symbols Outlined';
  font-size: 26px;
  fill: #a78bfa;
  font-variation-settings: 'FILL' 1;
  pointer-events: none;
}

.hiw-hub-label {
  fill: #a78bfa;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hiw-hub-pulse {
  fill: none;
  stroke: #a78bfa;
  stroke-width: 1.5;
  opacity: 0;
}

.hiw-ambient {
  animation: ambientPulse 4s ease-in-out infinite;
}

@keyframes ambientPulse {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.55; }
}

/* ── Progress bar ── */
.hiw-progress-bg {
  fill: rgba(18, 18, 25, 0.6);
  stroke: rgba(63, 63, 70, 0.28);
  stroke-width: 0.5;
}

.hiw-progress-bar {
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1), fill 0.5s ease;
}

.hiw-progress-bar.complete {
  fill: rgba(52, 211, 153, 0.35) !important;
}

.hiw-progress-glow {
  pointer-events: none;
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1), stroke-width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.hiw-progress-text {
  fill: #505060;
  font-family: 'Geist', sans-serif;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: fill 0.4s ease;
}

.hiw-progress-text.complete {
  fill: #34d399;
}

/* ── Reset ── */
.hiw-reset-bg {
  fill: rgba(39, 39, 42, 0.35);
  stroke: rgba(82, 82, 91, 0.25);
  stroke-width: 0.5;
  transition: fill 0.25s ease;
}

.hiw-reset-group:hover .hiw-reset-bg {
  fill: rgba(39, 39, 42, 0.65);
  stroke: rgba(167, 139, 250, 0.2);
}

.hiw-reset-text {
  fill: #9d9db5;
  font-family: 'Geist', sans-serif;
  font-size: 13px;
  font-weight: 500;
  transition: fill 0.25s ease;
}

.hiw-reset-group:hover .hiw-reset-text {
  fill: #dfdfe5;
}

/* ── Connections ── */
.hiw-conn {
  transition: stroke-width 0.3s ease;
  stroke-linecap: round;
}

.hiw-conn-active {
  stroke-dasharray: none;
}

.hiw-conn-glow {
  stroke-linecap: round;
  pointer-events: none;
}

/* ── Data packets ── */
.hiw-pkt {
  will-change: transform;
}

/* ── Celebration burst ── */
.hiw-burst {
  pointer-events: none;
}

.hiw-particle {
  pointer-events: none;
}

/* ═══════════════════════════════════════════════
   SCENE 2 — CYBER-CIRCUIT FLUID (Premium Canvas)
   ═══════════════════════════════════════════════ */

.hiw-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(145deg, #0a0a0d 0%, #0f0f14 40%, #0d0d11 100%);
}

/* Mobile: allow vertical scroll to pass through canvas; only drag on nodes */
@media (max-width: 767.98px) {
  .hiw-canvas {
    touch-action: pan-y;
  }
}

/* ═══════════════════════════════════════════════
   SCENE 3 — DEPLOY & MONITOR (Premium Split Panel)
   ═══════════════════════════════════════════════ */

.dm-root {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  width: 100%;
  height: 100%;
  padding: 5px;
  font-family: 'Geist', sans-serif;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  background: linear-gradient(145deg, #0a0a0d 0%, #0f0f14 40%, #0d0d11 100%);
  border-radius: inherit;
}

.dm-root::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(167, 139, 250, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(167, 139, 250, 0.018) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
  border-radius: inherit;
}

@media (max-width: 767.98px) {
  .dm-root {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 4px;
  }
}

/* ── Panels ── */
.dm-panel {
  background: rgba(18, 18, 25, 0.75);
  border: 1px solid rgba(63, 63, 70, 0.35);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
  min-height: 0;
  position: relative;
  z-index: 1;
}

/* ── Scanline overlay ── */
.dm-scanline {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  opacity: 0.025;
  will-change: auto;
  contain: strict;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(167, 139, 250, 0.25) 2px,
    rgba(167, 139, 250, 0.25) 3px
  );
  animation: dmScanlineDrift 8s linear infinite;
}

@keyframes dmScanlineDrift {
  0% { background-position: 0 0; }
  100% { background-position: 0 24px; }
}

/* ── Active deploy glow ── */
.dm-deploy-active {
  border-color: rgba(96, 165, 250, 0.35) !important;
  box-shadow: 0 0 12px rgba(96, 165, 250, 0.06), inset 0 0 8px rgba(96, 165, 250, 0.03);
}

/* ── Header ── */
.dm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.dm-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dm-icon {
  font-size: 16px;
  color: #a78bfa;
  font-variation-settings: 'FILL' 1;
}

.dm-title {
  font-size: 10px;
  font-weight: 700;
  color: #dfdfe5;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ── Badge ── */
.dm-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.dm-badge-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dm-badge-idle {
  background: rgba(113, 113, 122, 0.15);
  color: #6b6b80;
  border: 1px solid rgba(113, 113, 122, 0.25);
}

.dm-badge-idle .dm-badge-dot {
  background: #505060;
}

.dm-badge-running {
  background: rgba(96, 165, 250, 0.12);
  color: #93c5fd;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.dm-badge-running .dm-badge-dot {
  background: #60a5fa;
  animation: dmPulseDot 1s ease-in-out infinite;
}

.dm-badge-success {
  background: rgba(52, 211, 153, 0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.dm-badge-success .dm-badge-dot {
  background: #34d399;
}

@keyframes dmPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.65); }
}

/* ── Pipeline ── */
.dm-pipeline {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  padding: 4px 0;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.dm-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  position: relative;
  flex-shrink: 0;
  min-width: 0;
}

.dm-stage-ring {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #2f2f36;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #141418;
  transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  flex-shrink: 0;
}

.dm-stage-icon {
  font-size: 14px;
  color: #505060;
  font-variation-settings: 'FILL' 0;
  transition: color 0.45s ease;
}

.dm-stage-label {
  font-size: 7px;
  font-weight: 600;
  color: #505060;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  transition: color 0.45s ease;
}

.dm-stage-time {
  font-size: 7px;
  color: #3e3e4c;
  font-variant-numeric: tabular-nums;
  transition: color 0.45s ease;
}

/* Active stage */
.dm-stage.active .dm-stage-ring {
  border-color: var(--stage-color, #60a5fa);
  background: rgba(96, 165, 250, 0.08);
  background: color-mix(in srgb, var(--stage-color, #60a5fa) 8%, #141418);
  box-shadow: 0 0 10px color-mix(in srgb, var(--stage-color, #60a5fa) 20%, transparent),
              inset 0 0 6px color-mix(in srgb, var(--stage-color, #60a5fa) 5%, transparent);
  animation: dmStageRingPulse 1.2s ease-in-out infinite;
}

.dm-stage.active .dm-stage-icon {
  color: var(--stage-color, #93c5fd);
  font-variation-settings: 'FILL' 1;
}

.dm-stage.active .dm-stage-label {
  color: #dfdfe5;
}

.dm-stage.active .dm-stage-time {
  color: var(--stage-color, #60a5fa);
}

.dm-stage.done .dm-stage-ring {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.06);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.1);
}

@keyframes dmStageRingPulse {
  0%, 100% {
    box-shadow: 0 0 10px color-mix(in srgb, var(--stage-color, #60a5fa) 18%, transparent),
                inset 0 0 6px color-mix(in srgb, var(--stage-color, #60a5fa) 5%, transparent);
  }
  50% {
    box-shadow: 0 0 18px color-mix(in srgb, var(--stage-color, #60a5fa) 30%, transparent),
                inset 0 0 10px color-mix(in srgb, var(--stage-color, #60a5fa) 8%, transparent);
  }
}

/* Pipeline connectors */
.dm-pipe-conn {
  display: flex;
  align-items: center;
  padding-top: 6px;
  width: 20px;
  flex-shrink: 0;
}

.dm-pipe-conn-track {
  width: 100%;
  height: 2px;
  background: #1e1e22;
  border-radius: 2px;
  overflow: hidden;
}

.dm-pipe-conn-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #60a5fa, #34d399);
  border-radius: 2px;
}

/* ── Terminal ── */
.dm-terminal {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(10, 10, 12, 0.85);
  border: 1px solid rgba(30, 30, 34, 0.7);
  border-radius: 6px;
  overflow: hidden;
  min-height: 0;
}

.dm-term-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(17, 17, 20, 0.95);
  border-bottom: 1px solid rgba(30, 30, 34, 0.8);
  flex-shrink: 0;
}

.dm-term-dots {
  display: flex;
  gap: 4px;
}

.dm-term-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
}

.dm-term-dots span:nth-child(1) { background: #ef4444; opacity: 0.45; }
.dm-term-dots span:nth-child(2) { background: #fbbf24; opacity: 0.45; }
.dm-term-dots span:nth-child(3) { background: #34d399; opacity: 0.45; }

.dm-term-title {
  font-size: 7px;
  color: #3e3e4c;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.dm-term-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  scrollbar-width: none;
}

.dm-term-body::-webkit-scrollbar {
  display: none;
}

.dm-term-line {
  font-family: 'Geist Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 7.5px;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dm-term-dim {
  color: #505060;
}

.dm-term-success {
  color: #34d399;
}

.dm-term-info {
  color: #60a5fa;
}

.dm-term-warn {
  color: #fbbf24;
}

.dm-term-error {
  color: #ef4444;
}

.dm-term-cursor {
  display: inline-block;
  width: 4px;
  height: 9px;
  background: #a78bfa;
  margin-left: 2px;
  vertical-align: middle;
  animation: dmBlinkCursor 1s steps(1) infinite;
}

@keyframes dmBlinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Live indicator ── */
.dm-live-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.dm-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.35);
  animation: dmLivePulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

.dm-live-label {
  font-size: 7px;
  font-weight: 700;
  color: #6ee7b7;
  letter-spacing: 0.06em;
}

@keyframes dmLivePulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(52, 211, 153, 0.35); }
  50% { opacity: 0.4; box-shadow: 0 0 2px rgba(52, 211, 153, 0.1); }
}

/* ── KPI Row ── */
.dm-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  flex-shrink: 0;
}

.dm-kpi {
  background: rgba(24, 24, 27, 0.45);
  border: 1px solid rgba(39, 39, 42, 0.4);
  border-radius: 5px;
  padding: 4px 5px;
  text-align: center;
  position: relative;
  transition: border-color 0.3s ease;
}

.dm-kpi:hover {
  border-color: rgba(63, 63, 70, 0.6);
}

.dm-kpi-value {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.dm-kpi-label {
  font-size: 6.5px;
  color: #505060;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 1px;
}

.dm-kpi-icon {
  position: absolute;
  top: 2px;
  right: 3px;
  font-size: 9px;
  opacity: 0.25;
  font-variation-settings: 'FILL' 0;
}

/* ── Sparkline chart ── */
.dm-chart-wrap {
  position: relative;
  flex-shrink: 0;
}

.dm-chart-label {
  font-size: 6.5px;
  color: #3e3e4c;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 3px;
}

.dm-chart-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #a78bfa;
  opacity: 0.5;
  animation: dmLivePulse 2s ease-in-out infinite;
}

.dm-sparkline {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border-radius: 4px;
}

/* ── Services health ── */
.dm-services {
  flex: 1;
  min-height: 0;
}

.dm-svc-title {
  font-size: 7px;
  font-weight: 700;
  color: #505060;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.dm-svc-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dm-svc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(18, 18, 25, 0.35);
  border: 1px solid rgba(39, 39, 42, 0.25);
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.dm-svc-row:hover {
  background: rgba(24, 24, 27, 0.5);
  border-color: rgba(63, 63, 70, 0.4);
}

/* Celebration pulse on service rows */
.dm-svc-celebrate {
  background: rgba(52, 211, 153, 0.06) !important;
  border-color: rgba(52, 211, 153, 0.35) !important;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.12) !important;
}

.dm-svc-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dm-svc-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dm-svc-ok {
  background: #34d399;
  box-shadow: 0 0 3px rgba(52, 211, 153, 0.25);
}

.dm-svc-warn {
  background: #fbbf24;
  box-shadow: 0 0 3px rgba(251, 191, 36, 0.25);
}

.dm-svc-name {
  font-size: 7.5px;
  color: #9d9db5;
  font-weight: 500;
}

.dm-svc-latency {
  font-size: 7.5px;
  color: #34d399;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: color 0.4s ease;
}

/* ═══════════════════════════════════════════════
   COMMON
   ═══════════════════════════════════════════════ */

.hiw-svg {
  will-change: transform, opacity;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .hiw-viz::before,
  .hiw-hub-pulse,
  .hiw-ambient,
  .hiw-tool-dot,
  .hiw-orbit-group {
    animation: none !important;
  }

  .hiw-svg {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hiw-tool-card,
  .hiw-tool-logo,
  .hiw-tool-sub,
  .hiw-tool-dot,
  .hiw-tool-accent,
  .hiw-tool-highlight,
  .hiw-tool-shadow,
  .hiw-tool-label,
  .hiw-conn,
  .hiw-conn-active,
  .hiw-conn-glow {
    transition: none !important;
  }

  .dm-badge-running .dm-badge-dot,
  .dm-live-dot,
  .dm-chart-dot,
  .dm-stage.active .dm-stage-ring,
  .dm-term-cursor,
  .dm-mobile-glow,
  .dm-mobile-satellite,
  .dm-mobile-stage.is-active i,
  .dm-mobile-root.is-complete .dm-mobile-core {
    animation: none !important;
  }

  .dm-pipe-conn-fill,
  .dm-term-line,
  .dm-root,
  .dm-panel,
  .dm-stage-ring,
  .dm-stage-icon,
  .dm-stage-label,
  .dm-stage-time,
  .dm-badge,
  .dm-svc-row,
  .dm-svc-latency,
  .dm-deploy-active {
    transition: none !important;
  }

  .dm-mobile-stage,
  .dm-mobile-stage i,
  .dm-mobile-stage .material-symbols-outlined,
  .dm-mobile-log,
  .dm-mobile-services div,
  .dm-mobile-run {
    transition: none !important;
  }

  .dm-scanline {
    display: none;
  }
}

/* ── Mobile ── */
@media (max-width: 767.98px) {
  .hiw-tool-card {
    stroke-width: 1;
    transition: fill 0.2s ease, stroke 0.2s ease, filter 0.2s ease;
  }
  .hiw-tool:active:not(.connected) .hiw-tool-card {
    fill: rgba(25, 25, 32, 0.98);
    stroke: rgba(167, 139, 250, 0.4);
    filter: drop-shadow(0 0 12px rgba(167, 139, 250, 0.12));
    transition: fill 0.08s ease, stroke 0.08s ease, filter 0.08s ease;
  }
  .hiw-tool-label {
    font-size: 12px;
  }
  .hiw-tool-sub {
    display: none;
  }
  .hiw-hub-icon {
    font-size: 20px;
  }
  .hiw-hub-label {
    font-size: 12px;
  }
  .hiw-hub-body {
    stroke-width: 1.2;
  }
  .hiw-progress-text {
    font-size: 12px;
  }
  .hiw-progress-bg {
    stroke-width: 0.5;
  }
  .hiw-stat-label {
    font-size: 12px;
  }
  .hiw-stat-value {
    font-size: 12px;
  }
  .hiw-tool-dot {
    r: 3.5;
  }

  .hiw-orbit-group {
    animation: none !important;
  }

  .hiw-reset-text {
    font-size: 10px;
  }

  .dm-mobile-root {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-height: 250px;
    padding: 12px;
    overflow: hidden;
    border-radius: inherit;
    background:
      radial-gradient(circle at 20% 16%, rgba(96,165,250,0.16), transparent 32%),
      radial-gradient(circle at 78% 28%, rgba(167,139,250,0.14), transparent 30%),
      radial-gradient(circle at 50% 82%, rgba(52,211,153,0.12), transparent 36%),
      linear-gradient(145deg, #09090b 0%, #101016 54%, #0a0a0d 100%);
    font-family: 'Geist', sans-serif;
  }

  .dm-mobile-root::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(167,139,250,0.028) 1px, transparent 1px),
      linear-gradient(90deg, rgba(167,139,250,0.022) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
    mask-image: radial-gradient(circle at center, #000 0%, transparent 86%);
  }

  .dm-mobile-glow {
    position: absolute;
    left: 50%;
    top: 47%;
    width: 190px;
    height: 190px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: conic-gradient(from 90deg, rgba(96,165,250,0.18), rgba(167,139,250,0.08), rgba(52,211,153,0.16), rgba(96,165,250,0.18));
    filter: blur(28px);
    opacity: 0.78;
    animation: dmmGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
  }

  @keyframes dmmGlow {
    from { transform: translate(-51%, -49%) rotate(-12deg) scale(0.92); opacity: 0.54; }
    to { transform: translate(-49%, -51%) rotate(14deg) scale(1.08); opacity: 0.84; }
  }

  .dm-mobile-header {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
  }

  .dm-mobile-header > div > span {
    display: block;
    margin-bottom: 3px;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .dm-mobile-header strong {
    display: block;
    max-width: 190px;
    color: #fafafa;
    font-size: 13px;
    line-height: 1.15;
    letter-spacing: -0.02em;
  }

  .dm-mobile-run {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 9px;
    border: 1px solid rgba(167,139,250,0.28);
    border-radius: 999px;
    color: #c4b5fd;
    background: rgba(167,139,250,0.08);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
  }

  .dm-mobile-run .material-symbols-outlined {
    display: inline-block;
    margin: 0;
    color: inherit;
    font-size: 13px;
    font-variation-settings: 'FILL' 1;
  }

  .dm-mobile-run:active {
    transform: scale(0.96);
  }

  .dm-mobile-orbit {
    position: relative;
    z-index: 2;
    width: 132px;
    height: 94px;
    margin: 5px auto 4px;
  }

  .dm-mobile-orbit::before,
  .dm-mobile-orbit::after {
    content: "";
    position: absolute;
    inset: 11px 18px;
    border: 1px solid rgba(167,139,250,0.12);
    border-radius: 50%;
  }

  .dm-mobile-orbit::after {
    inset: 20px 30px;
    border-color: rgba(52,211,153,0.1);
    transform: rotate(-18deg);
  }

  .dm-mobile-core {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 72px;
    height: 58px;
    padding: 7px;
    border: 1px solid rgba(52,211,153,0.28);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(18,18,25,0.96), rgba(10,18,15,0.94));
    box-shadow: 0 18px 42px -26px rgba(52,211,153,0.7), inset 0 1px 0 rgba(255,255,255,0.04);
    transform: translate(-50%, -50%);
  }

  .dm-mobile-core .material-symbols-outlined {
    color: #34d399;
    font-size: 18px;
    font-variation-settings: 'FILL' 1;
  }

  .dm-mobile-core strong {
    color: #d1fae5;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 0.08em;
  }

  .dm-mobile-core small {
    color: #71717a;
    font-size: 12px;
    line-height: 1;
  }

  .dm-mobile-satellite {
    position: absolute;
    z-index: 3;
    padding: 3px 6px;
    border: 1px solid rgba(63,63,70,0.58);
    border-radius: 999px;
    color: #a1a1aa;
    background: rgba(18,18,25,0.86);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: dmmFloat 3.6s ease-in-out infinite;
  }

  .dm-sat-api { left: 0; top: 19px; color: #93c5fd; }
  .dm-sat-db { right: 2px; top: 19px; color: #6ee7b7; animation-delay: 0.5s; }
  .dm-sat-worker { left: 50%; bottom: 2px; color: #c4b5fd; transform: translateX(-50%); animation-delay: 1s; }

  @keyframes dmmFloat {
    0%, 100% { margin-top: 0; }
    50% { margin-top: -3px; }
  }

  .dm-mobile-rail {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    margin-top: 2px;
  }

  .dm-mobile-rail::before {
    content: "";
    position: absolute;
    left: 10%;
    right: 10%;
    top: 14px;
    height: 1px;
    background: linear-gradient(90deg, rgba(96,165,250,0.24), rgba(167,139,250,0.24), rgba(52,211,153,0.24));
  }

  .dm-mobile-stage {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 3px;
    color: #71717a;
  }

  .dm-mobile-stage i {
    position: relative;
    z-index: 2;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(113,113,122,0.6);
    background: #121215;
    transition: background 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
  }

  .dm-mobile-stage .material-symbols-outlined {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(63,63,70,0.48);
    border-radius: 9px;
    background: rgba(18,18,25,0.78);
    font-size: 15px;
    font-variation-settings: 'FILL' 0;
    transition: color 0.28s ease, border-color 0.28s ease, transform 0.28s cubic-bezier(0.16,1,0.3,1);
  }

  .dm-mobile-stage b {
    color: inherit;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .dm-mobile-stage.is-active {
    color: #c4b5fd;
  }

  .dm-mobile-stage.is-active i {
    border-color: #a78bfa;
    background: #a78bfa;
    box-shadow: 0 0 16px rgba(167,139,250,0.62);
    animation: dmmStagePulse 1s ease-in-out infinite;
  }

  .dm-mobile-stage.is-active .material-symbols-outlined {
    border-color: rgba(167,139,250,0.38);
    color: #c4b5fd;
    transform: translateY(-1px);
  }

  .dm-mobile-stage.is-done {
    color: #6ee7b7;
  }

  .dm-mobile-stage.is-done i {
    border-color: #34d399;
    background: #34d399;
    box-shadow: 0 0 12px rgba(52,211,153,0.32);
  }

  @keyframes dmmStagePulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.35); opacity: 0.65; }
  }

  .dm-mobile-console {
    position: relative;
    z-index: 3;
    margin-top: 8px;
    overflow: hidden;
    border: 1px solid rgba(39,39,42,0.7);
    border-radius: 12px;
    background: rgba(7,7,9,0.84);
  }

  .dm-mobile-console-head {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    border-bottom: 1px solid rgba(39,39,42,0.6);
    background: rgba(18,18,25,0.72);
  }

  .dm-mobile-console-head span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
  }

  .dm-mobile-console-head span:nth-child(1) { background: #ef4444; opacity: 0.45; }
  .dm-mobile-console-head span:nth-child(2) { background: #fbbf24; opacity: 0.45; }
  .dm-mobile-console-head span:nth-child(3) { background: #34d399; opacity: 0.45; }

  .dm-mobile-console-head b {
    margin-left: 4px;
    color: #52525b;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .dm-mobile-console-body {
    min-height: 55px;
    padding: 6px 8px;
  }

  .dm-mobile-log {
    color: #71717a;
    font-family: 'Geist Mono', ui-monospace, monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.28s ease, transform 0.28s cubic-bezier(0.16,1,0.3,1);
  }

  .dm-mobile-log.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .dm-mobile-log-info { color: #60a5fa; }
  .dm-mobile-log-success { color: #34d399; }
  .dm-mobile-log-warn { color: #fbbf24; }

  .dm-mobile-kpis {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 8px;
  }

  .dm-mobile-kpis div {
    padding: 7px 6px;
    border: 1px solid rgba(39,39,42,0.72);
    border-radius: 11px;
    background: rgba(18,18,25,0.6);
    text-align: center;
  }

  .dm-mobile-kpis span {
    display: block;
    color: #f4f4f5;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums;
  }

  .dm-mobile-kpis small {
    display: block;
    margin-top: 4px;
    color: #71717a;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .dm-mobile-services {
    position: relative;
    z-index: 3;
    display: grid;
    gap: 4px;
    margin-top: 7px;
  }

  .dm-mobile-services div {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 8px;
    border: 1px solid rgba(39,39,42,0.55);
    border-radius: 10px;
    background: rgba(18,18,25,0.46);
    transition: border-color 0.28s ease, background 0.28s ease, box-shadow 0.28s ease;
  }

  .dm-mobile-services div.is-pulsing {
    border-color: rgba(52,211,153,0.38);
    background: rgba(52,211,153,0.06);
    box-shadow: 0 0 20px -12px rgba(52,211,153,0.7);
  }

  .dm-mobile-services i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 8px rgba(52,211,153,0.44);
    flex-shrink: 0;
  }

  .dm-mobile-services span {
    color: #a1a1aa;
    font-size: 12px;
    font-weight: 600;
  }

  .dm-mobile-services b {
    margin-left: auto;
    color: #34d399;
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }

  .dm-mobile-root.is-complete .dm-mobile-core {
    animation: dmmComplete 0.9s cubic-bezier(0.16,1,0.3,1);
  }

  @keyframes dmmComplete {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    40% { transform: translate(-50%, -50%) scale(1.08); box-shadow: 0 18px 48px -22px rgba(52,211,153,0.95); }
  }

  .dm-root {
    grid-template-columns: 1fr;
    gap: 3px;
    padding: 3px;
  }

  .dm-panel {
    border-radius: 6px;
    padding: 6px 8px;
    gap: 4px;
  }

  .dm-stage-ring {
    width: 28px;
    height: 28px;
  }

  .dm-stage-icon {
    font-size: 12px;
  }

  .dm-stage-label {
    font-size: 12px;
  }

  .dm-stage-time {
    font-size: 12px;
  }

  .dm-pipe-conn {
    width: 14px;
    padding-top: 5px;
  }

  .dm-pipe-conn-track {
    height: 1.5px;
  }

  .dm-kpi-row {
    gap: 2px;
  }

  .dm-kpi {
    padding: 3px 4px;
    border-radius: 4px;
  }

  .dm-kpi-value {
    font-size: 12px;
  }

  .dm-kpi-label {
    font-size: 12px;
  }

  .dm-kpi-icon {
    font-size: 7px;
    top: 1px;
    right: 2px;
  }

  .dm-title {
    font-size: 12px;
  }

  .dm-badge {
    font-size: 12px;
    padding: 2px 6px;
  }

  .dm-badge-dot {
    width: 4px;
    height: 4px;
  }

  .dm-term-header {
    padding: 2px 6px;
  }

  .dm-term-line {
    font-size: 12px;
    line-height: 1.35;
  }

  .dm-svc-name {
    font-size: 12px;
  }

  .dm-svc-latency {
    font-size: 12px;
  }

  .dm-svc-dot {
    width: 3px;
    height: 3px;
  }

  .dm-svc-row {
    padding: 2px 4px;
  }

  .dm-live-dot {
    width: 5px;
    height: 5px;
  }

  .dm-live-label {
    font-size: 12px;
  }

  .dm-icon {
    font-size: 14px;
  }

  .dm-mobile-glow {
    animation: none !important;
  }

  .dm-mobile-satellite {
    animation: none !important;
  }

  .dm-mobile-stage.is-active i {
    animation: none !important;
  }

  .dm-scanline {
    animation: none !important;
    opacity: 0 !important;
  }

  .dm-pipeline {
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
  }

  .dm-pipeline::-webkit-scrollbar {
    display: none;
  }

  /* Faster DM animation transitions on mobile */
  .dm-stage-ring {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .dm-badge {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Sparkline: allow touch scroll to pass through on mobile */
  .dm-sparkline {
    pointer-events: none;
  }

  /* Ensure sparkline chart container has room to render */
  .dm-chart-wrap {
    min-height: 60px;
    flex: 0 0 auto;
  }

  /* Pipeline: snap to each stage on small screens so they never squish */
  .dm-pipeline {
    scroll-snap-type: x mandatory;
  }

  .dm-stage {
    scroll-snap-align: start;
  }
}
