.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: #3B5828;
  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-forgot {
  justify-self: start;
  min-height: auto !important;
  border: 0 !important;
  background: transparent !important;
  color: #3B5828 !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 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 > div {
  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 > div {
    grid-template-columns: 1fr;
  }
}

/* >>> MT-MOBILE-REMARQUE DEBUT */
/* Point d'accès : 44 px de zone tactile, 22 px visibles (le site reste public). */
@media (max-width: 760px) {
  .mt-editor-dot { width: 44px; height: 44px; background: transparent; border: 0;
    box-shadow: none; display: grid; place-items: center; right: 8px; bottom: 8px; }
  .mt-editor-dot::after { content: ""; width: 22px; height: 22px; border-radius: 50%;
    background: #dfceb0; border: 2px solid rgba(107,142,127,.38); box-shadow: 0 12px 30px rgba(45,74,62,.24); }
  /* La barre du mode puzzle passait à la ligne et couvrait les blocs : une seule rangée, en bas. */
  .mt-editor-lay-bar { left: 0; right: 0; transform: none; max-width: none;
    border-radius: 14px 14px 0 0; flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; gap: 8px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); font-size: 12px; }
  .mt-editor-lay-bar.visible { bottom: 0; }
  .mt-editor-lay-bar .mt-editor-lay-help { display: none; }
  .mt-editor-lay-bar button { white-space: nowrap; min-height: 40px; }
}
body.mt-editor-layout [data-mt-lay-bound="1"],
body.mt-editor-layout .mt-editor-lay-selected,
body.mt-editor-layout [data-lay-box] { touch-action: none; -webkit-user-select: none; user-select: none; }
body.mt-editor-layout [data-lay-box] button { min-width: 40px; min-height: 40px; }

/* Remarques — feuille basse, pensée pour le pouce, correcte aussi à la souris. */
.mt-editor-mode-remarque::after { content: "Touchez le bloc à commenter"; position: fixed;
  left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2147483100; background: #2f3b31;
  color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; box-shadow: 0 10px 26px rgba(0,0,0,.25); }
.mt-editor-remarque { position: fixed; inset: 0; z-index: 2147483200; display: flex; align-items: flex-end; }
.mt-editor-remarque__fond { position: absolute; inset: 0; background: rgba(20,26,22,.45); }
.mt-editor-remarque__carte { position: relative; width: 100%; max-width: 520px; margin: 0 auto;
  background: #fff; border-radius: 18px 18px 0 0; padding: 18px 18px 22px; display: grid; gap: 10px;
  box-shadow: 0 -10px 40px rgba(0,0,0,.25); font-family: inherit; max-height: 86vh; overflow: auto; }
.mt-editor-remarque__carte strong { font-size: 17px; }
.mt-editor-remarque__extrait { margin: 0; font-size: 13px; opacity: .72; }
.mt-editor-remarque__carte textarea { width: 100%; font: inherit; font-size: 16px; padding: 12px;
  border-radius: 12px; border: 1px solid rgba(0,0,0,.18); background: #fff; resize: vertical; min-height: 96px; }
.mt-editor-remarque__capture { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.mt-editor-remarque__capture input { width: 20px; height: 20px; }
.mt-editor-remarque__etat { margin: 0; font-size: 13px; }
.mt-editor-remarque__actions { display: flex; gap: 10px; justify-content: flex-end; }
.mt-editor-remarque__actions button { font: inherit; font-size: 15px; padding: 12px 18px;
  border-radius: 999px; border: 0; cursor: pointer; min-height: 44px; }
.mt-editor-remarque__actions button[type="submit"] { background: #2f3b31; color: #fff; }
.mt-editor-remarque__actions button[data-annuler] { background: rgba(0,0,0,.08); }
.mt-editor-remarque-bloc button { width: 100%; min-height: 48px; font-size: 15px; }
.mt-editor-remarque-bloc small { display: block; margin-top: 6px; opacity: .7; font-size: 12px; line-height: 1.4; }
/* <<< MT-MOBILE-REMARQUE FIN */
