.wpc-fr-configurator {
  clear: both;
  margin: 1.5rem 0;
  padding: clamp(14px, 3vw, 24px);
  border: 1px solid #e2e2e2;
  border-radius: 10px;
  background: #fff;
}
.wpc-fr-configurator h2 {
  font-size: 1.4rem;
}
.wpc-fr-options label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}
.wpc-fr-options select {
  width: 100%;
  max-width: 480px;
}
.wpc-fr-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 18px 0 10px;
}
.wpc-fr-tabs button {
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid #bbb;
  border-radius: 6px;
  background: #fff;
  white-space: nowrap;
  cursor: pointer;
}
.wpc-fr-tabs button[aria-selected="true"] {
  color: #fff;
  background: #222;
  border-color: #222;
}
.wpc-fr-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr);
  gap: 18px;
}
.wpc-fr-canvas-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f4f4f4;
}
.wpc-fr-canvas-wrap .canvas-container,
.wpc-fr-canvas-wrap canvas {
  max-width: 100%;
  height: auto !important;
}
.wpc-fr-tools {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.wpc-fr-tools > div {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 7px;
}
.wpc-fr-tools h3 {
  font-size: 1rem;
  margin: 0 0 10px;
}
.wpc-fr-tools input[type="text"] {
  width: 100%;
  margin-bottom: 8px;
}
.wpc-fr-tools label {
  display: block;
  margin-top: 8px;
}
.wpc-fr-file-label input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.wpc-fr-tools small {
  display: block;
  margin-top: 6px;
}
.wpc-fr-total {
  font-size: 1.1rem;
  margin: 14px 0 0;
}
.wpc-fr-status {
  min-height: 1.5em;
}
.wpc-fr-configurator button,
.wpc-fr-configurator select,
.wpc-fr-configurator input {
  font-size: 16px;
}
@media (max-width: 700px) {
  .wpc-fr-workspace {
    grid-template-columns: 1fr;
  }
  .wpc-fr-tools {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .wpc-fr-tools > #wpc-fr-delete {
    grid-column: 1/-1;
    min-height: 44px;
  }
  .wpc-fr-canvas-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .wpc-fr-configurator {
    padding: 12px;
  }
}
@media (max-width: 430px) {
  .wpc-fr-tools {
    grid-template-columns: 1fr;
  }
}

.wpc-fr-configurator {
  width: 100%;
  flex-basis: 100%;
  text-align: left;
}
.wpc-fr-editor[hidden] {
  display: none !important;
}
.wpc-fr-canvas-wrap .canvas-container {
  width: 100% !important;
  height: 100% !important;
}
.wpc-fr-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
.wpc-fr-history {
  display: flex;
  gap: 6px;
}
.wpc-fr-tools button {
  min-height: 44px;
}
.wpc-fr-configurator select {
  height: auto;
}
.single-product form.cart:has(.wpc-fr-configurator) {
  flex-wrap: wrap;
}
.wpc-fr-tabs button[aria-selected="true"] {
  background: #0f766e;
  border-color: #0f766e;
}

.wpc-fr-launch p {
  font-size: 14px;
}
.wpc-fr-launch button,
#wpc-fr-finish {
  background: #0f766e;
  color: #fff;
  border: 0;
  border-radius: 7px;
  padding: 14px 20px;
}
.wpc-fr-modal[hidden] {
  display: none !important;
}
.wpc-fr-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #f7f8fa;
  overflow-y: auto;
  padding: 24px max(24px, calc((100vw - 1300px) / 2));
  text-align: left;
}
.wpc-fr-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #dfe4e8;
  margin-bottom: 20px;
}
.wpc-fr-modal-head h2 {
  margin: 0 0 16px;
}
.wpc-fr-modal-head button {
  background: white;
  color: #24333e;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.wpc-fr-modal .wpc-fr-workspace {
  grid-template-columns: minmax(300px, 720px) minmax(230px, 330px);
  justify-content: center;
}
.wpc-fr-modal .wpc-fr-tools {
  background: white;
  padding: 16px;
  border-radius: 10px;
}
.wpc-fr-modal input {
  color: #24333e;
  background: white;
}
.wpc-fr-modal #wpc-fr-finish {
  display: block;
  margin: 16px 0 24px auto;
}
.wpc-fr-modal .wpc-fr-canvas-wrap {
  position: relative;
  top: auto;
  touch-action: none;
}
.wpc-fr-file-label {
  position: relative;
  overflow: hidden;
}
.wpc-fr-file-label input {
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  cursor: pointer;
}
@media (max-width: 700px) {
  .wpc-fr-modal {
    padding: 12px;
  }
  .wpc-fr-modal .wpc-fr-workspace {
    grid-template-columns: 1fr;
  }
  .wpc-fr-modal .wpc-fr-tools {
    padding: 10px;
  }
  .wpc-fr-modal-head h2 {
    font-size: 18px;
  }
}

