/* Knightfall Creator Production Lab: self-contained mobile workspaces */
#production-workbench[hidden],#production-workbench [hidden]{display:none!important}
#production-workbench{--lab-ink:#141827;--lab-stroke:#5d526e;--lab-sky:#a6e4d4;scroll-margin-top:7rem;margin:1rem 0;padding:clamp(.8rem,2vw,1.3rem)}
#production-workbench p{line-height:1.55;max-width:75ch}
.lab-tabs{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0}
.lab-tabs button{font:inherit;min-height:44px;cursor:pointer;padding:.55rem .85rem;border-radius:10px;background:#182133;color:#d6e2e3;border:1px solid #576272}
.lab-tabs button[aria-selected="true"]{background:#b2e8cf;color:#092024;border-color:#b2e8cf;font-weight:850}
.lab-tabs button:focus-visible,#production-workbench :is(input,select,canvas,.btn):focus-visible{outline:3px solid #c7a77c;outline-offset:3px}
.lab-grid{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(0,1fr);gap:1rem;align-items:start}
.lab-canvas-wrap{padding:.75rem;border-radius:12px;border:1px solid var(--lab-stroke);background:#131924;background-image:linear-gradient(45deg,#273140 25%,transparent 25%),linear-gradient(-45deg,#273140 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#273140 75%),linear-gradient(-45deg,transparent 75%,#273140 75%);background-size:28px 28px;background-position:0 0,0 14px,14px -14px,-14px 0;display:grid;place-items:center;min-width:0;overflow:auto}
#production-workbench canvas{display:block;max-width:100%;height:auto;image-rendering:pixelated;border:1px solid #69758a}
#lab-pixel-canvas{width:min(100%,360px);aspect-ratio:1;touch-action:none;cursor:crosshair}
#lab-tile-canvas{width:100%;touch-action:none;cursor:crosshair}
#lab-atlas-canvas{width:auto;max-height:320px;object-fit:contain}
.lab-controls{min-width:0;display:grid;align-content:start;gap:.65rem}
.lab-controls label{font-size:.83rem;color:#dae0e8;font-weight:700;display:grid;gap:.35rem}
.lab-controls :is(input[type="number"],select){width:100%;font:inherit;background:#0c1220;color:#fff;padding:.7rem;border-radius:8px;border:1px solid #68718b}
.lab-controls input[type="color"]{width:68px;height:44px;border-radius:8px;padding:2px;cursor:pointer}
.lab-tools{display:flex;flex-wrap:wrap;gap:.4rem}
.lab-tools button,.lab-controls .btn,.lab-upload{min-height:44px;border-radius:8px;padding:.55rem .75rem;border:1px solid #69718b;background:#1b2233;color:#fff;font:inherit;font-weight:700;cursor:pointer}
.lab-tools button[aria-pressed="true"]{border-color:#b2e8cf;background:#284638;color:#defde9}
.lab-controls .btn.primary{background:#b2e8cf;color:#122523;border-color:#b2e8cf}
.lab-upload{display:inline-flex;align-items:center;justify-content:center}
.lab-upload input{position:absolute;width:1px;height:1px;opacity:0}
.lab-status{font-size:.83rem;border:1px solid #4d6470;border-radius:8px;background:#131d2a;padding:.65rem .75rem;color:#d9e6e9;min-height:2.75rem}
#lab-atlas-list{margin:0;padding-left:1.4rem;color:#d3dbe2;max-height:180px;overflow:auto;font-size:.78rem;overflow-wrap:anywhere}
.lab-note{font-size:.75rem!important;color:#b7bccc!important}
@media(max-width:750px){.lab-grid{grid-template-columns:1fr}.lab-canvas-wrap{order:0}.lab-controls{order:1}#production-workbench{padding:.75rem}.lab-tabs button{flex:1 1 130px}}
@media(prefers-reduced-motion:reduce){#production-workbench *{scroll-behavior:auto!important;transition:none!important}}
