/* ============================================================
   ModelosHub Studio v2 — Editor UI
   Layout full-screen: topbar + (canvas | sidebar)
   ============================================================ */

:root {
  --mh-bg:        #14161B;
  --mh-bg-1:      #1A1D24;
  --mh-bg-2:      #20242C;
  --mh-bg-3:      #2A2F38;
  --mh-line:      #2F3540;
  --mh-line-2:    #1F242C;
  --mh-ink:       #E8EAED;
  --mh-ink-dim:   #9CA3AF;
  --mh-ink-soft:  #6B7280;
  --mh-accent:    #5B9CFF;
  --mh-accent-2:  #4D8AE6;
  --mh-success:   #34D399;
  --mh-danger:    #F87171;
  --mh-warn:      #FBBF24;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; overflow: hidden; }

body.mh-editor-body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--mh-bg);
  color: var(--mh-ink);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

/* ============================================================
   TOPBAR
   ============================================================ */
.mh-topbar {
  height: 56px;
  flex-shrink: 0;
  background: var(--mh-bg-1);
  border-bottom: 1px solid var(--mh-line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
}
.mh-topbar__left { display: flex; align-items: center; gap: 12px; }
.mh-topbar__center { display: flex; align-items: center; gap: 4px; justify-content: center; }
.mh-topbar__right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

.mh-topbar__divider { width: 1px; height: 22px; background: var(--mh-line); }

.mh-topbar__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--mh-ink);
  letter-spacing: -0.005em;
}
.mh-topbar__sub {
  font-size: 12px;
  color: var(--mh-ink-soft);
  font-feature-settings: "tnum" 1;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.mh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--mh-ink-dim);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .12s;
}
.mh-btn:hover { background: var(--mh-bg-2); color: var(--mh-ink); }
.mh-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mh-btn:disabled:hover { background: transparent; color: var(--mh-ink-dim); }

.mh-btn--ghost { background: var(--mh-bg-2); }
.mh-btn--ghost:hover { background: var(--mh-bg-3); }

.mh-btn--icon { padding: 0; width: 32px; justify-content: center; }
.mh-btn--icon-sm { width: 24px; height: 24px; padding: 0; justify-content: center; border-radius: 6px; }

.mh-btn--sm { height: 26px; padding: 0 10px; font-size: 12px; }

.mh-btn--block { width: 100%; justify-content: center; }

.mh-btn--export {
  background: var(--mh-bg-2);
  border: 1px solid var(--mh-line);
  color: var(--mh-ink);
}
.mh-btn--export:hover { background: var(--mh-bg-3); }

.mh-btn--export-primary {
  background: var(--mh-accent);
  color: white;
  font-weight: 600;
}
.mh-btn--export-primary:hover { background: var(--mh-accent-2); color: white; }

.mh-btn--danger {
  color: var(--mh-danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
  background: rgba(248, 113, 113, 0.06);
}
.mh-btn--danger:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.5);
  color: var(--mh-danger);
}

/* ============================================================
   WORKSPACE
   ============================================================ */
.mh-workspace {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 360px;
  overflow: hidden;
}

/* CANVAS */
/* Barra de progresso de export — FIXED, fora do grid (senao rouba a coluna do canvas) */
.mh-export-progress {
  position: fixed;
  top: 56px;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--mh-accent, #5B9CFF), #B265FF);
  box-shadow: 0 0 8px rgba(91,156,255,0.5);
  z-index: 300;
  pointer-events: none;
  opacity: 0;
  transition: width .5s cubic-bezier(.16,1,.3,1), opacity .3s;
}
.mh-export-progress.is-active {
  width: 100%;
  opacity: 1;
}

.mh-canvas-wrap {
  position: relative;
  background:
    radial-gradient(ellipse 800px 600px at 50% 50%, rgba(91,156,255,0.05), transparent 70%),
    var(--mh-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: radial-gradient(circle, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 24px 24px;
}

#mh-canvas {
  width: 100%;
  height: 100%;
  background: transparent;
  border: 0;
}

.mh-zoom-controls {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0;
  background: var(--mh-bg-1);
  border: 1px solid var(--mh-line);
  border-radius: 10px;
  padding: 4px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.mh-zoom-btn {
  background: transparent;
  border: 0;
  color: var(--mh-ink-dim);
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mh-zoom-btn:hover { background: var(--mh-bg-3); color: var(--mh-ink); }

.mh-zoom-level {
  font-size: 11px;
  font-weight: 600;
  color: var(--mh-ink-dim);
  padding: 0 10px;
  letter-spacing: 0.04em;
  font-feature-settings: "tnum" 1;
  min-width: 50px;
  text-align: center;
}

/* SIDEBAR */
.mh-sidebar {
  background: var(--mh-bg-1);
  border-left: 1px solid var(--mh-line);
  overflow-y: auto;
  overflow-x: hidden;
}

.mh-sidebar::-webkit-scrollbar { width: 6px; }
.mh-sidebar::-webkit-scrollbar-track { background: transparent; }
.mh-sidebar::-webkit-scrollbar-thumb { background: var(--mh-line); border-radius: 3px; }
.mh-sidebar::-webkit-scrollbar-thumb:hover { background: var(--mh-bg-3); }

/* ============================================================
   PANELS
   ============================================================ */
.mh-panel { padding: 18px 18px 32px; }

.mh-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.mh-panel__header--edit {
  margin: -2px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--mh-line);
}

.mh-panel__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--mh-ink);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
#mh-edit-label { text-transform: none; font-size: 14px; }

.mh-panel__sub {
  font-size: 12px;
  color: var(--mh-ink-soft);
  line-height: 1.5;
  margin: 4px 0 0;
  width: 100%;
}

/* Slot list */
.mh-slot-list { list-style: none; }
.mh-slot-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--mh-bg-2);
  border: 1px solid var(--mh-line-2);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all .12s;
}
.mh-slot-item:hover {
  background: var(--mh-bg-3);
  border-color: var(--mh-accent);
  transform: translateX(2px);
}
.mh-slot-item__label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--mh-ink-soft);
  text-transform: uppercase;
}
.mh-slot-item__preview {
  font-size: 13px;
  color: var(--mh-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Palette swatch */
.mh-palette-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.mh-palette-swatch {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: inline-block;
  border: 1px solid var(--mh-line);
  cursor: default;
}
.mh-palette-swatch--clickable { cursor: pointer; transition: transform .12s; }
.mh-palette-swatch--clickable:hover { transform: scale(1.15); }

/* Shortcuts */
.mh-shortcut-list { list-style: none; }
.mh-shortcut-list li {
  font-size: 12.5px;
  color: var(--mh-ink-dim);
  padding: 4px 0;
}
.mh-shortcut-list kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--mh-bg-2);
  border: 1px solid var(--mh-line);
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mh-ink);
  margin-right: 4px;
}

