/* ==========================================================================
       25. MODE ÉDITION DIRECTE (TEXTES, BOUTONS, IMAGES, FONDS)
       ========================================================================== */
    #edit-mode-fab,
    #edit-popover,
    .section-bg-btn {
      font-family: 'Inter', system-ui, sans-serif;
    }

    #edit-mode-fab {
      position: fixed;
      left: 18px;
      bottom: 18px;
      z-index: 1000;
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 15px;
      border-radius: 999px;
      border: 1px solid rgba(255, 255, 255, 0.16);
      background: #111318;
      color: #f3f4f6;
      font-size: 13px;
      font-weight: 600;
      line-height: 1;
      cursor: pointer;
      box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
      transition: transform 0.18s ease, background-color 0.2s ease, border-color 0.2s ease;
    }
    #edit-mode-fab:hover {
      transform: translateY(-2px);
    }
    #edit-mode-fab .edit-dot {
      width: 8px;
      height: 8px;
      border-radius: 999px;
      background: #6b7280;
      transition: background-color 0.2s ease, box-shadow 0.2s ease;
    }
    body.edit-mode #edit-mode-fab {
      background: #4f46e5;
      border-color: rgba(165, 180, 252, 0.55);
      color: #ffffff;
    }
    body.edit-mode #edit-mode-fab .edit-dot {
      background: #4ade80;
      box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.28);
    }

    /* Pilule gauche : Structure de la page uniquement (Monter, Descendre, Dupliquer, Supprimer) */
    .section-edit-tools {
      position: absolute;
      top: 10px;
      left: 12px;
      z-index: 66;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      padding: 4px;
      border-radius: 999px;
      background: #111318;
      color: #f3f4f6;
      border: 1px solid rgba(255, 255, 255, 0.22);
      box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
      font-family: 'Inter', system-ui, sans-serif;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.15s ease;
    }
    body.edit-mode .ui-section:hover > .section-edit-tools,
    body.edit-mode .tr-section-wrap:hover > .section-edit-tools,
    body.edit-mode .section-edit-tools:hover,
    body.edit-mode .section-edit-tools:focus-within,
    body.edit-mode.show-badges .section-edit-tools {
      opacity: 1;
      pointer-events: auto;
    }
    .section-tool-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 21px;
      height: 21px;
      padding: 0;
      border-radius: 999px;
      background: rgba(255, 255, 255, 0.14);
      color: #fff;
      border: 0;
      font-family: inherit;
      font-size: 11.5px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      transition: background-color 0.15s ease, opacity 0.15s ease;
    }
    .section-tool-btn:hover:not(:disabled) {
      background: #6366f1;
    }
    .section-tool-btn.is-danger:hover:not(:disabled) {
      background: #dc2626;
    }
    .section-tool-btn:disabled {
      opacity: 0.32;
      cursor: not-allowed;
    }

    /* Flèches Haut/Bas dans l'onglet Sections du Studio */
    .section-move-group {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .section-move-btn {
      width: 22px;
      height: 22px;
      border-radius: 6px;
      border: 1px solid var(--st-border, #272c38);
      background: #111318;
      color: #d1d5db;
      font-size: 11px;
      font-weight: 700;
      line-height: 1;
      cursor: pointer;
      display: grid;
      place-items: center;
      padding: 0;
      transition: background-color 0.14s ease, color 0.14s ease, opacity 0.14s ease;
    }
    .section-move-btn:hover:not(:disabled) {
      background: #6366f1;
      border-color: #6366f1;
      color: #ffffff;
    }
    .section-move-btn:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }

    /* Modale Éditeur de Menu */
    #menu-editor-modal {
      position: fixed;
      inset: 0;
      z-index: 1480;
      background: rgba(8, 10, 16, 0.78);
      backdrop-filter: blur(6px);
      display: none;
      align-items: center;
      justify-content: center;
      padding: 16px;
      font-family: 'Inter', system-ui, sans-serif;
    }
    #menu-editor-modal.is-open {
      display: flex;
    }
    .menu-ed-dialog {
      width: min(640px, 96vw);
      max-height: 86vh;
      background: #111318;
      color: #f3f4f6;
      border: 1px solid #272c38;
      border-radius: 14px;
      box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      font-size: 12.5px;
    }
    .menu-ed-header {
      padding: 14px 18px;
      background: #151821;
      border-bottom: 1px solid #272c38;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
    }
    .menu-ed-header h3 {
      margin: 0;
      font-family: 'Inter', sans-serif;
      font-size: 14px;
      font-weight: 700;
      color: #ffffff;
    }
    .menu-ed-body {
      padding: 14px 18px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 12px;
      flex: 1;
    }
    .menu-ed-item {
      background: #181c25;
      border: 1px solid #272c38;
      border-radius: 10px;
      padding: 12px;
      display: flex;
      flex-direction: column;
      gap: 9px;
    }
    .menu-ed-row {
      display: grid;
      grid-template-columns: 1fr 1fr auto;
      gap: 8px;
      align-items: center;
    }
    .menu-ed-row.has-type {
      grid-template-columns: 1.1fr 0.9fr auto;
    }
    .menu-ed-actions {
      display: inline-flex;
      align-items: center;
      gap: 4px;
    }
    .menu-ed-icon-btn {
      width: 26px;
      height: 26px;
      border-radius: 6px;
      border: 1px solid #2b3140;
      background: #111318;
      color: #d1d5db;
      font-size: 12px;
      cursor: pointer;
      display: grid;
      place-items: center;
      padding: 0;
    }
    .menu-ed-icon-btn:hover:not(:disabled) {
      background: #4f46e5;
      border-color: #4f46e5;
      color: #fff;
    }
    .menu-ed-icon-btn.is-danger:hover {
      background: #dc2626;
      border-color: #dc2626;
    }
    .menu-ed-icon-btn:disabled {
      opacity: 0.3;
      cursor: not-allowed;
    }
    .menu-ed-sublist {
      margin-left: 10px;
      padding-left: 12px;
      border-left: 2px solid #2f3649;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    .menu-ed-subitem {
      background: #12151d;
      border: 1px solid #252a38;
      border-radius: 8px;
      padding: 8px;
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .menu-ed-subgrid {
      display: grid;
      grid-template-columns: 1fr 1fr auto;
      gap: 6px;
      align-items: center;
    }
    .menu-ed-footer {
      padding: 12px 18px;
      background: #151821;
      border-top: 1px solid #272c38;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
    }
    .menu-ed-footer-group {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }
    body.edit-mode .nav-trigger:hover {
      outline: 2px dashed #06b6d4;
      outline-offset: 2px;
    }
    @media (max-width: 600px) {
      .menu-ed-row, .menu-ed-row.has-type, .menu-ed-subgrid {
        grid-template-columns: 1fr;
      }
    }

    /* Indicateurs visuels au survol en Mode Édition */
    body.edit-mode [data-edit-text] {
      cursor: text;
      transition: outline-color 0.15s ease, background-color 0.15s ease;
      border-radius: 4px;
    }
    body.edit-mode [data-edit-text]:hover {
      outline: 1.5px dashed rgba(99, 102, 241, 0.78);
      outline-offset: 3px;
    }
    body.edit-mode [data-edit-text]:focus {
      outline: 2px solid #6366f1;
      outline-offset: 3px;
      background: rgba(99, 102, 241, 0.08);
    }

    body.edit-mode [data-edit-btn] {
      cursor: pointer !important;
      position: relative;
    }
    body.edit-mode [data-edit-btn]:hover {
      outline: 2px dashed #06b6d4;
      outline-offset: 3px;
    }

    body.edit-mode [data-edit-img] {
      cursor: pointer !important;
      position: relative;
    }
    body.edit-mode .tr-expand-frame[data-edit-img]::after,
    body.edit-mode .tr-parallax[data-edit-img]::after {
      top: 44px;
      left: 14px;
    }
    body.edit-mode [data-edit-img]:hover {
      outline: 2px dashed #10b981;
      outline-offset: 3px;
    }
    body.edit-mode [data-edit-img]::after {
      content: 'Éditer l’image';
      position: absolute;
      top: 8px;
      left: 8px;
      z-index: 15;
      padding: 4px 8px;
      border-radius: 999px;
      background: rgba(16, 185, 129, 0.92);
      color: #ffffff;
      font-family: 'Inter', system-ui, sans-serif;
      font-size: 11px;
      font-weight: 700;
      line-height: 1;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.15s ease;
    }
    body.edit-mode [data-edit-img]:hover::after {
      opacity: 1;
    }

    /* Image remplacée à l'intérieur d'un conteneur */
    .edited-media-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      border-radius: inherit;
    }
    .hero-visual-frame > .edited-media-img,
    .media-frame > .edited-media-img,
    .card-thumb > .edited-media-img {
      aspect-ratio: 16 / 10;
      border-radius: calc(var(--radius, 8px) * 0.65);
    }
    .img-carousel-slide > .edited-media-img {
      aspect-ratio: 960 / 440;
    }
    .gallery-item > .edited-media-img {
      aspect-ratio: 480 / 320;
    }

    /* Popover d'édition flottant (Bouton / Image / Fond) */
    #edit-popover {
      position: fixed;
      top: 0;
      left: 0;
      z-index: 1450;
      width: min(320px, 92vw);
      background: #111318;
      color: #f3f4f6;
      border: 1px solid #2b3140;
      border-radius: 12px;
      box-shadow: 0 20px 50px rgba(0, 0, 0, 0.48);
      padding: 14px;
      display: none;
      flex-direction: column;
      gap: 10px;
      font-size: 12.5px;
    }
    #edit-popover.is-open {
      display: flex;
    }
    .edit-pop-head {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding-bottom: 8px;
      border-bottom: 1px solid #272c38;
    }
    .edit-pop-title {
      font-weight: 700;
      font-size: 12.5px;
      color: #ffffff;
    }
    .edit-pop-close {
      width: 24px;
      height: 24px;
      border-radius: 6px;
      border: 1px solid #272c38;
      background: #181c25;
      color: #d1d5db;
      cursor: pointer;
      display: grid;
      place-items: center;
      padding: 0;
      font-size: 12px;
    }
    .edit-pop-close:hover { background: #272d3d; color: #fff; }
    .edit-pop-field {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }
    .edit-pop-field label {
      font-size: 11px;
      font-weight: 600;
      color: #9ca3af;
      display: flex;
      justify-content: space-between;
    }
    .edit-pop-input {
      width: 100%;
      padding: 7px 9px;
      border-radius: 7px;
      border: 1px solid #2b3140;
      background: #181c25;
      color: #f3f4f6;
      font-family: inherit;
      font-size: 12px;
      outline: none;
    }
    .edit-pop-input:focus {
      border-color: #6366f1;
    }
    .edit-pop-file-label {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      padding: 7px 10px;
      border-radius: 7px;
      border: 1px dashed #3f475c;
      background: #181c25;
      color: #c7d2fe;
      font-size: 11.5px;
      font-weight: 600;
      cursor: pointer;
      transition: border-color 0.15s ease, background-color 0.15s ease;
    }
    .edit-pop-file-label:hover {
      border-color: #6366f1;
      background: rgba(99, 102, 241, 0.12);
    }
    .edit-pop-file-label input {
      display: none;
    }
    .edit-pop-check {
      display: flex;
      align-items: center;
      gap: 7px;
      font-size: 12px;
      color: #d1d5db;
      cursor: pointer;
    }
    .edit-pop-check input {
      accent-color: #6366f1;
    }
    .edit-pop-actions {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      padding-top: 4px;
    }
