.bn-modal-box {
  max-width: 860px;
}

.bn-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.bn-modal-body::-webkit-scrollbar {
  width: 4px;
}
.bn-modal-body::-webkit-scrollbar-thumb {
  background: rgba(var(--black-color-rgb), 0.08);
  border-radius: 2px;
}

.bn-upload-area {
  position: relative;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px dashed rgba(var(--black-color-rgb), 0.1);
  transition:
    border-color 0.25s,
    background 0.25s,
    box-shadow 0.25s;
}

.bn-upload-area:hover {
  border-color: rgba(var(--primary-color-rgb), 0.55);
  background: rgba(var(--primary-color-rgb), 0.04);
}

.bn-upload-area.has-image {
  border-style: solid;
  border-color: rgba(var(--primary-color-rgb), 0.3);
}

.bn-file-input {
  display: none;
}

.bn-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 1.5rem 1rem;
  background: rgba(var(--black-color-rgb), 0.015);
}

.bn-upload-icon-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(var(--black-color-rgb), 0.04);
  margin-bottom: 0.2rem;
}

.bn-upload-text {
  font-size: var(--st-text-base);
  color: rgba(var(--black-color-rgb), 0.5);
  font-weight: 550;
}

.bn-upload-hint {
  font-size: var(--st-text-xs);
  color: rgba(var(--black-color-rgb), 0.2);
  font-family: "JetBrains Mono", monospace;
}

.bn-final-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bn-edit-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(var(--black-color-rgb), 0) 40%,
    rgba(var(--black-color-rgb), 0.55) 100%
  );
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0.85rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bn-upload-area:hover .bn-edit-overlay {
  opacity: 1;
}

.bn-edit-overlay-label {
  pointer-events: auto;
  font-size: var(--st-text-sm);
  font-weight: 600;
  color: var(--black-color);
  letter-spacing: -0.01em;
  background: var(--white-color);
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 8px 20px -8px rgba(var(--black-color-rgb), 0.4);
  transition:
    background 0.2s,
    color 0.2s,
    transform 0.2s;
}

.bn-edit-overlay-label:hover {
  background: var(--primary-color);
  color: var(--black-color);
  transform: translateY(-1px);
}

.bn-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(var(--black-color-rgb), 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.bn-crop-overlay.active {
  display: flex;
}

.bn-crop-box {
  position: relative;
  width: 96%;
  max-width: 800px;
  max-height: var(--modal-max-height);
  background: var(--white-color);
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  border-radius: 1rem;
  box-shadow: 0 25px 60px -12px rgba(var(--black-color-rgb), 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: bnCropEnter 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes bnCropEnter {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.bn-crop-subtitle {
  display: block;
  font-size: 0.55rem;
  color: rgba(var(--black-color-rgb), 0.3);
  font-weight: 400;
  margin-top: 1px;
}

.bn-crop-stage-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: var(--color-neutral-off-white);
  overflow: hidden;
  user-select: none;
}

.bn-crop-container {
  position: relative;
  overflow: hidden;
  cursor: grab;
  background: var(--color-gray-100);
  border: 1px solid rgba(var(--primary-color-rgb), 0.4);
  border-radius: 10px;
  box-shadow:
    0 0 30px rgba(var(--primary-color-rgb), 0.06),
    0 15px 40px rgba(var(--black-color-rgb), 0.08);
}

.bn-crop-container:active {
  cursor: grabbing;
}

.bn-crop-container img {
  position: absolute;
  transform-origin: top left;
  max-width: none;
  pointer-events: none;
  user-select: none;
}

.bn-crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.bn-crop-grid::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 33.33%;
  right: 33.33%;
  border-left: 1px solid rgba(var(--black-color-rgb), 0.1);
  border-right: 1px solid rgba(var(--black-color-rgb), 0.1);
}

.bn-crop-grid::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 33.33%;
  bottom: 33.33%;
  border-top: 1px solid rgba(var(--black-color-rgb), 0.1);
  border-bottom: 1px solid rgba(var(--black-color-rgb), 0.1);
}

.bn-crop-controls-wrap {
  width: 100%;
  max-width: 600px;
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bn-snap-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.bn-snap-label {
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(var(--black-color-rgb), 0.2);
  margin-right: 0.3rem;
}

.bn-snap-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  background: rgba(var(--black-color-rgb), 0.03);
  color: rgba(var(--black-color-rgb), 0.35);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.bn-snap-btn:hover:not(:disabled) {
  border-color: rgba(var(--primary-color-rgb), 0.4);
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.06);
}

.bn-snap-btn:disabled {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
}

.bn-snap-divider {
  width: 1px;
  height: 16px;
  background: rgba(var(--black-color-rgb), 0.06);
  margin: 0 0.15rem;
}

.bn-zoom-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  background: rgba(var(--black-color-rgb), 0.02);
  border: 1px solid rgba(var(--black-color-rgb), 0.06);
  border-radius: 10px;
}

.bn-zoom-btn {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid rgba(var(--black-color-rgb), 0.08);
  background: rgba(var(--black-color-rgb), 0.03);
  color: rgba(var(--black-color-rgb), 0.35);
  cursor: pointer;
  transition: all 0.15s;
}

.bn-zoom-btn:hover {
  border-color: rgba(var(--primary-color-rgb), 0.4);
  color: var(--primary-color);
}

.bn-zoom-slider {
  flex: 1;
  height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(var(--black-color-rgb), 0.08);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.bn-zoom-slider::-webkit-slider-runnable-track {
  height: 3px;
  background: rgba(var(--black-color-rgb), 0.08);
  border-radius: 2px;
}

.bn-zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  margin-top: -5.5px;
  box-shadow: 0 0 6px rgba(var(--primary-color-rgb), 0.3);
}

.bn-zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 6px rgba(var(--primary-color-rgb), 0.3);
}

.bn-zoom-level {
  font-size: 0.6rem;
  font-weight: 650;
  color: var(--primary-color);
  width: 36px;
  text-align: right;
  font-family: "JetBrains Mono", monospace;
}
