/* Yellowjacket — bench faceplate. Reference world: test equipment, not software. */

:root {
  --yj-bg:        #0B0A07;
  --yj-panel:     #12110C;
  --yj-well:      #070604;
  --yj-line:      #262418;
  --yj-line-hi:   #3A3722;
  --yj-yellow:    #FFD400;
  --yj-yellow-hi: #FFE45C;
  --yj-amber:     #C79A00;
  --yj-amber-dim: #6E5A10;
  --yj-ink:       #E8E4D4;
  --yj-ink-dim:   #94906F;
  --yj-caution:   #FF9E00;   /* semantic caution — distinct from brand yellow (FAA 25.1322 borrow) */
  --yj-hot:       #D7FF00;   /* chartreuse — peaks, hottest spectrogram energy */
  --yj-nominal:   #58D68D;
  --yj-fault:     #FF5C45;
  --yj-select:    rgba(255, 212, 0, 0.14);
  --yj-cut:       rgba(255, 92, 69, 0.10);
  --yj-wave:      #D9B830;
  /* The other take. Yellow is always what you are hearing; blue is the version
     you are not — the original behind a render, or the render behind the
     original. Cyan-leaning so it separates from the yellow at any overlap
     rather than muddying toward green. */
  --yj-blue:      #7FD4F5;
  --yj-blue-dim:  #2E5C6E;

  --yj-hazard: repeating-linear-gradient(-45deg,
      var(--yj-yellow) 0 5.66px, #0B0A07 5.66px 11.31px);
  --yj-hazard-dim: repeating-linear-gradient(-45deg,
      rgba(255,212,0,.28) 0 5.66px, transparent 5.66px 11.31px);

  --f-ui: "Archivo", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Class display rules (flex/grid) silently beat the UA's [hidden] sheet;
   this guard makes the hidden attribute mean what it says, everywhere. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  background: var(--yj-bg);
  color: var(--yj-ink);
  font-family: var(--f-ui);
  font-size: 13px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
canvas { display: block; }

::selection { background: var(--yj-yellow); color: #000; }

/* ---------- silkscreen label utility ---------- */
.yj-label,
.yj-panel[data-label]::before,
.yj-param-label,
.yj-readouts dt,
.yj-led-text,
.yj-mark-sub {
  font-family: var(--f-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--yj-ink-dim);
}

/* ---------- header ---------- */
.yj-top {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--yj-line);
  background: var(--yj-panel);
}

.yj-mark { display: flex; flex-direction: column; gap: 3px; min-width: 170px; }
.yj-mark-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--yj-yellow);
}
.yj-mark-bar { display: block; height: 5px; width: 148px; background: var(--yj-hazard); }
.yj-mark-sub { font-size: 9px; }

.yj-transport {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 auto;
}

.yj-io { display: flex; align-items: center; gap: 6px; min-width: 0; flex-wrap: wrap; }
.yj-io-group { display: flex; gap: 6px; padding-right: 8px; margin-right: 2px; border-right: 1px solid var(--yj-line); }
@media (min-width: 1100px) { .yj-btn-command { margin-left: auto; } }
.yj-history { display: flex; gap: 2px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--yj-line); }
.yj-btn-compact { padding-left: 8px; padding-right: 8px; font-size: 10px; }
.yj-btn-command { border-color: var(--yj-amber-dim); }
.yj-btn-command span { font-family: var(--f-mono); font-size: 9px; color: var(--yj-amber); }

/* ---------- buttons: machined, flat, 2px radius max ---------- */
.yj-btn {
  border: 1px solid var(--yj-line);
  background: var(--yj-panel);
  color: var(--yj-yellow);
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 7px 12px;
  border-radius: 2px;
  white-space: nowrap;
}
.yj-btn:hover:not(:disabled) { border-color: var(--yj-line-hi); color: var(--yj-yellow-hi); }
.yj-btn:active:not(:disabled) { transform: translateY(1px); }
.yj-btn:disabled { color: var(--yj-amber-dim); cursor: default; }
.yj-btn:focus-visible { outline: 1px solid var(--yj-yellow); outline-offset: 2px; }

