:root {
  --mymex-feedback-radius: 16px;
  --mymex-feedback-shadow: 0 14px 34px rgba(3, 20, 40, .12);
  --mymex-feedback-success-fg: #086948;
  --mymex-feedback-success-bg: #eafaf4;
  --mymex-feedback-success-line: #9fe2c9;
  --mymex-feedback-error-fg: #972f38;
  --mymex-feedback-error-bg: #fff0f1;
  --mymex-feedback-error-line: #f0b6b6;
  --mymex-feedback-info-fg: #075985;
  --mymex-feedback-info-bg: #eefaff;
  --mymex-feedback-info-line: #9bdcf5;
  --mymex-feedback-dark-bg: #071b32;
  --mymex-feedback-dark-surface: #0a2b4a;
  --mymex-feedback-dark-line: rgba(105, 205, 255, .28);
  --mymex-feedback-dark-text: #e7f8ff;
}

/* One visual language for inline outcomes across platform, tenant, builder,
   login, CRM, public and marketing surfaces. Layout-specific positioning is
   deliberately left to the owning component. */
:where(
  .tenant-notice,
  .ford-success,
  .ford-alert,
  .mymex-tenant-management-feedback,
  .platform-media-gallery-notice,
  .ford-builder-exit-status,
  .ford-builder-destination-help,
  .mymex-jarvis-voice-status,
  .mymex-jarvis-support-status,
  .tenant-integration-test-result,
  .tenant-integration-status,
  .mymex-site-share.is-error,
  .mymex-public-jarvis-message.is-error
) {
  box-sizing: border-box;
  border-radius: var(--mymex-feedback-radius);
  box-shadow: var(--mymex-feedback-shadow);
  font-weight: 750;
  line-height: 1.45;
}

