/* Layout dialogs v191: visual-only dialog, drawer, popover and toast convergence.
   This layer does not change handlers, workflows, storage, API logic or any
   business behavior. It exists to remove remaining legacy color/radius/
   spacing conflicts from dialogs and floating feedback surfaces. */

:is(
  body.erp-app,
  body.source-inbox-frame-page,
  body.source-inbox-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app
) {
  --m2-dialog-surface: #ffffff;
  --m2-dialog-surface-soft: #f7f9f8;
  --m2-dialog-surface-hover: #f0f4f1;
  --m2-dialog-line: #e3e7e4;
  --m2-dialog-line-strong: #ccd3cf;
  --m2-dialog-text: #202622;
  --m2-dialog-muted: #68736c;
  --m2-dialog-accent: #2f6b4f;
  --m2-dialog-accent-hover: #275a42;
  --m2-dialog-accent-soft: #eaf3ed;
  --m2-dialog-danger: #a6514c;
  --m2-dialog-danger-soft: #fbf0ee;
  --m2-dialog-warning: #9a7537;
  --m2-dialog-warning-soft: #fbf4e8;
  --m2-dialog-radius: 10px;
  --m2-dialog-control-radius: 8px;
  --m2-dialog-overlay: rgba(15, 24, 19, .46);
  --m2-dialog-shadow: 0 18px 48px rgba(20, 28, 24, .16);
  --m2-dialog-menu-shadow: 0 12px 28px rgba(20, 28, 24, .14);
}

/* ------------------------------------------------------------------ */
/* Backdrops and floating surfaces                                     */
/* ------------------------------------------------------------------ */
:is(
  body.erp-app,
  body.source-inbox-frame-page,
  body.source-inbox-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app
) :is(
  .modal-backdrop,
  .account-editor-backdrop,
  .dialog-backdrop,
  .product-detail-backdrop,
  .erp-image-zoom-backdrop,
  .runtime-dialog-backdrop,
  .collector-detail-backdrop
) {
  background: var(--m2-dialog-overlay) !important;
  -webkit-backdrop-filter: blur(6px) saturate(.94) !important;
  backdrop-filter: blur(6px) saturate(.94) !important;
}

:is(
  body.erp-app,
  body.source-inbox-frame-page,
  body.source-inbox-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app
) :is(
  .modal-backdrop,
  .account-editor-backdrop,
  .dialog-backdrop,
  .erp-image-zoom-backdrop,
  .runtime-dialog-backdrop
) {
  padding: 18px !important;
}

/* Source-inbox drawer keeps its own overlay child because it also hosts a
   right-side drawer rather than a centered dialog. */
body.source-inbox-frame-page .collector-detail-backdrop,
body.source-inbox-app .collector-detail-backdrop {
  background: rgba(15, 24, 19, .36) !important;
  -webkit-backdrop-filter: blur(3px) !important;
  backdrop-filter: blur(3px) !important;
}

body.erp-app .product-detail-backdrop {
  background: rgba(15, 24, 19, .30) !important;
  -webkit-backdrop-filter: blur(2px) !important;
  backdrop-filter: blur(2px) !important;
}

/* ------------------------------------------------------------------ */
/* Centered modal geometry                                             */
/* ------------------------------------------------------------------ */
body.erp-app :is(
  .system-modal,
  .account-editor-modal,
  .export-file-modal
),
body.source-inbox-frame-page :is(
  .runtime-dialog
),
body.source-inbox-app :is(
  .runtime-dialog
),
body.copywriting-app .runtime-dialog,
body.api-app .runtime-dialog,
body.templates-app .runtime-dialog {
  width: min(400px, calc(100vw - 28px)) !important;
  max-width: 400px !important;
  max-height: min(640px, calc(100vh - 28px)) !important;
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  overflow: hidden !important;
  border: 1px solid var(--m2-dialog-line) !important;
  border-radius: var(--m2-dialog-radius) !important;
  background: var(--m2-dialog-surface) !important;
  box-shadow: var(--m2-dialog-shadow) !important;
}

body.erp-app .system-modal {
  width: min(380px, calc(100vw - 28px)) !important;
  max-width: 380px !important;
  max-height: min(460px, calc(100vh - 28px)) !important;
}

