/* "Deisgned by Kapil Pidhwani": AI Image Upscaler split-stage & zoom styles; adapts via @container only (ceiling: CSS clip-path compare). */
.tool-pane { container-type: inline-size; }
.ups-tall { height: 320px; }
.media-empty-placeholder[hidden], .ups-stage[hidden], .ups-cmp-row[hidden],
.ups-notice[hidden], .ups-cancel-btn[hidden], .ups-change-btn[hidden], #seg-zoom[hidden] { display: none; }

.ups-head { display: flex; align-items: center; gap: 0.5rem; min-width: 0; flex-wrap: wrap; justify-content: flex-end; }
.ups-notice {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem;
  margin: 0.65rem 1.25rem 0; padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm); border: 1px solid rgba(234, 109, 56, 0.28);
  background: var(--brand-soft); color: var(--text-primary); font-size: 0.8rem; line-height: 1.45;
}
.ups-notice iconify-icon { flex: none; color: var(--brand-ink); }
.ups-notice > span { flex: 1 1 180px; min-width: 0; }
.ups-change-btn { width: 100%; justify-content: center; margin-top: 0.75rem; }

.ups-stage {
  position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: inherit;
  background-color: var(--surface);
  background-image:
    linear-gradient(45deg, var(--border) 25%, transparent 25%),
    linear-gradient(-45deg, var(--border) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--border) 75%),
    linear-gradient(-45deg, transparent 75%, var(--border) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.ups-scroll { width: 100%; height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ups-stage.is-zoom-100 .ups-scroll { overflow: auto; align-items: flex-start; justify-content: flex-start; }

.ups-layers { --split: 50%; position: relative; display: inline-block; line-height: 0; max-width: 100%; max-height: 100%; }
.ups-stage.is-zoom-100 .ups-layers { max-width: none; max-height: none; margin: auto; }

.ups-after { display: block; width: auto; height: auto; max-width: 100%; max-height: 316px; }
.ups-stage.is-zoom-100 .ups-after { max-width: none; max-height: none; }

.ups-before {
  position: absolute; inset: 0; width: 100%; height: 100%;
  image-rendering: pixelated;
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
  pointer-events: none;
}

.ups-divider {
  position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px;
  background: var(--brand); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.75); pointer-events: none;
}

.ups-tag {
  position: absolute; top: 0.5rem; padding: 2px 6px; border-radius: var(--radius-chip);
  background: rgba(23, 25, 28, 0.88); color: #ffffff; font-size: 0.7rem; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.ups-tag-l { right: 6px; }
.ups-tag-r { left: 6px; }

.ups-cmp-row { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.7rem; min-width: 0; }
.ups-cmp-row .range-slider-clean { flex: 1; min-width: 0; }
.ups-cmp-row .range-val-badge { font-variant-numeric: tabular-nums; min-width: 3.1rem; text-align: center; }

.ups-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.75rem; }
.ups-actions .btn-primary-action { margin-top: 0; flex: 1; min-width: 0; }
.tool-workspace-card.is-busy .ups-actions,
.tool-workspace-card.is-busy .ups-cancel-btn { pointer-events: auto; opacity: 1; }
.ups-range { width: 160px; max-width: 100%; }

@container (max-width: 420px) {
  .ups-tall { height: 250px; }
  .ups-after { max-height: 246px; }
}
