/* V0.739 — Switchcraft Studio: only this route; original engines & storage untouched */
body:has(.ts739-page){background:#eff0e6;color:#203e33;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
body:has(.ts739-page) .preview-note{display:none}
body:has(.ts739-page) .topbar{background:#f5f3e9;border-bottom:1px solid #d0d8ca}
.ts739-page{--ts-forest:#143b33;--ts-ink:#173c33;--ts-cream:#fcfaf0;--ts-moss:#d4e9d4;--ts-gold:#dfae69;--ts-border:#bfcfc0;max-width:1240px;padding-top:20px;color:var(--ts-ink)}
.ts739-page *{box-sizing:border-box}
.ts739-page button,.ts739-page summary,.ts739-page select{-webkit-tap-highlight-color:transparent}
.ts739-page :is(button,summary,select,.ts347-stage):focus-visible{outline:3px solid #f9c46e;outline-offset:3px}
.ts739-page .ts347-head{position:relative;display:flex;align-items:center;gap:16px;justify-content:space-between;margin:0 0 13px}
.ts739-page .ts347-head .eyebrow{background:#d7e5d4;color:#2e5b43;border:1px solid #b4cfbb;font-size:.63rem;letter-spacing:.11em;font-weight:900;display:inline-block;padding:5px 9px;border-radius:999px}
.ts739-page .ts347-head h1{font-size:clamp(2.2rem,4vw,3.6rem);line-height:1.04;letter-spacing:-.058em;color:#163e33;margin:6px 0 2px}
.ts739-page .ts347-head h1 em{font-style:normal;color:#977141}
.ts739-page .ts347-head p{font-size:.92rem;color:#48675b;max-width:560px;margin:0}
.ts739-page .ts739-utility-fold{align-self:flex-start;position:relative;flex-shrink:0;z-index:11}
.ts739-page .ts739-utility-fold summary{list-style:none;font-weight:800;cursor:pointer;color:#315245;border:1px solid var(--ts-border);background:#fdfcf5;padding:9px 12px;border-radius:12px;font-size:.78rem}
.ts739-page .ts739-utility-fold summary::-webkit-details-marker{display:none}
.ts739-page .ts739-utility-fold summary:after{content:'⌄';padding-left:7px}
.ts739-page .ts347-utilities{position:absolute;right:0;top:42px;min-width:270px;display:grid;grid-template-columns:repeat(3,1fr);padding:8px;border:1px solid var(--ts-border);border-radius:13px;background:#fcfcf7;box-shadow:0 18px 38px #112d2633;gap:5px}
.ts739-page .ts739-utility-fold:not([open]) .ts347-utilities{display:none}
.ts739-page .ts347-utilities button{background:#edf3e9;color:#294637;font-size:.68rem;border:1px solid #c6d4c7;min-height:37px;padding:6px}
.ts739-page .ts347-shell{display:grid;grid-template-columns:minmax(0,1fr) minmax(260px,310px);grid-template-areas:"modes modes" "context context" "status hud" "stage hud" "response actions" "spec actions" "results results";column-gap:15px;row-gap:7px;align-items:start;padding:16px;background:linear-gradient(152deg,#f9f9ef 0%,#f0f5ec 100%);border:1px solid #cbd7c5;box-shadow:0 13px 32px #20483717;border-radius:23px}
.ts739-page .ts347-modebar{grid-area:modes;grid-template-columns:repeat(4,1fr);gap:8px;padding:0;border:0}
.ts739-page .ts347-modebar button{min-height:44px;border:1px solid #c0d2c3;border-radius:12px;background:#eff5ed;color:#315045;font-size:.9rem;font-weight:850;letter-spacing:-.01em}
.ts739-page .ts347-modebar button.active{background:#163d33;color:#fff9e9;border-color:#163d33;box-shadow:0 4px 0 #b6c5b5}
.ts739-page .ts347-contextline{grid-area:context;border-top:1px solid #d5ded0;border-bottom:1px solid #d5ded0;margin:5px 0 0;padding:8px 2px;min-width:0}
.ts739-page .ts347-contextline>strong{color:#426450;font-size:.78rem;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.ts739-page .ts347-options>summary{color:#294b3d;font-weight:800;font-size:.75rem;white-space:nowrap}
.ts739-page .ts347-options-panel{background:#fbfcf4;border-color:#c3d1c1;box-shadow:0 20px 40px #1533292b}
.ts739-page .ts347-hud{grid-area:hud;display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0;align-self:stretch;align-content:start;padding:12px;background:#153b33;border-radius:17px;min-width:0}
.ts739-page .ts347-hud>div{padding:13px 10px;min-height:81px;background:#21493f;border:1px solid #436659;border-radius:13px}
.ts739-page .ts347-hud small{color:#c9dacb;font-weight:800;font-size:.68rem;letter-spacing:.04em}
.ts739-page .ts347-hud strong{color:#fff8e8;font-size:1.2rem;line-height:1.2;margin-top:8px}
.ts739-page .ts347-hud>div:first-child{grid-column:1/-1;min-height:62px;background:#e4c493;border-color:#e4c493}
.ts739-page .ts347-hud>div:first-child small,.ts739-page .ts347-hud>div:first-child strong{color:#173e31}
.ts739-page .ts347-status{grid-area:status;margin:0;padding:7px 12px;background:#e4efdd;color:#345947;border:1px solid #c9d9c6;border-radius:11px;text-align:left;min-height:32px;line-height:1.3;font-size:.8rem;font-weight:750}
.ts739-page .ts347-stage{grid-area:stage;min-height:270px;gap:6px;border-radius:18px;padding:14px 20px;background:radial-gradient(circle at 78% 16%,#345c49 0,transparent 47%),linear-gradient(144deg,#0e302b,#16483f 65%,#194e42);border:1px solid #295c4d;color:#fff9e8;box-shadow:inset 0 0 0 5px #ffffff0d;align-self:stretch;overflow:hidden}
.ts739-page .ts347-ready{width:100%;max-width:640px}
.ts739-page .ts347-ready strong{color:#fffaf0;font-size:1.25rem;letter-spacing:-.035em}
.ts739-page .ts347-ready p{color:#cfe1cf;font-size:.86rem;margin:8px 0 0;line-height:1.36}
.ts739-page .ts347-ready .mini{font-size:.74rem;font-weight:850;color:#efd0a3;letter-spacing:.03em}
.ts739-page .ts739-visual-cue{display:flex;justify-content:center;align-items:center;gap:12px;margin:0 auto 12px;color:#fff7e8}
.ts739-page .ts739-visual-cue span:not(.ts739-sw){font-size:1.25rem;font-weight:900;line-height:1;display:grid;place-items:center;border:1px solid #688a77;background:#315d4d;border-radius:11px;height:38px;width:38px}
.ts739-page .ts739-visual-cue .ts739-sw{color:#f1c58b;font-size:1.8rem;line-height:1}
.ts739-page .ts347-cue{color:#f0c38a;font-size:clamp(1.3rem,3vw,1.7rem);letter-spacing:.12em}
.ts739-page .ts347-stimulus{color:#fffaf0;text-shadow:0 10px 25px #061a1788;font-size:clamp(5rem,9vw,7rem)}
.ts739-page .ts347-map{color:#d1ead2;font-weight:800;font-size:.9rem}
.ts739-page .ts347-pause-mask{background:#143b33f4;color:#fffaf1}
.ts739-page .ts347-pause-mask span{color:#bcd3c5}
.ts739-page .ts347-response{grid-area:response;display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:0;max-width:none;width:100%}
.ts739-page .ts347-response button{min-height:58px;display:flex;align-items:center;justify-content:center;gap:10px;background:#f1f7ed;border:1.5px solid #a8c4aa;border-radius:13px;color:#1e513e;font-size:1rem;font-weight:900;transition:background .12s,transform .12s}
.ts739-page .ts347-response button:not(:disabled):active{transform:scale(.97);background:#c5e4c9}
.ts739-page .ts347-response button:disabled{opacity:.55}
.ts739-page .ts347-response button b{font-size:1.5rem;line-height:1}
.ts739-page .ts347-response .ts739-kbd{font-size:.72rem;color:#527765;background:#e0eee0;border:1px solid #b8cbb9;padding:5px 8px;border-radius:7px;margin:0}
.ts739-page .ts347-actions{grid-area:actions;display:grid;grid-template-columns:1fr 1fr;align-items:start;gap:8px;width:100%;margin:0}
.ts739-page .ts347-actions .btn{min-height:50px;font-size:.82rem;padding:8px 9px;border-radius:11px}
.ts739-page #ts347Start{background:#eac084;color:#17392e;border:1px solid #d8ae72;box-shadow:0 3px 0 #ad884f;font-weight:900}
.ts739-page #ts347Pause{background:#f7f6e9;color:#315343;border:1px solid #b4c6b4}
.ts739-page #ts347Share,.ts739-page #ts347Replay{grid-column:1/-1;min-height:38px;font-size:.72rem;background:transparent;border:1px dashed #afc4b2;color:#456450}
.ts739-page .ts347-run-spec{grid-area:spec;text-align:left;color:#597363;font-weight:750;margin:2px 0 0;font-size:.72rem}
.ts739-page .ts347-results{grid-area:results;margin:8px 0 0;border-color:#c3d1c3;width:100%}
.ts739-page .ts347-result-metrics>div,.ts739-page .ts347-split-metrics>div{background:#eaf1e8;border-color:#c0d1bf}
.ts739-page .ts347-secondary{margin-top:15px}
.ts739-page .ts347-secondary>details{padding:7px 12px;border-bottom:1px solid #d8e0d2}
.ts739-page .ts347-secondary>details>summary{color:#2e5745;font-weight:850;padding:8px 0}
.ts739-page .ts347-explain article{background:#f9f8ed;border:1px solid #dce1d3;box-shadow:0 6px 15px #324a3011}
.ts739-page .ts347-explain h2{color:#294a3e}
.ts739-page .ts347-explain p{color:#51705e}
.ts739-page.ts347-focus{max-width:960px}
body.ts347-focus .ts739-page .ts347-head{display:flex}
body.ts347-focus .ts739-page .ts347-head>div:first-child{display:block!important}
body.ts347-focus .ts739-page .ts347-stage{min-height:260px}
@media(max-width:760px){
 .ts739-page{padding-top:8px;width:min(100% - 20px,1240px)}
 .ts739-page .ts347-head{display:flex;align-items:center;margin-bottom:8px;gap:5px}
 .ts739-page .ts347-head .eyebrow{padding:4px 7px;font-size:.57rem}
 .ts739-page .ts347-head h1{font-size:clamp(1.75rem,7vw,2.2rem);margin:4px 0 2px;line-height:1}
 .ts739-page .ts347-head p{font-size:.73rem;line-height:1.28;max-width:300px}
 .ts739-page .ts739-utility-fold{position:static;align-self:center}
 .ts739-page .ts739-utility-fold summary{font-size:.67rem;min-width:56px;padding:7px 6px;line-height:1.24;text-align:center}
 .ts739-page .ts347-utilities{right:0;top:100%;min-width:250px}
 .ts739-page .ts347-shell{grid-template-columns:minmax(0,1fr);grid-template-areas:"modes" "context" "stage" "response" "actions" "status" "hud" "spec" "results";gap:7px;padding:9px;border-radius:17px}
 .ts739-page .ts347-modebar{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
 .ts739-page .ts347-modebar button{font-size:.69rem;min-height:37px;padding:7px 2px;border-radius:9px}
 .ts739-page .ts347-contextline{margin:0;padding:4px 1px;min-height:27px}
 .ts739-page .ts347-contextline>strong,.ts739-page .ts347-options>summary{font-size:.7rem}
 .ts739-page .ts347-options-panel{top:65px;left:8px;right:8px;padding:12px;max-height:85vh}
 .ts739-page .ts347-stage{min-height:200px;padding:9px 11px;border-radius:13px;gap:4px}
 .ts739-page .ts739-visual-cue{gap:7px;margin:0 auto 7px}
 .ts739-page .ts739-visual-cue span:not(.ts739-sw){width:31px;height:31px;border-radius:9px;font-size:1.12rem}
 .ts739-page .ts739-visual-cue .ts739-sw{font-size:1.3rem}
 .ts739-page .ts347-ready strong{font-size:1.04rem;line-height:1.2}
 .ts739-page .ts347-ready p{font-size:.74rem;margin:5px 0 0;line-height:1.3}
 .ts739-page .ts347-ready .mini{font-size:.62rem;letter-spacing:0}
 .ts739-page .ts347-cue{font-size:1.1rem}
 .ts739-page .ts347-stimulus{font-size:5rem}
 .ts739-page .ts347-map{font-size:.76rem}
 .ts739-page .ts347-response button{min-height:51px;font-size:.78rem;gap:5px;border-radius:10px}
 .ts739-page .ts347-response button b{font-size:1.3rem}
 .ts739-page .ts347-response .ts739-kbd{font-size:.68rem;padding:3px 5px}
 .ts739-page .ts347-actions{grid-template-columns:1.45fr 1fr 1fr;gap:5px}
 .ts739-page .ts347-actions .btn{min-height:42px;font-size:.7rem;padding:7px 6px}
 .ts739-page #ts347Share{grid-column:auto;font-size:.61rem;min-height:42px}
 .ts739-page #ts347Replay{grid-column:1/-1;min-height:36px}
 .ts739-page .ts347-status{font-size:.69rem;min-height:25px;padding:6px 8px}
 .ts739-page .ts347-hud{padding:6px;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;border-radius:10px}
 .ts739-page .ts347-hud>div,.ts739-page .ts347-hud>div:first-child{grid-column:auto;min-height:47px;padding:7px 3px;border-radius:8px}
 .ts739-page .ts347-hud small{font-size:.55rem;letter-spacing:0}
 .ts739-page .ts347-hud strong{font-size:.72rem;margin-top:5px}
 .ts739-page .ts347-run-spec{font-size:.64rem}
 .ts739-page .ts347-result-metrics{grid-template-columns:repeat(2,1fr)}
 .ts739-page .ts347-secondary{margin-top:7px}
 .ts739-page .ts347-explain{margin-top:12px}
}
@media(max-width:355px){.ts739-page .ts347-head h1{font-size:1.65rem}.ts739-page .ts347-head p{max-width:200px;font-size:.68rem}.ts739-page .ts347-stage{min-height:190px}.ts739-page .ts347-actions{grid-template-columns:1.4fr 1fr 1.1fr}.ts739-page .ts347-actions .btn{font-size:.65rem}}
@media(prefers-reduced-motion:reduce){.ts739-page .ts347-response button{transition:none}}
/* Open settings must remain below their clickable summary, not cover it. */
.ts739-page .ts347-options{position:relative}
@media(max-width:760px){.ts739-page .ts347-options-panel{position:absolute;top:calc(100% + 8px);left:auto;right:0;width:min(340px,calc(100vw - 38px));max-height:min(65vh,480px);overflow:auto;z-index:50}}
