.cms-banner-crop {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgb(15 23 42 / 72%);
}

.cms-banner-crop__dialog {
  width: min(1080px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 70px rgb(0 0 0 / 30%);
  padding: 22px;
  color: #172033;
}

.cms-banner-crop__dialog h2 {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.cms-banner-crop__step {
  width: fit-content;
  margin: 0 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bs-primary, #087cad) 12%, white);
  padding: 4px 10px;
  color: var(--bs-primary, #087cad);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.cms-banner-crop__help {
  margin: 0 0 16px;
  color: #52627a;
}

.cms-banner-crop__workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.15fr);
  align-items: start;
  gap: 14px;
}

.cms-banner-crop__workspace > div {
  display: grid;
  gap: 6px;
}

.cms-banner-crop__source {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  max-height: 240px;
  overflow: hidden;
  border: 1px solid #cad5e2;
  border-radius: 10px;
  background: #f5f7fa;
}

.cms-banner-crop__source img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  object-fit: contain;
}

.cms-banner-crop__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1600 / 475;
  overflow: hidden;
  border: 2px solid #0b7db7;
  border-radius: 12px;
  background: #eef2f6;
}

.cms-banner-crop__frame--card {
  width: min(100%, clamp(180px, calc((100dvh - 330px) * 0.714), 260px));
  aspect-ratio: 5 / 7;
  margin-inline: auto;
}

.cms-banner-crop__frame img {
  position: absolute;
  display: block;
  max-width: none;
  object-fit: fill;
  user-select: none;
  pointer-events: none;
}

.cms-banner-crop__controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.cms-banner-crop__control {
  display: grid;
  align-content: start;
  gap: 6px;
  font-weight: 600;
}

.cms-banner-crop__control input {
  width: 100%;
}

.cms-banner-crop__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.cms-banner-crop__error {
  flex: 1 0 100%;
  margin: 0;
  border-radius: 8px;
  background: #fff1f2;
  padding: 9px 12px;
  color: #9f1239;
  font-weight: 600;
}

.cms-banner-crop__button {
  border: 1px solid #b8c5d6;
  border-radius: 9px;
  background: #fff;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
}

.cms-banner-crop__button--primary {
  border-color: var(--bs-primary, #087cad);
  background: var(--bs-primary, #087cad);
  color: #fff;
}

.cms-banner-crop__button:focus-visible,
.cms-banner-crop__control input:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--bs-primary, #087cad) 35%, white);
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .cms-banner-crop {
    padding: 10px;
  }

  .cms-banner-crop__dialog {
    padding: 16px;
  }

  .cms-banner-crop__workspace,
  .cms-banner-crop__controls {
    grid-template-columns: 1fr;
  }

  .cms-banner-crop__frame--card {
    width: min(100%, 260px);
  }
}
