.cms-editor-toolbar,
.cms-edit-button,
.cms-modal,
.cms-toast {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.cms-editor-toolbar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20000;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px 10px 16px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(7, 19, 34, .92);
  box-shadow: 0 18px 55px rgba(7, 19, 34, .28);
  color: #ffffff;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.cms-editor-toolbar strong {
  font-size: 13px;
  letter-spacing: .02em;
}

.cms-editor-toolbar button,
.cms-modal button,
.cms-modal label.cms-upload-control {
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.cms-editor-toolbar button {
  min-height: 34px;
  padding: 0 13px;
  background: linear-gradient(135deg, #ff982f, #ffb15f);
  color: #071322;
}

.cms-edit-button {
  position: absolute;
  z-index: 19990;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  background: linear-gradient(135deg, #ff982f, #ffb15f);
  box-shadow: 0 10px 28px rgba(7, 19, 34, .22);
  color: #071322;
  cursor: pointer;
  transition: box-shadow 180ms ease, opacity 180ms ease;
}

.cms-edit-button::before {
  content: "\270E";
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
}

.cms-edit-button:hover,
.cms-edit-button:focus-visible {
  box-shadow: 0 0 0 5px rgba(255, 152, 47, .22), 0 14px 34px rgba(7, 19, 34, .25);
  outline: none;
}

.cms-edit-button[data-cms-kind="image"],
.cms-edit-button[data-cms-kind="background"] {
  background: #ffffff;
  color: #ff982f;
}

.cms-edit-mode [data-cms-editable="text"],
.cms-edit-mode [data-cms-editable="image"],
.cms-edit-mode [data-cms-editable="background"] {
  outline: 1px dashed rgba(255, 152, 47, .34);
  outline-offset: 4px;
}

.cms-modal {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(7, 19, 34, .62);
}

.cms-modal[hidden] {
  display: none;
}

.cms-modal-panel {
  width: min(100%, 760px);
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
  color: #101827;
}

.cms-modal-head {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(16, 24, 39, .1);
}

.cms-modal-head h2 {
  margin: 0;
  font-size: clamp(22px, 4vw, 30px);
  line-height: 1.15;
}

.cms-modal-close {
  width: 38px;
  height: 38px;
  background: rgba(16, 24, 39, .06);
  color: #101827;
}

.cms-modal-body {
  padding: 24px;
}

.cms-field {
  display: grid;
  gap: 10px;
}

.cms-field label {
  color: #344053;
  font-size: 13px;
  font-weight: 850;
}

.cms-field textarea {
  width: 100%;
  min-height: 170px;
  resize: vertical;
  border: 1px solid rgba(16, 24, 39, .14);
  border-radius: 16px;
  padding: 14px 15px;
  color: #101827;
  font: inherit;
  line-height: 1.55;
}

.cms-field textarea:focus {
  border-color: #ff982f;
  box-shadow: 0 0 0 4px rgba(255, 152, 47, .16);
  outline: none;
}

.cms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.cms-action-primary {
  min-height: 44px;
  padding: 0 18px;
  background: linear-gradient(135deg, #ff982f, #ffb15f);
  color: #071322;
}

.cms-action-secondary {
  min-height: 44px;
  padding: 0 18px;
  background: rgba(16, 24, 39, .07);
  color: #101827;
}

.cms-gallery-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.cms-gallery-top p {
  width: min(100%, 420px);
  margin: 0;
  color: #667085;
  line-height: 1.55;
}

.cms-upload-control {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 0 18px;
  background: #071322;
  color: #ffffff;
}

.cms-upload-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.cms-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 14px;
}

.cms-gallery-item {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(16, 24, 39, .1);
  border-radius: 16px;
  background: #f6f7f8;
}

.cms-gallery-select {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

.cms-gallery-select img {
  width: 100%;
  aspect-ratio: 1.28;
  object-fit: cover;
}

.cms-gallery-name {
  display: block;
  overflow: hidden;
  padding: 9px 10px 10px;
  color: #344053;
  font-size: 12px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cms-gallery-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  background: rgba(7, 19, 34, .86);
  color: #ffffff;
}

.cms-gallery-empty,
.cms-gallery-loading {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  border-radius: 16px;
  background: #f6f7f8;
  color: #667085;
}

.cms-toast {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 31000;
  max-width: min(360px, calc(100vw - 36px));
  padding: 12px 15px;
  border-radius: 14px;
  background: #071322;
  box-shadow: 0 18px 55px rgba(7, 19, 34, .26);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.cms-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 720px) {
  .cms-editor-toolbar {
    right: 12px;
    bottom: 12px;
    left: 12px;
    justify-content: space-between;
    border-radius: 18px;
  }

  .cms-edit-button {
    width: 32px;
    height: 32px;
  }

  .cms-modal {
    padding: 12px;
  }

  .cms-modal-panel {
    max-height: calc(100vh - 24px);
    border-radius: 20px;
  }

  .cms-modal-head,
  .cms-modal-body {
    padding: 18px;
  }

  .cms-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
