
/* Visual layout editor */
body.ub-edit-mode * { scroll-behavior: auto !important; }
body.ub-edit-mode a { cursor: move; }
body.ub-edit-mode [data-ub-edit-id] {
  outline: 1px dashed rgba(0, 102, 255, .55);
  outline-offset: 3px;
  cursor: move !important;
  touch-action: none;
}
body.ub-edit-mode [data-ub-edit-id]:hover,
body.ub-edit-mode [data-ub-edit-id].ub-selected {
  outline: 3px solid rgba(255, 70, 60, .85);
  outline-offset: 5px;
  z-index: 999 !important;
}
.ub-editor-panel {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: min(390px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  padding: 14px;
  z-index: 999999;
  font: 14px/1.35 system-ui, -apple-system, Segoe UI, sans-serif;
}
.ub-editor-panel h2 {
  font-size: 16px;
  margin: 0 0 8px;
  letter-spacing: 0;
  line-height: 1.2;
}
.ub-editor-panel p {
  margin: 0 0 10px;
  color: #d8d8d8;
}
.ub-editor-panel .ub-small {
  font-size: 12px;
  color: #bdbdbd;
}
.ub-editor-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.ub-editor-panel button,
.ub-editor-panel label.ub-file {
  border: 1px solid rgba(255,255,255,.24);
  background: #fff;
  color: #111;
  border-radius: 999px;
  padding: 8px 10px;
  font-weight: 800;
  cursor: pointer;
  font-size: 12px;
}
.ub-editor-panel button.secondary {
  background: transparent;
  color: #fff;
}
.ub-editor-panel button.danger {
  background: #ff615d;
  color: #111;
  border-color: #ff615d;
}
.ub-editor-panel input[type="file"] { display: none; }
.ub-editor-panel textarea {
  width: 100%;
  min-height: 110px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.22);
  background: #060606;
  color: #fff;
  padding: 8px;
  font: 12px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace;
  box-sizing: border-box;
}
.ub-selected-info {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: #fff;
  word-break: break-word;
  font-size: 12px;
}
.ub-nudge {
  display: grid;
  grid-template-columns: repeat(3, 42px);
  gap: 6px;
  width: max-content;
  margin: 8px 0;
}
.ub-nudge button { border-radius: 10px; padding: 7px 0; }
.ub-nudge .blank { visibility: hidden; }
body.ub-edit-mode .site-header {
  z-index: 2000;
}
@media (max-width: 700px) {
  .ub-editor-panel {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
  }
}

.ub-editor-panel button[data-delete-selected] {
  background: #ffb000;
  border-color: #ffb000;
  color: #111;
}

.ub-text-editor {
  border-top: 1px solid rgba(255,255,255,.18);
  border-bottom: 1px solid rgba(255,255,255,.18);
  margin: 10px 0;
  padding: 10px 0;
}
.ub-text-editor label {
  display: block;
  color: #fff;
  font-weight: 800;
  margin: 7px 0 5px;
  font-size: 12px;
}
.ub-text-editor textarea {
  min-height: 84px;
}
.ub-text-editor input[type="text"] {
  flex: 1 1 160px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.24);
  background: #060606;
  color: #fff;
  padding: 8px 10px;
  font: 12px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.ub-media-editor {
  border-top: 1px solid rgba(255,255,255,.18);
  border-bottom: 1px solid rgba(255,255,255,.18);
  margin: 10px 0;
  padding: 10px 0;
}
.ub-media-editor label {
  display: block;
  color: #fff;
  font-weight: 800;
  margin: 7px 0 5px;
  font-size: 12px;
}
.ub-media-editor input[type="text"],
.ub-media-editor select {
  flex: 1 1 140px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.24);
  background: #060606;
  color: #fff;
  padding: 8px 10px;
  font: 12px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.ub-text-editor button[data-clear-text-content] {
  background: #ff615d;
  border-color: #ff615d;
  color: #111;
}


/* v27 duplicate and mouse-resize editor controls */
.ub-size-editor {
  border-top: 1px solid rgba(255,255,255,.18);
  border-bottom: 1px solid rgba(255,255,255,.18);
  margin: 10px 0;
  padding: 10px 0;
}
.ub-size-editor label {
  display: block;
  color: #fff;
  font-weight: 800;
  margin: 7px 0 5px;
  font-size: 12px;
}
.ub-size-editor input[type="text"] {
  flex: 1 1 120px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.24);
  background: #060606;
  color: #fff;
  padding: 8px 10px;
  font: 12px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
}
.ub-resize-handle {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  background: #ffb000;
  border: 2px solid #111;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  cursor: nwse-resize;
  z-index: 1000000;
  display: none;
}
.ub-resize-handle::before {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 8px;
  height: 8px;
  border-right: 2px solid #111;
  border-bottom: 2px solid #111;
}


/* v28 clearer selection for video thumbnail internals */
body.ub-edit-mode .video-thumb span,
body.ub-edit-mode .video-thumb em {
  outline-offset: 2px;
}


/* v30 clearer selection for changed video text */
body.ub-edit-mode .video-thumb span[data-ub-edit-id],
body.ub-edit-mode .video-thumb em[data-ub-edit-id]{
  outline:2px dashed rgba(255,176,0,.65);
  outline-offset:3px;
}
body.ub-edit-mode .video-thumb span[data-ub-edit-id].ub-selected,
body.ub-edit-mode .video-thumb em[data-ub-edit-id].ub-selected{
  outline:3px solid rgba(255,70,60,.95);
}


/* v31 precise selection frame for video text fields */
body.ub-edit-mode .video-thumb span[data-ub-edit-id],
body.ub-edit-mode .video-thumb em[data-ub-edit-id]{
  box-shadow:0 0 0 2px rgba(255,176,0,.75);
}
body.ub-edit-mode .video-thumb span[data-ub-edit-id].ub-selected,
body.ub-edit-mode .video-thumb em[data-ub-edit-id].ub-selected{
  box-shadow:0 0 0 3px rgba(255,70,60,.95);
}
