/* Background Remover — tool-specific styles (uses the site's design tokens only). */
.bg-tip > span { flex: none; display: inline-flex; }
.bg-status { margin: 14px 0 4px; }
.bg-status p { margin: 0 0 8px; color: var(--text-2); font-weight: 600; }
#bg-error { margin-top: 14px; }
#bg-run { margin-bottom: 4px; }

.bg-stage { position: relative; }
.bg-empty {
  display: grid; place-items: center; gap: 8px; align-content: center; min-height: 260px; padding: 24px;
  border: 2px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); text-align: center;
}
.bg-empty .icon { width: 40px; height: 40px; }
.bg-empty p { margin: 0; }

/* Before/after: the "after" layer is a canvas instead of an <img>. */
.bg-compare { background: var(--surface); margin: 0 auto; }
.bg-compare > img { display: block; width: 100%; height: auto; max-height: none; }
.bg-compare .compare-after canvas { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }

/* Refine view: painting surface */
.bg-refine-frame, #bg-original-wrap .img-frame { display: block; min-height: 0; }
.bg-refine-frame canvas, #bg-original-wrap .img-frame img { margin: 0 auto; }
.bg-refine-frame canvas { touch-action: none; cursor: none; max-height: 70vh; }
.bg-cursor {
  position: absolute; left: 0; top: 0; pointer-events: none; border-radius: 50%;
  border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(15, 23, 42, .75), inset 0 0 0 1px rgba(15, 23, 42, .75);
  transform: translate(-50%, -50%);
}
.bg-cursor.is-restore { border-color: #22c55e; }
.bg-cursor.is-erase { border-color: #fff; }
#bg-mode-hint { margin-top: 10px; }

#bg-original-wrap .img-frame img { max-height: 60vh; }

@media (max-width: 640px) {
  .bg-empty { min-height: 180px; }
  .bg-refine-frame canvas { max-height: 60vh; }
}

/* Make the hidden attribute win over component display rules. */
.notice[hidden], .bg-empty[hidden], .bg-cursor[hidden], .size-badge[hidden], .bg-status[hidden] { display: none; }