/* ============================================================
   FORM FIELDS
   ============================================================ */
.mh-field { margin-bottom: 16px; }
.mh-field--row { display: flex; gap: 6px; }

.mh-field__label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--mh-ink-soft);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.mh-field__value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--mh-accent);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.mh-input {
  width: 100%;
  height: 34px;
  background: var(--mh-bg-2);
  border: 1px solid var(--mh-line);
  border-radius: 7px;
  padding: 0 10px;
  color: var(--mh-ink);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color .12s;
}
.mh-input:focus { border-color: var(--mh-accent); }
.mh-input--text {
  height: auto;
  padding: 9px 10px;
  resize: vertical;
  line-height: 1.45;
  font-family: inherit;
}

/* Slider */
.mh-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--mh-bg-3);
  border-radius: 2px;
  outline: none;
  margin: 8px 0;
}
.mh-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px; height: 16px;
  background: var(--mh-accent);
  border: 2px solid var(--mh-bg-1);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--mh-line);
}
.mh-slider::-moz-range-thumb {
  width: 14px; height: 14px;
  background: var(--mh-accent);
  border: 2px solid var(--mh-bg-1);
  border-radius: 50%;
  cursor: pointer;
}

/* Segment buttons */
.mh-segment {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 2px;
  background: var(--mh-bg-2);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--mh-line);
}
#mh-input-align { grid-template-columns: repeat(4, 1fr); }
.mh-segment button {
  height: 28px;
  background: transparent;
  border: 0;
  color: var(--mh-ink-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  cursor: pointer;
  transition: all .12s;
}
.mh-segment button:hover { background: var(--mh-bg-3); color: var(--mh-ink); }
.mh-segment button.is-active { background: var(--mh-accent); color: white; }

/* Toggle button */
.mh-toggle {
  flex: 1;
  height: 34px;
  background: var(--mh-bg-2);
  border: 1px solid var(--mh-line);
  color: var(--mh-ink-dim);
  border-radius: 7px;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .12s;
}
.mh-toggle:hover { background: var(--mh-bg-3); color: var(--mh-ink); }
.mh-toggle.is-active {
  background: var(--mh-accent);
  border-color: var(--mh-accent);
  color: white;
}

/* Color row */
.mh-color-row { display: flex; align-items: center; gap: 8px; }
.mh-color-picker {
  width: 40px;
  height: 34px;
  border: 1px solid var(--mh-line);
  border-radius: 7px;
  background: var(--mh-bg-2);
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px;
}

/* Position inputs */
.mh-pos-row { display: flex; gap: 6px; align-items: center; }
.mh-pos-input {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--mh-bg-2);
  border: 1px solid var(--mh-line);
  border-radius: 7px;
  padding: 0 4px 0 10px;
  height: 34px;
}
.mh-pos-input span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--mh-ink-soft);
  font-weight: 600;
}
.mh-pos-input input {
  flex: 1;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--mh-ink);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 0 4px;
  outline: none;
}
.mh-pos-input input:focus { color: var(--mh-accent); }
.mh-pos-input input::-webkit-outer-spin-button,
.mh-pos-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ============================================================
   TOAST
   ============================================================ */
.mh-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--mh-bg-1);
  border: 1px solid var(--mh-line);
  color: var(--mh-ink);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.mh-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.mh-toast.is-success { border-color: rgba(52,211,153,0.4); color: var(--mh-success); }
.mh-toast.is-error { border-color: rgba(248,113,113,0.4); color: var(--mh-danger); }

/* ============================================================
   MOBILE
   ============================================================ */
@media (max-width: 900px) {
  .mh-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .mh-sidebar {
    border-left: 0;
    border-top: 1px solid var(--mh-line);
    max-height: 50vh;
  }
  .mh-topbar__sub { display: none; }
  .mh-topbar { padding: 0 8px; }
  .mh-btn--export { display: none; }
}

/* ============================================================
   DOCK + DRAWER v2 — Premium 2026 redesign
   Substitui completamente o estilo anterior do dock
   ============================================================ */

