/* One shared kit/native-editor toolbar. Never absolute-position over tabs. */
html body .ui-editor-history-toolbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  flex-wrap: wrap; min-width: 0;
}
html body .ui-editor-history-toolbar :is([data-builder-design-history], .ui-editor-mirror-history) {
  display: flex; align-items: center; gap: 4px; flex: 0 0 auto;
}
html body .ui-editor-history-toolbar [data-builder-design-history].is-hidden { display: none; }
html body .ui-editor-history-toolbar :is([hidden], .is-hidden) { display: none !important; }
html body .ui-editor-history-toolbar :is(.ui-editor-history-button, .ui-editor-save-changes) {
  display: inline-flex; align-items: center; justify-content: center;
  box-sizing: border-box; flex-shrink: 0; height: 44px !important; min-height: 44px !important;
  max-height: 44px; margin: 0; line-height: 1; white-space: nowrap;
}
html body .ui-editor-history-toolbar .ui-editor-history-button {
  width: 44px !important; min-width: 44px !important; padding: 10px !important; border: 1px solid transparent;
  border-radius: 10px; background: transparent; box-shadow: none; cursor: pointer;
}
html body .ui-editor-history-toolbar .ui-editor-history-button img { width: 24px; height: 24px; object-fit: contain; }
html:is([data-ui-version='v2'], [data-ui-kit-reference]) body .ui-editor-history-toolbar button.ui-editor-history-button.ui-icon-control {
  background: transparent !important; border-color: transparent !important; box-shadow: none !important;
}
html body .ui-editor-history-toolbar .ui-editor-save-changes {
  width: auto; min-width: 120px; padding: 0 16px !important; border-radius: 10px;
  border: 1px solid transparent; background: var(--ui-blue, #1559ed); color: #fff;
  font: 800 13px/1 var(--ui-font, Manrope, sans-serif); cursor: pointer;
}
html[data-ui-version='v2'] body .ui-editor-controls :is(.ui-editor-tools, .ui-editor-footer-toolbar) .ui-editor-save-changes {
  --ui-action-height: 44px; --ui-action-font-size: 13px;
  font: 800 13px/1 var(--ui-font, Manrope, sans-serif);
}
html body .ui-editor-history-toolbar :is(.ui-editor-history-button, .ui-editor-save-changes):disabled {
  cursor: not-allowed; opacity: .5;
}
html body .ui-editor-history-toolbar :is(.ui-editor-history-button, .ui-editor-save-changes):focus-visible {
  outline: 2px solid var(--ui-blue, #1559ed); outline-offset: 3px;
}
.ui-editor-toolbar-row { display: none; }
html body .ui-editor-footer-toolbar { display: none; }
.ui-kit-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; }
@media (min-width: 1101px) {
  .ui-editor-layout { container-type: inline-size; container-name: editor-workspace; }
  html body .ui-editor-controls > .ui-editor-toolbar-row {
    display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between;
    gap: 12px; padding: 8px 26px; border-bottom: 1px solid var(--ui-line);
  }
  html body .ui-editor-toolbar-row > .tabs {
    flex: 0 1 auto; width: auto; min-width: 0; gap: 3px; margin: 0; padding: 0; border: 0;
    align-items: center; flex-wrap: nowrap;
  }
  html body .ui-editor-toolbar-row > .tabs > .tab {
    flex: 0 0 auto; width: auto; letter-spacing: normal; font: 800 13px/1 Manrope, sans-serif;
  }
  html body .ui-editor-controls .ui-editor-toolbar-row > .ui-editor-tools {
    position: static; flex: 0 0 auto; padding: 0; margin: 0 0 0 auto;
    min-height: 44px; background: transparent; border: 0; flex-wrap: nowrap;
  }
  html body .ui-editor-footer-toolbar { display: flex; flex-wrap: nowrap; margin-left: auto; }
  html body .ui-editor-controls > .ui-editor-actions { flex-wrap: nowrap; }
  .ui-editor-actions > [data-ui-editor-preview-link] { flex: 0 0 auto; }
  @container editor-workspace (max-width: 1040px) {
    .ui-editor-layout > :is(.ui-editor-preview, .ui-editor-controls) { grid-column: 1 / -1; }
    .ui-editor-layout > .ui-editor-preview { position: static; width: 100%; max-width: 435px; box-sizing: border-box; }
  }
  html body .ui-editor-toolbar-row .saved-header > span { display: none; }
  /* The native mobile theme wrapper must not leave a trailing flex gap when
     its theme button is hidden on desktop. Keep any real controls intact. */
  html body .ui-editor-toolbar-row .saved-header > .header-right { display: contents; }
}
@media (max-width: 1100px) {
  /* A standalone mobile footer action fills the same width as the editor. */
  .ui-editor-actions > [data-ui-editor-preview-link] { width: 100%; box-sizing: border-box; }
  /* Mobile retains Save & Next. This additional native Save is available next
     to history on Design only, without opening the hidden desktop header. */
  html body .ui-editor-preview .saved-header.ui-editor-history-toolbar:not(:has([data-builder-design-history].is-hidden)) .ui-editor-save-changes { display: inline-flex; }
}
