.ecp-dtf-app {
  --blue: #243b93;
  --purple: #7642e7;
  --purple-dark: #6331d2;
  --red: #e52525;
  --ink: #1e2028;
  --muted: #7d8494;
  --line: #dbe1ec;
  --panel: #f4f6fc;
  --soft: #eef1fb;
  --paper: #ffffff;
  position: relative;
  display: grid;
  grid-template-rows: 66px minmax(660px, calc(100vh - 130px)) 56px;
  overflow: hidden;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

.ecp-dtf-app * {
  box-sizing: border-box;
}

.ecp-dtf-product-builder {
  margin: 16px 0;
}

.ecp-dtf-product-builder .ecp-dtf-build-button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  padding: 16px 22px !important;
  border: 2px solid #f97316 !important;
  border-radius: 7px !important;
  background: #f97316 !important;
  color: #ffffff !important;
  font-size: 18px !important;
  font-weight: 900 !important;
  letter-spacing: 0 !important;
  line-height: 1.15 !important;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 8px 18px rgba(249, 115, 22, 0.25);
}

.ecp-dtf-product-builder .ecp-dtf-build-button:hover {
  background: #ea580c !important;
  border-color: #ea580c !important;
  color: #ffffff !important;
}

body.ecp-dtf-builder-page footer:not(.ecp-dtf-bottombar),
body.ecp-dtf-builder-page .site-footer,
body.ecp-dtf-builder-page #colophon,
body.ecp-dtf-builder-page .footer,
body.ecp-dtf-builder-page .main-footer,
body.ecp-dtf-builder-page .elementor-location-footer {
  display: none !important;
}

.ecp-dtf-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.ecp-dtf-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 290px;
  margin-right: auto;
}

