/* External modules inside the package diagram; dimensions are SVG user units. */
.bm-stage .board-svg { display:block; }
.bm-stage .board-empty-slot {cursor:pointer;}
.bm-stage .board-empty-slot:hover rect,.bm-stage .board-empty-slot:focus-visible rect {stroke:#bbdf9c;}
.bm-wires { pointer-events:none; }
.bm-wire { opacity:.64; stroke-width:1.45; stroke-linecap:round; stroke-linejoin:round; }
.bm-wire.bm-high { opacity:.96; stroke-width:2.2; }
.bm-wire.bm-selected { stroke:#fff; stroke-width:3.5; opacity:1; }
.bm-contact { stroke:#172b37; stroke-width:.8; pointer-events:none; }
.bm-contact.bm-selected { stroke:white; stroke-width:2; }
.bm-object { overflow:visible; }
.bm-card { box-sizing:border-box; display:grid; grid-template-rows:31px minmax(0,1fr) 32px; height:100%; width:100%; padding:0; color:#e4eff3; background:#192e39; border:1.3px solid #577b84; border-radius:8px; overflow:visible; box-shadow:0 4px 8px #071c2438; font-family:inherit; }
.bm-card:focus-within,.bm-card.bm-moving { border-color:#bce894;box-shadow:0 0 0 2px #a1cf883d; }
.bm-head { display:flex; align-items:stretch; gap:2px; background:#243c46; padding:0 4px; border-radius:7px 7px 0 0; border-bottom:1px solid #38535d; }
.bm-handle,.bm-config,.bm-port { margin:0; padding:0; border:0; box-shadow:none; background:transparent; border-radius:3px; color:inherit; }
.bm-handle { display:flex; align-items:center; gap:6px; padding:0 2px; min-width:0; flex:1; text-align:left; cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; }
.bm-handle:active,.bm-moving .bm-handle {cursor:grabbing;}
.bm-name { font:650 12px/1.13 "DM Sans",system-ui,sans-serif; color:#f3f7f4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bm-grip {width:7px;height:14px;flex:none;background:radial-gradient(circle,#a2b9bc 1px,transparent 1.3px) 0 0/3.5px 4.5px;}
.bm-config { width:24px; flex:none; display:grid;place-items:center;color:#b9cccb; }
.bm-handle:hover,.bm-config:hover,.bm-port:hover {background:#34505a; border:0; color:#e2f5dc;}
.bm-card button:focus-visible {outline:2px solid #c6f28a;outline-offset:-2px;}
.bm-card .ml-board-face {display:flex; flex-direction:column; justify-content:center; min-height:0; color:#d0e2dc; overflow:hidden;}
.bm-card .ml-board-face .ml-instrument {display:flex;flex-direction:row; flex:1; align-items:center;justify-content:center;gap:9px; background:transparent; padding:2px 5px; min-height:0; margin:0; border:0; border-radius:0;overflow:hidden;}
.bm-card .ml-board-face .ml-art {transform:none;flex:0 0 75px;width:65px;height:60px;display:grid;place-items:center;}
.bm-card .ml-board-face .ml-art>div:not(.ml-lcd-pcb) {transform:scale(.78);}
.bm-card .ml-board-face .ml-art {grid-template-rows:100%;}
.bm-card .ml-board-face .ml-art-lcd {width:100%;flex-basis:100%;transform:none;}
.bm-card .ml-board-face .ml-art-lcd .ml-lcd-pcb {width:182px; padding:5px 6px;}
.bm-card .ml-board-face .ml-lcd-glass {font-size:12px;}
.bm-card .ml-board-face .ml-instrument:has(.ml-art-lcd) {flex-direction:column;gap:0;}
.bm-card .ml-board-face .ml-instrument:has(.ml-art-lcd) .ml-live-value {display:none;}
.bm-card .ml-board-face .ml-live-value {font-size:11px;line-height:1.2;font-weight:650;min-width:0;max-width:116px;text-align:center;overflow-wrap:anywhere;}
.bm-card .ml-board-face .ml-controls {display:flex;justify-content:center; align-items:center; gap:3px;margin:0 0 4px;padding:0;}
.bm-card .ml-board-face .ml-actuator {font-size:10px;line-height:1.25;min-height:21px;padding:2px 5px;color:#deeee9;background:#243c46;border:1px solid #5b7d7d;}
.bm-card .ml-board-face .ml-actuator[aria-checked=true],.bm-card .ml-board-face .ml-actuator.pressed {color:#efffe5;background:#466e56;}
.bm-ports {display:flex;align-items:stretch;justify-content:center;min-width:0;border-radius:0 0 8px 8px;padding:0 7px;background:#1e333d;border-top:1px solid #38525a;}
.bm-port {position:relative; flex:1; min-width:0; display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.05;gap:2px;}
.bm-signal {font:600 8.5px/1 var(--mono,monospace);color:var(--signal);}
.bm-pin-name {font:600 9px/1 var(--mono,monospace);color:#e2ebec;}
.bm-port::after {content:"";position:absolute;bottom:-3px;left:50%;width:5px;height:5px;border-radius:50%;background:var(--signal);transform:translateX(-50%);box-shadow:0 0 0 .7px #112a36;}
.bm-port.bm-high::after {box-shadow:0 0 4px var(--signal);}

.bm-card .ml-board-face .ml-bus {flex-direction:column;gap:3px;height:auto;overflow:hidden;}
.bm-card .ml-board-face .ml-bus .ml-art {width:100%;height:auto;flex:1;min-height:0;}
.bm-card .ml-board-face .ml-bus .ml-art>div {transform:none;}
.bm-card .ml-board-face .ml-tft-pcb {width:184px;}
.bm-card .ml-board-face .ml-tilt-pad {width:75px;}
.bm-card .ml-board-face .ml-bus .ml-live-value {flex:none;padding:1px 4px;max-width:none;}
.bm-card .ml-board-face .ml-bus-st7789 .ml-live-value {font-size:9px;}
