.mobile-detail { margin-top: 12px; border: 1px solid #d8d8d4; border-radius: 8px; background: #fff; }
.mobile-detail summary { min-height: 42px; padding: 11px 12px; cursor: pointer; font-size: 12px; font-weight: 700; list-style-position: inside; }
.mobile-detail-content { padding: 0 12px 13px; }
.mobile-edit-settings, .stitch-tools-toggle, #stitchPaletteToggle { display: none; }
.stitch-header-actions, .stitch-palette-actions { display: flex; align-items: center; gap: 7px; }
.stitch-touch-probe { position: absolute; z-index: 4; width: 136px; padding: 7px; border: 2px solid #242424; border-radius: 12px; background: #fff; box-shadow: 0 8px 22px #0004; pointer-events: none; text-align: center; }
.stitch-touch-probe[hidden] { display: none; }
.stitch-touch-probe canvas { display: block; width: 112px; height: 112px; margin: auto; image-rendering: pixelated; }
.stitch-touch-probe strong { display: block; padding-top: 4px; color: #242424; font-size: 12px; }
@media (pointer: coarse) { .stitch-board { touch-action: none; } }

@media (max-width: 760px) {
  .settings.has-image .upload-box { min-height: 48px; padding: 4px; }
  .settings.has-image .upload-icon { display: none; }
  .settings.has-image .upload-button { width: 100%; min-height: 40px; font-size: 13px; }
  .crop-wrap { margin-top: 12px; }
  #cropPreview { height: auto; max-height: 180px; }
  .setting-group { margin: 16px 0 13px; padding-top: 14px; }
  .setting-heading { margin-bottom: 10px; }
  .mobile-detail summary { min-height: 44px; font-size: 13px; }
  .grid-presets button { min-height: 44px; font-size: 11px; }
  .subject-entry, .primary-button, .export-button, .mobile-edit-settings { min-height: 44px; }
  .subject-entry { margin-top: 8px; }
  .import-row { padding-top: 12px; }
  .mobile-edit-settings { display: inline-flex; align-items: center; justify-content: center; border: 1px solid #242424; border-radius: 6px; padding: 4px 8px; background: #fff; color: #242424; font-size: 11px; font-weight: 700; white-space: nowrap; }
  .canvas-heading-actions .icon-button { width: 44px; height: 44px; }
  .canvas-heading { padding: 12px; margin: 0; }
  .stitch-header { align-items: center; padding: 8px 12px; }
  .stitch-header h2 { font-size: 17px; }
  .stitch-tools-toggle, #stitchPaletteToggle { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border: 1px solid #242424; border-radius: 7px; background: #fff; color: #242424; padding: 6px 10px; font-size: 12px; font-weight: 700; }
  .stitch-close { min-height: 44px; }
  .stitch-controls { padding: 5px 10px; }
  .stitch-selection-actions button { min-height: 44px; min-width: 44px; }
  .stitch-dialog:not(.tools-expanded) .stitch-view-actions { display: none; }
  .stitch-view-actions { padding-top: 3px; justify-content: space-between; }
  .stitch-view-actions button { min-height: 44px; min-width: 44px; }
  .stitch-region-toolbar { min-height: 44px; padding: 4px 10px; }
  .stitch-region-switch { min-height: 36px; font-size: 12px; }
  .stitch-region-controls select, .stitch-region-controls button { min-height: 44px; }
  .stitch-region-controls #stitchRegionProgress { width: auto; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
  .stitch-palette { padding: 5px 10px max(8px, env(safe-area-inset-bottom)); }
  .stitch-palette-heading { min-height: 44px; margin: 0; }
  .stitch-palette-heading button { min-height: 44px; padding: 5px 9px; }
  .stitch-dialog:not(.palette-expanded) .stitch-color-list { display: none; }
  .stitch-color { min-height: 48px; }
  .stitch-cell-info { font-size: 11px; }
  .stitch-board { touch-action: none; }
  .subject-toolbar button, .subject-actions button { min-height: 44px; }
}

@media (min-width: 761px) and (max-width: 1100px) {
  .stitch-dialog { width: calc(100vw - 20px); height: calc(100dvh - 20px); }
}
