/* Toggle switches: a chrome bat lever on a hex nut, a paper label under it. Up = on. One up at a time in a bank. */
.m-toolbank .machine-body { align-items: center; }
.switchbank { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; width: 100%; height: 100%; align-items: stretch; }
.toggle { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: var(--tap); min-height: var(--tap);
  padding: 6px 2px 8px; border: 0; border-radius: 6px; cursor: pointer; background: linear-gradient(180deg, rgba(0,0,0,0.18), rgba(0,0,0,0.05)); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25); }
.toggle-plate { position: relative; flex: 1; width: 46px; min-height: 64px; max-height: 96px; border-radius: 5px;
  background: linear-gradient(180deg, #9aa29e, #5d6562 50%, #3b4240); box-shadow: inset 0 1px 0 rgba(255,255,255,0.35), inset 0 0 0 1px rgba(0,0,0,0.5), 0 2px 3px rgba(0,0,0,0.5); }
.toggle-plate::before, .toggle-plate::after { content: "ON"; position: absolute; left: 0; right: 0; top: 3px; text-align: center; font: 700 8px var(--font-stencil); letter-spacing: .1em; color: rgba(0,0,0,0.5); }
.toggle-plate::after { content: "OFF"; top: auto; bottom: 3px; }
.toggle-nut { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
  background: radial-gradient(circle at 40% 35%, #f4f6f4, #9aa3a0 45%, #4c5452); }
.toggle-bat { position: absolute; left: 50%; bottom: 50%; width: 12px; height: 40%; margin-left: -6px; border-radius: 6px 6px 4px 4px; transform-origin: 50% 100%;
  transform: rotate(180deg); /* down: swung round the nut */
  background: linear-gradient(90deg, #6c7472, #f5f7f6 40%, #a9b1ae 60%, #4c5452);
  box-shadow: 0 3px 4px rgba(0,0,0,0.6); transition: transform .07s cubic-bezier(.6, 0, 1, 1); }
.toggle-bat::after { content: ""; position: absolute; left: -2px; right: -2px; top: -4px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #ffffff, #aab2af 60%, #5a6260); }
.toggle.up .toggle-bat { transform: rotate(0deg); }
.toggle-label { display: block; min-width: 0; max-width: 100%; padding: 3px 6px 2px; border-radius: 1px; background: var(--paper); color: var(--ink);
  font: 700 11px/1 var(--font-type); letter-spacing: .06em; box-shadow: 0 1px 2px rgba(0,0,0,0.5); transform: rotate(-1.5deg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toggle:nth-child(even) .toggle-label { transform: rotate(1deg); }
.toggle.up .toggle-label { box-shadow: 0 1px 2px rgba(0,0,0,0.5), 0 0 0 2px rgba(255,180,60,0.85), 0 0 10px rgba(255,180,60,0.5); }
.toggle-key { position: absolute; top: 4px; right: 5px; font: 700 9px var(--font-nixie); color: rgba(255,255,255,0.35); }
/* a capped switch: a red safety cover over the lever */
.toggle-cap { display: none; position: absolute; left: 50%; top: 14%; width: 30px; height: 72%; margin-left: -15px; border-radius: 6px 6px 3px 3px;
  background: linear-gradient(90deg, rgba(150,20,10,0.85), rgba(230,60,40,0.75) 40%, rgba(120,15,8,0.9)); box-shadow: inset 0 0 0 1px rgba(60,5,0,0.8), 0 2px 4px rgba(0,0,0,0.6); }
.toggle.locked .toggle-cap { display: block; }
.toggle.locked .toggle-label { opacity: .6; }
.toggle.rattle { animation: rattle .26s linear; }
@keyframes rattle { 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }
/* single toggles (Settings) */
.toggle.single { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 4px 10px; min-height: 60px; }
.toggle.single .toggle-plate { flex: none; height: 52px; min-height: 0; width: 36px; }
.toggle.single .toggle-label { transform: none; white-space: normal; text-align: left; font-size: 12px; line-height: 1.2; }
.toggle-state { margin-left: auto; font: 700 12px var(--font-nixie); color: var(--amber-dim); }
.toggle.single.up .toggle-state { color: var(--amber); text-shadow: 0 0 6px rgba(255,170,40,0.7); }
