/* ============================================================
   Brush Crop Image Tool — style.css
   Classes  : bc-brush-crop-*
   Approach : Mobile-first (base = mobile, @media min-width = desktop)
   Brand    : #42B5A4 (teal) — protected as the default. It is the
              default brush color too; the person can switch the
              brush color, which only changes how their selection
              looks on screen (never the exported image).
   Shares tokens, type and components with circle-crop so both
   tools read as one product (Inter, same header, same controls).
   ============================================================ */


/* ══════════════════════════════════════════
   0. BASE / RESET / BRAND TOKENS
   ══════════════════════════════════════════ */

/* Guarantees any element with the native `hidden` attribute stays
   hidden even when another rule here also sets `display` on it
   (e.g. .bc-brush-crop-controls__row sets display:flex) — otherwise
   author CSS at equal specificity beats the browser's own
   [hidden]{display:none} default, and JS toggling .hidden appears
   to do nothing. */
[hidden] {
  display: none !important;
}

.bc-brush-crop-wrap,
.bc-brush-crop-wrap * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.bc-brush-crop-wrap {
  /* ── Brand color — single source of truth, never hardcoded elsewhere ── */
  --bc-brand: #42B5A4;
  --bc-brand-dark: #2E8577;
  --bc-brand-soft: #E8F8F6;

  --bc-ink: #1a1a22;
  --bc-ink-soft: #55555f;
  --bc-line: #e4e4ee;
  --bc-line-strong: #c4c4d4;
  --bc-bg: #f5f5fa;
  --bc-error: #c0392b;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}

.bc-brush-crop-wrap button,
.bc-brush-crop-wrap select,
.bc-brush-crop-wrap input {
  font-family: inherit;
}

.bc-brush-crop-wrap button:focus-visible,
.bc-brush-crop-wrap select:focus-visible,
.bc-brush-crop-wrap input[type="range"]:focus-visible {
  outline: 2px solid var(--bc-brand);
  outline-offset: 2px;
}


/* ══════════════════════════════════════════
   1. HEADER
   ══════════════════════════════════════════ */
.bc-brush-crop-header {
  text-align: center;
  margin-bottom: 24px;
}

.bc-brush-crop-header__title {
  font-weight: 800;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  letter-spacing: -0.8px;
  color: var(--bc-ink);
  margin: 0 0 8px;
}

.bc-brush-crop-header__title strong {
  font-weight: 900;
  color: var(--bc-brand);
}

.bc-brush-crop-header__subtitle {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--bc-ink-soft);
  line-height: 1.6;
  margin: 0;
}

.bc-brush-crop-header__subtitle a {
  color: var(--bc-brand);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: rgba(66, 181, 164, 0.35);
  text-underline-offset: 2px;
}

.bc-brush-crop-header__subtitle a:hover,
.bc-brush-crop-header__subtitle a:focus-visible {
  color: var(--bc-brand-dark);
  text-decoration-color: currentColor;
}

.bc-brush-crop-header__note {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bc-ink-soft);
  opacity: 0.75;
  margin: 10px 0 0;
}


/* ══════════════════════════════════════════
   2. STEPPER
   ══════════════════════════════════════════ */
.bc-brush-crop-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.bc-brush-crop-stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.bc-brush-crop-stepper__dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #9999a2;
  background: #fff;
  border: 1.5px solid var(--bc-line);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.bc-brush-crop-stepper__step.is-active .bc-brush-crop-stepper__dot {
  background: var(--bc-brand);
  border-color: var(--bc-brand);
  color: #fff;
}

.bc-brush-crop-stepper__step.is-done .bc-brush-crop-stepper__dot {
  background: var(--bc-brand-soft);
  border-color: var(--bc-brand);
  color: var(--bc-brand);
}

.bc-brush-crop-stepper__dot--export {
  width: auto;
  border-radius: 9999px;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.bc-brush-crop-stepper__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--bc-ink-soft);
}

.bc-brush-crop-stepper__line {
  width: 28px;
  height: 2px;
  background: var(--bc-line);
  margin-top: -18px;
}


/* ══════════════════════════════════════════
   3. PANELS
   ══════════════════════════════════════════ */
.bc-brush-crop-panel {
  display: none;
}

.bc-brush-crop-panel.is-active {
  display: block;
  animation: bcFadeIn 0.28s ease both;
}

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


