.reacg-hidden {
  display: none !important;
}

.reacg-builder-panel-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
  pointer-events: none;
  /* Beaver Builder's top bar is 999999. */
  z-index: 1000002;
  display: block;
  visibility: visible;
  box-sizing: border-box;
}

.reacg-builder-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 300px;
  max-width: 90vw;
  height: calc(100vh - 40px);
  max-height: 900px;
  background: #ffffff;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.12);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  z-index: 1000002;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  overflow: hidden;
  box-sizing: border-box;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu,
    Cantarell, "Helvetica Neue", sans-serif;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

.reacg-builder-panel-backdrop.reacg-hidden .reacg-builder-panel {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

.reacg-builder-panel.reacg-is-dragging {
  user-select: none !important;
  cursor: grabbing !important;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.3),
    0 4px 16px rgba(0, 0, 0, 0.15) !important;
  transition: none !important;
}

/* Panel Header (Draggable Handle) */
.reacg-bp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
}

.reacg-bp-header:active {
  cursor: grabbing;
}

.reacg-bp-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
}

.reacg-bp-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  margin-right: 2px;
}

.reacg-bp-drag-handle .dashicons {
  font-size: 18px;
  width: 18px;
  height: 18px;
  line-height: 18px;
}

.reacg-bp-brand img {
  width: 22px;
  height: 22px;
  display: block;
}

.reacg-bp-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: default;
}

.reacg-bp-save-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  transition:
    opacity 0.2s ease,
    color 0.2s ease;
  user-select: none;
}

.reacg-bp-save-status.reacg-status-saving {
  color: #0284c7;
}

.reacg-bp-save-status.reacg-status-saved {
  color: #10b981;
}

.reacg-bp-save-status .dashicons {
  font-size: 14px;
  width: 14px;
  height: 14px;
  line-height: 14px;
}

.reacg-bp-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  transition: color 0.15s ease;
  width: 20px;
  height: 20px;
  box-sizing: content-box;
  cursor: pointer;
}

.reacg-bp-close-btn:hover {
  color: #0f172a;
}

/* The panel auto-saves option changes; hide the redundant inner Save button. */
#reacg_settings .save-settings-button,
#reacg_settings .reacg-settings-panel-tabs__action-button_save {
  display: none !important;
}

/* Gallery Selector Bar */
.reacg-bp-select-bar {
  padding: 10px;
  background: #ffffff;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.reacg-bp-gallery-select {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  padding: 0 32px 0 12px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  color: #2c3338 !important;
  border: 1px solid #8c8f94 !important;
  border-radius: 6px !important;
  background-color: #ffffff !important;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 16px 16px !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 38px !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: pointer !important;
  box-sizing: border-box !important;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease !important;
}

.reacg-bp-gallery-select:hover {
  border-color: var(--reacg-primary-color) !important;
}

.reacg-bp-gallery-select:focus {
  border-color: var(--reacg-primary-color) !important;
  box-shadow: 0 0 0 1px var(--reacg-primary-color) !important;
  outline: 2px solid transparent !important;
}

.reacg-bp-btn-new-gallery {
  flex-shrink: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 38px !important;
  padding: 0 14px !important;
}

/* Create Gallery Inline Form (No background) */
.reacg-bp-create-form {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: transparent !important;
  border-bottom: 1px solid #f1f5f9;
  box-sizing: border-box;
  width: 100%;
}

.reacg-bp-new-title {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 38px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  color: #2c3338 !important;
  border: 1px solid #8c8f94 !important;
  border-radius: 6px !important;
  outline: none !important;
  background: #ffffff !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease !important;
}

.reacg-bp-new-title:hover {
  border-color: var(--reacg-primary-color) !important;
}

.reacg-bp-new-title:focus {
  border-color: var(--reacg-primary-color) !important;
  box-shadow: 0 0 0 1px var(--reacg-primary-color) !important;
  outline: 2px solid transparent !important;
}

