/* hwcontrol.css — styles for the tranche-2 Hardware Control card only.
   Kept separate from style.css so that file stays a byte-for-byte copy of the
   mux UI's (the Phase A identical-surface guarantee). */

.hw-badge {
  font-size: 0.7rem; letter-spacing: 0.1em; margin-left: 0.5rem;
  padding: 0.1rem 0.5rem; border-radius: 4px;
  background: #2a6; color: #fff; vertical-align: middle;
}
.hw-badge.down { background: #b33; }
/* Camera Lab: a "debug" badge — these controls are dev/test-only, not in K1. */
.hw-badge.exp { background: #b8860b; text-transform: uppercase; }

/* Camera Lab is a dev-only surface: visible only in debug mode (the F1 toggle,
   persisted in localStorage, default OFF — H22). Gated by id so the card keeps
   its normal block layout — unlike the generic .debug-only, which forces flex. */
#lab-card { display: none; }
body.debug-mode #lab-card { display: block; }

.hw-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}
.hw-panel {
  border: 1px solid rgba(128, 128, 128, 0.25);
  border-radius: 8px; padding: 0.75rem;
}
.hw-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.hw-row label { font-size: 0.8rem; opacity: 0.8; }
.hw-row input[type="number"] { width: 6rem; }
.hw-row input[type="range"] { flex: 1 1 5rem; }
.hw-row select, .hw-row input { padding: 0.2rem 0.3rem; }

/* ── Rotation + Lights: dedicated per-thing control sets (no selectors) ─────── */
.hw-axes, .hw-lights {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem; margin-bottom: 0.75rem;
}
.hw-axis, .hw-light {
  border: 1px solid rgba(128, 128, 128, 0.25); border-radius: 8px;
  padding: 0.6rem; text-align: center;
}
.hw-axis-title, .hw-light-title {
  font-size: 0.8rem; font-weight: 600; opacity: 0.85; margin-bottom: 0.4rem;
}

/* Jog: a curved arrow each side of a little turntable image. */
.hw-jog { display: flex; align-items: center; justify-content: center; gap: 0.2rem; }
.ped-svg { width: 60px; height: 60px; flex: 0 0 auto; }
.jog-arrow {
  background: none; border: none; cursor: pointer; color: #7dd3fc;
  padding: 0.2rem; border-radius: 8px; line-height: 0;
}
.jog-arrow:hover { background: rgba(125, 211, 252, 0.15); color: #bae6fd; }
.jog-arrow:active { transform: scale(0.9); }
.rot-ico { width: 30px; height: 30px; display: block; }

.hw-axis-actions {
  display: flex; align-items: center; justify-content: center; gap: 0.3rem;
  margin-top: 0.45rem; flex-wrap: wrap;
}
.deg-in { width: 3.2rem; padding: 0.2rem 0.3rem; }

/* Red square = stop (icon-only for a jog; labelled for the sequence abort). */
.stop-btn {
  min-width: 26px; height: 26px; border: none; border-radius: 5px; cursor: pointer;
  background: #e5484d; color: #fff; font-size: 0.75rem; padding: 0 0.5rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.stop-btn:hover { background: #f5595e; }
.stop-btn:active { transform: scale(0.92); }

.scanbox-btn.tiny { padding: 0.2rem 0.5rem; font-size: 0.75rem; }

/* Position readout (N19) — honest presentation of MotionState.degrees/
   origin_set. Gated behind the developer surface (.debug-only, audit fix
   cycle 1): before a first homing it reads "unknown — origin lost" at
   every boot, the steady state of a control the normal viewer cannot even
   see — H22's exact pattern (not-render, not a cheerful substitute). */
.hw-position { font-size: 0.75rem; opacity: 0.85; margin-top: 0.4rem; }
.hw-position.unknown { color: #d97706; font-style: italic; opacity: 1; }

/* Motor power — release/engage (N19). Behind the developer surface
   (.debug-only, H9/H22) until the per-surface Grenoble proof lands: an
   unproven control must not sit in the normal view.
   THREE states, never two (owner ruling 2026-08-16): `driver_enabled` is an
   optional read of the line, and a device that does not report it must not
   be rendered as released. "unknown" is styled deliberately closer to the
   LIVE warning than to the released green — the direction that costs a
   finger is treating an unread line as safe. */
.hw-power {
  margin-top: 0.5rem; padding-top: 0.5rem;
  border-top: 1px dashed rgba(128, 128, 128, 0.25);
  flex-direction: column; align-items: center; gap: 0.35rem;
}
.hw-power-badge {
  display: inline-block; padding: 0.15rem 0.6rem; border-radius: 4px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em;
}
/* LIVE — loudest state on the page by design: the DoD calls a control that
   is ambiguous when engaged "worse than none". */
.hw-power-badge.live {
  background: #e5484d; color: #fff;
  animation: hw-power-live-pulse 1.4s ease-in-out infinite;
}
.hw-power-badge.released { background: #2a6; color: #fff; }
/* Same amber this page already uses for "dev/warning" (.hw-badge.exp,
   .build-tag) — deliberately NOT the neutral grey a "loading…" state would
   use, and deliberately NOT the released green. */
.hw-power-badge.unknown { background: #b8860b; color: #fff; }
@keyframes hw-power-live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.65); }
  50%      { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); }
}
.hw-power-btns { display: flex; gap: 0.3rem; }

.hw-light .hw-row { justify-content: center; margin-bottom: 0.35rem; }
.hw-light .hw-row input[type="range"] { flex: 1 1 4rem; }
.hw-light .hw-row input[type="number"] { width: 4.5rem; }
.hw-rgb-row { justify-content: flex-start; margin-bottom: 0.75rem; }