/* ══════════════════════════════════════════
   4. STEP 1 — UPLOAD SECTION (premium, minimal)
   ══════════════════════════════════════════ */
.bc-brush-crop-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  margin: 8px auto 0;
  padding: 40px 24px;
  border-radius: 24px;
  cursor: pointer;
}

/* Drag-over affordance: a soft brand-colored halo behind the whole
   card, not a color swap — reads as "drop here" without shouting. */
.bc-brush-crop-dropzone__ring {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1.5px dashed transparent;
  box-shadow: 0 0 0 0 rgba(66, 181, 164, 0);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  pointer-events: none;
}

.bc-brush-crop-dropzone.is-dragover .bc-brush-crop-dropzone__ring {
  border-color: rgba(66, 181, 164, 0.45);
  box-shadow: 0 0 0 8px rgba(66, 181, 164, 0.08);
}

/* ── The focal point: pill-shaped select button ── */
.bc-brush-crop-dropzone__button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 32px;
  border-radius: 9999px;
  background: var(--bc-brand);
  border: 1.5px solid var(--bc-brand);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.1px;
  box-shadow: 0 2px 10px rgba(66,181,164,0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.bc-brush-crop-dropzone__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #fff;
}

.bc-brush-crop-dropzone:hover .bc-brush-crop-dropzone__button {
  transform: translateY(-2px);
  background: var(--bc-brand-dark);
  border-color: var(--bc-brand-dark);
  box-shadow: 0 14px 32px rgba(66,181,164,0.28);
}

.bc-brush-crop-dropzone:active .bc-brush-crop-dropzone__button {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 6px 16px rgba(66,181,164,0.24);
}

.bc-brush-crop-dropzone:focus-visible {
  outline: none;
}

.bc-brush-crop-dropzone:focus-visible .bc-brush-crop-dropzone__button {
  box-shadow: 0 0 0 4px var(--bc-brand-soft), 0 8px 24px rgba(66,181,164,0.28);
}

.bc-brush-crop-dropzone.is-dragover .bc-brush-crop-dropzone__button {
  transform: translateY(-2px);
  background: var(--bc-brand-dark);
  border-color: var(--bc-brand-dark);
  box-shadow: 0 14px 32px rgba(66,181,164,0.32);
}

/* ── Refined divider: fading hairlines, not decoration ── */
.bc-brush-crop-dropzone__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 300px;
  margin-top: 28px;
  color: #a3a3ae;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.bc-brush-crop-dropzone__divider::before,
.bc-brush-crop-dropzone__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--bc-line-strong));
}

.bc-brush-crop-dropzone__divider::after {
  background: linear-gradient(to left, transparent, var(--bc-line-strong));
}

/* ── Trust line ── */
.bc-brush-crop-dropzone__trust {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 22px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--bc-ink-soft);
}

.bc-brush-crop-dropzone__trust svg {
  width: 15px;
  height: 15px;
  color: var(--bc-brand);
  flex-shrink: 0;
}

.bc-brush-crop-dropzone__hint {
  margin: 10px 0 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--bc-ink-soft);
  opacity: 0.7;
  text-align: center;
}


/* ══════════════════════════════════════════
   5. STEP 2 — STAGE (image canvas + crop overlay)
   ══════════════════════════════════════════ */
.bc-brush-crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 420px;
  margin: 0 auto 20px;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #e9e9ef 25%, transparent 25%) -10px 0/ 20px 20px,
    linear-gradient(-45deg, #e9e9ef 25%, transparent 25%) -10px 0/ 20px 20px,
    linear-gradient(45deg, transparent 75%, #e9e9ef 75%) -10px 0/ 20px 20px,
    linear-gradient(-45deg, transparent 75%, #e9e9ef 75%) -10px 0/ 20px 20px,
    #fafafd;
  touch-action: none;
}

.bc-brush-crop-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

/* Overlay sits above the image canvas, same box, transparent.
   It paints the brushed area / shapes and carries the shape handles. */
.bc-brush-crop-draw-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* Brush-size ring that follows a mouse / pen so the footprint is
   visible before painting. Hidden for touch. */
.bc-brush-crop-cursor {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(26, 26, 34, 0.6), inset 0 0 0 1px rgba(26, 26, 34, 0.3);
  pointer-events: none;
  z-index: 2;
  will-change: transform;
}

.bc-brush-crop-stage__loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 250, 253, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 3;
}

.bc-brush-crop-stage__loading.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.bc-brush-crop-spinner {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 3px solid var(--bc-line);
  border-top-color: var(--bc-brand);
  animation: bcSpin 0.7s linear infinite;
}

@keyframes bcSpin {
  to { transform: rotate(360deg); }
}


/* ══════════════════════════════════════════
   6. CONTROLS (tools + brush + history + image + color + background)
   ══════════════════════════════════════════ */
.bc-brush-crop-controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
}

