/* Shared by the light and dark designs: the animated diagrams in cnx/widgets/diagrams/. */
:root {
    --cnx-ink: #12131a;
    --cnx-muted: #5d6170;
    --cnx-line: #e6e4f0;
    --cnx-soft: #f6f4fd;
    --cnx-purple: #8169f1;
    --cnx-deep: #501e9c;
    --cnx-grad: linear-gradient(to right, #501e9c 0%, #8169f1 30%, #a44cee 73%, #ff847f 100%);
}
/* ===== Diagrams (cnx/widgets/diagrams/*.php) ===== */
.cnx-dg-wrap { background: #fff; border: 1px solid var(--cnx-line); border-radius: 26px; padding: 24px; box-shadow: 0 24px 60px rgba(80,30,156,.07); }
.cnx-dg { width: 100%; height: auto; display: block; font-family: Inter, sans-serif; }
.cnx-dg text { font-size: 15px; fill: var(--cnx-ink); }
.cnx-dg .h { font-size: 12px; font-weight: 800; letter-spacing: 1.5px; fill: var(--cnx-purple); }
.cnx-dg .b { font-weight: 700; }
.cnx-dg .m { fill: var(--cnx-muted); font-size: 13.5px; }
.cnx-dg .w { fill: #fff; }
.cnx-dg .s { font-size: 12.5px; }
.cnx-dg .xs { font-size: 10.5px; }
.cnx-dg .r { fill: #e5484d; font-weight: 700; }
.cnx-dg .ln { fill: none; stroke: #b9adf7; stroke-width: 2.5; }
.cnx-dg .dashed { stroke-dasharray: 6 7; animation: cnx-dash 1.4s linear infinite; }
.cnx-dg .revise { stroke: #ff847f; stroke-dasharray: 6 6; animation: cnx-dash 1.2s linear infinite; }
.cnx-dg .beam { stroke: #8169f1; stroke-width: 3; stroke-dasharray: 8 6; animation: cnx-dash 1s linear infinite; }
.cnx-dg .road { fill: none; stroke: #e6e4f0; stroke-width: 14; stroke-linecap: round; stroke-linejoin: round; }
.cnx-dg .steps text { font-size: 12px; font-weight: 700; fill: var(--cnx-purple); }
@keyframes cnx-dash { to { stroke-dashoffset: -26; } }
@keyframes cnx-blink { 0%, 100% { opacity: 0; transform: translateY(6px); } 15%, 60% { opacity: 1; transform: none; } 75% { opacity: 0; } }
@keyframes cnx-beat { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
@keyframes cnx-spin { to { transform: rotate(360deg); } }
@keyframes cnx-grow { 0% { transform: scaleY(.15); } 50%, 100% { transform: scaleY(1); } }
@keyframes cnx-growx { 0% { transform: scaleX(.1); } 45%, 100% { transform: scaleX(1); } }
/* Shopnix */
.sx-pop, .sx-bubble { animation: cnx-blink 7s infinite; transform-box: fill-box; }
.sx-pop { animation-delay: 2.2s; } .sx-bubble { animation-delay: 3.6s; }
.sx-ping { animation: cnx-beat 1.6s infinite; transform-box: fill-box; transform-origin: center; }
/* Mynix */
.mx-move { animation: mx-move 9s ease-in-out infinite; }
@keyframes mx-move { 0%, 8% { transform: translate(0, 0); opacity: 0; } 12%, 24% { transform: translate(0, 0); opacity: 1; } 32%, 46% { transform: translate(160px, 0); } 54%, 68% { transform: translate(320px, 0); } 76%, 92% { transform: translate(480px, 0); opacity: 1; } 100% { transform: translate(480px, 0); opacity: 0; } }
.mx-submit { animation: cnx-beat 9s infinite; transform-box: fill-box; transform-origin: center; }
.mx-sla { stroke-dashoffset: 0; animation: mx-sla 9s linear infinite; }
@keyframes mx-sla { 0%, 30% { stroke-dashoffset: 0; } 46% { stroke-dashoffset: 46; } 100% { stroke-dashoffset: 46; } }
.mx-bar { transform-box: fill-box; transform-origin: bottom; animation: cnx-grow 4.5s ease-out infinite; animation-delay: var(--d); }
.mx-donut { stroke-dashoffset: 163; animation: mx-donut 4.5s ease-out infinite; }
@keyframes mx-donut { 0% { stroke-dashoffset: 163; } 50%, 100% { stroke-dashoffset: 22; } }
/* Bugasura */
.bg-vec circle { fill: #8169f1; animation: bg-twinkle 2.4s infinite; }
.bg-vec circle:nth-child(2n) { animation-delay: .6s; fill: #ff847f; } .bg-vec circle:nth-child(3n) { animation-delay: 1.2s; }
@keyframes bg-twinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.bg-fan { animation: cnx-spin 1.2s linear infinite; transform-box: fill-box; transform-origin: center; }
.bg-orbit { animation: cnx-spin 12s linear infinite; }
.bg-orbit > g > * { animation: cnx-spin 12s linear infinite reverse; transform-box: fill-box; transform-origin: center; }
.bg-load { transform-box: fill-box; transform-origin: left; animation: bg-load 2s ease-in-out infinite; }
@keyframes bg-load { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(42px); } }
.bg-out { animation: cnx-blink 3.5s infinite; animation-delay: var(--d, 0s); }
.bg-chunks rect { animation: bg-twinkle 1.8s infinite; } .bg-chunks rect:nth-child(2n) { animation-delay: .5s; }
/* Autocon */
.ac-node rect { animation: ac-glow 9s infinite; animation-delay: var(--d); }
@keyframes ac-glow { 0%, 100% { stroke: #e6e4f0; } 3%, 12% { stroke: #8169f1; stroke-width: 3; } 16% { stroke: #e6e4f0; stroke-width: 1; } }
.ac-rule { animation: cnx-blink 9s infinite; animation-delay: 7.2s; }
.ac-swap-a { animation: ac-swap 8s infinite; } .ac-swap-b { animation: ac-swap 8s infinite reverse; }
@keyframes ac-swap { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0; } 100% { opacity: 1; } }
/* Hirenix */
.hx-spark { animation: cnx-spin 4s linear infinite; transform-box: fill-box; transform-origin: center; }
.hx-tile rect { animation: hx-tile 4s infinite; animation-delay: var(--d); }
@keyframes hx-tile { 0%, 100% { fill: #efe9ff; } 10%, 25% { fill: #d9d2fb; } }
.hx-bar { transform-box: fill-box; transform-origin: left; animation: cnx-growx 5s ease-out infinite; animation-delay: var(--d); }

.bg-model { opacity: 0; animation: bg-model 9s infinite; }
.bg-m2 { animation-delay: 3s; } .bg-m3 { animation-delay: 6s; }
@keyframes bg-model { 0% { opacity: 0; } 4%, 30% { opacity: 1; } 34%, 100% { opacity: 0; } }

/* Moofu */
.mf-edges path { stroke-dasharray: 120; stroke-dashoffset: 120; animation: mf-draw 6s ease-out infinite; }
@keyframes mf-draw { 0% { stroke-dashoffset: 120; } 40%, 100% { stroke-dashoffset: 0; } }
.mf-cells rect { fill: #f6f4fd; animation: mf-cell 6s infinite; animation-delay: var(--d); }
.mf-good { --on: #22a06b; } .mf-bad { --on: #e5484d; }
@keyframes mf-cell { 0%, 8% { fill: #f6f4fd; } 14%, 90% { fill: var(--on); } 100% { fill: #f6f4fd; } }
.mf-ans { transform-box: fill-box; transform-origin: left; animation: cnx-growx 4s ease-out infinite; animation-delay: var(--d); }
.mf-ok { animation: cnx-blink 6s infinite; animation-delay: 1s; }

@media (prefers-reduced-motion: reduce) { .cnx-dg * { animation: none !important; } }

/* Moofu: minesweeper board */
.mf-cell rect { fill: #8169f1; stroke: #6c55e6; animation: mf-reveal 7s infinite; animation-delay: var(--d); }
.mf-cell text { fill: #fff; font-size: 10.5px; font-weight: 600; animation: mf-label 7s infinite; animation-delay: var(--d); }
.mf-cell .mf-tick, .mf-cell .mf-flag { opacity: 0; animation: mf-mark 7s infinite; animation-delay: var(--d); }
.mf-bug rect { animation-name: mf-reveal-bug; }
@keyframes mf-reveal { 0%, 6% { fill: #8169f1; stroke: #6c55e6; } 10%, 92% { fill: #fff; stroke: #e1dbfb; } 100% { fill: #8169f1; stroke: #6c55e6; } }
@keyframes mf-reveal-bug { 0%, 6% { fill: #8169f1; stroke: #6c55e6; } 10%, 92% { fill: #ffe9e7; stroke: #f5b5ad; } 100% { fill: #8169f1; stroke: #6c55e6; } }
@keyframes mf-label { 0%, 6% { fill: #fff; } 10%, 92% { fill: #5d6170; } 100% { fill: #fff; } }
@keyframes mf-mark { 0%, 8% { opacity: 0; } 12%, 92% { opacity: 1; } 100% { opacity: 0; } }
.mf-cov { transform-box: fill-box; transform-origin: left; animation: mf-cov 7s linear infinite; }
@keyframes mf-cov { 0% { transform: scaleX(.05); } 85%, 100% { transform: scaleX(1); } }
