.x0-editor {
  background: transparent;
  transition: border-color 0.2s ease;
}

.x0-editor:hover {
  border-color: #ffdd93;
}

.x0-editor-toolbar {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 80;
  padding-bottom: 6px;
}

.x0-editor-toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.x0-editor-toolbar-row-mode {
  width: auto;
  padding: 5px;
  border: 1px solid #d9d6cf;
  background: #f8f8f6;
}

.x0-editor-toolbar-row-primary,
.x0-editor-toolbar-row-insert,
.x0-editor-toolbar-row-boxes {
  padding: 5px;
  border: 1px solid #d9d6cf;
  background: #f8f8f6;
}

.x0-editor-toolbar-row-boxes {
  padding-top: 5px;
}

.x0-editor-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.x0-editor-mode-nav {
  border: 0;
  background: transparent;
  padding: 0;
  min-height: 28px;
}

.x0-editor-mode-btn {
  min-height: 26px;
  padding: 4px 9px;
  font-size: max(10px, calc(var(--theme-font-size, 19px) - 8px));
}

.x0-editor-group-bootx0 {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.x0-editor-snippet-select {
  min-width: 180px;
  max-width: 240px;
}

.x0-editor-btn,
.x0-editor-select {
  border: 1px solid #f0d9a8;
  background: #fff;
  color: #141414;
  font-size: max(11px, calc(var(--theme-font-size, 19px) - 6px));
  line-height: 1;
  min-height: 28px;
  padding: 4px 7px;
}

.x0-editor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 28px;
  white-space: nowrap;
}

.x0-editor-btn .bi {
  font-size: 1.1em;
  -webkit-text-stroke: .25px currentColor;
}

.x0-editor-btn:hover,
.x0-editor-btn:focus,
.x0-editor-select:hover,
.x0-editor-select:focus {
  border-color: #ffdd93;
  background: #f4f3f1;
  box-shadow: none;
}

.x0-editor-btn.is-active {
  border-color: #ffdd93;
  background: #ece9e2;
  font-weight: 700;
}

.x0-editor-surface {
  min-height: 260px;
  padding: 10px;
  outline: none;
  border: 1px solid #d9d6cf;
  background: #fff;
  margin-top: 8px;
}

.x0-editor-source {
  width: 100%;
  min-height: 260px;
  border: 1px solid #d9d6cf;
  padding: 10px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  resize: vertical;
  background: #fafaf9;
  color: #1a1a1a;
  margin-top: 8px;
}

.x0-editor-divider {
  height: 1px;
  width: 100%;
  margin: 10px 0 0;
  background: linear-gradient(90deg, transparent, #d9d6cf 15%, #d9d6cf 85%, transparent);
}

.x0-editor-meta {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 6px;
  color: #68645d;
  font-size: max(11px, calc(var(--theme-font-size, 19px) - 7px));
}

.x0-editor-group-boxes .x0-editor-btn {
  min-width: 112px;
}

body.dark .x0-editor-toolbar,
body.admin-body.dark .x0-editor-toolbar {
  background: transparent;
  border-color: transparent;
}

body.dark .x0-editor-toolbar-row-mode,
body.dark .x0-editor-toolbar-row-primary,
body.dark .x0-editor-toolbar-row-insert,
body.dark .x0-editor-toolbar-row-boxes,
body.admin-body.dark .x0-editor-toolbar-row-mode,
body.admin-body.dark .x0-editor-toolbar-row-primary,
body.admin-body.dark .x0-editor-toolbar-row-insert,
body.admin-body.dark .x0-editor-toolbar-row-boxes {
  background: #191918;
  border-color: #34322f;
}

body.dark .x0-editor-surface,
body.dark .x0-editor-source,
body.admin-body.dark .x0-editor-surface,
body.admin-body.dark .x0-editor-source {
  background: #111;
  border-color: #3d3933;
  color: #f3f0e8;
}

.x0-editor-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10080;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, .34);
}

.x0-editor-dialog {
  width: min(430px, 100%);
  border: 1px solid #ffdd93;
  border-radius: 3px;
  background: #fff;
  color: #141414;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .18);
}

.x0-editor-gallery-dialog {
  width: min(780px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
}

.x0-editor-gallery-dialog .x0-editor-dialog-form {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
}

.x0-editor-gallery-controls,
.x0-editor-gallery-images {
  min-width: 0;
  margin: 0;
  padding: 9px;
  border: 1px solid #d9d6cf;
}

.x0-editor-gallery-images {
  grid-column: 1 / -1;
}

.x0-editor-gallery-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.x0-editor-gallery-controls legend,
.x0-editor-gallery-images legend {
  padding: 0 5px;
  color: #68645d;
  font-size: 12px;
}

.x0-editor-gallery-control,
.x0-editor-gallery-choice {
  cursor: pointer;
}

.x0-editor-gallery-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.x0-editor-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow: auto;
}