.wpc-fr-modal {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  color: #24333e;
}
.wpc-fr-modal button,
.wpc-fr-modal .button {
  font-weight: 600;
  border-radius: 6px;
  font-size: 14px;
  padding: 10px 14px;
  min-height: 42px;
}
.wpc-fr-modal select {
  border: 1px solid #cdd6dc;
  padding: 10px;
  border-radius: 6px;
  min-height: 44px;
  width: 100%;
  background: white;
  font-size: 14px;
}
.wpc-fr-modal .wpc-fr-tools > div {
  padding: 10px;
}
.wpc-fr-modal label {
  font-size: 13px;
}
.wpc-fr-tools input[type="range"] {
  width: 100%;
}
.wpc-fr-footer {
  position: sticky;
  bottom: -24px;
  background: #fff;
  box-shadow: 0 -4px 14px #24333e12;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 3;
  margin-top: 20px;
}
.wpc-fr-footer .wpc-fr-total {
  margin: 0;
  white-space: nowrap;
}
.wpc-fr-footer #wpc-fr-finish {
  margin: 0 0 0 auto;
}
.wpc-fr-footer #wpc-fr-status {
  font-size: 12px;
  margin: 0;
}
.wpc-fr-history button {
  flex: 1;
}
#wpc-fr-layers strong {
  font-size: 12px;
}
#wpc-fr-layers button {
  display: block;
  width: 100%;
  text-align: left;
  margin-top: 5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wpc-fr-tools .wpc-fr-history {
  border: 0;
  padding: 0 !important;
}
.wpc-fr-modal .wpc-fr-tools h3 {
  font-weight: 650;
}
.wpc-fr-canvas-wrap {
  align-self: start;
}
.wpc-fr-modal .wpc-fr-workspace {
  grid-template-columns: minmax(300px, 650px) minmax(230px, 330px);
}
@media (max-width: 700px) {
  .wpc-fr-modal .wpc-fr-workspace {
    grid-template-columns: 1fr;
  }
  .wpc-fr-footer {
    bottom: -12px;
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }
  .wpc-fr-footer #wpc-fr-status:empty {
    display: none;
  }
  .wpc-fr-footer #wpc-fr-finish {
    font-size: 12px;
  }
  .wpc-fr-footer .wpc-fr-total {
    font-size: 14px;
  }
  .wpc-fr-modal .wpc-fr-tools {
    display: flex;
  }
}
.wpc-fr-modal textarea {
  width: 100%;
  min-height: 70px;
  font-size: 16px;
  background: white;
  color: #24333e;
}
.wpc-fr-modal [hidden] {
  display: none !important;
}
.wpc-fr-modal .wpc-fr-tools {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}
.wpc-fr-options {
  border: 2px solid #0f766e !important;
  background: #eef9f6;
}
.wpc-fr-actions button {
  margin: 4px 0;
}
.wpc-fr-history {
  flex-wrap: wrap;
}
#wpc-fr-layers button[aria-pressed="true"] {
  background: #e0f2ee;
  border-color: #0f766e;
}
#wpc-fr-rules,
#wpc-fr-dpi {
  font-size: 12px;
  margin: 0;
  color: #805100;
}
#wpc-fr-start {
  position: absolute;
  inset: 40% 10% auto;
  text-align: center;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
}
#wpc-fr-review-content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}
#wpc-fr-review-content > p {
  width: 100%;
}
#wpc-fr-review-content article {
  max-width: 460px;
  background: white;
  padding: 18px;
  border: 1px solid #dae5e0;
}
#wpc-fr-review img {
  width: 100%;
}
#wpc-fr-crop {
  max-width: 800px;
  margin: auto;
}
.wpc-fr-crop-wrap {
  width: 100%;
  max-width: 600px;
  aspect-ratio: 4/3;
}
.wpc-fr-crop-wrap .canvas-container,
.wpc-fr-crop-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
#wpc-fr-crop-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#wpc-fr-crop-fields input {
  width: 100%;
}
#wpc-fr-draft {
  background: #fff3cd;
  padding: 15px;
  margin-bottom: 12px;
}
#wpc-fr-review > label {
  display: block;
  margin: 24px 0;
}
#wpc-fr-review-accept {
  background: #0f766e;
  color: white;
}
@media (max-width: 700px) {
  .wpc-fr-modal .wpc-fr-tools {
    max-height: none;
    overflow: visible;
  }
  .wpc-fr-options {
    order: -1;
  }
  .wpc-fr-modal .wpc-fr-workspace {
    display: flex;
    flex-direction: column;
  }
  .wpc-fr-canvas-wrap {
    width: 100%;
  }
}
#wpc-fr-configurator:not(.wpc-fr-ready) .wpc-fr-tools > :not(.wpc-fr-options) {
  display: none !important;
}
/* Scoped specificity keeps theme button resets (including Flatsome) from
   turning these controls back into unframed text. */
