.custom-print-shortcode {
  display: grid;
  gap: 14px;
  max-width: 100%;
}

.custom-print-shortcode-controls {
  display: grid;
  gap: 12px;
}

.custom-print-shortcode-control-label {
  display: grid;
  gap: 6px;
}

.custom-print-shortcode-label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.custom-print-shortcode-control input[type="text"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.custom-print-media-ui {
  display: grid;
  gap: 14px;
}

.custom-print-media-source {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.custom-print-media-preview {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 420px;
  aspect-ratio: 1 / 1;
  padding: 14px;
  border: 1px solid #dfdfdf;
  border-radius: 22px;
  background: linear-gradient(180deg, #f7f5f1 0%, #f1efe9 100%);
  box-sizing: border-box;
}

.custom-print-media-preview[hidden],
.custom-print-media-result[hidden] {
  display: none !important;
}

.custom-print-media-result {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid #d8d5ce;
  border-radius: 16px;
  background: #ffffff;
  object-fit: contain;
}

.custom-print-media-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 12px;
}

.custom-print-media-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1 1 220px;
  min-height: 50px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid #d4d4d4;
  background: #ffffff;
  color: #1f2328;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.custom-print-media-button-icon {
  font-size: 15px;
  line-height: 1;
}

.custom-print-media-button:hover:not(:disabled) {
  border-color: #b8b8b8;
}

.custom-print-media-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.custom-print-media-select {
  border-color: #8b2532;
  background: #8b2532;
  color: #ffffff;
}

.custom-print-media-select:hover:not(:disabled) {
  border-color: #751f2a;
  background: #751f2a;
}

.custom-print-media-adjust {
  background: #ffffff;
  color: #1f2328;
}

.custom-print-progress {
  display: grid;
  gap: 6px;
}

.custom-print-progress[hidden] {
  display: none !important;
}

.custom-print-progress-bar {
  position: relative;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid #bfc4bf;
  border-radius: 999px;
  background: #e4e7e4;
}

.custom-print-progress-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: #3fa03b;
  transition: width 0.55s ease;
}

.custom-print-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  line-height: 1.4;
}

.custom-print-progress-phase {
  color: #50575e;
}

.custom-print-progress-percent {
  color: #50575e;
  font-weight: 600;
  white-space: nowrap;
}

.custom-print-shortcode-help {
  min-height: 18px;
  font-size: 12px;
}

.custom-print-shortcode-help.is-pending {
  color: #a15c00;
}

.custom-print-shortcode-help.is-success {
  color: #008a20;
}

.custom-print-shortcode-help.is-error {
  color: #d63638;
}

.custom-print-crop-modal[hidden] {
  display: none !important;
}

.custom-print-modal-open {
  overflow: hidden;
}

.custom-print-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: 20px;
  isolation: isolate;
  box-sizing: border-box;
}

.custom-print-crop-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(10, 12, 16, 0.66);
}

.custom-print-crop-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  width: min(92vw, 760px);
  max-height: calc(100vh - 40px);
  padding: 22px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
}

.custom-print-crop-header {
  display: grid;
  gap: 6px;
}

.custom-print-crop-header strong {
  font-size: 18px;
  line-height: 1.2;
}

.custom-print-crop-header p {
  margin: 0;
  color: #5f6670;
  font-size: 14px;
  line-height: 1.5;
}

.custom-print-crop-stage {
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 8px;
  border-radius: 18px;
  background: #eff2ee;
}

.custom-print-crop-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: min(72vh, 640px);
}

.custom-print-crop-image {
  display: block;
  max-width: min(100%, 680px);
  max-height: min(68vh, 600px);
  border-radius: 16px;
}

.custom-print-crop-selection {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #3fa03b;
  box-shadow: 0 0 0 9999px rgba(15, 19, 26, 0.42);
  cursor: move;
}

.custom-print-crop-selection::before,
.custom-print-crop-selection::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(63, 160, 59, 0.95);
  pointer-events: none;
}

.custom-print-crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 3px;
  background: #3fa03b;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
}

.custom-print-crop-handle-nw {
  top: 0;
  left: 0;
  cursor: nwse-resize;
}

.custom-print-crop-handle-n {
  top: 0;
  left: 50%;
  cursor: ns-resize;
}

.custom-print-crop-handle-ne {
  top: 0;
  left: 100%;
  cursor: nesw-resize;
}

.custom-print-crop-handle-e {
  top: 50%;
  left: 100%;
  cursor: ew-resize;
}

.custom-print-crop-handle-se {
  top: 100%;
  left: 100%;
  cursor: nwse-resize;
}

.custom-print-crop-handle-s {
  top: 100%;
  left: 50%;
  cursor: ns-resize;
}

.custom-print-crop-handle-sw {
  top: 100%;
  left: 0;
  cursor: nesw-resize;
}

.custom-print-crop-handle-w {
  top: 50%;
  left: 0;
  cursor: ew-resize;
}

.custom-print-crop-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 12px;
}

.custom-print-crop-button {
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid #d0d4d9;
  border-radius: 14px;
  background: #ffffff;
  color: #1f2328;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.custom-print-crop-done {
  border-color: #8b2532;
  background: #8b2532;
  color: #ffffff;
}

.custom-print-preview-stage {
  position: relative;
}

.custom-print-live-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.custom-print-preview-item {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
}

.custom-print-preview-item-input {
  padding: 4px;
}

.custom-print-preview-text {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 4px 6px;
  color: #111;
  font-size: clamp(12px, 1.4vw, 22px);
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  word-break: break-word;
}

.custom-print-preview-item-media {
  padding: 0;
}

.custom-print-preview-media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

@media (max-width: 640px) {
  .custom-print-media-preview {
    max-width: 100%;
  }

  .custom-print-crop-dialog {
    padding: 16px;
  }

  .custom-print-crop-button,
  .custom-print-media-button {
    width: auto;
  }
}
