:root {
  --upc-green: #287c2f;
  --upc-green-dark: #185e22;
  --upc-green-soft: #eef8ef;
  --upc-ink: #18221a;
  --upc-muted: #647067;
  --upc-line: #dce4dd;
  --upc-surface: #f7f9f7;
}
/* Guided customer journey. Keep desktop controls close to the picture and a single
   natural scroll surface on phones; never hide essential actions in canvas handles. */
.upc-modal .upc-guided {
  font-family: system-ui, sans-serif;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 360px);
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  gap: 0;
  overflow: auto;
  font-size: 16px;
  scroll-padding-bottom: calc(
    var(--upc-guided-footer-space, 68px) + 24px + env(safe-area-inset-bottom)
  );
}
.upc-modal .upc-guided-progress,
.upc-modal .upc-guided-screen,
.upc-modal .upc-guided-notice,
.upc-modal .upc-guided .upc-editor__footer,
.upc-modal .upc-guided .upc-editor__area-tabs {
  grid-column: 1 / -1;
}
.upc-modal .upc-guided-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--upc-line);
  background: #fff;
}
.upc-modal .upc-guided-progress span {
  font-size: 15px;
  color: #243d29;
}
.upc-modal .upc-guided button,
.upc-modal .upc-guided summary,
.upc-modal .upc-guided select,
.upc-modal .upc-guided textarea {
  min-height: 44px;
  min-width: 44px;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.35;
  border-radius: 8px;
  white-space: normal;
}
.upc-modal .upc-guided button {
  background: #fff;
  color: #173b20;
  border: 1px solid #b9cabb;
  cursor: pointer;
}
.upc-modal .upc-guided button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.upc-modal .upc-guided .upc-tool-card button {
  background: transparent;
  border: 0;
}
.upc-modal .upc-guided button:focus-visible,
.upc-modal .upc-guided summary:focus-visible {
  outline: 3px solid #1767a3;
  outline-offset: 2px;
}
.upc-modal .upc-guided button.button-primary,
.upc-modal .upc-guided button.upc-choose-photo {
  background: #287c2f;
  color: #fff;
}
.upc-modal .upc-guided .upc-editor__workspace {
  grid-column: 1;
  padding: 8px 16px;
  overflow: auto;
  min-width: 0;
}
.upc-modal .upc-guided-controls {
  grid-column: 2;
  overflow: auto;
  padding: 12px;
  background: #fff;
}
.upc-modal .upc-guided .upc-editor__library,
.upc-modal .upc-guided .upc-editor__panel {
  display: block;
  padding: 0;
  border: 0;
  overflow: visible;
}
.upc-modal .upc-stage-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 570px) 52px;
  grid-template-rows: auto auto;
  gap: 8px;
  width: min(100%, 630px);
  margin: 0 auto;
  align-items: center;
}
.upc-modal .upc-guided .upc-editor__stage {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  margin: 0;
  flex-shrink: 0;
}
.upc-modal .upc-stage-topbar {
  position: absolute;
  z-index: 7;
  top: 8px;
  left: 8px;
  right: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}