.yj-btn-primary {
  background: var(--yj-yellow);
  border-color: var(--yj-yellow);
  color: #0B0A07;
}
.yj-btn-primary:hover:not(:disabled) { background: var(--yj-yellow-hi); border-color: var(--yj-yellow-hi); color: #000; }
.yj-btn-primary:disabled { background: var(--yj-amber-dim); border-color: var(--yj-amber-dim); color: #0B0A07; }
/* One focus rule for every control the per-class rules missed (zero
   specificity, so those still win): 1px yellow, offset 2, no glow. */
:where(button, select, a, input, [tabindex]):focus-visible { outline: 1px solid var(--yj-yellow); outline-offset: 2px; }

.yj-btn-play { min-width: 74px; }
.yj-btn.is-active { background: var(--yj-yellow); border-color: var(--yj-yellow); color: #0B0A07; }

.yj-btn.is-working {
  background: var(--yj-hazard);
  color: #000;
  border-color: var(--yj-yellow);
  animation: yj-crawl 0.7s linear infinite;
}
@keyframes yj-crawl { to { background-position: -11.31px 0; } }

/* ---------- readout wells ---------- */
.yj-well {
  background: var(--yj-well);
  border: 1px solid var(--yj-line);
  box-shadow: inset 0 1px 0 rgba(0,0,0,.7);
  border-radius: 2px;
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: var(--yj-yellow);
  padding: 6px 9px;
  font-size: 12px;
  text-align: right;
  min-width: 64px;
}
.yj-time { font-size: 14px; min-width: 118px; letter-spacing: 0.02em; }
.yj-time-dim { color: var(--yj-amber); }
.yj-count { font-size: 11px; }
.yj-count-wide { text-align: center; margin-top: 8px; }

/* ---------- tabs: machine toggles with chevron underbar ---------- */
.yj-tabs {
  display: flex;
  gap: 2px;
  padding: 0 16px;
  border-bottom: 1px solid var(--yj-line);
  background: var(--yj-panel);
}
.yj-tab-btn {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--yj-ink-dim);
  padding: 11px 18px 9px;
  border-bottom: 5px solid transparent;
}
.yj-tab-btn { position: relative; }
/* A running job crawls the underbar of the tab that owns it — dim from other
   tabs, full hazard on the active one. The 5 px sits on the border the tab
   already reserves; border-image cannot animate, hence the pseudo. */
.yj-tab-btn.is-working::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px; height: 5px;
  background: var(--yj-hazard-dim); animation: yj-crawl 0.7s linear infinite;
}
.yj-tab-btn.is-active.is-working::after { background: var(--yj-hazard); }
.yj-tab-btn:hover { color: var(--yj-ink); }
.yj-tab-btn.is-active { color: var(--yj-yellow); border-image: var(--yj-hazard) 1; border-bottom: 5px solid; }
.yj-tab-btn:focus-visible { outline: 1px solid var(--yj-yellow); outline-offset: -3px; }

/* ---------- main / panes ---------- */
.yj-main { flex: 1; overflow: hidden; display: flex; }
.yj-tabpane { display: none; flex: 1; flex-direction: column; gap: 10px; padding: 12px 16px; overflow: hidden; min-width: 0; }
.yj-tabpane.is-active { display: flex; }
.yj-studio-host { flex: 1; min-height: 0; min-width: 0; }

.yj-cols { display: flex; gap: 10px; flex: 1; min-height: 0; }
.yj-grow { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.yj-rail { width: 264px; flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }

/* ---------- panels with silkscreen labels ---------- */
.yj-panel {
  position: relative;
  background: var(--yj-panel);
  border: 1px solid var(--yj-line);
  border-radius: 2px;
  padding: 22px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.yj-panel[data-label]::before {
  content: attr(data-label);
  position: absolute;
  top: 5px;
  left: 12px;
}
.yj-panel[data-label]::after {
  content: "";
  position: absolute;
  top: 11px;
  left: 0;
  width: 6px;
  border-top: 1px solid var(--yj-line);
}

/* ---------- transcript ---------- */
.yj-transcript-wrap { flex: 1; }
.yj-transcript {
  flex: 1;
  overflow-y: auto;
  font-family: var(--f-mono);
  font-size: 14px;
  line-height: 2.1;
  padding: 6px 8px;
  user-select: none;
}
.yj-word {
  appearance: none;
  display: inline-block;
  background: transparent;
  padding: 0 3px;
  margin: 0 1px;
  border-radius: 2px;
  font: inherit;
  line-height: inherit;
  color: var(--yj-ink);
  cursor: pointer;
  border: 1px solid transparent;
}
.yj-word:focus-visible,
.yj-gap:focus-visible { outline: 1px solid var(--yj-yellow); outline-offset: 1px; }
.yj-word:hover { border-color: var(--yj-line-hi); }
.yj-word.is-now { background: var(--yj-yellow); color: #000; }
.yj-word.is-filler { background: var(--yj-yellow); color: #000; box-shadow: 0 0 0 1px #000 inset; }
.yj-word.is-sel { background: var(--yj-select); border-color: var(--yj-amber-dim); }
.yj-word.is-cut {
  color: var(--yj-amber-dim);
  text-decoration: line-through;
  text-decoration-color: var(--yj-fault);
  background: var(--yj-hazard-dim);
  background-size: auto;
}
.yj-word.is-cut.is-filler { box-shadow: none; }
.yj-gap {
  appearance: none;
  display: inline-block;
  background: transparent;
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--yj-ink-dim);
  border: 1px dashed var(--yj-line-hi);
  border-radius: 2px;
  padding: 0 5px;
  margin: 0 3px;
  cursor: pointer;
}
.yj-gap.is-cut { background: var(--yj-hazard-dim); color: var(--yj-amber-dim); text-decoration: line-through; }

.yj-hint { color: var(--yj-ink-dim); font-family: var(--f-ui); font-size: 12.5px; line-height: 1.6; max-width: 46em; user-select: text; }
.yj-hint-small { font-size: 11px; }

/* ---------- rail widgets ---------- */
.yj-select {
  background: var(--yj-well);
  color: var(--yj-ink);
  border: 1px solid var(--yj-line);
  border-radius: 2px;
  font-family: var(--f-mono);
  font-size: 11.5px;
  padding: 6px 8px;
  width: 100%;
}

.yj-led-row { display: flex; align-items: center; gap: 7px; }
.yj-led {
  width: 7px; height: 7px;
  background: var(--yj-amber-dim);
  flex-shrink: 0;
}
.yj-led.is-on { background: var(--yj-nominal); }
.yj-led.is-busy { background: var(--yj-yellow); animation: yj-blink 1s step-end infinite; }
.yj-led.is-stale { background: var(--yj-amber); }
.yj-led.is-fault { background: var(--yj-fault); }
@keyframes yj-blink { 50% { opacity: 0.25; } }

.yj-toolrow { display: flex; gap: 6px; align-items: center; }
.yj-toolrow .yj-btn { flex: 1; }
.yj-toolrow .yj-well { flex-shrink: 0; }
.yj-toolrow-4 .yj-btn { padding-left: 4px; padding-right: 4px; }

.yj-param { display: flex; align-items: center; gap: 8px; }
.yj-param-label { flex-shrink: 0; width: 88px; }
.yj-param-val {
  font-family: var(--f-mono); font-size: 11px; color: var(--yj-yellow);
  font-variant-numeric: tabular-nums; width: 58px; text-align: right; flex-shrink: 0;
}

/* range inputs: flat track, machined square thumb */
input[type="range"] { -webkit-appearance: none; appearance: none; flex: 1; height: 18px; background: transparent; min-width: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--yj-line-hi); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 9px; height: 16px; margin-top: -7px;
  background: var(--yj-yellow); border-radius: 1px;
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--yj-line-hi); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 16px; background: var(--yj-yellow); border: none; border-radius: 1px; }
input[type="range"]:focus-visible { outline: 1px solid var(--yj-yellow); outline-offset: 2px; }
input[type="range"]:disabled::-webkit-slider-thumb { background: var(--yj-amber-dim); }
input[type="range"]:disabled::-moz-range-thumb { background: var(--yj-amber-dim); }

/* ---------- progress: crawling chevrons ---------- */
.yj-progress {
  position: relative;
  height: 18px;
  border: 1px solid var(--yj-line);
  background: var(--yj-well);
  border-radius: 2px;
  overflow: hidden;
}
.yj-progress-fill {
  height: 100%;
  background: var(--yj-hazard);
  animation: yj-crawl 0.7s linear infinite;
  transition: width 0.25s;
}
.yj-progress-note {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: 10px; color: var(--yj-ink);
  text-shadow: 0 0 3px #000, 0 0 3px #000;
}

/* ---------- canvases ---------- */
.yj-canvas { width: 100%; background: var(--yj-well); border: 1px solid var(--yj-line); }
.yj-canvas-wave { height: 180px; flex-shrink: 0; }
.yj-canvas-preview { height: 110px; }
.yj-preview { flex: 0 0 auto; }
#btnPlay.is-sounding { border-color: var(--yj-yellow); color: var(--yj-yellow); }
.yj-sounding { min-width: 96px; }
.yj-conversion { font-size: 8.5px; letter-spacing: 0.1em; color: var(--yj-ink-dim); max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yj-conversion.is-fault { color: var(--yj-fault); }
.yj-sounding .yj-led.is-sounding { background: var(--yj-yellow); }
.yj-sounding .yj-led-text { color: var(--yj-yellow); }
.yj-preview-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.yj-preview-out { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.08em; color: var(--yj-blue); }
.yj-preview-out.is-dim { color: var(--yj-ink-dim); }
.yj-canvas-spec { flex: 1; min-height: 220px; }
.yj-canvas-slice { flex: 1; min-height: 260px; touch-action: none; }
.yj-canvas-slice:focus-visible { outline: 1px solid var(--yj-yellow); outline-offset: -1px; }

/* spectrogram layering: GPU image beneath, overlays on the 2D canvas above */
.yj-specwrap { position: relative; flex: 1; min-height: 220px; display: flex; background: var(--yj-well); border: 1px solid var(--yj-line); }
/* The overlay canvas must not paint a CSS background: it would hide the GPU
   image below it. The well color moves to the wrapper; in the 2D fallback the
   composite fills the bitmap opaquely anyway. */
.yj-specwrap .yj-canvas-spec { position: relative; z-index: 1; flex: 1; min-height: 0; background: transparent; border: 0; }
.yj-canvas-gpu {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  background: var(--yj-well);
  border: 1px solid var(--yj-line);
}

/* resume panel in the drop zone */
.yj-resume {
  border-bottom: 1px solid var(--yj-line);
  padding-bottom: 14px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}
/* A tab discard removed the working set: the chevrons say "removed". */
.yj-resume.is-discarded { padding-left: 12px; }
.yj-resume.is-discarded::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--yj-hazard); }
.yj-resume-info {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--yj-yellow);
}