body.erp-app .account-editor-modal {
  width: min(440px, calc(100vw - 28px)) !important;
  max-width: 440px !important;
  max-height: min(620px, calc(100vh - 28px)) !important;
}

body.erp-app .export-file-modal {
  width: min(420px, calc(100vw - 28px)) !important;
  max-width: 420px !important;
  max-height: min(600px, calc(100vh - 28px)) !important;
}

/* Runtime confirmation and input dialogs can grow slightly when they carry
   an editable field, but remain content-adaptive on short viewports. */
body.copywriting-app .runtime-dialog,
body.api-app .runtime-dialog,
body.templates-app .runtime-dialog,
body.source-inbox-frame-page .runtime-dialog {
  width: min(380px, calc(100vw - 28px)) !important;
  max-width: 380px !important;
  max-height: min(600px, calc(100vh - 28px)) !important;
}

:is(
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog:has(.runtime-dialog-input) {
  width: min(430px, calc(100vw - 28px)) !important;
  max-width: 430px !important;
}

body.erp-app .runtime-dialog {
  width: min(380px, calc(100vw - 28px)) !important;
  max-width: 380px !important;
  max-height: min(600px, calc(100vh - 28px)) !important;
}

body.erp-app .runtime-dialog:has(.runtime-dialog-input) {
  width: min(430px, calc(100vw - 28px)) !important;
  max-width: 430px !important;
}

/* ------------------------------------------------------------------ */
/* Dialog copy and header/body spacing                                 */
/* ------------------------------------------------------------------ */
body.erp-app :is(
  .system-modal-copy,
  .account-editor-body,
  .export-file-modal-copy,
  .product-detail-body
),
body.source-inbox-frame-page .collector-detail-body,
body.source-inbox-app .collector-detail-body {
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 16px 18px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(32, 38, 34, .24) transparent !important;
}

body.erp-app .system-modal-copy {
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  padding: 20px 20px 16px !important;
  text-align: center !important;
}

body.erp-app .system-modal-copy h2,
body.erp-app .account-editor-header h2,
body.erp-app .product-detail-header h2,
body.erp-app .export-file-modal-copy h2,
body.source-inbox-frame-page .collector-detail-head h2,
body.source-inbox-app .collector-detail-head h2,
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-copy h2 {
  margin: 0 !important;
  color: var(--m2-dialog-text) !important;
  font-size: 15px !important;
  font-weight: 650 !important;
  line-height: 1.35 !important;
  letter-spacing: 0 !important;
}

body.erp-app :is(
  .system-modal-copy p,
  .export-file-modal-copy p,
  .account-editor-header p,
  .product-detail-header p
),
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-copy p {
  margin: 7px 0 0 !important;
  color: var(--m2-dialog-muted) !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  line-height: 1.55 !important;
  letter-spacing: 0 !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

body.erp-app .account-editor-header,
body.erp-app .product-detail-header,
body.source-inbox-frame-page .collector-detail-head,
body.source-inbox-app .collector-detail-head {
  min-height: 52px !important;
  height: 52px !important;
  max-height: 52px !important;
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  padding: 0 16px !important;
  border-bottom: 1px solid var(--m2-dialog-line) !important;
  border-radius: 0 !important;
  background: var(--m2-dialog-surface) !important;
}

body.erp-app .account-editor-header > div,
body.erp-app .product-detail-header > div,
body.source-inbox-frame-page .collector-detail-head-copy {
  min-width: 0 !important;
  flex: 1 1 auto !important;
}

body.erp-app .product-detail-header p,
body.erp-app .account-editor-header p {
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

body.erp-app .account-editor-body {
  display: block !important;
}

body.erp-app .account-editor-fields {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 10px 12px !important;
  margin: 0 0 12px !important;
}

body.erp-app .account-editor-field {
  min-width: 0 !important;
  margin: 0 !important;
}

body.erp-app .account-editor-field.span-2,
body.erp-app .account-editor-field:has(input[type="checkbox"]) {
  grid-column: 1 / -1 !important;
}

body.erp-app .account-editor-field > span,
body.erp-app .account-editor-field label > span,
body.erp-app .export-file-modal-copy > label {
  display: block !important;
  margin: 0 0 5px !important;
  color: var(--m2-dialog-muted) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 18px !important;
}

body.erp-app :is(
  .account-editor-field input,
  .account-editor-field select,
  .account-editor-field textarea,
  .export-file-modal-copy input,
  .export-file-modal-copy select,
  .export-file-modal-copy textarea
) {
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 10px !important;
  border: 1px solid var(--m2-dialog-line-strong) !important;
  border-radius: var(--m2-dialog-control-radius) !important;
  outline: 0 !important;
  background: var(--m2-dialog-surface) !important;
  color: var(--m2-dialog-text) !important;
  font-size: 13px !important;
  line-height: 20px !important;
  box-shadow: none !important;
}

body.erp-app :is(
  .account-editor-field textarea,
  .export-file-modal-copy textarea
) {
  height: auto !important;
  min-height: 76px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
  resize: vertical !important;
}

body.erp-app :is(
  .account-editor-field input:focus,
  .account-editor-field select:focus,
  .account-editor-field textarea:focus,
  .export-file-modal-copy input:focus,
  .export-file-modal-copy select:focus,
  .export-file-modal-copy textarea:focus
),
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-input:focus {
  border-color: rgba(47, 107, 79, .68) !important;
  box-shadow: 0 0 0 3px rgba(47, 107, 79, .12) !important;
}

body.erp-app .account-editor-field .password-control button {
  min-width: 40px !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 8px !important;
  border: 0 !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--m2-dialog-muted) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
}

/* Runtime prompt input follows the same quiet form language. */
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-body {
  padding: 0 18px 14px !important;
}

:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-input {
  width: 100% !important;
  min-width: 0 !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  border: 1px solid var(--m2-dialog-line-strong) !important;
  border-radius: var(--m2-dialog-control-radius) !important;
  outline: 0 !important;
  background: var(--m2-dialog-surface) !important;
  color: var(--m2-dialog-text) !important;
  font-family: var(--m2-font-ui, inherit) !important;
  font-size: 13px !important;
  line-height: 20px !important;
  box-shadow: none !important;
}

:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) textarea.runtime-dialog-input {
  height: auto !important;
  min-height: 88px !important;
  padding: 8px 10px !important;
  resize: vertical !important;
}

/* ------------------------------------------------------------------ */
/* Dialog action rows                                                  */
/* ------------------------------------------------------------------ */
body.erp-app :is(
  .system-modal-actions,
  .account-editor-actions,
  .export-file-modal-actions
),
body.source-inbox-frame-page .collector-detail-actions,
body.source-inbox-app .collector-detail-actions,
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-actions {
  flex: 0 0 auto !important;
  min-height: 54px !important;
  height: auto !important;
  max-height: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px !important;
  padding: 10px 18px !important;
  border-top: 1px solid var(--m2-dialog-line) !important;
  border-radius: 0 !important;
  background: var(--m2-dialog-surface-soft) !important;
}

/* Root static modal footer was previously split in half. */
body.erp-app #systemModal .system-modal-actions,
body.erp-app #exportFileModal .export-file-modal-actions {
  display: flex !important;
  justify-content: flex-end !important;
}