.reacg-bp-btn-create-submit {
  flex-shrink: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 38px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

.reacg-bp-btn-create-cancel {
  flex-shrink: 0 !important;
  height: 40px !important;
  min-height: 40px !important;
  line-height: 38px !important;
  padding: 0 14px !important;
  font-size: 13px !important;
  white-space: nowrap !important;
}

/* Panel Body */
.reacg-bp-body {
  flex: 1;
  position: relative;
  overflow-y: auto;
  padding: 0;
  background: #ffffff;
}

/* Loading spinner overlay (covers entire modal panel) */
.reacg-bp-spinner-wrap {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  border-radius: 12px;
  pointer-events: auto;
}

.reacg-bp-spinner-wrap.reacg-hidden {
  display: none !important;
}

.reacg-bp-spinner-wrap .spinner {
  width: 28px;
  height: 28px;
  margin: 0;
  float: none;
  background-size: 28px 28px;
  display: block;
}

/* Images Section inside Panel */
.reacg-bp-images-section,
.reacg-bp-settings-section {
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
}

.reacg-bp-settings-section {
  border-bottom: none;
  padding-bottom: 0;
}

.reacg-gallery-images-section-title,
.reacg-gallery-settings-section-title {
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 14px 6px;
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

li.MuiMenuItem-root:focus-visible {
  outline: none;
}

.reacg-builder-panel,
.reacg-modal {
  #reacg-gallery-images {
    margin: 0 10px 10px;
  }

  .reacg-media-toolbar {
    display: flex;
    flex-wrap: nowrap !important;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f6f6fb;
    border: 1px solid #eceaf8;
    border-radius: 6px;
    margin-top: 4px;
    margin-bottom: 8px;
    min-height: 40px;
    box-sizing: border-box;
    container-type: inline-size;
  }

  .reacg-media-toolbar__left {
    display: flex;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 8px;
    min-width: 0;
  }

  .reacg-media-toolbar__left > *,
  .reacg-media-toolbar__right .reacg-bulk-edit-btn {
    white-space: nowrap;
  }

  .reacg-media-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 0;
  }

  .reacg-media-toolbar .reacg-select-all-label {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
    user-select: none;
  }

  .reacg-media-toolbar .reacg-selected-count {
    font-size: 12px;
    line-height: 18px;
    color: var(--reacg-primary-color, #155c92);
    background: color-mix(
      in srgb,
      var(--reacg-primary-color, #155c92) 10%,
      #ffffff
    );
    border: 1px solid
      color-mix(in srgb, var(--reacg-primary-color, #155c92) 22%, #ffffff);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    letter-spacing: 0.1px;
  }

  .reacg-media-toolbar .reacg-selected-count .reacg-selected-count__full {
    display: none !important;
  }

  .reacg-media-toolbar .reacg-selected-count .reacg-selected-count__short {
    display: inline !important;
  }

  .reacg-media-toolbar input[type="checkbox"].reacg-select-all-checkbox,
  .reacg_items input[type="checkbox"].reacg-item-checkbox {
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    position: relative !important;
    display: inline-block !important;
    box-sizing: border-box !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    max-height: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #8c8f94 !important;
    border-radius: 4px !important;
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
    box-shadow: none !important;
    outline: none !important;
    float: none !important;
    clear: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    visibility: visible !important;
    cursor: pointer !important;
    vertical-align: middle !important;
    transition:
      background-color 0.1s ease,
      border-color 0.1s ease;
  }

  .reacg_items input[type="checkbox"].reacg-item-checkbox {
    border-color: rgba(0, 0, 0, 0.35) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    background-color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
  }

  .reacg-media-toolbar input[type="checkbox"].reacg-select-all-checkbox::after,
  .reacg_items input[type="checkbox"].reacg-item-checkbox::after {
    display: none !important;
    content: none !important;
  }

  .reacg-media-toolbar input[type="checkbox"].reacg-select-all-checkbox::before,
  .reacg_items input[type="checkbox"].reacg-item-checkbox::before {
    content: "" !important;
    position: absolute !important;
    display: none !important;
    box-sizing: border-box !important;
    left: 5px !important;
    top: 2px !important;
    width: 6px !important;
    height: 10px !important;
    margin: 0 !important;
    border: solid #ffffff !important;
    border-width: 0 2px 2px 0 !important;
    background: none !important;
    box-shadow: none !important;
    transform: rotate(45deg) !important;
  }

  .reacg-media-toolbar input[type="checkbox"].reacg-select-all-checkbox:checked,
  .reacg-media-toolbar
    input[type="checkbox"].reacg-select-all-checkbox:indeterminate,
  .reacg_items input[type="checkbox"].reacg-item-checkbox:checked {
    background: var(--reacg-primary-color, #155c92) !important;
    background-color: var(--reacg-primary-color, #155c92) !important;
    background-image: none !important;
    border-color: var(--reacg-primary-color, #155c92) !important;
  }

  .reacg-media-toolbar
    input[type="checkbox"].reacg-select-all-checkbox:checked::before,
  .reacg_items input[type="checkbox"].reacg-item-checkbox:checked::before {
    display: block !important;
  }

  .reacg-media-toolbar
    input[type="checkbox"].reacg-select-all-checkbox:indeterminate::before {
    display: block !important;
    left: 4px !important;
    top: 7px !important;
    width: 8px !important;
    height: 0 !important;
    border-width: 0 0 2px 0 !important;
    transform: none !important;
  }

  .reacg-media-toolbar
    input[type="checkbox"].reacg-select-all-checkbox:focus-visible,
  .reacg_items input[type="checkbox"].reacg-item-checkbox:focus-visible {
    box-shadow:
      0 0 0 2px #ffffff,
      0 0 0 4px var(--reacg-primary-color, #155c92) !important;
  }

  .reacg-media-toolbar .reacg-bulk-edit-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    background: var(--reacg-primary-color, #155c92) !important;
    background-color: var(--reacg-primary-color, #155c92) !important;
    border: 1px solid var(--reacg-primary-color, #155c92) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 0 12px !important;
    min-height: 32px !important;
    cursor: pointer !important;
    box-shadow: none !important;
    text-shadow: none !important;
    text-decoration: none !important;
  }

  .reacg-media-toolbar
    .reacg-bulk-edit-btn:hover:not(:disabled):not([disabled]),
  .reacg-media-toolbar
    .reacg-bulk-edit-btn:focus:not(:disabled):not([disabled]) {
    background: var(--reacg-primary-color-darker, #006ba1) !important;
    background-color: var(--reacg-primary-color-darker, #006ba1) !important;
    border-color: var(--reacg-primary-color-darker, #006ba1) !important;
    color: #ffffff !important;
  }

  .reacg-media-toolbar .reacg-bulk-edit-btn:disabled,
  .reacg-media-toolbar .reacg-bulk-edit-btn[disabled] {
    background: #f6f7f7 !important;
    background-color: #f6f7f7 !important;
    border-color: #dcdcde !important;
    color: #a7aaad !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
  }

  .reacg-media-toolbar .reacg-bulk-edit-btn .dashicons,
  .reacg-media-toolbar .reacg-bulk-edit-btn .dashicons::before {
    color: inherit !important;
  }

  .reacg-media-toolbar .reacg-bulk-edit-btn .dashicons {
    font-size: 15px !important;
    width: 15px !important;
    height: 15px !important;
    line-height: 1 !important;
    margin: 0 !important;
    vertical-align: middle;
  }

  .reacg_items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 4px;
    padding: 2px;
    box-sizing: border-box;
  }

  .reacg_item {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0;
  }

  .reacg_item.reacg-item--selected {
    border-color: var(--reacg-primary-color, #155c92) !important;
    outline: none !important;
  }

  .reacg_item.reacg-item--selected::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--reacg-primary-color, #155c92);
    border-radius: 5px;
    pointer-events: none;
    z-index: 5;
    box-sizing: border-box;
  }

  .reacg_item_new .reacg_item_image {
    mask-size: 75px;
  }

  .button-primary {
    background: var(--reacg-primary-color);
    border: 1px solid var(--reacg-primary-color);
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    text-shadow: none;
  }

  .button-primary:hover {
    background: var(--reacg-primary-color-darker);
    border-color: var(--reacg-primary-color-darker);
    color: #fff;
  }

  .button-primary:focus {
    background: var(--reacg-primary-color-darker);
    border-color: var(--reacg-primary-color-darker);
    color: #fff;
    box-shadow:
      0 0 0 1px #fff,
      0 0 0 3px var(--reacg-primary-color);
    outline: 2px solid transparent;
  }

  .button-secondary {
    color: var(--reacg-primary-color);
    border: 1px solid var(--reacg-primary-color);
    background: #ffffff;
    border-radius: 6px;
    vertical-align: top;
  }

  .button-secondary:hover {
    background: #ffffff;
    border-color: var(--reacg-primary-color-darker);
    color: var(--reacg-primary-color-darker);
  }

  .button-secondary:focus {
    border-color: var(--reacg-primary-color-darker);
    color: var(--reacg-primary-color-darker);
    box-shadow: 0 0 0 1px var(--reacg-primary-color-darker);
    outline: 2px solid transparent;
  }

  .button,
  .button-primary,
  .button-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    height: 40px;
    min-height: 40px;
    line-height: 38px;
    margin: 0;
    padding: 0 16px;
    cursor: pointer;
    border-width: 1px;
    border-style: solid;
    -webkit-appearance: none;
    border-radius: 6px;
    white-space: nowrap;
    box-sizing: border-box;
    text-align: center;
    transition:
      background-color 0.15s ease,
      border-color 0.15s ease,
      color 0.15s ease,
      box-shadow 0.15s ease;
  }
}

/* Edit & AI Attachment Modals only (Kept isolated from React settings) */
.reacg-modal {
  color: #3c434a;

  h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
    line-height: 1.3;
  }

  h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
    line-height: 1.4;
  }

  textarea {
    box-sizing: border-box !important;
    width: 100% !important;
    background-color: #fff !important;
    background: #fff !important;
    color: #2c3338 !important;
    border: 1px solid #8c8f94 !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    box-shadow: none !important;
    resize: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  input[type="text"],
  input[type="url"],
  input[type="number"],
  input[type="search"] {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 36px !important;
    min-height: 36px !important;
    background-color: #fff !important;
    background: #fff !important;
    color: #2c3338 !important;
    border: 1px solid #8c8f94 !important;
    border-radius: 4px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    box-shadow: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
  }

  textarea:focus,
  input[type="text"]:focus,
  input[type="url"]:focus,
  input[type="number"]:focus,
  input[type="search"]:focus {
    border-color: var(--reacg-primary-color, #2271b1) !important;
    box-shadow: 0 0 0 1px var(--reacg-primary-color, #2271b1) !important;
    outline: 2px solid transparent !important;
  }

  textarea:disabled,
  input[type="text"]:disabled,
  input[type="url"]:disabled,
  input[type="number"]:disabled,
  input[type="search"]:disabled {
    background-color: #f0f0f1 !important;
    background: #f0f0f1 !important;
    color: #646970 !important;
    cursor: not-allowed !important;
  }

  input[type="checkbox"],
  input[type="radio"] {
    box-sizing: border-box !important;
    border: 1px solid #1e1e1e !important;
    border-radius: 2px !important;
    background: #fff !important;
    background-image: none !important;
    color: #1e1e1e !important;
    clear: none !important;
    cursor: pointer !important;
    display: inline-block !important;
    line-height: 0 !important;
    height: 16px !important;
    width: 16px !important;
    min-height: 16px !important;
    min-width: 16px !important;
    max-height: 16px !important;
    max-width: 16px !important;
    margin: 0 6px 0 0 !important;
    outline: 0 !important;
    outline-offset: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    vertical-align: middle !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    box-shadow: none !important;
    float: none !important;
    transform: none !important;
    opacity: 1 !important;
    filter: none !important;
    visibility: visible !important;
    font-size: 16px !important;
    transition: 0.05s border-color ease-in-out !important;
    accent-color: var(--reacg-primary-color, #155c92) !important;
  }

  input[type="radio"] {
    display: inline-flex !important;
    border-radius: 50% !important;
    margin-right: 6px !important;
    align-items: center !important;
    justify-content: center !important;
  }

  input[type="checkbox"]::after,
  input[type="radio"]::after {
    display: none !important;
    content: none !important;
  }

  input[type="checkbox"]:focus,
  input[type="radio"]:focus {
    border-color: var(--reacg-primary-color, #155c92) !important;
    box-shadow: 0 0 0 1px var(--reacg-primary-color, #155c92) !important;
    outline: 2px solid transparent !important;
    outline-offset: 0 !important;
  }

  input[type="checkbox"]:checked,
  input[type="radio"]:checked {
    background: var(--reacg-primary-color, #155c92) !important;
    border-color: var(--reacg-primary-color, #155c92) !important;
    box-shadow: none !important;
  }

  input[type="checkbox"]:checked::before,
  input[type="radio"]:checked::before {
    float: left !important;
    display: inline-block !important;
    vertical-align: middle !important;
    width: 16px !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    box-shadow: none !important;
    border: none !important;
    transform: none !important;
  }

  input[type="checkbox"]:checked::before {
    content: url(data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23ffffff%27%2F%3E%3C%2Fsvg%3E) !important;
    content: url(data:image/svg+xml;utf8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2020%2020%27%3E%3Cpath%20d%3D%27M14.83%204.89l1.34.94-5.81%208.38H9.02L5.78%209.67l1.34-1.25%202.57%202.4z%27%20fill%3D%27%23ffffff%27%2F%3E%3C%2Fsvg%3E) /
      "" !important;
    margin: -3px 0 0 -4px !important;
    height: 21px !important;
    width: 21px !important;
    min-width: 21px !important;
    min-height: 21px !important;
    max-width: none !important;
    max-height: none !important;
    background: transparent !important;
  }

  input[type="radio"]:checked::before {
    content: "" !important;
    display: block !important;
    border-radius: 50% !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    max-width: 8px !important;
    max-height: 8px !important;
    margin: auto !important;
    background-color: #fff !important;
    outline: 4px solid transparent !important;
  }

  label {
    cursor: pointer;
    display: block;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 7px;
    color: #3c434a;
  }

  /* The crop position picker (admin.css) uses visually hidden radios behind
     a 3x3 grid of labels; keep it out of the generic radio/label styling. */
  .reacg-crop-position-picker__option {
    display: block;
    height: 28px;
    margin: 0;
    font-size: inherit;
    font-weight: normal;
  }

  .reacg-crop-position-picker__option input[type="radio"] {
    position: absolute !important;
    display: block !important;
    width: 1px !important;
    height: 1px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 1px !important;
    max-height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
  }

  .reacg-crop-position-picker__option input[type="radio"]::before {
    display: none !important;
    content: none !important;
  }

  .reacg-crop-position-picker__label-row label {
    margin-bottom: 0 !important;
  }

  .reacg-convert-delete-original {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin: 0 !important;
    font-size: 13px !important;
    font-weight: normal !important;
    line-height: 1.4 !important;
  }
}

.reacg-alert-dialog.MuiDialog-root {
  z-index: 10000010 !important;
}

.reacg-modal.reacg-ai-generate-modal {
  h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1d2327;
    margin: 0;
    line-height: 1.4;
  }

  .reacg-ai-generate-modal__fields {
    border-top: 1px solid #e2e4e7;
    border-bottom: 1px solid #e2e4e7;
    padding: 14px 0;
    display: grid;
    gap: 10px;
  }

  .reacg-ai-generate-modal__fields label {
    display: grid;
    grid-template-columns: 24px minmax(120px, 140px) 1fr;
    gap: 10px;
    align-items: center;
    margin: 0;
  }

  .reacg-ai-generate-modal__fields input[type="checkbox"] {
    margin: 0 !important;
  }

  .reacg-ai-generate-modal__field-name {
    font-weight: 600;
  }

  .reacg-ai-generate-modal__overwrite {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .reacg-ai-generate-modal__overwrite label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
  }

  .reacg-ai-generate-modal__progress {
    margin: 0 10px 0 auto;
    font-size: 13px;
    color: #50575e;
    line-height: 1.4;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
  }

  .reacg-ai-generate-modal__notice--success {
    color: #1d6f42;
    background-color: #ebf9f0;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
  }

  .reacg-ai-generate-modal__notice--error {
    color: #c7254e;
    background-color: #f9f2f4;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
  }
}

.reacg-builder-panel-backdrop.reacg-embedded-mode {
  display: none !important;
}

.reacg-builder-panel.reacg-builder-panel-embedded {
  position: static !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  z-index: auto !important;
  overflow: visible !important;
  transition: none !important;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.reacg-builder-panel.reacg-builder-panel-embedded .reacg-bp-header {
  cursor: default !important;
  background: transparent !important;
  padding: 8px 0 10px 0 !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

.reacg-builder-panel.reacg-builder-panel-embedded .reacg-bp-drag-handle,
.reacg-builder-panel.reacg-builder-panel-embedded .reacg-bp-close-btn {
  display: none !important;
}

.reacg-builder-panel.reacg-builder-panel-embedded .reacg-bp-select-bar {
  padding: 12px 0 !important;
  background: transparent !important;
}

.reacg-builder-panel.reacg-builder-panel-embedded .reacg-bp-create-form {
  padding: 10px 0 14px 0 !important;
  background: transparent !important;
}

.reacg-builder-panel.reacg-builder-panel-embedded .reacg-bp-body {
  overflow-y: visible !important;
  height: auto !important;
  max-height: none !important;
  background: transparent !important;
}

.reacg-bp-empty-state {
  padding: 16px 8px;
  text-align: center;
}

.reacg-bp-empty-desc {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  margin: 0;
}

/* ==========================================================================
   Overlays opened from the settings app (MUI menus, dialogs, tooltips)
   The settings app runs in this document and uses a theme whose z-index
   scale starts at 1,000,100, i.e. above the panel (1,000,002). Only the
   notistack container needs an explicit value.
   ========================================================================== */
.notistack-SnackbarContainer {
  z-index: 1000500 !important;
}

/* The WordPress media library (wp.media) is opened from the panel's media
   section; core places it at 160,000, below the panel. */
.media-modal-backdrop {
  z-index: 1000299 !important;
}

.media-modal {
  z-index: 1000300 !important;
}

.reacg-templates-dialog .MuiDialog-paper {
  height: 88vh;
  max-height: 88vh;
}
