.be-shell {
  --be-border: #d8dee5;
  --be-bg: #f7f9fb;
  --be-btn: #ffffff;
  --be-btn-hover: #edf2f7;
  --be-text: #112033;
  --be-height: 420px;
  border: 1px solid var(--be-border);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: var(--be-text);
}

.be-shell.is-sticky-fixed {
  box-shadow: 0 10px 28px rgba(17, 32, 51, 0.2);
}

.be-sticky-spacer {
  width: 100%;
}

.be-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(180deg, #fdfefe 0%, var(--be-bg) 100%);
  border-bottom: 1px solid var(--be-border);
}

.be-toolbar-wordcount {
  margin-left: auto;
  align-self: flex-end;
  font-size: 12px;
  color: #6f7b89;
  padding: 0 4px 2px 4px;
}

.be-toolbar-group {
  display: inline-flex;
  gap: 4px;
  padding-right: 8px;
  margin-right: 8px;
  border-right: 1px solid var(--be-border);
}

.be-toolbar-group:last-child {
  border-right: 0;
  margin-right: 0;
  padding-right: 0;
}

.be-btn {
  width: 45px;
  height: 41px;
  font-size: 14px;
  border: 1px solid var(--be-border);
  border-radius: 6px;
  background: var(--be-btn);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.be-btn:hover {
  background: var(--be-btn-hover);
}

@media screen and (max-width: 1600px) {
.be-btn {
  width: 40px;
  height: 40px;
}
}

@media screen and (max-width: 1480px) {
.be-btn {
  width: 35px;
  height: 35px;
}
}

@media screen and (max-width: 1350px) {
.be-btn {
  width: 30px;
  height: 30px;
}

}

.be-btn.is-active {
  border-color: #0b67ca;
  box-shadow: 0 0 0 2px rgba(11, 103, 202, 0.14);
}

.be-specialchar-btn {
  width: auto;
  height: 56px;
  font-size: 31px;
  border: 1px solid var(--be-border);
  border-radius: 6px;
  background: var(--be-btn);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #666;
}

.be-select {
  height: 40px;
  border: 1px solid var(--be-border);
  border-radius: 6px;
  background: #fff;
  padding: 0 8px;
  min-width: 96px;
}

.be-body {
  height: var(--be-height);
  max-height: var(--be-max-height, none);
  position: relative;
}

.be-shell.is-fullscreen {
  position: fixed !important;
  inset: 8px;
  z-index: 9998 !important;
  width: auto !important;
  max-width: none !important;
  box-shadow: 0 12px 30px rgba(17, 32, 51, 0.28);
}

.be-shell.is-fullscreen .be-body {
  height: calc(100vh - 92px);
  max-height: none;
}

.be-iframe,
.be-html-source {
  width: 100%;
  height: 100%;
  border: 0;
}

.be-html-source {
  resize: none;
  border: 0;
  font: 13px/1.45 Menlo, Consolas, monospace;
  padding: 12px;
}

.be-ico {
  width: 32px;
  height: 24px;
  display: block;
  object-fit: contain;
  border: 0;
}

.be-modal-root {
  display: none;
}

.be-modal-root.is-open {
  display: block;
}

.be-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 32, 51, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9990;
}

.be-modal {
  width: min(92vw, 620px);
  max-height: min(85vh, 760px);
  overflow: auto;
  border-radius: 8px;
  border: 0;
  background: #fff;
}

.be-modal-header,
.be-modal-footer {
  padding: 10px 12px;
  background: #856259;
  border-bottom: 1px solid #856259;
  color: #fff;
  font-size: 22px;
}

.be-modal-header {
  cursor: move;
  user-select: none;
}

.be-modal-footer {
  border-bottom: 0;
  border-top: 1px solid #856259;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.be-modal-body {
  padding: 12px;
}

.be-field {
  margin-bottom: 10px;
}

.be-field label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
}

.be-field input,
.be-field select,
.be-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--be-border);
  border-radius: 6px;
  padding: 7px 8px;
}

.be-field select {
  padding: 10px 10px;
}

.be-modal-action {
  width: auto;
  min-width: 96px;
  padding: 0 14px;
  height: 34px;
  color: #fff;
  border: 0;
}

.be-modal-cancel {
  background: #5d433c;
  font-size: 14px !important;
}

