.bm-lab{color:var(--ink);font-size:14px;line-height:1.65}
.bm-lab h3,.bm-lab h4,.bm-lab p{margin:0}
.bm-lab>header{margin-bottom:12px}.bm-lab>header h3{font-size:20px}.bm-lab>header p{color:#425b50}
.bm-layout{display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,.9fr);gap:12px;align-items:start}
.bm-work,.bm-side>section{min-width:0;border:1px solid #d8e3dd;border-radius:11px;background:#fff;padding:13px}
.bm-work h4,.bm-side h4{font-size:16px;font-weight:600}.bm-work>p,.bm-output p{font-size:13px;color:var(--muted)}
.bm-side{display:grid;gap:10px;min-width:0}.bm-side pre{max-height:340px;overflow:auto;white-space:pre;margin:8px 0 0;border-radius:8px;background:#20332e;color:#e3f1e5;padding:10px 12px;font:13px/1.7 ui-monospace,monospace}
.bm-palette,.bm-piece,.bm-rowtools,.bm-pin,.bm-case,.bm-reading{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.bm-palette{margin:8px 0 14px;gap:9px}.bm-palette button,.bm-piece{--piece:#d6e9c9;--edge:#86a978;position:relative;background:var(--piece);border:1px solid var(--edge);border-radius:6px}
.bm-lab [data-bm-tone=wait],.bm-lab [data-bm-tone=divide]{--piece:#f9e0bb;--edge:#d3a36a}
.bm-lab [data-bm-tone=print],.bm-lab [data-bm-tone=read]{--piece:#dceaf8;--edge:#8eafd5}
.bm-palette button{min-height:34px;padding:5px 10px;font-weight:600}.bm-palette button:after,.bm-piece:after{content:"";position:absolute;bottom:-5px;left:12px;width:13px;height:5px;border:1px solid var(--edge);border-top:0;border-radius:0 0 4px 4px;background:var(--piece)}
.bm-pin,.bm-case{font-size:13px;color:#45584e}.bm-pin select,.bm-lab select,.bm-piece input{max-width:100%;min-width:0;color:var(--ink);background:#fff;border:1px solid #adbaae;border-radius:5px;font:inherit;padding:4px 6px}
.bm-list{min-height:64px;display:grid;gap:4px;align-content:start;margin:9px 0 14px;padding:10px;border:1px dashed #c6d3ca;border-radius:8px;background:#f4f8f2;background-image:radial-gradient(#bdcec0 .7px,transparent .7px);background-size:14px 14px}
.bm-piece{width:fit-content;max-width:100%;padding:5px 7px;min-height:36px;gap:5px;font-size:13px}.bm-piece input{width:73px}.bm-piece select{max-width:142px}.bm-rowtools{margin-left:auto;gap:1px}.bm-rowtools button,.bm-grip{min-width:23px;min-height:26px;padding:0;color:#465847}.bm-rowtools button:disabled{opacity:.35}.bm-grip{cursor:grab}
.bm-output{margin-top:8px}.bm-reading{gap:10px;margin:9px 0}.bm-reading i{width:22px;height:22px;display:block;flex:none;border-radius:50%;border:2px solid #947669;background:color-mix(in srgb,#ffab4b calc(var(--light,0)*100%),#9eaaa0)}
.bm-reading strong{font-size:13px}.bm-wave{display:block;width:100%;border-radius:6px}.bm-case{margin:6px 0}.bm-case input[type=range]{width:100%;accent-color:var(--accent)}
.bm-lcd{padding:10px 12px;border-radius:7px;background:#203c34;color:#e1f3d6}.bm-lcd small,.bm-lcd b{display:block}.bm-lcd b{font:600 24px/1.4 ui-monospace,monospace}
.bm-output .bm-error{color:#984728;background:#fff1e7;border-left:3px solid #dd8555;padding:8px 10px}.bm-report{font-size:13px;color:#476150;margin-top:9px}.bm-report ul{margin:4px 0;padding-left:19px}
@media(max-width:770px){.bm-layout{grid-template-columns:1fr}.bm-work,.bm-side>section{padding:10px}.bm-palette button,.bm-rowtools button,.bm-grip{min-height:35px}.bm-piece input,.bm-piece select{min-height:34px}}
.bm-lab{container-type:inline-size}
@container (max-width:660px){
  .bm-layout{display:flex;flex-direction:column;gap:10px;align-items:stretch}
  .bm-side{order:0;position:sticky;top:0;z-index:2;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:start;gap:5px;padding:3px;background:var(--bg);border-radius:10px;box-shadow:0 3px 9px #253c2b16}
  .bm-side section{max-height:34dvh;overflow:auto;padding:8px}
  .bm-side h4{font-size:13px;line-height:1.35}.bm-side pre{max-height:24dvh;margin:4px 0 0;padding:7px;font-size:11px}
  .bm-side .bm-reading{gap:4px;margin:4px 0}.bm-reading i{width:15px;height:15px}.bm-reading strong{font-size:12px}
  .bm-side .bm-case,.bm-output p{font-size:12px}.bm-side .bm-case input{margin:3px 0}.bm-work{order:1}
  .bm-piece input,.bm-piece button,.bm-piece select{scroll-margin-top:36dvh}
}
