/* ============================================================
   M/Y Netto II — JARVIS BRIDGE v4 "Orbital Command"
   Mounted by JarvisShell.mount into #jarvis-bridge when the
   user is on Jarvis Mode + on the dashboard route.
   ============================================================ */

#jarvis-bridge { display: none; }
#jarvis-bridge.is-mounted {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--j-bg, #04070d);
  overflow: hidden;
  isolation: isolate;
}

html.jarvis-bridge-active .appbar,
html.jarvis-bridge-active .topbar,
html.jarvis-bridge-active #portal-nav,
html.jarvis-bridge-active #page-portal,
html.jarvis-bridge-active .messages-fab,
html.jarvis-bridge-active #toast,
html.jarvis-bridge-active .nav-drawer,
html.jarvis-bridge-active .mobile-nav-drawer {
  display: none !important;
}

.j4-root {
  position: relative;
  width: 100%;
  height: 100%;
  color: var(--j-text, #dff6ff);
  font-family: 'Rajdhani', 'Orbitron', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(92,240,255,0.08), rgba(92,240,255,0) 60%),
    radial-gradient(ellipse at 50% 110%, rgba(92,240,255,0.05), rgba(92,240,255,0) 55%),
    repeating-linear-gradient(0deg,  rgba(92,240,255,0.03) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(90deg, rgba(92,240,255,0.03) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg,  rgba(92,240,255,0.015) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, rgba(92,240,255,0.015) 0 1px, transparent 1px 24px),
    linear-gradient(180deg, #04070d 0%, #06101c 55%, #04070d 100%);
  overflow: hidden;
}

/* ============================================================
   STATUS TICKER (top)
   ============================================================ */
.jarvis-status-ticker {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 26px;
  border-bottom: 1px solid rgba(92,240,255,0.18);
  background: linear-gradient(180deg, rgba(4,7,13,0.96), rgba(4,7,13,0.55));
  overflow: hidden;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--j-text-soft, #7fa8b8);
  display: flex;
  align-items: center;
  z-index: 6;
}
.jarvis-ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: jarvis-ticker 42s linear infinite;
  padding-left: 100%;
}
.jarvis-ticker-seg { padding: 0 28px; display: inline-flex; align-items: center; gap: 8px; position: relative; }
.jarvis-ticker-seg + .jarvis-ticker-seg::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 1px; height: 12px;
  background: rgba(92,240,255,0.25); transform: translateY(-50%);
}
.jarvis-ticker-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--j-ok, #57e3a0);
  box-shadow: 0 0 8px var(--j-ok, #57e3a0);
}
.jarvis-ticker-dot.is-bad { background: var(--j-danger, #ff4d6d); box-shadow: 0 0 8px var(--j-danger, #ff4d6d); }
.jarvis-ticker-key { color: var(--j-text-mute, #5a7a8a); }
.jarvis-ticker-val { color: var(--j-text, #dff6ff); font-weight: 600; }
@keyframes jarvis-ticker { to { transform: translateX(-50%); } }

/* ============================================================
   CORNER CHROME — date, wordmark, greeting, stamps
   ============================================================ */
.j4-corner {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  font-family: 'Rajdhani', sans-serif;
}
.j4-corner-tl { top: 40px;  left: 22px; display: flex; align-items: center; gap: 14px; }
.j4-corner-tr { top: 40px;  right: 22px; text-align: right; max-width: 360px; }
.j4-corner-bl { bottom: 18px; left: 22px; }
.j4-corner-br { bottom: 18px; right: 22px; }

.j4-wm-antler {
  width: 56px;
  height: 56px;
  filter: invert(1) brightness(1.2) contrast(1.4) drop-shadow(0 0 8px rgba(92,240,255,0.55));
  mix-blend-mode: screen;
  opacity: 0.7;
}
.j4-date { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; gap: 0; }
.j4-date-month {
  font-size: 11px; letter-spacing: 0.28em;
  color: var(--j-text-soft, #7fa8b8); text-transform: uppercase;
}
.j4-date-dd {
  font-family: 'Orbitron', sans-serif;
  font-size: 30px; font-weight: 700;
  color: var(--j-accent, #5cf0ff);
  text-shadow: 0 0 14px var(--j-accent-glow, rgba(92,240,255,0.4));
  margin: 2px 0;
}
.j4-date-weekday {
  font-size: 10px; letter-spacing: 0.24em;
  color: var(--j-text, #dff6ff); text-transform: uppercase;
}

.j4-wm-wordmark {
  width: 180px;
  display: block;
  margin-left: auto;
  filter: invert(1) brightness(1.1) contrast(1.4) drop-shadow(0 0 6px rgba(92,240,255,0.5));
  mix-blend-mode: screen;
  opacity: 0.78;
}
.j4-greet {
  margin-top: 6px;
  font-family: 'Orbitron', sans-serif;
  font-size: 18px; font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--j-text, #dff6ff);
  text-shadow: 0 0 14px rgba(92,240,255,0.18);
}
.j4-greet-sub {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--j-text-soft, #7fa8b8);
  text-transform: uppercase;
  margin-top: 3px;
}

.j4-stamp {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--j-text-mute, #5a7a8a);
  text-transform: uppercase;
}

/* ============================================================
   STAGE + ORBITAL SVG
   ============================================================ */
.j4-stage {
  position: absolute;
  top: 26px;
  left: 0; right: 0;
  bottom: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.j4-orbital {
  width: min(820px, 90vw);
  height: 100%;
  max-height: 720px;
  overflow: visible;
}

/* Outer compass ring */
.j4-outer-circle {
  fill: none;
  stroke: var(--j-line, rgba(92,240,255,0.22));
  stroke-width: 1;
}
.j4-tick {
  stroke: var(--j-accent-soft, rgba(92,240,255,0.55));
  stroke-width: 1;
  opacity: 0.5;
}
.j4-tick-major   { stroke-width: 1.5; opacity: 0.85; }
.j4-tick-cardinal { stroke-width: 2.5; stroke: var(--j-accent, #5cf0ff); opacity: 1; }
.j4-cardinal {
  fill: var(--j-accent, #5cf0ff);
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.j4-readout {
  fill: var(--j-text, #dff6ff);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.j4-cog-needle {
  fill: var(--j-accent, #5cf0ff);
  stroke: var(--j-accent, #5cf0ff);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px var(--j-accent, #5cf0ff));
  transform-origin: 0 0;
  transform-box: view-box;
  transition: transform 500ms cubic-bezier(0.22, 0.61, 0.36, 1);
  opacity: 0.65;
}

/* Decorative primary orbit ring */
.j4-orbit-ring {
  fill: none;
  stroke: rgba(92,240,255,0.14);
  stroke-width: 1;
  stroke-dasharray: 2 6;
  animation: j4-orbit-rotate 90s linear infinite;
  transform-origin: 0 0;
  transform-box: view-box;
}
@keyframes j4-orbit-rotate { to { transform: rotate(360deg); } }

/* Sun-to-planet spokes */
.j4-spoke {
  stroke: rgba(92,240,255,0.18);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}
.j4-particle {
  fill: var(--j-accent, #5cf0ff);
  filter: drop-shadow(0 0 4px var(--j-accent, #5cf0ff));
  animation: j4-particle-flow 4s linear infinite;
}
@keyframes j4-particle-flow {
  0%   { transform: translate(0, 0);                  opacity: 0; }
  10%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { transform: translate(var(--j4-tx), var(--j4-ty)); opacity: 0; }
}

/* ============================================================
   SUN (centre core)
   ============================================================ */
.j4-sun { cursor: pointer; outline: none; }
.j4-sun:focus-visible .j4-sun-core { stroke: var(--j-text, #dff6ff); }
.j4-sun-glow { pointer-events: none; }
.j4-sun-core {
  fill: rgba(4,7,13,0.92);
  stroke: var(--j-accent, #5cf0ff);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 16px var(--j-accent, #5cf0ff));
}
.j4-sun-initials {
  fill: var(--j-accent, #5cf0ff);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 26px;
  text-shadow: 0 0 14px var(--j-accent-glow, rgba(92,240,255,0.4));
}
.j4-sun-marsec-l {
  fill: var(--j-text-mute, #5a7a8a);
  font-family: 'Rajdhani', sans-serif;
  font-size: 9px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}
.j4-sun-marsec-v {
  fill: var(--j-accent, #5cf0ff);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 22px;
}
.j4-sun-role {
  fill: var(--j-text-soft, #7fa8b8);
  font-family: 'Rajdhani', sans-serif;
  font-size: 10px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

/* ============================================================
   PLANETS
   ============================================================ */
.j4-planet { cursor: pointer; transition: opacity 240ms ease; outline: none; }
.j4-planet:focus-visible .j4-planet-circle { stroke: var(--j-text, #dff6ff); }
.j4-planet-body { transition: transform 200ms cubic-bezier(0.22, 0.61, 0.36, 1); }
.j4-planet-halo {
  fill: none;
  stroke: var(--j-accent-soft, rgba(92,240,255,0.55));
  stroke-width: 1;
  opacity: 0;
  transition: opacity 220ms ease;
}
.j4-planet-circle {
  fill: rgba(10,19,32,0.85);
  stroke: var(--j-accent-soft, rgba(92,240,255,0.55));
  stroke-width: 1.5;
  filter: drop-shadow(0 0 8px rgba(92,240,255,0.25));
  transition: stroke 200ms ease, filter 200ms ease;
}
.j4-planet-glyph {
  fill: var(--j-accent, #5cf0ff);
  font-family: 'Orbitron', sans-serif;
  font-size: 26px;
  font-weight: 700;
  text-shadow: 0 0 8px var(--j-accent-glow, rgba(92,240,255,0.4));
  pointer-events: none;
}
.j4-planet-label {
  fill: var(--j-text, #dff6ff);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  pointer-events: none;
}
.j4-planet-badge .j4-badge-bg {
  fill: rgba(4,7,13,0.92);
  stroke: var(--j-accent, #5cf0ff);
  stroke-width: 1;
  opacity: 0.85;
  filter: drop-shadow(0 0 6px rgba(92,240,255,0.25));
}
.j4-badge-value {
  fill: var(--j-accent, #5cf0ff);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.05em;
}
.j4-badge-sub {
  fill: var(--j-text-soft, #7fa8b8);
  font-family: 'Rajdhani', sans-serif;
  font-size: 9px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

/* Planet hover/focus = is-hot. Other planets dim. */
.j4-stage.has-hot .j4-planet:not(.is-hot) { opacity: 0.35; }
.j4-planet.is-hot .j4-planet-body { transform: translate(var(--planet-x, 0), var(--planet-y, 0)) scale(1.12); }
.j4-planet.is-hot .j4-planet-halo {
  opacity: 1;
  stroke: var(--j-accent, #5cf0ff);
  animation: j4-halo-pulse 1.4s ease-in-out infinite;
}
.j4-planet.is-hot .j4-planet-circle {
  stroke: var(--j-accent, #5cf0ff);
  stroke-width: 2;
  filter: drop-shadow(0 0 18px var(--j-accent, #5cf0ff));
}
@keyframes j4-halo-pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ============================================================
   MOONS — hidden by default, fan out when planet is hot
   ============================================================ */
.j4-moon {
  opacity: 0;
  pointer-events: none;
  transform-origin: center;
  outline: none;
  transition: opacity 280ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.j4-moon-circle {
  fill: rgba(4,7,13,0.95);
  stroke: var(--j-accent, #5cf0ff);
  stroke-width: 1.5;
  filter: drop-shadow(0 0 8px var(--j-accent-glow, rgba(92,240,255,0.4)));
}
.j4-moon-glyph {
  fill: var(--j-accent, #5cf0ff);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}
.j4-moon-label {
  fill: var(--j-text, #dff6ff);
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 0 4px rgba(0,0,0,0.85);
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
}
.j4-planet.is-hot .j4-moon {
  opacity: 1;
  pointer-events: auto;
  /* Stagger reveal via attribute selectors so each moon arrives ~60ms apart. */
}
.j4-planet.is-hot .j4-moon[data-i="0"] { transition-delay:   0ms; }
.j4-planet.is-hot .j4-moon[data-i="1"] { transition-delay:  60ms; }
.j4-planet.is-hot .j4-moon[data-i="2"] { transition-delay: 120ms; }
.j4-planet.is-hot .j4-moon[data-i="3"] { transition-delay: 180ms; }
.j4-planet.is-hot .j4-moon[data-i="4"] { transition-delay: 240ms; }
.j4-planet.is-hot .j4-moon-label { opacity: 1; transition-delay: 200ms; }
.j4-moon:hover .j4-moon-circle,
.j4-moon:focus-visible .j4-moon-circle {
  stroke: var(--j-text, #dff6ff);
  filter: drop-shadow(0 0 14px var(--j-accent, #5cf0ff));
}

/* Branches */
.j4-branch {
  stroke: var(--j-accent, #5cf0ff);
  stroke-width: 1.25;
  fill: none;
  filter: drop-shadow(0 0 4px var(--j-accent-glow, rgba(92,240,255,0.4)));
  stroke-dasharray: 200;
  stroke-dashoffset: 200;
  transition: stroke-dashoffset 400ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.j4-planet.is-hot .j4-branch { stroke-dashoffset: 0; }
.j4-planet.is-hot .j4-branch:nth-child(1) { transition-delay:   0ms; }
.j4-planet.is-hot .j4-branch:nth-child(2) { transition-delay:  60ms; }
.j4-planet.is-hot .j4-branch:nth-child(3) { transition-delay: 120ms; }
.j4-planet.is-hot .j4-branch:nth-child(4) { transition-delay: 180ms; }
.j4-planet.is-hot .j4-branch:nth-child(5) { transition-delay: 240ms; }

/* ============================================================
   BOTTOM STRIP — vessel blueprint + deck cycler + marlin emblem
   ============================================================ */
.j4-bottom {
  position: absolute;
  left: 22px; right: 22px; bottom: 56px;
  height: 168px;
  display: grid;
  grid-template-columns: 1fr 80px 1fr;
  gap: 14px;
  z-index: 3;
}
.j4-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(10,19,32,0.78), rgba(14,26,44,0.66));
  border: 1px solid var(--j-line, rgba(92,240,255,0.22));
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-width: 0;
  clip-path: polygon(
    0 10px, 10px 0,
    calc(100% - 10px) 0, 100% 10px,
    100% calc(100% - 10px), calc(100% - 10px) 100%,
    10px 100%, 0 calc(100% - 10px)
  );
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.j4-panel:hover, .j4-panel:focus-visible {
  border-color: var(--j-accent, #5cf0ff);
  box-shadow: 0 0 22px rgba(92,240,255,0.18);
  outline: none;
}

.jcl-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--j-text-soft, #7fa8b8);
  text-transform: uppercase;
  margin-bottom: 6px;
  flex: none;
}
.jcl-pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--j-accent, #5cf0ff);
  box-shadow: 0 0 8px var(--j-accent, #5cf0ff);
  flex: none;
}
.jcl-title {
  color: var(--j-text, #dff6ff);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.jcl-sub {
  margin-left: auto;
  color: var(--j-text-mute, #5a7a8a);
  white-space: nowrap;
  padding-left: 12px;
  flex: none;
}

.j4-panel-body {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(4,7,13,0.5), rgba(4,7,13,0.85));
  border: 1px dashed rgba(92,240,255,0.18);
  min-height: 0;
}
.j4-blueprint-img, .j4-deck-img {
  max-width: 96%;
  max-height: 96%;
  filter:
    invert(1)
    brightness(1.2)
    contrast(1.4)
    drop-shadow(0 0 6px var(--j-accent, #5cf0ff))
    drop-shadow(0 0 14px rgba(92,240,255,0.45));
  mix-blend-mode: screen;
  opacity: 0.92;
  transition: opacity 300ms ease;
}

.j4-blueprint-hotspots { position: absolute; inset: 0; pointer-events: none; }
.j4-hot {
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--j-accent, #5cf0ff);
  box-shadow: 0 0 0 2px rgba(4,7,13,0.85), 0 0 10px var(--j-accent, #5cf0ff);
  transform: translate(-50%, -50%);
  animation: j4-hot 2.4s ease-in-out infinite;
}
.j4-hot::after {
  content: attr(data-label);
  position: absolute;
  top: 14px; left: 50%;
  transform: translateX(-50%);
  font-family: 'Rajdhani', sans-serif;
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--j-accent, #5cf0ff);
  text-shadow: 0 0 8px rgba(0,0,0,0.85);
  white-space: nowrap;
}
.j4-hot:nth-child(2) { animation-delay: 0.6s; }
.j4-hot:nth-child(3) { animation-delay: 1.2s; }
.j4-hot:nth-child(4) { animation-delay: 1.8s; }
@keyframes j4-hot {
  0%, 100% { transform: translate(-50%, -50%) scale(0.85); }
  50%      { transform: translate(-50%, -50%) scale(1.3); }
}

.j4-scan {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 0%, transparent 48%, rgba(92,240,255,0.22) 50%, transparent 52%, transparent 100%);
  animation: j4-scan 7s linear infinite;
}
@keyframes j4-scan {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.j4-deck-pips {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 6px;
  flex: none;
}
.j4-deck-pip {
  width: 24px; height: 2px;
  background: var(--j-line, rgba(92,240,255,0.22));
}
.j4-deck-pip.is-on {
  background: var(--j-accent, #5cf0ff);
  box-shadow: 0 0 8px var(--j-accent, #5cf0ff);
}

.j4-bottom-emblem {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.j4-bottom-emblem img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: invert(1) brightness(1.2) contrast(1.5) drop-shadow(0 0 10px var(--j-accent, #5cf0ff));
  mix-blend-mode: screen;
  opacity: 0.55;
}

/* ============================================================
   ALERT TRAY (bottom-left, floats above bottom strip)
   ============================================================ */
.jarvis-alert-tray {
  position: absolute;
  left: 22px; bottom: 240px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 280px;
  z-index: 4;
  pointer-events: none;
}
.jarvis-alert {
  pointer-events: auto;
  background: linear-gradient(180deg, rgba(10,19,32,0.92), rgba(14,26,44,0.92));
  border: 1px solid var(--j-line, rgba(92,240,255,0.22));
  border-left: 3px solid var(--j-accent, #5cf0ff);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--j-text, #dff6ff);
  animation: jarvis-alert-in 420ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.jarvis-alert-pip {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--j-accent, #5cf0ff);
  box-shadow: 0 0 8px var(--j-accent, #5cf0ff);
}
.jarvis-alert-empty {
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--j-text-mute, #5a7a8a);
  padding: 8px 12px;
  border: 1px dashed var(--j-line, rgba(92,240,255,0.22));
}
@keyframes jarvis-alert-in {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   CURSOR RETICLE
   ============================================================ */
.jarvis-cursor-reticle {
  position: fixed; top: 0; left: 0;
  width: 24px; height: 24px;
  margin: -12px 0 0 -12px;
  border: 1.25px solid var(--j-accent, #5cf0ff);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
  transition: width 140ms ease, height 140ms ease, margin 140ms ease, opacity 140ms ease;
  box-shadow: 0 0 10px rgba(92,240,255,0.22);
}
.jarvis-cursor-reticle::before,
.jarvis-cursor-reticle::after {
  content: ""; position: absolute; background: var(--j-accent, #5cf0ff);
}
.jarvis-cursor-reticle::before { left: 50%; top: -5px; width: 1px; height: 4px; transform: translateX(-50%); }
.jarvis-cursor-reticle::after  { left: 50%; bottom: -5px; width: 1px; height: 4px; transform: translateX(-50%); }
.jarvis-cursor-reticle.is-snapped {
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  opacity: 1;
  box-shadow: 0 0 22px rgba(92,240,255,0.5);
}
@media (pointer: coarse) { .jarvis-cursor-reticle { display: none !important; } }

/* ============================================================
   TRANSITIONS (unchanged from v3)
   ============================================================ */
html.jarvis-powerdown #jarvis-bridge.is-mounted {
  animation: jarvis-powerdown 300ms cubic-bezier(0.5, 0, 0.8, 0.2) forwards;
}
@keyframes jarvis-powerdown {
  0%   { opacity: 1; transform: none; filter: brightness(1); }
  60%  { opacity: 0.6; filter: brightness(2); }
  100% { opacity: 0; transform: scale(0.94); filter: brightness(0); }
}
html.jarvis-powerup #jarvis-bridge.is-mounted,
html.jarvis-powerup body {
  animation: jarvis-powerup 380ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
@keyframes jarvis-powerup {
  0%   { opacity: 0; transform: scale(1.02); filter: brightness(2); }
  35%  { opacity: 0.6; filter: brightness(1.6); }
  100% { opacity: 1; transform: none; filter: brightness(1); }
}
html.jarvis-scan::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 9998;
  background: linear-gradient(180deg, transparent 0%, transparent 48%, rgba(92,240,255,0.45) 50%, transparent 52%, transparent 100%);
  animation: jarvis-scan 220ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
@keyframes jarvis-scan {
  0%   { transform: translateY(-100%); opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translateY(100%); opacity: 0; }
}

/* ============================================================
   FPS DOWNGRADE + REDUCED MOTION
   ============================================================ */
html.jarvis-downgraded .j4-orbit-ring { animation: none; }
html.jarvis-downgraded .j4-particle  { animation: none; opacity: 0; }
html.jarvis-downgraded .j4-scan      { animation: none; display: none; }
html.jarvis-downgraded .j4-hot       { animation: none; }
html.jarvis-downgraded .jarvis-cursor-reticle { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  .jarvis-ticker-track,
  .j4-orbit-ring,
  .j4-particle,
  .j4-scan,
  .j4-hot,
  .j4-blueprint-img { animation: none; }
  .j4-scan { display: none; }
}
html[data-reduce-motion="1"] .jarvis-ticker-track,
html[data-reduce-motion="1"] .j4-orbit-ring,
html[data-reduce-motion="1"] .j4-particle,
html[data-reduce-motion="1"] .j4-scan,
html[data-reduce-motion="1"] .j4-hot { animation: none; }
html[data-reduce-motion="1"] .j4-scan { display: none; }

/* ============================================================
   MOBILE — orbital onion expands to fill the viewport.
   The accordion fallback (.j4-mobile, .j4-mob-*) stays in the DOM
   so the markup is forwards-compatible if we ever want to surface
   it again, but it's hidden under 960px so phones get the full
   planetary view.
   ============================================================ */
.j4-mobile { display: none; }

/* Accordion styles preserved for any future re-use (e.g. landscape
   tablets or kiosk-narrow). Not currently shown. */
.j4-mob-row {
  background: linear-gradient(180deg, rgba(10,19,32,0.85), rgba(14,26,44,0.7));
  border: 1px solid var(--j-line, rgba(92,240,255,0.22));
  margin-bottom: 8px;
  clip-path: polygon(
    0 8px, 8px 0,
    calc(100% - 8px) 0, 100% 8px,
    100% calc(100% - 8px), calc(100% - 8px) 100%,
    8px 100%, 0 calc(100% - 8px)
  );
}
.j4-mob-row[open] { border-color: var(--j-accent, #5cf0ff); box-shadow: 0 0 16px rgba(92,240,255,0.18); }
.j4-mob-head {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--j-text, #dff6ff);
}
.j4-mob-head::-webkit-details-marker { display: none; }
.j4-mob-glyph {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--j-accent-soft, rgba(92,240,255,0.55));
  background: rgba(92,240,255,0.06);
  color: var(--j-accent, #5cf0ff);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  font-size: 16px;
}
.j4-mob-label {
  flex: 1;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 13px;
}
.j4-mob-badge {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: 'Orbitron', sans-serif;
  color: var(--j-accent, #5cf0ff);
  text-align: right;
  line-height: 1;
}
.j4-mob-badge span { font-size: 16px; font-weight: 700; }
.j4-mob-badge small {
  font-family: 'Rajdhani', sans-serif;
  font-size: 9px; letter-spacing: 0.24em;
  color: var(--j-text-mute, #5a7a8a);
  margin-top: 2px;
}
.j4-mob-chevron {
  color: var(--j-text-mute, #5a7a8a);
  font-size: 14px;
  transition: transform 200ms ease;
}
.j4-mob-row[open] .j4-mob-chevron { transform: rotate(180deg); color: var(--j-accent, #5cf0ff); }
.j4-mob-moons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 0 14px 12px;
}
.j4-mob-moon {
  background: transparent;
  border: 1px solid var(--j-line, rgba(92,240,255,0.22));
  color: var(--j-text, #dff6ff);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 11px;
  text-align: left;
}
.j4-mob-moon:hover, .j4-mob-moon:focus-visible {
  border-color: var(--j-accent, #5cf0ff);
  background: rgba(92,240,255,0.06);
  outline: none;
}
.j4-mob-moon-glyph {
  color: var(--j-accent, #5cf0ff);
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
}

@media (max-width: 960px) {
  /* ---- Show the orbital, hide the accordion fallback. ---- */
  .j4-mobile { display: none; }
  .j4-stage {
    /* Give the SVG as much vertical space as the viewport allows,
       leaving room for the slim greeting/date corners up top. */
    top: 100px;
    bottom: 16px;
    left: 0;
    right: 0;
  }
  .j4-orbital {
    /* Fill the viewport width so PLANET_R (42 in viewBox=900) lands
       around 18-20 CSS px on a phone, and the halo at PLANET_R+12
       gives a ~47 CSS px tap target — clears Apple's 44 px floor. */
    width: 100vw;
    max-width: none;
    height: 100%;
    max-height: none;
  }
  /* Turn the previously-decorative halo into a transparent hit
     target so a planet tap registers on the wider radius. */
  .j4-planet-halo { fill: transparent; }
  /* Slightly bigger label so it reads at viewport scale. */
  .j4-planet-label { font-size: 16px; }
  /* Outer-ring readouts are the most cluttered piece — drop a touch
     in size so the COG / SOG / TEMP / WIND labels don't crowd the
     planets when the SVG is small. */
  .j4-readout { font-size: 14px; }
  .j4-cardinal { font-size: 22px; }

  /* The bottom strip (vessel blueprint + deck cycler + marlin emblem)
     is decorative on mobile — drop it so the orbital owns the screen.
     The same routes are reachable via planets/moons. */
  .j4-bottom { display: none; }
  .j4-bottom-emblem { display: none; }
  .jarvis-alert-tray { display: none; }

  /* Tight corner chrome so it doesn't overlap the orbital. */
  .j4-corner-tr { max-width: 160px; top: 16px; right: 12px; }
  .j4-corner-tl { top: 16px; left: 12px; gap: 8px; }
  .j4-wm-wordmark { width: 110px; }
  .j4-greet { font-size: 12px; letter-spacing: 0.08em; }
  .j4-greet-sub { font-size: 9px; }
  .j4-wm-antler { width: 40px; height: 40px; }
  .j4-date-dd { font-size: 22px; }
  .j4-corner-bl, .j4-corner-br { display: none; }
}

/* Very narrow phones (iPhone SE, etc.) — tighten further so the
   outer-ring readouts don't collide with the corner chrome. */
@media (max-width: 420px) {
  .j4-stage { top: 92px; }
  .j4-readout { font-size: 12px; }
  .j4-cardinal { font-size: 18px; }
  .j4-planet-label { font-size: 14px; }
}
