.aieg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 3.75rem) clamp(1rem, 2.7vw, 2.2rem);
}
.aieg-card { min-width: 0; }
.aieg-compare {
  --split: 50%;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  background: #dbd0bc;
  direction: ltr;
}
.aieg-compare img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.aieg-compare img[data-example-before] { clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.aieg-card[data-editor-example="edit"] .aieg-compare { --split: 37%; }
.aieg-card[data-editor-example="local"] .aieg-compare { background: #a8a39e; }
.aieg-card[data-editor-example="local"] img { object-fit: contain; }
.aieg-card[data-editor-example="erase"] img { object-position: 50% 50%; }
.aieg-card[data-editor-example="text"] img { object-position: 50% 45%; }
.aieg-compare input[type="range"] {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  direction: ltr;
  touch-action: pan-y;
}
.aieg-compare:focus-within { outline: 3px solid #ff924f; outline-offset: 3px; }
.aieg-divider {
  position: absolute;
  inset-block: 0;
  left: var(--split);
  width: 2px;
  transform: translateX(-50%);
  background: #fff;
  box-shadow: 0 0 4px #160d0a80;
  pointer-events: none;
}
.aieg-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px #0004;
}
.aieg-divider::after {
  content: '‹ ›';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -53%);
  color: #261c18;
  font: bold 19px/1 Arial, sans-serif;
  white-space: pre;
}
.aieg-tag {
  position: absolute;
  bottom: .65rem;
  padding: .3rem .55rem;
  border-radius: 5px;
  color: #fff;
  background: #241c17d9;
  font-size: .75rem;
  line-height: 1.25;
  pointer-events: none;
}
.aieg-tag--before { left: .65rem; }
.aieg-tag--after { right: .65rem; }
.aieg-card h3 { margin: 1rem 0 .4rem; }
.aieg-card p { margin: 0 0 .55rem; }
.aieg-try {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
  border: 0;
  padding: 0;
  color: inherit;
  background: none;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.aieg-try::after { content: '→'; }
[dir="rtl"] .aieg-try::after { content: '←'; }
.aieg-try:hover { text-decoration: underline; }
.aieg-try:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.aieg-try:disabled { opacity: .6; cursor: progress; }
@media (max-width: 640px) { .aieg-grid { grid-template-columns: minmax(0, 1fr); } }