.mh-dock-wrap {
  position: fixed !important;
  bottom: 0;
  left: 0;
  right: 360px;
  z-index: 50;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
@media (max-width: 900px) { .mh-dock-wrap { right: 0 !important; } }

/* ============================================================
   DOCK
   ============================================================ */
.mh-dock {
  display: flex !important;
  gap: 6px !important;
  background: linear-gradient(180deg, rgba(28,32,40,0.85) 0%, rgba(20,22,27,0.92) 100%) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-bottom: 0 !important;
  border-radius: 18px 18px 0 0 !important;
  padding: 10px !important;
  box-shadow:
    0 -12px 32px rgba(0,0,0,0.45),
    0 -1px 0 rgba(255,255,255,0.05) inset !important;
  pointer-events: auto;
  position: relative;
  margin: 0 !important;
}
.mh-dock::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91,156,255,0.4), rgba(255,77,143,0.4), transparent);
}

.mh-dock__btn {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  width: 78px !important;
  height: 62px !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 12px !important;
  color: rgba(255,255,255,0.6) !important;
  font-family: 'Inter', -apple-system, sans-serif !important;
  font-size: 10.5px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  cursor: pointer;
  transition: all .22s cubic-bezier(.16,1,.3,1);
  position: relative;
  overflow: hidden;
  text-transform: none !important;
}
.mh-dock__btn svg {
  transition: transform .22s cubic-bezier(.16,1,.3,1);
}
.mh-dock__btn:hover {
  background: rgba(255,255,255,0.06) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.1) !important;
  transform: translateY(-2px) !important;
}
.mh-dock__btn:hover svg { transform: scale(1.08); }

.mh-dock__btn.is-active {
  background: linear-gradient(180deg, rgba(91,156,255,0.18), rgba(91,156,255,0.08)) !important;
  border-color: rgba(91,156,255,0.4) !important;
  color: #A8C8FF !important;
  box-shadow:
    0 0 0 1px rgba(91,156,255,0.2),
    0 4px 12px rgba(91,156,255,0.18) !important;
}
.mh-dock__btn.is-active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 18px;
  height: 2px;
  background: linear-gradient(90deg, #5B9CFF, #B265FF);
  border-radius: 2px;
  transform: translateX(-50%);
}

/* Surpreenda-me: gradient holográfico animado */
.mh-dock__btn--magic {
  background:
    linear-gradient(135deg, rgba(255,77,143,0.18) 0%, rgba(91,156,255,0.18) 50%, rgba(168,85,247,0.18) 100%) !important;
  border: 1px solid rgba(255,77,143,0.35) !important;
  color: #FFD0E2 !important;
  position: relative;
}
.mh-dock__btn--magic::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(135deg, #FF4D8F, #5B9CFF, #B265FF, #FF4D8F);
  background-size: 200% 200%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: holo 4s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}
@keyframes holo {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
.mh-dock__btn--magic:hover {
  background: linear-gradient(135deg, rgba(255,77,143,0.3) 0%, rgba(91,156,255,0.3) 50%, rgba(168,85,247,0.3) 100%) !important;
  color: #fff !important;
  transform: translateY(-2px) scale(1.02) !important;
}
.mh-dock__btn--magic:hover::before { opacity: 1; }
.mh-dock__btn--magic:hover svg { transform: rotate(15deg) scale(1.15); }

/* ============================================================
   DRAWER
   ============================================================ */
.mh-drawer {
  width: min(960px, calc(100vw - 80px)) !important;
  max-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(26,29,36,0.96) 0%, rgba(20,22,27,0.98) 100%) !important;
  backdrop-filter: blur(40px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-bottom: 0 !important;
  border-radius: 20px 20px 0 0 !important;
  margin-bottom: 6px !important;
  transition: max-height .45s cubic-bezier(.16,1,.3,1), opacity .3s, transform .45s cubic-bezier(.16,1,.3,1) !important;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: auto;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
  position: relative;
}
.mh-drawer::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91,156,255,0.3), rgba(255,77,143,0.3), transparent);
}
.mh-drawer.is-open {
  max-height: 520px;
  opacity: 1;
  transform: translateY(0);
}

.mh-drawer__header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 18px 28px !important;
  border-bottom: 1px solid rgba(255,255,255,0.06) !important;
  margin: 0 !important;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent) !important;
}
.mh-drawer__title {
  font-family: 'Inter', sans-serif !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  color: #fff !important;
  letter-spacing: 0.02em !important;
  text-transform: none !important;
  margin: 0 !important;
}
.mh-drawer__title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: linear-gradient(180deg, #5B9CFF, #B265FF);
  margin-right: 10px;
  border-radius: 2px;
  vertical-align: -2px;
}

#mh-drawer-close {
  width: 30px !important;
  height: 30px !important;
  background: rgba(255,255,255,0.05) !important;
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 8px !important;
  color: rgba(255,255,255,0.7) !important;
  transition: all .18s !important;
}
#mh-drawer-close:hover {
  background: rgba(255,255,255,0.12) !important;
  color: #fff !important;
  border-color: rgba(255,255,255,0.2) !important;
  transform: rotate(90deg);
}

.mh-drawer__body {
  padding: 22px 28px 28px !important;
  overflow-y: auto !important;
  max-height: 450px;
}
.mh-drawer__body::-webkit-scrollbar { width: 8px; }
.mh-drawer__body::-webkit-scrollbar-track { background: transparent; }
.mh-drawer__body::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
}
.mh-drawer__body::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ============================================================
   PALETAS — Premium cards
   ============================================================ */
.mh-palette-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
  gap: 12px !important;
}

