/* edutec — Circuit lab: the parts tray, the card for whichever part or lead the student
   picked up off the bench, the verdict line that answers their wiring, and the intro card
   that explains a part before it ever goes on the table.
   Only the electricity page loads this file; the shared bench3d.css stays clean. */

/* minmax(0,1fr) and min-width:0 let the columns give way instead of pushing the button
   out of the panel, so a narrow right panel wraps a name rather than eating a part. */
.tray { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:5px; }
.part-btn {
  display:flex; align-items:center; gap:6px; cursor:pointer; min-width:0;
  background:#fff; border:1.5px solid #ddd; border-radius:10px; padding:3px 6px;
  transition:.15s;
}
.part-btn:hover { border-color:#45825d; background:#edf7f0; }
/* the 132 x 56 canvas is the full-size symbol, shrunk by CSS and drawn with a heavier
   pen so the leads stay visible at thumbnail size. Thirteen of them have to fit in one
   panel that will not scroll, so the thumbnail gives up six pixels to the name. */
.part-btn canvas { display:block; width:50px; height:22px; flex:none; }
.part-btn span { font-size:10.5px; font-weight:700; color:#333; line-height:1.1; min-width:0; }
/* the tray adds a part, so at the bench's limit it goes grey like every other adding control */
.part-btn:disabled, .part-btn:disabled:hover {
  opacity:.4; cursor:default; background:#f0f0f0; border-color:#ccc;
}
.part-btn:disabled span { color:#8a9490; }

/* heading for the placed parts, carrying the one global control beside it */
.rp-head { display:flex; align-items:center; gap:8px; margin-top:6px; }
.rp-head .rp-label { margin:0; }
.mini-btn {
  margin-left:auto; font-size:10px; font-weight:700; color:#45825d; background:#fff;
  border:1.5px solid #cfd6d1; border-radius:7px; padding:3px 8px; cursor:pointer; transition:.15s;
}
.mini-btn:hover { border-color:#45825d; background:#edf7f0; }
.mini-btn:disabled, .mini-btn:disabled:hover { opacity:.4; cursor:default; background:#fff; }

/* what is sitting in each slot, with the controls that part answers to. One line per
   chip: the panel is 478 px tall and thirteen tray buttons plus a selection card plus the
   verdict has to live inside it without a scrollbar — which is why the tray folds away
   the moment something is selected instead of shrinking every row to fit. */
.sel-card {
  display:flex; flex-direction:column; gap:2px; margin-top:6px; padding:5px 8px;
  background:#edf7f0; border:1.5px solid #45825d; border-radius:10px;
}
.sel-card.wire { background:#eef4ff; border-color:#4a7fd0; }
.sel-top { display:flex; align-items:center; gap:6px; min-width:0; }
.sel-name { font-size:11.5px; font-weight:700; color:#2e7d4f; white-space:nowrap; }
.sel-card.wire .sel-name { color:#26456f; }
.sc-val { margin-left:auto; font-size:11px; color:#555; white-space:nowrap; }
.sel-btns { display:flex; flex-wrap:wrap; gap:5px; margin-top:2px; }
.sel-btns .ctl-btn { font-size:10.5px; padding:3px 8px; }
/* the two controls that end something are allowed to look like it */
.sel-btns .danger { border-color:#e4b6b0; color:#c0392b; }
.sel-btns .danger:hover { border-color:#e74c3c; background:#fdecea; }

/* the one row of settings that is not about the selected part, so it stays put whatever
   the tray is doing */
.panel-foot { display:flex; align-items:center; gap:6px; margin-top:8px; }
.foot-label { font-size:10px; font-weight:800; letter-spacing:.4px; text-transform:uppercase; color:#8a9490; }
.lead-sw {
  width:26px; height:16px; border-radius:5px; border:2px solid #cfd6d1; cursor:pointer; padding:0;
}
.lead-sw.on { border-color:#45825d; box-shadow:0 0 0 2px #edf7f0 inset; }
.panel-foot .mini-btn { margin-left:auto; }

/* the check line that closes the predict-then-test loop, and the fault card that answers
   a wiring the bench disagrees with */
.build-check {
  margin-top:8px; padding:8px 10px; border-radius:8px; font-size:11.5px; line-height:1.5;
  background:#eef4ff; border-left:4px solid #4a7fd0; color:#26456f;
}
.build-check.none { background:#f6f7f6; border-left-color:#cfd6d1; color:#6b7470; }
.build-check.bad { background:#fdecea; border-left-color:#e74c3c; color:#8c2f22; }

/* Circuit parts become easy-to-tap tiles when the bench controls move below the
   simulation on a phone. Keep the two-column layout while allowing each label room. */
@media (max-width: 760px) {
  .tray { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
  .part-btn { min-height:58px; gap:8px; padding:7px 9px; border-radius:11px; }
  .part-btn canvas { width:58px; height:25px; }
  .part-btn span { font-size:12px; line-height:1.25; overflow-wrap:anywhere; }
  .sel-card { padding:10px; gap:6px; }
  .sel-top { flex-wrap:wrap; }
  .sel-name { font-size:13px; white-space:normal; }
  .sc-val { font-size:12px; }
  .sel-btns .ctl-btn { min-height:42px; font-size:12px; padding:8px 10px; }
  .build-check { padding:11px 12px; font-size:13px; line-height:1.5; }
}
