/* ===== NEURONS: node canvas (tools/11-neurons.js) ===== */
main.neuron-canvas{max-width:none;margin:0;padding:0;position:relative;min-height:100vh}
.neuron-layer{position:relative}
.neuron-links{position:absolute;left:0;top:0;pointer-events:none;z-index:0;overflow:visible}


/* Each neuron's window */
.neuron-node{
  position:absolute;display:none;flex-direction:column;box-sizing:border-box;
  background:var(--bg);border:1px solid var(--border);border-radius:14px;
  box-shadow:0 10px 30px rgba(0,0,0,.35);overflow:hidden;
}
.neuron-node.open{display:flex}
.neuron-node.focused{border-color:color-mix(in srgb, var(--accent) 60%, var(--border));box-shadow:0 14px 40px rgba(0,0,0,.45),0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent)}
.neuron-node.moving{opacity:.92;box-shadow:0 20px 50px rgba(0,0,0,.55)}
.neuron-head{
  display:flex;align-items:center;gap:.6rem;flex-shrink:0;height:40px;padding:0 .4rem 0 .8rem;
  background:var(--card);border-bottom:1px solid var(--border);cursor:grab;user-select:none;touch-action:none;
}
.neuron-node.moving .neuron-head{cursor:grabbing}
.neuron-title{flex:1;font-family:'Tallhaus','Anton',sans-serif;font-weight:700;letter-spacing:.6px;font-size:.9rem;color:var(--text)}
.neuron-port{width:10px;height:10px;border-radius:50%;border:2px solid var(--muted);box-sizing:border-box;flex-shrink:0}
.neuron-port.linked{border-color:var(--accent);background:var(--accent);box-shadow:0 0 8px var(--accent)}
.neuron-btn{width:28px;height:28px;border-radius:50%;border:none;background:transparent;color:var(--muted);cursor:pointer;font-size:.85rem}
.neuron-btn:hover{background:color-mix(in srgb, var(--danger) 18%, transparent);color:var(--danger)}
.neuron-body.section{display:block;flex:1;min-height:0;overflow:auto;padding:1rem;container-type:inline-size}
.neuron-resize{
  position:absolute;right:0;bottom:0;width:18px;height:18px;cursor:nwse-resize;touch-action:none;
  background:linear-gradient(135deg, transparent 50%, var(--border) 50%, var(--border) 60%, transparent 60%, transparent 70%, var(--border) 70%, var(--border) 80%, transparent 80%);
}
.neuron-resize:hover{background-color:color-mix(in srgb, var(--accent) 15%, transparent)}
body.neuron-dragging{user-select:none;cursor:grabbing}
body.neuron-dragging iframe{pointer-events:none}

/* Lines between neurons that share data */
.nl-glow{fill:none;stroke:var(--accent);stroke-width:8;opacity:.12}
.nl-line{fill:none;stroke:var(--accent);stroke-width:2;stroke-dasharray:6 8;animation:nlFlow 1.2s linear infinite;opacity:.85}
.nl-end{fill:var(--accent)}
@keyframes nlFlow{to{stroke-dashoffset:-28}}

/* Narrow screens: one neuron below the other */
@media (max-width:760px){
  main.neuron-canvas{padding:.6rem}
  .neuron-layer{display:flex;flex-direction:column;gap:.8rem}
  .neuron-node{position:relative;left:auto !important;top:auto !important;width:auto !important;height:auto !important;z-index:auto !important}
  .neuron-head{cursor:default}
  .neuron-body.section{overflow:visible}
  .neuron-resize,.neuron-links{display:none}
}

/* Tasks inside a narrow window: button bars wrap instead of overflowing */
.neuron-body .sub-tabs,.neuron-body .view-btns{flex-wrap:wrap}


