/* Final narrow-screen alignment for the music and fan laboratories. */
@media (max-width: 700px) {
  .circuit-lab + .music-lab .music-stage,
  .fan-stage { padding-inline: 16px; }

  .circuit-lab + .music-lab .music-row,
  .circuit-lab + .music-lab .music-schematic__row,
  .fan-row,
  .fan-scheme-row {
    grid-template-columns: minmax(0, .95fr) minmax(0, .78fr) minmax(0, 1.27fr);
    gap: 30px !important;
    grid-template-columns: minmax(0, .95fr) minmax(0, .78fr) minmax(0, 1.27fr) !important;
  }

  .circuit-lab + .music-lab .music-card,
  .fan-card { min-width: 0; padding-inline: 3px; }

  .circuit-lab + .music-lab .music-terminal,
  .fan-terminal { width: 15px !important; height: 15px !important; border-width: 2px !important; }
  .circuit-lab + .music-lab .music-terminal.left,
  .fan-terminal.left { left: -7px !important; }
  .circuit-lab + .music-lab .music-terminal.right,
  .fan-terminal.right { right: -7px !important; }

  .circuit-lab + .music-lab .music-card h3,
  .fan-card h3 {
    max-width: 100%;
    font-size: 10px;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }

  .fan-card:last-child h3 {
    max-width: calc(100% - 6px);
    font-size: 8.5px;
    line-height: 1.12;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
  }
  .circuit-lab + .music-lab .music-card small,
  .fan-card small { font-size: 7px; }

  .circuit-lab + .music-lab .module-shell {
    width: calc(100% - 4px);
    padding: 5px 2px;
  }
  .circuit-lab + .music-lab .module-title { font-size: 7px; line-height: 1.08; }
  .circuit-lab + .music-lab .module-chain { gap: 1px; }
  .circuit-lab + .music-lab .module-block {
    min-width: 0;
    min-height: 38px;
    padding: 2px 1px;
    font-size: 5.5px;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }
  .circuit-lab + .music-lab .module-arrow { font-size: 8px; }

  /* Remove the two obsolete short strokes left by the old switch drawing. */
  .music-schematic .scheme-switch { border-bottom: 0 !important; }
  .music-schematic .scheme-switch > em { display: none !important; }

  .music-scheme-card > i,
  .fan-symbol > i { width: 15px !important; height: 15px !important; border-width: 2px !important; }
  .music-scheme-card > i:first-child,
  .fan-symbol > i:first-child { left: -7px !important; }
  .music-scheme-card > i:nth-of-type(2),
  .fan-symbol > i:nth-of-type(2) { right: -7px !important; }

  .circuit-lab + .music-lab .music-schematic {
    padding-bottom: 0 !important;
  }
  .circuit-lab + .music-lab .music-stage {
    padding-bottom: 22px !important;
  }
  .circuit-lab + .music-lab .music-controls {
    margin-top: 8px !important;
  }

  .circuit-lab + .music-lab .music-scheme-card:nth-child(2) h3 {
    width: calc(100% - 6px);
    white-space: nowrap;
    font-size: 6.5px !important;
    overflow-wrap: normal;
  }

  .music-scheme-card h3,
  .fan-symbol h3 {
    max-width: calc(100% - 8px);
    font-size: 7px !important;
    line-height: 1.05;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .circuit-lab + .music-lab .scheme-module {
    width: 116px;
    transform: translate(-50%, -50%) scale(.68);
  }
  .circuit-lab + .music-lab .music-scheme-card.module:before,
  .circuit-lab + .music-lab .music-scheme-card.module:after {
    width: calc(50% - 43px);
  }

  .fan-unit { width: 72px; height: 72px; }
  .fan-rotor { transform: scale(.48); }
  .fan-stage.forward .fan-rotor { animation-name: fan-cw-mobile-tight; }
  .fan-stage.reverse .fan-rotor { animation-name: fan-ccw-mobile-tight; }
}

/* Keep the schematic switch itself on the same axis as the red wire terminals. */
.symbol-card > .switch-symbol,
.fan-symbol > .switch-symbol,
.music-schematic .scheme-switch {
  top: 50% !important;
  height: 0 !important;
  transform: translate(-50%, 0) !important;
}

.symbol-card > .switch-symbol i,
.fan-symbol > .switch-symbol i,
.music-schematic .scheme-switch::before,
.music-schematic .scheme-switch::after {
  top: 0 !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
}

.symbol-card > .switch-symbol span,
.fan-symbol > .switch-symbol span,
.music-schematic .scheme-switch b {
  top: -2px !important;
  bottom: auto !important;
  transform: rotate(-25deg) !important;
  transform-origin: left center !important;
}

.circuit-stage.is-closed .switch-symbol span,
.fan-stage.closed .switch-symbol span,
.music-stage.closed .scheme-switch b {
  transform: rotate(0) !important;
}

/* Anchor the rotor by its real 116 x 116 px centre; animation may rotate/scale it
   without moving the hub away from the centre of the outer ring. */
.fan-unit .fan-rotor {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  margin: -58px 0 0 -58px !important;
}

.fan-card:last-child h3 {
  width: 100% !important;
  margin-inline: 0 !important;
  text-align: center !important;
}

@media (max-width: 430px) {
  .circuit-lab + .music-lab .music-board,
  .fan-board { padding-inline: 7px; }
  .circuit-lab + .music-lab .music-stage,
  .fan-stage { padding-inline: 13px; }
  .circuit-lab + .music-lab .music-row,
  .circuit-lab + .music-lab .music-schematic__row,
  .fan-row,
  .fan-scheme-row { gap: 27px !important; }

  .circuit-lab + .music-lab .music-battery { width: 49px; }
  .fan-battery { width: 68px; }
  .circuit-lab + .music-lab .music-toggle,
  .fan-toggle { transform: scale(.88); }
  .fan-unit { width: 66px; height: 66px; }

  .music-schematic__title,
  .fan-scheme-title { gap: 6px; align-items: center; line-height: 1.15; }
}

@keyframes fan-cw-mobile-tight {
  from { transform: scale(.48) rotate(0); }
  to { transform: scale(.48) rotate(360deg); }
}
@keyframes fan-ccw-mobile-tight {
  from { transform: scale(.48) rotate(0); }
  to { transform: scale(.48) rotate(-360deg); }
}
