body.safe-visual-editor-on .story-ui-cards,
body.safe-visual-editor-on .hero-ui-cards,
body.safe-visual-editor-on .safe-ve-editable {
  pointer-events: auto;
}

body.safe-visual-editor-on .safe-ve-editable {
  opacity: 1 !important;
  z-index: 15 !important;
  transition: none !important;
  cursor: move;
  touch-action: none;
  user-select: none;
  outline: 2px dashed rgba(32, 181, 107, 0.9);
  outline-offset: 5px;
}

body.safe-visual-editor-on .safe-ve-selected {
  outline-color: #1f63c4 !important;
  outline-style: solid !important;
  outline-width: 3px !important;
}

body.safe-visual-editor-on .safe-ve-hidden {
  display: none !important;
}

body.safe-visual-editor-on .safe-ve-panel {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 120;
  display: none;
  width: min(300px, calc(100vw - 24px));
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 44px rgba(23, 34, 28, 0.18);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  backdrop-filter: blur(18px) saturate(160%);
  color: #17221c;
  font: 12px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

body.safe-visual-editor-on .safe-ve-panel.safe-ve-visible {
  display: block;
}

body.safe-visual-editor-on .safe-ve-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 28px;
  margin: -2px -2px 8px;
  padding: 2px 2px 8px;
  border-bottom: 1px solid rgba(49, 60, 54, 0.1);
  cursor: grab;
  user-select: none;
}

body.safe-visual-editor-on .safe-ve-head:active {
  cursor: grabbing;
}

body.safe-visual-editor-on .safe-ve-title {
  font-size: 13px;
  font-weight: 900;
}

body.safe-visual-editor-on .safe-ve-hint {
  color: #52635b;
  font-size: 11px;
  font-weight: 700;
}

body.safe-visual-editor-on .safe-ve-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0;
}

body.safe-visual-editor-on .safe-ve-panel button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: #20b56b;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

body.safe-visual-editor-on .safe-ve-colors {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0 8px;
}

body.safe-visual-editor-on .safe-ve-colors button[data-action="color"] {
  min-width: 0;
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: var(--ve-color);
  box-shadow: 0 2px 7px rgba(23, 34, 28, 0.16);
}

body.safe-visual-editor-on .safe-ve-colors button[data-action="color"]:hover {
  transform: translateY(-1px);
  background: var(--ve-color);
}

body.safe-visual-editor-on .safe-ve-colors .safe-ve-reset {
  min-height: 24px;
  padding: 0 8px;
  font-size: 10px;
  background: #52635b;
}

body.safe-visual-editor-on .safe-ve-panel button:hover {
  background: #11824b;
}

body.safe-visual-editor-on .safe-ve-panel .safe-ve-secondary {
  background: #52635b;
}

body.safe-visual-editor-on .safe-ve-panel .safe-ve-danger {
  background: #d74b4b;
}

body.safe-visual-editor-on .safe-ve-panel .safe-ve-save {
  background: #1f63c4;
  min-width: 92px;
}

body.safe-visual-editor-on .safe-ve-panel .safe-ve-commit {
  background: #1f63c4;
}

body.safe-visual-editor-on .safe-ve-advanced {
  display: none;
  margin-top: 8px;
}

body.safe-visual-editor-on .safe-ve-panel.safe-ve-show-code .safe-ve-advanced {
  display: block;
}

body.safe-visual-editor-on .safe-ve-panel textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  border: 1px solid rgba(49, 60, 54, 0.14);
  border-radius: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #17221c;
  font: 11px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

body.safe-visual-editor-on .safe-ve-status {
  min-height: 16px;
  margin-top: 6px;
  color: #52635b;
  font-size: 11px;
}

body.safe-visual-editor-on .safe-ve-toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 130;
  min-height: 30px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(23, 34, 28, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

body.safe-visual-editor-on .safe-ve-toast.safe-ve-toast-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 768px) {
  body.safe-visual-editor-on .safe-ve-panel {
    top: 10px;
    left: 10px;
    bottom: auto;
  }
}