.upc-modal .upc-rotate-tools {
  display: flex;
  gap: 6px;
}
.upc-modal .upc-rotate-tools button {
  padding: 6px;
  font-size: 24px;
  line-height: 1;
}
.upc-modal .upc-preview-primary {
  margin-left: auto;
  background: var(--upc-green) !important;
  color: #fff !important;
  font-weight: 700;
}
.upc-modal .upc-zoom-tools {
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
}
.upc-modal .upc-zoom-symbol {
  font-size: 22px;
  line-height: 1;
  color: #173b20;
}
.upc-modal .upc-zoom-slider {
  width: 180px;
  min-width: 0 !important;
  height: 24px;
  padding: 0 !important;
  accent-color: var(--upc-green);
  transform: rotate(-90deg);
}
.upc-modal .upc-guided-side {
  font-size: 19px;
  margin: 0 0 8px;
}
.upc-modal .upc-guided .upc-editor__toolbar {
  grid-column: 1 / -1;
  grid-row: 2;
  gap: 6px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.upc-modal .upc-adjustments {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: center;
}
.upc-modal .upc-adjustments button:not(.upc-replace-photo),
.upc-modal .upc-guided .upc-editor__toolbar [data-upc-undo],
.upc-modal .upc-guided .upc-editor__toolbar [data-upc-redo] {
  padding: 6px;
  font-size: 22px;
  line-height: 1;
}
.upc-modal .upc-guided .upc-editor__messages {
  margin: 6px 0;
  font-size: 15px;
}
.upc-modal .upc-guided .upc-editor__validation,
.upc-modal .upc-guided .upc-editor__save-status {
  font-size: 14px;
  padding: 6px 10px;
}
.upc-modal .upc-guided .upc-editor__validation:not(.has-errors) {
  display: none;
}
.upc-modal .upc-guided .upc-editor__panel > h3,
.upc-modal .upc-guided [data-upc-standard-tools] > h3,
.upc-modal .upc-guided [data-upc-standard-tools] > .upc-editor__hint,
.upc-modal .upc-guided .upc-editor__selection,
.upc-modal .upc-guided .upc-editor__empty,
.upc-modal .upc-guided .upc-editor__transform-help,
.upc-modal .upc-guided .upc-editor__details,
.upc-modal .upc-guided .upc-mode-picker,
.upc-modal .upc-guided [data-upc-center-x],
.upc-modal .upc-guided [data-upc-center-y] {
  display: none;
}
.upc-modal .upc-guided-screen {
  padding: 20px;
  overflow: auto;
  scroll-padding-bottom: calc(
    var(--upc-guided-footer-space, 68px) + 24px + env(safe-area-inset-bottom)
  );
}
.upc-modal .upc-guided-screen-body {
  box-sizing: border-box;
}
.upc-modal .upc-review-bottom-space {
  display: block;
  width: 100%;
  height: calc(var(--upc-guided-footer-space, 68px) + 120px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.upc-modal .upc-guided-heading {
  font-size: 24px;
  margin: 0 0 18px;
}
.upc-modal .upc-guided-screen-body > button {
  margin: 8px;
}
.upc-modal .upc-choice-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}
.upc-modal .upc-choice-cards.has-five {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.upc-modal .upc-choice-cards.has-five .upc-choice-card {
  grid-column: span 2;
}
.upc-modal .upc-choice-cards.has-five .upc-choice-card:nth-child(4) {
  grid-column: 2 / span 2;
}
.upc-modal .upc-choice-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  text-align: center;
}
.upc-modal .upc-choice-card strong {
  font-size: 20px;
}
.upc-modal .upc-choice-card b {
  margin-top: auto;
}
.upc-modal .upc-choice-sample {
  display: grid;
  place-content: center;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e5e8e6, #fff, #d9ddda);
  border: 2px solid #9ca79e;
  color: #202b22;
  font-size: 24px;
}
.upc-modal .upc-stage-upload {
  position: absolute;
  z-index: 5;
  inset: 38% 22%;
  box-shadow: 0 2px 12px #0003;
}
.upc-modal .upc-text.is-placeholder {
  fill: #294f31;
  opacity: 0.78;
  font-style: italic;
}
.upc-modal .upc-guided-notice {
  padding: 8px 16px;
  margin: 0;
  color: #852020;
  background: #fff7ed;
}
.upc-modal .upc-guided-notice:empty {
  display: none;
}
.upc-modal .upc-guided .upc-editor__footer {
  position: sticky;
  bottom: 0;
  z-index: 9;
  background: #fff;
  padding: 10px 16px;
  min-height: 68px;
}
.upc-modal .upc-guided .upc-editor__footer small {
  font-size: 14px;
}
.upc-modal .upc-guided[data-step='review'] {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.upc-modal .upc-guided[data-step='review'] .upc-guided-screen {
  flex: 0 0 auto;
  overflow: visible;
}
.upc-modal .upc-guided[data-step='review'] .upc-review-bottom-space {
  height: 32px;
}
.upc-modal .upc-guided[data-step='review'] .upc-editor__footer {
  position: static;
  flex: 0 0 auto;
  align-self: center;
  width: min(calc(100% - 32px), 540px);
  min-height: 76px;
  margin: 0 auto max(28px, env(safe-area-inset-bottom));
  padding: 12px 16px;
  border: 1px solid var(--upc-line);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(24, 34, 26, 0.12);
  background: #fff;
  justify-content: space-between;
}
.upc-modal .upc-review-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.upc-modal .upc-review-card {
  text-align: center;
  padding: 12px;
  border: 1px solid var(--upc-line);
  border-radius: 12px;
}
.upc-modal .upc-review-card img {
  width: 100%;
  max-width: 360px;
  display: block;
  margin: auto;
}
.upc-modal .upc-review-total {
  font-size: 20px;
  font-weight: 700;
}
.upc-modal .upc-review-consent {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--upc-line);
  cursor: pointer;
  scroll-margin-bottom: calc(
    var(--upc-guided-footer-space, 68px) + 24px + env(safe-area-inset-bottom)
  );
}
.upc-modal .upc-review-consent input {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
.upc-modal .upc-background-removal {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #b9d9bc;
  border-radius: 10px;
  background: var(--upc-green-soft);
  cursor: pointer;
}
.upc-modal .upc-background-removal input {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
}
.upc-modal .upc-background-removal strong,
.upc-modal .upc-background-removal span {
  display: block;
}
.upc-modal .upc-background-removal span {
  margin-top: 4px;
}
.upc-modal .upc-font-choices {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}
.upc-modal .upc-font-choices [aria-pressed='true'] {
  border: 2px solid #287c2f;
  background: #eef8ef;
}
.upc-modal .upc-guided textarea {
  width: 100%;
}
.upc-modal .upc-guided [data-upc-text-form] > p,
.upc-modal .upc-guided [data-upc-design-form] > p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
}
.upc-modal .upc-guided [data-upc-text-form] > p button,
.upc-modal .upc-guided [data-upc-design-form] > p button {
  margin: 0;
}
.upc-modal .upc-guided [data-upc-text-form] label,
.upc-modal .upc-guided [data-upc-design-form] label {
  display: block;
  width: 100%;
}
.upc-modal .upc-guided summary {
  cursor: pointer;
  margin-top: 8px;
}
.upc-entry [hidden],
.upc-personalized-sides[hidden] {
  display: none !important;
}
.upc-gallery-with-sides {
  display: flex !important;
  flex-direction: column !important;
  min-width: 0;
  max-width: 100%;
}
.upc-gallery-with-sides img[data-upc-original-src] {
  max-width: 100%;
  height: auto;
}
.product .upc-personalized-sides {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  align-self: stretch;
  overflow-x: auto;
  gap: 8px;
  margin: 0 0 10px;
  padding: 3px;
  width: 100%;
  box-sizing: border-box;
}
.product .upc-personalized-sides button {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  align-self: flex-start;
  justify-content: center;
  gap: 4px;
  width: auto;
  height: auto;
  min-height: 44px;
  max-width: 140px;
  margin: 0;
  border-radius: 8px;
  font:
    14px/1.2 system-ui,
    sans-serif;
  white-space: normal;
  border: 1px solid #287c2f;
  background: #fff;
  color: #173b20;
  padding: 8px;
  cursor: pointer;
}
.product .upc-personalized-sides img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  display: block;
  position: static;
}
.upc-personalized-sides [aria-pressed='true'] {
  outline: 2px solid #287c2f;
}
.upc-modal .upc-inline-text {
  position: absolute;
  z-index: 5;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform-origin: center;
}
.upc-modal .upc-inline-text textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  outline: 1px dotted #287c2f;
  box-shadow: none;
  font-weight: normal;
  color: #111827;
  caret-color: #111827;
  background: transparent;
  resize: none;
  overflow: hidden;
}
@media (max-width: 760px) {
  .upc-modal .upc-modal__dialog {
    overflow: hidden;
    max-width: 100vw;
  }
  .upc-modal .upc-guided,
  .upc-modal .upc-guided * {
    box-sizing: border-box;
  }
  .upc-modal .upc-guided {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }
  .upc-modal .upc-guided-progress {
    order: 0;
    flex-shrink: 0;
    padding: 4px 8px;
  }
  .upc-modal .upc-guided-progress span {
    font-size: 13px;
  }
  .upc-modal .upc-guided .upc-editor__area-tabs {
    order: 1;
    flex: 0 0 auto;
  }
  .upc-modal .upc-guided-screen {
    order: 2;
    flex: 1 0 auto;
    padding: 12px 6px;
  }
  .upc-modal .upc-guided-heading {
    margin-inline: 6px;
  }
  .upc-modal .upc-guided .upc-editor__workspace {
    order: 2;
    min-height: 0;
    overflow: visible;
    padding: 6px;
    flex: 0 0 auto;
  }
  .upc-modal .upc-stage-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    width: 100%;
    gap: 6px;
  }
  .upc-modal .upc-guided .upc-editor__stage {
    grid-column: 1;
    grid-row: 1;
    width: min(100%, 48dvh);
    justify-self: center;
  }
  .upc-modal .upc-stage-topbar {
    right: 8px;
  }
  .upc-modal .upc-zoom-tools {
    grid-column: 1;
    grid-row: 2;
    align-self: auto;
    flex-direction: row-reverse;
    min-height: 44px;
  }
  .upc-modal .upc-zoom-slider {
    width: min(68vw, 280px);
    transform: none;
  }
  .upc-modal .upc-guided .upc-editor__toolbar {
    grid-column: 1;
    grid-row: 3;
  }
  .upc-modal .upc-guided-controls {
    order: 3;
    flex: 0 0 auto;
    overflow: visible;
    padding: 8px 12px;
  }
  .upc-modal .upc-guided-notice {
    order: 4;
  }
  .upc-modal .upc-guided .upc-editor__footer {
    order: 5;
    flex-shrink: 0;
    margin-top: auto;
  }
  .upc-modal .upc-choice-cards {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }
  .upc-modal .upc-choice-cards.has-five {
    grid-template-columns: 1fr;
  }
  .upc-modal .upc-choice-cards.has-five .upc-choice-card,
  .upc-modal .upc-choice-cards.has-five .upc-choice-card:nth-child(4) {
    grid-column: 1;
  }
  .upc-modal .upc-choice-card {
    display: grid;
    grid-template-columns: 60px 1fr;
    gap: 4px 12px;
    text-align: left;
    padding: 12px;
    width: 100%;
  }
  .upc-modal .upc-choice-sample {
    grid-row: span 3;
    width: 60px;
    height: 60px;
    font-size: 14px;
  }
  .upc-modal .upc-choice-card strong {
    font-size: 18px;
  }
  .upc-modal .upc-choice-card b {
    font-size: 15px;
  }
  .upc-modal .upc-review-gallery {
    grid-template-columns: 1fr;
  }
}
.upc-entry {
  clear: both;
  margin: 0 0 1.25rem;
}
.upc-entry__button {
  min-height: 52px;
  width: 100%;
}
.upc-entry__summary {
  color: var(--upc-ink);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0.75rem 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.upc-entry__complete {
  align-items: center;
  background: var(--upc-green-soft);
  border: 1px solid #b9d9bc;
  border-radius: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr auto;
  margin-top: 10px;
  padding: 12px;
}
.upc-entry__complete small {
  color: var(--upc-muted);
  display: block;
  margin-top: 2px;
}
.upc-entry__check {
  align-items: center;
  background: var(--upc-green);
  border-radius: 50%;
  color: #fff;
  display: flex;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  width: 32px;
}
.upc-entry__edit {
  background: transparent;
  border: 0;
  color: var(--upc-green-dark);
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
}
.upc-entry__actions {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.upc-entry__remove {
  background: transparent;
  border: 0;
  color: #9f1d1d;
  cursor: pointer;
  font-size: 0.82rem;
  text-decoration: underline;
}
.upc-entry__breakdown {
  color: var(--upc-ink);
  display: block;
  font-size: 0.78rem;
  margin-top: 5px;
}
form.cart .single_add_to_cart_button.upc-purchase-locked {
  cursor: not-allowed;
  filter: grayscale(0.55);
  opacity: 0.55;
}
.upc-modal[hidden],
.upc-modal [hidden] {
  display: none !important;
}
.upc-modal {
  inset: 0;
  width: 100vw;
  height: 100dvh;
  position: fixed;
  z-index: 100000;
}
.upc-modal__backdrop {
  background: rgba(15, 23, 42, 0.72);
  inset: 0;
  position: absolute;
}
.upc-modal__dialog {
  font-family: system-ui, sans-serif;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  inset: max(8px, 1.2vh) max(8px, 1vw);
  overflow: hidden;
  position: absolute;
}
.upc-modal__header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--upc-line);
  color: var(--upc-ink);
  display: flex;
  flex: 0 0 auto;
  justify-content: space-between;
  min-height: 42px;
  padding: 7px 18px;
}
.upc-modal__header h2,
.upc-modal__eyebrow {
  margin: 0;
}
.upc-modal__header h2 {
  font-size: clamp(1.1rem, 1.6vw, 1.4rem);
}
.upc-modal__eyebrow {
  color: var(--upc-green);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.upc-modal__close {
  background: var(--upc-surface);
  border: 0;
  border-radius: 50%;
  color: var(--upc-ink);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  min-height: 34px;
  min-width: 34px;
}
.upc-modal :focus-visible,
.upc-entry__button:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}
.upc-modal__status {
  padding: 3rem;
  text-align: center;
}
.upc-modal__error {
  background: #fef2f2;
  border-left: 4px solid #b91c1c;
  padding: 16px;
}
.upc-editor {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(240px, 290px) minmax(440px, 1fr) minmax(290px, 350px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}
.upc-editor__area-tabs {
  background: #fff;
  border-bottom: 1px solid var(--upc-line);
  display: flex;
  gap: 8px;
  grid-column: 1 / -1;
  overflow-x: auto;
  padding: 6px 14px;
}
.upc-editor__area-tabs:empty {
  display: none;
}
.upc-editor__area-tabs button {
  background: var(--upc-surface);
  border: 1px solid var(--upc-line);
  border-radius: 999px;
  color: var(--upc-ink);
  cursor: pointer;
  font-weight: 700;
  min-height: 32px;
  padding: 5px 13px;
  white-space: nowrap;
}
.upc-editor__area-tabs button[aria-selected='true'] {
  background: var(--upc-green);
  border-color: var(--upc-green);
  color: #fff;
}
.upc-editor__library,
.upc-editor__panel {
  min-height: 0;
  overflow-y: auto;
  padding: 20px;
}
.upc-editor__library {
  background: var(--upc-surface);
  border-right: 1px solid var(--upc-line);
}
.upc-editor__panel {
  border-left: 1px solid var(--upc-line);
}
.upc-editor__library h3,
.upc-editor__panel h3 {
  color: var(--upc-ink);
  font-size: 1rem;
  margin: 22px 0 6px;
}
.upc-editor__hint {
  color: var(--upc-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  margin: 0 0 14px;
}
.upc-tool-card {
  align-items: center;
  background: #fff;
  border: 1px solid var(--upc-line);
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(24, 34, 26, 0.05);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto 1fr;
  padding: 12px;
  position: relative;
  transition: 0.15s ease;
}
.upc-tool-card:hover {
  border-color: var(--upc-green);
  box-shadow: 0 4px 14px rgba(40, 124, 47, 0.12);
  transform: translateY(-1px);
}
.upc-tool-card__icon {
  align-items: center;
  background: var(--upc-green-soft);
  border-radius: 9px;
  color: var(--upc-green-dark);
  display: flex;
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 800;
  height: 42px;
  justify-content: center;
  width: 42px;
}
.upc-tool-card small {
  color: var(--upc-muted);
  display: block;
  font-size: 0.84rem;
}
.upc-tool-card button {
  background: transparent;
  border: 0;
  cursor: pointer;
  inset: 0;
  position: absolute;
}
.upc-editor__workspace {
  background: #eef1ee;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 8px 12px 12px;
}
.upc-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: center;
  margin-bottom: 6px;
}
.upc-editor__toolbar .button {
  background: #fff;
  border: 1px solid var(--upc-line);
  border-radius: 8px;
  color: var(--upc-ink);
  font-size: 0.84rem;
  line-height: 1.1;
  min-height: 32px;
  padding: 0 10px;
}
.upc-editor__messages {
  display: grid;
  gap: 7px;
  margin: 0 auto 6px;
  max-width: 820px;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 4;
}
.upc-editor__stage {
  aspect-ratio: 1;
  background-color: #fff;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  border: 1px solid #cfd8d0;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(24, 34, 26, 0.1);
  flex: 0 0 auto;
  margin: auto;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  width: min(100%, 820px, calc(100vh - 225px));
}
.upc-editor__stage img {
  height: 100%;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 100%;
}
.upc-editor__stage svg {
  height: 100%;
  inset: 0;
  overflow: visible;
  position: absolute;
  touch-action: none;
  width: 100%;
}
.upc-area {
  fill: rgba(14, 116, 144, 0.1);
  stroke: #087a9c;
  stroke-dasharray: 2 1;
  stroke-width: 0.65;
  vector-effect: non-scaling-stroke;
}
.upc-guides {
  pointer-events: none;
}
.upc-exclusion {
  fill: rgba(220, 38, 38, 0.25);
  stroke: #dc2626;
  stroke-width: 0.55;
  vector-effect: non-scaling-stroke;
}
.upc-text {
  cursor: grab;
  fill: #111827;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 0.12;
  user-select: none;
}
.upc-design {
  cursor: grab;
  overflow: visible;
}
.upc-hitbox {
  cursor: grab;
  fill: transparent;
  pointer-events: all;
}
.upc-transform-controls {
  pointer-events: none;
}
.upc-selection-box {
  fill: none;
  pointer-events: none;
  stroke: #2563eb;
  stroke-dasharray: 1.3 0.7;
  stroke-width: 0.38;
  vector-effect: non-scaling-stroke;
}
.upc-rotation-stem {
  pointer-events: none;
  stroke: #2563eb;
  stroke-width: 0.38;
  vector-effect: non-scaling-stroke;
}
.upc-transform-handle {
  fill: #fff;
  pointer-events: all;
  stroke: #2563eb;
  stroke-width: 0.45;
  vector-effect: non-scaling-stroke;
}
.upc-transform-handle--resize {
  cursor: nwse-resize;
}
.upc-transform-handle--rotate {
  cursor: grab;
}
.upc-rotation-icon {
  dominant-baseline: central;
  fill: #2563eb;
  font-family: Arial, sans-serif;
  font-size: 2.25px;
  font-weight: 700;
  pointer-events: none;
  text-anchor: middle;
}
.upc-text.is-selected,
.upc-design.is-selected {
  filter: drop-shadow(0 0 1.5px #1d4ed8);
  outline: none;
  stroke: #1d4ed8;
  stroke-width: 0.25;
}
.upc-editor__stage.is-preview .upc-text,
.upc-editor__stage.is-preview .upc-design {
  cursor: default;
}
.upc-editor__validation {
  background: var(--upc-green-soft);
  border-radius: 8px;
  color: var(--upc-green-dark);
  font-size: 0.94rem;
  line-height: 1.4;
  margin: 0;
  padding: 6px 10px;
  width: 100%;
}
.upc-editor__validation.has-errors {
  background: #fef2f2;
  color: #991b1b;
}
.upc-editor__save-status {
  background: #fff;
  border: 1px solid var(--upc-line);
  border-radius: 8px;
  color: #536056;
  font-size: 0.9rem;
  min-height: 27px;
  padding: 4px 9px;
}
.upc-editor__save-status:empty {
  display: none;
}
.upc-editor__save-status.has-errors {
  background: #fff7ed;
  border-color: #fdba74;
  color: #9a3412;
}
.upc-editor__transform-help {
  background: var(--upc-green-soft);
  border-radius: 8px;
  color: var(--upc-green-dark);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 10px 12px;
}
.upc-editor__panel label {
  color: var(--upc-ink);
  display: grid;
  font-size: 0.9rem;
  font-weight: 650;
  gap: 5px;
  margin-bottom: 12px;
}
.upc-editor__panel input,
.upc-editor__panel select,
.upc-editor__panel textarea,
.upc-search input {
  background: #fff;
  border: 1px solid #cbd5cc;
  border-radius: 8px;
  box-sizing: border-box;
  font: inherit;
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}
.upc-editor__panel textarea {
  min-height: 88px;
  resize: vertical;
}
.upc-editor__numbers {
  display: grid;
  gap: 0 10px;
  grid-template-columns: 1fr 1fr;
}
.upc-editor__selection {
  color: var(--upc-green-dark);
  font-size: 0.9rem;
  font-weight: 700;
}
.upc-editor__empty {
  align-items: center;
  background: var(--upc-surface);
  border: 1px dashed #bdc9be;
  border-radius: 10px;
  color: var(--upc-muted);
  display: flex;
  flex-direction: column;
  padding: 24px 14px;
  text-align: center;
}
.upc-editor__empty span {
  color: var(--upc-green);
  font-size: 1.5rem;
}
.upc-button-danger {
  color: #b91c1c !important;
}
.upc-design-library {
  margin-top: 8px;
}
.upc-design-library__items {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
  min-height: 60px;
}
.upc-design-library__item {
  align-items: center;
  background: #fff;
  border: 1px solid var(--upc-line);
  border-radius: 10px;
  color: var(--upc-ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  gap: 4px;
  justify-content: center;
  min-height: 84px;
  padding: 7px;
  transition: 0.15s ease;
}
.upc-design-library__item:hover,
.upc-design-library__item:focus-visible {
  border-color: var(--upc-green);
  box-shadow: 0 4px 12px rgba(40, 124, 47, 0.12);
  transform: translateY(-1px);
}
.upc-design-library__item svg {
  height: 46px;
  pointer-events: none;
  width: 46px;
}
.upc-design-library__pages {
  align-items: center;
  display: flex;
  justify-content: space-between;
}
.upc-design-library__pages .button {
  border-radius: 50%;
  min-height: 36px;
  min-width: 36px;
  padding: 0;
}
.upc-editor__panel dt {
  color: var(--upc-muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}
.upc-editor__panel dd {
  margin: 0 0 0.7rem;
}
.upc-editor__details {
  border-top: 1px solid var(--upc-line);
  margin-top: 18px;
  padding-top: 12px;
}
.upc-editor__details summary {
  color: var(--upc-muted);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
}
.upc-editor__footer {
  align-items: center;
  background: #fff;
  border-top: 1px solid var(--upc-line);
  display: flex;
  grid-column: 1/-1;
  justify-content: flex-end;
  gap: 22px;
  padding: 12px 22px;
}
.upc-editor__footer small {
  color: var(--upc-muted);
  display: block;
  font-size: 0.8rem;
}
.upc-editor__footer strong {
  color: var(--upc-ink);
  font-size: 1.15rem;
}
.upc-editor__footer .button-primary {
  background: var(--upc-green);
  border: 0;
  border-radius: 9px;
  color: #fff;
  min-height: 46px;
  padding: 0 22px;
}
.upc-editor__footer .button-primary:hover {
  background: var(--upc-green-dark);
}
.upc-context-menu {
  background: #fff;
  border: 1px solid var(--upc-line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  min-width: 180px;
  padding: 6px;
  position: fixed;
  z-index: 100003;
}
.upc-context-menu button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--upc-ink);
  cursor: pointer;
  display: block;
  padding: 9px 11px;
  text-align: left;
  width: 100%;
}
.upc-context-menu button:hover,
.upc-context-menu button:focus {
  background: var(--upc-green-soft);
}
.upc-context-menu button.is-danger {
  color: #b91c1c;
}
body.upc-modal-open {
  overflow: hidden;
}
.upc-mode-picker {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}
.upc-mode-picker button {
  background: #fff;
  border: 1px solid var(--upc-line);
  border-radius: 10px;
  color: var(--upc-ink);
  cursor: pointer;
  min-height: 70px;
  padding: 10px;
  text-align: left;
}
.upc-mode-picker button.is-active {
  background: var(--upc-green-soft);
  border-color: var(--upc-green);
  box-shadow: inset 0 0 0 1px var(--upc-green);
}
.upc-mode-picker small,
.upc-tool-card small {
  color: var(--upc-muted);
  display: block;
  margin-top: 4px;
}
.upc-customer-dropzone {
  align-items: center;
  background: #fff;
  border: 2px dashed #8aa58e;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  min-height: 130px;
  padding: 16px;
  text-align: center;
}
.upc-customer-dropzone:hover,
.upc-customer-dropzone:focus-within {
  background: var(--upc-green-soft);
  border-color: var(--upc-green);
}
.upc-customer-dropzone input {
  margin-top: 8px;
  max-width: 100%;
}
.upc-upload-disclaimer {
  background: #fff9e8;
  border: 1px solid #ead9a2;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 12px 0;
  padding: 12px;
}
.upc-upload-disclaimer ul {
  margin: 7px 0 10px 18px;
  padding: 0;
}
.upc-upload {
  cursor: move;
  filter: grayscale(1) contrast(1.15);
}
[dir='rtl'] .upc-editor__library {
  border-left: 1px solid var(--upc-line);
  border-right: 0;
}
[dir='rtl'] .upc-editor__panel {
  border-left: 0;
  border-right: 1px solid var(--upc-line);
}
@media (max-width: 980px) {
  .upc-editor {
    grid-template-columns: 200px minmax(320px, 1fr) 260px;
  }
  .upc-editor__library,
  .upc-editor__panel {
    padding: 14px;
  }
}
@media (max-width: 760px) {
  .upc-modal__dialog {
    border-radius: 0;
    inset: 0;
    overflow-y: auto;
  }
  .upc-editor {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .upc-editor__library {
    border-bottom: 1px solid var(--upc-line);
    border-right: 0;
    overflow: visible;
    order: 2;
  }
  .upc-editor__workspace {
    min-height: 520px;
    order: 1;
  }
  .upc-editor__panel {
    border-left: 0;
    border-top: 1px solid var(--upc-line);
    overflow: visible;
    order: 3;
  }
  .upc-editor__footer {
    bottom: 0;
    order: 4;
    position: sticky;
    z-index: 2;
  }
  .upc-design-library__items {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .upc-editor__stage {
    width: min(100%, 700px);
  }
}
@media (max-width: 480px) {
  .upc-modal__header {
    padding: 12px 14px;
  }
  .upc-editor__workspace {
    min-height: 430px;
    padding: 10px;
  }
  .upc-editor__toolbar .button {
    font-size: 0.75rem;
    padding: 0 8px;
  }
  .upc-design-library__items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .upc-editor__footer {
    gap: 12px;
    justify-content: space-between;
    padding: 10px 12px;
  }
  .upc-editor__footer .button-primary {
    padding: 0 13px;
  }
  .upc-entry__complete {
    grid-template-columns: auto 1fr;
  }
  .upc-entry__edit {
    grid-column: 2;
    text-align: left;
  }
}
@media (forced-colors: active) {
  .upc-area,
  .upc-exclusion,
  .upc-text.is-selected,
  .upc-design.is-selected {
    forced-color-adjust: auto;
    stroke: CanvasText;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .upc-modal__dialog {
    animation: upc-enter 0.18s ease-out;
  }
  @keyframes upc-enter {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
  }
}