body.erp-app :is(
  .system-modal-actions button,
  .export-file-modal-actions button,
  .account-editor-actions button
),
body.source-inbox-frame-page .collector-detail-actions button,
body.source-inbox-app .collector-detail-actions button,
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-actions button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 86px !important;
  width: auto !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  padding: 0 14px !important;
  border-style: solid !important;
  border-width: 1px !important;
  border-radius: var(--m2-dialog-control-radius) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

/* Primary actions: the system's quiet green, not legacy blue. */
body.erp-app :is(
  #accountEditorSubmit,
  #modalConfirmBtn:not(.danger),
  #exportFileConfirm:not(.danger),
  .account-editor-primary:not(:disabled)
),
body.source-inbox-frame-page .collector-detail-actions .collector-button.primary,
body.source-inbox-app .collector-detail-actions .collector-button.primary,
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-button.primary:not(.danger):not(:disabled) {
  border-color: var(--m2-dialog-accent) !important;
  background: var(--m2-dialog-accent) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16) !important;
}

body.erp-app :is(
  #accountEditorSubmit:hover:not(:disabled),
  #modalConfirmBtn:not(.danger):hover:not(:disabled),
  #exportFileConfirm:not(.danger):hover:not(:disabled),
  .account-editor-primary:hover:not(:disabled)
),
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-button.primary:not(.danger):hover:not(:disabled) {
  border-color: var(--m2-dialog-accent-hover) !important;
  background: var(--m2-dialog-accent-hover) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* Destructive actions stay clearly red but restrained. */
body.erp-app #modalConfirmBtn.danger,
body.erp-app #exportFileConfirm.danger,
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-button.danger:not(:disabled) {
  border-color: var(--m2-dialog-danger) !important;
  background: var(--m2-dialog-danger) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12) !important;
}

