@import url('data:text/css,');
/* Training is an optional document container; the existing board stays shared. */
.document-strip{display:flex;align-items:center;gap:7px;min-width:0;flex-shrink:0;padding:7px 10px;background:#fff;border-bottom:1px solid var(--line)}
.document-strip>span{font-size:14px;color:var(--teal);font-weight:650;min-width:0;max-width:25%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#document-context{white-space:normal;overflow-wrap:anywhere}
.document-strip label{display:flex;align-items:center;gap:5px;min-width:0;flex:1 1 15em;font-size:14px}
.document-strip label[hidden],.document-strip button[hidden]{display:none}
.document-strip select{min-width:0;width:100%;max-width:320px;border:1px solid var(--line);border-radius:5px;padding:5px;background:#fff;font-size:14px}
.document-strip button{padding:5px 7px;font-size:14px;white-space:nowrap}
.exercise-document-actions{margin-left:auto;display:flex;align-items:center;gap:7px;flex-shrink:0}
#training-dialog{width:min(700px,calc(100vw - 28px));max-height:85vh;overflow:auto;padding:20px;border:1px solid var(--line);border-radius:12px;color:var(--navy)}
#training-dialog::backdrop{background:#102e3955}
.training-heading,.training-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.training-heading{justify-content:space-between}.training-heading h2{font-size:18px;margin:0}
.training-local-note{font-size:12px;line-height:1.5;color:var(--muted)}
#training-error{color:#a03238;border-left:3px solid currentColor;padding-left:10px}
#training-dialog label{display:block;font-size:12px;margin:10px 0 5px}
#training-dialog input:not([type=file]),#training-dialog textarea{display:block;width:100%;font:inherit;font-size:13px;border:1px solid var(--line);border-radius:6px;padding:8px;resize:vertical}
.training-actions{margin:12px 0}#training-exercises{padding:0;list-style:none;max-height:32vh;overflow:auto}
.training-save-bar{position:sticky;top:-1px;z-index:2;background:#fff;padding:1px 0 8px;border-bottom:1px solid var(--line)}
.training-save-bar .training-local-note{margin:0}
#training-exercises li{display:flex;gap:4px;align-items:center;padding:5px;border-bottom:1px solid var(--line)}
#training-exercises li.active{background:#e6f3f1}
#training-exercises [data-training-select]{flex:1;min-width:0;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#training-exercises [data-training-action]{padding:7px 9px}
.library-selection{position:sticky;top:0;z-index:2;display:flex;align-items:center;gap:10px;flex-wrap:wrap;background:#f4f9f8;padding:12px;border:1px solid var(--line);border-radius:8px}
.library-selection[hidden]{display:none}.library-selection>span{flex:1 1 180px}
.library-card.selected{outline:3px solid #12857b;outline-offset:-3px}.library-card.selected .library-open-label{font-weight:700;color:#126c54}
#training-exercises [data-composition-preview]{flex:0 0 120px;width:120px;aspect-ratio:16/9;min-height:0;overflow:hidden;font-size:10px}
#training-exercises [data-training-select]{white-space:normal;overflow-wrap:anywhere}#training-exercises [data-training-select] small{display:block;margin-top:5px;font-weight:400}
.composition-row-actions{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end;max-width:150px}
@media(max-width:500px){#training-exercises li{flex-wrap:wrap}#training-exercises [data-composition-preview]{flex-basis:85px;width:85px}.composition-row-actions{max-width:none;width:100%}#training-exercises{max-height:40vh}}
.training-exercise-details{border-top:1px solid var(--line);padding-top:12px;margin-top:12px;font-size:12px}
#fs-phases .document-strip{border:1px solid var(--line);border-radius:6px;margin-bottom:4px;background:#fffffff0}
@media(max-width:650px){.document-strip{flex-wrap:wrap}.document-strip>span{max-width:45%}.document-strip label{flex-basis:55%}#training-dialog{padding:12px}#training-exercises [data-training-action]{padding:7px}}
:root{font-family:Inter,"Segoe UI",Arial,sans-serif;color:#18313b;background:#f4f6f6;font-synthesis:none;--teal:#087f83;--navy:#102e39;--muted:#788a91;--line:#e4eaec;--gold:#edb94f}*{box-sizing:border-box}body{margin:0;min-width:1100px;height:100vh;overflow:hidden}button,input,select{font:inherit}button{cursor:pointer;border:1px solid var(--line);background:white;border-radius:7px;padding:9px 12px;color:inherit;font-size:12px;font-weight:600;transition:background .15s}button:hover{background:#edf6f5;border-color:#afcfcb}button:disabled{opacity:.35;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #149d98;outline-offset:2px}button.primary{background:var(--teal);border-color:var(--teal);color:#fff}button.primary:hover{background:#09676c}.topbar{height:72px;background:var(--navy);color:#fff;display:flex;align-items:center;padding:0 26px;gap:24px}.brand{display:flex;gap:11px;align-items:center;font-size:20px;font-weight:720;letter-spacing:-.7px}.brand small{display:block;font-size:8px;letter-spacing:2.15px;color:#90b4bc;margin-top:5px}.brand-mark{font-size:31px;font-weight:900;border:1px solid #4b6970;border-radius:11px;width:39px;height:41px;line-height:37px;text-align:center;letter-spacing:-8px;padding-right:7px}.brand-mark span{font-size:25px;color:var(--gold)}.divider{height:28px;width:1px;background:#34505a}.workspace-name{font-size:12px;color:#bdced1;white-space:nowrap}.workspace-name b{font-size:8px;margin-left:8px;border:1px solid #63777d;padding:3px 5px;border-radius:3px;letter-spacing:1px}.top-actions{margin-left:auto;display:flex;align-items:center;gap:8px}.top-actions>span{font-size:10px;color:#91b8b9;margin-right:12px}.topbar button{background:transparent;color:white;border-color:#45606a}.topbar .primary{background:#188f90;border-color:#188f90}.exercise-bar{height:84px;display:flex;align-items:center;justify-content:space-between;padding:0 27px;border-bottom:1px solid var(--line);background:#fff}.eyebrow{display:block;font-size:9px;font-weight:750;letter-spacing:1.8px;color:var(--teal);margin-bottom:7px}#title{border:0;font-size:22px;letter-spacing:-.5px;font-weight:650;color:var(--navy);width:470px;background:transparent;padding:0}.exercise-meta{display:flex;align-items:center;gap:16px}.exercise-meta>span{font-size:9px;letter-spacing:1.4px;color:var(--muted)}.exercise-meta button{font-size:11px}#workspace{display:grid;grid-template-columns:228px minmax(400px,1fr) 244px;height:calc(100vh - 254px)}#workspace.left-closed{grid-template-columns:0 minmax(400px,1fr) 244px}#workspace.right-closed{grid-template-columns:228px minmax(400px,1fr) 0}#workspace.left-closed.right-closed{grid-template-columns:0 1fr 0}.panel{background:#fff;overflow:auto;position:relative;display:flex;flex-direction:column;min-width:0}.panel-heading{display:flex;justify-content:space-between;align-items:center;padding:18px 18px 10px}.panel-heading h2{font-size:14px;margin:0}.panel-heading button{border:0;font-size:21px;padding:0 6px;color:#8b9ca1}#library{border-right:1px solid var(--line)}#properties{border-left:1px solid var(--line)}#categories{padding:6px 12px 13px;border-bottom:1px solid var(--line)}.category{width:100%;display:flex;gap:11px;border:0;background:transparent;text-align:left;padding:8px 10px;margin:2px 0;font-weight:500}.category .icon{width:20px;font-size:17px;line-height:18px;color:#7d9299}.category.active{background:#e6f3f1;color:#087e7f;font-weight:700}.category.active .icon{color:var(--teal)}.category .count{margin-left:auto;font-size:10px;line-height:19px;color:#819595}.library-content{padding:18px 14px}.section-label{font-size:9px;font-weight:700;letter-spacing:1.4px;color:#7a8e93;margin-bottom:12px;display:flex;justify-content:space-between}.section-label span{font-weight:400}.pose-card{width:100%;padding:0;text-align:left;overflow:hidden;margin-bottom:10px;background:#f8faf9;position:relative;border-color:#e1e8e8}.pose-card img{width:100%;height:78px;object-fit:cover;object-position:center;background:#edf1f0;display:block}.pose-card .pose-caption{padding:9px 10px;display:flex;justify-content:space-between;align-items:center;font-size:11px}.pose-card .pose-caption span{color:#8ca0a4;font-size:9px}.pose-card.selected{border-color:var(--teal);box-shadow:0 0 0 1px var(--teal)}.pose-card.selected:after{content:'✓';position:absolute;top:7px;right:7px;width:19px;height:19px;background:var(--teal);border-radius:50%;text-align:center;line-height:19px;color:#fff}.full-width{width:100%}.library-help{font-size:10px;line-height:1.65;color:#839497;margin:12px 1px}.panel-foot{margin-top:auto;padding:15px 16px;border-top:1px solid var(--line);font-size:10px;color:#536d74}.panel-foot small{display:block;font-size:9px;margin:6px 0 0 13px;color:#98a6ab}.live-dot{display:inline-block;width:5px;height:5px;background:#149c8c;border-radius:50%;margin-right:5px}#stage{position:relative;overflow:hidden;background:#e4ece8}#canvas-host{position:absolute;inset:0}canvas{display:block;outline:none}.stage-top{position:absolute;top:18px;left:20px;right:20px;display:flex;justify-content:center;gap:12px;pointer-events:none}.stage-top>*{pointer-events:auto}.view-switch{display:flex;align-items:center;gap:3px;background:#fffefbf5;padding:4px;border:1px solid #dce5e2;border-radius:9px;box-shadow:0 3px 14px #18382c0a}.view-switch>span{font-size:8px;letter-spacing:1.3px;color:#7a9090;padding:0 9px}.view-switch button{border:0;background:transparent;padding:8px 15px;font-size:11px}.view-switch .active{color:#087c7d;background:#e2f0ec}.stage-tools{position:absolute;left:50%;transform:translateX(-50%);bottom:63px;background:#fffefbfa;border:1px solid #e0e6e0;border-radius:10px;display:flex;gap:3px;padding:5px;box-shadow:0 5px 20px #15352312;white-space:nowrap}.stage-tools button{border:0;background:transparent;padding:9px 11px;font-size:15px}.stage-tools button span{font-size:10px;margin-left:4px}.stage-tools .active{background:var(--navy);color:#fff}.stage-tools i{height:23px;width:1px;background:#e0e6e2;align-self:center;margin:0 3px}.stage-bottom{position:absolute;bottom:16px;left:20px;right:20px;display:flex;align-items:center;justify-content:space-between;gap:10px;pointer-events:none}#stage-hint{font-size:10px;color:#4a6c67;background:#edf5efd9;padding:8px 11px;border-radius:5px}.zoom-tools{display:flex;gap:3px;pointer-events:auto}.zoom-tools button{font-size:10px;background:#ffffffed;border-color:#dbe5de;padding:7px 9px}#inspector{padding:12px 18px 18px}.selection-type{font-size:8px;font-weight:700;letter-spacing:1.5px;color:var(--teal)}.selection-name{font-size:17px;letter-spacing:-.4px;margin:7px 0 5px}.selection-sub{font-size:10px;color:var(--muted);margin-bottom:22px}.prop-section{margin:18px 0}.prop-section>label{display:block;font-size:10px;font-weight:650;margin-bottom:8px}.prop-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:5px}.prop-grid label{display:flex;align-items:center;background:#f4f7f7;border:1px solid #e5ebec;border-radius:6px;padding:8px 6px;gap:4px;font-size:9px;color:#8a9a9e}.prop-grid input{min-width:0;width:100%;border:0;outline:0;background:transparent;font-size:11px;color:#29444a;appearance:textfield}.prop-grid input::-webkit-inner-spin-button{appearance:none}.prop-row{display:flex;gap:8px;align-items:center}.prop-row input,.prop-section select{border:1px solid #e3e9e9;background:#f7f9f9;border-radius:6px;padding:9px;width:100%;font-size:11px;color:#29444a}.prop-row span{font-size:10px;color:#9aa6a9}.danger{color:#ae5960}.scene-list{border-top:1px solid var(--line);padding:18px 14px;margin-top:auto}.object-item{display:flex;align-items:center;width:100%;text-align:left;border:0;padding:9px;background:transparent;font-size:10px;font-weight:500;gap:8px}.object-item.active{background:#edf6f3;color:var(--teal)}.object-item small{margin-left:auto;color:#96a5a7;font-size:8px}.empty-state{padding:20px 0;color:#8b9ba0;font-size:12px;line-height:1.7}footer{height:98px;background:#fff;border-top:1px solid var(--line);display:flex;align-items:center;padding:0 23px;gap:20px}.phase-caption{width:186px;flex-shrink:0}.phase-caption>span:last-child{font-size:10px;color:#83979d}#phases{display:flex;gap:9px;max-width:45vw;overflow:auto}.phase-tab{display:flex;align-items:center;gap:10px;min-width:123px;padding:11px 16px;border-radius:9px;text-align:left}.phase-tab .phase-number{font-size:18px;font-weight:400;color:#92a6aa}.phase-tab strong{display:block;font-size:11px}.phase-tab small{display:block;font-size:8px;color:#96a4a5;margin-top:4px}.phase-tab.active{border-color:#128888;background:#edf8f4}.phase-tab.active .phase-number{color:#118885}#add-phase{border-style:dashed;border-color:#bbcdcc;background:transparent;white-space:nowrap;font-size:18px}#add-phase span{font-size:10px;vertical-align:middle}.phase-note{margin-left:auto;display:flex;gap:20px;align-items:center}.phase-note input{border:0;border-bottom:1px solid #e5eae9;padding:9px 0;background:transparent;color:#6e848b;font-size:10px;width:280px}.phase-note span{font-size:10px;color:#859b9c;white-space:nowrap}#loading{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:16px;background:#e7eeebf7;z-index:10;color:#276065}#loading small{color:#7f9698}.spinner{height:27px;width:27px;border:2px solid #b4d6cc;border-top-color:var(--teal);border-radius:50%;animation:spin .8s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}#toast{position:absolute;bottom:120px;left:50%;transform:translateX(-50%);background:var(--navy);color:white;font-size:11px;padding:12px 18px;border-radius:8px;opacity:0;pointer-events:none;transition:opacity .2s;white-space:nowrap}#toast.visible{opacity:1}.hidden{display:none!important}.swatches{display:flex;gap:10px;margin:12px 0}.swatch{height:25px;width:25px;padding:0;border:3px solid white;box-shadow:0 0 0 1px #dae3e0;border-radius:50%}.swatch.active{box-shadow:0 0 0 2px var(--teal)}.asset-option{display:block;width:100%;padding:18px 10px;margin-bottom:10px;text-align:left;font-size:12px}.asset-option b{font-size:23px;margin-right:12px;color:var(--teal)}dialog{width:490px;border:0;border-radius:14px;padding:32px;box-shadow:0 30px 100px #082e3a40;color:var(--navy)}dialog::backdrop{background:#0a243971}dialog h2{font-size:26px;letter-spacing:-1px}dialog p{font-size:12px;color:#647e85;line-height:1.7}dialog small{font-size:10px;line-height:1.7;color:#83969b}.dialog-close{float:right;border:0;font-size:23px;padding:0 5px}
@media(max-height:850px){.pose-card img{height:57px}.library-content{padding-top:12px}.category{padding-top:5px;padding-bottom:5px}.panel-foot{padding:10px}.prop-section{margin:13px 0}.selection-sub{margin-bottom:14px}}
.pose-card img{object-fit:contain}.pose-card{background:#f3f6f5}.pose-card img{background:#e7eceb}.topbar button:hover{background:#264952}
/* Builder UX: a dominant board with compact tools and an independent pose drawer. */
body{display:flex;flex-direction:column;min-width:1000px}
.topbar{height:58px;flex-shrink:0;padding:0 18px;gap:16px}.brand{font-size:18px}.top-actions>a{color:#a5e1dc!important;font-size:11px}.top-actions>span{margin-right:0}.exercise-bar{height:64px;flex-shrink:0;padding:0 20px}#title{font-size:20px}.exercise-meta>span{display:none}
#workspace{flex:1;min-height:0;height:auto;grid-template-columns:170px minmax(400px,1fr) 226px;gap:0}
#workspace.left-closed{grid-template-columns:0 minmax(400px,1fr) 226px}#workspace.right-closed{grid-template-columns:170px minmax(400px,1fr) 0}#workspace.left-closed.right-closed{grid-template-columns:0 minmax(400px,1fr) 0}
.board{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden}#stage{flex:1;min-height:180px}
.panel-heading{padding:15px 12px}.library-content{padding:14px 10px}#categories{padding:6px}.category{padding:10px 7px;font-size:11px}.category .count{display:none}.category .icon{width:24px}.panel-foot{padding:12px;font-size:9px}.panel-foot small{font-size:8px}.asset-option{padding:12px 8px;font-size:11px}.asset-option b{font-size:19px;margin-right:7px}.library-help{font-size:10px}.callout-placeholder{margin:6px 12px;text-align:left;opacity:.65!important}.callout-placeholder small{display:block;font-size:9px;color:var(--muted);margin-top:4px}
.phase-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 12px;background:#fff;border-bottom:1px solid var(--line);flex-shrink:0}.phase-caption{width:auto;min-width:30px}.phase-caption .eyebrow{margin:0}#phases{flex:1;min-width:150px;max-width:none;overflow-x:auto;display:flex;gap:6px}.phase-tab{min-width:100px;padding:6px 9px;gap:8px}.phase-tab small{margin-top:2px}.phase-number{font-size:17px}#add-phase{font-size:15px;padding:8px}.phase-note{width:100%;gap:10px}.phase-note input{width:auto;flex:1;padding:3px;font-size:11px}.phase-note span{font-size:10px}
.stage-top{top:12px;gap:8px}.stage-tools{bottom:50px;white-space:nowrap}.stage-bottom{bottom:10px;left:12px;right:12px}#stage-hint{display:none}.zoom-tools{margin-left:auto}.view-switch{padding:3px}.view-switch button{padding:6px 10px}#canvas-host.pose-drop{outline:3px solid var(--teal);outline-offset:-3px}
#pose-library{background:#fff;border-top:1px solid #b7d5d1;flex-shrink:0}.drawer-heading{display:flex;align-items:center;gap:12px;padding:6px 12px;min-height:40px}.drawer-heading button{border:0;padding:5px 0;color:var(--teal)}.drawer-heading>a{margin-left:auto;font-size:10px;color:var(--teal);white-space:nowrap}.drawer-heading>span{font-size:10px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pose-filters{display:flex;align-items:center;gap:6px;padding:0 12px 8px;font-size:10px}.pose-search{display:flex;align-items:center;gap:6px;flex:1;min-width:90px}.pose-search input{width:100%;min-width:50px}.pose-filters input,.pose-filters select{border:1px solid var(--line);border-radius:6px;background:#f7f9f9;padding:6px;font-size:11px;color:var(--navy)}.pose-filters select{max-width:125px}.pose-filters button{padding:6px;font-size:10px}.pose-filters button[aria-pressed=true]{background:#def1ec;border-color:var(--teal);color:var(--teal)}.pose-pagination{display:flex;align-items:center;gap:5px;white-space:nowrap;color:var(--muted)}
#pose-results{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;padding:0 12px 10px;min-height:108px}.drawer-card{position:relative;min-width:0}.drawer-card .pose-card{width:100%;height:100%;margin:0;padding:0;overflow:hidden;border-radius:7px}.drawer-card .pose-card img{height:69px;width:100%;object-fit:contain}.drawer-card .pose-caption{display:block;font-size:10px;padding:5px 7px;text-align:left;line-height:1.3}.drawer-card .pose-favorite{position:absolute;right:4px;top:4px;padding:2px 5px;background:#ffffffeb;font-size:16px;color:var(--teal)}.pose-empty{grid-column:1/-1;color:var(--muted);font-size:12px;align-self:center;text-align:center}.pose-card[draggable=true]{cursor:grab}.pose-card.selected{border-color:var(--teal);box-shadow:inset 0 0 0 1px var(--teal)}
#inspector{padding:14px}.scene-list{padding:12px}.selection-name{font-size:17px}.prop-section{margin:12px 0}#toast{z-index:11}
@media(max-height:760px){.drawer-card .pose-card img{height:48px}#pose-results{min-height:88px}.phase-note{gap:8px}.topbar{height:52px}.exercise-bar{height:54px}.prop-section{margin:9px 0}.stage-tools{bottom:45px}}
@media(max-width:1150px){.workspace-name,.top-actions>#save-status{display:none}.drawer-heading>span{max-width:170px}.pose-search{font-size:0}.pose-search input{font-size:11px}#workspace{grid-template-columns:150px minmax(400px,1fr) 210px}#workspace.left-closed{grid-template-columns:0 minmax(400px,1fr) 210px}#workspace.right-closed{grid-template-columns:150px minmax(400px,1fr) 0}}
#stage-hint{display:block;position:absolute;bottom:86px;left:0;max-width:100%;font-size:10px;padding:5px 8px;background:#ffffffde;border-radius:5px;pointer-events:none}

/* Compact toolbar anchored outside the central working area. */
.stage-tools{left:12px;bottom:50px;transform:none;padding:3px;gap:2px;border-radius:7px;box-shadow:0 2px 8px #15352312}
.stage-tools button{display:flex;align-items:center;justify-content:center;min-width:28px;height:28px;padding:4px 6px;font-size:15px;border-radius:4px}
.stage-tools button span{display:none}
.stage-tools button[data-tool="orbit"] span{display:inline;font-size:10px;margin-left:3px}
.stage-tools button[data-tool="orbit"] .navigation-cross{font-size:18px;line-height:1;margin:0 3px 0 0}
.stage-tools button.active{background:#dff2ed;color:#076c70;box-shadow:inset 0 0 0 1px #83bdb4}
.stage-tools i{height:16px;margin:0 2px}
/* Both toolbars share a baseline and visual shell at the canvas edges. */
.stage-tools,.zoom-tools{height:36px;box-sizing:border-box;display:flex;align-items:center;gap:2px;padding:3px;background:#fffefbfa;border:1px solid #e0e6e0;border-radius:7px;box-shadow:0 2px 8px #15352312}
.stage-tools{bottom:10px}
.stage-bottom{bottom:10px;height:36px}
.zoom-tools button{height:28px;min-width:28px;display:flex;align-items:center;justify-content:center;padding:4px 7px;border:0;border-radius:4px;background:transparent;font-size:10px}
.zoom-tools button:hover{background:#edf6f5}
#stage-hint{bottom:42px;max-width:330px;padding:3px 5px;font-size:9px;line-height:1.35;color:#526e67;background:#edf5efb8;border-radius:4px}

/* Controls live in the sidebar; the canvas contains only the 3D scene. */
#properties .panel-heading{padding:12px 14px}
.control-section{padding:12px 14px;border-bottom:1px solid var(--line);flex-shrink:0}
.control-title{margin:0 0 9px;font-size:11px;font-weight:700;color:var(--navy)}
#properties #inspector{padding:0}
#properties .selection-name{margin:5px 0;font-size:15px}
#properties .selection-sub{margin-bottom:8px;font-size:10px}
#properties .prop-section{margin:10px 0}


#properties .stage-tools{position:static;transform:none;width:100%;height:auto;display:grid;grid-template-columns:1fr 1fr;gap:5px;padding:0;border:0;background:transparent;box-shadow:none;white-space:normal}
#properties .stage-tools i{display:none}
#properties .stage-tools button{height:30px;border:1px solid var(--line);justify-content:flex-start;font-size:14px}
#properties .stage-tools button span{display:inline;font-size:10px;margin-left:4px}
#properties #undo::after{content:attr(data-label);font-size:10px;margin-left:5px}
#properties #redo::after{content:attr(data-label);font-size:10px;margin-left:5px}
#properties #stage-hint{display:block;position:static;margin-top:8px;padding:0;max-width:none;color:var(--muted);background:transparent;font-size:9px;line-height:1.5}
#properties .view-switch{width:100%;box-shadow:none;padding:3px;justify-content:space-between}
#properties .view-switch>span{display:none}
#properties .view-switch button{flex:1;padding:6px 5px;font-size:10px}
#properties .zoom-tools{height:auto;display:grid;grid-template-columns:28px 1fr 28px;gap:4px;width:100%;margin:0;padding:0;border:0;background:transparent;box-shadow:none}
#properties .zoom-tools button{border:1px solid var(--line)}
#properties #focus-goal{grid-column:1/-1}
#advanced-transform>summary{cursor:pointer;font-size:11px;font-weight:600;color:var(--navy);padding:2px 0}
#advanced-transform[open]>summary{margin-bottom:8px}
#properties .scene-list{margin-top:0;flex-shrink:0}
.exercise-meta .floating{font-size:10px}

/* Native fullscreen isolates the current board without changing exercise state. */
#exit-fullscreen{display:none}
#stage:fullscreen{width:100vw;height:100vh;min-height:0;flex:none;border:0;background:#e0e9e3}
#stage:fullscreen::backdrop{background:#e0e9e3}
#stage:fullscreen #exit-fullscreen{display:block;position:absolute;top:12px;right:12px;z-index:20;padding:6px 9px;font-size:11px;color:var(--navy);background:#ffffffd9;border:1px solid #dbe5de;border-radius:6px;opacity:.75}
#stage:fullscreen #exit-fullscreen:hover,#stage:fullscreen #exit-fullscreen:focus-visible{opacity:1}
@media(max-width:1250px){.topbar .workspace-name,.top-actions>#save-status{display:none}}

.equipment-option{display:flex;flex-direction:column;gap:6px;padding:8px;width:100%;text-align:left}
.equipment-option img{width:100%;height:95px;object-fit:contain;background:#edf1f1;border-radius:5px}
.equipment-option span{font-size:12px;line-height:1.35}

/* Fullscreen is the same editor, with its existing nodes temporarily docked here. */
.fs-only{display:none}
#stage:fullscreen .fs-only:not([hidden]){display:block;position:absolute;z-index:15}
#stage:fullscreen #fs-actions{top:12px;left:12px;display:flex;gap:5px}
#fs-actions button{padding:7px 9px;font-size:11px;background:#ffffffed}
#stage:fullscreen #fs-phases{top:12px;left:290px;right:155px}
#fs-phases .phase-bar{padding:3px;gap:4px;border:1px solid var(--line);border-radius:7px;background:#fffffff0;flex-wrap:nowrap}
#fs-phases .phase-caption,#fs-phases .phase-note,#fs-phases .phase-number,#fs-phases .phase-tab small,#fs-phases #add-phase span{display:none}
#fs-phases #phases{min-width:0;gap:3px}
#fs-phases .phase-tab{min-width:0;white-space:nowrap;padding:6px 8px;font-size:11px}
#fs-phases #add-phase{font-size:0;padding:6px 9px;flex-shrink:0}
#fs-phases #add-phase::after{content:'+';font-size:17px}
#stage:fullscreen .fs-panel{top:58px;bottom:64px;max-height:calc(100% - 122px);overflow:auto;background:#fff;border:1px solid var(--line);border-radius:9px;box-shadow:0 4px 18px #102e3922}
#fs-properties{right:12px;width:270px;max-width:calc(100% - 24px)}
#stage:fullscreen #toast{bottom:62px;max-width:calc(100% - 24px);white-space:normal;pointer-events:none}
@media(max-width:800px){
 #stage:fullscreen #fs-phases{top:55px;left:12px;right:12px}
 #stage:fullscreen .fs-panel{top:101px;max-height:calc(100% - 165px)}
 #fs-actions button{padding:7px 5px;font-size:10px}
}

/* One contextual DOM toolbar, shared by normal and fullscreen editing. */

.stage-tools #delete:not(:disabled){color:#a34e56}
.stage-tools #duplicate span,.stage-tools #delete span{display:inline;font-size:10px}

/* Shared category overlay: opening it never participates in board layout. */
#category-drawer{position:absolute;z-index:12;left:12px;top:12px;width:360px;max-width:calc(100% - 24px);max-height:calc(100% - 24px);display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 28px #102e392b;overflow:hidden}
#category-drawer[hidden],#pose-library[hidden]{display:none}
.category-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-bottom:1px solid var(--line);flex-shrink:0}
.category-heading h2{font-size:13px;margin:0}.category-heading button{font-size:22px;border:0;padding:0 6px}
.category-scroll{overflow:auto;overscroll-behavior:contain;min-height:0;padding:12px}
#category-drawer #pose-library{border:0}
#category-drawer .drawer-heading{flex-wrap:wrap;padding:10px 0;gap:8px}
#category-drawer .drawer-heading>span{white-space:normal;max-width:none}
#category-drawer .drawer-heading>a{margin-left:0}
#category-drawer .pose-filters{flex-wrap:wrap;padding:0 0 10px}
#category-drawer .pose-search{flex-basis:100%;font-size:10px}
#category-drawer #pose-results{grid-template-columns:repeat(2,minmax(0,1fr));padding:0;min-height:0}
#category-drawer .pose-card img{height:100px}
#drawer-categories:empty{display:none}
#drawer-categories #categories{display:grid;grid-template-columns:1fr 1fr;padding:0 0 10px;margin-bottom:12px}
#drawer-categories .category{font-size:10px;padding:6px;gap:4px}
#stage:fullscreen #category-drawer{top:58px;max-height:calc(100% - 122px)}
#fs-properties #properties{width:100%;height:auto;overflow:visible;border:0}
#fs-properties{overscroll-behavior:contain;touch-action:pan-y}
#fs-properties #properties{flex-shrink:0}
#fs-properties .control-section,#fs-properties .scene-list{flex-shrink:0}
#fs-properties .panel-heading{display:none}
@media(max-width:800px){#stage:fullscreen #category-drawer{top:101px;max-height:calc(100% - 165px)}}

@media(max-width:760px){
 #category-drawer{max-width:min(calc(100% - 24px),calc(100vw - 174px))}
 #workspace.left-closed #category-drawer,#stage:fullscreen #category-drawer{max-width:calc(100% - 24px)}
}

#delete-phase{white-space:nowrap;padding:8px;font-size:10px;flex-shrink:0}
#fs-phases #delete-phase{padding:6px 8px}

/* Fixed launcher slot: artwork does not change row height or text alignment. */
#categories .category .icon{flex:0 0 24px;width:24px;height:18px;position:relative}
#categories .category .icon img,#categories .category .icon svg{position:absolute;width:24px;height:24px;left:0;top:50%;transform:translateY(-50%);object-fit:contain;pointer-events:none;border:0;background:none}

/* Header branding only; existing header heights and action controls stay unchanged. */
.topbar .gkcanvas-brand{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;flex:0 0 230px;width:230px;letter-spacing:normal}
.gkcanvas-brand .brand-logo{display:block;width:230px;height:31px;object-fit:contain;object-position:left center}
.topbar .gkcanvas-brand small{margin:0;width:230px;color:#fff;font-size:8px;line-height:10px;font-weight:500;letter-spacing:1.8px;white-space:nowrap;text-align:center}
@media(max-width:1150px){
 .topbar .gkcanvas-brand{flex-basis:196px;width:196px}
 .gkcanvas-brand .brand-logo{width:196px;height:27px}
 .topbar .gkcanvas-brand small{width:196px;font-size:7.5px;letter-spacing:1.2px}
}
@media(max-width:1000px){
 .topbar{max-width:100vw;overflow-x:auto;scrollbar-width:none}
 .topbar::-webkit-scrollbar{display:none}
 .topbar>.divider,.topbar>.top-actions{flex-shrink:0}
}
/* Smart Phase shares the existing phase bar, including its fullscreen placement. */
#smart-phase{white-space:nowrap;font-size:10px;padding:8px;flex-shrink:0}
#fs-phases #smart-phase{padding:6px;font-size:10px}
#fs-phases #add-phase::after{content:'⧉'}
#fs-phases .phase-bar{overflow-x:auto}

#association-choice{position:absolute;z-index:35;left:12px;top:64px;width:260px;max-width:calc(100% - 24px);max-height:60%;overflow:auto;padding:12px;background:var(--panel,#fff);color:#173b42;border:1px solid #b9d3cf;border-radius:10px;box-shadow:0 6px 22px #1234;display:grid;gap:6px}
#association-choice[hidden]{display:none}
#association-choice p{font-size:12px;margin:0}
#association-choice button{text-align:left}

#association-choice button:focus-visible,#association-choice button:hover{outline:2px solid #29a895;outline-offset:-2px}
#association-choice button[aria-disabled="true"]{opacity:.55}
#arrow-link{width:100%;text-align:left}
#update-next-phase{white-space:nowrap;font-size:10px;padding:8px;flex-shrink:0}
#next-update-panel{position:absolute;z-index:36;top:64px;left:12px;width:360px;max-width:calc(100% - 24px);max-height:calc(100% - 80px);overflow:auto;box-sizing:border-box;padding:14px;border:1px solid #b9d3cf;border-radius:10px;background:var(--panel,#fff);color:#173b42;box-shadow:0 6px 22px #1234;display:grid;gap:10px}
#next-update-panel[hidden]{display:none}
#next-update-panel p{font-size:12px;margin:0}
.next-update-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px;border-radius:5px}
.next-update-row:hover,.next-update-row:focus-within{outline:2px solid #29a895}
.next-update-row small{display:block;font-size:10px;color:#53675b}
.next-update-row select{max-width:55%;font-size:12px}
.next-update-row[hidden]{display:none}
.next-update-actions{display:flex;flex-wrap:wrap;gap:6px}
#confirm-next-update{background:#147b68;color:#fff}
.next-relation{font-size:12px;display:flex;align-items:start;gap:6px}
#object-name{display:block;width:100%;box-sizing:border-box;font:inherit;font-size:14px;font-weight:700;color:inherit;padding:5px 3px;margin:5px 0;border:1px solid transparent;border-radius:4px;background:transparent}
#object-name:hover{border-color:#b9d3cf}
#object-name:focus{outline:2px solid #29a895;background:#fff}
#smart-phase-toggle{white-space:nowrap;font-size:10px;padding:7px;flex-shrink:0;border-radius:14px;background:#f1f4f3;color:#475d60;border:1px solid #b9c9c6}
#smart-phase-toggle[aria-checked="true"]{background:#087e78;color:#fff;border-color:#087e78}
#smart-phase-toggle:focus-visible{outline:2px solid #29a895;outline-offset:2px}
/* Compact navigation: only the numbered phase list scrolls. */
.phase-bar{display:flex;flex-direction:column;flex-wrap:nowrap;align-items:stretch;height:89.2px;gap:10px;position:relative;z-index:20}
.phase-navigation{display:flex;align-items:center;gap:8px;min-width:0;flex:1}
.phase-navigation .phase-caption{flex:0 0 auto;min-width:0}
.phase-navigation #phases{min-width:32px;flex:1 1 0;gap:4px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin}
.phase-navigation .phase-tab{flex:0 0 36px;min-width:36px;height:34px;padding:0;justify-content:center;border-radius:6px}
.phase-navigation .phase-number{font-size:12px;font-weight:650;color:inherit}
.phase-navigation .phase-tab.active{background:#087e78;border-color:#087e78;color:#fff}
.phase-navigation .phase-tab.active .phase-number{color:inherit}
.phase-actions{display:flex;flex:0 0 auto;align-items:center;gap:4px}
.phase-actions .phase-icon{display:inline-flex;align-items:center;justify-content:center;width:30px;height:32px;padding:0!important;flex-shrink:0;font-size:18px!important}
.phase-actions #smart-phase-toggle{height:30px;padding:5px 7px}
.phase-more{position:relative}
#phase-more-menu{position:absolute;right:0;top:calc(100% + 6px);padding:5px;background:white;border:1px solid var(--line);border-radius:8px;box-shadow:0 5px 18px #102e3922;z-index:40}
#phase-more-menu[hidden]{display:none}
#phase-more-menu button{border:0;text-align:left;min-height:34px}
.phase-bar .phase-note{height:20px;flex:0 0 20px;min-width:0}
.phase-bar .phase-note input{min-width:0}
#fs-phases .phase-bar{height:44px;overflow:visible;gap:0}
#fs-phases .phase-caption,#fs-phases .phase-number{display:block}
#fs-phases .phase-tab{min-width:36px;padding:0}
#fs-phases #add-phase{font-size:18px}
#fs-phases #add-phase::after{content:none}
@media(max-width:1100px){
 .phase-navigation{gap:4px}
 .phase-actions{gap:2px}
 .phase-actions .phase-icon{width:27px}
 .phase-actions #smart-phase-toggle{font-size:9px;padding:4px}
 .phase-navigation .phase-tab{flex-basis:32px;min-width:32px}
 .phase-bar{padding-left:6px;padding-right:6px}
}

#association-choice .association-candidates{display:grid;gap:6px;max-height:28vh;overflow:auto;min-height:0}
#association-choice .association-candidates small{color:var(--teal,#087e78);font-size:11px;font-weight:600}
/* Contextual update shares the note row; duplication stays in the overflow menu. */
.phase-bar{gap:4px}
.phase-bar .phase-note{height:32px;flex-basis:32px;gap:8px}
.phase-bar .phase-note input{flex:1 1 0;width:0;text-overflow:ellipsis}
#update-next-phase{height:30px;padding:5px 9px;font-size:11px;color:#087e78;background:#e6f3f1;border-color:#b6d8cf}
#update-next-phase:hover{background:#d4ebe4;border-color:#087e78}
#update-next-phase[hidden]{display:none}
#phase-more-menu #add-phase{font-size:12px;padding:8px 12px;background:transparent;border:0;white-space:nowrap}
#fs-phases .phase-bar{height:78px;gap:4px}
#fs-phases .phase-note{display:flex}
#fs-phases #phase-more-menu #add-phase{font-size:12px;padding:8px 12px}
#stage:fullscreen #next-update-panel{top:146px;max-height:calc(100% - 162px)}
@media(max-width:800px){
 #update-next-phase{font-size:10px;padding:5px 7px}
 .phase-bar .phase-note{gap:5px}
 #fs-phases .phase-note #phase-counter{font-size:9px}
 #stage:fullscreen #next-update-panel{top:188px;max-height:calc(100% - 204px)}
}
/* Context editor stays inside the fullscreen stage; no permanent panel. */
#field-text-editor{position:absolute;z-index:45;width:300px;max-width:calc(100% - 16px);padding:14px;background:#fff;color:#163c49;border:1px solid #cededb;border-radius:10px;box-shadow:0 8px 24px #1235;display:grid;gap:8px}
#field-text-editor[hidden]{display:none}
#field-text-editor textarea{width:100%;box-sizing:border-box;resize:vertical;max-height:150px;font:inherit;padding:8px;border:1px solid #cededb;border-radius:5px}
#field-text-editor small{font-size:11px;color:#52716c}
#field-text-editor>div{display:flex;gap:8px}
#field-text-error{color:#b23730;margin:0;font-size:12px}
#field-text-error:empty{display:none}
#field-text-editor{max-height:calc(100% - 16px);overflow:auto}
#field-text-size{display:block;box-sizing:border-box;width:100%;padding:8px;border:1px solid #cededb;border-radius:6px;font:inherit;color:inherit}
#field-text-color{display:block;width:44px;height:32px;padding:2px;border:1px solid #cededb;border-radius:5px;background:transparent}
#field-text-bold{accent-color:#087e78}
/* Recovery is available before 3D initialization and never changes the exercise. */
#local-recovery{max-width:560px;width:calc(100% - 40px);box-sizing:border-box;max-height:90vh;overflow:auto;padding:24px;border:1px solid #cededb;border-radius:12px;color:#163c49;background:#fff}
#local-recovery::backdrop{background:#123b}
#local-recovery h2{margin-top:0}
#local-recovery p{line-height:1.5}
#local-recovery select{width:100%;margin:8px 0;padding:8px}
#local-recovery .recovery-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
#local-recovery small{display:block;line-height:1.5;color:#52716c}

/* Arrow palettes only; field text and other object color controls stay unchanged. */
.arrow-color-options{display:flex;flex-wrap:wrap;gap:8px;padding:3px}
.arrow-color-swatch{width:32px;height:32px;flex:0 0 32px;padding:0;border:2px solid #bac7cb;border-radius:50%;background:var(--arrow-color);display:grid;place-items:center}
.arrow-color-swatch:hover{background:var(--arrow-color);border-color:var(--teal)}
.arrow-color-swatch[aria-pressed="true"]{border-color:var(--teal);box-shadow:0 0 0 2px white,0 0 0 4px var(--teal)}
.arrow-color-swatch[aria-pressed="true"] span{background:white;color:#102e39;border-radius:50%;width:17px;height:17px;line-height:17px;font-size:13px}
.arrow-color-existing{display:flex;align-items:center;gap:8px;margin-top:12px;font-size:10px;line-height:1.5}
.arrow-color-existing code{display:block}
.arrow-color-sample{display:block;width:28px;height:28px;flex:0 0 28px;border:1px solid #bac7cb;border-radius:50%;background:var(--arrow-color)}

.training-save-recover{display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap}
.training-save-recover button[hidden]{display:none}
#personal-exercises .personal-rename{flex:0 0 auto;text-align:center}
#personal-title-message{font-size:14px;color:var(--navy);overflow-wrap:anywhere}
#personal-title-label[hidden]{display:none}
.personal-dialog.exercise-save-dialog{max-height:calc(100dvh - 32px);padding:24px;box-sizing:border-box}
.exercise-save-dialog textarea{width:100%;box-sizing:border-box;resize:vertical;min-height:110px;padding:10px;border:1px solid #c9d7d7;border-radius:6px;font:inherit}
.exercise-save-dialog fieldset{border:0;padding:0;margin:18px 0;min-width:0}
.exercise-save-dialog legend{font-weight:600;margin-bottom:8px}
.exercise-detail-choices{display:flex;flex-wrap:wrap;gap:8px}
.exercise-detail-choices button{min-height:44px;white-space:normal}
.exercise-detail-choices button[aria-pressed="true"]{background:#dcefe9;border:2px solid #137c78;color:#12313b;font-weight:700}
.exercise-save-dialog :focus-visible{outline:3px solid #168d91;outline-offset:2px}
.exercise-save-dialog .exercise-save-actions{position:sticky;bottom:-24px;background:white;padding:12px 0;margin-bottom:0;justify-content:flex-end;border-top:1px solid #e1e9e8}
#exercise-save-submit,#training-save-submit{background:#148b8e;color:white}
#exercise-save-status{color:#125c60;overflow-wrap:anywhere}
.exercise-save-actions #exercise-save-status{flex-basis:100%;margin:0}
.exercise-save-actions #exercise-save-status:empty{display:none}
.personal-dialog.save-attention-dialog{position:fixed;inset:0;margin:auto;width:min(440px,calc(100vw - 64px));max-height:calc(100dvh - 64px);box-sizing:border-box;padding:24px;border:2px solid #d49a31;border-radius:14px;box-shadow:0 16px 60px #102e3959;overflow:auto}
.save-attention-dialog::backdrop{background:#102e3966}
.save-attention-dialog h2{margin:0 0 14px;font-size:22px;overflow-wrap:anywhere}
.save-attention-dialog p{font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.save-attention-dialog .personal-actions{justify-content:flex-end;margin-bottom:0}
.save-attention-dialog button{min-height:44px;max-width:100%;white-space:normal;background:var(--teal);color:#fff}
.save-attention-dialog #save-attention-cancel{background:#fff;color:var(--navy)}
.exercise-save-dialog input[aria-invalid="true"],.exercise-save-dialog textarea[aria-invalid="true"]{border:2px solid #a95609;background:#fff8eb;outline-offset:3px}
@media(max-width:480px){.personal-dialog.exercise-save-dialog{padding:16px;width:calc(100vw - 16px);max-height:calc(100dvh - 16px)}.exercise-save-dialog .exercise-save-actions{bottom:-16px}.exercise-save-actions button{flex:1;min-height:44px}}
.training-secondary{margin-top:16px;border-top:1px solid #dce5e8;padding-top:12px}.training-secondary summary{cursor:pointer;font-size:12px;font-weight:600}.training-secondary .training-actions{margin-top:12px}#training-cloud-status{color:#125c60;font-size:12px;overflow-wrap:anywhere}#training-cloud-status:empty{display:none}
.personal-dialog{width:min(640px,calc(100vw - 32px));max-height:85vh;overflow:auto}.personal-dialog label,.auth-callback label{display:grid;gap:6px;margin:12px 0}.personal-dialog input,.auth-callback input{padding:10px;border:1px solid #c9d7d7;border-radius:6px;width:100%;box-sizing:border-box}.personal-actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}#personal-exercises{padding:0;list-style:none}#personal-exercises li{display:flex;align-items:center;gap:12px;margin:8px 0}#personal-exercises button{min-width:0;overflow-wrap:anywhere;text-align:left;flex:1}#personal-status{color:#125c60;font-weight:600}#personal-open-fullscreen{position:absolute;right:20px;top:60px;z-index:12}.auth-callback{display:block;overflow:auto;background:#edf4f1}.auth-callback main{max-width:560px;margin:8vh auto;padding:24px;background:white;border-radius:12px}.top-actions{gap:7px}@media(max-width:1450px){.topbar .workspace-name,.topbar>.divider{display:none}.top-actions>#save-status{display:none}.top-actions button{padding-left:8px;padding-right:8px}}@media(max-width:1150px){.topbar .gkcanvas-brand{width:160px}.topbar .brand-logo{width:160px;height:auto}.top-actions>a{display:none}}
.document-strip{flex-wrap:wrap}
@media(max-width:550px){
 /* The canvas has a 400px minimum. Keep navigation inside the visible space
    beside the open 150px library, including when only the right panel closes. */
 #workspace:not(.left-closed) .board>.document-strip{max-width:calc(100vw - 150px)}
 .board>.document-strip{box-sizing:border-box;max-width:100vw;max-height:36dvh;overflow:auto;gap:5px}
 .board>.document-strip #document-context{max-width:100%}
 .board>.document-strip label{flex-basis:100%}
 .board>.document-strip .exercise-document-actions{flex-wrap:wrap;max-width:100%;margin-left:0;gap:5px}
}
#fullscreen-save-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:7px;margin-left:auto;min-width:0;background:white;padding:6px;border-radius:6px;margin-bottom:4px}
#fullscreen-save-actions[hidden],#fullscreen-save-actions button[hidden]{display:none}
#fullscreen-save-actions button{min-height:36px;white-space:nowrap}
.exercise-meta button:not(.floating),#fullscreen-save-actions button{font-size:14px}
@media(max-width:800px){
 #stage:fullscreen #fs-phases{top:102px}
 #fs-phases .document-strip{max-height:calc(100dvh - 210px);overflow-y:auto;overscroll-behavior:contain}
 #fullscreen-save-actions{flex:1 1 100%}
 #fullscreen-save-actions button{min-height:44px;flex:0 1 auto}
}
#cloud-workspace-status{font-size:11px;color:#125c60;max-width:180px}
#manage-training[hidden],#cloud-workspace-status[hidden]{display:none}
.personal-dialog.document-menu{width:min(430px,calc(100vw - 24px));box-sizing:border-box}
.document-menu>.dialog-close,.document-archive>.dialog-close{position:absolute;top:10px;right:10px;min-width:44px;min-height:44px}
.document-menu>h2,.document-archive>h2{padding-right:34px;overflow-wrap:anywhere}
.document-menu>button:not(.dialog-close){display:block;width:100%;margin:8px 0;min-height:44px;white-space:normal;text-align:left}
.document-menu>button[hidden]{display:none}
.archive-records{padding:0;list-style:none}
.archive-records li{display:flex;align-items:center;gap:8px;margin:8px 0;flex-wrap:wrap}
.archive-records li>button:first-child{flex:1 1 180px;min-width:0;min-height:44px;white-space:normal;overflow-wrap:anywhere;text-align:left}
.archive-records small{font-size:11px;color:#577078}
.document-archive .personal-rename{flex:0 0 auto!important;min-height:44px}
.document-archive :focus-visible,.document-menu :focus-visible{outline:3px solid #148b8e;outline-offset:2px}
#archive-search-form{display:flex;align-items:end;gap:8px;flex-wrap:wrap}#archive-search-form label{flex:1;margin:0;min-width:160px}#archive-search-form button{min-height:42px}
#archive-more[hidden]{display:none}
#training-save-summary{padding-left:22px;overflow-wrap:anywhere}
/* Dedicated library view: keep the live Builder mounted behind it. */
.library-view{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;background:#f3f7f6;color:var(--navy);text-align:left;min-width:0;font-size:14px}
.library-view[hidden]{display:none}
.topbar.library-header{flex-wrap:wrap;height:auto;min-height:58px;padding-top:6px;padding-bottom:6px;overflow:visible}
#library-brand{flex:0 0 auto}
.library-account-actions{margin-left:auto;flex-wrap:wrap;justify-content:flex-end}
.library-navigation{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 18px;background:white;border-bottom:1px solid var(--line);flex:0 0 auto}
.library-navigation [aria-current="page"]{background:#e3f3ef;border-color:#12857b;color:#126c54}
.library-scroll{overflow:auto;min-height:0;flex:1;overscroll-behavior:contain}
.library-content{max-width:1400px;margin:auto;padding:32px 28px}
.library-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;flex-wrap:wrap;margin-bottom:22px}
.library-heading h1{margin:0;font-size:30px;letter-spacing:-.6px}
.library-heading p:not(.eyebrow){color:#527078;margin:10px 0 0;line-height:1.5}
.library-heading>.primary{min-height:46px;padding:12px 22px;font-size:14px}
.library-view #archive-search-form{background:white;border:1px solid var(--line);padding:16px;border-radius:10px;align-items:end}
.library-view #archive-search-form label{display:grid;gap:7px}
.library-view input{padding:11px;border:1px solid #c9d7d7;border-radius:6px;min-width:0;width:100%;font-size:14px}
.library-view #document-archive-status{min-height:20px;line-height:1.5;color:#125c60;overflow-wrap:anywhere}
.library-view #library-guest{padding:28px;background:white;border-radius:10px;text-align:center}
.library-view [hidden]{display:none!important}
.library-view .library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));gap:22px;padding:0;margin:20px 0;list-style:none}
.library-view #personal-exercises .library-card{display:flex;flex-direction:column;align-items:stretch;gap:0;margin:0;border:1px solid #dce7e5;border-radius:12px;background:white;overflow:hidden;box-shadow:0 3px 12px #1232;min-width:0}
.library-view #personal-exercises .library-card-open{display:flex;flex-direction:column;align-items:stretch;text-align:left;width:100%;padding:0;border:0;border-radius:0;flex:1;min-width:0;font-size:16px;overflow-wrap:anywhere}
.library-placeholder{display:grid;place-items:center;aspect-ratio:16/9;background:linear-gradient(145deg,#e3eeeb,#d5e4df);color:#54736e;font-size:12px;font-weight:500;padding:20px;text-align:center}
.library-card-open>strong{padding:18px 18px 10px;line-height:1.4}
.library-card-info{padding:0 18px 14px;color:#5d777d;font-size:12px;line-height:1.6;font-weight:400}
.library-open-label{padding:0 18px 16px;margin-top:auto;font-size:13px;color:#087f83}
.library-card-actions{display:flex;flex-wrap:wrap;gap:8px;padding:12px 18px;border-top:1px solid #e4ece9}
.library-view #personal-exercises .library-card-actions .library-card-print{flex-basis:100%;color:#087f83;font-weight:700}
.exercise-print-dialog{width:min(960px,calc(100vw - 20px));max-width:none;height:calc(100dvh - 24px);max-height:calc(100dvh - 24px);padding:12px;border:0;border-radius:12px;background:#f5f8f8;color:#17343e;overflow:hidden}
.exercise-print-dialog[open]{display:flex;flex-direction:column;gap:8px}
.exercise-print-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;flex-shrink:0}
.exercise-print-toolbar h2{font-size:17px;flex:1 1 190px;margin:0}
.exercise-print-toolbar button{min-height:44px}
.training-page-count{display:inline-flex;align-items:center;gap:6px;font-size:14px}.training-page-count[hidden]{display:none}.training-page-count select{min-height:40px}
#exercise-print-status{font-size:12px;margin:0;flex-shrink:0}
#exercise-print-frame{width:100%;flex:1;min-height:0;border:1px solid #d6e3df;border-radius:4px;background:white}
.print-options{flex-shrink:0;display:flex;flex-wrap:wrap;align-items:center;gap:8px;font-size:12px}.print-options[hidden]{display:none}.print-options fieldset{border:0;padding:0;margin:0;display:flex;gap:4px;flex-wrap:wrap}.print-options label{display:inline-flex;align-items:center;gap:5px;min-height:36px;padding:2px 6px}.print-options legend{font-weight:600}.print-options select{max-width:180px;min-height:36px}
.exercise-print-dialog::backdrop{background:#17343e88}
.training-print-options{overflow:auto;min-height:0;padding:4px}
.training-print-options fieldset{min-width:0;margin:0 0 12px;padding:10px 14px;border:1px solid var(--line);border-radius:8px;background:white}
.training-print-options legend{font-weight:650;overflow-wrap:anywhere}
.training-print-options button{min-height:36px;margin-right:6px}
.training-phase-list{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.training-phase-list label{display:inline-flex;align-items:center;gap:5px;min-height:44px;padding:0 8px;cursor:pointer}
.library-view #personal-exercises .library-card-actions .library-card-delete{color:#b42318}
.library-view #personal-exercises .library-card-actions button{flex:1;min-height:42px;font-size:12px;text-align:center}
.library-view :focus-visible{outline:3px solid #169e97;outline-offset:-3px}
.library-pagination{display:flex;align-items:center;justify-content:center;gap:16px;margin:28px 0}
.library-pagination button{min-height:44px}
.library-secondary{border-top:1px solid #d9e4e1;padding-top:18px;color:#527078}
.library-secondary summary{cursor:pointer;padding:8px 0}
.library-secondary button{margin:8px 8px 0 0;min-height:42px}
@media(max-width:650px){
 .topbar.library-header{padding:8px 12px;gap:8px}
 .library-navigation{padding:8px 12px}.library-navigation button{flex:1;min-height:44px}
 .library-account-actions{gap:6px}.library-account-actions button{padding:8px;min-height:40px}
 .library-content{padding:24px 16px}.library-heading{gap:16px}.library-heading h1{font-size:25px}
 .library-heading>.primary{width:100%}.library-view #archive-search-form label{flex-basis:100%}
 .library-view #archive-search-form button{flex:1;padding:8px;font-size:11px}
 .library-pagination{gap:10px;font-size:12px}
}
/* The title action shares its node/handler with the fullscreen action strip. */
.exercise-bar{gap:12px;max-width:100vw;height:auto;min-height:64px;flex-wrap:wrap;padding:8px 20px}
.exercise-bar>div:first-child{flex:1 1 260px;min-width:0}
.exercise-bar #title{width:100%;max-width:470px}
.exercise-meta{gap:8px;flex:0 1 auto;min-width:0;max-width:100%;flex-wrap:wrap}
@media(max-width:600px){
 .exercise-bar{height:auto;min-height:54px;flex-wrap:wrap;padding:8px 12px}
 .exercise-bar>div:first-child{flex-basis:100%}
 .exercise-meta{flex:1 1 100%;gap:6px}
 .exercise-meta button{min-height:44px}
}
@media(max-width:600px){.document-archive.personal-dialog{width:calc(100vw - 16px);padding:18px;box-sizing:border-box}.archive-records small{width:100%}.document-strip #exercise-choice{max-width:180px}}
/* Derived covers share one fixed footprint; no layout jump while downloading. */
.library-preview-mosaic{display:grid;grid-template-columns:1fr;aspect-ratio:16/9;width:100%;overflow:hidden;background:#d5e4df;gap:2px}
.library-preview-mosaic[data-count="2"],.library-preview-mosaic[data-count="3"],.library-preview-mosaic[data-count="4"]{grid-template-columns:1fr 1fr}
.library-preview-mosaic[data-count="3"],.library-preview-mosaic[data-count="4"]{grid-template-rows:1fr 1fr}
.library-preview-mosaic[data-count="3"] .library-preview-cell:first-child{grid-row:span 2}
.library-preview-cell{display:grid;place-items:center;min-width:0;min-height:0;overflow:hidden;color:#54736e;font-size:11px;font-weight:400}
.library-preview-cell img{width:100%;height:100%;object-fit:contain;display:block;background:#d5e4df}
/* Training covers are rendered for each slot's aspect ratio (coverFormat).
   Fixed tracks and out-of-flow images prevent intrinsic image sizes stretching
   the mosaic. Cover only trims the small difference introduced by separators. */
.library-preview-mosaic[data-kind="training"]{flex:none;grid-template-rows:minmax(0,1fr)}
.library-preview-mosaic[data-kind="training"][data-count="3"],.library-preview-mosaic[data-kind="training"][data-count="4"]{grid-template-rows:repeat(2,minmax(0,1fr))}
.library-preview-mosaic[data-kind="training"] .library-preview-cell{position:relative;text-align:center}
.library-preview-mosaic[data-kind="training"] .library-preview-cell img{position:absolute;inset:0;object-fit:cover;object-position:center}

/* Pending text is a transient draft, visible also when fullscreen panels are closed. */
#field-text-placement{position:absolute;z-index:25;bottom:16px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:9px;background:#fff;box-shadow:0 3px 14px #12313b33;font-size:12px}
#field-text-placement[hidden]{display:none}
#field-text-placement button{min-height:44px;flex-shrink:0}
#field-text-placement button:focus-visible{outline:3px solid #168d91;outline-offset:2px}

[data-insert]{touch-action:pan-y;user-select:none;-webkit-user-select:none}
[data-insert] img{pointer-events:none}
[data-insert].insertion-selected{outline:3px solid #168d91;outline-offset:-3px;background:#dcefe9}
#catalog-placement{position:absolute;z-index:25;bottom:16px;left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);width:max-content;box-sizing:border-box;display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:9px;background:#fff;box-shadow:0 3px 14px #12313b33;font-size:12px}
#catalog-placement[hidden]{display:none}
#model-status{position:absolute;z-index:26;top:8px;right:8px;max-width:calc(100% - 16px);pointer-events:none}
.model-wait{display:flex;align-items:center;gap:8px;padding:6px 10px;border-radius:6px;background:#fff;color:#12333d;box-shadow:0 2px 6px #12313b33;font-size:13px}
.model-wait button{pointer-events:auto}
#catalog-placement small{display:block;font-size:10px;max-width:350px;color:#52716c;margin-top:4px}
#catalog-placement button{min-height:44px;flex-shrink:0}
/* Archive criteria share the existing card view; no scene/layout state changes. */
.library-query-tools{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap;margin:12px 0}.library-query-tools details{flex:1;min-width:240px;border:1px solid var(--line);border-radius:8px;padding:12px;background:white}.library-query-tools summary{cursor:pointer;font-weight:600;min-height:28px}.library-query-tools fieldset{border:1px solid var(--line);border-radius:6px;margin:12px 0;padding:10px}.library-filter-options{display:flex;gap:10px;flex-wrap:wrap}.library-filter-options label{display:flex;align-items:center;gap:7px;min-height:44px;padding:6px;border:1px solid var(--line);border-radius:6px;cursor:pointer}.library-filter-options label:has(input:checked){background:#e4f4f1;border-color:var(--teal)}.library-filter-options input{width:18px;height:18px;accent-color:var(--teal)}.library-filter-numbers{display:flex;flex-wrap:wrap;gap:12px}.library-filter-numbers label{display:grid;gap:6px;flex:1 1 180px}.library-filter-numbers input,.library-sort select{padding:10px;min-height:44px;border:1px solid var(--line);border-radius:6px;max-width:100%;width:100%;background:white}.library-sort{display:grid;gap:6px;max-width:100%}.library-active-filters{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}.library-active-filters button{max-width:100%;overflow-wrap:anywhere;min-height:40px}#library-filter-error{color:#a03238}#library-contained-hint{line-height:1.5}#library-result-count{font-weight:600}.library-query-tools [hidden]{display:none!important}@media(max-width:600px){.library-query-tools{display:block}.library-sort{margin-top:12px}.library-filter-options label{flex:1 1 130px}.library-filter-numbers input{min-width:0}}

/* Full exercise titles: one editable node in both layouts, no ellipsis or clipping. */
.exercise-bar #title,#fs-phases #title{display:block;box-sizing:border-box;width:100%;max-width:none;min-height:28px;resize:none;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;font-family:inherit;font-size:20px;font-weight:600;line-height:1.35;border:0;padding:0;background:transparent;color:var(--navy)}
#exercise-title-field{min-width:0}
#fs-phases #exercise-title-field{background:#fff;padding:8px 12px;border-radius:8px;margin-bottom:6px}
.library-card-open>strong{white-space:normal;overflow-wrap:anywhere}

.classification-manage{margin:0 0 8px;font-size:12px}.classification-editor #classification-list{list-style:none;padding:0}.classification-editor li{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0}.classification-editor li input{flex:1 1 190px;min-width:0}.classification-editor li small{flex-basis:100%}.classification-editor button{min-height:44px}.classification-editor #classification-status{color:#875509;overflow-wrap:anywhere}.classification-editor dialog{max-width:calc(100vw - 32px);box-sizing:border-box}

.classification-editor[open]{display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;max-height:85dvh}.classification-editor>h2{margin-top:0;font-size:22px}.classification-editor>p,.classification-editor>form,.classification-editor>#classification-close{flex-shrink:0}.classification-editor #classification-status:empty{display:none}.classification-editor #classification-list{overflow:auto;min-height:60px;overscroll-behavior:contain}.classification-editor #classification-close{align-self:flex-end}

/* One direct contextual toolbar inside the stage, shared with fullscreen. */
#equipment-layout-bar{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);z-index:12;width:max-content;max-width:calc(100% - 24px);padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff;box-shadow:0 3px 16px #102e3926;}
#equipment-layout-bar[hidden]{display:none}
.layout-direct-actions{display:flex;gap:6px;flex-wrap:wrap}
.layout-direct-actions button{min-height:44px;flex:1 1 auto}
#layout-bar-message{font-size:12px;line-height:1.4;margin:8px 0;max-width:560px;color:var(--muted)}
#layout-multi{min-height:44px}
#layout-multi[aria-pressed=true],#layout-select-toggle[aria-pressed=true]{background:var(--teal);color:white}
#equipment-layout-bar.layout-single{display:none}
#equipment-layout-bar.layout-single .layout-direct-actions{display:none}
@media(max-width:760px){#equipment-layout-bar:not([hidden]){display:block;position:fixed;left:12px;right:12px;bottom:12px;width:auto;max-width:none;transform:none}.layout-direct-actions button{flex-basis:100%;padding:8px}#layout-bar-message{font-size:12px}#layout-multi{width:100%}}

/* Local pose preview leaves the canvas available for camera inspection. */
#personal-pose-preview{position:absolute;z-index:80;top:12px;right:12px;width:min(330px,calc(100% - 24px));max-height:calc(100% - 24px);overflow:auto;background:#fff;border:1px solid #b4cece;border-radius:12px;box-shadow:0 4px 24px #123c4033;padding:16px;box-sizing:border-box}
#personal-pose-preview[hidden]{display:none}
#personal-pose-preview p{font-size:13px;line-height:1.4;margin:8px 0}
#personal-pose-preview form{display:grid;gap:8px}
#personal-pose-preview select{width:100%;min-width:0}
#personal-pose-preview button{min-height:42px}
#personal-pose-preview>button{width:100%}
#personal-pose-preview fieldset{display:grid;gap:8px;border:0;padding:12px 0;min-width:0}
#personal-pose-preview fieldset[hidden]{display:none}
#personal-pose-preview input{width:100%;min-width:0;box-sizing:border-box}
#personal-pose-preview .pose-views{display:flex;gap:6px;margin:8px 0}
#personal-pose-preview details{font-size:13px;margin:8px 0;color:var(--teal)}
#personal-pose-preview summary{cursor:pointer}
#personal-pose-preview .pose-views[hidden],#personal-pose-preview [hidden]{display:none}
#personal-pose-preview #pose-request{padding:9px 10px;border:1px solid var(--line);border-radius:6px}
#personal-pose-preview .pose-constraints:not(:empty){border-left:3px solid var(--teal);padding:5px 8px;background:#edf6f5}
#stage.creating-pose #canvas-host{right:min(352px,42%)}
#stage.creating-pose #personal-pose-preview{width:min(330px,40%);right:8px}
@media(max-width:800px){
 #stage.creating-pose #canvas-host{right:0;bottom:46%}
 #stage.creating-pose #personal-pose-preview{top:auto;bottom:3px;width:calc(100% - 12px);max-height:45%}
}
#personal-pose-library{width:min(520px,calc(100% - 24px));max-height:85vh;overflow:auto;border:1px solid #b4cece;border-radius:12px;padding:20px;box-sizing:border-box}
#personal-pose-library article{display:grid;gap:10px;padding:12px 0;border-bottom:1px solid #dce7e7}
#personal-pose-library select{width:100%;min-width:0;min-height:44px;padding:8px;border:1px solid #cbdcdd;border-radius:7px;background:white;color:#12323d}
#personal-pose-library button{min-height:44px;margin-top:8px}
@media(max-width:600px){#personal-pose-preview{padding:10px;top:6px;right:6px;width:min(310px,calc(100% - 12px));max-height:48%}}

/* Playback is a render-only session; controls travel with the existing phase bar. */
.phase-bar:has(#phase-motion),#fs-phases .phase-bar:has(#phase-motion){height:auto}
#phase-motion{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 0;border-top:1px solid var(--line,#dce7e8);font-size:12px}
#phase-motion strong{color:#087e78}#phase-motion label{display:flex;align-items:center;gap:6px}#phase-motion input{width:66px;min-height:36px}
#phase-motion button{min-height:40px}#motion-status{flex:1;min-width:160px}#motion-issues{flex-basis:100%;max-height:110px;overflow:auto;border-left:3px solid #c78313;background:#fff7e7;padding:4px 10px}#motion-issues p{margin:4px 0}
#motion-options{display:flex;flex-wrap:wrap;gap:10px;flex-basis:100%}#motion-options select{min-height:40px;max-width:100%;font:inherit}#motion-options label[hidden]{display:none}
@media(max-width:600px){#phase-motion{gap:6px;max-width:calc(100vw - 170px)}#workspace.left-closed #phase-motion{max-width:calc(100vw - 20px)}#fs-phases #phase-motion{max-width:100%}#phase-motion strong{flex-basis:100%}#phase-motion label{flex-wrap:wrap}#motion-status{flex-basis:100%;overflow-wrap:anywhere}}

/* Shared compact phase toolbar. Deliberately scoped: sidebars/document header
   and their responsive/fullscreen behavior are not changed. */
.phase-bar.compact-phase-toolbar,#fs-phases .phase-bar.compact-phase-toolbar{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;gap:10px;height:60px;min-height:60px;padding:8px 10px;box-sizing:border-box;overflow:visible}
.compact-phase-toolbar .phase-navigation{flex:1 1 180px;min-width:44px;gap:6px;overflow:hidden}
.compact-phase-toolbar #phases{flex:1 1 auto;min-width:44px;scrollbar-width:thin;gap:4px}
.compact-phase-toolbar :is(.phase-tab,#smart-phase),#fs-phases .compact-phase-toolbar :is(.phase-tab,#smart-phase){box-sizing:border-box;flex:0 0 44px;width:44px;min-width:44px;height:44px;padding:0;display:inline-flex;align-items:center;justify-content:center}
.compact-phase-toolbar #motion-play,.compact-phase-toolbar #motion-stop,.compact-phase-toolbar #phase-more-toggle{width:44px;min-width:44px;height:44px;padding:0;font-size:19px;flex-shrink:0;display:inline-flex;align-items:center;justify-content:center}
.compact-phase-toolbar #motion-play{color:#fff;background:#087e78;border-color:#087e78}
.compact-phase-toolbar #motion-play:disabled{opacity:.45}
.compact-phase-toolbar #smart-phase>span{font-size:20px;line-height:1}
#phase-update-summary:not([hidden]){display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 14px;padding:4px 12px;background:#eef7f5;color:#173f42;font-size:13px;line-height:1.45;overflow-wrap:anywhere}
#phase-update-summary details summary{cursor:pointer;color:#06655f}
#phase-update-summary ul{margin:4px 0;padding-left:1.25em}
#phase-update-summary details[open]{max-height:24vh;overflow:auto}
.compact-phase-toolbar .phase-center,.compact-phase-toolbar .phase-playback{display:flex;flex:0 0 auto;align-items:center;gap:6px;min-width:0}
.compact-phase-toolbar #smart-phase-toggle{height:40px;padding:6px 9px;font-size:11px;white-space:nowrap}
.compact-phase-toolbar #update-next-phase{height:40px;font-size:11px;white-space:nowrap}
.compact-phase-toolbar #update-next-phase:disabled{display:none}
.compact-phase-toolbar .phase-duration{display:flex;align-items:center;gap:3px;white-space:nowrap;font-size:12px}
.compact-phase-toolbar #motion-duration{width:58px;height:44px;min-height:44px;box-sizing:border-box;font-size:12px;padding:6px}
.compact-phase-toolbar #phase-more-menu{width:min(340px,calc(100vw - 24px));box-sizing:border-box;max-height:65vh;max-height:min(65dvh,550px);overflow-y:auto;padding:12px;right:0;top:calc(100% + 8px);font-size:12px}
.compact-phase-toolbar #phase-more-menu:not([hidden]){display:flex;flex-direction:column;gap:8px}
.compact-phase-toolbar #phase-more-menu button:not(:where(#smart-phase)){min-height:44px;white-space:normal;font-size:12px;text-align:left;padding:8px}
.compact-phase-toolbar #phase-more-menu #delete-phase{display:flex;align-items:center;gap:8px}
.compact-phase-toolbar #phase-more-menu #delete-phase svg{width:16px;height:16px}
.compact-phase-toolbar .phase-overflow-controls{display:flex;flex-direction:column;gap:8px}
.compact-phase-toolbar .phase-overflow-controls:empty,.compact-phase-toolbar .phase-center:empty{display:none}
.compact-phase-toolbar #phase-more-menu .phase-note,#fs-phases .compact-phase-toolbar #phase-more-menu .phase-note{display:flex;height:auto;flex:auto;flex-direction:column;align-items:stretch;width:100%;gap:5px}
.compact-phase-toolbar .phase-note label{display:flex;flex-direction:column;gap:5px}
.compact-phase-toolbar .phase-note #phase-note{width:100%;height:44px;min-height:44px;box-sizing:border-box;padding:8px}
.compact-phase-toolbar #motion-options{display:flex;flex-direction:column;gap:8px;flex-basis:auto}
.compact-phase-toolbar #motion-options label{display:flex;flex-direction:column;gap:5px}
.compact-phase-toolbar #motion-options label[hidden]{display:none}
.compact-phase-toolbar #motion-options select{min-height:44px;width:100%}
.compact-phase-toolbar #motion-status{display:block;min-width:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.compact-phase-toolbar #motion-issues{max-height:none;margin-top:8px;font-size:12px}
.compact-phase-toolbar .phase-feedback summary{padding:10px 0;min-height:24px;cursor:pointer}
.compact-phase-toolbar .has-feedback::after{content:'';position:absolute;right:3px;top:3px;width:8px;height:8px;border-radius:50%;background:#c78313}
.compact-phase-toolbar #phase-more-toggle{position:relative}
.compact-phase-toolbar[data-density="small"],#fs-phases .compact-phase-toolbar[data-density="small"]{gap:4px;padding:8px 4px}
.compact-phase-toolbar[data-density="small"] .phase-caption{display:none!important}
.compact-phase-toolbar[data-density="small"] .phase-navigation,.compact-phase-toolbar[data-density="small"] .phase-playback{gap:4px}
.compact-phase-toolbar button:focus-visible,.compact-phase-toolbar summary:focus-visible{outline:2px solid #087e78;outline-offset:-3px}
.compact-phase-toolbar #phases{flex:0 1 auto}
.compact-phase-toolbar[data-density="tiny"],#fs-phases .compact-phase-toolbar[data-density="tiny"]{gap:4px;padding:8px 4px}
.compact-phase-toolbar[data-density="tiny"] .phase-caption{display:none!important}
.compact-phase-toolbar[data-density="tiny"] .phase-navigation,.compact-phase-toolbar[data-density="tiny"] .phase-playback{gap:4px}
.toolbar-announcement{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.compact-phase-toolbar .phase-duration-caption{display:none}
.compact-phase-toolbar #phase-more-menu .phase-duration{flex-wrap:wrap}
.compact-phase-toolbar #phase-more-menu .phase-duration-caption{display:block;flex-basis:100%;margin-bottom:4px}
.compact-phase-toolbar[data-density="wide"],#fs-phases .compact-phase-toolbar[data-density="wide"]{display:grid;grid-template-columns:minmax(44px,1fr) auto minmax(216px,1fr)}
.compact-phase-toolbar[data-density="wide"] .phase-playback{justify-self:end}
/* Reordering stays inside the existing horizontally scrolling phase sequence. */
.compact-phase-toolbar #phases{position:relative;user-select:none}
#phases.phase-dragging{cursor:grabbing;scroll-behavior:auto}
#phases .phase-drag-source{opacity:.45}
#phases .phase-insertion-line{position:absolute;top:2px;height:40px;width:3px;background:#087e78;box-shadow:0 0 0 1px white;z-index:3;pointer-events:none;flex:none}
#arrow-guide:not([hidden]){display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;min-height:32px;padding:2px 10px;background:#f1f8f7;border-bottom:1px solid var(--line);color:var(--navy);font-size:12px}
#arrow-draw-cancel{flex:none;padding:4px 8px}
@media(pointer:coarse){#arrow-draw-cancel{min-height:44px}}
/* Reserve the phase controls' actual height while drawing in fullscreen. */
#stage:fullscreen:has(#arrow-guide:not([hidden])){display:grid;grid-template-rows:auto minmax(0,1fr)}
#stage:fullscreen:has(#arrow-guide:not([hidden])) #fs-phases{position:relative;inset:auto;grid-row:1;margin:12px 155px 0 290px}
#stage:fullscreen:has(#arrow-guide:not([hidden])) #canvas-host{position:relative;grid-row:2;min-height:0}
#stage:fullscreen:has(#arrow-guide:not([hidden])) #association-choice{grid-row:2;top:8px}
@media(max-width:800px){#stage:fullscreen:has(#arrow-guide:not([hidden])) #fs-phases{margin:102px 12px 0}}
.asset-option svg{vertical-align:middle}

#exercise-library-target{width:100%;min-height:44px;padding:10px;border:1px solid var(--line);border-radius:6px;background:white;color:var(--navy);font:inherit}
#phase-images-dialog button{min-height:44px}#phase-images-dialog fieldset{border:1px solid var(--line);border-radius:8px;margin-top:18px}#phase-images-list{display:flex;gap:8px;flex-wrap:wrap;max-height:35vh;overflow:auto}#phase-images-dialog label{display:flex;align-items:center;gap:8px;min-height:44px;margin:0;padding:8px}#phase-images-dialog input{width:20px;height:20px;accent-color:var(--teal)}#phase-images-status{min-height:22px}
#phase-video-dialog button,#phase-video-dialog select{min-height:44px}#phase-video-dialog select{padding:8px;border:1px solid var(--line);border-radius:6px;background:white;color:var(--navy)}#video-range{display:flex;gap:12px}#video-range label{flex:1}#video-range[hidden]{display:none}#phase-video-dialog .video-toggle{display:flex;align-items:center;gap:8px;min-height:44px}#video-arrows{width:20px;height:20px;accent-color:var(--teal)}#video-status{min-height:24px}#motion-video{white-space:nowrap}
#exercise-library-options button{min-height:44px;background:white;color:var(--navy);transition:none}#exercise-library-options button[aria-pressed="true"]{background:var(--teal);color:white;border-color:var(--teal)}

@media(pointer:coarse){#properties .stage-tools button,#reset-tilt{min-height:44px}}
/* The board details sheet shares its form with the modal save flow. */
#details-compact,.details-resize{display:none}
#exercise-save-dialog.floating-details[open]{display:flex;flex-direction:column;position:fixed;inset:auto;margin:0;z-index:45;max-width:100vw;max-height:100dvh;padding:0;overflow:hidden;border:1px solid var(--line);box-shadow:0 8px 28px #102e3933;background:#fff}
.floating-details .details-titlebar{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;padding:6px 12px;border-bottom:1px solid var(--line);cursor:grab;touch-action:none;user-select:none}
.floating-details .details-titlebar:active{cursor:grabbing}
.floating-details .details-titlebar h2{font-size:17px;margin:0}
.floating-details #details-compact{display:block;min-height:34px}
.floating-details #exercise-save-scope{margin:4px 12px}
.floating-details #exercise-save-form{flex:1;min-height:0;overflow:auto;padding:0 14px;overscroll-behavior:contain}
.floating-details #exercise-save-form label{margin:8px 0}
.floating-details #exercise-save-form textarea{min-height:66px;height:88px}
.floating-details .exercise-save-actions{bottom:0;margin:0 -14px;padding:8px 24px 8px 14px}
.floating-details .exercise-save-actions p:empty{display:none}
.floating-details .details-resize{display:block;position:absolute;right:0;bottom:0;width:24px;height:24px;touch-action:none;cursor:nwse-resize}
.floating-details .details-resize::after{content:"";position:absolute;right:4px;bottom:4px;width:9px;height:9px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted)}
.compact-details #exercise-save-scope,.compact-details #exercise-save-form>fieldset,.compact-details #exercise-save-form>label:has(input[type=number]),.compact-details #exercise-save-form button:not([type=submit]),.compact-details #exercise-library-options{display:none}
@media(pointer:coarse){.floating-details #details-compact{min-height:44px}.floating-details .details-resize{width:32px;height:32px}.floating-details .exercise-save-actions{padding-right:36px}}

/* Document navigation is shared by the window and the fullscreen stage. */
#builder-heading{position:relative;z-index:35;flex:none;width:100%;max-width:100vw;color:var(--navy)}
#builder-heading .topbar{position:relative;z-index:2;box-sizing:border-box;height:auto;min-height:52px;gap:clamp(8px,2vw,28px);padding:4px 16px;overflow:visible}
.builder-navigation,.builder-context{display:flex;align-items:center}
.builder-navigation{gap:6px}
#builder-heading .nav-trigger{display:inline-flex;align-items:center;gap:8px;background:transparent;color:inherit;border:0;min-height:42px;line-height:1.25;font-family:inherit;font-size:15px;font-weight:600;padding:6px 10px}
.nav-trigger::after{content:'';display:inline-block;width:7px;height:7px;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(45deg);flex:none;margin-top:-4px}
#builder-heading .nav-trigger[aria-expanded=true]{color:#087f83}
#builder-heading .topbar .nav-trigger[aria-expanded=true]{color:#94e4d5;box-shadow:inset 0 -3px currentColor}
#builder-heading .top-actions{margin-left:auto;gap:8px}
#builder-heading #help-button{order:1}
.builder-context{position:relative;z-index:1;gap:5px;min-width:0;background:white;padding:0 16px;border-bottom:1px solid var(--line);font-size:14px}
#context-kind{color:var(--muted)}
#context-kind::after{content:' ·'}
#context-switch{min-width:0;max-width:100%}
#context-switch span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.builder-context #cloud-workspace-status{margin-left:auto;flex:none}
#nav-dismiss{position:fixed;inset:0;touch-action:none}
.builder-menu{position:fixed;z-index:5;display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);width:max-content;min-width:216px;max-width:calc(100vw - 16px);overflow:auto;box-sizing:border-box;padding:12px 16px;background:white;color:var(--navy);border:1px solid var(--line);border-top:3px solid #58c8ba;border-radius:0 0 8px 8px;box-shadow:0 6px 20px #10303924}
.builder-menu[hidden],#nav-dismiss[hidden],.builder-menu [hidden]{display:none!important}
.builder-menu>div{min-width:200px}
.builder-menu>div+div{border-left:1px solid var(--line);margin-left:12px;padding-left:16px}
.builder-menu section+section{margin-top:12px}
.builder-menu h2{font-size:12px;letter-spacing:.04em;color:#086c6f;text-transform:uppercase;margin:4px 6px}
#builder-heading .builder-menu button{display:block;background:transparent;color:var(--navy);border:0;text-align:left;width:100%;min-height:38px;padding:7px 8px;font-size:15px;font-weight:450;white-space:normal;overflow-wrap:anywhere}
#builder-heading .builder-menu button:disabled{opacity:.45}
#builder-heading .builder-menu button:is(:hover,:focus-visible):enabled{background:#e6f4f0}
#context-options{display:block;min-width:min(300px,calc(100vw - 16px));max-width:min(550px,calc(100vw - 16px))}
#context-options button[aria-current=true]::before{content:'✓ ';color:#087f83}
#fs-heading{display:none}
#stage:fullscreen #fs-heading{display:block;position:absolute;inset:0 0 auto;z-index:35}
#stage:fullscreen :is(#fs-phases,#fs-actions,#fs-properties,#category-drawer){translate:0 var(--builder-heading-height,100px)}
#stage:fullscreen:has(#arrow-guide:not([hidden])) #fs-phases{translate:none;margin-top:calc(12px + var(--builder-heading-height,100px))}
#stage:fullscreen #exit-fullscreen,#stage:fullscreen #personal-open-fullscreen{display:none}
@media(max-width:800px){
 #builder-heading .topbar{flex-wrap:wrap;gap:2px 8px;padding:4px 8px}
 #builder-heading .gkcanvas-brand,#builder-heading .brand-logo{width:100px}
 #builder-heading .nav-trigger{padding:5px;font-size:14px}
 #builder-heading .top-actions{flex-wrap:wrap}
 #builder-heading #save-status{display:none}
 .builder-context{padding:0 8px}
 #stage:fullscreen #fs-phases{top:54px}
 #stage:fullscreen:has(#arrow-guide:not([hidden])) #fs-phases{margin-top:calc(54px + var(--builder-heading-height,100px))}
}
@media(max-width:560px){
 .builder-menu{grid-auto-flow:row;gap:12px;width:min(310px,calc(100vw - 16px))}
 .builder-menu>div+div{margin:0;border:0;border-top:1px solid var(--line);padding:8px 0 0}
 #builder-heading .builder-menu button{min-height:44px}
 .builder-context #cloud-workspace-status{max-width:80px;line-height:1.1}
}

/* On narrower boards the same catalog and inspector open on demand. */
@media (max-width:999px){
 body:has(#workspace){min-width:0;height:100dvh}
 #workspace{display:block;min-width:0}
 #workspace>.board{height:100%}
 #workspace>.panel,#builder-heading :is(#open-left,#open-right){display:none}
 .board>#fs-actions{display:flex;align-items:center;justify-content:space-between;flex:none;gap:8px;padding:2px 8px;background:white;border-bottom:1px solid var(--line)}
 #fs-actions button{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:6px 12px;color:var(--teal);font-size:14px}
 .board>#fs-actions button{border-color:transparent}
 #fs-actions button::after{content:'';width:6px;height:6px;border:solid currentColor;border-width:0 1.5px 1.5px 0;transform:rotate(45deg);margin-top:-3px}
 #fs-actions button[aria-expanded=true]{background:#e6f4f0}
 #fs-actions button[aria-expanded=true]::after{transform:rotate(225deg);margin-top:3px}
 #stage:not(:fullscreen) #category-drawer{top:6px;left:8px;max-width:calc(100% - 16px);max-height:calc(100% - 14px)}
 #stage:not(:fullscreen) #fs-properties:not([hidden]){display:block;position:absolute;z-index:15;inset:6px 8px auto auto;max-height:calc(100% - 14px);overflow:auto;background:#fff;border:1px solid var(--line);border-radius:9px;box-shadow:0 6px 20px #102e3926}
 #fs-properties select,#drawer-categories .category,#category-drawer [data-add=keeper]{min-height:44px}
 #stage:not(:fullscreen) #toast{max-width:calc(100% - 16px);white-space:normal}
}
@media (max-width:800px){
 #stage:fullscreen #fs-actions{top:5px}
 #stage:fullscreen :is(#category-drawer,#fs-properties){translate:none;top:calc(var(--builder-heading-height,100px) + 118px);bottom:auto;max-height:calc(100% - var(--builder-heading-height,100px) - 126px)}
}
@media (max-width:560px){
 #builder-heading .topbar{display:grid;grid-template-columns:auto minmax(0,1fr);gap:0 8px}
 #builder-heading .builder-navigation{justify-content:flex-end}
 #builder-heading .top-actions{grid-column:1/-1}
 #builder-heading .gkcanvas-brand small{width:100%;font-size:6px;letter-spacing:.6px}
 #builder-heading .nav-trigger{min-height:44px}
}
