.editor-page-shell {
  padding: 16px 0 40px;
}

.editor-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 260px;
  gap: 14px;
}

.editor-column {
  display: grid;
  gap: 10px;
  align-content: start;
}

.editor-column-wide {
  min-width: 0;
}

.editor-title-block,
.editor-panel,
.editor-canvas {
  padding: 14px;
  border-radius: var(--radius-panel);
  background: var(--color-surface-strong);
}

.editor-title-copy {
  max-width: 740px;
}

.editor-title-block {
  display: grid;
  gap: 8px;
}

.editor-page-title,
.editor-panel-title {
  margin: 0;
  font-family: var(--font-display);
}

.editor-panel-title {
  font-size: 0.92rem;
}

.editor-panel-copy {
  margin: 4px 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-dark-soft);
}

.editor-step-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.editor-step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(138, 156, 196, 0.18);
  color: var(--color-dark);
  font-weight: 800;
  font-size: 0.84rem;
  box-shadow: var(--shadow-pill);
}

.editor-page-title {
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
  line-height: 1.04;
}

/* Upload */
.editor-upload-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  min-height: 88px;
  margin-top: 10px;
  border: 2px dashed rgba(108, 124, 255, 0.32);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 800;
  color: var(--color-dark);
  background:
    radial-gradient(circle at top left, rgba(240, 98, 146, 0.08), transparent 28%),
    rgba(255, 255, 255, 0.62);
}

.editor-upload-box:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 98, 146, 0.42);
  box-shadow: var(--shadow-pill);
}

.editor-upload-box:focus-within {
  border-color: rgba(240, 98, 146, 0.48);
  box-shadow: 0 0 0 4px rgba(240, 98, 146, 0.12);
}

.editor-upload-box strong {
  font-size: 0.95rem;
}

.editor-upload-box span:last-child {
  color: var(--color-dark-soft);
  font-weight: 600;
  font-size: 0.82rem;
}

/* Forms */
.editor-form-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.editor-form-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
}

.editor-text-input,
.editor-select,
.editor-share-copy {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(138, 156, 196, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  font-size: 0.88rem;
}

.editor-color-input {
  width: 100%;
  height: 38px;
  padding: 3px;
  border: 1px solid rgba(138, 156, 196, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
}

.editor-action-button,
.editor-secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.86rem;
  box-shadow: var(--shadow-pill);
}

.editor-action-button {
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  color: #ffffff;
}

.editor-secondary-button {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(138, 156, 196, 0.22);
  color: var(--color-dark);
}

.editor-action-button:hover,
.editor-secondary-button:hover {
  transform: translateY(-1px);
}

/* Border picker — horizontal row */
.editor-border-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.editor-border-button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 6px 11px;
  border: 1px solid rgba(138, 156, 196, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  font-size: 0.84rem;
}

.editor-border-button.is-active {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-pill);
}

.editor-border-button:hover {
  transform: translateY(-1px);
}

.editor-border-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(31, 41, 55, 0.12);
  flex-shrink: 0;
}

/* Canvas — larger */
.editor-canvas-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 560px;
  margin-top: 12px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(240, 98, 146, 0.12), transparent 22%),
    radial-gradient(circle at bottom right, rgba(108, 124, 255, 0.14), transparent 26%),
    linear-gradient(135deg, rgba(255, 251, 250, 0.94), rgba(246, 247, 255, 0.92));
  overflow: hidden;
}

.editor-canvas-stage img {
  max-width: 100%;
  max-height: 480px;
  border-radius: 22px;
  box-shadow: var(--shadow-card);
}

.editor-overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.editor-overlay-layer.is-interactive {
  pointer-events: auto;
  touch-action: none;
}

.editor-overlay-text,
.editor-overlay-sticker {
  position: absolute;
  transform: translate(-50%, -50%);
  text-shadow: 0 2px 12px rgba(17, 24, 39, 0.35);
  font-weight: 700;
}

.editor-overlay-item {
  border: none;
  padding: 0;
  background: transparent;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  white-space: nowrap;
  max-width: 78%;
}