.mh-palette-card {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 14px !important;
  padding: 12px !important;
  cursor: pointer;
  transition: all .22s cubic-bezier(.16,1,.3,1) !important;
  text-align: left;
  font-family: 'Inter', sans-serif !important;
  color: #fff !important;
  overflow: hidden;
  position: relative;
}
.mh-palette-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(255,255,255,0.08), transparent 60%);
  opacity: 0;
  transition: opacity .22s;
  pointer-events: none;
}
.mh-palette-card:hover {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(91,156,255,0.4) !important;
  transform: translateY(-3px) !important;
  box-shadow:
    0 12px 24px rgba(0,0,0,0.3),
    0 0 0 1px rgba(91,156,255,0.2) !important;
}
.mh-palette-card:hover::before { opacity: 1; }

.mh-palette-card__swatches {
  display: flex !important;
  gap: 0 !important;
  border-radius: 10px !important;
  overflow: hidden !important;
  height: 56px !important;
  margin-bottom: 12px !important;
  position: relative;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.06),
    0 2px 6px rgba(0,0,0,0.3);
}
.mh-palette-card__swatches span {
  flex: 1 !important;
  display: block !important;
  position: relative;
}
.mh-palette-card__swatches span::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 40%);
  pointer-events: none;
}

.mh-palette-card__name {
  display: block !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: #fff !important;
  letter-spacing: -0.005em !important;
  margin: 0 0 3px 0 !important;
  text-transform: none !important;
}
.mh-palette-card__desc {
  display: block !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 10.5px !important;
  font-weight: 500 !important;
  color: rgba(255,255,255,0.5) !important;
  letter-spacing: 0.04em !important;
  margin: 0 !important;
  text-transform: none !important;
}

/* ============================================================
   FONT PAIRS — Premium preview cards
   ============================================================ */
.mh-font-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 12px !important;
}

.mh-font-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.02) 100%) !important;
  border: 1px solid rgba(255,255,255,0.07) !important;
  border-radius: 14px !important;
  padding: 18px 20px !important;
  cursor: pointer;
  transition: all .22s cubic-bezier(.16,1,.3,1) !important;
  text-align: left;
  color: #fff !important;
  position: relative;
  overflow: hidden;
}
.mh-font-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(91,156,255,0.3), transparent);
  opacity: 0;
  transition: opacity .22s;
}
.mh-font-card:hover {
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.04) 100%) !important;
  border-color: rgba(91,156,255,0.4) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,0.3), 0 0 0 1px rgba(91,156,255,0.18) !important;
}
.mh-font-card:hover::before { opacity: 1; }

.mh-font-card__display {
  font-size: 36px !important;
  line-height: 1 !important;
  font-weight: 500 !important;
  color: #fff !important;
  margin: 0 0 6px 0 !important;
  letter-spacing: -0.025em !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: none !important;
}

.mh-font-card__body {
  font-size: 13px !important;
  color: rgba(255,255,255,0.55) !important;
  margin: 0 0 14px 0 !important;
  letter-spacing: 0 !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  text-transform: none !important;
}

.mh-font-card__name {
  display: inline-block !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  color: rgba(168, 200, 255, 0.85) !important;
  letter-spacing: 0.16em !important;
  text-transform: uppercase !important;
  padding: 3px 10px;
  background: rgba(91,156,255,0.1);
  border: 1px solid rgba(91,156,255,0.2);
  border-radius: 100px;
  margin: 0 !important;
}

/* ============================================================
   TEXTOS list (no drawer)
   ============================================================ */
.mh-drawer-text-list {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
  gap: 8px !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
.mh-drawer-text-list .mh-slot-item {
  margin: 0 !important;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  padding: 10px 14px !important;
}
.mh-drawer-text-list .mh-slot-item:hover {
  background: rgba(91,156,255,0.08) !important;
  border-color: rgba(91,156,255,0.3) !important;
  transform: translateX(3px) !important;
}
.mh-drawer-text-list .mh-slot-item__label {
  color: rgba(168,200,255,0.7) !important;
  font-size: 10px !important;
  letter-spacing: 0.14em !important;
}
.mh-drawer-text-list .mh-slot-item__preview {
  color: #fff !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
}

/* ============================================================
   TROCAR templates grid
   ============================================================ */
.mh-tpl-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  gap: 14px !important;
}
.mh-tpl-card {
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.06) !important;
  border-radius: 12px !important;
  overflow: hidden !important;
  cursor: pointer;
  text-decoration: none !important;
  color: inherit;
  transition: all .22s cubic-bezier(.16,1,.3,1) !important;
  display: block;
  position: relative;
}
.mh-tpl-card:hover {
  border-color: rgba(91,156,255,0.45) !important;
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(91,156,255,0.2) !important;
}
.mh-tpl-card iframe {
  width: 100% !important;
  aspect-ratio: 9/5 !important;
  border: 0 !important;
  pointer-events: none;
  display: block;
  background: #111;
}
.mh-tpl-card__name {
  display: block !important;
  padding: 10px 14px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  color: #fff !important;
  border-top: 1px solid rgba(255,255,255,0.06) !important;
  background: rgba(255,255,255,0.02);
  letter-spacing: -0.005em !important;
}

/* Pequena correção para canvas-wrap acomodar dock */
.mh-canvas-wrap { padding-bottom: 92px !important; }

/* ============================================================
   FASE 7 — Mobile-first + Touch
   Substitui parcialmente o @media (max-width: 900px) anterior
   ============================================================ */

/* Tablet (901px - 1100px) — sidebar mais estreita */
@media (max-width: 1100px) and (min-width: 901px) {
  .mh-workspace { grid-template-columns: 1fr 300px; }
  .mh-dock-wrap { right: 300px; }
}

