/* ===== Interactive labs (pulley lab) ===== */
.lab{--lab-line:rgba(139,166,198,.22);--lab-dim:#8ba6c6;--lab-gold:#ffb72f;--lab-teal:#2bd4b8;--lab-azure:#4c8dff;--lab-coral:#ff674d;
  clear:both;margin:1.5rem 0 1.7rem;padding:1.1rem 1.1rem 1.15rem;border:1px solid rgba(255,183,47,.38);border-radius:22px;
  background:linear-gradient(160deg,rgba(255,183,47,.08),rgba(15,32,54,.82) 38%,rgba(8,18,32,.94));color:#e7f0fb}
.lab *{box-sizing:border-box}
.lab:empty{min-height:150px;display:grid;place-items:center}
.lab:empty:before{content:"Pulley lab: an interactive toy that plays on the live page and in Preview";font:700 11px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em;text-transform:uppercase;color:var(--lab-dim);text-align:center;padding:1rem}
.lab-head{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem .8rem}
.lab-kick{font:800 10px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.2em;text-transform:uppercase;padding:.42rem .6rem;border-radius:999px;background:var(--lab-gold);color:#2a1b00}
.lab-head h3{margin:0;font-family:'Bricolage Grotesque',ui-sans-serif,system-ui,sans-serif;font-weight:800;font-size:1.35rem;letter-spacing:-.02em;color:#fff}
.lab-head p{flex-basis:100%;margin:.1rem 0 0;font-size:1.02rem;line-height:1.5;color:#b6c8dd}
/* stacked: the picture gets the full width (it was squeezed into 60% and too small), the controls sit under it */
.lab-body{display:grid;grid-template-columns:minmax(0,1fr);gap:1.1rem;margin-top:.9rem;align-items:start}
.lab-stage{border-radius:16px;border:1px solid var(--lab-line);background:radial-gradient(ellipse at 40% 20%,#0f2036,#07101c 70%);overflow:hidden}
.lab-stage svg{display:block;width:100%;height:auto;max-height:min(80vh,680px);touch-action:none;user-select:none;-webkit-user-select:none}
.lab-side{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem 1.4rem;align-items:start}
.lab-stats,.lab-msg{grid-column:1/-1}
.lab-ctl{display:grid;gap:.45rem}
.lab-lbl{font:700 12px/1 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.16em;text-transform:uppercase;color:var(--lab-dim)}
.lab-chips{display:flex;flex-wrap:wrap;gap:.4rem}
.lab-chips button{all:unset;box-sizing:border-box;cursor:pointer;min-width:3.1rem;text-align:center;font:800 18px/1 ui-monospace,SFMono-Regular,Menlo,monospace;padding:.9rem .6rem;border-radius:12px;border:1px solid var(--lab-line);color:#cfe0f3;transition:all .18s}
.lab-chips button:hover{border-color:rgba(255,183,47,.6);color:#fff}
.lab-chips button[aria-pressed=true]{background:var(--lab-gold);border-color:var(--lab-gold);color:#07101c}
.lab-chips button:focus-visible,.lab-btn:focus-visible{outline:2px solid #fff;outline-offset:2px}
.lab-range{width:100%;accent-color:var(--lab-gold);height:2.2rem}
.lab-btns{display:flex;flex-wrap:wrap;gap:.5rem}
.lab-btn{all:unset;box-sizing:border-box;cursor:pointer;font-weight:800;font-size:1rem;padding:.8rem 1.3rem;border-radius:999px;border:1px solid var(--lab-line);color:#cfe0f3;transition:transform .15s,border-color .15s}
.lab-btn:hover{border-color:var(--lab-teal);color:#fff}
.lab-btn.go{background:linear-gradient(180deg,#ffc24a,#ffa514);border-color:transparent;color:#07101c}
.lab-btn.go:hover{transform:translateY(-1px)}
.lab-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:.5rem}
.lab-stat{padding:.65rem .7rem;border-radius:14px;border:1px solid var(--lab-line);background:rgba(7,16,28,.6);display:grid;gap:.3rem;align-content:start}
.lab-stat small{font:700 11px/1.2 ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--lab-dim)}
.lab-stat b{font:800 1.5rem/1 ui-monospace,SFMono-Regular,Menlo,monospace;color:#fff;white-space:nowrap}
.lab-stat.eff{border-color:rgba(43,212,184,.45)}
.lab-stat.eff b{color:var(--lab-teal)}
.lab-stat .bar{display:block;height:6px;border-radius:99px;background:rgba(139,166,198,.2);overflow:hidden}
.lab-stat .bar u{display:block;height:100%;width:50%;background:linear-gradient(90deg,var(--lab-teal),var(--lab-gold));text-decoration:none;transition:width .25s}
.lab-msg{margin:0;font-size:1.05rem;line-height:1.55;color:#cfe0f3}
.lab-msg b{color:#fff}

/* the picture */
.lab svg .strut{stroke:#3b587a;stroke-width:5;stroke-linecap:round}
.lab svg .blk{fill:#12263f;stroke:#4c8dff;stroke-width:2}
.lab svg .blk.mov{fill:#16304f;stroke:#2bd4b8}
.lab svg .sheave{fill:#0a1626;stroke:#2bd4b8;stroke-width:3}
.lab svg .axle{fill:#8ba6c6}
.lab svg .knot{fill:#ffb72f;stroke:#07101c;stroke-width:1.5}
.lab svg .ring{fill:none;stroke:#2bd4b8;stroke-width:4}
.lab svg .rope{stroke:#ffb72f;stroke-width:5;stroke-linecap:round;stroke-linejoin:round;fill:none}
.lab svg .hook{stroke:#8ba6c6;stroke-width:4;stroke-linecap:round}
.lab svg .crate{fill:#ff674d;stroke:#ffd0c6;stroke-width:2}
.lab svg .crate-t1{font:800 10px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.2em;fill:#3a0d05}
.lab svg .crate-t2{font:800 20px ui-monospace,SFMono-Regular,Menlo,monospace;fill:#250600}
.lab svg .dim{stroke:#ffb72f;stroke-width:2;stroke-dasharray:4 3}
.lab svg .dim.load{stroke:#ff674d}
.lab svg .dim-t{font:700 12px ui-monospace,SFMono-Regular,Menlo,monospace;fill:#ffd88a}
.lab svg .dim-t.load{fill:#ffb2a3}
.lab svg .handle{cursor:ns-resize;outline:none}
.lab svg .handle:focus-visible .grip{stroke:#fff;stroke-width:3}
.lab svg .grip{fill:#ffb72f;stroke:#07101c;stroke-width:2}
.lab svg .grip-l{stroke:#07101c;stroke-width:2;stroke-linecap:round}
.lab svg .force-t{font:800 15px ui-monospace,SFMono-Regular,Menlo,monospace;fill:#2bd4b8}
.lab svg .hint-t{font:700 11px ui-monospace,SFMono-Regular,Menlo,monospace;fill:#ffd88a;animation:labBlink 1.6s ease-in-out infinite}
@keyframes labBlink{0%,100%{opacity:.35}50%{opacity:1}}

@media(max-width:760px){
  .lab{padding:.85rem;border-radius:18px}
  .lab-side{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){.lab svg .hint-t{animation:none}.lab-stat .bar u{transition:none}}
