
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.preview-viewport {
  min-height: 0;
  height: 100%;
  display: grid;
  align-items: center;
  justify-items: center;
  overflow: hidden;
}

.canvas-frame {
  width: auto;
  height: min(100%, 820px);
  max-width: 100%;
  max-height: 100%;
  margin-inline: auto;
  aspect-ratio: 1080 / 1920;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: calc(var(--radius-lg) + 4px);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.10);
}

@media (min-width: 1101px) {
  .canvas-frame {
    height: min(100%, calc(100dvh - 220px));
    width: min(100%, calc((100dvh - 220px) * 1080 / 1920));
    max-width: min(100%, calc((100dvh - 220px) * 1080 / 1920));
  }
}

.canvas-stage {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#designCanvas {
  display: block;
  flex: 0 0 auto;
  background: #fff;
  box-shadow: var(--canvas-shadow);
  border-radius: 18px;
  max-width: none;
  max-height: none;
}


@media (max-width: 1100px) {
  .preview-toolbar {
    margin-bottom: 8px;
  }

  .canvas-frame {
    width: min(100%, 500px);
    height: auto;
  }
}

@media (max-width: 760px) {
  .preview-toolbar {
    margin-bottom: 4px;
  }

  .canvas-frame {
    width: min(calc(100vw - 26px), 368px);
    padding: 6px;
    border-radius: 20px;
  }
}


@media (max-width: 760px) and (orientation: portrait) {
  .preview-viewport {
    min-height: min(70svh, 740px);
    height: auto;
  }

  .canvas-frame {
    width: min(calc(100vw - 24px), 384px);
    height: auto;
    max-height: min(72svh, 760px);
    padding: 5px;
  }
}


@media (max-width: 760px) {
  .success-preview-panel .preview-toolbar {
    margin-bottom: 6px;
  }

  .success-preview-panel .preview-viewport {
    min-height: min(66svh, 700px);
    height: auto;
    padding: 0 6px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .success-preview-panel .canvas-frame {
    width: min(calc(100vw - 72px), 332px);
    height: auto;
    max-height: min(66svh, 680px);
    padding: 10px;
    border-radius: 24px;
    margin-inline: auto;
  }
}
