.mast, .command, footer { flex-wrap: wrap; }
.preview-shell { width: min(100%, 520px); margin: 0 auto; padding: 24px 32px; }
.art-title { margin: 0 0 10px; flex-wrap: wrap; }
.art-title button { padding: 3px 10px; }
.paper-ruler { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); padding: 3px 0 5px; background: repeating-linear-gradient(90deg,#637690 0 1px,transparent 1px 12px) left bottom/100% 3px no-repeat; }
#sheetPreview { display: block; width: 100%; background: white; box-shadow: 0 12px 28px #0a0e16aa; margin: 0; touch-action: none; }
#status[data-error=true], #quality { color: #ffd39d; }
.inspector select { min-width: 0; max-width: 100%; }
#packageDetails, #quality { margin-bottom: 8px; }
footer { min-height: 45px; }
@media (max-width:760px) { .preview-shell { padding: 16px; } .inspector { max-height: none; } }

.preview-shell { flex: none; align-self: flex-start; }
#autoCrop { width: 100%; margin-bottom: 10px; }
.rush-bg-fields { padding: 0; border: 0; margin: 0; min-width: 0; }
#rushBackgroundCustomRow[hidden] { display:none; }
#rushBackgroundCustom { min-height: 34px; width: 100%; }
#rushBackgroundStatus { min-height: 2.3em; }
#facePicker { max-height: 90dvh; }
#facePreview { width: 100%; height: auto; max-height: 55dvh; object-fit: contain; }
#editCrop { width: 100%; margin-bottom: 8px; }
#enhanceControls { border: 0; padding: 0; margin: 0; min-width: 0; }
#enhanceControls output { float: right; font-variant-numeric: tabular-nums; }
#cropDialog { max-height: 92dvh; width: min(580px, 94vw); }
#cropDialog p { margin: 0; }
#cropPreview { display: block; max-width: 100%; max-height: 52dvh; width: auto; height: auto; margin: auto; touch-action: none; cursor: move; }

#autoEnhance { width: 100%; margin-bottom: 10px; }
#previewBoard { min-width: 0; }
#previewBoard[data-tool="move"] #sheetPreview[data-photo="true"] { cursor: grab; }
#previewBoard[data-tool="move"] #sheetPreview.moving-id-photo { cursor: grabbing; }
#previewBoard[data-tool="hand"] #sheetPreview { cursor: grab; }
#previewBoard[data-tool="hand"].panning { user-select: none; }
#previewBoard[data-tool="hand"].panning #sheetPreview { cursor: grabbing; }
.paper-preview { position: relative; margin: 8px 0 12px; }
#photoSlots { position: absolute; inset: 0; pointer-events: none; }
#photoSlots .photo-slot {
  position: absolute; display: grid; place-items: center; padding: 0;
  border: 1px dashed #748caf; background: #f0f5fb; color: #345275;
  font-size: clamp(16px, 4vmin, 38px); pointer-events: auto;
}
#photoSlots .photo-slot:not(.photo-slot-filled):hover { border-color: #3868a0; background: #e2eefc; }
#photoSlots .photo-slot-filled { border: 0; background: transparent; cursor: zoom-in; }
#photoSlots .photo-slot-filled[aria-pressed="true"] { cursor: zoom-out; }
#photoSlots .photo-slot-filled:hover,
#photoSlots .photo-slot-filled:focus-visible { outline: 2px solid #3868a0; outline-offset: -2px; }
#previewBoard[data-tool="hand"] .photo-slot { pointer-events: none; }
.numeric-pair { display: grid; gap: 3px; min-width: 0; }
.numeric-pair input { width: 100%; min-width: 0; margin: 0; }
.numeric-pair input[type="range"] { padding: 0; accent-color: #6da9ef; }
#cropDimensions .numeric-pair { width: 100%; }

#paperSetup .paper-group { min-inline-size: 0; margin: 0; padding: 7px 9px 9px; border: 1px solid var(--line); border-radius: 6px; }
#paperSetup .paper-group + .paper-group { margin-top: 10px; }
#paperSetup legend { padding: 0 4px; font-size: 12px; font-weight: 600; }
#paperSetup .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 8px; margin: 0; }
#paperSetup .field-grid + .field-grid { margin-top: 9px; }
#paperSetup select { width: 100%; min-width: 0; }
#paperSetup .check { margin-top: 9px; }
#paperSetup .photo-border-toggle { display: flex; margin-top: 0; gap: 6px; }
#paperSetup .photo-border-toggle input { width: auto; min-width: auto; }

#photoBorderHue {
  appearance: none;
  height: 10px;
  margin: 3px 0;
  padding: 0;
  border-radius: 10px;
  background: linear-gradient(to right, white, red 4%, yellow 18%, lime 34%, cyan 50%, blue 67%, magenta 83%, red);
}
#photoBorderHue:disabled { opacity: .45; }
#photoBorderHue::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 2px solid white;
  border-radius: 50%;
  background: #202938;
}
#photoBorderHue::-moz-range-thumb {
  width: 11px;
  height: 11px;
  border: 2px solid white;
  border-radius: 50%;
  background: #202938;
}

#decorControls { margin: 8px 0 0; padding: 0; border: 0; min-inline-size: 0; }
#photoDecor select { min-width: 0; width: 100%; }
#decorText {
  width: 100%; resize: vertical; padding: 6px 8px;
  font: inherit; color: inherit; background: #252f3f;
  border: 1px solid #455569; border-radius: 6px;
}
#decorText:disabled { opacity: .5; }

.rail #rotateLeft, .rail #rotateRight { display: none; }
#donate { background: none; border: 0; padding: 4px; }
#donateDialog { width: fit-content; max-width: 92vw; }
#donateDialog img { display: block; width: auto; height: auto; max-width: calc(92vw - 38px); max-height: min(70dvh, 620px); }
#donateDialog form { margin-top: 10px; justify-items: center; }

#feedbackPage { max-width: 620px; margin: 24px auto; border: 0; }
#feedbackPage form, #feedbackPage label { display: grid; gap: 8px; }
#feedbackPage form { margin-top: 16px; gap: 12px; }
#feedbackPage textarea { width: 100%; padding: 8px; background: var(--base); color: var(--light); border: 1px solid var(--line); border-radius: 6px; font: inherit; }
#feedbackPage form button { justify-self: start; }