#wpc-fr-configurator .wpc-fr-modal button,
#wpc-fr-configurator .wpc-fr-modal .wpc-fr-file-label {
  border: 1px solid #0f766e;
  background: #eff9f6;
  color: #115e59;
  border-radius: 7px;
  padding: 10px 13px;
  min-height: 44px;
  margin: 3px 0;
  line-height: 1.35;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
  white-space: normal;
}
#wpc-fr-configurator .wpc-fr-modal button:hover {
  background: #d5eee7;
  border-color: #115e59;
}
#wpc-fr-configurator .wpc-fr-modal button:focus-visible {
  outline: 3px solid #0d9488;
  outline-offset: 3px;
}
#wpc-fr-configurator .wpc-fr-modal button:disabled {
  opacity: 0.5;
  cursor: wait;
}
#wpc-fr-configurator .wpc-fr-modal button[aria-selected="true"],
#wpc-fr-configurator .wpc-fr-modal button[aria-pressed="true"],
#wpc-fr-configurator #wpc-fr-add-text,
#wpc-fr-configurator #wpc-fr-finish,
#wpc-fr-configurator #wpc-fr-review-accept,
#wpc-fr-configurator #wpc-fr-crop-apply {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
  font-weight: 700;
}
#wpc-fr-configurator #wpc-fr-delete {
  border-color: #b91c1c;
  color: #991b1b;
  background: #fff5f5;
}
#wpc-fr-configurator .wpc-fr-tools .wpc-fr-history {
  gap: 8px;
}
#wpc-fr-configurator .wpc-fr-tools select {
  border: 1px solid #0f766e;
}
#wpc-fr-configurator.wpc-fr-cropping .wpc-fr-footer {
  display: none !important;
}
#wpc-fr-configurator .wpc-fr-crop-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-top: 2px solid #cde5de;
  box-shadow: 0 -5px 18px #0001;
  margin-top: 20px;
}
#wpc-fr-configurator #wpc-fr-crop-apply {
  margin-left: auto;
  min-height: 50px;
  padding: 14px 22px;
}
#wpc-fr-configurator #wpc-fr-crop-status {
  width: 100%;
  margin: 0;
  font-size: 13px;
}
#wpc-fr-configurator #wpc-fr-crop-status:empty {
  display: none;
}
#wpc-fr-configurator .wpc-fr-color-current {
  display: flex;
  gap: 10px;
  align-items: center;
}
#wpc-fr-configurator #wpc-fr-color-chip {
  width: 32px;
  height: 24px;
  flex-shrink: 0;
  border: 1px solid #94a3b8;
  border-radius: 4px;
}
#wpc-fr-configurator #wpc-fr-color-swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 12px 0;
}
#wpc-fr-configurator #wpc-fr-color-swatches button {
  min-height: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 1px solid #94a3b8;
  border-radius: 4px;
}
#wpc-fr-configurator #wpc-fr-color-swatches button[aria-pressed="true"] {
  outline: 3px solid #0f766e;
  outline-offset: 2px;
  box-shadow: inset 0 0 0 2px #fff;
}
#wpc-fr-configurator .wpc-fr-curve-control {
  border: 1px solid #cddfd9;
  border-radius: 7px;
  padding: 12px;
  margin-top: 16px;
}
#wpc-fr-configurator .wpc-fr-curve-control legend {
  font-size: 14px;
  font-weight: 700;
  padding: 0 5px;
}
#wpc-fr-configurator #wpc-fr-curve-value {
  width: 80px;
  min-width: 0;
  height: 44px;
  text-align: center;
  margin: 3px 0;
}
#wpc-fr-configurator .wpc-fr-tools input[type="checkbox"] {
  accent-color: #0f766e;
}
@media (max-width: 500px) {
  #wpc-fr-configurator #wpc-fr-crop-apply {
    width: 100%;
    margin-left: 0;
  }
  #wpc-fr-configurator .wpc-fr-crop-actions {
    gap: 8px;
    padding: 12px;
  }
}