.be-modal-insert {
  background: #fa9403;
}

.be-modal-wide {
  width: 90vw;
  max-width: 90vw;
}

.be-tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.be-tab-btn {
  width: auto;
  padding: 0 12px;
  height: 32px;
}

.be-tab-btn.is-active {
  border-color: #856259;
  background: #f2e9e6;
}

.be-hidden {
  display: none !important;
}

.be-muted {
  color: #7a6761;
  font-size: 13px;
}

.be-color-grid {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.be-color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  border: 1px solid #b9a59f;
  cursor: pointer;
}

.be-color-swatch-wrap {
  position: relative;
  width: 28px;
  height: 28px;
}

.be-color-swatch.is-saved {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.be-color-swatch-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 0;
  background: #5d433c;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.16s ease;
}

.be-color-swatch-wrap:hover .be-color-swatch-del,
.be-color-swatch-wrap:focus-within .be-color-swatch-del {
  opacity: 1;
  visibility: visible;
}

.be-color-preview {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid #b9a59f;
  display: inline-block;
  flex: 0 0 32px;
}

.be-color-custom {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  align-items: start;
}

.be-color-picker {
  display: grid;
  gap: 8px;
}

.be-color-sv {
  position: relative;
  height: 190px;
  border-radius: 8px;
  border: 1px solid #b9a59f;
  cursor: crosshair;
  overflow: hidden;
}

.be-color-sv::before,
.be-color-sv::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.be-color-sv::before {
  background: linear-gradient(to right, #fff 0%, rgba(255, 255, 255, 0) 100%);
}

.be-color-sv::after {
  background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 100%);
}

.be-color-sv-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.be-color-hue {
  width: 100%;
  margin: 0;
}

.be-color-inputs {
  display: grid;
  gap: 8px;
}

.be-color-inputs .be-btn {
  width: auto;
  height: 34px;
  justify-content: center;
}

.be-color-eye-btn {
  min-width: 72px;
}

.be-color-eye-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.be-color-inputs .be-color-preview {
  width: 100%;
  height: 34px;
  border-radius: 6px;
}

.be-table-grid td,
.be-table-grid th,
.be-table-grid table {
  border: 1px dashed #a88f87 !important;
}

.be-link-common {
  margin-top: 10px;
  border-top: 1px solid #e4d8d3;
  padding-top: 10px;
}

.be-media-layout {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 0.95fr;
  gap: 14px;
}

.be-media-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 46vh;
  overflow: auto;
  padding-right: 4px;
}

.be-media-card {
  width: 100%;
  border: 1px solid #d8c9c4;
  border-radius: 6px;
  background: #fff;
  padding: 6px;
  text-align: left;
}

.be-media-card.is-active {
  border-color: #fa9403;
  box-shadow: 0 0 0 2px rgba(250, 148, 3, 0.24);
}

.be-media-card img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 4px;
}

.be-media-card span {
  display: block;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.be-media-preview {
  border: 1px solid #d8c9c4;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 10px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fbf8f7;
}

.be-media-preview-img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
}

.be-upload-dropzone {
  border: 2px dashed #b8b8b8;
  background: #f5f5f5;
  border-radius: 8px;
  min-height: 110px;
  padding: 26px 18px;
  text-align: center;
  margin: 6px 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.be-upload-layout {
  display: grid;
  grid-template-columns: 1fr 0.9fr 1fr;
  gap: 14px;
}

.be-upload-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px 12px;
}

.be-upload-preview {
  min-height: 180px;
  margin: 6px 0 0;
}

.be-inline-option {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin-bottom: 0 !important;
  white-space: nowrap;
}

.be-inline-check {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  margin-bottom: 0 !important;
  white-space: nowrap;
}

.be-upload-dropzone.is-dragover {
  border-color: #fa9403;
  background: #fff3dd;
}

@media (max-width: 1024px) {
  .be-media-layout {
    grid-template-columns: 1fr 1fr;
  }
  .be-media-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-height: 34vh;
  }
  .be-upload-grid {
    grid-template-columns: 1fr;
  }
  .be-upload-layout {
    grid-template-columns: 1fr;
  }
  .be-color-custom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .be-media-layout {
    grid-template-columns: 1fr;
  }
}