/* Mobile (até 900px) — layout vertical, dock vira sheet */
@media (max-width: 900px) {
  body.mh-editor-body { font-size: 14px; }

  /* TOPBAR mobile compacta */
  .mh-topbar {
    height: 52px;
    padding: 0 10px;
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }
  .mh-topbar__sub { display: none; }
  .mh-topbar__title { font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mh-topbar__center { gap: 2px; }
  .mh-topbar__center .mh-btn--icon { width: 38px; height: 38px; }
  #mh-fullscreen, #mh-reset { display: none; }
  .mh-btn--export { display: none; }
  .mh-btn--export-primary { padding: 0 12px; height: 36px; font-size: 12px; }
  /* MH_MOBILE_FIX: esconder botoes secundarios que estouravam a topbar no mobile */
  #mh-pages-ui, #mh-versions-btn, #mh-share-btn, #mh-history-toggle, #mh-uses-chip { display: none !important; }
  .mh-topbar__center, .mh-topbar__right { min-width: 0; overflow: hidden; }

  /* WORKSPACE: canvas em cima, sidebar como modal-sheet */
  .mh-workspace {
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
  }

  .mh-canvas-wrap { padding-bottom: 76px !important; }
  /* MH_ZOOM_MOBILE_FIX: zoom controls acima do dock (estava escondido atras) */
  .mh-zoom-controls {
    bottom: 150px !important;
    z-index: 86 !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  }

  /* SIDEBAR no mobile: modal fullscreen do bottom */
  .mh-sidebar {
    position: fixed !important;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: 55vh;
    max-height: 55vh;
    border-left: 0 !important;
    border-top: 1px solid var(--mh-line);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.16,1,.3,1);
    z-index: 100;
    box-shadow: 0 -20px 60px rgba(0,0,0,0.5);
    background: var(--mh-bg-1);
  }
  .mh-sidebar.is-mobile-open { transform: translateY(0); }

  /* Handle/grip no topo da sidebar mobile */
  .mh-sidebar::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: var(--mh-line);
    border-radius: 2px;
    z-index: 10;
  }

  /* DOCK mobile: sempre visível, ocupa toda a largura */
  .mh-dock-wrap {
    right: 0 !important;
  }

  .mh-dock {
    width: 100%;
    border-radius: 16px 16px 0 0 !important;
    justify-content: space-evenly !important;
    padding: 8px 4px !important;
    gap: 2px !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .mh-dock::-webkit-scrollbar { display: none; }
  .mh-dock__btn {
    width: 46px !important;
    min-width: 46px !important;
    flex-shrink: 0 !important;
    height: 52px !important;
    font-size: 9px !important;
    padding: 4px 2px !important;
  }
  .mh-dock__btn svg {
    width: 20px;
    height: 20px;
  }

  /* DRAWER mobile: ocupa tela quase toda */
  .mh-drawer {
    width: calc(100vw - 20px) !important;
    max-width: 100% !important;
  }
  .mh-drawer.is-open { max-height: 60vh !important; }
  .mh-drawer__body { max-height: calc(60vh - 60px) !important; padding: 16px 18px !important; }

  /* Cards menores */
  .mh-palette-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .mh-palette-card__swatches { height: 44px !important; }
  .mh-font-grid { grid-template-columns: 1fr !important; }
  .mh-font-card__display { font-size: 28px !important; }
  .mh-tpl-grid { grid-template-columns: 1fr !important; }
  .mh-drawer-text-list { grid-template-columns: 1fr !important; }

  /* PAINÉIS SIDEBAR — touch targets maiores */
  .mh-panel { padding: 24px 18px 80px !important; }
  .mh-input, .mh-toggle, .mh-segment button { min-height: 44px; }
  .mh-segment button { font-size: 13px; }
  .mh-slot-item { padding: 14px !important; }

  /* Botão FAB pra abrir sidebar (quando há slot selecionado) */
  .mh-fab-sidebar {
    position: fixed;
    bottom: 92px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mh-accent), #B265FF);
    border: 0;
    color: white;
    box-shadow: 0 8px 24px rgba(91,156,255,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 80;
    font-size: 22px;
  }
  body.mh-has-selection .mh-fab-sidebar { display: flex; }
}

/* Telas muito pequenas */
@media (max-width: 480px) {
  .mh-topbar__title { max-width: 100px; font-size: 12px; }
  .mh-dock__btn span { font-size: 9px !important; }
  .mh-name { font-size: 56px !important; } /* dentro do iframe não conta */
}

/* ============================================================
   ONBOARDING (Shepherd.js custom theme)
   ============================================================ */
