:root {
    --mg-green: #43a047;
    --mg-green-dark: #2e7d32;
    --mg-orange: #f57c00;
    --mg-orange-dark: #e06f00;
    --mg-brown: #4e342e;
    --mg-cream: #f6f4ee;
    --mg-text: #263322;
    /* lanceur : buste + pouce d'Albert, 400x400, buste clippé dans un cercle r=185 centré en (215,220) ; la casquette dépasse */
    --mg-albert-hey: url('../img/albert-hey.webp');
    /* avatars : tête seule, 300x300, visage clippé dans un cercle r=112,5 centré en (150,170) ; la casquette dépasse */
    --mg-albert-head: url('../img/albert-head.webp');

    /* --- variables du widget @n8n/chat 1.27 (attention : double tiret sur primary/secondary) --- */
    --chat--color--primary: #2e7d32;
    --chat--color--primary-shade-50: #2a722e;
    --chat--color--primary--shade-100: #256628;
    --chat--color--secondary: #43a047;
    --chat--color-secondary-shade-50: #3d9141;
    --chat--color-white: #ffffff;
    --chat--color-light: #f6f4ee;
    --chat--color-light-shade-50: #ede9df;
    --chat--color-light-shade-100: #ddd7c8;
    --chat--color-medium: #a8a29a;
    --chat--color-dark: #263322;
    --chat--color-disabled: #b9bdb6;
    --chat--color-typing: #43a047;

    --chat--font-family: inherit;
    --chat--spacing: 1rem;
    --chat--border-radius: 18px;
    --chat--transition-duration: 0.2s;

    --chat--window--width: 400px;
    --chat--window--height: min(660px, calc(100vh - 120px));
    --chat--window--bottom: 20px;
    --chat--window--right: 26px;
    --chat--window--border: none;
    --chat--window--border-radius: 24px;
    --chat--window--margin-bottom: 14px;
    --chat--window--z-index: 2147483647;

    --chat--header-height: auto;
    --chat--header--padding: 18px 108px 14px 20px;
    --chat--header--background: linear-gradient(135deg, #4caf50 0%, #2e6b32 100%);
    --chat--header--color: #ffffff;
    --chat--heading--font-size: 1.15rem;
    --chat--subtitle--font-size: 0.8rem;
    --chat--subtitle--line-height: 1.3;

    --chat--body--background: #f6f4ee;
    --chat--messages-list--padding: 18px 14px 10px;

    --chat--message--font-size: 0.94rem;
    --chat--message--padding: 11px 14px;
    --chat--message--border-radius: 18px;
    --chat--message-line-height: 1.5;
    --chat--message--margin-bottom: 10px;
    --chat--message--bot--background: #ffffff;
    --chat--message--bot--color: #263322;
    --chat--message--bot--border: none;
    --chat--message--user--background: #2e7d32;
    --chat--message--user--color: #ffffff;
    --chat--message--user--border: none;

    --chat--footer--border-top: none;
    --chat--footer--background: #ffffff;
    --chat--footer--padding: 10px 12px 0;

    --chat--input--container--background: #f6f4ee;
    --chat--input--container--border: 1.5px solid #e4dfd2;
    --chat--input--container--border-radius: 26px;
    --chat--input--container--padding: 2px 4px 2px 12px;
    --chat--input--background: transparent;
    --chat--input--font-size: 0.95rem;
    --chat--input--padding: 0.7rem 0.3rem;
    --chat--input--text-color: #263322;
    --chat--textarea--height: 46px;
    --chat--textarea--max-height: 160px;
    --chat--input--send--button--background: #f57c00;
    --chat--input--send--button--background-hover: #e06f00;
    --chat--input--send--button--color: #ffffff;
    --chat--input--send--button--color-hover: #ffffff;
    --chat--input--button--border-radius: 50%;

    --chat--toggle--size: 66px;
    --chat--toggle--background: #ffffff;
    --chat--toggle--hover--background: #ffffff;
    --chat--toggle--active--background: #ffffff;
    --chat--toggle--color: #ffffff;
  }

  #n8n-chat { position: relative; z-index: 2147483647; }
  #n8n-chat .chat-window-wrapper { z-index: 2147483647 !important; }
  /* Le widget est un <main> : les règles du thème sur « main » (marges, largeur max) ne doivent pas l'atteindre. */
  #n8n-chat main.chat-layout { padding: 0 !important; margin: 0 !important; max-width: none !important; }
  /* Modale Bootstrap ouverte (ajout au panier…) : le chat passe sous le voile le temps de la modale. */
  body.modal-open #n8n-chat,
  body.modal-open #n8n-chat .chat-window-wrapper { z-index: 1039 !important; }

  /* ---------- Lanceur : Albert en médaillon ---------- */
  #n8n-chat .chat-window-toggle {
    position: relative;
    overflow: visible;
    border: 3px solid var(--mg-green);
    box-shadow: 0 10px 28px rgba(46, 125, 50, 0.32), 0 2px 6px rgba(38, 51, 34, 0.12);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.4), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, translate 0.35s ease;
  }
  /* Buste d'Albert : le cercle de l'image remplit exactement le disque intérieur du bouton
     (bouton moins 2 x 3px de bordure) ; la casquette dépasse en haut. */
  #n8n-chat .chat-window-toggle::before {
    content: "";
    position: absolute;
    --mg-d: calc(var(--chat--toggle--size) - 6px);
    width: calc(var(--mg-d) * 400 / 370);
    height: calc(var(--mg-d) * 400 / 370);
    left: calc(var(--mg-d) / 2 - var(--mg-d) * 215 / 370);
    top: calc(var(--mg-d) / 2 - var(--mg-d) * 220 / 370);
    background: var(--mg-albert-hey) no-repeat center / 100% 100%;
    transform-origin: 50% 80%;
    pointer-events: none;
  }
  /* pastille « en ligne » */
  #n8n-chat .chat-window-toggle::after {
    content: "";
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3fbf5f;
    border: 2.5px solid #ffffff;
    animation: mgPulse 2.2s ease-out infinite;
  }
  #n8n-chat .chat-window-toggle svg { opacity: 0; transition: opacity 0.2s ease; }
  #n8n-chat .chat-window-toggle:hover,
  #n8n-chat .chat-window-toggle:focus {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 16px 36px rgba(46, 125, 50, 0.40), 0 3px 8px rgba(38, 51, 34, 0.14);
  }
  #n8n-chat .chat-window-toggle:hover::before { animation: mgNod 0.7s ease-in-out 1; }

  /* ---------- Masquer Albert : petit bouton sur le médaillon, qui le replie contre le bord droit
     (une languette dépasse) ; un clic sur la languette le ressort. Choix mémorisé pour la visite. ---------- */
  .mg-hide {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(38, 51, 34, 0.1);
    background: #ffffff;
    color: var(--mg-green-dark);
    font-size: 18px;
    line-height: 22px;
    text-align: center;
    padding: 0;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(38, 51, 34, 0.18);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
  }
  #n8n-chat .chat-window-toggle:hover .mg-hide,
  #n8n-chat .chat-window-toggle:focus-within .mg-hide { opacity: 1; }
  .mg-hide:hover { background: var(--mg-green); color: #ffffff; }
  #n8n-chat.mg-open .mg-hide,
  #n8n-chat:not(.mg-ready) .mg-hide { display: none; }
  @media (hover: none) { .mg-hide { opacity: 1; } }
  /* État replié : le médaillon glisse en grande partie hors de l'écran, seule une languette reste visible. */
  #n8n-chat.mg-collapsed .chat-window-toggle {
    translate: calc(var(--chat--window--right) + var(--chat--toggle--size) * 0.62) 0;
    opacity: 0.92;
  }
  #n8n-chat.mg-collapsed .chat-window-toggle::after,
  #n8n-chat.mg-collapsed .mg-albert-hey,
  #n8n-chat.mg-collapsed .mg-hide { display: none !important; }
  #n8n-chat.mg-collapsed .chat-window-toggle:hover { transform: none; translate: calc(var(--chat--window--right) + var(--chat--toggle--size) * 0.5) 0; }

  /* fenêtre ouverte : le lanceur devient un bouton « replier » vert */
  #n8n-chat.mg-open .chat-window-toggle {
    background: var(--mg-green-dark);
    border-color: var(--mg-green-dark);
    box-shadow: 0 8px 22px rgba(38, 51, 34, 0.28);
  }
  #n8n-chat.mg-open .chat-window-toggle::before,
  #n8n-chat.mg-open .chat-window-toggle::after { display: none; }
  #n8n-chat.mg-open .chat-window-toggle svg { opacity: 1; }

  /* ---------- Entrée en scène (1re page de la visite) ---------- */
  #n8n-chat:not(.mg-ready) .chat-window-toggle { opacity: 0; transform: translateX(160px); pointer-events: none; }
  #n8n-chat.mg-ready:not(.mg-no-anim) .chat-window-toggle { animation: mgAlbertIn 0.95s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
  #n8n-chat.mg-ready:not(.mg-no-anim) .chat-window-toggle::before { animation: mgNod 0.75s ease-in-out 1.05s 2; }

  /* bulle d'invitation « Une question ? » */
  .mg-albert-hey {
    position: absolute;
    right: calc(100% + 14px);
    bottom: 10px;
    display: none;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 12px;
    background: #ffffff;
    color: var(--mg-text);
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 10px 30px rgba(38, 51, 34, 0.18);
    white-space: nowrap;
    cursor: pointer;
    font-size: 0.86rem;
    line-height: 1.25;
    text-align: left;
    transform-origin: 100% 100%;
  }
  .mg-albert-hey::after {
    content: "";
    position: absolute;
    right: -7px;
    bottom: 12px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    transform: rotate(45deg);
    border-radius: 2px;
  }
  .mg-albert-hey .mg-hand {
    font-size: 1.5rem;
    line-height: 1;
    display: inline-block;
    transform-origin: 70% 70%;
    animation: mgHand 1.6s ease-in-out infinite;
  }
  .mg-albert-hey strong { display: block; font-size: 1rem; font-weight: 700; color: var(--mg-green-dark); }
  .mg-albert-hey .mg-hey-close {
    margin-left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: #f0ede3;
    color: #6b7268;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    padding: 0;
    cursor: pointer;
  }
  .mg-albert-hey .mg-hey-close:hover { background: #e2ddd0; color: var(--mg-text); }
  #n8n-chat.mg-hey .mg-albert-hey { display: flex; animation: mgHeyPop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both; }
  #n8n-chat.mg-hey-out .mg-albert-hey { display: flex; animation: mgHeyOut 0.3s ease-in both; }
  #n8n-chat.mg-open .mg-albert-hey { display: none !important; }

  /* ---------- Fenêtre : ouverture en fondu + léger rebond depuis le lanceur ---------- */
  #n8n-chat .chat-window {
    box-shadow: 0 28px 70px rgba(38, 51, 34, 0.30), 0 4px 14px rgba(38, 51, 34, 0.10);
    background: var(--mg-cream);
  }
  #n8n-chat.mg-open .chat-window { animation: mgWindowIn 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }

  /* en-tête : avatar + titre + état */
  #n8n-chat .chat-header {
    position: relative;
    display: grid !important;
    grid-template-columns: 46px 1fr;
    grid-template-rows: auto auto auto;
    column-gap: 18px;
    row-gap: 1px !important;
    align-items: center;
    min-height: 0;
  }
  /* Avatar de l'en-tête : disque blanc de 42px, tête d'Albert en pop-out (la casquette dépasse).
     Disque intérieur d = 38px → image d*300/225, cercle de l'image calé sur le disque. */
  #n8n-chat .chat-header .mg-chat-avatar {
    grid-row: 1 / 3;
    align-self: end;
    position: relative;
    width: 42px;
    height: 42px;
    margin-bottom: -33px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  }
  #n8n-chat .chat-header .mg-chat-avatar::before {
    content: "";
    position: absolute;
    --d: 38px;
    width: calc(var(--d) * 300 / 225);
    height: calc(var(--d) * 300 / 225);
    left: calc(var(--d) / 2 - var(--d) * 150 / 225);
    top: calc(var(--d) / 2 - var(--d) * 170 / 225);
    background: var(--mg-albert-head) no-repeat center / 100% 100%;
    pointer-events: none;
  }
  #n8n-chat .chat-header .chat-heading,
  #n8n-chat .chat-header h1,
  #n8n-chat .chat-header p { margin: 0 !important; padding: 0 !important; }
  #n8n-chat .chat-header .chat-heading { grid-column: 2; grid-row: 1; }
  #n8n-chat .chat-header p { grid-column: 2; grid-row: 2; }
  #n8n-chat .chat-header .mg-beta {
    grid-column: 2;
    grid-row: 3;
    margin: 5px 0 0 !important;
    padding: 0 !important;
    font-size: 0.68rem;
    line-height: 1.3;
    font-style: italic;
    color: var(--chat--header--color);
    opacity: 0.8;
  }
  /* Le thème peut styliser les titres : on réaffirme celui du chat, quelle que soit la page. */
  #n8n-chat .chat-header h1,
  #n8n-chat .chat-header .chat-heading > div {
    font-family: inherit;
    font-size: var(--chat--heading--font-size);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--chat--header--color);
    text-transform: none;
    text-align: left;
    margin: 0 !important;
    padding: 0 !important;
    background: none;
    border: 0;
  }
  #n8n-chat .chat-header h1::before,
  #n8n-chat .chat-header h1::after { content: none; display: none; }
  #n8n-chat .chat-header p {
    font-family: inherit;
    color: var(--chat--header--color);
    text-transform: none;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.94;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  #n8n-chat .chat-header p::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9cf0a8;
    box-shadow: 0 0 0 3px rgba(156, 240, 168, 0.25);
    flex: none;
  }

  /* boutons d'en-tête : ↺ nouvelle conversation, ✕ fermer */
  .moonera-reset,
  .moonera-close {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #ffffff;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
  }
  .moonera-reset { right: 56px; font-size: 18px; }
  .moonera-close { right: 14px; font-size: 17px; }
  .moonera-reset:hover,
  .moonera-close:hover { background: rgba(255, 255, 255, 0.32); }
  .moonera-reset:hover { transform: translateY(-50%) rotate(-40deg); }

  /* corps : bulles */
  #n8n-chat .chat-body { scrollbar-width: thin; scrollbar-color: #cfd8cc transparent; }
  #n8n-chat .chat-body::-webkit-scrollbar { width: 6px; }
  #n8n-chat .chat-body::-webkit-scrollbar-thumb { background: #cfd8cc; border-radius: 3px; }

  #n8n-chat .chat-message {
    animation: mgMsgIn 0.28s ease both;
    box-shadow: 0 2px 8px rgba(38, 51, 34, 0.06);
  }
  #n8n-chat .chat-message.chat-message-from-bot {
    overflow: visible;
    margin-left: 36px;
    border-bottom-left-radius: 6px !important;
  }
  #n8n-chat .chat-message.chat-message-from-bot::before {
    content: "";
    position: absolute;
    left: -36px;
    bottom: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #ffffff;
    box-shadow: 0 2px 6px rgba(38, 51, 34, 0.18);
  }
  /* tête d'Albert en pop-out sur le disque (intérieur 25px → image 33,4px, cercle calé sur le disque) */
  #n8n-chat .chat-message.chat-message-from-bot::after {
    content: "";
    position: absolute;
    left: -38.7px;
    bottom: -0.4px;
    width: 33.4px;
    height: 33.4px;
    background: var(--mg-albert-head) no-repeat center / 100% 100%;
    pointer-events: none;
  }
  #n8n-chat .chat-message.chat-message-from-user {
    border-bottom-right-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.26);
  }
  #n8n-chat .chat-message img { max-width: 100%; height: auto; border-radius: 10px; }
  #n8n-chat .chat-message-from-bot a { color: var(--mg-green-dark); font-weight: 600; text-decoration: underline; }
  #n8n-chat ul,
  #n8n-chat ol { padding-left: 1.5em !important; margin: 0.4em 0 !important; list-style-position: outside !important; }
  #n8n-chat li { margin: 0.25em 0 !important; }
  #n8n-chat p { margin: 0.4em 0 !important; overflow-wrap: anywhere; }

  /* suggestions de départ */
  .mg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 6px 36px;
    animation: mgMsgIn 0.35s ease 0.15s both;
  }
  .mg-chips button {
    border: 1.5px solid var(--mg-green);
    background: #ffffff;
    color: var(--mg-green-dark);
    border-radius: 999px;
    padding: 6px 11px;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
  }
  .mg-chips button:hover { background: var(--mg-green); color: #ffffff; transform: translateY(-1px); }

  /* composer */
  #n8n-chat .chat-inputs { align-items: center !important; transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease; }
  #n8n-chat .chat-inputs:focus-within {
    border-color: var(--mg-green) !important;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(67, 160, 71, 0.16);
  }
  #n8n-chat .chat-inputs textarea { box-shadow: none !important; }
  #n8n-chat .chat-inputs textarea::placeholder { color: #8e948b; }
  #n8n-chat .chat-input-send-button {
    width: 38px !important;
    height: 38px !important;
    margin: 4px !important;
    font-size: 18px !important;
    box-shadow: 0 4px 12px rgba(245, 124, 0, 0.35);
    transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.4), background 0.18s ease, box-shadow 0.18s ease !important;
  }
  #n8n-chat .chat-input-send-button:hover:not([disabled]) { transform: scale(1.08); }
  #n8n-chat .chat-input-send-button[disabled] { background: #d9d6cb !important; color: #ffffff !important; box-shadow: none; }
  #n8n-chat .chat-input-file-button { display: none !important; }

  /* crédit Moonera.ai (à conserver) */
  .moonera-powered-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 7px 0 9px;
    text-align: center;
  }
  .moonera-powered-footer a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #8a8f86;
    font-size: 11px;
    line-height: 1.2;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: color 0.2s ease;
  }
  .moonera-powered-footer a::before { content: "✦"; font-size: 9px; color: var(--mg-green); }
  /* Sans session (webhook injoignable, page ouverte hors du site), @n8n/chat affiche son propre
     « Powered by n8n » à la place de la saisie : jamais affiché, le crédit Moonera le remplace. */
  #n8n-chat .chat-powered-by { display: none !important; }
  #n8n-chat .moonera-powered-footer,
  #n8n-chat .moonera-powered-footer a { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; }
  .moonera-powered-footer a strong { font-weight: 800; color: #5f665c; }
  .moonera-powered-footer a:hover,
  .moonera-powered-footer a:hover strong { color: var(--mg-green-dark); text-decoration: none; }

  /* ---------- Animations ---------- */
  @keyframes mgAlbertIn {
    0%   { opacity: 0; transform: translateX(160px) rotate(12deg); }
    55%  { opacity: 1; transform: translateX(-18px) rotate(-4deg); }
    75%  { transform: translateX(8px) rotate(2deg); }
    90%  { transform: translateX(-3px); }
    100% { opacity: 1; transform: translateX(0) rotate(0); }
  }
  @keyframes mgNod {
    0%, 100% { transform: rotate(0) translateY(0); }
    25% { transform: rotate(-6deg) translateY(-2px); }
    50% { transform: rotate(5deg); }
    75% { transform: rotate(-3deg) translateY(-1px); }
  }
  @keyframes mgHand {
    0%, 50%, 100% { transform: rotate(0); }
    10% { transform: rotate(16deg); }
    20% { transform: rotate(-10deg); }
    30% { transform: rotate(16deg); }
    40% { transform: rotate(-6deg); }
  }
  @keyframes mgHeyPop {
    0%   { opacity: 0; transform: scale(0.5) translateX(20px); }
    100% { opacity: 1; transform: scale(1) translateX(0); }
  }
  @keyframes mgHeyOut {
    0%   { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.7) translateX(16px); }
  }
  @keyframes mgWindowIn {
    0%   { opacity: 0; transform: translateY(18px) scale(0.94); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }
  @keyframes mgPulse {
    0%   { box-shadow: 0 0 0 0 rgba(63, 191, 95, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(63, 191, 95, 0); }
    100% { box-shadow: 0 0 0 0 rgba(63, 191, 95, 0); }
  }
  @keyframes mgMsgIn {
    0%   { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
  }
  @media (prefers-reduced-motion: reduce) {
    #n8n-chat *, #n8n-chat *::before, #n8n-chat *::after, .mg-albert-hey, .mg-albert-hey * {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
    }
  }

  /* ---------- Ordinateur : lanceur plus grand, centré en hauteur sur le bord droit ----------
     La fenêtre s'ouvre centrée en hauteur, à gauche du médaillon. Le coin bas-droit reste libre
     pour la bulle Tawk.to, si le client l'affiche. */
  @media (min-width: 769px) {
    :root { --chat--toggle--size: 88px; --chat--window--height: min(660px, calc(100vh - 40px)); }
    #n8n-chat .chat-window-toggle { position: fixed; right: 26px; top: calc(50% - 44px); margin: 0; }
    #n8n-chat .chat-window-toggle::after { width: 16px; height: 16px; right: 3px; bottom: 3px; }
    #n8n-chat.mg-open .chat-window-toggle svg { transform: rotate(-90deg); width: 40px; height: 40px; }
    #n8n-chat .chat-window {
      position: fixed;
      top: 50%;
      right: 130px;
      translate: 0 -50%;
      margin: 0;
      transform-origin: 100% 50%;
    }
    @keyframes mgWindowIn {
      0%   { opacity: 0; transform: translateX(22px) scale(0.94); }
      100% { opacity: 1; transform: translateX(0) scale(1); }
    }
  }

  /* ---------- Mobile : fenêtre plein écran ---------- */
  @media (max-width: 768px) {
    :root { --chat--toggle--size: 60px; --chat--window--bottom: 14px; --chat--window--right: 18px; }
    /* bulle Tawk.to visible (bas-droit) : Albert se place juste au-dessus */
    body.mg-tawk { --chat--window--bottom: 92px; }
    .mg-albert-hey {
      font-size: 0.82rem;
      /* sur mobile la bulle se place AU-DESSUS du médaillon (et non à sa gauche, où la place manque) */
      right: 0;
      bottom: calc(100% + 14px);
      white-space: normal;
      width: max-content;
      max-width: min(290px, calc(100vw - 2 * var(--chat--window--right)));
      transform-origin: 90% 100%;
    }
    .mg-albert-hey::after { right: 22px; bottom: -7px; }
    .mg-hide { top: 10px; left: -14px; }
    #n8n-chat.mg-open .chat-window-wrapper { inset: 0 !important; max-width: 100% !important; max-height: 100% !important; }
    #n8n-chat.mg-open .chat-window {
      width: 100vw !important;
      height: 100vh !important;
      height: 100dvh !important;
      max-height: none !important;
      margin: 0 !important;
      border-radius: 0 !important;
    }
    #n8n-chat.mg-open .chat-window-toggle { display: none !important; }
  }