body.erp-app #modalConfirmBtn.danger:hover:not(:disabled),
body.erp-app #exportFileConfirm.danger:hover:not(:disabled),
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-button.danger:hover:not(:disabled) {
  border-color: #8d3d39 !important;
  background: #8d3d39 !important;
  color: #ffffff !important;
  box-shadow: none !important;
}

/* Secondary actions use a neutral white control. */
body.erp-app :is(
  #accountEditorCancel,
  #modalCancelBtn,
  #exportFileCancel,
  .account-editor-secondary:not(:disabled)
),
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-button.secondary:not(:disabled) {
  border-color: var(--m2-dialog-line-strong) !important;
  background: var(--m2-dialog-surface) !important;
  color: var(--m2-dialog-text) !important;
  box-shadow: none !important;
}

body.erp-app :is(
  #accountEditorCancel:hover:not(:disabled),
  #modalCancelBtn:hover:not(:disabled),
  #exportFileCancel:hover:not(:disabled),
  .account-editor-secondary:hover:not(:disabled)
),
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-button.secondary:hover:not(:disabled) {
  border-color: #b9c4bd !important;
  background: var(--m2-dialog-surface-hover) !important;
  color: #233129 !important;
}

/* Disabled modal controls stay visibly unavailable but not broken. */
body.erp-app :is(
  #accountEditorSubmit,
  #accountEditorCancel,
  #modalCancelBtn,
  #modalConfirmBtn,
  #exportFileCancel,
  #exportFileConfirm
):disabled,
:is(
  body.erp-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app,
  body.source-inbox-frame-page
) .runtime-dialog-button:disabled {
  cursor: not-allowed !important;
  border-color: #e0e5e2 !important;
  background: #f3f5f4 !important;
  color: #a2aba6 !important;
  opacity: 1 !important;
  box-shadow: none !important;
}

/* ------------------------------------------------------------------ */
/* Close and icon controls                                             */
/* ------------------------------------------------------------------ */
body.erp-app :is(
  .account-editor-close,
  .product-detail-close
),
body.source-inbox-frame-page .collector-icon-button,
body.source-inbox-app .collector-icon-button {
  width: 30px !important;
  min-width: 30px !important;
  max-width: 30px !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid var(--m2-dialog-line) !important;
  border-radius: var(--m2-dialog-control-radius) !important;
  background: var(--m2-dialog-surface) !important;
  color: var(--m2-dialog-muted) !important;
  box-shadow: none !important;
  transition:
    background-color .14s ease,
    color .14s ease,
    border-color .14s ease !important;
}

body.erp-app :is(
  .account-editor-close:hover,
  .product-detail-close:hover
),
body.source-inbox-frame-page .collector-icon-button:hover,
body.source-inbox-app .collector-icon-button:hover {
  border-color: var(--m2-dialog-line-strong) !important;
  background: var(--m2-dialog-surface-hover) !important;
  color: var(--m2-dialog-text) !important;
}

body.erp-app :is(
  .account-editor-close svg,
  .product-detail-close svg,
  .erp-image-zoom-close svg
) {
  width: 15px !important;
  height: 15px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
}

/* ------------------------------------------------------------------ */
/* Product and collector drawers                                      */
/* ------------------------------------------------------------------ */
body.erp-app .product-detail-drawer {
  width: min(680px, calc(100vw - 20px)) !important;
  max-width: 680px !important;
  height: 100% !important;
  max-height: 100% !important;
  border: 0 !important;
  border-left: 1px solid var(--m2-dialog-line) !important;
  border-radius: 0 !important;
  box-shadow: -24px 0 70px rgba(20, 28, 24, .18) !important;
  overflow: hidden !important;
}