.shepherd-theme-mh {
  font-family: 'Inter', -apple-system, sans-serif;
}
.shepherd-element.shepherd-theme-mh {
  background: linear-gradient(180deg, rgba(26,29,36,0.98) 0%, rgba(20,22,27,1) 100%);
  border: 1px solid rgba(91,156,255,0.3);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(91,156,255,0.2);
  color: var(--mh-ink);
  max-width: 360px;
}
.shepherd-theme-mh .shepherd-content { padding: 20px; }
.shepherd-theme-mh .shepherd-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--mh-ink-dim);
  margin-bottom: 16px;
  padding: 0;
}
.shepherd-theme-mh .shepherd-text strong { color: #fff; font-weight: 600; }
.shepherd-theme-mh .shepherd-header {
  padding: 0 0 8px 0;
  background: transparent;
}
.shepherd-theme-mh .shepherd-title {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.005em;
}
.shepherd-theme-mh .shepherd-title::before {
  content: '✨';
  margin-right: 6px;
}
.shepherd-theme-mh .shepherd-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0;
  gap: 8px;
}
.shepherd-theme-mh .shepherd-button {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  border: 0;
  transition: all .15s;
}
.shepherd-theme-mh .shepherd-button-primary {
  background: linear-gradient(135deg, var(--mh-accent), #4D8AE6);
  color: white;
}
.shepherd-theme-mh .shepherd-button-primary:hover {
  background: linear-gradient(135deg, #4D8AE6, var(--mh-accent));
  transform: translateY(-1px);
}
.shepherd-theme-mh .shepherd-button-secondary {
  background: transparent;
  color: var(--mh-ink-dim);
  border: 1px solid var(--mh-line);
}
.shepherd-theme-mh .shepherd-button-secondary:hover {
  background: var(--mh-bg-2);
  color: var(--mh-ink);
}
.shepherd-theme-mh .shepherd-cancel-icon {
  color: var(--mh-ink-soft);
  font-size: 20px;
}
.shepherd-theme-mh .shepherd-arrow:before {
  background: rgba(26,29,36,0.98);
  border: 1px solid rgba(91,156,255,0.3);
}
.shepherd-modal-overlay-container {
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  fill: rgba(0,0,0,0.6);
}


/* ============================================================
   FASE 7.1 — Mobile redesign + Toast com Desfazer + Drag fix
   ============================================================ */

/* Toast action button (Desfazer) */
.mh-toast {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 240px;
  justify-content: space-between;
  padding: 10px 12px 10px 18px !important;
}
.mh-toast span { flex: 1; }
.mh-toast__action {
  background: rgba(91,156,255,0.18);
  border: 1px solid rgba(91,156,255,0.4);
  color: #A8C8FF;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  transition: all .15s;
}
.mh-toast__action:hover {
  background: rgba(91,156,255,0.3);
  color: #fff;
}

/* Botão Undo destacado quando ha histórico */
#mh-undo:not(:disabled) {
  background: rgba(91,156,255,0.08) !important;
  border-color: rgba(91,156,255,0.3) !important;
  color: #A8C8FF !important;
}
#mh-undo:not(:disabled):hover {
  background: rgba(91,156,255,0.18) !important;
}

/* ============================================================
   MOBILE REDESIGN (override max-width: 900px)
   ============================================================ */
@media (max-width: 900px) {
  /* SIDEBAR: 50vh maximo (era 70) — canvas sempre 50%+ visivel */
  .mh-sidebar {
    height: 50vh !important;
    max-height: 50vh !important;
  }

  /* Canvas precisa de mais altura quando sidebar fechada */
  .mh-canvas-wrap {
    height: calc(100vh - 52px - 70px) !important;
    padding-bottom: 70px !important;
  }

  /* Sidebar aberta empurra canvas pra cima */
  body.mh-sidebar-open .mh-canvas-wrap {
    height: calc(50vh - 52px - 70px) !important;
  }
  body.mh-sidebar-open #mh-canvas {
    /* canvas fica menor pero o iframe interno faz scale automatico */
  }

  /* TOOLBAR FLUTUANTE (mobile only) — aparece sobre o canvas perto do elemento */
  .mh-floating-toolbar {
    position: fixed;
    background: linear-gradient(180deg, rgba(26,29,36,0.96) 0%, rgba(20,22,27,0.98) 100%);
    backdrop-filter: blur(20px) saturate(160%);
    border: 1px solid rgba(91,156,255,0.3);
    border-radius: 14px;
    padding: 8px;
    z-index: 90;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    gap: 4px;
    transform-origin: top center;
    animation: ftSlide .18s cubic-bezier(.16,1,.3,1);
  }
  @keyframes ftSlide {
    from { opacity: 0; transform: translateY(-6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  body.mh-has-selection:not(.mh-sidebar-open) .mh-floating-toolbar { display: flex; }

  .mh-ft-btn {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--mh-ink-dim);
    border-radius: 8px;
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .12s;
  }
  .mh-ft-btn:hover, .mh-ft-btn.is-active {
    background: var(--mh-bg-3);
    color: #fff;
  }
  .mh-ft-btn.is-primary {
    background: linear-gradient(135deg, var(--mh-accent), #4D8AE6);
    color: white;
  }
  .mh-ft-sep {
    width: 1px;
    height: 22px;
    background: var(--mh-line);
    margin: 0 2px;
  }
  .mh-ft-size-display {
    min-width: 42px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--mh-accent);
    text-align: center;
    padding: 0 6px;
  }

  /* FAB pra abrir sidebar completa */
  .mh-fab-sidebar {
    position: fixed;
    bottom: 86px;
    right: 14px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--mh-accent), #B265FF);
    border: 0;
    color: white;
    box-shadow: 0 8px 20px rgba(91,156,255,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 80;
    font-size: 18px;
    font-weight: 600;
  }
  body.mh-has-selection .mh-fab-sidebar { display: flex; }
  body.mh-sidebar-open .mh-fab-sidebar { display: none; }

  /* Botão "fechar sidebar" no header dela: mais visivel */
  .mh-panel__header--edit #mh-edit-close {
    width: 36px !important;
    height: 36px !important;
  }
}

/* ============================================================
   DRAG visual (PC e mobile): cursor + outline mais forte
   ============================================================ */
.stage [data-slot].mh-selected {
  cursor: move !important;
  will-change: transform;
}


/* ============================================================
   MODAIS DE GATE (cadastro / limite atingido)
   ============================================================ */
