/* Animated Option A background: 3-phase phasor and sine waves on a dark field. */
html.jd-bg-on {
  background: #0B0C10;
}
html.jd-bg-on body {
  background: #0B0C10;
  background-image: none;
}
#jd-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
}
/* Only in-flow page sections need a stacking context above the canvas.
   Do not set position:relative on .calc, .drawer, or dialog — that would
   override their position:fixed (or the native dialog top layer). */
html.jd-bg-on main,
html.jd-bg-on .backbar,
html.jd-bg-on .foot {
  position: relative;
  z-index: 1;
}
html.jd-bg-on .nav { z-index: 50; }
html.jd-bg-on .calc { z-index: 90; }
html.jd-bg-on .drawer { z-index: 80; }

/* Uncarded text on the dark field. Cards, bars and the calculator stay as they are. */
html.jd-bg-on .hero .kicker,
html.jd-bg-on .mhead .kicker { color: #9fb0c8; }
html.jd-bg-on .hero h1,
html.jd-bg-on .mhead h1 { color: #f4f1ea; }
html.jd-bg-on .hero p,
html.jd-bg-on .mhead p { color: #c5ccd6; }
html.jd-bg-on .fgroup { color: #c5ccd6; }
html.jd-bg-on .foot {
  background: #08090c;
  border-top-color: #1a1e24;
}
html.jd-bg-on .foot div { color: #8b93a0; }
html.jd-bg-on .foot-admin a { color: #7a8390; border-bottom-color: #3a414c; }
html.jd-bg-on .foot-admin a:hover { color: #d0d6de; border-bottom-color: #d0d6de; }

/* Desktop: the right rail is sized to fit the full phasor plus a small
   margin. The left margin matches it, and the column narrows as needed.
   When the viewport is wide enough, the column stays centered. */
@media (min-width: 901px) {
  html.jd-bg-on {
    --jd-max: 1160px;
    --jd-rail: 176px; /* gap + 2*72 (a3 radius at tighter desktops) + margin */
  }
  html.jd-bg-on .nav-in,
  html.jd-bg-on main,
  html.jd-bg-on .backbar,
  html.jd-bg-on .foot div {
    max-width: min(var(--jd-max), calc(100% - 2 * var(--jd-rail)));
    margin-left: max(var(--jd-rail), calc((100% - min(var(--jd-max), 100% - 2 * var(--jd-rail))) / 2));
    margin-right: auto;
  }
}
@media (min-width: 1360px) {
  html.jd-bg-on { --jd-rail: 200px; }
}
@media (min-width: 1440px) {
  html.jd-bg-on { --jd-rail: 248px; } /* gap + 2*108 + margin */
}