/* ---------- WIRE: hardware I/O panel ---------- */
.yj-btn-block { width: 100%; }
.yj-wire-copy { max-width: 560px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.yj-wire-copy p { font-size: 13px; color: var(--yj-ink-dim); line-height: 1.5; }
.yj-wire-row { align-items: center; }
.yj-wire-label { font-family: var(--f-mono); font-size: 10px; color: var(--yj-ink-dim); letter-spacing: 0.08em; }
.yj-wire-sel { flex: 1; min-width: 120px; }
.yj-wire-well {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em;
  padding: 8px 10px; flex: 1; white-space: nowrap; overflow: hidden;
}
.yj-wire-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; margin-top: 10px; }
.yj-wire-chip {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.05em;
  padding: 6px 8px; text-align: left; cursor: pointer;
  background: var(--yj-well); border: 1px solid var(--yj-line); color: var(--yj-ink-dim);
}
.yj-wire-chip .b { color: var(--yj-yellow); display: block; margin-top: 2px; }
.yj-wire-chip.is-armed { border-color: var(--yj-yellow); color: var(--yj-yellow); animation: yj-blink 0.8s steps(2) infinite; }
.yj-wire-chip.is-bound { color: var(--yj-ink); }

.yj-constellation {
  width: 100%; height: 190px; display: block;
  background: var(--yj-well); border: 1px solid var(--yj-line);
  touch-action: none;
}