/* === MODAIS GATE === */
.mh-gate-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5,7,10,0.85);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.mh-gate-overlay.is-visible { display: flex; }

.mh-gate-card {
  background: linear-gradient(180deg, rgba(26,29,36,0.95) 0%, rgba(20,22,27,1) 100%);
  border: 1px solid rgba(91,156,255,0.25);
  border-radius: 18px;
  padding: 36px 36px 30px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}
.mh-gate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, #5B9CFF, #B265FF, transparent);
}
.mh-gate-card .icon {
  font-size: 44px;
  margin-bottom: 14px;
  display: inline-block;
}
.mh-gate-card .kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: #A8C8FF;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.mh-gate-card h2 {
  font-family: 'Inter Tight', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.mh-gate-card p {
  font-size: 14.5px;
  color: #C9D1DB;
  line-height: 1.55;
  margin-bottom: 22px;
}
.mh-gate-card p strong { color: #fff; font-weight: 600; }
.mh-gate-card .stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 18px 0 22px;
  padding: 14px 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.mh-gate-card .stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
}
.mh-gate-card .stat-val {
  font-family: 'Inter Tight', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: #5B9CFF;
  line-height: 1;
}
.mh-gate-card .stat-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: #6B7280;
  text-transform: uppercase;
}

.mh-gate-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}
.mh-gate-btn {
  flex: 1;
  height: 46px;
  border: 0;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mh-gate-btn--primary {
  background: linear-gradient(135deg, #FFB833 0%, #FF6B35 100%);
  color: #1A1810;
  font-weight: 700;
  box-shadow: 0 8px 22px rgba(255,184,51,0.3);
}
.mh-gate-btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(255,184,51,0.4);
}
.mh-gate-btn--secondary {
  background: rgba(255,255,255,0.06);
  color: #C9D1DB;
  border: 1px solid rgba(255,255,255,0.12);
}
.mh-gate-btn--secondary:hover { background: rgba(255,255,255,0.1); color: #fff; }

.mh-gate-features {
  text-align: left;
  background: rgba(91,156,255,0.05);
  border: 1px solid rgba(91,156,255,0.15);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
  font-size: 13px;
  color: #C9D1DB;
  line-height: 1.7;
}
.mh-gate-features li {
  list-style: none;
  padding: 2px 0 2px 22px;
  position: relative;
}
.mh-gate-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #34D399;
  font-weight: 700;
}

/* ============================================================
   WATERMARK no preview do iframe (vai dentro do iframe via CSS injected)
   ============================================================ */
.mh-free-watermark {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.06em;
  z-index: 99;
  pointer-events: none;
  mix-blend-mode: difference;
}


/* === I3: Painel de histórico visual === */
.mh-history-panel {
  position: fixed;
  top: 56px;
  left: 0;
  width: 280px;
  bottom: 70px;
  background: linear-gradient(180deg, rgba(26,29,36,0.95), rgba(20,22,27,1));
  backdrop-filter: blur(24px);
  border-right: 1px solid var(--mh-line);
  transform: translateX(-100%);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.mh-history-panel.is-open { transform: translateX(0); }
.mh-history-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--mh-line);
}
.mh-history-panel__header h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
}
.mh-history-close {
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.05);
  border: 0;
  border-radius: 6px;
  color: var(--mh-ink-dim);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mh-history-close:hover { background: rgba(255,255,255,0.12); color: #fff; }
.mh-history-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.mh-history-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  color: var(--mh-ink-dim);
  margin-bottom: 4px;
  font-family: inherit;
  transition: all .15s;
}
.mh-history-item:hover {
  background: rgba(91,156,255,0.06);
  border-color: rgba(91,156,255,0.18);
  color: #fff;
}
.mh-history-item.is-current {
  background: rgba(91,156,255,0.12);
  border-color: rgba(91,156,255,0.4);
  color: #fff;
}
.mh-history-item__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--mh-line);
  flex-shrink: 0;
}
.mh-history-item.is-current .mh-history-item__dot {
  background: var(--mh-accent);
  box-shadow: 0 0 0 3px rgba(91,156,255,0.2);
}
.mh-history-item__main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.mh-history-item__label {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
}
.mh-history-item__time {
  font-size: 10.5px;
  color: var(--mh-ink-soft);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
}
.mh-history-item__current {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--mh-accent);
  text-transform: uppercase;
  padding: 2px 6px;
  background: rgba(91,156,255,0.15);
  border-radius: 4px;
}
.mh-history-panel__footer {
  padding: 12px 16px;
  border-top: 1px solid var(--mh-line);
  font-size: 11.5px;
  color: var(--mh-ink-soft);
  line-height: 1.4;
}

/* Mobile: painel histórico full width */
@media (max-width: 900px) {
  .mh-history-panel { width: 85vw; max-width: 320px; }
}


/* === FIX toolbar desktop === */
/* Sempre escondida fora do mobile, garantindo nao vazar em desktop */
.mh-floating-toolbar { display: none !important; }
@media (max-width: 900px) {
  body.mh-has-selection:not(.mh-sidebar-open) .mh-floating-toolbar { display: flex !important; }
}

/* MH_PINCH_TOUCH_ACTION: bloqueia pinch-zoom nativo no canvas (pinch passa a ser do editor) */
.mh-canvas-wrap, .mh-canvas-wrap iframe, #mh-canvas { touch-action: pan-x pan-y !important; }
body.mh-editor-body { overscroll-behavior: contain; }