.bc-brush-crop-controls__row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bc-brush-crop-controls__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--bc-ink);
}

.bc-brush-crop-controls__val {
  font-weight: 700;
  color: var(--bc-brand);
  margin-left: 4px;
}

.bc-brush-crop-slider {
  width: 100%;
  height: 40px;
  accent-color: var(--bc-brand);
  touch-action: manipulation;
}

.bc-brush-crop-slider:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Tool buttons: Brush / Shape / Eraser / Invert ── */
.bc-brush-crop-controls__row--modes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* Very narrow phones: 2 × 2 instead of squeezing four labels into one row */
@media (max-width: 340px) {
  .bc-brush-crop-controls__row--modes {
    grid-template-columns: repeat(2, 1fr);
  }
}

.bc-brush-crop-modebtn {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 6px;
  border-radius: 12px;
  border: 1.5px solid var(--bc-line);
  background: #fff;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--bc-ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.bc-brush-crop-modebtn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.bc-brush-crop-modebtn.is-active {
  border-color: var(--bc-brand);
  color: var(--bc-brand);
  background: var(--bc-brand-soft);
  box-shadow: 0 2px 8px rgba(66, 181, 164, 0.18);
}

.bc-brush-crop-modebtn:active {
  transform: scale(0.98);
}

/* Invert is a flag, not a tool choice — give it its own pressed
   color (amber) so it never reads as "currently selected tool"
   the way Brush/Shape/Eraser's teal is-active state does. */
.bc-brush-crop-modebtn--invert[aria-pressed="true"] {
  border-color: #c9762f;
  color: #c9762f;
  background: #fdf1e7;
}

/* ── History row: undo / redo / clear ── */
.bc-brush-crop-controls__row--history {
  flex-direction: row;
  gap: 8px;
}

