/* ── Generic instrument panel ─────────────────────────────────────────────────────────── */
#psu-container, #fg-container { min-width: 0; min-height: 0; }

.instr-panel {
  height: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.instr-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0 8px;
}

.instr-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.instr-brand {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ── Oscilloscope panel ─────────────────────────────────────────────────────────── */
.scope-panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.scope-bezel {
  padding: 7px 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.scope-brand {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.scope-model {
  font-size: 10px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scope-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--bg-display);
  overflow: hidden;
}

#scope-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Screen corner vignette */
.scope-canvas-wrap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 70%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
  z-index: 2;
}

/* ── Function generator display ─────────────────────────────────────────────────────────── */
.fg-display {
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.disp-label {
  font-size: 10px;
  color: var(--text-dim);
}

.disp-value {
  font-size: 24px;
  line-height: 1;
  margin-left: auto;
}

.disp-unit {
  font-size: 11px;
  color: var(--text-dim);
}

.fg-row, .psu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
}

/* ── PSU displays ──────────────────────────────────────────────────────────────────── */
.psu-displays {
  display: flex;
  gap: 4px;
  background: var(--bg-inset);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
}

.psu-ch {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.psu-ch-label {
  font-size: 10px;
  color: var(--text-dim);
}

.psu-disp {
  font-size: 17px;
  line-height: 1.1;
  margin-left: 0;
  white-space: nowrap;
}

.psu-ch-fixed .psu-disp {
  color: var(--color-green);
  text-shadow: 0 0 6px rgba(69,212,131,0.35);
}

.psu-terminals {
  display: flex;
  gap: 8px;
  margin-top: auto;
  padding-top: 2px;
  justify-content: center;
}

.terminal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  cursor: default;
}
.terminal.red   { background: #2a1210; border-color: #c8483c; color: #ff9d94; }
.terminal.black { background: var(--bg-inset); border-color: #56616b; color: var(--text-dim); }
.terminal.blue  { background: #101b2e; border-color: #4a78d0; color: #9dbcf5; }

.run-stop-btn {
  background: var(--color-green-soft);
  border: 1px solid var(--color-green);
  color: var(--color-green);
  padding: 0 10px;
  height: 24px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}
.run-stop-btn.stopped {
  background: rgba(255,107,94,0.12);
  border-color: var(--color-red);
  color: var(--color-red);
}

.ch-toggle {
  padding: 0 8px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  background: transparent;
}
.ch-toggle.ch1 { color: var(--color-ch1); border-color: var(--color-ch1); }
.ch-toggle.ch2 { color: var(--color-ch2); border-color: var(--color-ch2); }
.ch-toggle.off { opacity: 0.4; }
