.mt-editor-dot,
.mt-editor-panel,
.mt-editor-toolbar,
.mt-editor-bar,
.mt-editor-image-modal {
  box-sizing: border-box;
  font-family: Outfit, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.mt-editor-dot {
  position: fixed;
  z-index: 2147483000;
  right: 18px;
  bottom: 18px;
  width: 22px;
  height: 22px;
  border: 2px solid rgba(107, 142, 127, 0.38);
  border-radius: 50%;
  background: #dfceb0;
  box-shadow: 0 12px 30px rgba(45, 74, 62, 0.24);
  cursor: pointer;
}

.mt-editor-panel {
  position: fixed;
  z-index: 2147483020;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100vw);
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: #fffaf1;
  color: #2d4a3e;
  box-shadow: -28px 0 70px rgba(25, 35, 32, 0.26);
  transform: translateX(105%);
  transition: transform 240ms ease;
}

.mt-editor-panel.open {
  transform: translateX(0);
}

.mt-editor-head,
.mt-editor-foot {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(45, 74, 62, 0.14);
}

.mt-editor-foot {
  border-top: 1px solid rgba(45, 74, 62, 0.14);
  border-bottom: 0;
}

.mt-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.mt-editor-head strong {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1;
}

.mt-editor-head small,
.mt-editor-hint {
  display: block;
  margin-top: 6px;
  color: rgba(45, 74, 62, 0.7);
  font-size: 13px;
  line-height: 1.5;
}

.mt-editor-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(45, 74, 62, 0.18);
  border-radius: 50%;
  background: transparent;
  color: #2d4a3e;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.mt-editor-body {
  overflow: auto;
  padding: 20px;
}

.mt-editor-block {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.mt-editor-block > strong {
  color: #6b8e7f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mt-editor-field {
  display: grid;
  gap: 6px;
}

.mt-editor-field span {
  color: rgba(45, 74, 62, 0.74);
  font-size: 12px;
  font-weight: 700;
}

.mt-editor-field input,
.mt-editor-field select,
.mt-editor-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(45, 74, 62, 0.18);
  background: #fff;
  color: #2d4a3e;
  padding: 0 12px;
  font: inherit;
}

.mt-editor-field textarea {
  min-height: 130px;
  padding: 12px;
  resize: vertical;
}

.mt-editor-actions,
.mt-editor-grid {
  display: grid;
  gap: 10px;
}

