/* ============================================
   Fan Zone — wiring diagrams (custom_913)
   The public /rig page and the Rig builder share these. Colours come from
   the theme's tokens where it has them; MIDI blue and the 13-pin purple are
   their own, so they read as different cables.
   ============================================ */

.fz-wiring { display: block; font-family: inherit; }
.fz-wiring text { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; }

.fz-wnode__box { fill: var(--surface, #111811); stroke: var(--border-light, #2c3d2c); stroke-width: 1.2; }
.fz-wnode__head { fill: var(--surface-alt, #182218); }
.fz-wnode__name { fill: var(--white, #e6efe6); font-size: 13px; font-weight: 700; }
.fz-wnode__sub { fill: var(--muted, #82a38a); font-size: 10.5px; }
.fz-wnode { cursor: pointer; }
.fz-wnode:hover .fz-wnode__box,
.fz-wnode:focus .fz-wnode__box { stroke: var(--green-light, #5a9e6e); }
.fz-wnode.is-on .fz-wnode__box,
.fz-wnode.is-sel .fz-wnode__box { stroke: var(--accent-warm, #e8c760); stroke-width: 2; }
.fz-wnode:focus { outline: none; }

.fz-jack { fill: var(--black, #070b07); stroke-width: 1.6; }
.fz-jack--audio { stroke: var(--accent-warm, #e8c760); }
.fz-jack--midi { stroke: #6fb3d9; }
.fz-jack--speaker { stroke: #d08a5b; }
.fz-jack--hex { stroke: #b48ce0; }
.fz-jack.is-used.fz-jack--audio { fill: var(--accent-warm, #e8c760); }
.fz-jack.is-used.fz-jack--midi { fill: #6fb3d9; }
.fz-jack.is-used.fz-jack--speaker { fill: #d08a5b; }
.fz-jack.is-used.fz-jack--hex { fill: #b48ce0; }
.fz-jack-label { fill: var(--muted-light, #a3bca8); font-size: 10px; }

.fz-cable { fill: none; stroke-linecap: round; }
.fz-cable--audio { stroke: var(--accent-warm, #e8c760); stroke-width: 2; opacity: 0.9; }
.fz-cable--midi { stroke: #6fb3d9; stroke-width: 1.8; stroke-dasharray: 6 4; }
.fz-cable--speaker { stroke: #d08a5b; stroke-width: 4; opacity: 0.9; }
.fz-cable--hex { stroke: #b48ce0; stroke-width: 2.4; stroke-dasharray: 1.5 4; }
.fz-cable-label { fill: var(--text-pale, #c8d8c8); font-size: 10px; paint-order: stroke; stroke: var(--black, #070b07); stroke-width: 3px; }

/* Public page: the diagram gets the window's width (not just the text
   column), fitted so the whole rig shows at once. "Zoom in" (js/rig.js)
   shows it at full size to scroll around; a phone starts at a readable
   size, scrolled to the start of the chain. */
.fz-wiring-wrap {
  position: relative; left: 50%; transform: translateX(-50%);
  width: min(calc(100vw - 2rem), var(--fz-wiring-w, 100%));
  margin: 0 0 1.5rem;
}
.fz-wiring-scroll {
  overflow: auto; -webkit-overflow-scrolling: touch;
  border-top: 1px solid var(--border, #1c2c1c); border-bottom: 1px solid var(--border, #1c2c1c);
  padding: 0.75rem 0;
}
.fz-wiring-scroll .fz-wiring { width: 100%; height: auto; }
.fz-wiring-scroll.is-zoomed { max-height: 85vh; }
.fz-wiring-scroll.is-zoomed .fz-wiring { width: var(--fz-wiring-w); max-width: none; }
.fz-zoom {
  font: inherit; font-size: 0.75rem; text-transform: none; letter-spacing: normal; cursor: pointer;
  padding: 0.3rem 0.8rem; min-height: 2rem; border-radius: 999px;
  background: transparent; color: var(--accent-warm, #e8c760); border: 1px solid var(--accent-warm, #e8c760);
}
.fz-zoom[hidden] { display: none; }
@media (max-width: 40rem) {
  .fz-wiring-scroll .fz-wiring { width: var(--fz-wiring-min); max-width: none; }
}
.fz-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; justify-content: center; margin-top: 0.6rem; font-size: 0.75rem; color: var(--muted, #82a38a); }
.fz-legend__item::before { content: ""; display: inline-block; width: 1.6rem; height: 0; vertical-align: middle; margin-right: 0.4rem; border-top: 2px solid; }
.fz-legend__item--audio::before { border-color: var(--accent-warm, #e8c760); }
.fz-legend__item--midi::before { border-top-style: dashed; border-color: #6fb3d9; }
.fz-legend__item--hex::before { border-top-style: dotted; border-top-width: 3px; border-color: #b48ce0; }
.fz-legend__item--speaker::before { border-top-width: 4px; border-color: #d08a5b; }
.fz-legend__hint { flex-basis: 100%; text-align: center; }
@media (max-width: 40rem) { .fz-legend__hint::after { content: " Swipe the diagram sideways."; } }

/* Builder only. */
.fz-cable-hit { fill: none; stroke: transparent; stroke-width: 14; cursor: pointer; }
.fz-cablehit.is-sel .fz-cable { stroke-width: 4; filter: drop-shadow(0 0 3px rgba(232, 199, 96, 0.8)); }
.fz-jack-hit { fill: transparent; cursor: crosshair; }
.fz-jack.is-pending { r: 7; stroke-width: 3; }
.fz-rubber { fill: none; stroke: var(--accent-warm, #e8c760); stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
.fz-builder { touch-action: none; user-select: none; -webkit-user-select: none; }
.fz-bnode { cursor: grab; }
.fz-bnode.is-overlap .fz-wnode__box { stroke: #d9534f; stroke-width: 2; stroke-dasharray: 6 4; }

/* ── custom_919: the tidy diagram (Tidy.php) ── */
.fz-tcable { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.fz-tcable.fz-cable--audio { stroke: var(--accent-warm, #e8c760); stroke-width: 1.8; opacity: 0.95; }
.fz-tcable.fz-cable--midi { stroke: #6fb3d9; stroke-width: 1.5; stroke-dasharray: 5 4; }
.fz-tcable.fz-cable--hex { stroke: #b48ce0; stroke-width: 2; stroke-dasharray: 1.5 3.5; }
.fz-tcable.fz-cable--speaker { stroke: #d08a5b; stroke-width: 3.5; }
.fz-arrow path { stroke: none; }
.fz-arrow--audio path { fill: var(--accent-warm, #e8c760); }
.fz-arrow--midi path { fill: #6fb3d9; }
.fz-arrow--hex path { fill: #b48ce0; }
.fz-arrow--speaker path { fill: #d08a5b; }
.fz-wiring--tidy .fz-wnode__box { fill: var(--surface, #111811); stroke: var(--border-light, #2c3d2c); }
.fz-wiring--tidy .fz-tnode--loop .fz-wnode__box { fill: var(--surface-alt, #161e16); }
.fz-wnode__name--sm { font-size: 12px; }
.fz-loop-label { fill: var(--muted, #82a38a); font-size: 9.5px; letter-spacing: 0.04em; }
.fz-midi-mark { fill: #6fb3d9; font-size: 8.5px; font-weight: 700; letter-spacing: 0.08em; }

/* ── custom_921: expression (control) cables ── */
.fz-jack--expr { stroke: #5fc4b5; }
.fz-jack.is-used.fz-jack--expr { fill: #5fc4b5; }
.fz-cable--expr { stroke: #5fc4b5; stroke-width: 1.6; stroke-dasharray: 7 3 1.5 3; }
.fz-tcable.fz-cable--expr { stroke: #5fc4b5; stroke-width: 1.6; stroke-dasharray: 7 3 1.5 3; }
.fz-arrow--expr path { fill: #5fc4b5; }
.fz-mark--expr { fill: #5fc4b5; }
.fz-control-note { fill: #5fc4b5; font-size: 9.5px; }
.fz-legend__item--expr::before { border-top-style: dashed; border-color: #5fc4b5; }
