/* Server racks: the interactive rack model rendered by racks.js.
   Design tokens (colors, fonts, easing) come from site.css. */

.rack-block{
  display:flex;
  flex-direction:column;
  gap:10px;
  min-width:0;
}

.rack-head{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  gap:10px;
  font-family:var(--font-mono);
  font-size:12px;
  letter-spacing:.08em;
  color:var(--ink-dim);
}
.rack-head .name{color:var(--ink);font-weight:600;}
.rack-head .zone{color:var(--accent);}

/* Gallery lighting: concentrated above the live network, quiet below. */
.rack-block{gap:14px;}
.rack-head{font-size:11px;letter-spacing:.04em;padding:0 4px;}
.rack-head .name{font-size:14px;letter-spacing:-.025em;}
.rack-head .zone{color:var(--ink-dim);}
.rack-head [data-rack-load]{font-size:10px;opacity:.65;}
.rack-svg-wrap{isolation:isolate;}
.rack-svg-wrap::before{
  content:"";position:absolute;inset:-12% -8% 25%;z-index:-1;
  background:radial-gradient(ellipse at 53% 30%,rgba(191,210,195,.12),transparent 65%);
  pointer-events:none;
}
svg.rack{filter:drop-shadow(0 22px 18px rgba(0,0,0,.32));}

/* The frame is reserved before racks.js runs (no layout shift) and shows
   a quiet outline of the empty rack while it loads. */
.rack-svg-wrap{
  position:relative;
  aspect-ratio:274 / 261;
}
.rack-svg-wrap:empty{
  border-radius:6px;
  background:
    repeating-linear-gradient(180deg, transparent 0 calc(100% / 7.9 - 1px), var(--line) calc(100% / 7.9 - 1px) calc(100% / 7.9)),
    var(--panel);
  opacity:.5;
}

svg.rack{
  display:block;
  width:100%;
  height:100%;
  overflow:visible;
  touch-action:none;
  user-select:none;
  -webkit-user-select:none;
}
svg.rack image{-webkit-user-drag:none;}
/* On touch screens the rack must not swallow page scrolling: taps
   (bolts, buttons) still work, drags hand the gesture back to the page. */
@media (pointer:coarse){
  svg.rack{touch-action:pan-x pan-y;}
}

.frame-backdrop{fill:var(--panel);}
.frame-cap{fill:var(--rail-dark);}
/* The vertical 19" mounting rail itself: a brushed-metal gradient
   (not a flat tint) plus an inner shade where the equipment throws a
   shadow onto it and an outer edge catching a thin rim of ambient
   light — the two together are what read as a folded metal channel
   rather than a painted stripe. */