body.source-inbox-frame-page .collector-detail,
body.source-inbox-app .collector-detail {
  width: min(640px, 94vw) !important;
  max-width: 640px !important;
  border-radius: 0 !important;
  box-shadow: -20px 0 64px rgba(20, 28, 24, .18) !important;
}

body.source-inbox-frame-page .collector-detail-head,
body.source-inbox-app .collector-detail-head {
  min-height: 52px !important;
  height: 52px !important;
  max-height: 52px !important;
  padding: 0 16px !important;
  background: var(--m2-dialog-surface) !important;
}

body.source-inbox-frame-page .collector-detail-head strong,
body.source-inbox-app .collector-detail-head strong {
  color: var(--m2-dialog-accent) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 16px !important;
}

body.source-inbox-frame-page .collector-detail-head h2,
body.source-inbox-app .collector-detail-head h2 {
  margin: 2px 0 0 !important;
  font-size: 13px !important;
  line-height: 1.3 !important;
}

body.source-inbox-frame-page .collector-detail-actions,
body.source-inbox-app .collector-detail-actions {
  min-height: 54px !important;
  height: 54px !important;
  max-height: 54px !important;
  padding: 0 16px !important;
  background: var(--m2-dialog-surface-soft) !important;
}

body.source-inbox-frame-page .collector-detail-section,
body.source-inbox-app .collector-detail-section {
  margin-bottom: 14px !important;
  color: var(--m2-dialog-text) !important;
  background: transparent !important;
}

body.source-inbox-frame-page .collector-detail-section h3,
body.source-inbox-app .collector-detail-section h3 {
  color: var(--m2-dialog-text) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 20px !important;
}

body.source-inbox-frame-page .collector-detail-image-grid,
body.source-inbox-app .collector-detail-image-grid {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)) !important;
  gap: 8px !important;
}

body.source-inbox-frame-page .collector-detail-image,
body.source-inbox-app .collector-detail-image {
  position: relative !important;
  aspect-ratio: 1 !important;
  overflow: hidden !important;
  border: 1px solid rgba(47, 107, 79, .10) !important;
  border-radius: 8px !important;
  background: var(--m2-dialog-surface-soft) !important;
  box-shadow: none !important;
}

body.source-inbox-frame-page .collector-detail-image img,
body.source-inbox-app .collector-detail-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}

body.source-inbox-frame-page .collector-field label,
body.source-inbox-app .collector-field label,
body.erp-app .product-detail-body label {
  color: var(--m2-dialog-muted) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 18px !important;
}

body.source-inbox-frame-page .collector-field textarea,
body.source-inbox-app .collector-field textarea {
  border-color: var(--m2-dialog-line-strong) !important;
  border-radius: var(--m2-dialog-control-radius) !important;
  background: var(--m2-dialog-surface) !important;
  color: var(--m2-dialog-text) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
}

body.source-inbox-frame-page .collector-detail-meta-row,
body.source-inbox-app .collector-detail-meta-row {
  grid-template-columns: 108px minmax(0, 1fr) !important;
  gap: 10px !important;
  padding: 7px 0 !important;
  border-bottom: 1px solid rgba(227, 231, 228, .72) !important;
}

