.domain-workspace{max-width:1900px;padding:12px 18px 10px;font-size:16px;gap:9px}
.domain-workspace .workspace-top h1{font-size:20px;line-height:1.25}.domain-workspace .work-label{font-size:13px;margin-top:5px}
.domain-workspace .workspace-top .btn{font-size:14px;min-height:42px}.domain-toolbar{min-height:44px;flex-wrap:nowrap;overflow:auto;padding-bottom:4px;flex-shrink:0}
.domain-btn{min-height:40px;font-size:14px;padding:7px 12px;white-space:nowrap;flex-shrink:0;box-shadow:0 2px 0 #263c52;border-color:#405674;color:#29405a}
.domain-toolbar label{display:flex;align-items:center;gap:7px;white-space:nowrap;font-size:14px}
.domain-workspace select{background:#fff;border:1px solid #70849a;border-radius:7px;padding:7px;font:inherit;min-height:38px;color:#29405a}
.domain-wrap{min-height:180px}.domain-wrap>svg{display:block;width:100%;height:100%;touch-action:none;user-select:none;-webkit-user-select:none;outline:none}
.domain-wrap svg text{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Arial,sans-serif;pointer-events:none}.domain-wrap [data-object]{cursor:grab}.domain-wrap [data-device-action],.domain-wrap [data-terminal],.domain-wrap [data-wire]{cursor:pointer}.domain-wrap [data-rheostat]{cursor:ew-resize}
.domain-hint{position:absolute;top:9px;left:10px;right:245px;z-index:2;pointer-events:none;color:#3a5268;font-size:13px;line-height:1.4;max-width:710px}
.domain-workspace-tools{position:absolute;z-index:5;left:12px;top:9px}.domain-workspace-tools~.domain-hint{left:210px}
.domain-hint:not(:empty){padding:6px 9px;border-radius:7px;background:#ffffffdf}.domain-hint.domain-fault{background:#fff0df;color:#83452e;border:1px solid #dca881}
.domain-controls{position:absolute;z-index:4;left:12px;top:67px;max-width:230px;max-height:calc(100% - 85px);overflow:auto;border:1px solid #58718d;border-radius:12px;padding:13px;background:#fffffff5;box-shadow:0 4px 16px #28425924;font-size:14px;color:#29405a}
.domain-controls[hidden],.domain-wire-menu[hidden]{display:none}.domain-controls b{display:block;padding-right:19px;margin-bottom:11px}.domain-controls label{display:flex;flex-direction:column;gap:6px;margin:10px 0;font-size:13px}.domain-controls input{font:inherit;min-width:0;width:100%;color:#29405a;border:1px solid #93a6b8;border-radius:7px;padding:7px}.domain-controls-close{position:absolute;right:7px;top:7px;background:#e7eef5;border:0;border-radius:50%;width:27px;height:27px;color:#4a627a;font-size:21px}
.domain-wire-menu{position:absolute;z-index:7;display:flex;padding:5px;background:#f7fafff5;border:1px solid #a5bacd;border-radius:11px;box-shadow:0 4px 12px #2942592b;max-width:calc(100% - 20px)}
.domain-bottom{display:flex;align-items:center;gap:12px;flex-shrink:0;flex-wrap:wrap;font-size:12px;color:#5b6c7e}.large-meter{display:block;width:100%;max-height:55dvh}
.foam-extended .foam-label{font-size:12px;line-height:1.2;bottom:-25px}.foam-extended .apparatus-visual{width:100%;height:100%}
.domain-closeup{position:absolute;z-index:6;background:#fffffff7;border:1px solid #59758d;border-radius:13px;box-shadow:0 5px 20px #29425928;color:#29475d;padding:13px;right:12px;top:55px;width:min(620px,52%);max-height:calc(100% - 70px);overflow:auto}
.domain-closeup[hidden]{display:none}.domain-closeup header{display:flex;align-items:center;justify-content:space-between;gap:12px}.domain-closeup header .domain-btn{min-height:30px;padding:2px 8px}.domain-closeup svg{width:100%;display:block;max-height:44dvh}.domain-closeup p{font-size:12px;line-height:1.45;color:#61788a;margin:8px 0 0}
.domain-toolbar [aria-pressed=true]{background:#dbeeff;border-color:#2976bd}.domain-wrap [data-placement=blocked]{cursor:not-allowed}
.domain-error-popup{position:absolute;z-index:30;left:50%;top:42%;transform:translate(-50%,-50%);max-width:min(460px,85%);padding:20px 28px;border:2px solid #ba5f47;border-radius:15px;background:#fff1e8;color:#783e2c;box-shadow:0 8px 30px #452b273b;font-size:20px;font-weight:700;text-align:center;pointer-events:none}
.domain-error-popup[hidden]{display:none}
@media(max-width:1000px){.domain-workspace{padding:8px}.domain-workspace .workspace-top h1{font-size:16px}.domain-btn{min-height:38px;font-size:12px;padding:6px 9px}.domain-controls{max-width:200px;font-size:13px}.domain-hint{font-size:12px;right:225px}.domain-workspace-tools~.domain-hint{left:180px}.domain-bottom>span{display:none}.domain-bottom{gap:6px}}
@media(max-width:800px){.domain-closeup{width:65%;top:55px;padding:8px}.domain-closeup header{font-size:13px}.domain-closeup p{font-size:11px}.domain-hint{right:12px;max-width:calc(100% - 190px)}}
@media(max-height:600px) and (orientation:landscape){.domain-workspace{padding:4px 7px;gap:5px}.domain-workspace .workspace-top h1{font-size:14px;max-width:57vw}.domain-workspace .work-label{font-size:10px}.domain-workspace .workspace-top .btn{font-size:12px;min-height:34px}.domain-toolbar{min-height:36px}.domain-btn{min-height:34px;padding:5px 8px;font-size:12px}.domain-wrap{min-height:100px}.domain-workspace-tools{top:4px;left:7px}.domain-controls{top:46px;left:7px;padding:8px;max-width:185px;max-height:calc(100% - 53px)}.domain-controls label{margin:7px 0}.domain-controls input{padding:5px}.domain-hint{top:4px;left:5px;font-size:11px;right:200px}.domain-workspace-tools~.domain-hint{left:172px}.domain-bottom{font-size:11px}.domain-closeup{top:43px;right:6px;max-height:calc(100% - 49px);padding:7px}.domain-closeup p{display:none}.domain-closeup svg{max-height:50dvh}.domain-error-popup{padding:13px 20px;font-size:17px}}

/* Version 11: local instrument actions and workspace controls. */
.domain-header-actions{display:flex;align-items:center;justify-content:flex-end;gap:9px;flex-wrap:nowrap;flex-shrink:0}
.domain-workspace .workspace-top{align-items:center}.domain-workspace .workspace-top h1{min-width:0}
.domain-view-tools{display:flex;align-items:center;gap:7px}
.domain-workspace-tools{display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.domain-wire-color{display:flex;align-items:center;gap:9px;padding:5px 8px;border:1px solid #a5bacd;border-radius:10px;background:#fffffff0;color:#29405a;font-size:13px}
.electric-workspace .domain-controls{top:160px;max-height:calc(100% - 175px)}
.electric-workspace .domain-workspace-tools~.domain-hint{left:240px}
.domain-object-actions{position:absolute;z-index:8;display:flex;align-items:center;padding:4px;border:1px solid #a5bacd;border-radius:13px;background:#fffffff5;box-shadow:0 3px 12px #29425926}
.domain-object-actions[hidden]{display:none}.domain-object-actions .domain-btn{border-radius:10px}
.domain-object-actions .domain-btn[aria-pressed=true]{background:#dbeeff;border-color:#2976bd}
.domain-wrap [data-object=optRuler]{cursor:pointer}

/* Version 12 — quiet instrument chrome around the material workbench. */
.domain-workspace .domain-wrap{background:#e5e8dc;border-color:#bdc8bc;box-shadow:0 2px 2px #25473b0b,0 16px 32px -22px #193d3c45;isolation:isolate}
.domain-workspace .domain-btn{border-color:#afc0bc;background:linear-gradient(#fffef5,#e9eee4);color:#304f58;box-shadow:0 2px 0 #82998e,0 3px 7px #254b3d0d}
.domain-workspace .domain-btn:hover{background:linear-gradient(#fffef6,#ddeadd);border-color:#77998d}
.domain-workspace .domain-btn:active{box-shadow:0 1px 0 #82998e;transform:translateY(1px)}
.domain-workspace .domain-btn:focus-visible,.domain-workspace select:focus-visible{outline:3px solid #79a2ff;outline-offset:3px}
.domain-workspace .domain-controls,.domain-workspace .domain-closeup{border:1px solid #a7bcb3;background:linear-gradient(135deg,#fffef6f7,#edf2e9f7);box-shadow:0 3px 0 #b7c7bd,0 15px 35px #294d4829}
.domain-workspace .domain-controls-close{background:#dbe7df;color:#48655d}
.domain-workspace .domain-wire-color,.domain-workspace .domain-object-actions,.domain-workspace .domain-wire-menu{border-color:#acc0b4;background:#fbfdf2f2;box-shadow:0 3px 9px #244e4021}
.domain-workspace select,.domain-workspace .domain-controls input{background:#fffef7;border-color:#a4b9ae;color:#35584f}
.domain-workspace .domain-hint:not(:empty){background:#fbfceff2;border:1px solid #bdccbe;box-shadow:0 2px 8px #244d3f0b;color:#3e5a50}
.domain-workspace .domain-hint.domain-fault{background:#fff0df;color:#83452e;border-color:#dca881}
.domain-workspace .domain-toolbar [aria-pressed=true],.domain-workspace .domain-object-actions .domain-btn[aria-pressed=true]{background:linear-gradient(#eaf4ff,#c4daf3);border-color:#658db2;color:#2b506e}
.domain-workspace .domain-wrap [data-terminal]:focus-visible{outline:none;filter:drop-shadow(0 0 4px #79a2ff)}
.domain-workspace .domain-wrap [data-device-action]:focus-visible,.domain-workspace .domain-wrap [data-rheostat]:focus-visible{outline:2px solid #79a2ff;outline-offset:3px}