/* ---------- LOOM: semantic source × MIDI performance compiler ---------- */
.yj-loom-host { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; }
.yj-loom { display: flex; flex-direction: column; gap: 10px; min-width: 1040px; }
.yj-loom-equation { flex-shrink: 0; }
.yj-loom-equation-row {
  display: grid;
  grid-template-columns: minmax(180px,1fr) 26px minmax(210px,1fr) 26px minmax(190px,1fr);
  align-items: center;
  gap: 7px;
}
.yj-loom-equation-well { text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.yj-loom-result { color: var(--yj-hot); border-color: var(--yj-amber-dim); }
.yj-loom-operator { font: 700 19px/1 var(--f-mono); color: var(--yj-yellow); text-align: center; }
.yj-loom-thesis {
  font: 600 9px/1.3 var(--f-mono); letter-spacing: .11em;
  color: var(--yj-ink-dim); text-align: center;
}
.yj-loom-inputs {
  display: grid;
  grid-template-columns: minmax(330px,1.15fr) minmax(390px,1.25fr) minmax(188px,.6fr);
  gap: 10px;
  flex-shrink: 0;
}
.yj-loom-source-readout,.yj-loom-gesture-readout {
  text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.yj-loom-capture {
  display: grid; grid-template-columns: minmax(128px,.72fr) 6px minmax(132px,1fr);
  align-items: center; gap: 7px; min-height: 29px;
}
.yj-loom-capture-btn { min-width: 128px; }
.yj-loom-capture-copy {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--yj-ink-dim); font: 600 9px/1 var(--f-mono); letter-spacing: .05em;
}
.yj-loom-capture.is-active .yj-loom-capture-copy { color: var(--yj-yellow); }
.yj-loom-wave { width: 100%; height: 72px; border: 1px solid var(--yj-line); background: var(--yj-well); }
.yj-loom-token-strip { display: flex; gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.yj-loom-token {
  min-width: 34px; max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  background: var(--yj-well); border: 1px solid var(--yj-line); color: var(--yj-yellow);
  padding: 5px 7px; font: 600 9px/1 var(--f-mono); letter-spacing: .04em; border-radius: 1px;
}
.yj-loom-token:hover { border-color: var(--yj-yellow); }
.yj-loom-empty { color: var(--yj-ink-dim); font: 10px/1.55 var(--f-mono); letter-spacing: .03em; }
.yj-loom-midi-mini { display: grid; grid-template-columns: repeat(16,minmax(22px,1fr)); gap: 2px; }
.yj-loom-midi-step {
  min-width: 0; height: 34px; display: flex; align-items: flex-end; justify-content: center;
  padding: 3px 1px; border: 1px solid var(--yj-line); background: var(--yj-well);
  color: var(--yj-ink-dim); font: 8px/1 var(--f-mono);
}
.yj-loom-midi-step.is-on {
  color: #0B0A07; border-color: var(--yj-yellow);
  background: linear-gradient(to top,var(--yj-yellow) 0 var(--fill),var(--yj-panel) var(--fill));
}
.yj-loom-midi-step.is-collision { color: var(--yj-bg); background: var(--yj-yellow); font-weight: 700; }
.yj-loom-build .yj-readouts dd { min-width: 82px; font-size: 10px; }
.yj-loom-empty-map { min-height: 230px; align-items: center; justify-content: center; }
.yj-loom-empty-hero {
  color: var(--yj-amber-dim); font: 700 28px/1 var(--f-ui); letter-spacing: .16em;
  padding-bottom: 12px; background: var(--yj-hazard-dim) bottom/auto 5px repeat-x;
}
.yj-loom-output { display: grid; grid-template-columns: minmax(760px,1fr) 254px; gap: 10px; min-height: 0; }
.yj-loom-map-panel { overflow-x: auto; }
.yj-loom-map { display: flex; flex-direction: column; gap: 2px; min-width: 780px; }
.yj-loom-map-row { display: grid; grid-template-columns: 76px repeat(16,minmax(34px,1fr)); gap: 2px; }
.yj-loom-lane {
  display: flex; align-items: center; color: var(--yj-ink-dim);
  font: 600 9px/1 var(--f-ui); letter-spacing: .09em;
}
.yj-loom-map-step,.yj-loom-map-cell {
  min-width: 0; min-height: 31px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--yj-line); background: var(--yj-well);
  color: var(--yj-ink-dim); font: 9px/1 var(--f-mono); padding: 2px;
  overflow: hidden; text-overflow: ellipsis;
}
.yj-loom-map-step { min-height: 20px; border-color: transparent; background: transparent; color: var(--yj-amber-dim); }
.yj-loom-map-cell.is-event { color: var(--yj-yellow); cursor: pointer; }
.yj-loom-map-cell.is-event:hover { border-color: var(--yj-yellow); }
.yj-loom-map-cell.is-collision { color: var(--yj-bg); background: var(--yj-yellow); border-color: var(--yj-yellow); font-weight: 700; }
.yj-loom-map-cell.is-selected { border-color: var(--yj-yellow); background: var(--yj-select); }
.yj-loom-map-cell.is-collision.is-selected { color: var(--yj-bg); background: var(--yj-yellow-hi); }
.yj-loom-map-cell.is-playing { outline: 2px solid var(--yj-hot); outline-offset: -2px; color: var(--yj-hot); }
.yj-loom-map-cell.is-rest { border-color: #1b1a12; color: #45422e; }
.yj-loom-output-actions,.yj-loom-replace-actions { flex-wrap: wrap; }
.yj-loom-arm-state {
  display: flex; align-items: center; gap: 7px; min-height: 27px; margin-bottom: 7px;
  padding: 5px 8px; border: 1px solid var(--yj-line); background: var(--yj-well);
}
.yj-loom-arm-state.is-armed { border-color: var(--yj-amber-dim); }
.yj-loom-arm-state.is-offline { border-color: rgba(255,92,69,.42); }
.yj-loom-arm-copy {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--yj-ink-dim); font: 600 9px/1 var(--f-mono); letter-spacing: .06em;
}
.yj-loom-arm-state.is-armed .yj-loom-arm-copy { color: var(--yj-yellow); }
.yj-loom-arm-state.is-offline .yj-loom-arm-copy { color: var(--yj-fault); }
.yj-loom-trace .yj-readouts dd {
  min-width: 132px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 9px;
}
.yj-loom-trace .yj-toolrow { flex-wrap: wrap; }

@media (max-width: 1120px) {
  .yj-loom { min-width: 860px; }
  .yj-loom-inputs { grid-template-columns: 1fr 1fr; }
  .yj-loom-build { grid-column: 1 / -1; }
  .yj-loom-build .yj-readouts { display: grid; grid-template-columns: repeat(3,1fr); }
  .yj-loom-output { grid-template-columns: 1fr; }
  .yj-loom-trace { display: grid; grid-template-columns: 1fr auto; }
}

/* ---------- credit line ---------- */
.yj-credit {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.05em;
  color: var(--yj-ink-dim); text-align: center; padding: 10px 16px 14px;
}
.yj-credit a { color: var(--yj-amber-dim); text-decoration: none; }
.yj-credit a:hover { color: var(--yj-yellow); }

/* ---------- machine substates ---------- */
.yj-substate { display: flex; gap: 2px; flex-shrink: 0; }
.yj-substate-btn {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--yj-ink-dim);
  padding: 6px 14px 5px;
  border: 1px solid var(--yj-line);
  border-radius: 2px;
  background: var(--yj-panel);
}
.yj-substate-btn:hover { color: var(--yj-ink); }
.yj-substate-btn.is-active { color: #0B0A07; background: var(--yj-yellow); border-color: var(--yj-yellow); }
.yj-substate-btn:focus-visible { outline: 1px solid var(--yj-yellow); outline-offset: 2px; }
.yj-mstate { display: none; flex: 1; min-height: 0; flex-direction: column; gap: 10px; }
.yj-mstate.is-active { display: flex; }
.yj-pattern-host { flex: 1; min-height: 0; overflow-y: auto; }
.yj-canvas-note { font-family: var(--f-mono); font-size: 10px; color: var(--yj-ink-dim); padding-top: 4px; }

.yj-wavestrip { flex-shrink: 0; height: 118px; }
.yj-wavestrip canvas { width: 100%; height: 100%; background: var(--yj-well); border: 1px solid var(--yj-line); }

/* ---------- meters ---------- */
.yj-meter { width: 100%; height: 46px; background: var(--yj-well); border: 1px solid var(--yj-line); }
.yj-clip-led {
  align-self: flex-start;
  font-family: var(--f-ui); font-size: 9px; font-weight: 700; letter-spacing: 0.1em;
  color: var(--yj-ink-dim);
  border: 1px solid var(--yj-line);
  border-radius: 2px;
  padding: 3px 8px;
}
.yj-clip-led.is-lit { background: var(--yj-fault); color: #000; border-color: var(--yj-fault); }

/* ---------- readout lists ---------- */
.yj-readouts { display: flex; flex-direction: column; gap: 6px; }
.yj-readouts > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.yj-readouts dd { min-width: 96px; }
.yj-readouts dd.is-fault { color: var(--yj-fault); }

/* ---------- rack modules ---------- */
#rackHost { overflow-y: auto; }
.yj-mod { flex-shrink: 0; }
.yj-mod-head { display: flex; align-items: center; gap: 10px; }
.yj-mod-power {
  width: 14px; height: 14px;
  border: 1px solid var(--yj-line-hi);
  border-radius: 1px;
  background: var(--yj-well);
  padding: 0;
  flex-shrink: 0;
}
.yj-mod-power.is-on { background: var(--yj-yellow); border-color: var(--yj-yellow); }
.yj-mod-title { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; color: var(--yj-ink); }
.yj-mod.is-off .yj-mod-title { color: var(--yj-ink-dim); }
.yj-mod-tag { font-family: var(--f-mono); font-size: 10px; color: var(--yj-ink-dim); margin-left: auto; text-align: right; }
.yj-mod-params { display: flex; flex-direction: column; gap: 5px; padding-top: 4px; }
/* An off module is its head row: LED, name, purpose. Bypassed sliders are not
   a required mark (DESIGN §Layout RACK), and nine full panels scrolled under
   the pipeline strip. No transition: a hardware bypass snaps. */
.yj-mod.is-off .yj-mod-params { display: none; }
.yj-mod.is-off { padding-bottom: 8px; }

/* ---------- A/B ---------- */
.yj-ab { display: flex; gap: 0; }
.yj-ab .yj-btn { flex: 1; border-radius: 0; }
.yj-ab .yj-btn:first-child { border-radius: 2px 0 0 2px; }
.yj-ab .yj-btn:last-child { border-radius: 0 2px 2px 0; border-left: none; }

/* A/B legend: which colour is which take. Only shown once a render exists,
   because before that there is no other take to compare against. */
.yj-ab-key {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.1em;
  margin-top: 4px;
}
.yj-ab-key[hidden] { display: none; }
.yj-ab-key span::before {
  content: ''; display: inline-block;
  width: 7px; height: 7px; margin-right: 5px; vertical-align: middle;
}
.yj-ab-key-live { color: var(--yj-ink-dim); }
.yj-ab-key-live::before { background: var(--yj-wave); }
.yj-ab-key-ghost { color: var(--yj-ink-dim); }
.yj-ab-key-ghost::before { background: var(--yj-blue); }

/* ---------- update offer ---------- */
/* Sits above the status bar, never over the benches: an update is an offer, not
   an interruption. */
.yj-update {
  position: fixed;
  left: 0; right: 0; bottom: 22px;
  z-index: 45;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 12px;
  background: var(--yj-well);
  border-top: 1px solid var(--yj-line-hi);
  font-family: var(--f-mono);
}
.yj-update[hidden] { display: none; }
.yj-update-text {
  font-size: 10.5px; letter-spacing: 0.08em; color: var(--yj-ink-dim);
}
@media (max-width: 720px) {
  .yj-update { flex-wrap: wrap; }
  .yj-update-text { flex-basis: 100%; text-align: center; }
}

/* ---------- drop zone ---------- */
.yj-drop {
  position: fixed; inset: 0;
  background: rgba(11, 10, 7, 0.96);
  /* Centred while it fits; when the panel is taller than the window (a link
     panel, a saved session and the shelf together are 1200 px), the overlay
     scrolls and the top stays reachable. `align-items: center` alone clips
     the top of an overflowing child with no way to scroll to it. */
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto;
  z-index: 40;
}
.yj-drop.is-hidden { display: none; }
.yj-drop.is-over .yj-drop-inner { border-color: var(--yj-yellow); }
.yj-drop-inner {
  border: 2px dashed var(--yj-line-hi);
  border-radius: 2px;
  padding: 36px 48px 40px;
  margin: auto;
  text-align: center;
  display: flex; flex-direction: column; gap: 16px; align-items: center;
}
.yj-drop-word {
  font-size: 30px; font-weight: 700; letter-spacing: 0.12em; color: var(--yj-yellow);
  padding-bottom: 14px;
  background: var(--yj-hazard) bottom / auto 6px repeat-x;
}
.yj-drop-inner p { color: var(--yj-ink-dim); font-size: 13px; line-height: 1.7; }
.yj-demo { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.yj-demo .yj-demo-note {
  font-family: var(--f-mono);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.04em;
}
.yj-demo-note strong { color: var(--yj-ink); }
.yj-demo-note a { color: var(--yj-amber); }

/* SIGINT: the second state of the SIGNAL bench.
   Its chips carry their own class rather than reusing .yj-substate-btn:
   MACHINE's controller binds a click handler to every element with that class
   and reads dataset.mstate off it, so sharing the class made a SIGNAL chip
   throw inside MACHINE. The look is shared; the wiring is not. */
.yj-sigstate-btn {
  font-family: var(--f-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.14em; color: var(--yj-ink-dim);
  background: var(--yj-well); border: 1px solid var(--yj-line);
  border-radius: 2px; padding: 5px 12px; cursor: pointer;
}
.yj-sigstate-btn:hover { border-color: var(--yj-line-hi); color: var(--yj-ink); }
.yj-sigstate-btn.is-active { color: var(--yj-bg); background: var(--yj-yellow); border-color: var(--yj-yellow); }
/* The SIGINT rail is wider than the meters' rail: it holds a report. */
.yj-rail-sigint { width: 372px; }
.yj-sigint-list { display: flex; flex-direction: column; gap: 3px; }
.yj-sigint-det {
  display: grid; grid-template-columns: 1.6em 1fr auto; gap: 8px; align-items: baseline;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.03em;
  color: var(--yj-ink-dim); background: var(--yj-well);
  border: 1px solid var(--yj-line); border-radius: 2px; padding: 4px 7px;
  cursor: pointer; text-align: left;
}
.yj-sigint-det:hover { border-color: var(--yj-line-hi); color: var(--yj-ink); }
.yj-sigint-det.is-selected { border-color: var(--yj-yellow); color: var(--yj-yellow); }
.yj-sigint-det .k { color: var(--yj-blue); }
.yj-sigint-det.is-selected .k { color: var(--yj-yellow); }
.yj-sigint-det .snr { color: var(--yj-amber); }
.yj-sigint-host { display: flex; flex-direction: column; gap: 9px; padding: 12px 2px; }
.yj-sigint-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.yj-sigint-title {
  font-family: var(--f-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; color: var(--yj-yellow);
}
.yj-sigint-sub { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.14em; color: var(--yj-ink-dim); }
.yj-sigint-note {
  font-family: var(--f-mono); font-size: 10px; line-height: 1.5;
  letter-spacing: 0.03em; color: var(--yj-ink-dim); max-width: 78ch;
}
.yj-sigint-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.yj-sigint-line {
  font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.04em;
  color: var(--yj-amber); min-height: 14px;
}
.yj-sigint-readouts {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 20px;
}
.yj-sigint-readouts dd { min-width: 150px; font-size: 11.5px; }
.yj-sigint-readouts dd.is-off { color: var(--yj-ink-dim); font-size: 10px; font-family: var(--f-ui); letter-spacing: 0.06em; }
.yj-sigint-designator {
  font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.04em; color: var(--yj-ink);
}
.yj-sigint-report {
  font-family: var(--f-mono); font-size: 10.5px; line-height: 1.5;
  color: var(--yj-ink); background: var(--yj-well);
  border: 1px solid var(--yj-line); border-radius: 2px;
  padding: 10px 12px; margin: 0; min-height: 120px;
  white-space: pre; overflow-x: auto;
}

/* SCORE: the surface for pieces longer and stranger than the four-bar roll */
.yj-score-host {
  display: flex; flex-direction: column; gap: 9px;
  border: 1px solid var(--yj-line); border-radius: 2px;
  background: var(--yj-panel); padding: 12px 14px; margin-top: 10px;
}
.yj-score-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.yj-score-title {
  font-family: var(--f-mono); font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; color: var(--yj-yellow);
}
.yj-score-sub, .yj-score-kicker {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.14em; color: var(--yj-ink-dim);
}
.yj-score-kicker { align-self: center; color: var(--yj-amber); }
.yj-score-note {
  font-family: var(--f-mono); font-size: 10px; line-height: 1.5;
  letter-spacing: 0.03em; color: var(--yj-ink-dim); max-width: 76ch;
}
.yj-score-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.yj-score-mv { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.1em; }
.yj-score-line {
  font-family: var(--f-mono); font-size: 10px; line-height: 1.4;
  letter-spacing: 0.04em; color: var(--yj-amber); min-height: 14px;
}
.yj-score-bar { height: 3px; background: var(--yj-well); border: 1px solid var(--yj-line); }
.yj-score-fill { height: 100%; background: var(--yj-yellow); width: 0; transition: width 120ms linear; }
@media (prefers-reduced-motion: reduce) { .yj-score-fill { transition: none; } }

/* FOUND: instruments measured into cards. The one offer on the intake that
   sounds with nothing loaded, so it is the hero and everything under it is a
   quiet row. Its heading is the bench's own silkscreen label, not a bespoke one. */
.yj-found { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 720px; align-items: center; }
.yj-drop-inner .yj-found-note {
  font-family: var(--f-mono); font-size: 10px; line-height: 1.5;
  letter-spacing: 0.03em; color: var(--yj-ink-dim); max-width: 64ch;
}
.yj-found-row { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.yj-found-btn { font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.1em; padding: 6px 9px; }
.yj-drop-inner .yj-found-line {
  font-family: var(--f-mono); font-size: 9.5px; line-height: 1.4;
  letter-spacing: 0.04em; color: var(--yj-amber); min-height: 13px;
}
.yj-drop-skip { align-self: flex-end; font-size: 9.5px; letter-spacing: 0.1em; padding: 5px 8px; }

/* INTAKE: every other way in, one row per kind of material. The key at the
   left says what the row costs you — your own file, ours, or nothing at all —
   which is the only ordering that made sense once there were this many. */
.yj-drop-inner .yj-drop-note { font-size: 12px; line-height: 1.6; max-width: 66ch; }
.yj-intake { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 720px; }
.yj-intake-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.yj-intake-key { flex: 0 0 92px; text-align: right; padding-right: 6px; text-transform: none; letter-spacing: 0.04em; font-size: 11px; }
.yj-intake-row .yj-urlrow { flex: 1 1 260px; max-width: none; }
.yj-drop-inner .yj-intake-row .yj-demo-note {
  flex-basis: 100%; margin-left: 98px; margin-top: -2px;
  font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.04em; line-height: 1.3;
}
.yj-intake-row .yj-demo-note strong { color: var(--yj-ink); }
.yj-intake-row .yj-demo-note a { color: var(--yj-amber); }
@media (max-width: 720px) {
  .yj-intake-key { flex-basis: 100%; text-align: left; padding: 0; }
  .yj-drop-inner .yj-intake-row .yj-demo-note { margin-left: 0; }
}

/* FIELD: the public-domain field-recording shelf inside the drop zone */
.yj-field { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 640px; }
.yj-field-head {
  font-family: var(--f-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; color: var(--yj-ink);
}
.yj-field-note {
  font-family: var(--f-mono); font-size: 10px; line-height: 1.5;
  letter-spacing: 0.03em; color: var(--yj-ink-dim);
}
.yj-field-note a { color: var(--yj-amber); }
.yj-field-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%;
}
.yj-field-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--yj-well);
  border: 1px solid var(--yj-line);
  border-radius: 2px;
  padding: 7px 9px;
  cursor: pointer;
  text-align: left;
  font-family: var(--f-mono);
}
.yj-field-btn:hover { border-color: var(--yj-yellow); }
.yj-field-region { grid-column: 1 / -1; margin-top: 6px; padding-bottom: 2px; border-bottom: 1px solid var(--yj-line); text-transform: capitalize; text-align: left; }
.yj-field-kind { font-size: 8.5px; letter-spacing: 0.16em; color: var(--yj-amber); }
.yj-field-title { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; color: var(--yj-ink); }
.yj-field-meta { font-size: 9.5px; letter-spacing: 0.03em; color: var(--yj-ink-dim); }
@media (max-width: 720px) {
  .yj-field-grid { grid-template-columns: repeat(2, 1fr); }
}

.yj-urlrow { display: flex; gap: 6px; width: 100%; max-width: 560px; }
.yj-urlinput {
  flex: 1;
  min-width: 0;
  background: var(--yj-well);
  border: 1px solid var(--yj-line);
  border-radius: 2px;
  color: var(--yj-ink);
  font-family: var(--f-mono);
  font-size: 11.5px;
  padding: 7px 9px;
}
.yj-urlinput::placeholder { color: var(--yj-ink-dim); opacity: 0.7; }
.yj-urlinput:focus-visible { outline: 1px solid var(--yj-yellow); outline-offset: -1px; }
.yj-ripcmd { color: var(--yj-yellow); }
.yj-riphelp {
  border-top: 1px solid var(--yj-line);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  width: 100%;
}
.yj-riphelp p { max-width: 46em; }
.yj-riphelp-note { font-size: 11px; }
.yj-riphelp-note a { color: var(--yj-amber); }

/* ---------- status line ---------- */
.yj-status {
  display: flex; justify-content: space-between;
  padding: 6px 16px;
  border-top: 1px solid var(--yj-line);
  background: var(--yj-panel);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--yj-ink-dim);
}
.yj-status > * { min-width: 0; }
.yj-status > :first-child.is-fault { white-space: normal; }
.yj-status > :first-child { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.yj-status > :last-child { flex-shrink: 0; white-space: nowrap; margin-left: 12px; }
.yj-status .is-hot { color: var(--yj-yellow); }
@keyframes yj-status-pulse { from { box-shadow: inset 3px 0 0 var(--yj-yellow); padding-left: 8px; } to { box-shadow: inset 3px 0 0 transparent; padding-left: 8px; } }
.yj-status .is-new { animation: yj-status-pulse 1.1s ease-out; padding-left: 8px; }
.yj-wayfind { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.yj-wayfind-lede { flex-basis: 100%; font-family: var(--f-mono); font-size: 9.5px; letter-spacing: 0.1em; color: var(--yj-ink-dim); }
.yj-status .is-fault { color: var(--yj-fault); }

/* ---------- scrollbars ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--yj-well); }
::-webkit-scrollbar-thumb { background: var(--yj-line-hi); border: 2px solid var(--yj-well); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--yj-amber-dim); }

/* ---------- small screens: stack rails ---------- */
@media (max-width: 900px) {
  .yj-top { flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; }
  .yj-mark { min-width: 150px; }
  .yj-transport { margin-left: auto; margin-right: 0; }
  .yj-io { width: 100%; }
  .yj-tabs, .yj-pipe { padding-left: 10px; padding-right: 10px; }
  .yj-cols { flex-direction: column; overflow-y: visible; flex: none; }
  .yj-cols > * { flex-shrink: 0; }
  .yj-grow { flex: none; }
  .yj-grow > .yj-panel { flex-shrink: 0; }
  .yj-canvas-spec { flex: none; height: 260px; }
  .yj-canvas-slice { flex: none; height: 280px; }
  .yj-transcript { max-height: 46vh; }
  .yj-rail { width: 100%; overflow-y: visible; }
  .yj-tabpane { overflow-y: auto; }
  .yj-drop { overflow-y: auto; padding: 16px; }
  .yj-drop-inner { padding: 32px 24px; gap: 14px; }
}

@media (max-width: 560px) {
  .yj-mark-sub, .yj-time-dim { display: none; }
  .yj-sounding { min-width: 0; } .yj-sounding .yj-led-text { display: none; }
  .yj-conversion { display: none; }
  .yj-time { min-width: 104px; font-size: 12px; }
  .yj-transport { gap: 4px; }
  .yj-top .yj-btn { padding-left: 8px; padding-right: 8px; }
  .yj-tab-btn { padding-left: 12px; padding-right: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .yj-btn.is-working, .yj-progress-fill, .yj-led.is-busy, .yj-wire-chip.is-armed,
  .yj-tab-btn.is-working::after { animation: none; }
  /* busy stays distinguishable from on and from sounding: hollow, not filled */
  .yj-led.is-busy { background: transparent; border: 2px solid var(--yj-yellow); }
  /* the change cue stays lit until the next message instead of fading */
  .yj-status .is-new { animation: none; box-shadow: inset 3px 0 0 var(--yj-yellow); }
  * { scroll-behavior: auto !important; }
}

/* ---------- soundscape split ---------- */
/* Biophony in blue against anthrophony in yellow: birdsong on one side of the
   bar, engines on the other. Same colour contract as the waveform ghost. */
.yj-soundscape { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.yj-soundscape[hidden] { display: none; }
.yj-soundscape-head {
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.14em; color: var(--yj-ink-dim);
}
.yj-soundscape-bar {
  display: flex; width: 100%; height: 12px;
  background: var(--yj-well); border: 1px solid var(--yj-line);
  border-radius: 1px; overflow: hidden;
}
.yj-soundscape-bio { background: var(--yj-blue); height: 100%; }
.yj-soundscape-anthro { background: var(--yj-wave); height: 100%; }
.yj-soundscape-key {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em; color: var(--yj-ink-dim);
}
.yj-soundscape-key span::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  margin-right: 4px; vertical-align: middle;
}
.yj-key-bio::before { background: var(--yj-blue); }
.yj-key-anthro::before { background: var(--yj-wave); }
.yj-soundscape-val { margin-left: auto; color: var(--yj-ink); }
.yj-soundscape-val::before { display: none !important; }
.yj-soundscape-note {
  font-family: var(--f-mono); font-size: 8.5px; line-height: 1.4; color: var(--yj-ink-dim); opacity: 0.8;
}

/* ---------- the shelf: five drawers, one quality switch ---------- */
.yj-shelf-chips { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; width: 100%; }
.yj-shelf-chip {
  font-family: var(--f-mono); font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--yj-ink-dim); background: var(--yj-well); border: 1px solid var(--yj-line);
  border-radius: 2px; padding: 4px 9px; cursor: pointer;
}
.yj-shelf-chip:hover { border-color: var(--yj-line-hi); color: var(--yj-ink); }
.yj-shelf-chip.is-active { background: var(--yj-yellow); border-color: var(--yj-yellow); color: var(--yj-bg); }
.yj-shelf-quality { margin-left: 10px; color: var(--yj-blue); border-color: var(--yj-blue-dim); }
.yj-shelf-quality.is-active { background: var(--yj-blue); border-color: var(--yj-blue); color: var(--yj-bg); }
.yj-field-head-row { display: flex; justify-content: space-between; width: 100%; align-items: baseline; }
.yj-field-badge { font-size: 8.5px; letter-spacing: 0.08em; color: var(--yj-ink-dim); }
.yj-field-badge.is-lossless { color: var(--yj-blue); }
.yj-window-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--yj-line-hi); border-radius: 2px; background: var(--yj-well); }
.yj-window-from { width: 72px; font-family: var(--f-mono); font-size: 11px; background: var(--yj-bg); color: var(--yj-yellow); border: 1px solid var(--yj-line); border-radius: 2px; padding: 4px 6px; }
.yj-window-span { font-family: var(--f-mono); font-size: 10px; background: var(--yj-bg); color: var(--yj-ink); border: 1px solid var(--yj-line); border-radius: 2px; padding: 4px 6px; }
.yj-mine-bar { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.yj-mine-empty { grid-column: 1 / -1; margin: 0; padding: 12px; text-align: center; font-size: 9.5px; letter-spacing: 0.1em; color: var(--yj-ink-dim); border: 1px dashed var(--yj-line); border-radius: 2px; }
.yj-mine-card { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.yj-mine-card .yj-field-btn { width: 100%; }
.yj-mine-card .yj-field-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.yj-mine-remove {
  align-self: flex-end; font-family: var(--f-mono); font-size: 8.5px; letter-spacing: 0.12em;
  background: none; border: 1px solid var(--yj-line); color: var(--yj-ink-dim);
  border-radius: 2px; padding: 2px 6px; cursor: pointer;
}
.yj-mine-remove:hover, .yj-mine-remove.is-armed { border-color: var(--yj-yellow); color: var(--yj-yellow); }

/* Speed sits with the transport: one cycling button, lit when not 1x. */
#btnSpeed { min-width: 44px; font-family: var(--f-mono); letter-spacing: 0.04em; }
#btnSpeed.is-active { background: var(--yj-blue); border-color: var(--yj-blue); color: var(--yj-bg); }

/* SLOW readout: what SPEED will bring down, and whether anything is there. */
.yj-slow-out {
  margin-top: 8px; font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.08em;
  line-height: 1.5; color: var(--yj-blue);
}
.yj-slow-out.is-empty { color: var(--yj-ink-dim); }

/* PERIODICITIES (SIGNAL rail): the modulation-spectrum readout and its transcription */
.yj-cyclic-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-family: var(--f-mono); font-size: 10px; }
.yj-cyclic-list li { display: flex; justify-content: space-between; gap: 8px; }
.yj-cyclic-list li span:last-child { color: var(--yj-ink-dim); text-align: right; }
.yj-cyclic-list li.is-harmonic { color: var(--yj-ink-dim); }
.yj-cyclic-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.yj-card-summary { font-family: var(--f-mono); font-size: 10px; color: var(--yj-yellow); margin: 6px 0 0; line-height: 1.5; }
.yj-card-actions .yj-select { font-size: 10px; max-width: 46%; }


/* A decoded picture — SSTV — inside the SIGINT rail. Pixel-exact rather than
   smoothed: this is a measurement, and a bilinear filter would invent detail
   the transmission does not contain. */
.yj-sigint-picture {
  margin: 10px 0 0;
  padding: 0;
  border: 1px solid var(--yj-line);
  background: var(--yj-panel-deep, #0c0c0a);
}
.yj-sigint-picture canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.yj-sigint-picture figcaption {
  font-family: var(--f-ui);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--yj-ink-dim);
  padding: 6px 8px;
  border-top: 1px solid var(--yj-line);
}