body.source-inbox-frame-page .collector-detail-meta-row dt,
body.source-inbox-app .collector-detail-meta-row dt {
  color: var(--m2-dialog-muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
}

body.source-inbox-frame-page .collector-detail-meta-row dd,
body.source-inbox-app .collector-detail-meta-row dd {
  color: var(--m2-dialog-text) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}

/* ------------------------------------------------------------------ */
/* Image zoom, lightbox and hover preview                              */
/* ------------------------------------------------------------------ */
body.source-inbox-frame-page .collector-image-lightbox,
body.source-inbox-app .collector-image-lightbox {
  padding: 22px !important;
  background: rgba(9, 14, 12, .84) !important;
}

body.source-inbox-frame-page .collector-image-lightbox img,
body.source-inbox-app .collector-image-lightbox img {
  max-width: min(88vw, 1500px) !important;
  max-height: 92vh !important;
  border-radius: 6px !important;
  background: #ffffff !important;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .30) !important;
}

body.source-inbox-frame-page .collector-image-lightbox-close,
body.source-inbox-app .collector-image-lightbox-close {
  position: fixed !important;
  top: 18px !important;
  right: 18px !important;
  width: 34px !important;
  min-width: 34px !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 1px solid rgba(255, 255, 255, .16) !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  background: rgba(18, 26, 22, .62) !important;
  box-shadow: none !important;
  font-size: 20px !important;
  line-height: 1 !important;
}

body.source-inbox-frame-page .collector-image-lightbox-close:hover,
body.source-inbox-app .collector-image-lightbox-close:hover {
  background: rgba(18, 26, 22, .84) !important;
  color: #ffffff !important;
}

body.erp-app .erp-image-zoom-backdrop {
  padding: 18px !important;
  background: rgba(9, 14, 12, .72) !important;
}

body.erp-app .erp-image-zoom-dialog {
  position: relative !important;
  width: auto !important;
  max-width: min(920px, calc(100vw - 36px)) !important;
  max-height: calc(100vh - 36px) !important;
  display: grid !important;
  place-items: center !important;
  padding: 14px !important;
  overflow: hidden !important;
  border: 1px solid rgba(255, 255, 255, .12) !important;
  border-radius: 10px !important;
  background: #ffffff !important;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34) !important;
}

body.erp-app .erp-image-zoom-dialog img {
  display: block !important;
  max-width: calc(100vw - 64px) !important;
  max-height: calc(100vh - 64px) !important;
  border-radius: 5px !important;
  object-fit: contain !important;
  background: #ffffff !important;
}

body.erp-app .erp-image-zoom-close {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  width: 32px !important;
  min-width: 32px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  border-radius: 50% !important;
  color: #ffffff !important;
  background: rgba(18, 26, 22, .60) !important;
  box-shadow: none !important;
}

body.erp-app .erp-image-zoom-close:hover {
  background: rgba(18, 26, 22, .82) !important;
  color: #ffffff !important;
}

/* ------------------------------------------------------------------ */
/* Toasts and floating feedback                                        */
/* ------------------------------------------------------------------ */
:is(
  body.erp-app,
  body.source-inbox-frame-page,
  body.source-inbox-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app
) :is(
  .erp-toast,
  .collector-toast,
  .moduleToast,
  .module-toast,
  .toast
) {
  left: 50% !important;
  right: auto !important;
  bottom: 18px !important;
  z-index: 3000 !important;
  width: auto !important;
  max-width: min(460px, calc(100vw - 32px)) !important;
  min-width: 220px !important;
  min-height: 34px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 8px 14px !important;
  border: 1px solid rgba(255, 255, 255, .10) !important;
  border-radius: 8px !important;
  background: rgba(32, 38, 34, .96) !important;
  color: #ffffff !important;
  box-shadow: 0 12px 30px rgba(16, 23, 19, .18) !important;
  font-size: 12px !important;
  font-weight: 550 !important;
  line-height: 18px !important;
  text-align: center !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
  pointer-events: none !important;
}

:is(
  body.erp-app,
  body.source-inbox-frame-page,
  body.source-inbox-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app
) :is(
  .erp-toast,
  .collector-toast,
  .moduleToast,
  .module-toast,
  .toast
).show {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translate(-50%, 0) !important;
}

:is(
  body.erp-app,
  body.source-inbox-frame-page,
  body.source-inbox-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app
) :is(
  .erp-toast.success,
  .collector-toast.success,
  .moduleToast.success,
  .module-toast.success,
  .toast.success
) {
  border-color: rgba(255, 255, 255, .10) !important;
  background: rgba(47, 107, 79, .96) !important;
}

:is(
  body.erp-app,
  body.source-inbox-frame-page,
  body.source-inbox-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app
) :is(
  .erp-toast.warning,
  .collector-toast.warning,
  .moduleToast.warning,
  .module-toast.warning,
  .toast.warning
) {
  border-color: rgba(255, 255, 255, .10) !important;
  background: rgba(154, 117, 55, .96) !important;
}

:is(
  body.erp-app,
  body.source-inbox-frame-page,
  body.source-inbox-app,
  body.copywriting-app,
  body.api-app,
  body.templates-app
) :is(
  .erp-toast.error,
  .collector-toast.error,
  .moduleToast.error,
  .module-toast.error,
  .toast.error
) {
  border-color: rgba(255, 255, 255, .10) !important;
  background: rgba(166, 81, 76, .97) !important;
}

body.erp-app :is(
  .account-editor-feedback,
  .export-file-message
) {
  min-height: 0 !important;
  margin: 2px 0 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: var(--m2-dialog-muted) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  line-height: 18px !important;
}

body.erp-app .account-editor-feedback.error,
body.erp-app .export-file-message.error {
  color: var(--m2-dialog-danger) !important;
}

body.erp-app .account-editor-feedback.success,
body.erp-app .export-file-message.success {
  color: var(--m2-dialog-accent) !important;
}

/* ------------------------------------------------------------------ */
/* Popover menus                                                       */
/* ------------------------------------------------------------------ */
body.erp-app :is(
  .user-popover,
  .account-action-menu
) {
  border: 1px solid var(--m2-dialog-line) !important;
  border-radius: 9px !important;
  background: var(--m2-dialog-surface) !important;
  box-shadow: var(--m2-dialog-menu-shadow) !important;
}

body.erp-app .account-action-menu {
  width: 168px !important;
  min-width: 168px !important;
  padding: 5px !important;
  overflow: hidden !important;
}

body.erp-app .account-action-menu button {
  width: 100% !important;
  min-width: 0 !important;
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
  margin: 0 !important;
  padding: 0 9px !important;
  border: 0 !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: var(--m2-dialog-text) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  text-align: left !important;
}

body.erp-app .account-action-menu button:hover {
  background: var(--m2-dialog-surface-hover) !important;
  color: var(--m2-dialog-text) !important;
}

body.erp-app .account-action-menu button.danger {
  color: var(--m2-dialog-danger) !important;
}

body.erp-app .account-action-menu button.danger:hover {
  background: var(--m2-dialog-danger-soft) !important;
  color: var(--m2-dialog-danger) !important;
}

/* ------------------------------------------------------------------ */
/* Small responsive refinements                                        */
/* ------------------------------------------------------------------ */
@media (max-width: 720px) {
  :is(
    body.erp-app,
    body.copywriting-app,
    body.api-app,
    body.templates-app,
    body.source-inbox-frame-page
  ) :is(
    .modal-backdrop,
    .account-editor-backdrop,
    .dialog-backdrop,
    .runtime-dialog-backdrop
  ) {
    padding: 12px !important;
    align-items: center !important;
  }

  body.erp-app .account-editor-fields {
    grid-template-columns: 1fr !important;
  }

  body.source-inbox-frame-page .collector-detail,
  body.source-inbox-app .collector-detail,
  body.erp-app .product-detail-drawer {
    width: min(100vw, 100%) !important;
    max-width: 100vw !important;
  }

  body.erp-app :is(
    .system-modal,
    .account-editor-modal,
    .export-file-modal
  ),
  :is(
    body.erp-app,
    body.copywriting-app,
    body.api-app,
    body.templates-app,
    body.source-inbox-frame-page
  ) .runtime-dialog {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  :is(
    body.erp-app,
    body.source-inbox-frame-page,
    body.source-inbox-app,
    body.copywriting-app,
    body.api-app,
    body.templates-app
  ) :is(
    .modal-backdrop,
    .account-editor-backdrop,
    .product-detail-backdrop,
    .erp-image-zoom-backdrop,
    .runtime-dialog-backdrop,
    .collector-detail-backdrop
  ) {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

body.erp-app .export-product-mode-fixed {
  width: 100% !important;
  height: 38px !important;
  display: flex !important;
  align-items: center !important;
  margin: 0 0 12px !important;
  padding: 0 12px !important;
  border: 1px solid var(--yftx-line-strong) !important;
  border-radius: var(--yftx-radius-control) !important;
  background: var(--yftx-surface-soft) !important;
  color: var(--yftx-muted) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
}