/* Window buttons: minimize · maximize/restore · close */
.neuron-btn.win{font-size:.8rem;line-height:1;opacity:.75}
.neuron-btn.win:hover{opacity:1}
.neuron-node.minimized{display:none !important}
.neuron-tray{position:fixed;left:12px;bottom:1.4rem;z-index:115;display:flex;gap:.35rem;flex-wrap:wrap;max-width:calc(50vw - 60px)}
.neuron-tray button{display:flex;align-items:center;gap:.35rem;background:var(--card);border:1px solid var(--border);color:var(--text);border-radius:999px;padding:.4rem .7rem;font-size:.72rem;font-weight:800;cursor:pointer;box-shadow:0 6px 18px -8px rgba(0,0,0,.6)}
.neuron-tray button:hover{border-color:var(--accent)}
.neuron-tray .nav-ic{width:15px;height:15px}
body.has-dock .neuron-tray{bottom:calc(1rem + 70px)}
@media (max-width: 760px){ .neuron-tray{bottom:6rem;max-width:calc(100vw - 24px)} .neuron-btn.win.max{display:none} }
.neuron-btn.win:hover{background:color-mix(in srgb, var(--text) 12%, transparent) !important;color:var(--text) !important}
@media (max-width: 760px){ body.has-tray #main{padding-bottom:4rem} }

/* ===== The core (center of the canvas, in the page color) ===== */
.neuron-core{position:absolute;width:64px;height:64px;margin:-32px 0 0 -32px;border-radius:50%;border:none;padding:0;cursor:pointer;z-index:0;
  background:radial-gradient(circle at 35% 30%, color-mix(in srgb, #fff 70%, var(--accent)) 0 8%, var(--accent) 30%, color-mix(in srgb, var(--accent) 65%, #000) 100%);
  box-shadow:0 0 18px 4px color-mix(in srgb, var(--accent) 55%, transparent), 0 0 60px 18px color-mix(in srgb, var(--accent) 22%, transparent);
  animation:coreBreath 4s ease-in-out infinite;transition:transform .2s}
.neuron-core:hover{transform:scale(1.08)}
.neuron-core i{position:absolute;inset:-18px;border-radius:50%;border:1px dashed color-mix(in srgb, var(--accent) 40%, transparent);animation:coreSpin 24s linear infinite;pointer-events:none}
@keyframes coreBreath{50%{box-shadow:0 0 26px 8px color-mix(in srgb, var(--accent) 65%, transparent), 0 0 80px 26px color-mix(in srgb, var(--accent) 28%, transparent)}}
@keyframes coreSpin{to{transform:rotate(360deg)}}
/* Core lines bright; neuron-to-neuron lines softer so the picture stays clean */
.nl-line.core{stroke-dasharray:2 7;opacity:.85}
.nl-glow.core{stroke-width:6;opacity:.14}
.nl-line:not(.core){opacity:.35}
.nl-glow:not(.core){opacity:.05}

@media (prefers-reduced-motion: reduce){ .neuron-core,.neuron-core i{animation:none} }
/* Nervous system: nerves around the core (they slowly pulse) and forks at the end of each nerve */
.neuron-core{overflow:visible}
.neuron-core .core-nerves{position:absolute;left:50%;top:50%;width:220px;height:220px;margin:-110px 0 0 -110px;pointer-events:none;opacity:.65;animation:coreSpin 90s linear infinite}
.neuron-core i{display:none}
.nl-fork{fill:none;stroke:var(--accent);stroke-width:1.4;opacity:.55;stroke-linecap:round}
.nl-line.core{stroke-dasharray:1 9;stroke-width:2.2;stroke-linecap:round;opacity:.9}
.nl-glow.core{stroke-width:7;opacity:.12}
.neuron-core .core-nerves path{stroke-width:1}.neuron-core .core-nerves circle{transform-box:fill-box;transform-origin:center;transform:scale(.75)}
/* Dendrite connections: a solid nerve with a traveling pulse, twigs with tips */
.nl-nerve{fill:none;stroke:var(--accent);stroke-width:2;opacity:.45;stroke-linecap:round}
.nl-line.core{stroke-dasharray:3 14;stroke-width:3;opacity:.95}
.nl-tip{fill:var(--accent);opacity:.7}
.nl-fork{stroke-width:1.5;opacity:.6}
/* When neurons are connected, the resting dendrites around the orb fade: the real ones take over */
.neuron-core .core-nerves{transition:opacity .4s}
.neuron-core.connected .core-nerves{opacity:.18}

/* The core moves away from windows (smoothly); with nowhere free it floats at the bottom center, above everything */
.neuron-core{transition:transform .2s}   /* moves instantly so the connections stay glued to its center */
.neuron-core.floating{position:fixed;left:50% !important;top:auto !important;bottom:1.1rem;width:56px;height:56px;margin:0 0 0 -28px;z-index:125}
.neuron-core.floating .core-nerves{width:150px;height:150px}
body.has-dock .neuron-core.floating{bottom:calc(1rem + 70px)}
/* First visit: a bubble that says "tap here" */
.core-hint{position:absolute;left:50%;bottom:calc(100% + 34px);transform:translateX(-50%);white-space:nowrap;pointer-events:none;
  background:var(--accent);color:#0b0f14;font-weight:900;font-size:.82rem;padding:.5rem .85rem;border-radius:12px;
  box-shadow:0 8px 24px -6px color-mix(in srgb, var(--accent) 70%, transparent);animation:coreHint 1.6s ease-in-out infinite;z-index:3}
.core-hint::after{content:'';position:absolute;left:50%;top:100%;margin-left:-7px;border:7px solid transparent;border-top-color:var(--accent)}
.neuron-core.hinting::before{content:'';position:absolute;inset:-10px;border-radius:50%;border:3px solid var(--accent);animation:coreRing 1.6s ease-out infinite;pointer-events:none}
@keyframes coreHint{50%{transform:translateX(-50%) translateY(-6px)}}
@keyframes coreRing{from{transform:scale(.8);opacity:1}to{transform:scale(1.8);opacity:0}}
@media (prefers-reduced-motion: reduce){ .core-hint,.neuron-core.hinting::before{animation:none} }
.neuron-core.hinting{z-index:9000}

/* On reload the core appears directly in its place (no slide from the corner) */
.neuron-core:not(.placed){transition:none;opacity:0}
.neuron-core.placed{animation-name:coreBreath, coreIn;animation-duration:4s, .35s;animation-timing-function:ease-in-out, ease-out;animation-iteration-count:infinite, 1}
@keyframes coreIn{from{opacity:0}to{opacity:1}}
#neuronLinks{transition:opacity .3s}
body:not(.core-ready) #neuronLinks{opacity:0}

/* Seamless pulses: the dash offset moves exactly a whole number of dash periods per loop (no jump when it restarts) */
.nl-line.core{animation:nlFlowCore 1.2s linear infinite}
@keyframes nlFlowCore{to{stroke-dashoffset:-34}}          /* 3 + 14 = 17, ×2 */
.nl-line.flow{stroke-dasharray:4 10;stroke-width:2;opacity:.7;animation:nlFlowIO 1.4s linear infinite;stroke-linecap:round}
@keyframes nlFlowIO{to{stroke-dashoffset:-28}}            /* 4 + 10 = 14, ×2 */
.nl-glow.flow{stroke-width:5;opacity:.07}
/* The brain stays still; little dots orbit around it */
.neuron-core .core-nerves{animation:none}
.core-orbit{position:absolute;left:50%;top:50%;border-radius:50%;pointer-events:none;animation:coreSpin linear infinite}
.core-orbit.o1{width:96px;height:96px;margin:-48px;animation-duration:7s}
.core-orbit.o2{width:140px;height:140px;margin:-70px;animation-duration:13s;animation-direction:reverse}
.core-orbit.o3{width:190px;height:190px;margin:-95px;animation-duration:21s;opacity:.7}
.core-orbit b{position:absolute;left:50%;top:-3px;width:6px;height:6px;margin-left:-3px;border-radius:50%;background:var(--accent);box-shadow:0 0 8px var(--accent)}
.core-orbit b:nth-child(2){top:auto;bottom:-3px;width:4px;height:4px;margin-left:-2px}
.core-orbit b:nth-child(3){top:50%;left:-3px;margin:-2px 0 0;width:4px;height:4px}
.neuron-core.floating .core-orbit.o3{display:none}
@media (prefers-reduced-motion: reduce){ .core-orbit,.nl-line{animation:none} }

/* ===== Windows that scale: everything inside reflows with the WINDOW width (container queries), not the screen ===== */
.neuron-body img, .neuron-body svg.px{max-width:100%}
.neuron-node.at-min .neuron-resize{background:linear-gradient(135deg, transparent 50%, #f59e0b 50%)}
@container (max-width: 440px){
  .neuron-body .fin-cards{grid-template-columns:1fr 1fr} .neuron-body .fin-card.bal{grid-column:1 / -1} .neuron-body .fin-row{flex-wrap:wrap}
  .neuron-body .wd-card{grid-template-columns:1fr;justify-items:center;text-align:center} .neuron-body .wd-card-info{align-items:center} .neuron-body .wd-member{align-self:center}
  .neuron-body .gd-cards{grid-template-columns:1fr}
}
@container (min-width: 640px){
  .neuron-body .gd-log{font-size:.95rem}
  .neuron-body .bt-party{grid-template-columns:1fr 1fr}
}
/* Focus scales with its window */
.neuron-body .fz-dial{width:clamp(150px, 62cqw, 300px)}
.neuron-body .fz-time{font-size:clamp(2.2rem, 15cqw, 4.6rem)}
@container (min-width: 560px){ .neuron-body .fz{max-width:560px} .neuron-body .fz-play{width:84px;height:84px} }
.neuron-body .fz-step b{white-space:nowrap}
@container (max-width: 360px){ .neuron-body .fz-step{gap:.3rem} .neuron-body .fz-step button{width:26px;height:26px} .neuron-body .fz-step b{font-size:1.15rem;min-width:0} .neuron-body .fz-durs{gap:.35rem} }
@container (max-width: 400px){ .neuron-body .tk-range{flex-wrap:nowrap} .neuron-body .tk-range-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} }

/* Battle on a wide window: arena + party on the left, the rest on the right, so everything is visible at once */
@container (min-width: 820px){
  .neuron-body .bt{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);column-gap:1rem;grid-auto-flow:row dense;align-items:start}
  .neuron-body .bt > .bt-top, .neuron-body .bt > .bt-opt{grid-column:1 / -1}
  .neuron-body .bt > .bt-arena{grid-column:1;grid-row:2 / span 3}
  .neuron-body .bt > .bt-party{grid-column:1;grid-row:5 / span 2}
  .neuron-body .bt > .bt-block{grid-column:2}
}

/* Fractal dendrites: thinner and fainter at every split */
.nl-frac{fill:none;stroke:var(--accent);stroke-linecap:round}
.nl-frac.f0{stroke-width:1.7;opacity:.6}
.nl-frac.f1{stroke-width:1.15;opacity:.45}
.nl-frac.f2{stroke-width:.8;opacity:.33}
.nl-frac.f3{stroke-width:.5;opacity:.22}
.nl-tip{opacity:.5}
/* The fractal brain around the core replaces the old drawing; it breathes slowly */
.neuron-core .core-nerves{display:none}
.core-frac{position:absolute;left:50%;top:50%;width:230px;height:230px;margin:-115px 0 0 -115px;pointer-events:none;animation:coreFracBreath 7s ease-in-out infinite}
.core-frac svg{width:100%;height:100%;overflow:visible}
.core-frac path{fill:none;stroke:var(--accent);stroke-linecap:round}
.core-frac .cf0{stroke-width:1.8;opacity:.75}.core-frac .cf1{stroke-width:1.3;opacity:.6}.core-frac .cf2{stroke-width:.9;opacity:.45}
.core-frac .cf3{stroke-width:.6;opacity:.32}.core-frac .cf4{stroke-width:.4;opacity:.22}
.core-frac .cf-dots{fill:var(--accent);opacity:.6}
.neuron-core.connected .core-frac{opacity:.55}
.neuron-core.floating .core-frac{width:160px;height:160px;margin:-80px 0 0 -80px}
@keyframes coreFracBreath{50%{transform:scale(1.04)}}
@media (prefers-reduced-motion: reduce){ .core-frac{animation:none} }

/* ===== The flower (tools/27-flower.js): the orb blooms into a random snowflake ===== */
/* Closed = only the orb (the logo). Each level of branches draws itself out from the orb, one after another,
   and folds back in reverse when it closes. */
.core-frac{animation:none;transition:width .7s cubic-bezier(.2,.8,.2,1),height .7s cubic-bezier(.2,.8,.2,1),margin .7s cubic-bezier(.2,.8,.2,1)}
.core-frac .fl{fill:none;stroke:var(--accent);stroke-linecap:round;stroke-dasharray:1 1;stroke-dashoffset:1;
  transition:stroke-dashoffset .45s cubic-bezier(.3,.7,.3,1);transition-delay:calc((4 - var(--i)) * 60ms)}
.core-frac.open .fl{stroke-dashoffset:0;transition-duration:.55s;transition-delay:calc(var(--i) * 140ms)}
.core-frac .fl0{stroke-width:1.9;opacity:.8}.core-frac .fl1{stroke-width:1.4;opacity:.65}.core-frac .fl2{stroke-width:1;opacity:.5}
.core-frac .fl3{stroke-width:.7;opacity:.38}.core-frac .fl4,.core-frac .fl5{stroke-width:.5;opacity:.28}
.core-frac .fl-dots{fill:var(--accent);opacity:0;transition:opacity .3s}
.core-frac.open .fl-dots{opacity:.65;transition:opacity .4s .55s}
/* Electric pulses running out along the branches */
.core-frac .fl-zap{fill:none;stroke:#fff;stroke-linecap:round;stroke-width:1.4;stroke-dasharray:.035 .965;stroke-dashoffset:1;opacity:0;
  filter:drop-shadow(0 0 2px var(--accent))}
.core-frac.open .fl-zap{opacity:.75;animation:flZap 1.8s linear infinite;animation-delay:calc(var(--i) * .35s + .6s)}
@keyframes flZap{to{stroke-dashoffset:0}}
/* Spider-web threads and rays: only in the big bloom */
.core-frac .fl-web{opacity:0;transition:opacity .4s}
.core-frac .fl-thread,.core-frac .fl-ray{fill:none;stroke:var(--accent);stroke-width:.45;stroke-dasharray:1 1;stroke-dashoffset:1;opacity:.45;transition:stroke-dashoffset .9s ease .5s}
.core-frac .fl-ray{stroke-width:.35;opacity:.35}
.core-frac .fl-zap.web{stroke-width:.8;stroke-dasharray:.02 .18}
.neuron-core.bloom-big .core-frac{width:560px;height:560px;margin:-280px 0 0 -280px}
.neuron-core.bloom-big .core-frac .fl-web{opacity:1}
.neuron-core.bloom-big .core-frac.open .fl-thread,.neuron-core.bloom-big .core-frac.open .fl-ray{stroke-dashoffset:0}
.neuron-core.bloom-big .core-frac.open .fl-zap.web{animation-duration:6s}
.neuron-core.bloom-big .core-orbit{opacity:.35}
/* Connected windows: the flower stays open but softer, so the windows stay the focus */
.neuron-core.connected .core-frac{opacity:.6}
.neuron-core.dragging{cursor:grabbing;transform:scale(1.12);transition:none}
.neuron-core.dragging .core-frac{opacity:.9}
@media (prefers-reduced-motion: reduce){
  .core-frac,.core-frac .fl{transition:none}
  .core-frac.open .fl-zap{animation:none;opacity:0}
}

/* Electricity through the little arms (11-neurons.js): sparks run from the nerve out to every tip, and the flows
   between neurons jump from the tip of one arm to the tip of another, with a glowing synapse at each end */
.nl-zap{fill:none;stroke:#fff;stroke-linecap:round;pointer-events:none;filter:drop-shadow(0 0 2px var(--accent)) drop-shadow(0 0 4px var(--accent))}
.nl-zap.z0{stroke-width:1.6;stroke-dasharray:2 22;animation:nlZap 1.6s linear infinite;opacity:.75}
.nl-zap.z1{stroke-width:1.2;stroke-dasharray:1.6 18;animation:nlZap 1.3s linear infinite .2s;opacity:.6}
.nl-zap.z2{stroke-width:.9;stroke-dasharray:1.2 14;animation:nlZap 1.1s linear infinite .4s;opacity:.5}
.nl-zap.z3{stroke-width:.7;stroke-dasharray:1 10;animation:nlZap .9s linear infinite .6s;opacity:.4}
@keyframes nlZap{from{stroke-dashoffset:48}to{stroke-dashoffset:0}}
.nl-zap.bolt{stroke-width:2.2;stroke-dasharray:3 60;animation:nlBolt 2.2s linear infinite;opacity:.9}
@keyframes nlBolt{from{stroke-dashoffset:63}to{stroke-dashoffset:-63}}
.nl-syn{fill:var(--accent);filter:drop-shadow(0 0 4px var(--accent));animation:nlSyn 2.2s ease-in-out infinite}
@keyframes nlSyn{50%{r:4.5;opacity:.6}}
@media (prefers-reduced-motion: reduce){ .nl-zap,.nl-syn{animation:none} .nl-zap{opacity:0} }
/* Pixel-art flower (canvas): crisp pixels with a bloom of light, HD-2D style */
.core-frac canvas.fl-px{width:100%;height:100%;display:block;image-rendering:pixelated;image-rendering:crisp-edges;
  filter:drop-shadow(0 0 2px color-mix(in srgb, var(--accent) 80%, transparent)) drop-shadow(0 0 9px color-mix(in srgb, var(--accent) 45%, transparent))}

/* ---------- The orb: a glowing neon sphere ---------- */
/* dark glassy inside, a bright neon rim, an inner glow, a light reflection on top, and a glow that breathes */
.neuron-core{
  background:
    radial-gradient(circle at 36% 27%, rgba(255,255,255,.95) 0 3.5%, rgba(255,255,255,.35) 8%, transparent 17%),
    radial-gradient(circle at 64% 76%, color-mix(in srgb, var(--accent) 55%, #fff) 0 2%, transparent 12%),
    radial-gradient(circle at 50% 50%,
      color-mix(in srgb, var(--accent) 42%, #06100a) 0 30%,
      color-mix(in srgb, var(--accent) 34%, #050806) 50%,
      color-mix(in srgb, var(--accent) 62%, #050806) 70%,
      var(--accent) 84%,
      color-mix(in srgb, var(--accent) 35%, #fff) 91%,
      var(--accent) 96%,
      color-mix(in srgb, var(--accent) 60%, transparent) 100%);
  box-shadow:
    0 0 4px 1px color-mix(in srgb, var(--accent) 90%, #fff),
    0 0 16px 4px var(--accent),
    0 0 46px 14px color-mix(in srgb, var(--accent) 55%, transparent),
    0 0 110px 36px color-mix(in srgb, var(--accent) 22%, transparent),
    inset 0 0 10px 2px var(--accent),
    inset 0 0 26px 8px color-mix(in srgb, var(--accent) 40%, transparent);
}
.neuron-core.placed{animation-name:coreBreath, coreIn, coreNeon;animation-duration:4s, .35s, 2.8s;animation-timing-function:ease-in-out, ease-out, ease-in-out;animation-iteration-count:infinite, 1, infinite}
@keyframes coreNeon{
  0%,100%{filter:brightness(1) saturate(1.1)}
  45%{filter:brightness(1.22) saturate(1.35)}
  52%{filter:brightness(1.05) saturate(1.2)}
  58%{filter:brightness(1.28) saturate(1.4)}
}
/* a thin neon ring that glows around the sphere */
.neuron-core .core-frac{border-radius:50%}
.neuron-core::after{content:'';position:absolute;inset:-7px;border-radius:50%;pointer-events:none;
  border:1.5px solid color-mix(in srgb, var(--accent) 70%, #fff);opacity:.55;
  box-shadow:0 0 10px var(--accent), inset 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent);animation:coreRingNeon 3.6s ease-in-out infinite}
@keyframes coreRingNeon{0%,100%{transform:scale(1);opacity:.5}50%{transform:scale(1.12);opacity:.15}}
.neuron-core[data-badge]::after{animation:none;opacity:1;border:none;inset:auto;box-shadow:none}
body.theme-light .neuron-core{box-shadow:
    0 0 4px 1px var(--accent), 0 0 16px 4px color-mix(in srgb, var(--accent) 80%, transparent),
    0 0 46px 12px color-mix(in srgb, var(--accent) 40%, transparent), inset 0 0 10px 2px var(--accent),
    inset 0 0 26px 8px color-mix(in srgb, var(--accent) 40%, transparent)}
@media (prefers-reduced-motion: reduce){ .neuron-core.placed{animation:none} .neuron-core::after{animation:none} }
/* the orb turns slowly (its figure turns with it, anchored in the middle: tools/27-flower.js) */
.neuron-core .orb-turn{position:absolute;inset:8%;border-radius:50%;pointer-events:none;z-index:0;
  background:repeating-conic-gradient(from 0deg, rgba(255,255,255,.13) 0deg 6deg, transparent 6deg 45deg);
  -webkit-mask:radial-gradient(circle, transparent 18%, #000 40%, #000 62%, transparent 74%);mask:radial-gradient(circle, transparent 18%, #000 40%, #000 62%, transparent 74%);
  mix-blend-mode:screen;animation:coreSpin 60s linear infinite}
@media (prefers-reduced-motion: reduce){ .neuron-core .orb-turn{animation:none} }

/* ===== Lightning links: every connection is an electric bolt (tools/11-neurons.js nlJag) ===== */
.nl-nerve,.nl-glow,.nl-line,.nl-frac,.nl-zap,.nl-bolt{stroke-linejoin:miter;stroke-miterlimit:3}
.nl-nerve{stroke:color-mix(in srgb,var(--accent) 80%,#fff);stroke-width:1.6;opacity:.6}
.nl-glow.core{stroke-width:9;opacity:.1;filter:blur(3px)}
/* the strikes: three bolts per line that flash one after another (white core, colored glow) */
.nl-bolt{fill:none;stroke:#fff;stroke-width:1.8;stroke-linecap:round;opacity:0;pointer-events:none;
  filter:drop-shadow(0 0 4px var(--accent));
  animation:nlStrike 2.7s linear infinite}
.nl-bolt.v1{animation-duration:3.1s;stroke-width:1.4}
.nl-bolt.v2{animation-duration:3.7s;stroke-width:1.1}
.nl-bolt.flow{stroke-width:1.2;animation-duration:2.3s}
@keyframes nlStrike{0%{opacity:0}1%{opacity:1}3%{opacity:.25}5%{opacity:.95}8%{opacity:.4}11%{opacity:0}100%{opacity:0}}
@keyframes nlHum{0%,100%{opacity:.45}50%{opacity:.75}}
/* the little arms crackle too */
.nl-frac{stroke:color-mix(in srgb,var(--accent) 85%,#fff);animation:nlCrackle 1.9s steps(2,jump-none) infinite}
.nl-frac.f1{animation-delay:-.5s}.nl-frac.f2{animation-delay:-1.1s}.nl-frac.f3{animation-delay:-1.4s}
@keyframes nlCrackle{0%,100%{stroke-opacity:1}50%{stroke-opacity:.55}}
.nl-end,.nl-syn{filter:drop-shadow(0 0 4px var(--accent)) drop-shadow(0 0 8px var(--accent))}
.core-frac path{stroke-linejoin:miter}
@media (prefers-reduced-motion: reduce){ .nl-bolt{animation:none;opacity:.35} .nl-bolt.v1,.nl-bolt.v2{opacity:0} .nl-nerve,.nl-frac{animation:none} }

/* Al conectar una neurona: un destello recorre el nervio desde el orbe hasta su puerto y las ramas brotan */
.nl-draw{fill:none;stroke:#fff;stroke-width:2.4;stroke-linecap:round;stroke-dasharray:1 1;stroke-dashoffset:1;pointer-events:none;filter:drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 6px var(--accent));animation:nlDraw 1s cubic-bezier(.2,.8,.2,1) forwards}
@keyframes nlDraw{0%{stroke-dashoffset:1;opacity:1}75%{stroke-dashoffset:0;opacity:1}100%{stroke-dashoffset:0;opacity:0}}
.nl-sprout{animation:nlSprout .9s ease-out .3s both}
@keyframes nlSprout{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion: reduce){ .nl-draw{display:none} .nl-sprout{animation:none} }

/* (17/11) «los pequeños puntos deben estar flotando alrededor del orbe»: antes los dos puntos de cada anillo quedaban uno frente al
   otro (arriba y abajo), así que se veían en línea; y en las compus lentas (data-perf=low) el giro se apagaba y quedaban quietos.
   Ahora cada punto tiene su propio lugar en el anillo (repartidos alrededor), flota un poco a su ritmo, y los anillos giran
   siempre (sólo es mover, casi no gasta). Con «reducir movimiento» del sistema se quedan quietos. */
.core-orbit b{animation:coreDot 3.6s ease-in-out infinite}
.core-orbit.o1 b:nth-child(1){left:50%;top:-3px;bottom:auto}
.core-orbit.o1 b:nth-child(2){left:67%;top:96%;bottom:auto;animation-delay:-1.3s;animation-duration:4.4s}
.core-orbit.o2 b:nth-child(1){left:93%;top:25%;bottom:auto;animation-delay:-.6s;animation-duration:4s}
.core-orbit.o2 b:nth-child(2){left:33%;top:97%;bottom:auto;animation-delay:-2.1s;animation-duration:3.2s}
.core-orbit.o2 b:nth-child(3){left:7%;top:25%;bottom:auto;animation-delay:-2.8s;animation-duration:4.8s}
@keyframes coreDot{0%,100%{translate:0 0;opacity:1}30%{translate:3px -4px;opacity:.75}65%{translate:-3px 2px;opacity:.95}}
html[data-perf=low] .neuron-core .core-orbit{animation:coreSpin linear infinite !important}
html[data-perf=low] .neuron-core .core-orbit.o1{animation-duration:7s !important}
html[data-perf=low] .neuron-core .core-orbit.o2{animation-duration:13s !important;animation-direction:reverse !important}
@media (prefers-reduced-motion: reduce){ .core-orbit,.core-orbit b,html[data-perf=low] .neuron-core .core-orbit{animation:none !important} }

/* (17/11) «hay un círculo constante alrededor del orbe que no me gusta»: sin el aro que late sin parar cuando el orbe invita a tocarlo */
.neuron-core.hinting::before{display:none!important;animation:none!important}
/* (17/11) «el aro fino alrededor del orbe no me gusta, y la esfera va en pocos cuadros y se pega»:
   · sin el aro fino neón (::after) — se conserva sólo la insignia (data-badge)
   · el orbe ya no anima su brillo ni su filtro en cada cuadro (box-shadow de 110 px + filter repintaban la esfera entera y la
     hacían ir a tirones): queda con su brillo fijo y sólo hace la entrada suave */
.neuron-core:not([data-badge])::after{display:none!important;animation:none!important}
body .neuron-core.placed,body.fg .fg-center .neuron-core.placed,body.fg .fg-center .neuron-core.placed.kept{animation-name:coreIn!important;animation-duration:.35s!important;animation-iteration-count:1!important;animation-timing-function:ease-out!important}
.neuron-core .orb-turn{will-change:transform;mix-blend-mode:normal;opacity:.7}
/* (17/11) Editar: el título «＋ Editar» arriba a la izquierda y la ✕ arriba a la derecha */
#menuEdit .me-head{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;text-align:left!important;gap:.6rem}
#menuEdit .me-head h3{margin:0!important;text-align:left!important;margin-right:auto!important}
#menuEdit .me-head .settings-close{position:static!important;margin:0 0 0 auto!important;flex:0 0 auto;order:2}
/* (17/11) «hay una barra verde debajo del header que me gusta: alárgala por todo el header y que sea del color de Cognose activo»:
   la línea de corriente de la barra de arriba ahora cubre todo el ancho (fija, con el color activo) y el destello sigue pasando por encima */
@media (prefers-reduced-motion: no-preference){
  .fg-bar::before{left:0!important;right:0!important;height:2px!important;opacity:1!important;
    background:linear-gradient(90deg,transparent 0 40%,color-mix(in srgb,var(--accent) 55%,#fff) 50%,transparent 60% 100%) 0 0 / 300% 100%,color-mix(in srgb,var(--accent) 65%,transparent)!important}
}
/* (17/11) ventajas del patrocinio con medallas de neuronas en vez de emojis */
.wd-perks.wd-perks-med{list-style:none;padding:0;margin:.6rem 0}
.wd-perks.wd-perks-med li{display:flex;align-items:center;gap:.7rem;margin:.55rem 0;line-height:1.35}
.wd-perks.wd-perks-med li::marker{content:''}
.wd-perks.wd-perks-med img,.wd-perks.wd-perks-med .wd-mw{flex:none;width:28px;height:28px;image-rendering:pixelated}
.wd-support img{vertical-align:middle;image-rendering:pixelated}

/* (17/11) el aviso de recordatorios salía detrás del header: debajo de él y por encima de todo */
.notif-ask{top:calc(var(--cg-lv-top, 64px) + 44px)!important;z-index:175!important}
/* (17/11) tienda y patrocinar, alineados con «Qué hago hoy» (estaban ~15px más arriba) */
#cgBuyRow{bottom:calc(69px + env(safe-area-inset-bottom))!important}
@media (max-width:760px){#cgBuyRow{bottom:calc(61px + env(safe-area-inset-bottom))!important}}
