.magic-eraser-ready {
  cursor: zoom-in;
  position: relative;
}

.magic-eraser-ready img {
  transition: filter .16s ease, transform .16s ease;
}

.magic-eraser-ready:hover img {
  filter: saturate(1.04) contrast(1.03);
  transform: scale(1.01);
}

.magic-eraser-modal[hidden] {
  display: none;
}

.magic-eraser-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(17, 24, 39, .76);
}

.magic-eraser-dialog {
  width: min(1180px, calc(100vw - 36px));
  height: min(860px, calc(100vh - 36px));
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .35);
}

.magic-eraser-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #d7dde5;
  background: #fff;
}

.magic-eraser-title {
  margin-right: auto;
  font-weight: 700;
  color: #111827;
}

.magic-eraser-hint {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid #c9d9d5;
  border-radius: 8px;
  background: #f2faf8;
  color: #0f5f58;
  font: 700 13px/1 Arial, sans-serif;
}

.magic-eraser-btn,
.magic-eraser-label {
  min-height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: 700 13px/1 Arial, sans-serif;
}

.magic-eraser-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 11px;
  cursor: pointer;
}

.magic-eraser-btn:hover {
  border-color: #0f766e;
  color: #0f766e;
}

.magic-eraser-btn.is-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #fff;
}

.magic-eraser-btn.is-accent {
  border-color: #1d4ed8;
  background: #1d4ed8;
  color: #fff;
}

.magic-eraser-btn:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.magic-eraser-label {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 6px 9px;
  font-weight: 600;
}

.magic-eraser-label input {
  width: 130px;
  accent-color: #0f766e;
}

.magic-eraser-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 14px;
  overflow: hidden;
  background: #e7ebf0;
}

.magic-eraser-canvas-wrap {
  position: relative;
  display: block;
  min-width: 0;
  min-height: 0;
  line-height: 0;
}

.magic-eraser-canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12), 0 16px 36px rgba(15, 23, 42, .18);
  touch-action: none;
  cursor: crosshair;
}

.magic-eraser-selection {
  position: absolute;
  border: 2px solid #10b981;
  border-radius: 4px;
  background: rgba(16, 185, 129, .15);
  pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, .18), 0 0 0 1px rgba(255, 255, 255, .95) inset;
}

.magic-eraser-status {
  min-height: 34px;
  padding: 8px 12px;
  border-top: 1px solid #d7dde5;
  background: #fff;
  color: #475467;
  font: 13px/1.35 Arial, sans-serif;
}

body.magic-eraser-open {
  overflow: hidden;
}

@media (max-width: 720px) {
  .magic-eraser-modal {
    padding: 0;
  }

  .magic-eraser-dialog {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .magic-eraser-title {
    width: 100%;
  }

  .magic-eraser-hint {
    flex: 1 1 100%;
  }

  .magic-eraser-label {
    flex: 1 1 100%;
  }

  .magic-eraser-label input {
    flex: 1;
    width: auto;
  }
}
