/* r26: keep every active modal overlay transparent so the page remains
   visible beneath the dim mask.  This overrides the earlier global white
   scrollbar background only inside Naive UI modal portals. */
.n-modal-container .n-modal-body-wrapper,
.n-modal-container .n-modal-body-wrapper .n-scrollbar,
.n-modal-container .n-modal-body-wrapper .n-scrollbar-container,
.n-modal-container .n-modal-body-wrapper .n-scrollbar-content {
  background-color: transparent !important;
}

.n-modal-container .n-modal-mask {
  background: rgba(0, 0, 0, .4) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

/* Existing dispatch dialog: preserve the compact reference appearance. */
.n-modal.codex-dispatch-compact-r25.modal-content {
  width: 400px !important;
  max-width: calc(100vw - 32px) !important;
  box-sizing: border-box !important;
  margin: auto !important;
  padding: 20px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18) !important;
}

/* The application-notification popup on /info. */
.n-modal.codex-info-popup-compact-r26.modal-content {
  display: flex !important;
  width: 400px !important;
  max-width: calc(100vw - 32px) !important;
  box-sizing: border-box !important;
  flex-direction: column !important;
  gap: 12px !important;
  margin: auto !important;
  padding: 20px !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18) !important;
}

.codex-info-popup-compact-r26 .icon-wrapper {
  display: flex !important;
  min-height: 0 !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

.codex-info-popup-compact-r26 .input-field {
  width: 100% !important;
}

.codex-info-popup-compact-r26 .button-wrapper {
  display: flex !important;
  justify-content: flex-end !important;
  gap: 10px !important;
  margin-top: 4px !important;
}

/* File image preview stays larger than a form, but is still a real white
   window rather than a full-page white surface. */
.n-modal.codex-info-image-preview-r26 {
  position: relative !important;
  width: min(900px, calc(100vw - 32px)) !important;
  max-height: calc(100vh - 32px) !important;
  box-sizing: border-box !important;
  margin: auto !important;
  padding: 16px !important;
  overflow: auto !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: #fff !important;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18) !important;
}

.codex-info-image-preview-r26 img {
  display: block !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

.codex-info-image-close-r26 {
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  display: flex;
  width: 30px;
  height: 30px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: rgba(241, 241, 241, .94);
  color: #737373;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.codex-info-image-close-r26:hover {
  background: #e5e7eb;
  color: #374151;
}

@media (max-width: 600px) {
  .n-modal.codex-dispatch-compact-r25.modal-content,
  .n-modal.codex-info-popup-compact-r26.modal-content {
    width: calc(100vw - 32px) !important;
    padding: 16px !important;
  }
}