#wpc-fr-configurator #wpc-fr-finish {
  margin-left: auto;
}
#wpc-fr-configurator [hidden] {
  display: none !important;
}
#wpc-fr-draft,
#wpc-fr-success {
  padding: 24px;
}
#wpc-fr-draft button,
#wpc-fr-success button,
#wpc-fr-success a {
  display: block;
  margin: 12px 0 !important;
  min-height: 48px;
}
#wpc-fr-last-preview {
  max-width: 180px;
  border-radius: 8px;
}
.wpc-fr-instructions {
  order: -2;
  border: 1px solid #9bcac4;
  background: #edf8f5;
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 18px;
  overflow-wrap: anywhere;
}
.wpc-fr-instructions ul,
.wpc-fr-instructions ol {
  padding-left: 22px;
}
.wpc-fr-quantity {
  padding: 16px;
  border: 1px solid #9bcac4;
  border-radius: 8px;
  margin: 18px 0;
}
#wpc-fr-quantity {
  display: inline-block;
  width: 90px;
  text-align: center;
  margin: 0 8px;
}
#wpc-fr-total-price {
  font-weight: bold;
  font-size: 1.2em;
}
#wpc-fr-review-accept {
  min-height: 52px;
}
#wpc-fr-rotation {
  border: 1px solid #9bcac4;
  border-radius: 8px;
  padding: 10px;
  margin: 10px 0;
}
#wpc-fr-angle {
  display: block;
  font-weight: bold;
  margin: 8px 0;
}
.wpc-fr-review-actions > label {
  display: block;
  margin: 16px 0;
}
/* Mobile: scrolling content, with actions outside the scroll area. */
@media (max-width: 700px) {
  #wpc-fr-configurator .wpc-fr-modal {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    top: var(--wpc-fr-viewport-top, 0px);
    bottom: auto;
    height: var(--wpc-fr-viewport-height, 100dvh);
    overflow: hidden;
    padding: 8px;
  }
  #wpc-fr-configurator .wpc-fr-modal-head {
    flex: 0 0 auto;
    margin-bottom: 8px;
  }
  #wpc-fr-configurator .wpc-fr-modal-head h2 {
    margin-bottom: 0;
  }
  #wpc-fr-configurator .wpc-fr-editor,
  #wpc-fr-configurator #wpc-fr-crop,
  #wpc-fr-configurator #wpc-fr-draft,
  #wpc-fr-configurator #wpc-fr-success {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-padding: 12px;
    padding-bottom: 12px;
  }
  #wpc-fr-configurator .wpc-fr-canvas-wrap {
    position: relative;
    flex-shrink: 0;
    max-width: min(100%, calc(var(--wpc-fr-viewport-height, 100dvh) * 0.42));
    margin: 0 auto;
  }
  #wpc-fr-configurator .wpc-fr-footer {
    position: relative;
    bottom: auto;
    flex: 0 0 auto;
    margin: 8px 0 0;
    gap: 6px;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
    max-height: 32%;
    overflow-y: auto;
  }
  #wpc-fr-configurator .wpc-fr-footer #wpc-fr-finish {
    margin: 0 0 0 auto;
    min-height: 44px;
  }
  #wpc-fr-configurator .wpc-fr-footer #wpc-fr-status {
    flex-basis: 100%;
    order: 2;
  }
  #wpc-fr-configurator #wpc-fr-review {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }
  #wpc-fr-configurator #wpc-fr-review > h3 {
    flex: 0 0 auto;
  }
  #wpc-fr-configurator .wpc-fr-review-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scroll-padding: 12px;
  }
  #wpc-fr-configurator .wpc-fr-review-actions {
    flex: 0 0 auto;
    padding: 8px 4px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid #cddfd9;
    background: #fff;
    max-height: 48%;
    overflow-y: auto;
  }
  #wpc-fr-configurator .wpc-fr-review-actions label {
    display: block;
  }
  #wpc-fr-configurator #wpc-fr-review-accept {
    width: 100%;
  }
  #wpc-fr-configurator .wpc-fr-instructions {
    padding: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.4;
  }
}