.editor-overlay-item.is-selected {
  outline: 2px solid rgba(108, 124, 255, 0.48);
  outline-offset: 6px;
  border-radius: 16px;
}

.editor-overlay-item:active {
  cursor: grabbing;
}

.editor-canvas-empty,
.editor-badge-empty {
  max-width: 260px;
  text-align: center;
  color: var(--color-dark-soft);
  line-height: 1.55;
  font-size: 0.9rem;
}

/* Badge preview — compact */
.editor-badge-stage {
  display: grid;
  place-items: center;
  margin-top: 12px;
  padding: 14px;
  border-radius: 26px;
  background:
    radial-gradient(circle at top left, rgba(240, 98, 146, 0.1), transparent 24%),
    radial-gradient(circle at bottom right, rgba(108, 124, 255, 0.1), transparent 28%),
    rgba(255, 255, 255, 0.72);
}

.editor-badge-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 210px);
  aspect-ratio: 1;
  border: 6px solid #f472b6;
  border-radius: 999px;
  background:
    radial-gradient(circle at top left, rgba(240, 98, 146, 0.08), transparent 24%),
    #ffffff;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.editor-badge-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.editor-badge-preview .editor-overlay-layer {
  border-radius: inherit;
  overflow: hidden;
}

/* Sticker grid — 4 columns, compact */
.editor-sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.editor-sticker-editor {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(138, 156, 196, 0.16);
}

.editor-sticker-button {
  display: grid;
  gap: 3px;
  place-items: center;
  padding: 7px 4px;
  border: 1px solid rgba(138, 156, 196, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
}

.editor-sticker-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-pill);
}

.editor-sticker-glyph {
  font-size: 1.2rem;
}

.editor-sticker-name {
  font-size: 0.68rem;
}

.editor-inline-label {
  font-weight: 800;
  font-size: 0.88rem;
}

.editor-range-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-dark);
  font-weight: 700;
  font-size: 0.84rem;
}

.editor-range-input {
  width: 100%;
}

.editor-layer-list,
.recent-works-list,
.editor-action-stack {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.editor-layer-item,
.recent-work-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(138, 156, 196, 0.18);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.86rem;
}

.editor-layer-item {
  cursor: pointer;
}

.editor-layer-item.is-selected {
  border-color: rgba(108, 124, 255, 0.4);
  box-shadow: var(--shadow-pill);
}

.editor-layer-item button {
  border: none;
  background: transparent;
  color: var(--color-secondary);
  cursor: pointer;
  font-weight: 700;
  font-size: 0.82rem;
}

.editor-layer-empty {
  color: rgba(31, 41, 55, 0.64);
  font-size: 0.84rem;
}

/* Share card — compact */
.share-card-preview {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(240, 98, 146, 0.1), transparent 26%),
    radial-gradient(circle at bottom right, rgba(108, 124, 255, 0.12), transparent 32%),
    linear-gradient(135deg, rgba(255, 250, 249, 0.96), rgba(244, 246, 255, 0.96));
}

.share-card-title {
  font-weight: 800;
  font-size: 0.88rem;
}

.share-card-badge {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 200px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.share-card-badge img {
  width: 160px;
  height: 160px;
  border-radius: 999px;
  object-fit: cover;
}

.recent-work-item {
  grid-template-columns: 56px 1fr;
}

.recent-work-item img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
}

.recent-work-copy {
  display: grid;
  gap: 2px;
}

.recent-work-copy span {
  color: var(--color-dark-soft);
  font-size: 0.82rem;
}

.editor-secondary-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--color-secondary);
  font-weight: 800;
  font-size: 0.88rem;
  text-decoration: none;
}

@media (max-width: 1080px) {
  .editor-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .editor-page-shell {
    padding-top: 12px;
  }

  .editor-title-block,
  .editor-panel,
  .editor-canvas {
    padding: 12px;
  }

  .editor-canvas-stage {
    min-height: 320px;
  }

  .editor-canvas-stage img {
    max-height: 260px;
  }

  .share-card-badge {
    min-height: 180px;
  }

  .share-card-badge img {
    width: 130px;
    height: 130px;
  }
}
