.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 390px);
  gap: 18px;
  align-items: start;
}

.upload {
  display: block;
  margin-top: 10px;
  border: 1px dashed #d8c9b2;
  border-radius: 14px;
  padding: 22px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.upload:hover { background: #fdf8ee; }

.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.thumbs .thumb {
  position: relative;
  width: 66px;
  height: 66px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.thumbs .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumbs .thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: rgba(40, 32, 24, .55);
  color: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.copy-box {
  margin-top: 10px;
  min-height: 110px;
  padding: 13px;
  border-radius: 12px;
  background: #fbf7ef;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-col { position: sticky; top: 18px; }

.preview-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  box-shadow: var(--shadow);
}

.preview-card canvas { width: 100%; height: auto; display: block; border-radius: 10px; }

@media (max-width: 780px) {
  .layout { grid-template-columns: 1fr; }
  .preview-col { position: static; order: -1; max-width: 420px; margin: 0 auto; width: 100%; }
}