.x0-editor-gallery-choice {
  display: grid;
  grid-template-rows: 76px auto;
  gap: 5px;
  position: relative;
  min-width: 0;
  padding: 5px;
  border: 1px solid #d9d6cf;
}

.x0-editor-gallery-choice:has(input:checked) {
  border-color: #ffdd93;
  background: #efeeeb;
}

.x0-editor-gallery-choice input {
  position: absolute;
  top: 7px;
  inset-inline-start: 7px;
}

.x0-editor-gallery-choice img {
  width: 100%;
  height: 76px;
  object-fit: cover;
}

.x0-editor-gallery-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

body.dark .x0-editor-gallery-controls,
body.dark .x0-editor-gallery-images,
body.dark .x0-editor-gallery-choice,
body.admin-body.dark .x0-editor-gallery-controls,
body.admin-body.dark .x0-editor-gallery-images,
body.admin-body.dark .x0-editor-gallery-choice {
  border-color: #3d3933;
}

body.dark .x0-editor-gallery-choice:has(input:checked),
body.admin-body.dark .x0-editor-gallery-choice:has(input:checked) {
  border-color: #ffdd93;
  background: #272624;
}

.x0-editor-dialog-header {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid #e2e2e2;
  background: #fafafa;
}

.x0-editor-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-inline-start: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.x0-editor-dialog-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.x0-editor-dialog-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  color: #68645d;
}

.x0-editor-dialog-field-wide,
.x0-editor-dialog-actions {
  grid-column: 1 / -1;
}

.x0-editor-dialog-field input,
.x0-editor-dialog-field select {
  width: 100%;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid #d9d6cf;
  border-radius: 0;
  background: #fff;
  color: #141414;
  box-sizing: border-box;
}

.x0-editor-dialog-field input:hover,
.x0-editor-dialog-field input:focus,
.x0-editor-dialog-field select:hover,
.x0-editor-dialog-field select:focus {
  border-color: #ffdd93;
  background: #f4f3f1;
  outline: 0;
}

.x0-editor-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 3px;
}

.x0-editor-dialog-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid #d9d6cf;
  background: #fff;
  color: #141414;
}

.x0-editor-dialog-actions button:hover,
.x0-editor-dialog-actions button:focus {
  border-color: #ffdd93;
  background: #efeeeb;
  outline: 0;
}

.x0-editor-dialog-insert {
  border-color: #ffdd93 !important;
  background: #efeeeb !important;
}

body.dark .x0-editor-dialog,
body.admin-body.dark .x0-editor-dialog {
  background: #111;
  color: #f3f0e8;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .4);
}

body.dark .x0-editor-dialog-header,
body.admin-body.dark .x0-editor-dialog-header {
  border-bottom-color: #3d3933;
  background: #191918;
}

body.dark .x0-editor-dialog-field,
body.admin-body.dark .x0-editor-dialog-field {
  color: #b9b4aa;
}

body.dark .x0-editor-dialog-field input,
body.dark .x0-editor-dialog-field select,
body.dark .x0-editor-dialog-actions button,
body.admin-body.dark .x0-editor-dialog-field input,
body.admin-body.dark .x0-editor-dialog-field select,
body.admin-body.dark .x0-editor-dialog-actions button {
  border-color: #3d3933;
  background: #191918;
  color: #f3f0e8;
}

body.dark .x0-editor-dialog-field input:hover,
body.dark .x0-editor-dialog-field input:focus,
body.dark .x0-editor-dialog-field select:hover,
body.dark .x0-editor-dialog-field select:focus,
body.dark .x0-editor-dialog-actions button:hover,
body.dark .x0-editor-dialog-actions button:focus,
body.admin-body.dark .x0-editor-dialog-field input:hover,
body.admin-body.dark .x0-editor-dialog-field input:focus,
body.admin-body.dark .x0-editor-dialog-field select:hover,
body.admin-body.dark .x0-editor-dialog-field select:focus,
body.admin-body.dark .x0-editor-dialog-actions button:hover,
body.admin-body.dark .x0-editor-dialog-actions button:focus {
  border-color: #ffdd93;
  background: #272624;
}

@media (max-width: 520px) {
  .x0-editor-dialog-form {
    grid-template-columns: 1fr;
  }

  .x0-editor-dialog-field-wide,
  .x0-editor-dialog-actions {
    grid-column: 1;
  }
}
