:root{font:15px/1.4 system-ui,-apple-system,sans-serif;color:#f5f5ec;background:#131d25;--gold:#ffc66b;--border:#8598a659;--panel:#172832f2;--muted:#bdcdd4}
*{box-sizing:border-box}
html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
#game{position:fixed;inset:0;width:100%;height:100vh;height:100dvh;overflow:hidden;--edge-left:max(12px,env(safe-area-inset-left));--edge-right:max(12px,env(safe-area-inset-right));--edge-top:max(12px,env(safe-area-inset-top));--edge-bottom:max(12px,env(safe-area-inset-bottom))}
button,select{font:inherit;color:inherit;min-height:44px}
button{cursor:pointer;border:1px solid var(--border);border-radius:9px;background:#263d4bed;padding:7px 10px;font-weight:750}
button:disabled{opacity:.45;cursor:default}
button:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #ffce75;outline-offset:2px}
.primary{color:#24190c;background:var(--gold);border-color:#fce3a8}
[hidden]{display:none!important}
h1,h2,p{margin:0}
h1{font-size:clamp(17px,4.6vw,26px);line-height:1.15}
h2{font-size:15px}
#workshop{position:relative;isolation:isolate;width:100%;height:100%;overflow:hidden;background:radial-gradient(ellipse at center,#425460,#152430 77%)}
#workshop canvas,.sceneShade{position:absolute;inset:0;width:100%;height:100%}
#workshop canvas{display:none;touch-action:none;cursor:grab}
.has-workshop canvas{display:block!important}
#workshop canvas:active{cursor:grabbing}
.sceneShade{pointer-events:none;background:linear-gradient(#101820cd,transparent 35%,transparent 54%,#111b22c9 100%)}
#heroArt{position:absolute;top:45%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;gap:10px;width:min(72vw,420px);padding:16px 4px;background:#203843b5;border:1px solid var(--border);border-radius:18px}
#heroArt .art{width:clamp(33px,14vw,88px);height:auto}
.has-workshop #heroArt{display:none}
.hudTop,.hudBottom{position:absolute;z-index:2;inset:0;pointer-events:none}
.hudTop{z-index:4;padding:var(--edge-top) var(--edge-right) 0 var(--edge-left)}
.hudBottom{z-index:3}
header,.sceneMeta,.row,footer{display:flex;align-items:center;justify-content:space-between;gap:8px}
header>div{min-width:0;max-width:calc(100% - 225px);text-shadow:0 2px 3px #111}
header nav{display:flex;gap:5px;pointer-events:auto;flex-shrink:0}
header button{padding-inline:11px}
#fullscreen,[data-camera-reset]{width:44px;font-size:21px;padding:2px}
#track{font-size:11px;font-weight:750;color:#ffdb9e;margin-bottom:2px}
.sceneMeta{margin-top:8px;min-height:0;width:fit-content;max-width:75%}
#intro{font-size:13px;text-shadow:0 1px 3px #080e16;border-radius:6px;background:#14252e9c;padding:3px 7px}
[data-camera-reset]{display:none;min-width:44px;pointer-events:auto;padding:2px;font-size:21px}
.has-workshop [data-camera-reset]{display:block}
.controlPanel{position:relative;z-index:2;margin-top:8px;width:fit-content;max-width:100%;pointer-events:auto}
.controlPanel summary,.controlBody,#saveNotice{border:1px solid var(--border);border-radius:10px;background:var(--panel)}
.controlPanel summary{width:max-content;max-width:100%;padding:9px 10px;cursor:pointer;font-size:13px;min-height:44px}
#round{margin-left:8px;color:#ffdb9e}
.controlBody{position:absolute;top:calc(100% + 4px);left:0;width:min(420px,calc(100vw - 22px));max-height:47dvh;overflow:auto;padding:9px;box-shadow:0 7px 25px #0008}
#orders{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.order{min-width:0;display:flex;align-items:center;gap:5px;padding:4px;border:1px solid var(--border);border-radius:7px;font-size:12px;background:#263d4c}
.order small,.lane small,#levelList small{display:block;color:var(--muted);font-size:11px}
.order.done{border-color:#75bd9a}.order.late{border-color:#ef9b70}
.quantity{color:#ffdb9e;margin-left:4px}
#stats{display:flex;gap:4px;flex-wrap:wrap;margin:6px 0}
#stats span{border:1px solid var(--border);border-radius:6px;padding:3px 5px;font-size:11px}
#hints,#saveNotice{padding:7px;font-size:12px;color:#ffda97}
#saveNotice{position:absolute;top:145px;left:var(--edge-left);max-width:min(450px,85%)}
.art{width:36px;height:31px;flex:none;vertical-align:middle;overflow:visible;pointer-events:none}
.flowArrow,.reward{color:var(--gold);font-size:21px;font-weight:900}
.machineTarget{position:absolute;z-index:1;left:50%;top:36%;transform:translate(-50%,-50%);border-color:#ffdb9c;background:#233844ed;white-space:nowrap;padding-inline:12px;box-shadow:0 3px 14px #111b;max-width:85vw}
.machineTarget:disabled{opacity:1;border-color:var(--border);color:#f5f5ec}
.dragMessage{position:absolute;bottom:calc(var(--edge-bottom) + 78px);left:50%;transform:translateX(-50%);width:max-content;max-width:70%;text-align:center;font-size:13px;font-weight:750;color:#fff2cb;background:#14242fe8;border-radius:9px;padding:5px 10px}
.dragMessage:empty{display:none}
#work{display:contents}
#stock{display:flex;flex-wrap:wrap;align-items:center;gap:5px;min-width:0;padding:2px}
.piece{display:inline-flex;align-items:center;justify-content:center;gap:4px;padding:3px 6px;white-space:nowrap;border:1px solid #967c58;border-radius:9px;background:#3b443d;color:#fff2cc;flex:none;font-size:12px;touch-action:none;user-select:none;-webkit-touch-callout:none}
.piece .art{width:31px;height:27px}
button.piece{cursor:grab}
.piece[aria-pressed="true"]{outline:2px solid var(--gold);outline-offset:-2px;background:#77562c}
.lane{min-width:0;display:flex;align-items:center;justify-content:center;gap:4px;min-height:48px;padding:3px 6px;text-align:left}
.lane div{display:grid;gap:0}
.lane strong{font-size:12px}.lane span{font-size:10px;color:#c3d0d4}
.lane .art{width:26px;height:23px}
.lane.scheduled{background:#294c43;border-color:#7ec1a4}
.dropReady:not(:disabled){border-color:#ffc66b;box-shadow:0 0 0 2px #ffce6877;color:#fff0c3}
.dropOver:not(:disabled){background:#a46321;border-color:#fff1ba}
.dragGhost{position:fixed;z-index:5;pointer-events:none;transform:translate(-50%,-65%);box-shadow:0 3px 16px #000b;border-color:var(--gold);background:#39484a}
.tutorial #controlPanel,.won #work,.roundReport #work,.roundReport #machineTarget{display:none}
footer{position:absolute;right:var(--edge-right);bottom:var(--edge-bottom);width:340px;justify-content:flex-end;gap:6px;pointer-events:auto}
footer button{flex:1 1 0;min-height:49px}
#report{position:absolute;right:var(--edge-right);bottom:calc(var(--edge-bottom) + 63px);width:min(410px,calc(100% - 30px));max-height:min(43dvh,300px);overflow:auto;padding:8px 11px;border:1px solid #cc9e57;border-radius:12px;background:var(--panel);pointer-events:auto}
#report.success{border-color:#79c4a4}
#reportArt,#taskArt,.guideRoute>div{display:flex;align-items:center;justify-content:center;gap:5px}
#reportArt:empty{display:none}#reportArt .art{width:40px;height:34px}
#reportArt{flex-wrap:wrap}
.previewPiece{display:inline-flex;align-items:center;font-size:12px;color:#ffdc9f}
#reportArt .previewPiece .art{width:27px;height:24px}
#feedback{font-size:12px;margin:4px 0;color:#edf1e8}
#reportActions{display:flex;flex-wrap:wrap;gap:6px}
#reportActions details{width:100%;font-size:12px}
dialog{border:1px solid #819b9b;border-radius:14px;padding:12px;width:min(94vw,460px);max-height:86dvh;color:#f4f5e9;background:#1e343fee;box-shadow:0 8px 28px #0008;overflow:auto}
dialog::backdrop{background:#10222b9e}
dialog p{margin:5px 0;font-size:13px}
dialog .row{margin-bottom:5px}
#levelList{display:grid;grid-template-columns:1fr 1fr;gap:6px}
#levelList button{text-align:left;font-size:12px}
label{display:block;font-size:12px;font-weight:700;margin-top:5px}
select{width:100%;display:block;border:1px solid #94a7b0;border-radius:7px;padding:3px 7px;background:#263e4a;color:#fff}
#taskReason{color:#ffd690;font-size:12px}
#taskArt,.guideRoute{border:1px solid var(--border);background:#263d48;border-radius:8px;padding:4px}
#taskArt .art,.guideRoute .art{width:44px;height:35px}
.guideRoute{text-align:center;margin-bottom:5px}
.guideRoute small,.muted{color:var(--muted);font-size:12px}
summary{cursor:pointer}

@media(max-width:700px) and (min-height:521px){
 #game{--edge-left:max(9px,env(safe-area-inset-left));--edge-right:max(9px,env(safe-area-inset-right));--edge-top:max(9px,env(safe-area-inset-top));--edge-bottom:max(9px,env(safe-area-inset-bottom))}
 header{align-items:flex-start}
 header>div{max-width:calc(100% - 100px)}
 header nav{display:grid;grid-template-columns:repeat(2,44px)}
 header button{padding-inline:3px;font-size:12px}
 h1{font-size:clamp(16px,4.5vw,23px)}
 .sceneMeta{position:absolute;top:75px;left:var(--edge-left);max-width:calc(100% - 120px);margin-top:0}
 .controlPanel{position:absolute;top:109px;left:var(--edge-left);margin-top:0}
 .lane{flex-direction:column;gap:1px;min-height:50px;padding:3px}
 .lane .art{width:25px;height:21px}
 .lane strong{font-size:11px}
 .lane small{display:none}
 footer{width:calc(100% - var(--edge-left) - var(--edge-right))}
 footer button{min-height:47px}
 .dragMessage{bottom:calc(var(--edge-bottom) + 126px);max-width:85%;font-size:12px}
 #report{right:var(--edge-right);width:calc(100% - var(--edge-left) - var(--edge-right))}
 .tutorial .dragMessage{bottom:calc(var(--edge-bottom) + 130px)}
 .tutorial.won #report{bottom:var(--edge-bottom)}
}
@media(max-height:520px){
 #game{--edge-top:max(8px,env(safe-area-inset-top));--edge-bottom:max(8px,env(safe-area-inset-bottom))}
 h1{font-size:19px}
 #intro{font-size:12px}
 .sceneMeta{margin-top:4px}
 .controlPanel{margin-top:4px}
 .controlPanel summary{padding-block:5px}
 .lane{padding:3px;min-height:45px}
 .lane .art,.lane small{display:none}
 footer{width:290px}
 footer button{min-height:45px;font-size:12px;padding-inline:5px}
 .dragMessage{bottom:calc(var(--edge-bottom) + 57px);font-size:12px;padding:3px 7px;max-width:55%}
 .controlBody{max-height:54dvh}
 #report{max-height:49dvh;width:min(360px,50%);bottom:calc(var(--edge-bottom) + 55px)}
 .tutorial .dragMessage{bottom:calc(var(--edge-bottom) + 65px)}
}

/* One scrollable handbook over the live workshop. */
#help{width:min(940px,96vw);max-width:96vw;max-height:92dvh;padding:0;overflow:hidden;background:#172d38}
#help[open]{display:flex;flex-direction:column}
.manualHeader,.manualFooter{flex:none;display:flex;justify-content:space-between;align-items:center;gap:12px;padding:13px 18px;background:#1e3844}
.manualHeader{border-bottom:1px solid var(--border)}
.manualHeader>div{min-width:0}
.manualHeader h2{font-size:clamp(17px,3.8vw,23px);line-height:1.3;margin:3px 0 0}
.manualKicker{font-size:12px;color:#ffd795;font-weight:750}
.manualHeader>button{min-width:44px;font-size:25px;line-height:1;align-self:flex-start}
.manualBody{padding:15px 18px 18px;overflow:auto;overscroll-behavior:contain;min-height:0;scrollbar-color:#819b9b #172d38}
#help .manualLead{font-size:15px;line-height:1.6;color:#f8e3bd;margin:0 0 13px}
.manualSection{margin:0 0 20px}
.manualSection h3{font-size:17px;margin:0 0 9px;color:#ffe2af}
.manualScreen{position:relative;margin:0;background:#0d202c;border-radius:11px;overflow:hidden;border:1px solid var(--border)}
.manualScreen img{display:block;width:100%;height:auto}
.manualScreen figcaption{padding:6px 9px;color:var(--muted);font-size:12px}
.mapPin,.manualLegend b{display:grid;place-items:center;width:25px;height:25px;border-radius:50%;color:#27200e;background:var(--gold);border:2px solid #fff1c9;font-weight:900;box-shadow:0 2px 6px #0008}
.mapPin{position:absolute}
.pinOrders{left:13%;top:15%}.pinMachines{left:69%;top:28%}.pinStock{left:33%;top:74%}.pinTrial{right:4%;top:81%}
.manualLegend{display:grid;grid-template-columns:1fr 1fr;gap:5px 15px;margin-top:8px}
#help .manualLegend p{display:flex;gap:8px;align-items:flex-start;margin:0;font-size:12px;line-height:1.5}
.manualLegend b{flex:none;width:22px;height:22px;font-size:12px;border-width:1px}
.manualLegend strong{display:block;color:#fff0d6}
.tutorialGuide,.manualExample{background:#244137;border:1px solid #68866b;border-radius:11px;padding:12px}
#help .tutorialGuide p{font-size:13px;line-height:1.6}
.tutorialGuideRow{display:flex;justify-content:center;align-items:center;gap:10px}
.tutorialGuideRow .art{width:62px;height:49px}
.guideArrow{color:var(--gold);font-size:25px;font-weight:900}
.manualSteps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.manualSteps article{padding:10px;border:1px solid var(--border);border-radius:11px;background:#233e49}
.manualSteps h4{font-size:15px;color:#ffe3b0;margin:8px 0 4px}
#help .manualSteps p{font-size:13px;line-height:1.65}
.manualSteps small,.exampleRound small{font-size:12px;color:#c3d5da;line-height:1.6;display:block;margin-top:5px}
.stepVisual{height:58px;display:flex;justify-content:center;align-items:center;gap:4px}
.stepVisual .art{width:46px;height:41px}
.guideButton{display:inline-block;border-radius:8px;padding:9px;color:#21190d;background:var(--gold);font-size:13px;font-weight:850}
.confirmDemo{background:#b0dfc3}
.roundDemo{border:1px solid var(--border);border-radius:8px;padding:8px 5px;font-size:12px}
.exampleRound{display:flex;align-items:flex-start;gap:10px;margin-top:9px}
.exampleRound>b{flex:none;background:#36574a;border-radius:6px;padding:5px 7px;font-size:12px}
#help .exampleRound p{font-size:13px;line-height:1.6;margin:0 0 4px}
#guideRoutes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#guideRoutes .guideRoute{margin:0;padding:8px 4px}
#guideRoutes .art{width:39px;height:34px}
#guideRoutes .flowArrow{font-size:17px}
#guideRoutes .guideRoute>div{gap:1px;flex-wrap:wrap}
#guideRoutes small{display:block;margin-top:4px}
.manualRules,.manualChecks ol{padding-left:20px;margin:6px 0;font-size:13px;line-height:1.7}
.manualRules li,.manualChecks li{margin-bottom:7px}
.manualChecks{border:1px solid var(--border);border-radius:10px;padding:9px 12px;background:#203a45}
.manualChecks summary{color:#ffe3af;font-weight:750;min-height:30px;padding-block:4px}
.manualFooter{border-top:1px solid var(--border)}
#help .manualFooter p{font-size:12px;color:var(--muted);margin:0}
.manualFooter button{flex:none;min-height:46px}
@media(max-width:600px){
 .manualHeader,.manualFooter{padding:10px 12px}
 .manualBody{padding:12px}
 .manualLegend{grid-template-columns:1fr}
 .manualSteps{grid-template-columns:1fr}
 .manualSteps article{display:grid;grid-template-columns:100px minmax(0,1fr);column-gap:8px;align-items:start}
 .stepVisual{grid-column:1;grid-row:1 / 4;align-self:center;flex-wrap:wrap;height:auto;min-height:65px}
 .stepVisual .art{width:35px;height:33px}
 .stepVisual .guideArrow{font-size:19px}
 .manualSteps h4{grid-column:2;font-size:14px;margin-top:0}
 .manualSteps p,.manualSteps small{grid-column:2}
 .manualFooter{flex-wrap:wrap;gap:6px}
 .manualFooter button{width:100%}
 #guideRoutes{grid-template-columns:1fr}
 .mapPin{width:20px;height:20px;font-size:11px;border-width:1px}
}
@media(max-height:450px){
 #help{max-height:95dvh}
 .manualHeader,.manualFooter{padding:7px 12px}
 .manualHeader h2{font-size:17px}
 .manualFooter button{min-height:44px}
}

#helpTitle:focus{outline:none}

#help .manualContext{padding:8px 10px;border-left:3px solid var(--gold);background:#223d48;border-radius:5px;margin:0 0 10px;line-height:1.65}
.manualChecks a{color:#ffd795;text-underline-offset:3px}
.manualChecks+.manualChecks{margin-top:8px}
#processCue{z-index:2;pointer-events:none;padding:7px 11px;font-size:clamp(12px,2.2vw,15px);font-weight:750;border:1px solid #ffdb9c;color:#fff1cc;text-align:center;white-space:normal}

#help .manualContext{padding:8px 10px;border-left:3px solid var(--gold);background:#223d48;border-radius:5px;margin:0 0 10px;line-height:1.65}
.manualChecks a{color:#ffd795;text-underline-offset:3px}
.manualChecks+.manualChecks{margin-top:8px}
#processCue{z-index:2;pointer-events:none;padding:7px 11px;font-size:clamp(12px,2.2vw,15px);font-weight:750;border:1px solid #ffdb9c;color:#fff1cc;text-align:center;white-space:normal}

/* Read production from the upper steel source down to the machines. */
#upstream{position:absolute;top:92px;left:50%;transform:translateX(-50%);width:min(430px,calc(100% - 32px));text-align:center;pointer-events:none}
.flowStep{font-size:12px;color:#ffdf9c;font-weight:800;text-shadow:0 1px 4px #09141b}
#steelTitle{margin-bottom:5px}
#steelStock{display:flex;justify-content:center;gap:7px;flex-wrap:wrap;pointer-events:auto}
#steelStock .piece{min-height:53px;font-size:14px;padding:5px 14px;background:#4e3a25;border-color:#b48243;cursor:pointer}
#steelStock .piece .art{width:43px;height:38px}
#steelStock .piece:disabled{background:#26383e}
.branchLines{position:relative;height:24px;width:62%;margin:0 auto}
.branchLines::before{content:'';position:absolute;left:50%;top:0;width:1px;height:12px;background:#c4a476}
.branchLines::after{content:'';position:absolute;left:0;right:0;top:12px;height:12px;border:1px solid #c4a476;border-bottom:0}
#processTitle{margin-bottom:6px}
#processChoices{display:grid;grid-template-columns:1fr 1fr;gap:10px;pointer-events:auto}
#processChoices .lane{width:100%;min-height:51px;flex-direction:row;gap:6px;padding:5px 8px;border-color:#8c9b9b;background:#213b49eb}
#processChoices .lane:disabled{opacity:.64}
#processChoices .lane.dropReady{border-color:#ffce78;box-shadow:0 0 0 2px #ffce6866;background:#4b4931f2}
#processChoices .lane.dropOver{background:#996023}
#castingChoices{display:flex;gap:5px}
#castingChoices .lane{flex:1;min-width:0}
#steelPrompt{font-size:12px;margin:6px auto 0;color:#f8e1b7;background:#172b36d6;border-radius:6px;padding:3px 6px;width:fit-content}
#upstream.sourceSelected #processTitle{color:#fff2c3}
#stockRoute{position:absolute;z-index:1;left:50%;top:62%;transform:translateX(-50%);width:min(490px,calc(100% - 24px));display:grid;justify-items:center;pointer-events:none;text-align:center}
#stockRoute .stockRack{position:static;left:auto;bottom:auto;transform:none;display:grid;grid-template-columns:1fr;max-width:100%;max-height:100px;overflow:auto;width:fit-content;padding:5px 9px;gap:3px;background:#182e39e8;border:1px solid #92a69766;pointer-events:auto}
#stockRoute .stockRack h2{display:block;font-size:12px}
#stockRoute #stock{justify-content:center;gap:5px}
#stockRoute .piece{min-height:45px;padding:3px 8px;font-size:12px}
.routeArrow{color:#eac07a;font-size:23px;line-height:20px;text-shadow:0 2px 4px #111}
#machineStep{margin-bottom:5px}
#stockRoute #machines{position:static;left:auto;top:auto;transform:none;width:100%;max-height:105px;display:flex;justify-content:center;align-items:stretch;gap:7px;padding:2px;overflow:auto;pointer-events:auto}
#stockRoute .lane{flex:1;max-width:160px;min-height:51px;flex-direction:row;padding:4px 8px;gap:5px}
#stockRoute .lane .art{width:31px;height:29px;display:block}
#stockRoute .lane div{text-align:left}
#stockRoute .lane small{display:none}
#stockRoute.sourceSelected #machineStep{color:#fff1c2}
.emptyStock{color:#c5d2d4;font-size:12px;max-width:300px;line-height:1.5;padding:3px}
#processCue{left:50%;top:52%;max-width:85%;border-radius:8px}
#dragMessage{bottom:var(--edge-bottom);left:var(--edge-left);transform:none;max-width:calc(100% - 390px);font-size:12px}
@media(max-width:700px) and (min-height:521px){
 #upstream{top:164px;width:calc(100% - 24px);max-width:410px}
 #steelStock .piece{min-height:48px;font-size:13px}
 #steelStock .piece .art{width:35px;height:31px}
 #processChoices{gap:8px}
 #processChoices .lane{gap:4px;min-height:48px;padding:4px}
 #processChoices .lane .art{width:27px;height:25px}
 #processChoices .lane strong{font-size:12px}
 #steelPrompt{font-size:11px}
 .branchLines{height:18px}
 .branchLines::before{height:8px}
 .branchLines::after{top:8px;height:10px}
 #stockRoute{width:calc(100% - 22px)}
 #stockRoute .stockRack{max-height:92px}
 #stockRoute .lane{padding:4px;gap:3px}
 #stockRoute .lane .art{width:26px;height:24px}
 #stockRoute .lane strong{font-size:12px}
 #processCue{top:45%;max-width:85%}
 #dragMessage{bottom:calc(var(--edge-bottom) + 60px);left:50%;transform:translateX(-50%);max-width:90%}
}
@media(max-height:520px){
 #upstream{top:61px;width:340px}
 #steelTitle{margin-bottom:2px}
 #steelStock .piece{min-height:44px;padding:1px 10px;font-size:12px}
 #steelStock .piece .art{width:31px;height:27px}
 .branchLines{height:12px}
 .branchLines::before{height:5px}
 .branchLines::after{top:5px;height:7px}
 #processTitle{margin-bottom:2px;font-size:11px}
 #processChoices .lane{min-height:44px;padding:2px 6px}
 #steelPrompt{font-size:10px;margin-top:3px;padding:1px 4px}
 #stockRoute,.tutorial #stockRoute{top:auto!important;left:50%!important;bottom:calc(var(--edge-bottom) + 58px);width:min(590px,calc(100% - 24px));display:flex;align-items:center;justify-content:center;gap:9px}
 #stockRoute .stockRack{max-width:46%;max-height:78px;padding:3px 6px}
 #stockRoute .stockRack h2{font-size:11px}
 #stockRoute .piece{min-height:44px;font-size:11px;padding-inline:5px}
 .routeArrow{font-size:20px;transform:rotate(-90deg);flex:none}
 #machineStep{display:none}
 #stockRoute #machines{width:auto;max-width:52%;flex:1;max-height:78px}
 #stockRoute .lane{max-width:150px;min-height:48px;padding:3px}
 #stockRoute .lane .art{display:none}
 #stockRoute .lane strong{font-size:11px}
 #processCue{top:54%;max-width:80%}
 #dragMessage{bottom:var(--edge-bottom);left:var(--edge-left);transform:none;max-width:calc(100% - 330px)}
}
#upstream.isSpent .branchLines,#upstream.isSpent .flowStep{opacity:.55}
#upstream.isSpent #steelPrompt{color:#b8d0c9}

#upstream.sourceFinished #steelStock,#upstream.sourceFinished .branchLines,#upstream.sourceFinished #processTitle,#upstream.sourceFinished #processChoices{display:none}
#upstream.sourceFinished #steelTitle{opacity:1;color:#b8dfc6}
#upstream.sourceFinished #steelPrompt{margin-top:4px}

#stockRoute.noStock .stockRack{background:transparent;border:0;padding:0 4px}
#stockRoute.noStock .emptyStock{padding:0;font-size:11px}

/* The first rolling trial puts the existing controls directly over their 3D parts. */
.slabPilot.has-workshop:not(.won) #stockRoute,
.slabPilot.has-workshop #stockRoute :is(.stockRack,#stock,#machines){display:contents}
.slabPilot.has-workshop #stockRoute :is(.flowStep,.routeArrow,.art,.lane span){display:none}
.slabPilot.has-workshop #stockRoute :is(.piece,.lane){
  position:absolute;transform:translate(-50%,-50%);padding:0;min-width:44px;min-height:44px;
  max-width:none;overflow:visible;pointer-events:auto;border:0;border-radius:6px;
  background:transparent;box-shadow:none;touch-action:none;
}
.slabPilot.has-workshop #stockRoute .piece{
  left:var(--slab-x);top:var(--slab-y);width:var(--slab-w);height:var(--slab-h);
  --mark:#ffd185;z-index:1;
}
.slabPilot.has-workshop #stockRoute .lane{
  left:var(--mill-x);top:var(--mill-y);width:var(--mill-w);height:var(--mill-h);
  --mark:#a4e8d1;
}
.slabPilot.has-workshop #stockRoute :is(.piece,.lane)::before{
  content:'';position:absolute;inset:0;pointer-events:none;opacity:.9;
  --corner:linear-gradient(var(--mark),var(--mark));
  background:var(--corner) left top / 11px 2px,var(--corner) left top / 2px 9px,
    var(--corner) right top / 11px 2px,var(--corner) right top / 2px 9px,
    var(--corner) left bottom / 11px 2px,var(--corner) left bottom / 2px 9px,
    var(--corner) right bottom / 11px 2px,var(--corner) right bottom / 2px 9px;
  background-repeat:no-repeat;filter:drop-shadow(0 1px 2px #091118);
}
.slabPilot.has-workshop #stockRoute :is(.piece>span,.lane>div){
  position:absolute;left:50%;transform:translateX(-50%);white-space:nowrap;border:1px solid var(--mark);
  border-radius:14px;padding:3px 10px;background:#18272cf5;color:var(--mark);font-size:13px;line-height:18px;
}
.slabPilot.has-workshop #stockRoute .piece>span{bottom:100%}
.slabPilot.has-workshop #stockRoute .lane>div{top:100%}
.slabPilot.has-workshop #stockRoute .lane strong{font-size:13px}
.slabPilot.has-workshop #stockRoute .dropReady{background:#6ac0a927;outline:2px dashed #b9ffe7}
.slabPilot.has-workshop #stockRoute .dropOver{background:#92edbc55;outline:3px solid #ccffe1}
.slabPilot.has-workshop #stockRoute .piece[aria-pressed="true"]{outline:2px solid #ffdb91}
.slabPilot.has-workshop #dragMessage{
  left:50%;bottom:max(16%,var(--edge-bottom));transform:translateX(-50%);max-width:90%;
}
.slabPilot.has-workshop #processCue{top:34%}

#plateLabel{display:none}
.slabPilot.has-workshop.won #plateLabel{
  position:absolute;z-index:2;display:block;pointer-events:none;transform:translate(-50%,calc(-100% - 19px));
  border:1px solid #a4e8d1;border-radius:14px;padding:3px 10px;font-size:13px;font-weight:750;
  background:#18272cf5;color:#b8f1db;white-space:nowrap;
}
#plateLabel::after{
  content:'';position:absolute;left:50%;top:100%;width:2px;height:16px;background:#a4e8d1;
}

@media(max-width:700px) and (min-height:521px){
  body:has(.slabPilot)>#next-click-button{top:calc(max(12px,env(safe-area-inset-top)) + 101px)}
}