.wpc-fr-touch-toolbar {
  display: none;
}
@media (max-width: 700px) {
  #wpc-fr-configurator .wpc-fr-touch-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 4;
    padding: 6px;
    background: #f7f8fa;
    border-bottom: 1px solid #cddfd9;
  }
  #wpc-fr-configurator .wpc-fr-touch-toolbar button {
    flex: 1;
    font-size: 12px;
  }
  #wpc-fr-configurator #wpc-fr-touch-help {
    flex-basis: 100%;
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
  }
  #wpc-fr-configurator.wpc-fr-touch-scroll .wpc-fr-canvas-wrap {
    touch-action: pan-y;
  }
  #wpc-fr-configurator.wpc-fr-touch-scroll
    .wpc-fr-canvas-wrap
    .canvas-container,
  #wpc-fr-configurator.wpc-fr-touch-scroll .wpc-fr-canvas-wrap canvas {
    pointer-events: none;
    touch-action: pan-y;
  }
}

/* Named fields directly below the preview, on desktop and mobile. */
#wpc-fr-configurator .wpc-fr-visual-column {
  min-width: 0;
  align-self: start;
}
#wpc-fr-configurator #wpc-fr-fixed-fields {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid #cddfd9;
  border-radius: 8px;
  background: #f5faf8;
}
#wpc-fr-configurator .wpc-fr-fixed-field + .wpc-fr-fixed-field {
  margin-top: 12px;
}
#wpc-fr-configurator .wpc-fr-fixed-field label {
  display: block;
  font-weight: 600;
  margin-bottom: 5px;
}
#wpc-fr-configurator .wpc-fr-fixed-field textarea {
  width: 100%;
  min-height: 44px;
  margin: 0;
  font-size: 16px;
  resize: vertical;
}
#wpc-fr-configurator .wpc-fr-fixed-field small {
  display: block;
  margin-top: 4px;
  color: #52655e;
}
#wpc-fr-configurator [hidden] {
  display: none !important;
}
