/* Sticker Remover — professional tool UI */
.sticker-tool {
  --sticker-a: #ec4899;
  --sticker-a2: #db2777;
  --sticker-line: rgba(148, 163, 184, 0.2);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.sticker-tool [hidden] { display: none !important; }

.sticker-hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.15rem 1.2rem;
  border-radius: 16px;
  border: 1px solid var(--sticker-line);
  background:
    radial-gradient(800px 160px at 0% -20%, rgba(236, 72, 153, 0.22), transparent 55%),
    linear-gradient(145deg, rgba(15, 23, 41, 0.96), rgba(30, 10, 28, 0.88));
}

.sticker-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f9a8d4;
}

.sticker-title {
  margin: 0 0 0.35rem;
  font-size: 1.28rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

.sticker-sub {
  margin: 0;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.5;
  max-width: 40rem;
}

.sticker-badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(145deg, var(--sticker-a), var(--sticker-a2));
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
}

.sticker-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.sticker-steps li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--sticker-line);
  background: rgba(15, 23, 42, 0.5);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 600;
}

.sticker-steps strong {
  display: inline-grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.18);
  color: #f9a8d4;
  font-size: 0.75rem;
}

.sticker-upload-block { margin: 0; }

.sticker-source-preview { margin: 0; }

.sticker-source-preview-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--sticker-line);
  background: rgba(255, 255, 255, 0.03);
}

.sticker-source-preview img {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: #0f172a;
}

.sticker-source-meta {
  flex: 1;
  min-width: 0;
}

.sticker-source-meta strong {
  display: block;
  color: #e2e8f0;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticker-workspace { margin: 0; }

.sticker-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.9rem;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid var(--sticker-line);
  background: rgba(15, 23, 42, 0.55);
}

.sticker-toolbar-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.sticker-mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 38px;
  padding: 0.4rem 0.72rem;
  border-radius: 9px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(2, 6, 23, 0.45);
  color: #cbd5e1;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.sticker-mode-btn:hover {
  border-color: rgba(236, 72, 153, 0.4);
  color: #fce7f3;
}

.sticker-mode-btn.active {
  border-color: rgba(236, 72, 153, 0.65);
  background: rgba(236, 72, 153, 0.16);
  color: #f9a8d4;
}

.sticker-brush-size label,
.sticker-feather-size label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  margin-right: 0.25rem;
}

.sticker-brush-size input[type="range"],
.sticker-feather-size input[type="range"] {
  width: 110px;
  accent-color: var(--sticker-a);
}

.sticker-canvas-shell {
  border-radius: 14px;
  padding: 0.55rem;
  border: 1px solid var(--sticker-line);
  background: rgba(2, 6, 23, 0.35);
}

.sticker-canvas-wrap {
  position: relative;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(45deg, #1e293b 25%, transparent 25%) 0 0 / 16px 16px,
    linear-gradient(-45deg, #1e293b 25%, transparent 25%) 0 8px / 16px 16px,
    #0f172a;
  touch-action: none;
  user-select: none;
  cursor: none;
}

.sticker-canvas-wrap.is-rect { cursor: crosshair; }
.sticker-canvas-wrap.is-rect .sticker-cursor { display: none !important; }

.sticker-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

#stickerImageCanvas { width: 100%; }

#stickerMaskCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.sticker-cursor {
  position: absolute;
  top: 0;
  left: 0;
  width: 28px;
  height: 28px;
  margin: 0;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.7), 0 0 12px rgba(236, 72, 153, 0.35);
  pointer-events: none;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.sticker-cursor.is-erase {
  border-color: rgba(255, 255, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.8);
  background: rgba(15, 23, 42, 0.15);
}

.sticker-hint {
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #94a3b8;
}

.sticker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.sticker-progress {
  padding: 0.85rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(236, 72, 153, 0.3);
  background: rgba(236, 72, 153, 0.1);
}

.sticker-progress-head {
  display: flex;
  justify-content: space-between;
  color: #e2e8f0;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
}

.sticker-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(15, 23, 41, 0.85);
  overflow: hidden;
}

.sticker-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--sticker-a2), var(--sticker-a), #f9a8d4);
  transition: width 0.2s ease;
}

.sticker-progress-step {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
}

.sticker-result-wrap {
  margin-top: 0.35rem;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--sticker-line);
  background: rgba(15, 23, 42, 0.45);
}

.sticker-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.7rem;
}

.sticker-result-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: #e2e8f0;
}

.sticker-result-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
}

.sticker-result-preview {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #0f172a;
}

.sticker-result-preview img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}

.sticker-result-note {
  margin: 0.7rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
}

.sticker-tool.is-busy .sticker-mode-btn,
.sticker-tool.is-busy .sticker-actions .btn,
.sticker-tool.is-busy input[type="range"] {
  pointer-events: none;
  opacity: 0.7;
}

@media (max-width: 720px) {
  .sticker-steps {
    grid-template-columns: 1fr;
  }

  .sticker-hero {
    flex-direction: column;
  }

  .sticker-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .sticker-toolbar-group {
    width: 100%;
  }

  .sticker-mode-btn {
    flex: 1 1 0;
    justify-content: center;
  }

  .sticker-brush-size,
  .sticker-feather-size {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 0.5rem;
  }

  .sticker-brush-size input[type="range"],
  .sticker-feather-size input[type="range"] {
    width: 100%;
  }

  .sticker-source-preview-inner {
    flex-wrap: wrap;
  }

  .sticker-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 100%;
  }

  .sticker-actions .btn {
    flex: none;
    width: 100%;
    min-height: 48px;
    justify-content: center;
  }
}
