.ej-patch-demo {
  --split: 50%;
  --ink: #192d35;
  --accent: #168470;
  margin: 0;
  min-width: 0;
}
.ej-patch-stage {
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 20px;
  background: #f4f0e8;
  cursor: ew-resize;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
.ej-patch-stage img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
}
.ej-patch-art { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.ej-patch-label {
  position: absolute;
  top: clamp(10px, 3%, 18px);
  padding: 5px 12px;
  border-radius: 24px;
  color: white;
  background: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.6;
  pointer-events: none;
}
.ej-label-art { left: 3%; }
.ej-label-thread { right: 3%; }
.ej-patch-stage[data-mode="art"] .ej-label-thread,
.ej-patch-stage[data-mode="thread"] .ej-label-art { visibility: hidden; }
.ej-patch-line {
  position: absolute;
  inset-block: 0;
  left: var(--split);
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 0 1px rgb(19 61 56 / .55);
  pointer-events: none;
}
.ej-patch-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: white;
  color: var(--ink);
  font: 700 22px/1 system-ui,sans-serif;
  transform: translate(-50%,-50%);
}
.ej-patch-stage:not([data-mode="split"]) .ej-patch-line { visibility: hidden; }
.ej-patch-stage:focus-within { outline: 3px solid var(--accent); outline-offset: 3px; }
.ej-patch-stage input.ej-patch-range {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  clip-path: inset(50%);
  overflow: hidden;
}
.ej-patch-views {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 4px;
  margin-top: 12px;
  padding: 4px;
  border: 1px solid #cbd8d3;
  border-radius: 28px;
  background: #fff;
}
.ej-patch-views button {
  appearance: none;
  display: block;
  min-width: 0;
  min-height: 44px;
  padding: 7px 4px;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(12px,2.4vw,15px);
  font-weight: 600;
  line-height: 1.25;
}
.ej-patch-views button[aria-pressed="true"] { color: white; background: var(--ink); }
.ej-patch-views button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.ej-patch-demo figcaption { margin-top: 8px; color: #52636b; font-size: 12px; }
.ej-placement-gallery .xcard > img {
  box-sizing: border-box;
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  background: #f2f3f1;
}
.ej-placement-gallery .xcard > img.ej-dog-sample { padding: 5%; }

/* A shared coordinate frame keeps both supplied leopard images registered. */
.ej-leopard-demo .ej-patch-stage { background: #fff; }
.ej-leopard-demo .ej-patch-base,
.ej-leopard-demo .ej-patch-art {
  position: absolute;
  inset: 0;
  background: #fff;
}
.ej-leopard-field {
  position: absolute;
  left: 6%;
  top: 10%;
  width: 88%;
  aspect-ratio: 1;
  overflow: hidden;
}
.ej-leopard-demo .ej-leopard-original {
  inset: auto;
  left: -6.965944%;
  top: -6.965944%;
  width: 113.931889%;
  height: 113.931889%;
  object-fit: fill;
}
.ej-leopard-demo .ej-leopard-embroidery {
  inset: auto;
  left: 9.647497%;
  top: 2.995990%;
  width: 126.315789%;
  height: 145.201238%;
  object-fit: fill;
  transform-origin: 0 0;
  transform: matrix(.691708421, .007144159, -.007005789, .638640378, 0, 0);
}

.ejx #explore { scroll-margin-top: 6rem; }