.ecp-brand-logo {
  width: 54px;
  height: 42px;
  display: block;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

.ecp-dtf-brand strong,
.ecp-dtf-brand span {
  display: block;
}

.ecp-dtf-brand span,
.ecp-status,
.ecp-upload-card small {
  color: var(--muted);
  font-size: 12px;
}

.ecp-btn,
.ecp-icon-btn,
.ecp-layer,
.ecp-asset,
.ecp-link-action {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 7px;
  min-height: 36px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

.ecp-btn:hover,
.ecp-icon-btn:hover,
.ecp-layer:hover,
.ecp-asset:hover,
.ecp-link-action:hover {
  border-color: var(--blue);
}

.ecp-btn.primary,
.ecp-btn.auto,
.ecp-btn.ai {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
  font-weight: 700;
}

.ecp-btn.ai {
  width: 100%;
  margin: 0 0 10px;
  background: linear-gradient(90deg, var(--purple), #2785ff);
  border: 0;
}

.ecp-btn.effect {
  width: 100%;
  margin: 0 0 8px;
  background: #111827;
  color: #fff;
  border-color: #111827;
  font-weight: 700;
}

.ecp-btn.effect:hover {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}

.ecp-btn.pill {
  border-radius: 999px;
  background: var(--purple);
  border-color: var(--purple);
}

.ecp-btn.outline {
  background: #fff;
  color: var(--purple);
  border-color: #bda7ff;
}

.ecp-btn.danger,
.ecp-btn.danger-fill {
  border-color: var(--red);
  color: var(--red);
}

.ecp-btn.danger-fill {
  background: var(--red);
  color: white;
  font-weight: 700;
}

.ecp-qty,
.ecp-dtf-size,
.ecp-live-price {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ecp-qty input,
.ecp-dtf-size select,
.ecp-stage-controls select,
.ecp-stage-controls input[type="number"],
.ecp-dtf-bottombar select,
.ecp-inspector input,
.ecp-active-sheet input {
  border: 1px solid var(--line);
  border-radius: 5px;
  min-height: 32px;
  padding: 5px 8px;
  background: white;
}

.ecp-qty input {
  width: 64px;
}

.ecp-live-price {
  margin-left: 10px;
  font-size: 14px;
}

.ecp-live-price span {
  font-size: 18px;
}

.ecp-dtf-workspace {
  display: grid;
  grid-template-columns: 62px 320px minmax(460px, 1fr) 290px;
  min-height: 0;
}

.ecp-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 5px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.ecp-rail button {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 58px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.ecp-rail button span {
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.ecp-rail button.active,
.ecp-rail button:hover {
  background: var(--blue);
  color: white;
}

.ecp-dtf-left,
.ecp-dtf-right {
  min-height: 0;
  overflow: auto;
  background: #fff;
}

.ecp-dtf-left {
  padding: 10px;
  border-right: 1px solid var(--line);
}

.ecp-dtf-right {
  border-left: 1px solid var(--line);
  padding: 14px 10px;
}

.ecp-upload-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-height: 126px;
  padding: 14px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fff;
}

.ecp-upload-card p {
  margin: 0;
}

.ecp-search {
  width: 100%;
  min-height: 34px;
  margin: 10px 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 7px 9px;
}

.ecp-dtf-left h2,
.ecp-inspector h2,
.ecp-layers h2 {
  margin: 10px 0 8px;
  font-size: 13px;
}

.ecp-asset-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.ecp-asset {
  display: grid;
  gap: 6px;
  padding: 6px;
  min-width: 0;
}

.ecp-asset img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid #cfd6e3;
  border-radius: 4px;
  background:
    linear-gradient(45deg, #d8d8d8 25%, transparent 25%),
    linear-gradient(-45deg, #d8d8d8 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d8d8d8 75%),
    linear-gradient(-45deg, transparent 75%, #d8d8d8 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.ecp-asset span,
.ecp-active-sheet small {
  overflow: hidden;
  color: #4b5565;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.ecp-empty-edit {
  display: grid;
  place-items: center;
  gap: 18px;
  min-height: 210px;
  margin-top: 22px;
  color: var(--ink);
  text-align: center;
  border-top: 1px solid var(--line);
}

.ecp-cursor-art {
  width: 130px;
  height: 130px;
  display: grid;
  place-items: center;
  color: #e4e8f0;
  font-size: 22px;
  font-weight: 800;
  border: 1px solid #edf0f6;
  border-radius: 6px;
}

.ecp-inspector {
  display: none;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ecp-dtf-app.has-selection .ecp-inspector {
  display: block;
}

.ecp-tool-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.ecp-inspector label {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
  font-size: 12px;
}

.ecp-dtf-stage {
  position: relative;
  display: grid;
  grid-template-rows: auto 28px minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
  background: #fff;
}

.ecp-stage-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 50px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.ecp-stage-controls label,
.ecp-dtf-bottombar label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
}

.ecp-margin-control input[type="number"] {
  width: 70px;
}

.ecp-ruler-x {
  position: relative;
  height: 28px;
  border-bottom: 1px solid var(--line);
  background:
    repeating-linear-gradient(90deg, transparent 0 17px, var(--blue) 17px 18px),
    #fbfcff;
  color: #44516a;
  font-size: 10px;
}

.ecp-ruler-x span {
  position: absolute;
  bottom: 12px;
  transform: translateX(-50%);
}

.ecp-canvas-shell {
  position: relative;
  min-height: 0;
  overflow: auto;
  padding: 84px 80px 130px;
  background: #fff;
}

.ecp-canvas-shell canvas {
  display: block;
  margin: 0 auto;
  border: 1px dashed #2688ca;
  box-shadow: none;
  transform-origin: top center;
  touch-action: none;
}

.ecp-generate-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: #5f7fa7;
  background: #fff;
}

.ecp-mode-generate .ecp-generate-empty {
  display: grid;
}

.ecp-generate-empty p {
  margin: 0;
  font-size: 20px;
}

.ecp-generate-empty span {
  color: #111;
  font: 700 12px "Comic Sans MS", cursive;
  transform: rotate(-5deg);
}

.ecp-auto-note {
  color: var(--muted);
}

.ecp-auto-build {
  position: absolute;
  left: 72px;
  bottom: 16px;
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.ecp-active-sheet {
  display: grid;
  gap: 8px;
  padding: 12px;
  margin-bottom: 18px;
  border: 1px solid var(--blue);
  border-radius: 5px;
}

.ecp-active-sheet strong,
.ecp-active-sheet span {
  display: block;
}

.ecp-active-sheet label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ecp-active-sheet input {
  width: 64px;
}

.ecp-active-sheet button,
.ecp-link-action {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: #111827;
  padding: 7px 2px;
}

.ecp-layer {
  display: block;
  width: 100%;
  margin-bottom: 6px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecp-layer.active {
  border-color: var(--blue);
  box-shadow: inset 3px 0 0 var(--blue);
}

.ecp-dtf-bottombar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f7f8fd;
  border-top: 1px solid var(--line);
}

.ecp-status {
  min-width: 160px;
}

.ecp-dtf-app.has-warning .ecp-status::before {
  content: "Boundary warning ";
  color: var(--red);
  font-weight: 700;
}

@media (max-width: 1160px) {
  .ecp-dtf-app {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }

  .ecp-dtf-topbar {
    flex-wrap: wrap;
  }

  .ecp-dtf-brand {
    min-width: 100%;
  }

  .ecp-dtf-workspace {
    grid-template-columns: 58px minmax(240px, 300px) minmax(380px, 1fr);
  }

  .ecp-dtf-right {
    grid-column: 2 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 760px) {
  .ecp-dtf-app {
    overflow: visible;
  }

  .ecp-dtf-workspace {
    grid-template-columns: 1fr;
  }

  .ecp-rail {
    flex-direction: row;
    overflow-x: auto;
  }

  .ecp-dtf-left,
  .ecp-dtf-right {
    border: 0;
  }

  .ecp-canvas-shell {
    padding: 44px 16px 90px;
  }

  .ecp-dtf-bottombar {
    flex-wrap: wrap;
  }
}
