/* The editor is appended to the document body, outside the page builder's form styles. */
dialog.e5f-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 12px;
  width: min(560px, calc(100% - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #fefcf4;
  color: #27251e;
  font: 400 16px/1.45 Poppins, system-ui, sans-serif;
  text-align: left;
  box-shadow: 0 16px 64px rgb(0 0 0 / 25%);
}
.e5f-dialog:not([open]), .e5f-feedback [hidden] { display: none !important; }
.e5f-dialog::backdrop { background: rgb(20 19 15 / 70%); }
.e5f-content { padding: clamp(16px, 4vw, 26px); }
.e5f-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.e5f-heading h2 { margin: 0; padding: 0; color: inherit; font: 650 clamp(21px, 4vw, 27px)/1.2 Poppins, system-ui, sans-serif; letter-spacing: -.025em; text-transform: none; }
.e5f-mode { border: 1px solid #cdbd86; border-radius: 100px; padding: 2px 10px; color: #67531e; font-size: 12px; white-space: nowrap; }
.e5f-dialog #e5f-help { margin: 8px 0 15px; font: inherit; font-size: 14px; color: #514d42; }
.e5f-stage {
  position: relative; overflow: hidden; display: block; width: 100%; margin: 0;
  height: clamp(160px, 44vh, 320px); height: clamp(160px, 44dvh, 320px); border-radius: 8px;
  background: #292825;
}
.e5f-stage > img { display: block; max-width: 100%; max-height: 100%; }
.e5f-loading { position: absolute; inset: 0; display: grid; place-items: center; color: white; font-size: 14px; }
.e5f-stage .cropper-view-box { outline: 2px solid #dfcc7c; outline-offset: -1px; }
.e5f-stage .cropper-point, .e5f-stage .cropper-line { background: #dfcc7c; }
.e5f-stage .cropper-point { width: 10px; height: 10px; opacity: 1; }
.e5f-stage .cropper-point::before { content: ""; position: absolute; inset: -7px; }
.e5f-dialog button, .e5f-feedback button.e5f-link {
  box-sizing: border-box; appearance: none; display: inline-block; margin: 0;
  min-width: 0; min-height: 44px; padding: 8px 14px; border: 1px solid #c9c2ad; border-radius: 8px;
  background: #fff; color: #302b1f; font: 550 14px/1.3 Poppins, system-ui, sans-serif;
  text-align: center; text-transform: none; letter-spacing: normal; cursor: pointer; box-shadow: none;
}
.e5f-dialog button:disabled { opacity: .55; cursor: wait; }
.e5f-dialog :focus-visible, .e5f-feedback button:focus-visible { outline: 3px solid #776b91; outline-offset: 2px; }
.e5f-stage:focus-visible { outline-offset: -3px; }
.e5f-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; }
.e5f-tools button { width: 44px; padding: 4px; font-size: 19px; }
.e5f-width { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 0 auto; }
.e5f-width input { width: 76px; min-height: 34px; margin: 0; padding: 0; accent-color: #76601c; }
.e5f-footer { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.e5f-dialog button[data-save] {
  background: linear-gradient(72deg, #B0891E 10%, #D8C25F 42%, #DFCC7C 52%, #B0891E 90%);
  color: #fff; text-shadow: 0 1px 2px #554218; font-weight: 650; border-color: transparent;
}
.e5f-dialog button:not(:disabled):hover, .e5f-feedback button.e5f-link:hover { filter: brightness(.95); }
.e5f-result { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-top: 9px; }
.e5f-thumb { width: 68px; height: 68px; object-fit: contain; border-radius: 6px; background: #fefcf4; }
.e5f-result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.e5f-feedback button.e5f-link { border: 0; padding: 6px 3px; background: transparent; text-decoration: underline; text-underline-offset: 3px; color: #65511a; }
.e5f-feedback .e5f-error, .e5f-dialog .e5f-error { margin: 7px 0 0; padding: 0; color: #8e3f36; font-size: 14px; line-height: 1.45; }
.e5f-error:empty { display: none; }
@media (max-width: 400px) {
  .e5f-footer { display: grid; grid-template-columns: auto 1fr; }
  .e5f-footer button { padding-inline: 8px; }
  .e5f-width { flex: 1 1 100%; margin-left: 0; }
  .e5f-width input { flex: 1; }
}
