.hatch-tool .lab-stage { display: flex; flex-direction: column; }
.hatch-tool .lab-stage-heading { position: absolute; inset: 0 0 auto; }
.hatch-stage { flex: 1; display: flex; flex-direction: column; }
.hatch-view { flex: 1; position: relative; display: grid; place-items: center; overflow: hidden; min-height: 225px; }
.hatch-view[data-ready] { touch-action: none; cursor: grab; }
.hatch-view[data-ready]:active { cursor: grabbing; }
.hatch-view[data-dragging] { outline: 1px dashed var(--lab-accent); outline-offset: -2px; }
.hatch-view #hatch-artwork { position: absolute; inset: 50% auto auto 50%; transform-origin: center; }
.hatch-view #hatch-artwork img { width: 100%; height: 100%; display: block; object-fit: contain; user-select: none; }
.hatch-view p { margin-inline: 12px; text-align: center; color: #bbb; }
.hatch-tool .lab-stage-tools { position: static; margin-inline: auto; }
.hatch-tool .lab-stage-controls { z-index: 2; width: min(100%, 300px); inset-inline-end: max(var(--lab-gutter, 16px), calc((100% - 1280px) / 2)); }
.hatch-tool .lab-stage-panel { max-height: max(220px, calc(100dvh - var(--lab-header-size) - 185px)); }
.hatch-select,.hatch-check,.hatch-colors label { display: flex; align-items: center; gap: 6px; margin-block-end: 6px; font-size: .8rem; }
.hatch-select { flex-wrap: wrap; justify-content: space-between; }
.hatch-tool :is(select,input[type=number]) { font: inherit; min-height: var(--lab-tap); color: #fff; background: #151515; border: 1px solid #555; border-radius: var(--lab-radius); padding-inline: 8px; }
.hatch-knob { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; font-size: .8rem; }
.hatch-knob input { grid-column: 1 / -1; min-height: var(--lab-tap); margin: 0; width: 100%; accent-color: var(--lab-accent); }
.hatch-knob output { color: #bbb; font-variant-numeric: tabular-nums; }
.hatch-check { min-height: var(--lab-tap); }
.hatch-check input { accent-color: var(--lab-accent); }
.hatch-colors label { justify-content: space-between; }
.hatch-colors input { min-width: 44px; min-height: var(--lab-tap); background: #151515; }
.hatch-toolbar { display: flex; flex-wrap: wrap; align-items: stretch; gap: 7px; pointer-events: auto; padding-block: 12px 8px; }
.hatch-toolbar .lab-action { min-height: var(--lab-tap); align-content: center; text-align: center; line-height: 1.3; font-weight: 400; }
.hatch-tool button[data-next-action]:not(:disabled) { background: var(--lab-accent); border-color: var(--lab-accent); color: var(--lab-accent-ink); }
.hatch-export-size { display: flex; gap: 5px; align-items: center; font-size: .75rem; }
.hatch-export-size input { width: 72px; }
.hatch-formats { flex-basis: 100%; margin: 0; color: #c3c3c3; font-size: .75rem; line-height: 1.45; }
.hatch-status { display: flex; align-items: center; flex-wrap: wrap; gap: 0 12px; flex-basis: 100%; margin: 0; color: #bbb; font-size: .78rem; }
.hatch-toolbar progress { width: 100%; height: 3px; accent-color: var(--lab-accent); }
.hatch-tool [hidden] { display: none !important; }
@media(max-width:699px) {
  .hatch-tool .lab-stage-tools { position: relative; }
  .hatch-tool .lab-stage-controls { inset-block: auto calc(100% + 4px); inset-inline-end: 0; }
  .hatch-tool .lab-stage-panel { max-height: min(38dvh, 320px); }
  .hatch-view { margin-block-end: calc(var(--lab-tap) + 8px); }
  .hatch-stage:has(.lab-stage-controls[open]) .hatch-view { margin-block-end: calc(var(--lab-tap) + min(38dvh, 320px) + 16px); }
  .hatch-toolbar { gap: 5px; }
  .hatch-toolbar .lab-action { padding-inline: 8px; font-size: .78rem; }
}

.hatch-tool .lab-stage-panel details { padding-block: 2px; }
.hatch-tool .lab-stage-panel details summary { min-height: var(--lab-tap); align-content: center; cursor: pointer; }
#hatch-layers { padding-inline-start: 12px; }