/* MH_MOBILE_COMPACT: painel de edicao mobile com campos mais apertados */
@media (max-width: 900px) {
  .mh-sidebar .mh-panel { padding: 14px 14px 60px !important; }
  .mh-sidebar .mh-field { margin-bottom: 10px !important; }
  .mh-sidebar .mh-field__label { font-size: 11px !important; margin-bottom: 4px !important; }
  .mh-sidebar .mh-input, .mh-sidebar .mh-slider { min-height: 36px !important; }
  .mh-sidebar .mh-input--text { min-height: 56px !important; padding: 8px 10px !important; font-size: 13px !important; }
  .mh-sidebar .mh-segment button { min-height: 34px !important; font-size: 12px !important; padding: 4px 6px !important; }
  .mh-sidebar .mh-pos-row { gap: 6px !important; }
  .mh-sidebar .mh-color-row { gap: 6px !important; }
  .mh-sidebar .mh-palette-row { gap: 4px !important; }
  .mh-sidebar .mh-palette-swatch { width: 22px !important; height: 22px !important; }
  .mh-sidebar .mh-toggle { width: 34px !important; height: 34px !important; }
  /* botao delete no header destaque */
  #mh-panel-delete { color: #f87171 !important; }
  #mh-panel-delete:hover, #mh-panel-delete:active { background: rgba(248,113,113,0.12) !important; }
}

/* UX_POLISH_V2 ============================================================ */
/* Chip "Salvo há Xs" — saving (amarelo) / saved (verde) */
.mh-autosave-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: .04em;
  background: rgba(120, 120, 120, 0.10);
  color: var(--mh-ink-soft, #888);
  border: 1px solid rgba(120, 120, 120, 0.18);
  transition: background .25s ease, color .25s ease, border-color .25s ease;
  white-space: nowrap;
}
.mh-autosave-chip .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  opacity: .8;
}
.mh-autosave-chip.is-saving {
  background: rgba(234, 179, 8, 0.14);
  color: #b08300;
  border-color: rgba(234, 179, 8, 0.35);
}
.mh-autosave-chip.is-saving .dot { animation: mhAutosavePulse 1s ease-in-out infinite; }
@keyframes mhAutosavePulse {
  0%, 100% { opacity: .35; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.1); }
}
.mh-autosave-chip.is-saved {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
  border-color: rgba(34, 197, 94, 0.35);
}
@media (prefers-color-scheme: dark) {
  .mh-autosave-chip.is-saving { color: #facc15; }
  .mh-autosave-chip.is-saved  { color: #4ade80; }
}

/* Help modal — atalhos */
.mh-help-overlay {
  position: fixed; inset: 0;
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: mhHelpFade .15s ease-out;
}
@keyframes mhHelpFade { from { opacity: 0; } to { opacity: 1; } }
.mh-help-dialog {
  background: var(--mh-bg, #fff);
  color: var(--mh-ink, #111);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04);
  width: min(560px, 100%);
  max-height: min(85vh, 720px);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.mh-help-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(120,120,120,0.18);
  font-size: 14px;
}
.mh-help-close {
  appearance: none; border: 0; background: transparent;
  font-size: 22px; line-height: 1; cursor: pointer;
  color: var(--mh-ink-soft, #888);
  width: 32px; height: 32px; border-radius: 8px;
}
.mh-help-close:hover { background: rgba(120,120,120,0.12); color: var(--mh-ink, #111); }
.mh-help-body {
  padding: 14px 18px 18px;
  overflow: auto;
  display: flex; flex-direction: column; gap: 18px;
}
.mh-help-section__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--mh-ink-soft, #888);
  margin-bottom: 6px;
  font-family: 'JetBrains Mono', monospace;
}
.mh-help-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mh-help-table td { padding: 7px 8px; border-bottom: 1px solid rgba(120,120,120,0.10); vertical-align: middle; }
.mh-help-table tr:last-child td { border-bottom: 0; }
.mh-help-key { width: 38%; }
.mh-help-table kbd {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  padding: 3px 7px;
  background: rgba(120,120,120,0.10);
  border: 1px solid rgba(120,120,120,0.25);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--mh-ink, #111);
  white-space: nowrap;
}

/* Shepherd mobile — modal centralizado + textos/botoes maiores */
.shepherd-theme-mh--mobile.shepherd-element {
  max-width: 92vw !important;
  width: 92vw !important;
}
.shepherd-theme-mh--mobile .shepherd-text {
  font-size: 14px !important;
  line-height: 1.45 !important;
  padding: 14px 16px !important;
}
.shepherd-theme-mh--mobile .shepherd-title {
  font-size: 16px !important;
}
.shepherd-theme-mh--mobile .shepherd-footer {
  padding: 10px 14px 14px !important;
  gap: 10px !important;
}
.shepherd-theme-mh--mobile .shepherd-button {
  min-height: 44px !important;
  padding: 10px 18px !important;
  font-size: 14px !important;
  border-radius: 10px !important;
}
.shepherd-theme-mh--mobile .shepherd-cancel-icon {
  font-size: 22px !important;
  padding: 6px 10px !important;
}
/* sem seta no mobile (modal centralizado) */
.shepherd-theme-mh--mobile .shepherd-arrow,
.shepherd-theme-mh--mobile .shepherd-arrow::before { display: none !important; }

@media (max-width: 900px) {
  .mh-autosave-chip { font-size: 10px; padding: 3px 8px; }
  .mh-help-dialog { width: 100%; max-height: 92vh; border-radius: 12px; }
  .mh-help-body { padding: 12px 14px 16px; }
  .mh-help-table { font-size: 13px; }
  .mh-help-key { width: 44%; }
}
/* UX_POLISH_V2 — fim ===================================================== */
