/* Carte membre — éditeur de flux (canvas central), palette MoonTik */
.ov-wizard.is-carte-flow {
  width: min(1440px, 100%) !important;
}
.ov-perso-layout.is-carte-flow {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: stretch;
  gap: 16px;
  width: 100%;
  flex-direction: unset;
}
.ov-perso-layout.is-carte-flow .ov-perso-preview-col {
  width: 100% !important;
  order: 0;
  min-width: 0;
  position: relative;
}
.ov-perso-layout.is-carte-flow .ov-perso-fields {
  width: 320px !important;
  max-height: calc(92vh - 160px);
  overflow: auto;
  padding-right: 4px;
}
.ov-perso-layout.is-carte-flow .ov-perso-live {
  aspect-ratio: auto !important;
  min-height: 520px;
  height: auto;
  display: block !important;
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.ov-perso-layout.is-carte-flow #ovScoreSkinBar {
  justify-content: center;
}

/* Hide the old right-panel trigger block; flux lives on the canvas */
#ovCarteFields .ov-cm-legacy-flow,
#ovCarteFields [data-cm-legacy-trigger] { display: none !important; }

.cmf-ed {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 8px 24px;
  min-height: 520px;
  padding: 8px 8px 8px 4px;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  border-radius: 16px;
}
.cmf-svg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none; z-index: 1; overflow: visible;
}
.cmf-left {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 14px;
  justify-content: center;
  padding: 8px 8px 8px 4px;
}
.cmf-node {
  position: relative;
  background: #12141c;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 14px;
  padding: 10px 12px 12px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.cmf-node.cmf-new {
  flex-direction: row; align-items: center; justify-content: space-between;
  border-style: dashed; border-color: rgba(0,212,255,0.45);
  background: rgba(0,212,255,0.04);
  padding: 8px 10px;
  cursor: pointer;
  color: #c4d4e8;
  font-size: 13px;
}
.cmf-node.cmf-new:hover { border-color: #00d4ff; background: rgba(0,212,255,0.1); }
.cmf-new-add {
  border: 0; border-radius: 8px;
  background: #2563eb; color: #fff;
  font-weight: 700; font-size: 12px;
  padding: 6px 10px; cursor: pointer;
}
.cmf-h { display: flex; align-items: center; gap: 10px; }
.cmf-h .ic {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 30px;
  background: rgba(0,212,255,0.14); color: #7dd3fc;
  display: grid; place-items: center; font-size: 15px;
}
.cmf-h small {
  display: block; color: #7dd3fc;
  font-size: 10px; letter-spacing: .08em; font-weight: 700;
}
.cmf-h b { font-size: 13.5px; color: #fff; font-weight: 700; }
.cmf-del {
  margin-left: auto; border: 0; background: transparent;
  color: #94a3b8; cursor: pointer; font-size: 14px; padding: 2px 4px;
}
.cmf-del:hover { color: #fda4af; }
.cmf-detail {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px; padding: 6px 8px;
  cursor: pointer; color: #e2e8f0; font-size: 12.5px;
}
.cmf-detail img { width: 22px; height: 22px; object-fit: contain; }
.cmf-detail .coins { margin-left: auto; color: #fbbf24; font-size: 11px; }
.cmf-detail input, .cmf-detail select {
  flex: 1; min-width: 0; background: #0e1016; border: 1px solid rgba(255,255,255,0.1);
  color: #fff; border-radius: 6px; padding: 4px 6px; font-size: 12px;
}
.cmf-c {
  display: flex; align-items: center; justify-content: space-between;
  color: #fbbf24; font-size: 10.5px; font-weight: 700; letter-spacing: .06em;
  border-top: 1px solid rgba(255,255,255,0.08); padding-top: 8px;
}
.cmf-conds { display: flex; flex-direction: column; gap: 5px; }
.cmf-add-cond {
  border: 1px dashed rgba(251,191,36,0.45);
  background: transparent; color: #fde68a;
  border-radius: 8px; padding: 6px 8px; font-size: 12px; cursor: pointer; text-align: left;
}
.cmf-add-cond:hover { background: rgba(251,191,36,0.08); }
.cmf-chip {
  display: flex; align-items: center; gap: 6px;
  background: rgba(251,191,36,0.1); border: 1px solid #854d0e;
  color: #fde68a; border-radius: 8px; padding: 4px 6px; font-size: 11.5px;
}
.cmf-chip input {
  width: 72px; background: #0e0e12; border: 1px solid #3a3a44;
  color: #fff; border-radius: 4px; font-size: 11px; padding: 2px 4px;
}
.cmf-chip button { border: 0; background: none; color: #fde68a; cursor: pointer; margin-left: auto; }
.cmf-port {
  position: absolute; right: -6px; top: 36px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #0b0b0f; border: 2px solid #00d4ff; z-index: 3;
}
.cmf-mid { position: relative; z-index: 2; display: flex; justify-content: center; align-items: stretch; min-width: 0; }
.cmf-card {
  position: relative;
  background: #0d0e14;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 10px 10px 0;
  display: flex; flex-direction: column;
  width: min(420px, 100%);
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
}
.cmf-in {
  position: absolute; left: -7px; top: 42%;
  width: 14px; height: 14px; border-radius: 50%;
  background: #00d4ff; box-shadow: 0 0 0 3px rgba(0,212,255,0.2); z-index: 3;
}
.cmf-preview {
  min-height: 380px;
  display: grid; place-items: center;
  background:
    linear-gradient(45deg, #1a1a22 25%, transparent 25%),
    linear-gradient(-45deg, #1a1a22 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #1a1a22 75%),
    linear-gradient(-45deg, transparent 75%, #1a1a22 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-color: #111118;
  border-radius: 10px;
  overflow: hidden;
}
.cmf-preview .ov-live-preview,
.cmf-preview .ov-prev-carte { max-width: 100%; }
.cmf-react {
  padding: 10px 8px 12px;
}
.cmf-react-lab {
  color: #fb923c; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  margin-bottom: 8px;
}
.cmf-react-row {
  display: flex; align-items: center; gap: 8px;
  color: #cbd5e1; font-size: 13px; padding: 6px 0;
}
.cmf-react-row > span:first-child { flex: 1; }
.cmf-react-pick {
  border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04);
  color: #e2e8f0; border-radius: 8px; padding: 3px 8px; font-size: 11px; cursor: pointer;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cmf-sw {
  position: relative; width: 36px; height: 20px; flex: 0 0 36px;
}
.cmf-sw input { opacity: 0; width: 0; height: 0; }
.cmf-sw i {
  position: absolute; inset: 0; border-radius: 999px;
  background: #2a2a36; transition: .15s;
}
.cmf-sw i::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 2px; left: 2px; transition: .15s;
}
.cmf-sw input:checked + i { background: #00d4ff; }
.cmf-sw input:checked + i::after { transform: translateX(16px); }

/* Left trigger catalog panel */
.cmf-panel {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 260px; z-index: 8;
  background: #0c0d14;
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: 12px 0 32px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; padding: 10px;
  transform: translateX(-110%);
  transition: transform .2s ease;
}
.ov-perso-layout.is-carte-flow .ov-perso-preview-col { overflow: hidden; }
.cmf-panel.open { transform: translateX(0); }
.cmf-panel input[type="search"] {
  width: 100%; background: #161822; border: 1px solid rgba(255,255,255,0.1);
  color: #fff; border-radius: 10px; padding: 8px 10px 8px 32px; font-size: 13px;
  margin-bottom: 8px;
}
.cmf-search-wrap { position: relative; }
.cmf-search-wrap::before {
  content: "⌕"; position: absolute; left: 10px; top: 8px; color: #64748b; font-size: 14px;
}
.cmf-panel button.cmf-kind {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  background: #161822; border: 1px solid rgba(255,255,255,0.06);
  color: #e2e8f0; border-radius: 10px; padding: 9px 12px;
  margin-bottom: 6px; cursor: pointer; font-size: 13.5px;
}
.cmf-panel button.cmf-kind:hover { border-color: #00d4ff; background: rgba(0,212,255,0.08); }
.cmf-panel button.cmf-kind .ic {
  width: 26px; text-align: center; font-size: 16px;
}
.cmf-menu {
  position: absolute; z-index: 12;
  background: #161822; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; min-width: 220px; padding: 4px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.cmf-menu button {
  display: block; width: 100%; text-align: left; border: 0;
  background: transparent; color: #e2e8f0; padding: 7px 10px;
  border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
.cmf-menu button:hover { background: rgba(0,212,255,0.12); }
.cmf-react-pop {
  position: absolute; z-index: 12; right: 12px; bottom: 52px;
  width: 280px; max-height: 280px; overflow: auto;
  background: #161822; border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px; padding: 8px; box-shadow: 0 12px 32px rgba(0,0,0,0.5);
}
.cmf-react-pop h4 { margin: 0 0 6px; font-size: 11px; letter-spacing: .06em; color: #94a3b8; }
.cmf-react-pop button {
  display: block; width: 100%; text-align: left; border: 0;
  background: transparent; color: #e2e8f0; padding: 6px 8px;
  border-radius: 6px; cursor: pointer; font-size: 12.5px;
}
.cmf-react-pop button:hover { background: rgba(0,212,255,0.12); }


/* t70 — plus de place pour la carte et les déclencheurs, tiroir de recherche par-dessus le canevas */
.ov-perso-layout.is-carte-flow .ov-perso-live,
.ov-wizard-overlay.is-perso:has(#cmfEd) #ovPersoLivePreview {
  min-height: 640px !important;
  height: 100% !important;
  overflow: hidden !important;
}
.cmf-ed {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) !important;
  grid-template-rows: 1fr;
  gap: 12px 28px !important;
  width: 100%;
  height: 100%;
  min-height: 640px;
  padding: 56px 16px 16px 12px !important;
  overflow: auto;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 18px 18px;
  border-radius: 16px;
  box-sizing: border-box;
}
.cmf-left {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 14px;
  justify-content: flex-start;
  align-self: stretch;
  padding: 4px 8px 8px 4px;
  min-width: 0;
  overflow: auto;
}
.cmf-mid {
  position: relative; z-index: 2;
  display: flex; justify-content: center; align-items: center;
  min-width: 0; min-height: 0;
  padding: 0 8px 0 12px;
}
.cmf-card {
  width: min(460px, 100%);
  max-height: 100%;
  display: flex; flex-direction: column;
  min-height: 0;
}
.cmf-preview {
  flex: 1 1 auto;
  min-height: 420px;
  height: min(62vh, 560px);
  overflow: hidden;
  display: grid; place-items: center;
}
.cmf-react {
  flex: 0 0 auto;
  padding: 14px 8px 16px;
  min-height: 108px;
}
.cmf-react-row { padding: 8px 0; }

/* Tiroir de recherche : overlay, ne compresse pas le canevas */
.cmf-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 5, 18, 0.45);
  z-index: 20;
  border: 0; padding: 0; margin: 0;
  cursor: pointer;
}
.cmf-panel, .cmf-ed > aside.cmf-panel {
  position: absolute !important;
  left: 12px; top: 52px; bottom: 12px;
  width: min(340px, 86%) !important;
  z-index: 21;
  background: #12121c;
  border: 1px solid rgba(167,139,250,0.28);
  border-radius: 16px;
  box-shadow: 16px 0 40px rgba(0,0,0,0.45);
  display: flex; flex-direction: column;
  padding: 12px;
  transform: translateX(0) !important;
  overflow: hidden;
}
.cmf-panel[hidden] { display: none !important; }
.cmf-panel .cmf-kind-list, .cmf-panel #cmfKindList {
  flex: 1; overflow: auto; min-height: 0;
  padding-right: 4px;
}
.ov-perso-layout.is-carte-flow .ov-perso-preview-col { overflow: visible; }
