:root { --gm2-primary:#006BD6; --gm2-primary-2:#005bb8; --gm2-soft:#eaf5ff; --gm2-line:#dbe7f3; --gm2-text:#102033; --gm2-muted:#6b7a8c; --gm2-bg:#ffffff; }
.gm2-contact-card,.gm2-messages-app,.gm2-messages-login,.gm2-start-modal { font-family: inherit; color: var(--gm2-text); box-sizing: border-box; }
.gm2-contact-card *,.gm2-messages-app *,.gm2-messages-login *,.gm2-start-modal * { box-sizing: border-box; }
.gm2-contact-card { background:#fff; border:1px solid var(--gm2-line); border-radius:18px; padding:20px; box-shadow:0 10px 30px rgba(11,47,87,.08); margin:20px 0; }
.gm2-contact-card__title { font-size:19px; font-weight:800; margin-bottom:8px; color:var(--gm2-primary); }
.gm2-contact-card__text { margin:0 0 12px; color:var(--gm2-muted); line-height:1.45; }
.gm2-contact-card__seller { margin:0 0 14px; color:#31445b; font-size:14px; }
.gm2-contact-card__status { margin-top:10px; }
.gm2-btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; border:0; border-radius:12px; padding:12px 16px; cursor:pointer; text-decoration:none!important; font-weight:800; line-height:1.2; transition:transform .12s ease, opacity .12s ease, box-shadow .12s ease; }
.gm2-btn:hover { opacity:.94; transform:translateY(-1px); }
.gm2-btn:disabled { opacity:.6; cursor:not-allowed; transform:none; }
.gm2-btn--primary { background:var(--gm2-primary); color:#fff!important; box-shadow:0 8px 18px rgba(11,47,87,.2); }
.gm2-btn--light { background:var(--gm2-soft); color:var(--gm2-primary)!important; }
.gm2-btn--full { width:100%; }
.gm2-btn--small { margin-top:10px; padding:9px 12px; font-size:13px; }
.gm2-inline-error { background:#fff1f2; color:#be123c; border:1px solid #fecdd3; padding:10px 12px; border-radius:12px; font-size:14px; }
body.gm2-modal-open { overflow:hidden; }
.gm2-start-modal { position:fixed; inset:0; z-index:999999; display:none; }
.gm2-start-modal--open { display:block; }
.gm2-start-modal__backdrop { position:absolute; inset:0; background:rgba(7,24,44,.68); backdrop-filter: blur(2px); }
.gm2-start-modal__dialog { position:relative; width:min(560px, calc(100% - 28px)); margin:7vh auto; background:#fff; border-radius:22px; box-shadow:0 30px 90px rgba(0,0,0,.28); overflow:hidden; }
.gm2-start-modal__body { padding:24px; }
.gm2-start-modal h3 { margin:0 42px 18px 0; font-size:22px; line-height:1.2; color:var(--gm2-primary); }
.gm2-start-modal__close { position:absolute; top:14px; right:14px; width:38px; height:38px; border:0; border-radius:50%; background:#f1f6fb; color:var(--gm2-primary); font-size:26px; cursor:pointer; }
.gm2-start-modal__vehicle { display:flex; gap:12px; align-items:center; padding:12px; border:1px solid var(--gm2-line); background:#f8fbff; border-radius:16px; margin-bottom:14px; }
.gm2-start-modal__thumb { width:64px; height:64px; object-fit:cover; border-radius:12px; flex:0 0 auto; }
.gm2-start-modal__car { font-weight:800; color:#1b2d43; }
.gm2-start-modal__seller { color:var(--gm2-muted); font-size:14px; margin-top:3px; }
.gm2-start-modal__message { width:100%; min-height:130px; border:1px solid var(--gm2-line); border-radius:16px; padding:14px; resize:vertical; font:inherit; color:var(--gm2-text); outline:none; }
.gm2-start-modal__message:focus,.gm2-conversation-search:focus,.gm2-reply-input:focus { border-color:#89bde8; box-shadow:0 0 0 4px rgba(137,189,232,.25); }
.gm2-start-modal__actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.gm2-start-modal__notice { margin-top:12px; min-height:1px; }
.gm2-notice--ok,.gm2-notice--error { border-radius:14px; padding:12px 14px; font-size:14px; }
.gm2-notice--ok { background:#ecfdf5; border:1px solid #bbf7d0; color:#166534; }
.gm2-notice--error { background:#fff1f2; border:1px solid #fecdd3; color:#be123c; }
.gm2-messages-login { background:#fff; border:1px solid var(--gm2-line); border-radius:20px; padding:28px; box-shadow:0 10px 30px rgba(11,47,87,.08); }
.gm2-messages-login h2 { margin:0 0 8px; color:var(--gm2-primary); }
.gm2-messages-app { display:grid; grid-template-columns:350px minmax(0,1fr); min-height:640px; background:#fff; border:1px solid var(--gm2-line); border-radius:22px; overflow:hidden; box-shadow:0 12px 34px rgba(11,47,87,.08); }
.gm2-messages-app__sidebar { background:#f8fbff; border-right:1px solid var(--gm2-line); padding:18px; min-width:0; }
.gm2-messages-app__head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.gm2-messages-app__head h2 { margin:0; font-size:24px; color:var(--gm2-primary); }
.gm2-badge { background:var(--gm2-soft); color:var(--gm2-primary-2); border:1px solid #c7e5ff; border-radius:999px; padding:5px 9px; font-size:11px; font-weight:900; white-space:nowrap; }
.gm2-conversation-search { width:100%; border:1px solid var(--gm2-line); border-radius:14px; padding:12px 13px; font:inherit; outline:none; background:#fff; margin-bottom:14px; }
.gm2-conversation-list { display:grid; gap:10px; max-height:560px; overflow:auto; padding-right:2px; }
.gm2-conv-row { width:100%; display:grid; grid-template-columns:52px minmax(0,1fr); gap:10px; align-items:center; border:1px solid var(--gm2-line); border-radius:16px; padding:10px; text-align:left; background:#fff; cursor:pointer; color:var(--gm2-text); }
.gm2-conv-row:hover,.gm2-conv-row.is-active { border-color:#9ed0fb; background:#eef8ff; }
.gm2-conv-thumb { width:52px; height:52px; border-radius:13px; object-fit:cover; background:#dceeff; }
.gm2-conv-thumb--empty:before { content:'🚗'; display:flex; align-items:center; justify-content:center; height:100%; font-size:23px; }
.gm2-conv-row__body { min-width:0; display:block; }
.gm2-conv-row__top { display:flex; justify-content:space-between; gap:8px; align-items:center; }
.gm2-conv-row__top strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; display:block; }
.gm2-unread { min-width:21px; height:21px; border-radius:999px; background:#1d9bf0; color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:900; }
.gm2-conv-row__vehicle,.gm2-conv-row__last,.gm2-conv-row__date { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gm2-conv-row__vehicle { color:var(--gm2-primary-2); font-size:13px; font-weight:700; margin-top:2px; }
.gm2-conv-row__last { color:#40566f; font-size:13px; margin-top:3px; }
.gm2-conv-row__date { color:var(--gm2-muted); font-size:12px; margin-top:3px; }
.gm2-thread-panel { display:grid; grid-template-rows:auto minmax(0,1fr) auto; min-width:0; background:#fff; }
.gm2-thread-panel__top { min-height:76px; display:flex; align-items:center; justify-content:space-between; gap:14px; padding:18px 20px; border-bottom:1px solid var(--gm2-line); }
.gm2-thread-title { margin:0; color:var(--gm2-primary); font-size:20px; }
.gm2-thread-subtitle { color:var(--gm2-muted); font-size:14px; margin-top:3px; }
.gm2-thread-listing { color:var(--gm2-primary-2); font-weight:800; text-decoration:none; white-space:nowrap; }
.gm2-thread-messages { background:linear-gradient(180deg,#fbfdff,#f2f8ff); padding:18px; overflow:auto; }
.gm2-message { display:flex; margin:10px 0; }
.gm2-message--mine { justify-content:flex-end; }
.gm2-message__bubble { max-width:min(72%, 620px); padding:12px 14px; border-radius:18px; border:1px solid var(--gm2-line); background:#fff; box-shadow:0 4px 16px rgba(11,47,87,.06); line-height:1.45; white-space:pre-wrap; }
.gm2-message--mine .gm2-message__bubble { background:var(--gm2-primary); color:#fff; border-color:var(--gm2-primary); border-bottom-right-radius:6px; }
.gm2-message--other .gm2-message__bubble { border-bottom-left-radius:6px; }
.gm2-message__bubble time { display:block; margin-top:6px; font-size:11px; opacity:.72; }
.gm2-thread-composer { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; align-items:end; padding:16px; border-top:1px solid var(--gm2-line); background:#fff; }
.gm2-reply-input { width:100%; border:1px solid var(--gm2-line); border-radius:16px; padding:13px; resize:vertical; min-height:58px; max-height:160px; font:inherit; outline:none; }
.gm2-empty-state { color:var(--gm2-muted); text-align:center; padding:28px 12px; }
.gm2-empty-state--small { padding:18px 10px; background:#fff; border:1px dashed var(--gm2-line); border-radius:16px; }
@media (max-width: 900px){
  .gm2-messages-app { grid-template-columns:1fr; min-height:unset; }
  .gm2-messages-app__sidebar { border-right:0; border-bottom:1px solid var(--gm2-line); }
  .gm2-conversation-list { max-height:310px; }
  .gm2-thread-panel { min-height:560px; }
}
@media (max-width: 640px){
  .gm2-contact-card { padding:16px; border-radius:16px; }
  .gm2-start-modal__dialog { width:100%; min-height:100vh; margin:0; border-radius:0; display:flex; align-items:center; }
  .gm2-start-modal__body { width:100%; padding:20px; }
  .gm2-start-modal__actions { display:grid; }
  .gm2-messages-app { border-radius:0; border-left:0; border-right:0; }
  .gm2-thread-panel__top { align-items:flex-start; flex-direction:column; }
  .gm2-thread-composer { grid-template-columns:1fr; }
  .gm2-message__bubble { max-width:88%; }
}

/* Corrección 1.1.0: modal obligatorio de primer mensaje, sin redirección directa a mensajes. */
.gm2-message-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.gm2-message-modal.is-open,
.gm2-start-modal.gm2-start-modal--open {
  display: flex;
}
.gm2-message-modal__overlay,
.gm2-start-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7,24,44,.72);
  backdrop-filter: blur(2px);
}
.gm2-message-modal__box,
.gm2-start-modal__dialog {
  position: relative;
  width: min(560px, 100%);
  margin: 0;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(0,0,0,.30);
  overflow: hidden;
}
.gm2-message-modal__body { padding: 24px; }
.gm2-message-modal__subtitle { margin: -8px 42px 16px 0; color: var(--gm2-muted); line-height: 1.45; }
.gm2-message-modal__vehicle { display:flex; gap:12px; align-items:center; padding:12px; border:1px solid var(--gm2-line); background:#f8fbff; border-radius:16px; margin-bottom:14px; }
.gm2-message-modal__thumb { width:64px; height:64px; object-fit:cover; border-radius:12px; flex:0 0 auto; }
.gm2-message-modal__car { font-weight:800; color:#1b2d43; }
.gm2-message-modal__seller { color:var(--gm2-muted); font-size:14px; margin-top:3px; }
.gm2-message-modal__textarea { width:100%; min-height:130px; border:1px solid var(--gm2-line); border-radius:16px; padding:14px; resize:vertical; font:inherit; color:var(--gm2-text); outline:none; }
.gm2-message-modal__textarea:focus { border-color:#89bde8; box-shadow:0 0 0 4px rgba(137,189,232,.25); }
.gm2-message-modal__actions { display:flex; gap:10px; flex-wrap:wrap; margin-top:14px; }
.gm2-message-modal__notice { margin-top:12px; min-height:1px; }
.gm2-notice--ok { background:#eaf5ff; border:1px solid #c7e5ff; color:var(--gm2-primary); }
@media (max-width: 640px){
  .gm2-message-modal { align-items: stretch; padding: 0; }
  .gm2-message-modal__box { width:100%; min-height:100vh; border-radius:0; display:flex; align-items:center; }
  .gm2-message-modal__body { width:100%; padding:20px; }
  .gm2-message-modal__actions { display:grid; }
}

/* GM2 1.1.6 - Mejora visual profesional de la página de mensajes y badge de menú */
.gm2-messages-shell {
  width: min(1280px, calc(100vw - 36px));
  max-width: 1280px;
  min-height: 720px;
  margin: 50px auto;
}

.gm2-messages-shell .gm2-messages-app {
  width: 100%;
  min-height: 720px;
  grid-template-columns: 390px minmax(0, 1fr);
  border-radius: 28px;
  border: 1px solid rgba(148, 183, 218, .45);
  box-shadow: 0 24px 70px rgba(11,47,87,.14);
  background: #fff;
}

.gm2-messages-shell .gm2-messages-app__sidebar {
  padding: 24px;
  background: linear-gradient(180deg, #f4faff 0%, #ffffff 100%);
}

.gm2-messages-shell .gm2-messages-app__head {
  margin-bottom: 18px;
}

.gm2-messages-shell .gm2-messages-app__head h2 {
  font-size: 30px;
  letter-spacing: -0.03em;
}

.gm2-messages-shell .gm2-conversation-search {
  height: 48px;
  border-radius: 999px;
  padding: 0 17px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(11,47,87,.05);
}

.gm2-messages-shell .gm2-conversation-list {
  gap: 12px;
  max-height: 600px;
  padding: 2px 4px 4px 0;
}

.gm2-messages-shell .gm2-conv-row {
  grid-template-columns: 62px minmax(0,1fr);
  gap: 13px;
  padding: 13px;
  border-radius: 20px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 8px 22px rgba(11,47,87,.055);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}

.gm2-messages-shell .gm2-conv-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(11,47,87,.10);
}

.gm2-messages-shell .gm2-conv-row.is-active {
  border-color: #8fcaf8;
  background: #eef8ff;
  box-shadow: 0 14px 34px rgba(29,155,240,.13);
}

.gm2-messages-shell .gm2-conv-thumb {
  width: 62px;
  height: 62px;
  border-radius: 18px;
}

.gm2-messages-shell .gm2-conv-row__top strong {
  font-size: 15px;
  color: #0b2f57;
}

.gm2-messages-shell .gm2-conv-row__vehicle {
  margin-top: 4px;
  font-size: 13px;
}

.gm2-messages-shell .gm2-conv-row__last {
  margin-top: 5px;
  color: #536981;
}

.gm2-messages-shell .gm2-conv-row__date {
  margin-top: 5px;
}

.gm2-messages-shell .gm2-thread-panel {
  min-height: 720px;
  background: #fff;
}

.gm2-messages-shell .gm2-thread-panel__top {
  min-height: 92px;
  padding: 24px 28px;
  background: #fff;
}

.gm2-messages-shell .gm2-thread-title {
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.gm2-messages-shell .gm2-thread-subtitle {
  font-size: 14px;
  margin-top: 6px;
  color: #60758c;
}

.gm2-messages-shell .gm2-thread-listing {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 14px;
  border-radius: 999px;
  background: #eaf5ff;
  border: 1px solid #c8e5ff;
  color: #0b2f57;
  font-size: 13px;
  font-weight: 900;
}

.gm2-messages-shell .gm2-thread-messages {
  padding: 28px;
  background: radial-gradient(circle at top left, rgba(234,245,255,.9), transparent 360px), linear-gradient(180deg,#fbfdff,#f2f8ff);
}

.gm2-messages-shell .gm2-message {
  margin: 14px 0;
}

.gm2-messages-shell .gm2-message__bubble {
  max-width: 65%;
  padding: 14px 16px;
  border-radius: 20px;
  font-size: 15px;
  line-height: 1.5;
  box-shadow: 0 7px 22px rgba(11,47,87,.07);
}

.gm2-messages-shell .gm2-message--mine .gm2-message__bubble {
  background: #0b2f57;
  color: #fff;
  border-color: #0b2f57;
  border-bottom-right-radius: 7px;
}

.gm2-messages-shell .gm2-message--other .gm2-message__bubble {
  background: #fff;
  color: #0b2f57;
  border: 1px solid #d5eafe;
  border-bottom-left-radius: 7px;
}

.gm2-messages-shell .gm2-message__bubble time {
  margin-top: 8px;
  font-size: 11px;
}

.gm2-messages-shell .gm2-thread-composer {
  padding: 20px 24px;
  gap: 14px;
  background: #fff;
}

.gm2-messages-shell .gm2-reply-input {
  min-height: 64px;
  border-radius: 18px;
  padding: 15px 16px;
  background: #fbfdff;
}

.gm2-messages-shell .gm2-send-reply {
  min-height: 48px;
  padding-left: 22px;
  padding-right: 22px;
  border-radius: 16px;
}

.gm2-menu-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #0b5ed7;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
}

@media (max-width: 1100px){
  .gm2-messages-shell {
    width: min(100%, calc(100vw - 24px));
    margin: 28px auto;
  }
  .gm2-messages-shell .gm2-messages-app {
    grid-template-columns: 340px minmax(0,1fr);
  }
}

@media (max-width: 900px){
  .gm2-messages-shell {
    width: min(100%, calc(100vw - 18px));
    min-height: 0;
    margin: 18px auto;
  }
  .gm2-messages-shell .gm2-messages-app {
    grid-template-columns: 1fr;
    min-height: 0;
    border-radius: 22px;
  }
  .gm2-messages-shell .gm2-messages-app__sidebar {
    padding: 18px;
  }
  .gm2-messages-shell .gm2-conversation-list {
    max-height: 330px;
  }
  .gm2-messages-shell .gm2-thread-panel {
    min-height: 560px;
  }
  .gm2-messages-shell .gm2-thread-messages {
    min-height: 350px;
  }
}

@media (max-width: 640px){
  .gm2-messages-shell {
    width: 100%;
    margin: 0;
  }
  .gm2-messages-shell .gm2-messages-app {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .gm2-messages-shell .gm2-messages-app__head h2 {
    font-size: 24px;
  }
  .gm2-messages-shell .gm2-conv-row {
    grid-template-columns: 54px minmax(0,1fr);
    padding: 11px;
  }
  .gm2-messages-shell .gm2-conv-thumb {
    width: 54px;
    height: 54px;
  }
  .gm2-messages-shell .gm2-thread-panel__top {
    padding: 18px;
  }
  .gm2-messages-shell .gm2-thread-messages {
    padding: 18px;
  }
  .gm2-messages-shell .gm2-message__bubble {
    max-width: 88%;
  }
  .gm2-messages-shell .gm2-thread-composer {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .gm2-messages-shell .gm2-send-reply {
    width: 100%;
  }
}

/* GM2 1.1.7 - Cabecera azul Genda Motor, composer degradado y enlace dinámico del vehículo */
.gm2-messages-shell .gm2-thread-panel {
  overflow: hidden;
}

.gm2-messages-shell .gm2-thread-panel__top,
.gm2-chat-header,
.gm2-conversation-header,
.gm2-thread-header {
  background: linear-gradient(135deg, #003b73 0%, #006edc 100%) !important;
  color: #ffffff !important;
  border-bottom: 0 !important;
}

.gm2-messages-shell .gm2-thread-panel__top {
  border-top-right-radius: 28px;
  box-shadow: 0 12px 26px rgba(0, 62, 125, .18);
}

.gm2-messages-shell .gm2-thread-title,
.gm2-chat-header h2,
.gm2-conversation-header h2,
.gm2-thread-header h2 {
  color: #ffffff !important;
}

.gm2-messages-shell .gm2-thread-subtitle,
.gm2-chat-header small,
.gm2-conversation-header small,
.gm2-thread-header small {
  color: rgba(255,255,255,.88) !important;
}

.gm2-messages-shell .gm2-thread-listing,
.gm2-view-vehicle,
.gm2-view-car,
.gm2-chat-header a,
.gm2-conversation-header a,
.gm2-thread-header a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  background: #ffffff !important;
  color: #006edc !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  border-radius: 999px !important;
  font-weight: 900;
  text-decoration: none !important;
  box-shadow: 0 10px 22px rgba(0,40,90,.16);
  white-space: nowrap;
}

.gm2-messages-shell .gm2-thread-listing:hover,
.gm2-view-vehicle:hover,
.gm2-view-car:hover {
  transform: translateY(-1px);
  box-shadow: 0 13px 26px rgba(0,40,90,.22);
}

.gm2-messages-shell .gm2-thread-composer,
.gm2-message-form,
.gm2-reply-form,
.gm2-chat-input-area {
  background: linear-gradient(135deg, #eaf6ff 0%, #d8ecff 45%, #b9dcff 100%) !important;
  border-top: 1px solid rgba(0,110,220,.18) !important;
  padding: 18px 20px;
}

.gm2-messages-shell .gm2-reply-input,
.gm2-message-form textarea,
.gm2-reply-form textarea,
.gm2-chat-input-area textarea,
.gm2-search-input,
.gm2-inbox-search,
.gm2-conversation-search {
  background: #ffffff !important;
  border: 1px solid rgba(0,110,220,.30) !important;
  color: #0b2545 !important;
  box-shadow: 0 8px 22px rgba(0,80,160,.08) !important;
}

.gm2-messages-shell .gm2-reply-input:focus,
.gm2-message-form textarea:focus,
.gm2-reply-form textarea:focus,
.gm2-chat-input-area textarea:focus,
.gm2-search-input:focus,
.gm2-inbox-search:focus,
.gm2-conversation-search:focus {
  outline: none !important;
  border-color: #006edc !important;
  box-shadow: 0 0 0 3px rgba(0,110,220,.15), 0 8px 22px rgba(0,80,160,.08) !important;
}

.gm2-messages-shell .gm2-send-reply,
.gm2-message-form button,
.gm2-reply-form button,
.gm2-chat-input-area button {
  background: linear-gradient(135deg, #0077e6 0%, #005bb8 100%) !important;
  color: #ffffff !important;
  border: 0 !important;
  border-radius: 14px !important;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(0,91,184,.25) !important;
}

.gm2-messages-shell .gm2-send-reply:hover,
.gm2-message-form button:hover,
.gm2-reply-form button:hover,
.gm2-chat-input-area button:hover {
  background: linear-gradient(135deg, #0088ff 0%, #004fa3 100%) !important;
  transform: translateY(-1px);
}

@media (max-width: 900px){
  .gm2-messages-shell .gm2-thread-panel__top {
    border-top-right-radius: 0;
  }
}

@media (max-width: 640px){
  .gm2-messages-shell .gm2-thread-panel__top {
    gap: 12px;
  }
  .gm2-messages-shell .gm2-thread-listing {
    width: 100%;
    white-space: normal;
  }
  .gm2-messages-shell .gm2-thread-composer {
    grid-template-columns: 1fr;
  }
}

/* GM2 1.1.9 - Scroll al último mensaje y estado en texto */
.gm2-thread-messages {
  scroll-behavior: smooth;
}

.gm2-message__meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 6px;
  line-height: 1;
}

.gm2-message__bubble .gm2-message__meta time {
  display: inline-flex;
  margin-top: 0;
  font-size: 11px;
  opacity: .75;
}

.gm2-message-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: -5px;
  padding-right: 5px;
  font-weight: 900;
  color: rgba(255,255,255,.72);
  user-select: none;
}

.gm2-message-status--sent,
.gm2-message-status--delivered {
  color: rgba(255,255,255,.72);
}

.gm2-message-status--read {
  color: #36c5ff;
  text-shadow: 0 0 10px rgba(54,197,255,.35);
}

.gm2-message--other .gm2-message__meta {
  justify-content: flex-start;
}

.gm2-message--other .gm2-message-status {
  display: none;
}

@media (max-width: 640px){
  .gm2-message-status {
    font-size: 12px;
  }
}


/* GM2 1.1.9 - estados en texto y azul GendaMotor para mensajes enviados */
.gm2-messages-shell .gm2-message--mine .gm2-message__bubble,
.gm2-message--mine .gm2-message__bubble {
  background: #006BD6 !important;
  border-color: #006BD6 !important;
  color: #ffffff !important;
}

.gm2-message-status {
  min-width: 0 !important;
  padding: 0 !important;
  margin-left: 8px !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  font-weight: 700 !important;
  color: rgba(255,255,255,.82) !important;
  text-shadow: none !important;
}

.gm2-message-status--sent,
.gm2-message-status--delivered {
  color: rgba(255,255,255,.82) !important;
}

.gm2-message-status--read {
  color: #ffffff !important;
}

/* GM2 1.2.0 - Chat con altura controlada, scroll interno y textos largos seguros */
.gm2-messages-shell,
.gm2-messages-app {
  max-width: 100%;
}

.gm2-messages-shell .gm2-messages-app,
.gm2-messages-app {
  height: min(760px, calc(100vh - 120px)) !important;
  min-height: 560px !important;
  max-height: 760px !important;
  overflow: hidden !important;
}

.gm2-messages-shell .gm2-messages-app__sidebar,
.gm2-messages-app__sidebar {
  min-height: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.gm2-messages-shell .gm2-conversation-list,
.gm2-conversation-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,107,214,.45) rgba(219,231,243,.65);
}

.gm2-messages-shell .gm2-thread-panel,
.gm2-thread-panel {
  min-height: 0 !important;
  height: 100% !important;
  overflow: hidden !important;
  display: grid !important;
  grid-template-rows: auto minmax(0,1fr) auto !important;
}

.gm2-messages-shell .gm2-thread-messages,
.gm2-thread-messages {
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(0,107,214,.45) rgba(219,231,243,.65);
}

.gm2-messages-shell .gm2-thread-messages::-webkit-scrollbar,
.gm2-thread-messages::-webkit-scrollbar,
.gm2-messages-shell .gm2-conversation-list::-webkit-scrollbar,
.gm2-conversation-list::-webkit-scrollbar {
  width: 9px;
}

.gm2-messages-shell .gm2-thread-messages::-webkit-scrollbar-track,
.gm2-thread-messages::-webkit-scrollbar-track,
.gm2-messages-shell .gm2-conversation-list::-webkit-scrollbar-track,
.gm2-conversation-list::-webkit-scrollbar-track {
  background: rgba(219,231,243,.65);
  border-radius: 999px;
}

.gm2-messages-shell .gm2-thread-messages::-webkit-scrollbar-thumb,
.gm2-thread-messages::-webkit-scrollbar-thumb,
.gm2-messages-shell .gm2-conversation-list::-webkit-scrollbar-thumb,
.gm2-conversation-list::-webkit-scrollbar-thumb {
  background: rgba(0,107,214,.45);
  border-radius: 999px;
  border: 2px solid rgba(219,231,243,.65);
}

.gm2-messages-shell .gm2-thread-composer,
.gm2-thread-composer {
  flex: 0 0 auto !important;
  position: relative;
  z-index: 2;
}

.gm2-messages-shell .gm2-message,
.gm2-message {
  min-width: 0;
}

.gm2-messages-shell .gm2-message__bubble,
.gm2-message__bubble {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: pre-wrap !important;
  min-width: 0 !important;
}

.gm2-messages-shell .gm2-message__text,
.gm2-message__text {
  overflow-wrap: anywhere !important;
  word-break: break-word !important;
  white-space: pre-wrap !important;
}

.gm2-messages-shell .gm2-reply-input,
.gm2-reply-input {
  max-height: 150px !important;
  overflow-y: auto !important;
}

@media (max-width: 900px){
  .gm2-messages-shell .gm2-messages-app,
  .gm2-messages-app {
    height: min(820px, calc(100vh - 70px)) !important;
    min-height: 620px !important;
    max-height: none !important;
  }

  .gm2-messages-shell .gm2-conversation-list,
  .gm2-conversation-list {
    flex: 0 0 auto !important;
    max-height: 220px !important;
  }

  .gm2-messages-shell .gm2-thread-panel,
  .gm2-thread-panel {
    min-height: 0 !important;
  }
}

@media (max-width: 640px){
  .gm2-messages-shell .gm2-messages-app,
  .gm2-messages-app {
    height: calc(100vh - 10px) !important;
    min-height: 0 !important;
    max-height: none !important;
  }

  .gm2-messages-shell .gm2-messages-app__sidebar,
  .gm2-messages-app__sidebar {
    flex: 0 0 auto !important;
    max-height: 260px !important;
  }

  .gm2-messages-shell .gm2-conversation-list,
  .gm2-conversation-list {
    max-height: 165px !important;
  }

  .gm2-messages-shell .gm2-thread-panel__top,
  .gm2-thread-panel__top {
    flex: 0 0 auto !important;
  }

  .gm2-messages-shell .gm2-thread-messages,
  .gm2-thread-messages {
    padding: 14px !important;
  }
}

/* GM2 1.2.1 - Modo móvil a pantalla completa tipo app */
.gm2-mobile-chatbar,
.gm2-thread-back {
  display: none;
}

@media (max-width: 640px){
  body.gm2-chat-mobile-open {
    overflow: hidden !important;
    touch-action: manipulation;
  }

  body.gm2-chat-mobile-open .gm2-messages-shell {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    max-width: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    z-index: 999998 !important;
    background: #ffffff !important;
    overflow: hidden !important;
  }

  body.admin-bar.gm2-chat-mobile-open .gm2-messages-shell {
    top: 46px !important;
    height: calc(100vh - 46px) !important;
    height: calc(100dvh - 46px) !important;
  }

  body.gm2-chat-mobile-open .gm2-messages-app,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-messages-app {
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    background: #f4faff !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-chatbar {
    display: grid !important;
    grid-template-columns: 82px minmax(0, 1fr) 82px;
    align-items: center;
    gap: 8px;
    min-height: 58px;
    padding: max(10px, env(safe-area-inset-top)) 14px 10px;
    background: #006bd6;
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(0, 58, 116, .22);
    position: relative;
    z-index: 5;
  }

  body.gm2-chat-mobile-open .gm2-mobile-title {
    display: block;
    min-width: 0;
    text-align: center;
    font-size: 17px;
    font-weight: 900;
    letter-spacing: -.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.gm2-chat-mobile-open .gm2-mobile-back,
  body.gm2-chat-mobile-open .gm2-mobile-exit {
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    padding: 0 11px;
    font: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    color: #006bd6;
    background: #ffffff;
    box-shadow: 0 6px 16px rgba(0, 34, 68, .14);
  }

  body.gm2-chat-mobile-open .gm2-mobile-back {
    visibility: hidden;
  }

  body.gm2-chat-mobile-open .gm2-mobile-thread-open .gm2-mobile-back {
    visibility: visible;
  }

  body.gm2-chat-mobile-open .gm2-messages-app__sidebar,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-messages-app__sidebar {
    grid-row: 2;
    height: 100% !important;
    max-height: none !important;
    min-height: 0 !important;
    border: 0 !important;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom)) !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    background: linear-gradient(180deg, #f4faff 0%, #ffffff 100%) !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-thread-open .gm2-messages-app__sidebar {
    display: none !important;
  }

  body.gm2-chat-mobile-open .gm2-messages-app__head {
    margin-bottom: 12px !important;
  }

  body.gm2-chat-mobile-open .gm2-messages-app__head h2 {
    font-size: 26px !important;
  }

  body.gm2-chat-mobile-open .gm2-conversation-search {
    flex: 0 0 auto !important;
    height: 46px !important;
    margin-bottom: 12px !important;
    border-radius: 16px !important;
  }

  body.gm2-chat-mobile-open .gm2-conversation-list,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-conversation-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 2px 2px 14px 0 !important;
    -webkit-overflow-scrolling: touch;
  }

  body.gm2-chat-mobile-open .gm2-conv-row,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-conv-row {
    grid-template-columns: 56px minmax(0, 1fr) !important;
    padding: 12px !important;
    border-radius: 18px !important;
  }

  body.gm2-chat-mobile-open .gm2-conv-thumb,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-conv-thumb {
    width: 56px !important;
    height: 56px !important;
    border-radius: 15px !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-panel,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-thread-panel {
    grid-row: 2;
    min-height: 0 !important;
    height: 100% !important;
    display: none !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    overflow: hidden !important;
    background: #ffffff !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-thread-open .gm2-thread-panel,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-mobile-thread-open .gm2-thread-panel {
    display: grid !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-panel__top,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-thread-panel__top {
    min-height: 76px !important;
    padding: 14px 14px !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(148, 183, 218, .45) !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-panel__info {
    min-width: 0;
    flex: 1 1 auto;
  }

  body.gm2-chat-mobile-open .gm2-thread-title,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-thread-title {
    font-size: 17px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.gm2-chat-mobile-open .gm2-thread-subtitle,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-thread-subtitle {
    font-size: 12px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.gm2-chat-mobile-open .gm2-thread-listing,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-thread-listing {
    min-height: 36px !important;
    padding: 8px 11px !important;
    font-size: 12px !important;
    flex: 0 0 auto;
  }

  body.gm2-chat-mobile-open .gm2-thread-back {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    color: #006bd6;
    background: #edf7ff;
    font-size: 19px;
    font-weight: 900;
    cursor: pointer;
    flex: 0 0 auto;
  }

  body.gm2-chat-mobile-open .gm2-thread-messages,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-thread-messages {
    min-height: 0 !important;
    height: auto !important;
    padding: 14px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  body.gm2-chat-mobile-open .gm2-thread-composer,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-thread-composer {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 10px !important;
    align-items: end !important;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) !important;
    background: #eaf5ff !important;
    border-top: 1px solid rgba(148, 183, 218, .45) !important;
  }

  body.gm2-chat-mobile-open .gm2-reply-input,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-reply-input {
    min-height: 46px !important;
    max-height: 112px !important;
    border-radius: 16px !important;
    resize: none !important;
  }

  body.gm2-chat-mobile-open .gm2-send-reply {
    min-height: 46px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    border-radius: 14px !important;
  }

  body.gm2-chat-mobile-open .gm2-message__bubble,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-message__bubble {
    max-width: 86% !important;
  }
}


/* GM2 1.2.2 - Móvil pantalla completa REAL, aislado del tema */
@media (max-width: 768px){
  html:has(.gm2-messages-shell),
  body.gm2-chat-mobile-open {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  body.gm2-chat-mobile-open > *:not(.gm2-messages-shell):not(#wpadminbar),
  body.gm2-chat-mobile-open .site,
  body.gm2-chat-mobile-open #page,
  body.gm2-chat-mobile-open .wp-site-blocks,
  body.gm2-chat-mobile-open main,
  body.gm2-chat-mobile-open footer,
  body.gm2-chat-mobile-open header {
    pointer-events: none !important;
  }

  .gm2-messages-shell,
  body.gm2-chat-mobile-open .gm2-messages-shell {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: #f4faff !important;
    overflow: hidden !important;
    z-index: 2147483647 !important;
    box-sizing: border-box !important;
    isolation: isolate !important;
    transform: none !important;
  }

  .gm2-messages-shell *,
  body.gm2-chat-mobile-open .gm2-messages-shell * {
    box-sizing: border-box !important;
  }

  .gm2-messages-shell .gm2-messages-app,
  .gm2-messages-app,
  body.gm2-chat-mobile-open .gm2-messages-app,
  body.gm2-chat-mobile-open .gm2-messages-shell .gm2-messages-app {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #f4faff !important;
    overflow: hidden !important;
  }

  .gm2-mobile-chatbar,
  body.gm2-chat-mobile-open .gm2-mobile-chatbar {
    display: grid !important;
    grid-template-columns: 92px minmax(0, 1fr) 78px !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: 58px !important;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px !important;
    background: linear-gradient(135deg, #005bb8 0%, #0077e6 100%) !important;
    color: #fff !important;
    border: 0 !important;
    box-shadow: 0 8px 24px rgba(0, 55, 110, .22) !important;
    z-index: 10 !important;
  }

  .gm2-mobile-title {
    color: #fff !important;
    text-align: center !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .gm2-mobile-back,
  .gm2-mobile-exit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #ffffff !important;
    color: #006bd6 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    cursor: pointer !important;
  }

  .gm2-mobile-back { visibility: hidden !important; }
  .gm2-mobile-thread-open .gm2-mobile-back { visibility: visible !important; }

  .gm2-messages-shell .gm2-messages-app__sidebar,
  .gm2-messages-app__sidebar,
  body.gm2-chat-mobile-open .gm2-messages-app__sidebar {
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: none !important;
    width: 100% !important;
    padding: 14px !important;
    border: 0 !important;
    background: #f4faff !important;
    overflow: hidden !important;
  }

  .gm2-mobile-thread-open .gm2-messages-app__sidebar {
    display: none !important;
  }

  .gm2-messages-app__head { flex: 0 0 auto !important; }
  .gm2-messages-app__head h2 { font-size: 25px !important; }
  .gm2-conversation-search { flex: 0 0 auto !important; margin-bottom: 10px !important; }

  .gm2-conversation-list,
  .gm2-messages-shell .gm2-conversation-list,
  body.gm2-chat-mobile-open .gm2-conversation-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 0 4px 16px 0 !important;
  }

  .gm2-thread-panel,
  .gm2-messages-shell .gm2-thread-panel,
  body.gm2-chat-mobile-open .gm2-thread-panel {
    grid-row: 2 !important;
    display: none !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    overflow: hidden !important;
    background: #fff !important;
  }

  .gm2-mobile-thread-open .gm2-thread-panel,
  .gm2-messages-shell .gm2-mobile-thread-open .gm2-thread-panel {
    display: grid !important;
  }

  .gm2-thread-panel__top,
  .gm2-messages-shell .gm2-thread-panel__top,
  body.gm2-chat-mobile-open .gm2-thread-panel__top {
    flex: 0 0 auto !important;
    min-height: 68px !important;
    padding: 10px 12px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    background: #fff !important;
    color: #102033 !important;
    border-bottom: 1px solid #dbe7f3 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  .gm2-thread-back {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #eaf5ff !important;
    color: #006bd6 !important;
    font-size: 20px !important;
    font-weight: 900 !important;
  }

  .gm2-thread-panel__info { min-width: 0 !important; flex: 1 1 auto !important; }
  .gm2-thread-title { color: #102033 !important; font-size: 16px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  .gm2-thread-subtitle { color: #6b7a8c !important; font-size: 12px !important; white-space: nowrap !important; overflow: hidden !important; text-overflow: ellipsis !important; }
  .gm2-thread-listing { min-height: 36px !important; padding: 8px 10px !important; font-size: 12px !important; flex: 0 0 auto !important; }

  .gm2-thread-messages,
  .gm2-messages-shell .gm2-thread-messages,
  body.gm2-chat-mobile-open .gm2-thread-messages {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 12px !important;
    background: linear-gradient(180deg,#fbfdff,#f2f8ff) !important;
  }

  .gm2-thread-composer,
  .gm2-messages-shell .gm2-thread-composer,
  body.gm2-chat-mobile-open .gm2-thread-composer {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    flex: 0 0 auto !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    gap: 8px !important;
    align-items: end !important;
    width: 100% !important;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom)) !important;
    border-top: 1px solid #dbe7f3 !important;
    background: #eaf5ff !important;
    z-index: 8 !important;
  }

  .gm2-reply-input,
  .gm2-messages-shell .gm2-reply-input {
    min-height: 46px !important;
    max-height: 110px !important;
    resize: none !important;
    border-radius: 14px !important;
  }

  .gm2-send-reply,
  .gm2-messages-shell .gm2-send-reply {
    width: auto !important;
    min-width: 66px !important;
    min-height: 46px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
  }
}

/* GM2 1.2.4 - Solución móvil final: pantalla completa aunque el tema tenga header/footer o contenedores con transform */
@media (max-width: 768px) {
  html.gm2-chat-mobile-open,
  body.gm2-chat-mobile-open {
    overflow: hidden !important;
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overscroll-behavior: none !important;
  }

  body.gm2-chat-mobile-open {
    position: fixed !important;
    inset: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    touch-action: none !important;
  }

  .gm2-chat-mobile-shell,
  body .gm2-chat-mobile-shell,
  body > .gm2-chat-mobile-shell,
  body.gm2-chat-mobile-open .gm2-chat-mobile-shell,
  body.gm2-chat-mobile-open > .gm2-chat-mobile-shell,
  .gm2-messages-shell.gm2-chat-mobile-shell,
  .gm2-chat-mobile-shell.gm2-is-mobile-fixed {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    inset: 0 !important;
    display: block !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #f4faff !important;
    overflow: hidden !important;
    z-index: 2147483647 !important;
    isolation: isolate !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .gm2-chat-mobile-shell::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    background: #f4faff !important;
    z-index: -1 !important;
    pointer-events: none !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app,
  body.gm2-chat-mobile-open .gm2-chat-mobile-shell .gm2-messages-app {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    background: #f4faff !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-chatbar {
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: 88px minmax(0,1fr) 78px !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: calc(58px + env(safe-area-inset-top)) !important;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #005fbf 0%, #0084d8 100%) !important;
    color: #fff !important;
    z-index: 50 !important;
    box-shadow: 0 8px 24px rgba(0,40,90,.22) !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-title {
    color: #fff !important;
    text-align: center !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-back,
  .gm2-chat-mobile-shell .gm2-mobile-exit {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #fff !important;
    color: #006bd6 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    cursor: pointer !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-back { visibility: hidden !important; }
  .gm2-chat-mobile-shell .gm2-mobile-thread-open .gm2-mobile-back { visibility: visible !important; }

  .gm2-chat-mobile-shell .gm2-messages-app__sidebar {
    grid-row: 2 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 14px !important;
    border: 0 !important;
    background: #f4faff !important;
    overflow: hidden !important;
  }

  .gm2-chat-mobile-shell.gm2-force-list .gm2-thread-panel,
  .gm2-chat-mobile-shell .gm2-messages-app:not(.gm2-mobile-thread-open) .gm2-thread-panel {
    display: none !important;
  }

  .gm2-chat-mobile-shell.gm2-force-list .gm2-messages-app__sidebar,
  .gm2-chat-mobile-shell .gm2-messages-app:not(.gm2-mobile-thread-open) .gm2-messages-app__sidebar {
    display: flex !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-thread-open .gm2-messages-app__sidebar {
    display: none !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app__head,
  .gm2-chat-mobile-shell .gm2-conversation-search {
    flex: 0 0 auto !important;
  }

  .gm2-chat-mobile-shell .gm2-conversation-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 2px 2px calc(18px + env(safe-area-inset-bottom)) 0 !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel {
    grid-row: 2 !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: none !important;
    display: none !important;
    grid-template-rows: auto minmax(0,1fr) auto !important;
    overflow: hidden !important;
    margin: 0 !important;
    border: 0 !important;
    background: #fff !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-thread-open .gm2-thread-panel {
    display: grid !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel__top {
    grid-row: 1 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    min-height: 64px !important;
    padding: 10px 12px !important;
    margin: 0 !important;
    background: #fff !important;
    color: #102033 !important;
    border-bottom: 1px solid #d9e8f7 !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-messages {
    grid-row: 2 !important;
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
    padding: 12px !important;
    background: linear-gradient(180deg,#fbfdff,#f0f7ff) !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-composer {
    grid-row: 3 !important;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0,1fr) auto !important;
    gap: 8px !important;
    align-items: end !important;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom)) !important;
    margin: 0 !important;
    border-top: 1px solid #d9e8f7 !important;
    background: #eaf5ff !important;
  }

  .gm2-chat-mobile-shell .gm2-reply-input {
    min-height: 46px !important;
    max-height: 110px !important;
    resize: none !important;
    border-radius: 14px !important;
  }

  .gm2-chat-mobile-shell .gm2-send-reply {
    width: auto !important;
    min-width: 66px !important;
    min-height: 46px !important;
    padding: 0 12px !important;
    border-radius: 14px !important;
  }
}

/* GM2 1.2.4 - Solución móvil final: pantalla completa aunque el tema tenga header/footer o contenedores con transform */
.gm2-mobile-placeholder { display: none !important; }
@media (max-width: 768px) {
  html.gm2-chat-mobile-open,
  body.gm2-chat-mobile-open {
    overflow: hidden !important;
    width: 100% !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overscroll-behavior: none !important;
  }
  body.gm2-chat-mobile-open {
    position: fixed !important;
    inset: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    touch-action: none !important;
  }
  .gm2-chat-mobile-shell,
  body .gm2-chat-mobile-shell,
  body > .gm2-chat-mobile-shell,
  body.gm2-chat-mobile-open .gm2-chat-mobile-shell,
  body.gm2-chat-mobile-open > .gm2-chat-mobile-shell,
  .gm2-messages-shell.gm2-chat-mobile-shell,
  .gm2-chat-mobile-shell.gm2-is-mobile-fixed {
    position: fixed !important;
    inset: 0 !important;
    display: block !important;
    width: 100vw !important;
    min-width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #f4faff !important;
    overflow: hidden !important;
    z-index: 2147483647 !important;
    isolation: isolate !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .gm2-chat-mobile-shell::before {
    content: "" !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    background: #f4faff !important;
    z-index: -1 !important;
    pointer-events: none !important;
  }
  .gm2-chat-mobile-shell .gm2-messages-app,
  body.gm2-chat-mobile-open .gm2-chat-mobile-shell .gm2-messages-app {
    position: relative !important;
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: hidden !important;
    background: #f4faff !important;
  }
  .gm2-chat-mobile-shell .gm2-mobile-chatbar {
    grid-row: 1 !important;
    display: grid !important;
    grid-template-columns: 88px minmax(0,1fr) 78px !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    min-height: calc(58px + env(safe-area-inset-top)) !important;
    padding: calc(8px + env(safe-area-inset-top)) 12px 8px !important;
    margin: 0 !important;
    background: linear-gradient(135deg, #005fbf 0%, #0084d8 100%) !important;
    color: #fff !important;
    z-index: 50 !important;
    box-shadow: 0 8px 24px rgba(0,40,90,.22) !important;
  }
  .gm2-chat-mobile-shell .gm2-mobile-title { color: #fff !important; text-align: center !important; font-size: 17px !important; font-weight: 900 !important; overflow: hidden !important; text-overflow: ellipsis !important; white-space: nowrap !important; }
  .gm2-chat-mobile-shell .gm2-mobile-back,
  .gm2-chat-mobile-shell .gm2-mobile-exit { display: inline-flex !important; align-items: center !important; justify-content: center !important; min-height: 40px !important; padding: 0 10px !important; border: 0 !important; border-radius: 999px !important; background: #fff !important; color: #006bd6 !important; font-size: 13px !important; font-weight: 900 !important; line-height: 1 !important; cursor: pointer !important; }
  .gm2-chat-mobile-shell .gm2-mobile-back { visibility: hidden !important; }
  .gm2-chat-mobile-shell .gm2-mobile-thread-open .gm2-mobile-back { visibility: visible !important; }
  .gm2-chat-mobile-shell .gm2-messages-app__sidebar { grid-row: 2 !important; display: flex !important; flex-direction: column !important; width: 100% !important; height: 100% !important; min-height: 0 !important; max-height: none !important; margin: 0 !important; padding: 14px !important; border: 0 !important; background: #f4faff !important; overflow: hidden !important; }
  .gm2-chat-mobile-shell.gm2-force-list .gm2-thread-panel,
  .gm2-chat-mobile-shell .gm2-messages-app:not(.gm2-mobile-thread-open) .gm2-thread-panel { display: none !important; }
  .gm2-chat-mobile-shell.gm2-force-list .gm2-messages-app__sidebar,
  .gm2-chat-mobile-shell .gm2-messages-app:not(.gm2-mobile-thread-open) .gm2-messages-app__sidebar { display: flex !important; }
  .gm2-chat-mobile-shell .gm2-mobile-thread-open .gm2-messages-app__sidebar { display: none !important; }
  .gm2-chat-mobile-shell .gm2-messages-app__head,
  .gm2-chat-mobile-shell .gm2-conversation-search { flex: 0 0 auto !important; }
  .gm2-chat-mobile-shell .gm2-conversation-list { flex: 1 1 auto !important; min-height: 0 !important; height: auto !important; max-height: none !important; overflow-y: auto !important; overflow-x: hidden !important; -webkit-overflow-scrolling: touch !important; overscroll-behavior: contain !important; padding: 2px 2px calc(18px + env(safe-area-inset-bottom)) 0 !important; }
  .gm2-chat-mobile-shell .gm2-thread-panel { grid-row: 2 !important; width: 100% !important; height: 100% !important; min-width: 0 !important; min-height: 0 !important; max-height: none !important; display: none !important; grid-template-rows: auto minmax(0,1fr) auto !important; overflow: hidden !important; margin: 0 !important; border: 0 !important; background: #fff !important; }
  .gm2-chat-mobile-shell .gm2-mobile-thread-open .gm2-thread-panel { display: grid !important; }
  .gm2-chat-mobile-shell .gm2-thread-panel__top { grid-row: 1 !important; display: flex !important; flex-direction: row !important; align-items: center !important; gap: 8px !important; min-height: 64px !important; padding: 10px 12px !important; margin: 0 !important; background: #fff !important; color: #102033 !important; border-bottom: 1px solid #d9e8f7 !important; box-shadow: none !important; overflow: hidden !important; }
  .gm2-chat-mobile-shell .gm2-thread-messages { grid-row: 2 !important; min-height: 0 !important; height: auto !important; max-height: none !important; overflow-y: auto !important; overflow-x: hidden !important; -webkit-overflow-scrolling: touch !important; overscroll-behavior: contain !important; padding: 12px !important; background: linear-gradient(180deg,#fbfdff,#f0f7ff) !important; }
  .gm2-chat-mobile-shell .gm2-thread-composer { grid-row: 3 !important; position: relative !important; bottom: auto !important; left: auto !important; right: auto !important; width: 100% !important; display: grid !important; grid-template-columns: minmax(0,1fr) auto !important; gap: 8px !important; align-items: end !important; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)) !important; margin: 0 !important; border-top: 1px solid #d9e8f7 !important; background: #eaf5ff !important; }
  .gm2-chat-mobile-shell .gm2-reply-input { min-height: 46px !important; max-height: 110px !important; resize: none !important; border-radius: 14px !important; }
  .gm2-chat-mobile-shell .gm2-send-reply { width: auto !important; min-width: 66px !important; min-height: 46px !important; padding: 0 12px !important; border-radius: 14px !important; }
}


/* GM2 1.2.5 - Abrir conversación directa desde móvil y mejora visual centrada */
@media (max-width: 768px) {
  .gm2-chat-mobile-shell .gm2-messages-app__sidebar {
    align-items: center !important;
    padding: 16px 14px calc(16px + env(safe-area-inset-bottom)) !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app__head,
  .gm2-chat-mobile-shell .gm2-conversation-search,
  .gm2-chat-mobile-shell .gm2-conversation-list {
    width: min(100%, 560px) !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app__head {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    text-align: center !important;
    margin-bottom: 14px !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app__head h2 {
    margin: 0 !important;
    font-size: 25px !important;
    line-height: 1.15 !important;
    letter-spacing: -.03em !important;
    color: #0b2f57 !important;
  }

  .gm2-chat-mobile-shell .gm2-conversation-search {
    display: block !important;
    height: 48px !important;
    padding: 0 16px !important;
    margin-bottom: 14px !important;
    border-radius: 999px !important;
    text-align: left !important;
  }

  .gm2-chat-mobile-shell .gm2-conversation-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 2px 4px calc(18px + env(safe-area-inset-bottom)) !important;
  }

  .gm2-chat-mobile-shell .gm2-conv-row {
    width: 100% !important;
    max-width: 560px !important;
    margin: 0 auto !important;
    border-radius: 20px !important;
    padding: 13px !important;
    background: rgba(255,255,255,.96) !important;
    box-shadow: 0 10px 28px rgba(11,47,87,.08) !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel__top {
    justify-content: center !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel__info {
    text-align: left !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-messages {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    padding: 14px max(12px, calc((100vw - 620px) / 2 + 12px)) !important;
  }

  .gm2-chat-mobile-shell .gm2-message {
    width: 100% !important;
  }

  .gm2-chat-mobile-shell .gm2-message__bubble {
    max-width: min(86%, 460px) !important;
    padding: 12px 14px !important;
    border-radius: 18px !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-composer {
    grid-template-columns: minmax(0, 1fr) auto !important;
    justify-content: center !important;
    padding-left: max(10px, calc((100vw - 620px) / 2 + 10px)) !important;
    padding-right: max(10px, calc((100vw - 620px) / 2 + 10px)) !important;
  }

  .gm2-chat-mobile-shell .gm2-reply-input {
    min-height: 46px !important;
    padding: 12px 14px !important;
    border-radius: 18px !important;
  }

  .gm2-chat-mobile-shell .gm2-send-reply {
    min-width: 74px !important;
    border-radius: 16px !important;
  }

  .gm2-chat-mobile-shell .gm2-empty-state {
    width: min(100%, 560px) !important;
    margin: 0 auto !important;
    border-radius: 18px !important;
  }
}


/* GM2 1.2.7 - Centrado móvil definitivo y ocultación de enlace técnico /coches-nuevos/ */
@media (max-width: 768px) {
  body.gm2-chat-mobile-open .gm2-chat-mobile-shell,
  body > .gm2-chat-mobile-shell.gm2-is-mobile-fixed {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background: #f4f8fb !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app {
    width: 100% !important;
    max-width: 520px !important;
    height: 100dvh !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    background: #f4f8fb !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-chatbar {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    grid-template-columns: 92px minmax(0,1fr) 82px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    background: linear-gradient(135deg, #0058c9 0%, #006bd6 100%) !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-title {
    text-align: center !important;
    font-size: 18px !important;
    line-height: 1.15 !important;
    max-width: 100% !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-back,
  .gm2-chat-mobile-shell .gm2-mobile-exit {
    min-width: 74px !important;
    min-height: 42px !important;
    padding: 0 12px !important;
    font-size: 14px !important;
    box-shadow: 0 8px 18px rgba(0,35,90,.16) !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app__sidebar {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    padding: 20px 16px calc(18px + env(safe-area-inset-bottom)) !important;
    align-items: center !important;
    background: #f4f8fb !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app__head {
    width: 100% !important;
    max-width: 460px !important;
    justify-content: center !important;
    text-align: center !important;
  }

  .gm2-chat-mobile-shell .gm2-messages-app__head h2 {
    font-size: clamp(26px, 8vw, 34px) !important;
    letter-spacing: -0.04em !important;
  }

  .gm2-chat-mobile-shell .gm2-conversation-search {
    width: 100% !important;
    max-width: 460px !important;
    height: 50px !important;
    margin: 0 auto 18px !important;
    border-radius: 18px !important;
    font-size: 15px !important;
  }

  .gm2-chat-mobile-shell .gm2-conversation-list {
    width: 100% !important;
    max-width: 460px !important;
    margin: 0 auto !important;
    padding: 0 0 calc(18px + env(safe-area-inset-bottom)) !important;
    gap: 14px !important;
  }

  .gm2-chat-mobile-shell .gm2-conv-row {
    width: 100% !important;
    max-width: 460px !important;
    min-height: 124px !important;
    grid-template-columns: 72px minmax(0, 1fr) !important;
    gap: 14px !important;
    align-items: center !important;
    margin: 0 auto !important;
    padding: 16px !important;
    border-radius: 22px !important;
    border: 1px solid rgba(0,107,214,.18) !important;
    background: #ffffff !important;
    box-shadow: 0 12px 30px rgba(11,47,87,.08) !important;
  }

  .gm2-chat-mobile-shell .gm2-conv-thumb {
    width: 72px !important;
    height: 72px !important;
    border-radius: 16px !important;
  }

  .gm2-chat-mobile-shell .gm2-conv-row__top strong,
  .gm2-chat-mobile-shell .gm2-conv-row__vehicle,
  .gm2-chat-mobile-shell .gm2-conv-row__last,
  .gm2-chat-mobile-shell .gm2-conv-row__date {
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    text-overflow: clip !important;
  }

  .gm2-chat-mobile-shell .gm2-conv-row__top strong {
    font-size: 17px !important;
    line-height: 1.2 !important;
  }

  .gm2-chat-mobile-shell .gm2-conv-row__vehicle {
    font-size: 15px !important;
    line-height: 1.25 !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    background: #f4f8fb !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel__top {
    justify-content: center !important;
    min-height: 64px !important;
    padding: 10px 16px !important;
    background: #ffffff !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-back {
    display: none !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel__info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    text-align: center !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-title {
    margin: 0 !important;
    color: #0b2f57 !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-subtitle {
    text-align: center !important;
    font-size: 13px !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-listing {
    margin: 8px auto 0 !important;
    min-height: 40px !important;
    padding: 9px 16px !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-messages {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    padding: 18px 16px !important;
    background: linear-gradient(180deg, #fbfdff 0%, #eef6ff 100%) !important;
  }

  .gm2-chat-mobile-shell .gm2-message {
    display: flex !important;
    width: 100% !important;
  }

  .gm2-chat-mobile-shell .gm2-message--mine {
    justify-content: flex-end !important;
  }

  .gm2-chat-mobile-shell .gm2-message--other {
    justify-content: flex-start !important;
  }

  .gm2-chat-mobile-shell .gm2-message__bubble {
    max-width: min(82%, 380px) !important;
    padding: 13px 15px !important;
    border-radius: 20px !important;
    overflow-wrap: anywhere !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-composer {
    width: 100% !important;
    max-width: 520px !important;
    margin: 0 auto !important;
    grid-template-columns: minmax(0, 1fr) 86px !important;
    gap: 10px !important;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom)) !important;
    align-items: end !important;
  }

  .gm2-chat-mobile-shell .gm2-reply-input {
    min-height: 54px !important;
    max-height: 112px !important;
    border-radius: 18px !important;
    padding: 14px 15px !important;
    font-size: 15px !important;
  }

  .gm2-chat-mobile-shell .gm2-send-reply {
    width: 86px !important;
    min-width: 86px !important;
    min-height: 54px !important;
    border-radius: 18px !important;
    padding: 0 !important;
  }
}

/* GM2 1.2.8 - Ajuste visual móvil: cabecera y Ver vehículo centrados/compactos */
@media (max-width: 768px) {
  .gm2-chat-mobile-shell .gm2-mobile-chatbar {
    grid-template-columns: 82px minmax(0, 1fr) 82px !important;
    align-items: center !important;
    justify-items: center !important;
    gap: 8px !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-back,
  .gm2-chat-mobile-shell .gm2-mobile-exit {
    width: 76px !important;
    min-width: 76px !important;
    max-width: 76px !important;
    min-height: 40px !important;
    padding: 0 10px !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-back {
    justify-self: start !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-exit {
    justify-self: end !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-title {
    justify-self: center !important;
    text-align: center !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 2px !important;
    font-size: clamp(16px, 4.5vw, 18px) !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel__top {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: auto !important;
    padding: 12px 14px 10px !important;
    gap: 8px !important;
    text-align: center !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel__info {
    width: 100% !important;
    max-width: 440px !important;
    flex: 0 0 auto !important;
    text-align: center !important;
    margin: 0 auto !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-title,
  .gm2-chat-mobile-shell .gm2-thread-subtitle {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-listing,
  .gm2-chat-mobile-shell a.gm2-thread-listing,
  .gm2-chat-mobile-shell .gm2-view-vehicle,
  .gm2-chat-mobile-shell .gm2-view-car {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 170px !important;
    min-height: 36px !important;
    height: 36px !important;
    padding: 0 14px !important;
    margin: 0 auto !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    text-align: center !important;
    box-shadow: 0 8px 18px rgba(0, 40, 90, .12) !important;
  }


  .gm2-chat-mobile-shell .gm2-thread-messages {
    padding-top: 14px !important;
  }
}

/* GM2 1.2.9 - Centrado exacto móvil del botón Ver vehículo */
@media (max-width: 768px) {
  .gm2-chat-mobile-shell .gm2-thread-panel__top {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }

  .gm2-chat-mobile-shell .gm2-thread-panel__info {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    text-align: center !important;
    box-sizing: border-box !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap {
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    text-align: center !important;
    padding: 8px 16px 4px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    float: none !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
  }

  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap .gm2-thread-listing,
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap a.gm2-thread-listing,
  .gm2-chat-mobile-shell .gm2-thread-panel__top .gm2-thread-listing {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: max-content !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 auto !important;
    padding: 0 18px !important;
    border-radius: 999px !important;
    text-align: center !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    float: none !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    align-self: center !important;
    justify-self: center !important;
  }

}


/* GM2 1.3.0 - Cabecera móvil en 3 columnas reales y botón Ver vehículo visible/centrado */
@media (max-width: 768px) {
  body.gm2-chat-mobile-open .gm2-mobile-chatbar,
  body.gm2-chat-mobile-open .gm2-chat-mobile-header,
  body.gm2-chat-mobile-open .gm2-chat-conversation-header,
  .gm2-chat-mobile-shell .gm2-mobile-chatbar,
  .gm2-chat-mobile-shell .gm2-chat-mobile-header,
  .gm2-chat-mobile-shell .gm2-chat-conversation-header {
    display: grid !important;
    grid-template-columns: 80px minmax(0, 1fr) 80px !important;
    align-items: center !important;
    justify-items: stretch !important;
    width: 100% !important;
    gap: 8px !important;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px !important;
    box-sizing: border-box !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-back,
  body.gm2-chat-mobile-open .gm2-chat-back,
  body.gm2-chat-mobile-open .gm2-chat-mobile-back,
  .gm2-chat-mobile-shell .gm2-mobile-back,
  .gm2-chat-mobile-shell .gm2-chat-back,
  .gm2-chat-mobile-shell .gm2-chat-mobile-back {
    justify-self: start !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 80px !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-title,
  body.gm2-chat-mobile-open .gm2-chat-title,
  body.gm2-chat-mobile-open .gm2-chat-mobile-title,
  body.gm2-chat-mobile-open .gm2-chat-contact-name,
  .gm2-chat-mobile-shell .gm2-mobile-title,
  .gm2-chat-mobile-shell .gm2-chat-title,
  .gm2-chat-mobile-shell .gm2-chat-mobile-title,
  .gm2-chat-mobile-shell .gm2-chat-contact-name {
    justify-self: center !important;
    text-align: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-weight: 700 !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-exit,
  body.gm2-chat-mobile-open .gm2-chat-exit,
  body.gm2-chat-mobile-open .gm2-chat-mobile-exit,
  .gm2-chat-mobile-shell .gm2-mobile-exit,
  .gm2-chat-mobile-shell .gm2-chat-exit,
  .gm2-chat-mobile-shell .gm2-chat-mobile-exit {
    justify-self: end !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 80px !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-panel,
  body.gm2-chat-mobile-open .gm2-chat-conversation-view,
  .gm2-chat-mobile-shell .gm2-thread-panel,
  .gm2-chat-mobile-shell .gm2-chat-conversation-view {
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-panel__top,
  .gm2-chat-mobile-shell .gm2-thread-panel__top {
    grid-row: 1 !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap,
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap {
    grid-row: 2 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 8px 12px 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    overflow: visible !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap .gm2-chat-vehicle-link,
  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap .gm2-thread-listing,
  body.gm2-chat-mobile-open .gm2-chat-vehicle-link,
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap .gm2-chat-vehicle-link,
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap .gm2-thread-listing,
  .gm2-chat-mobile-shell .gm2-chat-vehicle-link {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 180px !important;
    min-height: 36px !important;
    height: auto !important;
    padding: 8px 16px !important;
    margin: 0 auto !important;
    border-radius: 999px !important;
    text-align: center !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    position: static !important;
    left: auto !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-messages,
  body.gm2-chat-mobile-open .gm2-chat-messages,
  .gm2-chat-mobile-shell .gm2-thread-messages,
  .gm2-chat-mobile-shell .gm2-chat-messages {
    grid-row: 3 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-composer,
  body.gm2-chat-mobile-open .gm2-chat-reply-form,
  .gm2-chat-mobile-shell .gm2-thread-composer,
  .gm2-chat-mobile-shell .gm2-chat-reply-form {
    grid-row: 4 !important;
  }
}

/* GM2 1.3.0 - Estado vacío del enlace: solo se oculta cuando no hay URL real asignada */
@media (max-width: 768px) {
  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap .gm2-chat-vehicle-link:not([href]),
  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap .gm2-thread-listing:not([href]),
  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap .gm2-chat-vehicle-link[href="#"],
  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap .gm2-thread-listing[href="#"],
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap .gm2-chat-vehicle-link:not([href]),
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap .gm2-thread-listing:not([href]),
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap .gm2-chat-vehicle-link[href="#"],
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap .gm2-thread-listing[href="#"] {
    display: none !important;
  }
}


/* GM2 1.3.1 - Corrección final móvil: cabecera 3 columnas y Ver vehículo visible solo con URL real */
@media (max-width: 768px) {
  body.gm2-chat-mobile-open .gm2-mobile-chatbar.gm2-chat-conversation-header,
  body.gm2-chat-mobile-open .gm2-chat-mobile-header,
  body.gm2-chat-mobile-open .gm2-chat-conversation-header,
  .gm2-chat-mobile-shell .gm2-mobile-chatbar.gm2-chat-conversation-header,
  .gm2-chat-mobile-shell .gm2-chat-mobile-header,
  .gm2-chat-mobile-shell .gm2-chat-conversation-header {
    display: grid !important;
    grid-template-columns: 80px minmax(0, 1fr) 80px !important;
    align-items: center !important;
    width: 100% !important;
    gap: 8px !important;
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px !important;
    box-sizing: border-box !important;
  }

  body.gm2-chat-mobile-open .gm2-chat-back,
  body.gm2-chat-mobile-open .gm2-chat-mobile-back,
  body.gm2-chat-mobile-open .gm2-mobile-back,
  .gm2-chat-mobile-shell .gm2-chat-back,
  .gm2-chat-mobile-shell .gm2-chat-mobile-back,
  .gm2-chat-mobile-shell .gm2-mobile-back {
    grid-column: 1 !important;
    justify-self: start !important;
    max-width: 80px !important;
    min-width: 0 !important;
  }

  body.gm2-chat-mobile-open .gm2-chat-title,
  body.gm2-chat-mobile-open .gm2-chat-mobile-title,
  body.gm2-chat-mobile-open .gm2-chat-contact-name,
  body.gm2-chat-mobile-open .gm2-mobile-title,
  .gm2-chat-mobile-shell .gm2-chat-title,
  .gm2-chat-mobile-shell .gm2-chat-mobile-title,
  .gm2-chat-mobile-shell .gm2-chat-contact-name,
  .gm2-chat-mobile-shell .gm2-mobile-title {
    grid-column: 2 !important;
    justify-self: center !important;
    align-self: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: center !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-weight: 700 !important;
  }

  body.gm2-chat-mobile-open .gm2-chat-exit,
  body.gm2-chat-mobile-open .gm2-chat-mobile-exit,
  body.gm2-chat-mobile-open .gm2-mobile-exit,
  .gm2-chat-mobile-shell .gm2-chat-exit,
  .gm2-chat-mobile-shell .gm2-chat-mobile-exit,
  .gm2-chat-mobile-shell .gm2-mobile-exit {
    grid-column: 3 !important;
    justify-self: end !important;
    max-width: 80px !important;
    min-width: 0 !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-panel.gm2-chat-conversation-view,
  .gm2-chat-mobile-shell .gm2-thread-panel.gm2-chat-conversation-view {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-panel__top,
  .gm2-chat-mobile-shell .gm2-thread-panel__top {
    display: none !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap,
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap {
    grid-row: 1 !important;
    width: 100% !important;
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 8px 12px 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    flex: 0 0 auto !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    overflow: visible !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap.gm2-has-vehicle-url,
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap.gm2-has-vehicle-url {
    display: flex !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap.gm2-has-vehicle-url .gm2-chat-vehicle-link,
  body.gm2-chat-mobile-open .gm2-mobile-vehicle-link-wrap.gm2-has-vehicle-url .gm2-thread-listing,
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap.gm2-has-vehicle-url .gm2-chat-vehicle-link,
  .gm2-chat-mobile-shell .gm2-mobile-vehicle-link-wrap.gm2-has-vehicle-url .gm2-thread-listing {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 180px !important;
    min-height: 36px !important;
    height: auto !important;
    padding: 8px 16px !important;
    margin: 0 auto !important;
    border-radius: 999px !important;
    text-align: center !important;
    white-space: nowrap !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-messages,
  body.gm2-chat-mobile-open .gm2-chat-messages,
  .gm2-chat-mobile-shell .gm2-thread-messages,
  .gm2-chat-mobile-shell .gm2-chat-messages {
    grid-row: 2 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  body.gm2-chat-mobile-open .gm2-thread-composer,
  body.gm2-chat-mobile-open .gm2-chat-reply-form,
  .gm2-chat-mobile-shell .gm2-thread-composer,
  .gm2-chat-mobile-shell .gm2-chat-reply-form {
    grid-row: 3 !important;
  }
}

/* GM2 1.3.1 - Mantener lista/conversación separadas en móvil */
@media (max-width: 768px) {
  body.gm2-chat-mobile-open .gm2-messages-app:not(.gm2-mobile-thread-open) .gm2-thread-panel.gm2-chat-conversation-view,
  .gm2-chat-mobile-shell .gm2-messages-app:not(.gm2-mobile-thread-open) .gm2-thread-panel.gm2-chat-conversation-view {
    display: none !important;
  }

  body.gm2-chat-mobile-open .gm2-mobile-thread-open .gm2-thread-panel.gm2-chat-conversation-view,
  .gm2-chat-mobile-shell .gm2-mobile-thread-open .gm2-thread-panel.gm2-chat-conversation-view {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }
}


/* GM2 1.3.2 - Ver vehículo visible también en escritorio sin cambiar vehicle_url */
.gm2-vehicle-link-wrap {
  display: none;
}

@media (min-width: 769px) {
  .gm2-messages-shell .gm2-thread-panel.gm2-chat-conversation-view,
  .gm2-thread-panel.gm2-chat-conversation-view {
    display: grid !important;
    grid-template-rows: auto auto minmax(0, 1fr) auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .gm2-desktop-vehicle-link-wrap,
  .gm2-mobile-vehicle-link-wrap,
  .gm2-vehicle-link-wrap {
    grid-row: 2 !important;
    display: none !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    padding: 8px 12px 12px !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(148, 183, 218, .35) !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  .gm2-desktop-vehicle-link-wrap.gm2-has-vehicle-url,
  .gm2-mobile-vehicle-link-wrap.gm2-has-vehicle-url,
  .gm2-vehicle-link-wrap.gm2-has-vehicle-url {
    display: flex !important;
  }

  .gm2-messages-shell .gm2-thread-messages,
  .gm2-thread-messages.gm2-chat-messages {
    grid-row: 3 !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }

  .gm2-messages-shell .gm2-thread-composer,
  .gm2-thread-composer.gm2-chat-reply-form {
    grid-row: 4 !important;
  }

  .gm2-desktop-vehicle-link-wrap.gm2-has-vehicle-url .gm2-chat-vehicle-link,
  .gm2-mobile-vehicle-link-wrap.gm2-has-vehicle-url .gm2-chat-vehicle-link,
  .gm2-vehicle-link-wrap.gm2-has-vehicle-url .gm2-chat-vehicle-link,
  .gm2-chat-vehicle-link {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    max-width: 220px !important;
    min-height: 38px !important;
    padding: 8px 16px !important;
    border-radius: 999px !important;
    text-align: center !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }

  .gm2-chat-vehicle-link:not([href]),
  .gm2-chat-vehicle-link[href="#"] {
    display: none !important;
  }
}