.bc-brush-crop-iconbtn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--bc-line);
  background: #fff;
  color: var(--bc-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.bc-brush-crop-iconbtn svg {
  width: 19px;
  height: 19px;
}

.bc-brush-crop-iconbtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.bc-brush-crop-iconbtn:not(:disabled):active {
  transform: scale(0.94);
}

.bc-brush-crop-iconbtn--danger {
  margin-left: auto;
  color: var(--bc-error);
  border-color: #f1d4d0;
}

/* ── Rotate / flip the photo ── */
.bc-brush-crop-imgtools {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.bc-brush-crop-imgbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 64px;
  padding: 10px 4px;
  border-radius: 12px;
  border: 1.5px solid var(--bc-line);
  background: #fff;
  color: var(--bc-ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.bc-brush-crop-imgbtn svg {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
}

.bc-brush-crop-imgbtn span {
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

.bc-brush-crop-imgbtn:active {
  transform: scale(0.96);
  border-color: var(--bc-brand);
  color: var(--bc-brand);
  background: var(--bc-brand-soft);
}

/* ── Brush color swatches ── */
.bc-brush-crop-swatches {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.bc-brush-crop-swatch {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: var(--sw, #ccc);
  box-shadow: 0 0 0 1.5px var(--bc-line-strong);
  cursor: pointer;
  touch-action: manipulation;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.bc-brush-crop-swatch.is-active {
  box-shadow: 0 0 0 2.5px var(--bc-ink);
}

.bc-brush-crop-swatch:active {
  transform: scale(0.92);
}

/* Custom-color swatch: rainbow until a color is picked (JS then sets
   an inline background). */
.bc-brush-crop-swatch--custom {
  background: conic-gradient(#f0506e, #f5a524, #f2e34a, #42b5a4, #3b82f6, #8b5cf6, #f0506e);
}

/* ── Background row (same pattern as circle-crop) ── */
.bc-brush-crop-controls__row--bg {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.bc-brush-crop-bgmode {
  display: flex;
  gap: 8px;
  position: relative;
}

.bc-brush-crop-bgmode__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--bc-line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--bc-ink-soft);
  cursor: pointer;
}

.bc-brush-crop-bgmode__btn.is-active {
  border-color: var(--bc-brand);
  color: var(--bc-brand);
  background: var(--bc-brand-soft);
}

.bc-brush-crop-bgmode__swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--bc-line-strong);
  background: var(--bc-brand);
}

.bc-brush-crop-bgmode__swatch--checker {
  background:
    linear-gradient(45deg, #ccc 25%, transparent 25%) 0 0/8px 8px,
    linear-gradient(-45deg, #ccc 25%, transparent 25%) 0 0/8px 8px,
    linear-gradient(45deg, transparent 75%, #ccc 75%) 0 0/8px 8px,
    linear-gradient(-45deg, transparent 75%, #ccc 75%) 0 0/8px 8px,
    #fff;
}

.bc-brush-crop-colorinput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* On/off switch (same as circle-crop's Glow switch) */
.bc-brush-crop-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 28px;
  flex-shrink: 0;
}

.bc-brush-crop-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.bc-brush-crop-switch__track {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  background: var(--bc-line-strong);
  cursor: pointer;
  transition: background 0.18s ease;
}

.bc-brush-crop-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(26,26,34,0.3);
  transition: transform 0.18s ease;
}

.bc-brush-crop-switch input:checked + .bc-brush-crop-switch__track {
  background: var(--bc-brand);
}

.bc-brush-crop-switch input:checked + .bc-brush-crop-switch__track .bc-brush-crop-switch__thumb {
  transform: translateX(18px);
}

.bc-brush-crop-switch input:focus-visible + .bc-brush-crop-switch__track {
  outline: 2px solid var(--bc-brand);
  outline-offset: 2px;
}


/* ── Slider with − / + buttons (same as circle-crop's badge size) ── */
.bc-brush-crop-stepper-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bc-brush-crop-stepper-row .bc-brush-crop-slider {
  flex: 1;
}

.bc-brush-crop-stepbtn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--bc-line);
  background: #fff;
  color: var(--bc-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.bc-brush-crop-stepbtn:active {
  background: var(--bc-bg);
}


/* ══════════════════════════════════════════
   7. SHAPE PANEL
   ══════════════════════════════════════════ */
.bc-brush-crop-shapepanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--bc-line);
  box-shadow: 0 4px 18px rgba(20, 20, 30, 0.06);
}

.bc-brush-crop-shapehint {
  margin: 0;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--bc-ink-soft);
}

.bc-brush-crop-shapegrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
  padding: 2px;
}

.bc-brush-crop-shapebtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 4px;
  border-radius: 12px;
  border: 1.5px solid var(--bc-line);
  background: #fff;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.bc-brush-crop-shapebtn svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: var(--bc-ink-soft);
  stroke-width: 1.6;
  stroke-linejoin: round;
  transition: stroke 0.18s ease, fill 0.18s ease;
}

.bc-brush-crop-shapebtn span {
  font-size: 10px;
  font-weight: 700;
  color: var(--bc-ink-soft);
  text-align: center;
  line-height: 1.2;
}

/* Highlights the TYPE of the shape currently selected on the image. */
.bc-brush-crop-shapebtn.is-active {
  border-color: var(--bc-brand);
  background: var(--bc-brand-soft);
}

.bc-brush-crop-shapebtn.is-active svg {
  stroke: var(--bc-brand-dark);
  fill: var(--bc-brand-soft);
}

.bc-brush-crop-shapebtn.is-active span {
  color: var(--bc-brand-dark);
}

.bc-brush-crop-shapebtn:active {
  transform: scale(0.96);
}

.bc-brush-crop-shapecontrols {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bc-line);
}


/* ══════════════════════════════════════════
   8. STEP 3 — EXPORT PREVIEW
   ══════════════════════════════════════════ */
.bc-brush-crop-preview {
  display: flex;
  justify-content: center;
  margin: 8px 0 24px;
}

.bc-brush-crop-preview__canvas {
  width: 240px;
  height: 240px;
  max-width: 70vw;
  max-height: 70vw;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  background:
    linear-gradient(45deg, #e9e9ef 25%, transparent 25%) 0 0/16px 16px,
    linear-gradient(-45deg, #e9e9ef 25%, transparent 25%) 0 0/16px 16px,
    linear-gradient(45deg, transparent 75%, #e9e9ef 75%) 0 0/16px 16px,
    linear-gradient(-45deg, transparent 75%, #e9e9ef 75%) 0 0/16px 16px,
    #fafafd;
}

.bc-brush-crop-select {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--bc-line);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--bc-ink);
  width: 100%;
}


/* ══════════════════════════════════════════
   9. ACTION BUTTONS
   ══════════════════════════════════════════ */
.bc-brush-crop-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.bc-brush-crop-btn {
  flex: 1;
  height: 48px;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 15px;
  border: 1.5px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.bc-brush-crop-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bc-brush-crop-btn--primary {
  background: var(--bc-brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(66,181,164,0.28);
}

.bc-brush-crop-btn--primary:active {
  transform: scale(0.98);
}

.bc-brush-crop-btn--ghost {
  background: #fff;
  border-color: var(--bc-line);
  color: var(--bc-ink);
}

.bc-brush-crop-btn--ghost:active {
  background: var(--bc-bg);
}

/* Compact full-width button used inside the shape panel */
.bc-brush-crop-btn--small {
  flex: none;
  width: 100%;
  height: 44px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.bc-brush-crop-btn--small svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.bc-brush-crop-btn--danger {
  background: #fff;
  border-color: #f1d4d0;
  color: var(--bc-error);
}

.bc-brush-crop-btn--danger:active {
  background: #fdf1ef;
}


/* ══════════════════════════════════════════
   10. TOAST
   ══════════════════════════════════════════ */
.bc-brush-crop-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--bc-ink, #1a1a22);
  color: #fff;
  padding: 12px 22px;
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  max-width: 90vw;
  text-align: center;
}

.bc-brush-crop-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.bc-brush-crop-toast.is-error {
  background: #c0392b;
}


/* ══════════════════════════════════════════
   11. DESKTOP ENHANCEMENTS (≥768px)
   ══════════════════════════════════════════ */
@media (min-width: 768px) {
  .bc-brush-crop-wrap {
    padding: 40px 24px 72px;
  }

  .bc-brush-crop-header__subtitle {
    font-size: 16px;
  }

  .bc-brush-crop-stepper {
    gap: 10px;
    margin-bottom: 36px;
  }

  .bc-brush-crop-stepper__line {
    width: 56px;
  }

  .bc-brush-crop-dropzone {
    max-width: 520px;
    padding: 56px 24px;
  }

  .bc-brush-crop-dropzone__button {
    height: 60px;
    padding: 0 36px;
    font-size: 16.5px;
  }

  .bc-brush-crop-stage {
    max-width: 500px;
  }

  .bc-brush-crop-modebtn:hover,
  .bc-brush-crop-imgbtn:hover,
  .bc-brush-crop-bgmode__btn:hover,
  .bc-brush-crop-iconbtn:not(:disabled):hover {
    border-color: var(--bc-brand);
    color: var(--bc-brand);
  }

  .bc-brush-crop-swatch:not(.is-active):hover {
    transform: scale(1.08);
  }

  .bc-brush-crop-shapegrid {
    grid-template-columns: repeat(5, 1fr);
  }

  .bc-brush-crop-shapebtn:not(.is-active):hover {
    border-color: var(--bc-brand);
  }

  .bc-brush-crop-modebtn--invert:not([aria-pressed="true"]):hover {
    border-color: #c9762f;
    color: #c9762f;
  }

  .bc-brush-crop-btn--ghost:hover {
    border-color: var(--bc-ink);
  }

  .bc-brush-crop-btn--danger:hover {
    border-color: var(--bc-error);
  }

  .bc-brush-crop-btn--primary:hover {
    box-shadow: 0 4px 16px rgba(66,181,164,0.36);
  }

  .bc-brush-crop-actions {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
}


/* ══════════════════════════════════════════
   12. ACCESSIBILITY
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .bc-brush-crop-panel.is-active,
  .bc-brush-crop-spinner {
    animation: none;
  }

  .bc-brush-crop-dropzone__button {
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .bc-brush-crop-dropzone:hover .bc-brush-crop-dropzone__button,
  .bc-brush-crop-dropzone:active .bc-brush-crop-dropzone__button,
  .bc-brush-crop-dropzone.is-dragover .bc-brush-crop-dropzone__button {
    transform: none;
  }
}