.frame-rail{fill:url(#railGrad);}
.frame-rail-shade{fill:rgba(0,0,0,.3);}
.frame-rail-edge{fill:rgba(255,255,255,.16);}
/* The same brushed-metal strip as .frame-rail, but narrow and drawn
   right where a unit's own corner bolts land — so the rail visibly
   runs an unbroken strip past every hole (see railSlotStrip) instead
   of the holes floating disconnected on bare equipment. */
.inner-rail{fill:url(#railGrad);stroke:rgba(0,0,0,.35);stroke-width:.4;}
.u-tick{stroke:var(--line);stroke-width:1;}
.u-label{
  font-family:var(--font-mono);
  font-size:7.6px;
  fill:var(--ink-faint);
  text-anchor:end;
}
.u-label.right{text-anchor:start;}
.u-label.occupied{
  fill:var(--accent);
  font-weight:600;
  animation:labelGlow 3.6s ease-in-out infinite;
}
@keyframes labelGlow{
  0%,100%{filter:drop-shadow(0 0 1.5px rgba(163,181,126,.5));}
  50%{filter:drop-shadow(0 0 4.5px rgba(163,181,126,.95));}
}
.foot-bracket{fill:var(--rail-dark);}
.foot-shadow{fill:rgba(0,0,0,.4);}
.foot-tire{fill:#211d18;stroke:#070604;stroke-width:.7;transition:stroke .15s ease;}
.foot-hub{fill:#948a76;stroke:#4a4436;stroke-width:.5;}
.foot-bolt{fill:#2a2317;}
.foot-shine{stroke:rgba(255,255,255,.4);stroke-width:.8;stroke-linecap:round;fill:none;}

.caster{cursor:pointer;touch-action:none;}
.caster-hit{fill:transparent;}
.caster:hover .foot-tire{stroke:var(--accent);}

.unit-shell{fill:var(--panel-2);stroke:var(--line);stroke-width:1;}
.unit-shell.router{fill:#333a22;stroke:var(--line);}
.unit-shell.blank{fill:#211b10;stroke:var(--line);}

/* The cage-nut square — a real punched hole with visible depth (the
   same warm dark well used for an LED's lamp recess, not a flat
   black void), sitting directly under each M6 bolt in the bolt's own
   local coordinates, so this IS "the square you'd see if you
   unscrewed the bolt", not a decorative plate approximating one. */
.cage-hole{fill:rgba(0,0,0,.18);stroke:rgba(0,0,0,.35);stroke-width:.3;}
.cage-nut-clip{fill:#4a4436;opacity:.85;}
.cage-nut-body{fill:url(#boltGrad);stroke:#4a4638;stroke-width:.25;}
.cage-nut-bore{fill:rgba(0,0,0,.55);}
.bolt{cursor:pointer;touch-action:none;}
.bolt-washer{fill:#111;stroke:#000;stroke-width:.2;}
.bolt-head{fill:url(#boltGrad);stroke:#4a4638;stroke-width:.25;}
.bolt:hover .bolt-head{filter:brightness(1.18);}
.bolt-shine{fill:#fff;opacity:.55;}
.bolt-slot{stroke:#3a3628;stroke-width:.4;stroke-linecap:round;}
.bolt-hit{fill:transparent;}
/* The threaded hole itself — always present, sitting under the bolt;
   removing the bolt just stops covering it up. */
.bolt-hole{fill:rgba(0,0,0,.18);stroke:rgba(0,0,0,.32);stroke-width:.3;}
.bolt-falling{animation:boltFall 1.05s forwards;}
@keyframes boltFall{
  0%{transform:translate(0,0) rotate(0deg) scale(1); animation-timing-function:ease-in;}
  6%{transform:translate(0,-.6px) rotate(-35deg) scale(1.08); animation-timing-function:ease-out;}
  14%{transform:translate(0,-.2px) rotate(150deg) scale(1.04); animation-timing-function:cubic-bezier(.55,0,.85,.4);}
  66%{transform:translate(var(--fxm,0px),var(--fy,90px)) rotate(var(--frm,520deg)) scale(1); animation-timing-function:ease-out;}
  78%{transform:translate(var(--fx,0px),calc(var(--fy,90px) - 8px)) rotate(var(--fr,720deg)) scale(1.05); animation-timing-function:ease-in;}
  88%{transform:translate(var(--fx,0px),var(--fy,90px)) rotate(var(--fr,720deg)) scale(.95); animation-timing-function:ease-out;}
  94%{transform:translate(var(--fx,0px),calc(var(--fy,90px) - 2.5px)) rotate(var(--fr,720deg)) scale(1.02); animation-timing-function:ease-in;}
  100%{transform:translate(var(--fx,0px),var(--fy,90px)) rotate(var(--fr,720deg)) scale(1);}
}
.bolt-pop{fill:none;stroke:var(--accent);stroke-width:.6;animation:boltPop .4s ease-out forwards;}
@keyframes boltPop{
  0%{r:.5; opacity:.9;}
  100%{r:4.5; opacity:0;}
}

.port{fill:#0f0d09;stroke:rgba(255,255,255,.06);stroke-width:.5;}
.hatch{stroke:var(--line);stroke-width:1;}
.outlet{fill:#0f0d09;stroke:rgba(255,255,255,.08);stroke-width:.5;}
.outlet.on{fill:#173321;}
.toggle{fill:var(--ink-faint);}

.port-nub{cursor:crosshair;touch-action:none;}
.port-nub .dot{fill:var(--ink-faint);opacity:.7;transition:fill .12s ease,opacity .12s ease;}
.port-nub:hover .dot{fill:var(--data);opacity:1;}
.port-nub .hit{fill:transparent;}
.port-nub.face .dot{opacity:0;}
.port-nub.face:hover .dot{fill:var(--data);opacity:.9;}

/* A moulded indicator lamp, not a flat sticker: a recessed dark well
   (bezel + inner shadow + a thin rim catching light at the top) holding
   a glossy arrow lens — same visual language as the chassis LEDs. */
.link-arrow{fill:url(#arrowAmberGrad);stroke:rgba(30,18,2,.85);stroke-width:.3;opacity:1;pointer-events:none;filter:drop-shadow(0 .4px .5px rgba(0,0,0,.55)) drop-shadow(0 0 1.6px rgba(255,180,40,.6));transition:fill .3s ease,opacity .3s ease;}
.link-arrow.lit{fill:url(#arrowGreenGrad);stroke:rgba(3,30,14,.85);stroke-width:.3;animation:linkPulse 1.3s ease-in-out infinite;filter:drop-shadow(0 0 2.8px rgba(53,255,134,1));}
@keyframes linkPulse{0%,100%{opacity:.66;}50%{opacity:1;}}
.link-arrow.down{fill:url(#arrowOffGrad);stroke:rgba(0,0,0,.4);opacity:.85;animation:none;filter:drop-shadow(0 .3px .4px rgba(0,0,0,.35));}
.link-gloss{fill:rgba(255,255,255,.6);opacity:.85;pointer-events:none;}
.link-arrow.down + .link-gloss{opacity:.3;}

/* --- negotiating (reboot in progress): the arrow itself blinks,
   nothing on the ports and no chassis dimming. --- */
.link-arrow.negotiate{animation:arrowNegotiate .5s ease-in-out infinite;animation-delay:calc(var(--i,0) * 90ms);}
.link-arrow.negotiate.linked{animation-name:arrowNegotiateLinked;}
.link-arrow.flash{animation:arrowFlash .65s ease-out;}

/* An SVG element's default transform-origin is the whole view-box's
   corner, not its own centre — animating `transform:scale()` on the
   bare <circle> without pinning transform-box/-origin to itself first
   made the dot visibly drift sideways on every pulse instead of just
   breathing in place. */
.cisco-led-pulse{pointer-events:none;}
.cisco-led-pulse .core{opacity:.9;transform-box:fill-box;transform-origin:center;}
.cisco-led-pulse.sys .core{fill:#8dffb0;animation:ledBreathe2 2.6s ease-in-out infinite;}
.cisco-led-pulse.poe .core{fill:#8dffb0;animation:ledBreathe2 3.4s ease-in-out infinite .3s;}
.cisco-led-pulse.speed .core{fill:#ffd98a;animation:ledBlink 1.9s ease-in-out infinite;}
@keyframes ledBreathe2{0%,100%{opacity:.35;transform:scale(.85);}50%{opacity:1;transform:scale(1);}}
@keyframes ledBlink{0%,100%{opacity:0;}8%{opacity:1;}22%{opacity:0;}50%{opacity:0;}58%{opacity:1;}72%{opacity:0;}}
@media (prefers-reduced-motion:reduce){
  .cisco-led-pulse *{animation:none !important;}
}
@keyframes arrowNegotiate{
  0%,100%{fill:url(#arrowOffGrad);opacity:.45;}
  50%{fill:url(#arrowAmberGrad);opacity:1;}
}
@keyframes arrowNegotiateLinked{
  0%,18%{fill:url(#arrowOffGrad);opacity:.45;}
  48%,66%{fill:url(#arrowAmberGrad);opacity:1;}
  100%{fill:url(#arrowGreenGrad);opacity:1;}
}
@keyframes arrowFlash{
  0%{fill:url(#arrowGreenGrad);filter:drop-shadow(0 0 4.5px rgba(83,255,150,1));}
  100%{fill:url(#arrowGreenGrad);filter:none;}
}

/* --- UDM Pro: RESET button, display + reboot overlay ---------- */
.udm-reset{cursor:pointer;}
.rst-hit{fill:transparent;}
.rst-halo{fill:none;stroke:rgba(110,180,255,0);stroke-width:.7;transition:stroke .15s ease;}
.udm-reset:hover .rst-halo{stroke:rgba(110,180,255,.95);}
.unit.rebooting .udm-reset{cursor:progress;}
.udm-boot{pointer-events:none;}

.boot-ring{fill:none;stroke:#6db6ff;stroke-width:.8;opacity:0;}
[data-stage="press"] .boot-ring{animation:ringRipple .8s ease-out forwards;}
[data-stage="up"] .boot-ring{stroke:#4fcf7a;animation:ringRipple .9s ease-out forwards;}
@keyframes ringRipple{
  0%{opacity:1;stroke-width:1.5;r:var(--r0);}
  100%{opacity:0;stroke-width:.25;r:calc(var(--r0) * 2.7);}
}
.boot-press{fill:rgba(0,0,0,.4);opacity:0;}
[data-stage="press"] .boot-press{animation:pressDip .35s ease-out forwards;}
@keyframes pressDip{0%{opacity:0;}30%{opacity:1;}100%{opacity:.1;}}

/* the display */
.scr-bg{fill:#04060a;}
.scr-gloss{fill:rgba(255,255,255,.045);pointer-events:none;}
.scr-halo{fill:none;stroke:rgba(90,150,255,.4);stroke-width:.45;transition:opacity .4s ease;}
[data-stage="off"] .scr-halo{opacity:0;}
.scr-t1{font:700 3.5px var(--font-body);fill:#eef3ff;}
.scr-t2{font:500 2.9px var(--font-body);fill:#8aa0c8;}
.scr-t3{font:600 3.5px var(--font-body);fill:#cfe0ff;}
.scr-ok{fill:#4fcf7a;}
.scr-bar{fill:#3b82f6;opacity:.9;}
.scr-u{fill:none;stroke:#f2f6ff;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:100;stroke-dashoffset:0;}
.scr-udot{fill:#3b82f6;}
.scr-spin{fill:none;stroke:#3b82f6;stroke-width:1;stroke-linecap:round;stroke-dasharray:14 10;}
.scr-rd{fill:#3b82f6;opacity:.14;}
.scr-wm{font:700 5.6px var(--font-body);fill:#fff;opacity:0;}
.scr-ws{font:500 2.7px var(--font-body);fill:#8aa0c8;opacity:0;letter-spacing:.1em;}
.scr-track{stroke:rgba(255,255,255,.13);stroke-width:.8;stroke-linecap:round;}
.scr-prog{stroke:#3b82f6;stroke-width:.8;stroke-linecap:round;stroke-dasharray:var(--len);stroke-dashoffset:var(--len);}
.scr-line{stroke:#e2ecff;stroke-width:0;opacity:0;stroke-linecap:round;}
.scr-flash{fill:#cfe0ff;opacity:0;}

.uscr-t1{font:700 4.4px var(--font-body);fill:#eef3ff;}
.uscr-t2{font:500 2.5px var(--font-body);fill:#8aa0c8;}
.uscr-ok{fill:#4fcf7a;}
.uscr-bar{fill:#3b82f6;opacity:.85;}

.vscr-bg{fill:#0f0c08;}
.vscr-vignette{fill:#1c1810;opacity:.55;}
.vscr-scan{stroke:rgba(255,255,255,.022);stroke-width:1;}
.vscr-diamond{fill:none;stroke:#cdd9ac;stroke-width:1;opacity:.55;}
.vscr-diamond2{fill:none;stroke:#cdd9ac;stroke-width:1.6;}
.vscr-dot{fill:#a3b57e;filter:drop-shadow(0 0 2.6px rgba(163,181,126,.9));}
.vscr-wm{font:700 8.5px var(--font-body);fill:#f4efe4;}
.vscr-wmdot{fill:#a3b57e;filter:drop-shadow(0 0 2px rgba(163,181,126,.9));}
.vscr-rule{stroke:#a3b57e;stroke-width:.5;}
.vscr-tag{font:500 2.9px var(--font-body);fill:#bcae90;}
.vscr-wave-glow{fill:none;stroke:rgba(163,181,126,.35);stroke-width:2.6;stroke-linecap:round;}
.vscr-wave{fill:none;stroke:#c7d6a0;stroke-width:.6;stroke-linecap:round;}
.vscr-markdot{fill:#a3b57e;opacity:.85;}
.vscr-marktext{font:700 3px var(--font-mono);fill:rgba(244,239,230,.85);letter-spacing:.1em;}
.vscr-halo{fill:none;stroke:rgba(163,181,126,.4);stroke-width:.45;}

.scr-idle,.scr-restart,.scr-boot{opacity:0;transition:opacity .3s ease;}
.scr-idle{opacity:1;}
[data-stage="down"] .scr-idle{opacity:0;}
[data-stage="down"] .scr-restart{opacity:1;}
[data-stage="off"] .scr-idle{opacity:0;}
[data-stage="boot"] .scr-idle{opacity:0;}
[data-stage="boot"] .scr-boot{opacity:1;transition-duration:.15s;}
[data-stage="up"] .scr-idle{opacity:1;transition-duration:.7s;transition-delay:.3s;}
/* Bug fix: this read `opacity:1`, which left the boot layer (chasing
   ring + big logo + progress bar) sitting on top of the idle screen
   forever once a reboot or power-on finished — data-stage stays "up"
   until the next full rack rebuild, so nothing ever set it back down.
   It has to fade back OUT once idle has taken over, same as every
   other stage it isn't currently in. */
[data-stage="up"] .scr-boot{opacity:0;transition-duration:.3s;}
[data-stage="up"] .scr-prog{stroke-dashoffset:0;}

[data-stage="off"] .scr-line{animation:crtOff .8s ease-out both;}
@keyframes crtOff{
  0%{opacity:1;stroke-width:7;}
  14%{opacity:1;stroke-width:.9;}
  70%{opacity:1;stroke-width:.4;}
  100%{opacity:0;stroke-width:0;}
}
/* Retimed to finish well inside the shortest window this stage ever
   runs for — the switch's manual power-on boot phase is only ~2.2s
   (POWER_ON_STAGES) — so the sequence can never get caught mid-draw
   when the stage advances to "up". The previous progFill (3.9s + .4s
   delay = 4.3s) never actually finished during a power-on; only the
   `[data-stage="up"] .scr-prog{stroke-dashoffset:0}` snap masked it. */
[data-stage="boot"] .scr-boot .scr-u{animation:uDraw .6s cubic-bezier(.5,0,.2,1) .1s both;}
[data-stage="boot"] .scr-boot .scr-udot{animation:dotPop .3s cubic-bezier(.3,1.6,.5,1) .65s both;}
[data-stage="boot"] .scr-rd{animation:ringChase 1s linear infinite;animation-delay:calc(.4s + var(--k) * .07s);}
[data-stage="boot"] .scr-prog{animation:progFill 1s cubic-bezier(.4,.1,.6,1) .3s forwards;}
[data-stage="up"] .scr-flash{animation:scrFlash 1s ease-out both;}
@keyframes uDraw{from{stroke-dashoffset:100;}to{stroke-dashoffset:0;}}
@keyframes dotPop{from{r:0;}to{r:1.1;}}
@keyframes ringChase{0%{opacity:1;}65%{opacity:.14;}100%{opacity:.14;}}
@keyframes scrFade{from{opacity:0;}to{opacity:1;}}
@keyframes progFill{to{stroke-dashoffset:0;}}
@keyframes scrFlash{0%{opacity:.9;}100%{opacity:0;}}
@media (prefers-reduced-motion:reduce){
  .udm-boot *{animation:none !important;}
}

/* --- ambient network-status cycle (Ubiquiti screens, idle only) --
   A handful of small "LCD" faces cross-fading into each other — the
   cross-fade itself is SMIL (`<animate>` on each slide's own opacity,
   same technique as the VRODE screen's two-slide loop below), kept
   off the `.scr-idle` wrapper's opacity so it never fights the CSS
   transition that wrapper already uses for reboot/power staging. */
.nscr-title{font:700 3.3px var(--font-body);fill:#eef3ff;}
.nscr-status{font:600 2.2px var(--font-mono);fill:#7dffb2;letter-spacing:.03em;}
.nscr-line{font:500 2.35px var(--font-mono);fill:#9fb3d6;}
.nscr-label{font:600 2px var(--font-mono);fill:#5f7396;letter-spacing:.05em;}
.nscr-dot{fill:#324258;transition:fill .3s ease;}
.nscr-dot.on{fill:#3fd67a;animation:portBlink 2.6s ease-in-out infinite;}
@keyframes portBlink{0%,100%{opacity:.5;}50%{opacity:1;}}
.nscr-pkt{fill:#c8ffe4;filter:drop-shadow(0 0 1.1px rgba(140,255,190,.95));}
.nscr-fw{fill:rgba(90,150,255,.14);stroke:rgba(140,180,255,.55);stroke-width:.35;}
.nscr-fwtext{font:700 1.85px var(--font-mono);fill:#bcd3ff;letter-spacing:.04em;}
.nscr-flowline{stroke:rgba(140,180,255,.35);stroke-width:.5;fill:none;}
.nscr-flowdot{fill:#5a96ff;}
.nscr-sec-label{font:700 2.3px var(--font-mono);fill:#eef3ff;letter-spacing:.03em;}
.nscr-sec-val{font:500 2.1px var(--font-mono);fill:#7dffb2;}
@media (prefers-reduced-motion:reduce){
  .nscr-dot.on{animation:none !important;opacity:1;}
}

.brand-mark{stroke:var(--accent);stroke-width:2.4;fill:none;stroke-linecap:round;stroke-linejoin:round;}
.brand-dot{fill:var(--accent);}
.screen-bg{fill:#0b1410;}
.bar{fill:var(--accent);opacity:.85;}

.cable{
  fill:none;stroke:var(--data);stroke-width:1.5;stroke-linecap:round;opacity:.95;
  filter:drop-shadow(0 0 2.5px rgba(63,201,194,.55));
}
.cable.ghost{opacity:.55;stroke-dasharray:3 4;stroke-width:1.4;filter:none;}
.cable-handle{cursor:grab;touch-action:none;}
.cable-handle .hit{fill:transparent;}
.plug{pointer-events:none;}
.plug-body{fill:#1d2a2c;stroke:#050909;stroke-width:.3;}
.plug-top{fill:rgba(255,255,255,.14);}
.plug-latch{fill:#2a3a3d;stroke:#050909;stroke-width:.25;}
.plug-boot{fill:#2fc7be;stroke:#0d5b57;stroke-width:.3;}
.plug-glint{fill:rgba(255,255,255,.75);}
.cable-handle:hover .plug-body{stroke:var(--ink);stroke-width:.4;}
.cable-handle:hover .plug-boot{fill:#7ff0e8;}

/* --- duplex fibre patch cord ------------------------------------ */
.cord path{fill:none;stroke-linecap:round;pointer-events:none;}
.cord-halo{stroke:rgba(63,214,207,.16);stroke-width:5.8;transition:opacity .4s ease;animation:cordBreathe 3.8s ease-in-out infinite;}
@keyframes cordBreathe{0%,100%{opacity:.55;}50%{opacity:1;}}
.cord-jacket{stroke:#03080a;stroke-width:3.7;}
.cord-sheen{stroke:rgba(255,255,255,.55);stroke-width:.9;stroke-linecap:round;opacity:.5;pointer-events:none;}
.fiber{stroke-width:.9;transition:stroke .5s ease;}
.fiber-tx{stroke:url(#fiberTxGrad);}
.fiber-rx{stroke:url(#fiberRxGrad);}
.fiber-shine{stroke:rgba(255,255,255,.32);stroke-width:.2;}
.pkt{transition:opacity .35s ease;}
.cord.down .fiber{stroke:#3c4c4e;}
.cord.down .pkt,.cord.down .cord-halo,.cord.down .cord-sheen{opacity:0;}
.cord.negotiating .pkt,.cord.negotiating .cord-halo,.cord.negotiating .cord-sheen{opacity:0;}
.cord.negotiating .fiber{animation:fiberNegotiate 1s ease-in-out infinite;}
@keyframes fiberNegotiate{0%,100%{opacity:.4;}50%{opacity:.95;}}
.cord-halo,.cord-sheen{transition:opacity .4s ease;}

/* Entrance reveal, on first render only. Every rebuild (drag, new patch
   cord, the post-fonts-load repaint, a reboot...) throws away the old
   DOM and builds fresh unit groups — so "revealed" defaults to true and
   only the very first batch gets tagged `.entering` (added at build
   time, removed a frame later to play the transition); if the default
   state were the hidden one instead, every later rebuild's brand-new
   nodes would start invisible with nothing left to ever remove a
   "make visible" class from. Lives on an INNER group (never the unit's
   own outer <g>, whose `transform` attribute already carries its rack
   position and its drag offset — a CSS transform on that element would
   replace the attribute outright instead of composing with it).
   Staggered bottom-to-top in JS. */
.unit-reveal{transition:opacity 420ms var(--ease-out),transform 420ms var(--ease-out);}
.unit-reveal.entering{opacity:0;transform:translateY(9px) scale(.97);}
@media (prefers-reduced-motion:reduce){
  .unit-reveal.entering{opacity:1;transform:none;transition:none;}
}

.unit{cursor:grab;touch-action:none;}
.unit:active{cursor:grabbing;}
.unit .hl{fill:transparent;stroke:var(--accent);stroke-width:1;opacity:0;transition:opacity .15s ease;pointer-events:none;}
.unit:hover .hl{opacity:.65;fill:var(--accent-soft);}
.unit.drag-ok .hl{opacity:1;stroke:var(--good);fill:rgba(79,207,122,.16);}
.unit.drag-bad .hl{opacity:1;stroke:var(--bad);fill:rgba(226,99,91,.16);}
.unit-hit{fill:transparent;}

.unit.blank{cursor:default;}
.unit.blank .hl{display:none;}
.blank-label{
  font-family:var(--font-mono);font-size:9.5px;font-weight:600;letter-spacing:.1em;
  fill:var(--ink-dim);text-anchor:middle;pointer-events:none;
}
/* Pivot lives in the transform string itself (translate to the screw,
   rotate, translate back) — a JS rAF loop writes it fresh every frame
   (see buildBlankPanel), the same technique used for the caster wheel,
   because CSS transform-origin on an SVG element resolves against the
   whole <svg>'s corner, not this element. Both the pendulum swing and
   the fall afterwards are one continuous, analytic function of elapsed
   time, so pulling the last screw can never snap or "jump" — the fall
   literally starts from the angle and angular speed the swing already
   had at that instant. */
.unit.blank.hanging{pointer-events:none;}
.unit.blank.hanging .bolt{pointer-events:auto;}

/* cord drop targets */
.port-mark{fill:rgba(79,207,122,.16);stroke:var(--good);stroke-width:.9;pointer-events:none;}
.port-mark.bad{fill:rgba(226,99,91,.22);stroke:var(--bad);}
.port-flash{fill:rgba(226,99,91,.35);stroke:var(--bad);stroke-width:1;pointer-events:none;animation:flashBad .7s ease-out forwards;}
@keyframes flashBad{0%{opacity:1;r:4;}100%{opacity:0;r:10;}}

.drop-preview{fill:rgba(79,207,122,.1);stroke:var(--good);stroke-width:1;stroke-dasharray:3 3;pointer-events:none;}
.drop-preview.bad{fill:rgba(226,99,91,.1);stroke:var(--bad);}

.rack-foot{
  display:flex;justify-content:space-between;flex-wrap:wrap;gap:2px 12px;
  font-family:var(--font-mono);font-size:12px;color:var(--ink-faint);
  font-variant-numeric:tabular-nums;flex:none;
}

.ticker{
  font-family:var(--font-mono);font-size:12px;color:var(--ink-dim);
  border-top:1px solid var(--line);padding-top:7px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  transition:opacity .18s ease;flex:none;
}
.ticker::before{content:"▸ ";color:var(--accent);}

.tooltip{
  position:fixed;left:0;top:0;transform:translate(-9999px,-9999px);
  background:var(--panel);border:1px solid var(--line);border-radius:5px;
  padding:8px 11px;font-family:var(--font-mono);max-width:220px;
  pointer-events:none;opacity:0;transition:opacity .12s ease;
  box-shadow:0 10px 28px rgba(0,0,0,.45);z-index:50;
}
.tooltip.visible{opacity:1;}
.tooltip-name{font-size:11.5px;font-weight:600;color:var(--ink);letter-spacing:.01em;}
.tooltip-sub{font-size:10px;color:var(--ink-dim);margin-top:3px;line-height:1.4;}

/* A restrained material hierarchy keeps the ports and dressed fibre in focus. */
.frame-backdrop{fill:#141612;}
.frame-cap{fill:#30322c;}
.frame-rail-edge{fill:rgba(255,255,255,.1);}
.frame-rail{filter:brightness(.72) saturate(.35);}
.inner-rail{filter:brightness(.75) saturate(.4);}
.u-tick{stroke:rgba(220,225,215,.045);stroke-width:.5;}
.u-label{font-size:6.2px;opacity:.5;}
.u-label.occupied{fill:var(--ink-dim);font-weight:400;animation:none;opacity:.7;}
.unit-shell{stroke:rgba(225,231,220,.12);stroke-width:.45;}
.unit-shell.blank{fill:url(#blankMetalGrad);stroke:rgba(225,231,220,.09);stroke-width:.4;}
.blank-label{font-size:3.5px;font-weight:400;letter-spacing:.16em;text-anchor:end;fill:#72786d;}
.bolt-shine{opacity:.28;}
.link-arrow,.link-arrow.down{filter:none;}
.link-arrow.lit{animation:none;filter:none;}
.cord{transition:opacity .24s ease,filter .24s ease;}
.cord-halo{animation:none;opacity:.18;}
.cord-sheen{opacity:.25;}
.cord .pkt{opacity:.4;}
.cable-handle{transition:opacity .24s ease;}
.rack.connection-focus .cord:not(.route-active),
.rack.connection-focus .cable-handle:not(.route-active){opacity:.18;}
.cord.route-active{filter:drop-shadow(0 0 2px rgba(105,226,216,.5));}
.cord.route-active:not(.down):not(.negotiating) .cord-halo{opacity:.8;}
.cord.route-active:not(.down):not(.negotiating) .pkt{opacity:1;}
.port-nub.route-active .dot{fill:#b9fff0;opacity:1;filter:drop-shadow(0 0 2px #8ce8dc);}
.cable-handle.route-active .plug-body{stroke:#b9fff0;stroke-width:.5;}
.unit:focus-visible .hl,.unit:hover .hl{stroke:rgba(202,223,191,.4);stroke-width:.65;}
.port-nub:focus-visible,.cable-handle:focus-visible{outline:none;}
.rack-foot{font-size:10px;opacity:.65;}
.ticker{font-size:10px;color:var(--ink-faint);border-color:rgba(220,225,215,.08);padding-top:10px;}
.ticker::before{content:"· ";color:var(--accent);}
.tooltip{max-width:min(340px,calc(100vw - 24px));border-color:rgba(220,225,215,.14);border-radius:9px;padding:11px 14px;background:rgba(25,27,23,.96);}
.tooltip-sub{overflow-wrap:anywhere;line-height:1.6;}

@media (prefers-reduced-motion:reduce){
  .cord-halo,.cord.negotiating .fiber,.link-arrow,.nscr-dot.on{animation:none !important;}
  .cord,.cable-handle{transition:none;}
}

@media (prefers-reduced-motion:reduce){
  .u-label.occupied, .link-arrow.lit{animation:none !important;}
}
