/* Keep the machine canvas full-height; controls no longer consume a grid row. */
@media(min-width:761px){
 .app{height:100svh;min-height:700px;grid-template-rows:65px minmax(0,1fr) 32px}
 .mission{height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:5px;scrollbar-width:thin}
 .app>footer{grid-row:3}
 .intro{top:112px}.intro h1{font-size:35px}.intro p{font-size:11px}
}
.floating-controls.console{position:absolute;left:10px;top:210px;bottom:auto;width:180px;max-height:calc(100% - 290px);overflow-y:auto;scrollbar-width:thin;margin:0;padding:12px 10px 8px;border:0;border-radius:0;background:transparent;backdrop-filter:none;box-shadow:none;z-index:4}
.rail-heading{display:flex;justify-content:space-between;align-items:center;font-size:8px;letter-spacing:1.3px;color:var(--muted);padding:1px 5px 10px}.rail-heading b{font-size:10px;font-weight:500;letter-spacing:0}
.floating-controls .controls{display:flex;flex-direction:column;list-style:none;padding:0;margin:0;gap:3px}
.floating-controls .controls li{margin:0;padding:0;position:relative}
.floating-controls .controls li:not(:last-child):after{content:'';position:absolute;left:24px;bottom:-6px;width:1px;height:10px;background:#bfcfc9;pointer-events:none}
.floating-controls .control{width:100%;min-height:51px;display:flex;flex-direction:row;align-items:center;text-align:left;gap:10px;padding:7px 8px;border-radius:10px;background:transparent;border:1px solid transparent;box-shadow:none}
.step-number{width:29px;height:29px;flex:none;border:1px solid #b7c8c1;border-radius:50%;display:grid;place-items:center;font-size:12px;color:var(--muted);background:#f5f7f1}
.floating-controls .control strong{font-size:12px;display:block;font-weight:500}.floating-controls .control small{display:block;font-size:9px;margin-top:3px;line-height:1.35;color:var(--muted)}
.floating-controls .control.current{background:#e4eee8}.floating-controls .control.current .step-number{background:var(--accent);border-color:var(--accent);color:white}
.floating-controls .control.active{border-color:#94b5a9}.floating-controls .control.active strong{font-weight:700}.floating-controls .control.done:not(.current) .step-number{background:#dde8df;color:#3e7766;border-color:#c9dace}
.floating-controls .control.held{background:#c7e2d5;box-shadow:inset 0 1px 4px #20343c14}
.floating-controls .progress-track{margin:12px 5px 8px;height:2px;background:#d7e1da}.floating-controls #next-action{font-size:10px;line-height:1.5;min-height:30px;margin:0 5px 4px;color:var(--accent)}
.machine-feedback{position:absolute;left:210px;bottom:65px;max-width:320px;padding:9px 13px;border-radius:10px;background:#f8faf5eb;pointer-events:none;z-index:2;box-shadow:0 3px 16px #20343c08;font-size:11px;line-height:1.5}
.machine-feedback #stage-title{display:block}.machine-feedback #notice,.machine-feedback #mechanism-status{display:block;font-size:10px;min-height:0;margin:0;padding:3px 0 0}.machine-feedback #notice:empty,.machine-feedback #mechanism-status:empty{display:none}
.orbit-hint{display:none}
@media(min-width:761px) and (max-height:800px){
 .app{padding-top:16px;grid-template-rows:53px minmax(0,1fr) 28px;min-height:660px}
 .intro{top:90px}.intro h1{font-size:29px;margin:12px 0}.intro p{display:none}
 .floating-controls.console{top:140px;max-height:calc(100% - 206px)}
}
@media(min-width:761px) and (max-width:1100px){
 .floating-controls.console{width:152px;left:3px}.floating-controls .control{gap:6px;padding-left:4px}.floating-controls .control strong{font-size:11px}.floating-controls .control small{font-size:8px}.floating-controls .controls li:not(:last-child):after{left:20px}.machine-feedback{left:169px;max-width:240px}.intro h1{font-size:29px}
}
@media(max-width:760px){
 .app{height:auto;min-height:100svh;padding-bottom:0}
 #viewport{height:max(590px,calc(100svh - 85px));max-height:850px}
 .intro{top:95px}.intro h1{font-size:25px;line-height:1.06}
 .floating-controls.console{top:140px;left:6px;width:76px;max-height:calc(100% - 245px);padding:9px 5px 5px;overflow-y:auto}
 .rail-heading{justify-content:center;font-size:7px;letter-spacing:.5px;padding:0 0 6px}.rail-heading b{display:none}
 .floating-controls .controls{gap:3px}.floating-controls .controls li:not(:last-child):after{display:none}
 .floating-controls .control{flex-direction:column;gap:4px;padding:6px 1px;min-height:53px;text-align:center}.step-number{width:24px;height:24px;font-size:10px}
 .floating-controls .control strong{font-size:9px}.floating-controls .control small{display:none}
 .floating-controls #next-action{font-size:8px;min-height:30px;margin:0 2px 4px;text-align:center}.floating-controls .progress-track{margin:8px 2px 5px}
 .machine-feedback{left:92px;right:10px;bottom:103px;max-width:none;font-size:10px;padding:7px 10px}.machine-feedback #notice,.machine-feedback #mechanism-status{font-size:9px}
 .mission{padding-top:22px}.view-tools{z-index:5}
}
@media(max-width:760px) and (max-height:700px){
 .floating-controls.console{top:120px;max-height:calc(100% - 220px)}
 .floating-controls .control{min-height:44px;gap:2px;padding:4px 1px}
 .floating-controls .step-number{width:20px;height:20px}
 .floating-controls #next-action{min-height:26px}
}