:where(
  .tenant-notice-success,
  .ford-success,
  .mymex-tenant-management-feedback:not(.is-error),
  .platform-media-gallery-notice:not(.is-error),
  .ford-builder-exit-status[data-state="success"],
  .ford-builder-destination-help.is-success,
  .mymex-jarvis-voice-status.is-success,
  .mymex-jarvis-support-status.is-success,
  .tenant-integration-test-result.is-success,
  .tenant-integration-status.is-success
) {
  color: var(--mymex-feedback-success-fg);
  border-color: var(--mymex-feedback-success-line);
  background: linear-gradient(135deg, #f4fff9, var(--mymex-feedback-success-bg));
}

:where(
  .tenant-notice-error,
  .ford-alert,
  .mymex-tenant-management-feedback.is-error,
  .platform-media-gallery-notice.is-error,
  .ford-builder-exit-status:not([data-state]),
  .ford-builder-destination-help.is-error,
  .mymex-jarvis-voice-status.is-error,
  .mymex-jarvis-support-status.is-error,
  .tenant-integration-test-result.is-error,
  .tenant-integration-status.is-error,
  .mymex-site-share.is-error,
  .mymex-public-jarvis-message.is-error
) {
  color: var(--mymex-feedback-error-fg);
  border-color: var(--mymex-feedback-error-line);
  background: linear-gradient(135deg, #fff8f8, var(--mymex-feedback-error-bg));
}

:where(
  .ford-builder-exit-status[data-state="saving"],
  .mymex-jarvis-voice-status.is-loading,
  .mymex-jarvis-support-status.is-loading,
  .tenant-content-ai-status:not([hidden]),
  .tenant-media-status:not(:empty),
  .mymex-profile-copy-status:not(:empty),
  [data-blog-ai-status].is-loading
) {
  color: var(--mymex-feedback-dark-text);
  border-color: var(--mymex-feedback-dark-line);
  background: linear-gradient(135deg, var(--mymex-feedback-dark-bg), var(--mymex-feedback-dark-surface));
  box-shadow: 0 14px 34px rgba(3, 20, 40, .18);
}

/* Toasts keep their existing position and transitions while sharing the same
   surface, border, radius and contrast contract. */
:where(.toast, .ford-toast) {
  color: #f7fbff;
  border: 1px solid var(--mymex-feedback-dark-line);
  border-radius: var(--mymex-feedback-radius);
  background: linear-gradient(135deg, var(--mymex-feedback-dark-bg), var(--mymex-feedback-dark-surface));
  box-shadow: 0 18px 48px rgba(2, 12, 28, .28);
  font-weight: 750;
}

:where(
  [data-mymex-theme="dark"],
  [data-theme="dark"],
  [data-hub-theme="dark"],
  [data-content-theme="dark"]
) :where(
  .tenant-notice-success,
  .ford-success,
  .mymex-tenant-management-feedback:not(.is-error),
  .platform-media-gallery-notice:not(.is-error),
  .ford-builder-exit-status[data-state="success"],
  .ford-builder-destination-help.is-success,
  .mymex-jarvis-voice-status.is-success,
  .mymex-jarvis-support-status.is-success,
  .tenant-integration-test-result.is-success,
  .tenant-integration-status.is-success
) {
  color: #bff7df;
  border-color: rgba(57, 223, 166, .34);
  background: linear-gradient(135deg, rgba(8, 74, 54, .82), rgba(12, 51, 45, .92));
}

:where(
  [data-mymex-theme="dark"],
  [data-theme="dark"],
  [data-hub-theme="dark"],
  [data-content-theme="dark"]
) :where(
  .tenant-notice-error,
  .ford-alert,
  .mymex-tenant-management-feedback.is-error,
  .platform-media-gallery-notice.is-error,
  .ford-builder-exit-status:not([data-state]),
  .ford-builder-destination-help.is-error,
  .mymex-jarvis-voice-status.is-error,
  .mymex-jarvis-support-status.is-error,
  .tenant-integration-test-result.is-error,
  .tenant-integration-status.is-error,
  .mymex-site-share.is-error,
  .mymex-public-jarvis-message.is-error
) {
  color: #ffd0d2;
  border-color: rgba(255, 125, 130, .36);
  background: linear-gradient(135deg, rgba(91, 28, 34, .88), rgba(58, 23, 31, .94));
}

@media (max-width: 680px) {
  :where(
    .tenant-notice,
    .ford-success,
    .ford-alert,
    .mymex-tenant-management-feedback,
    .platform-media-gallery-notice,
    .ford-builder-exit-status,
    .ford-builder-destination-help,
    .mymex-jarvis-voice-status,
    .mymex-jarvis-support-status,
    .tenant-integration-test-result,
    .tenant-integration-status
  ) {
    border-radius: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(.toast, .ford-toast) {
    transition-duration: .01ms !important;
  }
}

[data-feedback-promoted][hidden] { display: none !important; }

.mymex-feedback-stack {
  position: fixed;
  z-index: 12000;
  top: calc(env(safe-area-inset-top, 0px) + 70px);
  right: 16px;
  width: min(360px, calc(100vw - 32px));
  max-height: calc(100dvh - 86px);
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  pointer-events: none;
}
.mymex-feedback-toast {
  box-sizing: border-box;
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 30px;
  gap: 9px;
  align-items: start;
  padding: 12px;
  border: 1px solid #9fe2c9;
  border-radius: 8px;
  color: #07563c;
  background: #f2fff9;
  box-shadow: 0 12px 32px rgba(2, 23, 42, .2);
  pointer-events: auto;
}
.mymex-feedback-toast.is-error { border-color: #e8aeb2; color: #84252e; background: #fff5f5; }
.mymex-feedback-toast__icon { width: 24px; height: 24px; display: grid; place-items: center; }
.mymex-feedback-toast__icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mymex-feedback-toast p { min-width: 0; margin: 1px 0 0; font-size: 13px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.mymex-feedback-toast__close { width: 30px; height: 30px; margin: -3px -3px 0 0; padding: 6px; display: grid; place-items: center; border: 0; border-radius: 6px; color: inherit; background: transparent; cursor: pointer; }
.mymex-feedback-toast__close:hover { background: rgba(4, 36, 56, .08); }
.mymex-feedback-toast__close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.mymex-feedback-toast__close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

[data-mymex-theme="dark"] .mymex-feedback-toast { color: #c3f7dc; border-color: #287f66; background: #0a302d; }
[data-mymex-theme="dark"] .mymex-feedback-toast.is-error { color: #ffd5d7; border-color: #9e4f58; background: #442129; }

@media (max-width: 560px) {
  .mymex-feedback-stack { top: calc(env(safe-area-inset-top, 0px) + 58px); right: 12px; width: min(340px, calc(100vw - 24px)); max-height: calc(100dvh - 70px); }
}

.tenant-digest-eligibility { padding: 0 12px; border: 1px solid #cfe0eb; border-radius: 8px; color: var(--tenant-ink, #10243d); background: var(--tenant-surface, #fff); }
.tenant-digest-eligibility summary { min-height: 42px; padding: 11px 0; box-sizing: border-box; cursor: pointer; font-size: 12px; }
.tenant-digest-eligibility summary strong { font-size: 12px; }
.tenant-digest-eligibility summary span { float: right; color: var(--tenant-primary, #075da6); font-size: 11px; font-weight: 700; }
.tenant-digest-eligibility p { margin: 0 0 11px; color: var(--tenant-muted, #526b84); font-size: 11px; line-height: 1.5; }
[data-mymex-theme="dark"] .tenant-digest-eligibility summary span { color: #a9e5ff; }
