/* One reusable compact menu. No game-HUD overlays unless viewing Lab replay. */
.kf51-engineering{width:100%;box-sizing:border-box;min-width:0;margin:12px 0;padding:15px;border:1px solid #477b90;border-radius:13px;background:#0b2030;color:#e5f5f9;font:13px/1.5 system-ui,sans-serif;overflow-wrap:anywhere}
.kf51-engineering *{box-sizing:border-box}
.kf51-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.kf51-heading small{color:#81ccdc;letter-spacing:.13em;font:700 10px monospace}
.kf51-heading h2{font-size:18px;margin:2px 0 5px;color:#f5d297}
.kf51-heading p{margin:3px 0 8px;font-size:12px;color:#bfd4df}
.kf51-switch{display:flex;align-items:center;gap:6px;white-space:nowrap;font-weight:800;color:#e8f6f8;padding:8px;border:1px solid #477b90;border-radius:8px}
.kf51-switch input{width:19px;height:19px;accent-color:#49bba6}
.kf51-row{display:flex;align-items:end;flex-wrap:wrap;gap:9px;margin:7px 0}
.kf51-row label{display:grid;gap:4px;flex:1;min-width:145px;font-weight:700}
.kf51-row select,.kf51-row input[type=file]{max-width:100%;width:100%;color:#e9f5f5;background:#16384a;border:1px solid #5b8796;border-radius:7px;padding:9px;font:12px system-ui}
.kf51-row button,.kf51-link,.kf51-dashboard button{color:#e9f5f5;background:#153c4e;border:1px solid #5996a7;border-radius:7px;padding:10px 12px;cursor:pointer;font:700 12px system-ui;text-decoration:none;min-height:39px}
.kf51-row button:disabled{opacity:.4;cursor:default}
.kf51-row button:hover,.kf51-link:hover{background:#216079}
.kf51-row .kf51-import{font-size:12px;border:1px dashed #568e9c;border-radius:7px;padding:6px}
.kf51-more{border-top:1px solid #2a5668;margin-top:10px;padding-top:10px;font-size:12px}
.kf51-more summary{cursor:pointer;font-weight:700}
.kf51-more h3{font-size:13px;margin:12px 0 6px}
#kf51Status,#kf51Parts{display:block;color:#97dcce;font:11px/1.5 monospace;max-width:100%}
.kf51-note{color:#b9cad0;font-size:11px}
.kf51-lab-actions{margin-top:14px;padding:14px;border:1px solid #4b9a94;border-radius:10px;background:#133445;display:flex;align-items:center;flex-wrap:wrap;gap:9px}
.kf51-lab-actions p{margin:4px 0;color:#c0d6e0;font-size:12px}
.kf51-lab-actions button{background:#1f6271;color:#fff;padding:11px;border:1px solid #6ecab6;border-radius:6px;font-size:12px;font-weight:800;cursor:pointer;min-height:40px}
.kf51-lab-actions progress{width:100%;height:12px;accent-color:#4dc7a9}
.kf51-lab-actions small{width:100%;color:#c7e9e3}
#kf51Replay[hidden]{display:none!important}
#kf51Replay{position:fixed;z-index:50000;inset:0;background:#07141bed;display:flex;align-items:center;justify-content:center;padding:18px;overflow:auto}
.kf51-dashboard{background:#0d2635;border:1px solid #4f8a9a;border-radius:14px;color:#e5f4f5;max-width:1400px;width:100%;max-height:97vh;overflow:auto;padding:17px;font:13px/1.5 system-ui}
.kf51-dashboard header{display:flex;gap:10px;align-items:center;justify-content:space-between;border-bottom:1px solid #2d586a;padding-bottom:10px}
.kf51-dashboard header small{font:700 11px monospace;color:#77d8b7;letter-spacing:.1em}
.kf51-dashboard header h2{margin:0;color:#f0c98b;font-size:22px}
.kf51-dashboard header p{margin:4px 0;color:#afc7d7}
.kf51-view{display:grid;grid-template-columns:minmax(0,2.4fr) minmax(220px,1fr);gap:14px;margin-top:12px}
.kf51-graph-area{min-width:0}.kf51-graph-area canvas{display:block;background:#0b1c29;width:100%;height:auto;border:1px solid #2e6473;border-radius:8px}
.kf51-view aside{background:#102f40;border:1px solid #2d6073;border-radius:8px;max-height:490px;overflow:auto;padding:13px;display:grid;align-content:start;gap:9px}
.kf51-view aside label{display:grid;gap:5px}
.kf51-view aside select{min-width:0;width:100%;padding:10px;background:#153e50;color:#fff;border:1px solid #6692a2;border-radius:6px}
#kf51Metrics{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#kf51Metrics div{padding:9px;background:#173d50;border-radius:6px;font:12px system-ui}
#kf51Checks{font-size:11px;color:#afdbd6}
.kf51-dashboard .kf51-row{display:flex;align-items:center}.kf51-dashboard .kf51-row input{flex:1;min-width:120px;accent-color:#54c9b0}
.kf51-dashboard footer{border-top:1px solid #275063;margin-top:12px;padding-top:10px;color:#a9c5ca;font-size:11px}
@media(max-width:850px){.kf51-view{grid-template-columns:1fr}.kf51-view aside{max-height:none}.kf51-heading{flex-wrap:wrap}.kf51-engineering{padding:11px}.kf51-dashboard{padding:10px}#kf51Replay{padding:6px}}

/* Dedicated Lab launcher avoids overlapping the wheel-lab experiment sections. */
#kf51LabShade[hidden]{display:none!important}
#kf51LabShade{position:fixed;z-index:40000;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;background:#06131dcd;padding:18px;overflow:auto}
#kf51LabShade>.kf51-engineering{max-width:850px;max-height:min(83vh,950px);overflow-y:auto;margin:0;border-radius:0 0 12px 12px;padding:18px 22px}
.kf51-dialog-head{max-width:850px;width:100%;padding:10px 16px;display:flex;align-items:center;justify-content:space-between;background:#1b4354;border:1px solid #649da8;border-radius:12px 12px 0 0;color:#f1cd94;font:700 12px system-ui}
.kf51-dialog-head button{background:#173444;color:#ecf4f4;border:1px solid #6694a2;border-radius:7px;padding:8px 12px;cursor:pointer}
#kf51LabLauncher{border-color:#63a69f;color:#9ce9d9}
@media(max-width:650px){#kf51LabShade{padding:6px}#kf51LabShade>.kf51-engineering{max-height:85vh;padding:10px}.kf51-dialog-head{padding:7px}}