.mt-editor-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mt-editor-actions button,
.mt-editor-panel button:not(.mt-editor-close),
.mt-editor-bar button,
.mt-editor-image-card button {
  min-height: 42px;
  border: 1px solid rgba(45, 74, 62, 0.16);
  background: #3D1F0D;
  color: #fffaf1;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.mt-editor-actions button.secondary,
.mt-editor-bar button.secondary,
.mt-editor-image-card button.secondary {
  background: transparent;
  color: #fffaf1;
}

.mt-editor-image-card button.secondary {
  background: #fffaf1;
  color: #2d4a3e !important;
  border-color: rgba(45, 74, 62, 0.24);
}

.mt-editor-image-card button.secondary:hover,
.mt-editor-image-card button.secondary:focus {
  background: rgba(107, 142, 127, 0.12);
  border-color: rgba(45, 74, 62, 0.38);
}

.mt-editor-panel .secondary {
  color: #2d4a3e !important;
}

.mt-editor-error {
  display: none;
  margin: 0;
  padding: 10px 12px;
  background: #fff0ea;
  color: #a3422e;
  font-size: 13px;
  font-weight: 700;
}

.mt-editor-error.visible {
  display: block;
}

.mt-editor-info {
  display: none;
  margin: 0;
  padding: 10px 12px;
  background: rgba(107, 142, 127, 0.12);
  color: #2d4a3e;
  font-size: 12.5px;
  line-height: 1.5;
}

.mt-editor-info.visible {
  display: block;
}

.mt-editor-info a {
  color: #85672E;
  font-weight: 700;
}

.mt-editor-info button {
  min-height: auto !important;
  border: 0 !important;
  background: transparent !important;
  color: #85672E !important;
  padding: 0 !important;
  font: inherit !important;
  font-weight: 700 !important;
  text-decoration: underline;
  cursor: pointer;
}

.mt-editor-forgot {
  justify-self: start;
  min-height: auto !important;
  border: 0 !important;
  background: transparent !important;
  color: #85672E !important;
  padding: 2px 0 !important;
  cursor: pointer;
  font-size: 12px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-transform: uppercase;
}

.mt-editor-forgot:hover,
.mt-editor-forgot:focus {
  color: #2d4a3e !important;
}

body.mt-editor-editing [data-mt-editable] {
  outline: 1px dashed rgba(223, 206, 176, 0.86);
  outline-offset: 4px;
  cursor: text;
}

body.mt-editor-editing [data-mt-editable]:hover,
body.mt-editor-editing [data-mt-editable]:focus {
  background: rgba(223, 206, 176, 0.13);
  outline: 2px solid rgba(107, 142, 127, 0.74);
}

body.mt-editor-editing [data-mt-image-editable] {
  cursor: copy;
  outline: 1px dashed rgba(223, 206, 176, 0.86);
  outline-offset: 5px;
}

body.mt-editor-editing [data-mt-image-editable]:hover {
  filter: saturate(1.04) brightness(1.02);
  outline: 2px solid rgba(107, 142, 127, 0.76);
}

.mt-editor-toolbar {
  position: absolute;
  z-index: 2147483030;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  max-width: min(92vw, 650px);
  padding: 6px;
  background: rgba(45, 74, 62, 0.98);
  color: #fffaf1;
  box-shadow: 0 16px 40px rgba(25, 35, 32, 0.3);
}

.mt-editor-toolbar[hidden],
.mt-editor-file-input {
  display: none;
}

.mt-editor-toolbar button,
.mt-editor-toolbar label {
  display: grid;
  min-width: 36px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf1;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.mt-editor-toolbar label {
  position: relative;
  overflow: hidden;
}

.mt-editor-toolbar input[type="color"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.mt-editor-bar {
  position: fixed;
  z-index: 2147483010;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: min(1240px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 12px 14px;
  border: 1px solid rgba(223, 206, 176, 0.44);
  background: rgba(45, 74, 62, 0.98);
  color: #fffaf1;
  box-shadow: 0 18px 50px rgba(25, 35, 32, 0.36);
}

.mt-editor-bar[hidden] {
  display: none;
}

.mt-editor-bar strong {
  flex: 0 0 auto;
  color: #dfceb0;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}

.mt-editor-bar span {
  flex: 1 1 210px;
  max-width: 260px;
  color: rgba(255, 250, 241, 0.78);
  font-size: 13px;
  line-height: 1.45;
}

.mt-editor-bar em {
  flex: 0 0 auto;
  color: rgba(223, 206, 176, 0.9);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.mt-editor-bar label {
  display: grid;
  flex: 1 1 210px;
  gap: 3px;
  min-width: 190px;
  max-width: 260px;
}

.mt-editor-bar small {
  color: rgba(255, 250, 241, 0.6);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mt-editor-bar select {
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #fffaf1;
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.mt-editor-bar select option {
  color: #2d4a3e;
}

.mt-editor-bar button {
  flex: 0 0 auto;
  min-width: 112px;
  padding: 0 12px;
  white-space: nowrap;
}

.mt-editor-image-chip-layer {
  position: absolute;
  z-index: 2147483008;
  inset: 0 auto auto 0;
  pointer-events: none;
}

.mt-editor-image-chip {
  position: absolute;
  min-width: 78px;
  height: 36px;
  border: 1px solid rgba(223, 206, 176, 0.78);
  background: rgba(45, 74, 62, 0.96);
  color: #fffaf1;
  box-shadow: 0 12px 32px rgba(25, 35, 32, 0.28);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  pointer-events: auto;
}

.mt-editor-image-chip::before {
  content: "+";
  margin-right: 6px;
  color: #dfceb0;
}

.mt-editor-image-modal {
  position: fixed;
  z-index: 2147483040;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(30, 42, 38, 0.62);
}

.mt-editor-image-modal[hidden] {
  display: none;
}

.mt-editor-image-card {
  width: min(520px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: #fffaf1;
  color: #2d4a3e;
  box-shadow: 0 28px 80px rgba(25, 35, 32, 0.34);
}

.mt-editor-image-card [data-image-step-pick],
.mt-editor-image-card [data-image-step-crop] {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.mt-editor-image-card [data-image-step-pick][hidden],
.mt-editor-image-card [data-image-step-crop][hidden] {
  display: none;
}

.mt-editor-crop-preview {
  position: relative;
  cursor: crosshair;
  overflow: hidden;
  border: 1px solid rgba(45, 74, 62, 0.18);
  max-height: 320px;
  line-height: 0;
}

.mt-editor-crop-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
}

.mt-editor-crop-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 3px solid #fffaf1;
  background: #C4973A;
  box-shadow: 0 0 0 1px rgba(45, 74, 62, 0.4), 0 4px 10px rgba(25, 35, 32, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.mt-editor-image-card strong {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 31px;
  font-weight: 500;
}

.mt-editor-image-card p {
  margin: 0;
  color: rgba(45, 74, 62, 0.72);
  line-height: 1.6;
}

.mt-editor-image-card label {
  display: grid;
  gap: 8px;
}

.mt-editor-image-card input {
  min-height: 46px;
  border: 1px solid rgba(45, 74, 62, 0.18);
  padding: 0 12px;
  font: inherit;
}

.mt-editor-image-card .mt-editor-image-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 640px) {
  .mt-editor-dot {
    right: 14px;
    bottom: 14px;
  }

  .mt-editor-panel {
    width: 100vw;
  }

  .mt-editor-grid {
    grid-template-columns: 1fr;
  }

  .mt-editor-bar {
    align-items: stretch;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    right: 10px;
    bottom: 10px;
    left: 10px;
    gap: 7px;
    max-height: 34vh;
    overflow: auto;
    padding: 9px;
  }

  .mt-editor-bar strong {
    grid-column: 1;
    align-self: center;
    font-size: 10px;
    letter-spacing: 0.1em;
  }

  .mt-editor-bar span {
    display: none;
  }

  .mt-editor-bar em {
    grid-column: 2;
    align-self: center;
    overflow: hidden;
    font-size: 10px;
    text-align: right;
    text-overflow: ellipsis;
  }

  .mt-editor-bar label {
    grid-column: 1 / -1;
    min-width: 0;
    max-width: none;
  }

  .mt-editor-bar button {
    min-width: 0;
    min-height: 40px;
    width: 100%;
    padding: 0 8px;
    font-size: 10px;
    letter-spacing: 0.06em;
  }

  body.mt-editor-editing {
    padding-bottom: 230px;
  }

  .mt-editor-image-card .mt-editor-image-actions {
    grid-template-columns: 1fr;
  }
}

/* ===== Mode puzzle + panneau Code — ajoutes le 2026-09-05 (portage depuis
   l'editeur de Michael Bourloux). Le chrome du panneau garde volontairement la
   palette outil commune au parc, pas la charte de la cliente. ===== */
.mt-editor-crop-preview.is-locked {
  cursor: default;
}
.mt-editor-crop-frame {
  position: absolute;
  border: 2px solid #C4973A;
  box-shadow: 0 0 0 9999px rgba(25, 35, 32, 0.5);
  pointer-events: none;
  transition: left 0.08s linear, top 0.08s linear;
}
.mt-editor-crop-frame[hidden] {
  display: none;
}
.mt-editor-crop-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: #5c6b62;
}
.mt-editor-crop-zoom {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #2d4a3e;
}
.mt-editor-crop-zoom input[type="range"] {
  width: 100%;
  accent-color: #C4973A;
}
.mt-editor-crop-zoom b {
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mt-editor-grid--colors {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 10px;
}
.mt-editor-grid--colors .mt-editor-field span {
  font-size: 11px;
  line-height: 1.3;
}
.mt-editor-grid--colors input[type="color"] {
  padding: 2px;
  min-height: 38px;
  cursor: pointer;
}
.mt-editor-frame-box {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border: 1px solid rgba(45, 74, 62, 0.16);
  border-radius: 12px;
  background: rgba(45, 74, 62, 0.04);
}
.mt-editor-frame-box strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
}
.mt-editor-frame-box p {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.45;
  opacity: 0.8;
}
.mt-editor-frame-box .mt-editor-crop-zoom {
  margin-bottom: 10px;
}
.mt-editor-layout-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2147482000;
}
.mt-editor-lay-box {
  position: absolute;
  border: 2px solid #C4973A;
  border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(14, 16, 23, 0.04);
  pointer-events: none;
}
.mt-editor-lay-handle {
  position: absolute;
  min-width: 48px;
  height: 48px;
  padding: 0 14px;
  border-radius: 999px;
  border: none;
  background: #3D1F0D;
  color: #F9F5F1;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: grab;
  pointer-events: auto;
  box-shadow: 0 8px 22px rgba(14, 16, 23, 0.35);
  touch-action: none;
}
.mt-editor-lay-icon { font-size: 17px; line-height: 1; }
.mt-editor-lay-label { font-size: 12px; font-weight: 700; white-space: nowrap; }
.mt-editor-lay-handle.is-move { left: -12px; top: -12px; }
.mt-editor-lay-handle.is-size {
  right: -24px; bottom: -24px; width: 48px; padding: 0;
  cursor: nwse-resize; background: #C4973A; color: #3D1F0D;
}
.mt-editor-lay-tip {
  position: absolute;
  right: 6px;
  top: -28px;
  background: #3D1F0D;
  color: #F9F5F1;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.mt-editor-lay-marker {
  position: absolute;
  height: 4px;
  background: #C4973A;
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(217, 141, 66, 0.25);
}
.mt-editor-lay-bar {
  position: fixed;
  left: 50%;
  bottom: -100px;
  transform: translateX(-50%);
  z-index: 2147483000;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: calc(100vw - 24px);
  padding: 12px 18px;
  border-radius: 999px;
  background: #F9F5F1;
  color: #3D1F0D;
  box-shadow: 0 16px 44px rgba(14, 16, 23, 0.28);
  transition: bottom 0.25s ease;
  font-size: 13px;
}
.mt-editor-lay-bar.visible { bottom: 18px; }
.mt-editor-lay-bar .mt-editor-lay-help { opacity: 0.75; }
.mt-editor-lay-bar b { font-weight: 700; }
body.mt-editor-layout [data-mt-lk] { cursor: pointer; }
body.mt-editor-layout [data-mt-lk]:hover { outline: 2px dashed rgba(217, 141, 66, 0.7); outline-offset: 2px; }
body.mt-editor-layout .mt-editor-lay-selected { outline: none; }
body.mt-editor-layout [data-mt-lk] { transition: none !important; }
body.mt-editor-lay-dragging { user-select: none; }
body.mt-editor-lay-dragging * { cursor: grabbing !important; }
.mt-editor-layouted { max-width: 100% !important; }
@media (max-width: 760px) {
  .mt-editor-layouted { height: auto !important; min-height: 0 !important; max-height: 70vh; }
}
.mt-editor-lay-bar button {
  font: inherit;
  font-weight: 600;
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  cursor: pointer;
  background: #3D1F0D;
  color: #F9F5F1;
}
.mt-editor-lay-bar button.secondary {
  background: transparent;
  color: #3D1F0D;
  border: 1px solid rgba(14, 16, 23, 0.25);
}
.mt-editor-lay-bar button:hover { opacity: 0.88; }
.mt-editor-freepos {
  transform: translate(var(--mt-tx, 0px), var(--mt-ty, 0px));
}
@media (max-width: 760px) {
  .mt-editor-freepos {
    transform: none !important;
  }
}
.mt-editor-lay-guide {
  position: absolute;
  z-index: 2147482900;
  pointer-events: none;
  background: #c4973a;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .55);
}
.mt-editor-lay-guide.is-v { top: 0; width: 1px; height: 100%; }
.mt-editor-lay-guide.is-h { left: 0; height: 1px; width: 100%; }
.mt-editor-lay-size {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 4px;
  font-size: 13px;
  white-space: nowrap;
}
.mt-editor-lay-size label { display: inline-flex; align-items: center; gap: 4px; }
.mt-editor-lay-size input[type="number"] {
  width: 72px;
  padding: 4px 6px !important;
  border: 1px solid rgba(0, 0, 0, .25);
  border-radius: 6px;
  font: inherit;
  font-family: inherit !important;
  text-align: right;
}
.mt-editor-lay-size input[type="number"]:disabled { opacity: .45; }
.mt-editor-lay-lock { font-size: 12px; opacity: .85; }
.mt-editor-code-box {
  width: min(1040px, 94vw) !important;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mt-editor-code-box .mt-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.mt-editor-code-box .mt-editor-actions button { padding: 0 18px; border-radius: 10px; }
.mt-editor-code-tabs { display: flex; align-items: center; gap: 8px; }
.mt-editor-code-tabs button {
  padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(0,0,0,.18);
  /* la regle boutons du panneau impose une encre presque blanche : sur un onglet
     inactif au fond transparent, le libelle disparaissait. */
  background: transparent !important; color: #3d1f0d !important;
  font: inherit; font-size: 13px; cursor: pointer; min-height: 0;
}
.mt-editor-code-tabs button.is-active { background: #3d1f0d !important; color: #fff !important; border-color: #3d1f0d; }
.mt-editor-code-where { margin-left: auto; font-size: 12px; opacity: .6; }
.mt-editor-code-area {
  width: 100%; min-height: 48vh; resize: vertical; padding: 12px 14px;
  border: 1px solid rgba(0,0,0,.2); border-radius: 10px; background: #fbfbfa;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 12.5px; line-height: 1.55; tab-size: 2; white-space: pre;
  padding: 12px 14px !important;
}
.mt-editor-code-error { display: none; font-size: 13px; color: #962f25; }
.mt-editor-code-error.visible { display: block; }
