/* Chat unificado Gudfy: bandeja list-detail en escritorio y navegación
   lista → conversación en móvil. Sin dependencias de CSS del layout. */
.gfc-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1001;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}
.gfc-stack, .gfc-stack * { box-sizing: border-box; }
.gfc-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.gfc-stack button:focus-visible, .gfc-stack a:focus-visible, .gfc-stack input:focus-visible, .gfc-stack textarea:focus-visible {
  outline: 3px solid #168b60; outline-offset: 2px;
}
.gfc-fab {
  position: relative;
  width: 58px;
  height: 58px;
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #8c39d0, #63209f);
  box-shadow: 0 8px 28px rgba(76, 22, 126, .38);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.gfc-fab:hover { transform: translateY(-2px) scale(1.04); box-shadow: 0 12px 32px rgba(76, 22, 126, .48); }
.gfc-fab:focus-visible { outline: 3px solid #27e19d; outline-offset: 3px; }
.gfc-fab svg { width: 27px; height: 27px; }
.gfc-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 23px;
  height: 23px;
  padding: 0 6px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 999px;
  color: #fff;
  background: #d52b4d;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}
.gfc-badge.is-visible { display: flex; }
.gfc-badge.is-new { animation: gfc-pop .45s ease; }
@keyframes gfc-pop { 50% { transform: scale(1.35); } }
.gfc-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  width: min(880px, calc(100vw - 48px));
  height: min(650px, calc(100vh - 112px));
  overflow: hidden;
  overflow: clip;
  color: #1a0a30;
  background: #fff;
  border: 1px solid #d9cced;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(31, 0, 70, .26), 0 6px 20px rgba(31, 0, 70, .12);
  transform-origin: bottom right;
  animation: gfc-open .2s ease both;
}
@keyframes gfc-open { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.gfc-panel[hidden] { display: none !important; }
.gfc-shell {
  height: 100%; min-height: 0; display: grid;
  grid-template-columns: 336px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
  overflow: clip;
}
.gfc-list-pane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow: clip;
  background: #faf8fd;
  border-right: 1px solid #e5dcf2;
}
.gfc-list-head {
  padding: 19px 17px 13px;
  background: #1f0046;
  color: #fff;
}
.gfc-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gfc-title { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.2px; }
.gfc-close {
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 10px; color: inherit; background: rgba(255,255,255,.1); cursor: pointer;
}
.gfc-close:hover { background: rgba(255,255,255,.18); }
.gfc-close svg { width: 18px; height: 18px; }
.gfc-search-wrap { position: relative; margin-top: 13px; }
.gfc-search-wrap svg { position: absolute; left: 12px; top: 13px; width: 17px; height: 17px; color: rgba(255,255,255,.72); }
.gfc-search {
  width: 100%; height: 43px; padding: 0 12px 0 38px; border: 1px solid rgba(255,255,255,.22);
  border-radius: 10px; outline: 0; color: #fff; background: rgba(255,255,255,.1); font: inherit; font-size: 13px;
}
.gfc-search::placeholder { color: rgba(255,255,255,.6); }
.gfc-search:focus { border-color: #27e19d; box-shadow: 0 0 0 2px rgba(39,225,157,.14); }
.gfc-filters { display: flex; gap: 6px; padding: 10px 13px; border-bottom: 1px solid #e5dcf2; }
.gfc-filter {
  min-height: 38px; border: 1px solid #d5c7e8; border-radius: 999px; padding: 7px 13px; color: #5d407f;
  background: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer;
}
.gfc-filter.is-active { border-color: #7b2fbe; color: #6a23a8; background: #f1e6fb; }
.gfc-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.gfc-list::-webkit-scrollbar, .gfc-msgs::-webkit-scrollbar { width: 6px; }
.gfc-list::-webkit-scrollbar-thumb, .gfc-msgs::-webkit-scrollbar-thumb { background: #d4c4e9; border-radius: 99px; }
.gfc-item {
  width: 100%; min-height: 82px; padding: 12px 14px; display: grid; grid-template-columns: 45px minmax(0,1fr) auto;
  gap: 10px; align-items: center; border: 0; border-bottom: 1px solid #eee8f6; color: inherit; background: transparent;
  text-align: left; font: inherit; cursor: pointer; transition: background .12s ease;
}
.gfc-item:hover, .gfc-item.is-active { background: #f0e8fa; }
.gfc-item.is-unread { background: #f7f0fd; }
.gfc-item.is-support { background: linear-gradient(90deg, rgba(123,47,190,.09), rgba(39,225,157,.06)); }
.gfc-avatar {
  width: 45px; height: 45px; display: flex; align-items: center; justify-content: center; overflow: hidden;
  border-radius: 14px; color: #fff; background: linear-gradient(145deg, #8d3bd0, #6730aa); font-size: 15px; font-weight: 800;
}
.gfc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gfc-avatar--support { border-radius: 13px; color: #1f0046; background: linear-gradient(145deg, #27e19d, #a6f4d4); }
.gfc-avatar--support svg { width: 23px; height: 23px; }
.gfc-item-main { min-width: 0; }
.gfc-item-top { display: flex; align-items: center; gap: 5px; min-width: 0; }
.gfc-item-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 750; }
.gfc-pin { color: #6a23a8; font-size: 10px; }
.gfc-item-context { display: block; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #654781; font-size: 11px; font-weight: 600; }
.gfc-item-preview { display: block; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6e548c; font-size: 11px; }
.gfc-item.is-unread .gfc-item-preview { color: #402260; font-weight: 650; }
.gfc-item-side { align-self: stretch; display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 5px; }
.gfc-time { color: #72578f; font-size: 10px; white-space: nowrap; }
.gfc-unread { min-width: 21px; height: 21px; padding: 0 6px; display: flex; align-items: center; justify-content: center; border-radius: 99px; color: #fff; background: #6a23a8; font-size: 10px; font-weight: 800; }
.gfc-load-more { min-height: 40px; margin: 9px 13px 14px; padding: 8px; border: 1px solid #d5c7e8; border-radius: 9px; color: #5f1e98; background: #fff; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.gfc-list-state { padding: 28px 18px; color: #6e548c; text-align: center; font-size: 12px; line-height: 1.5; }
.gfc-thread-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; overflow: clip; background: #fff; }
.gfc-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px; color: #7a5fa0; text-align: center; }
.gfc-empty svg { width: 42px; height: 42px; margin-bottom: 15px; color: #9b48ed; }
.gfc-empty strong { color: #2d104d; font-size: 16px; }
.gfc-empty span { max-width: 340px; margin-top: 7px; font-size: 13px; line-height: 1.55; }
.gfc-thread { position: relative; height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; overflow: clip; }
.gfc-thread[hidden], .gfc-empty[hidden] { display: none !important; }
.gfc-thread-head {
  min-height: 68px; padding: 10px 14px; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #e5dcf2; background: rgba(255,255,255,.96);
}
.gfc-back { display: none; width: 42px; height: 42px; align-items: center; justify-content: center; flex: 0 0 auto; border: 0; border-radius: 10px; color: #55267e; background: #f2eafb; cursor: pointer; }
.gfc-back svg { width: 18px; height: 18px; }
.gfc-thread-id { flex: 1; min-width: 0; }
.gfc-thread-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #24103c; font-size: 14px; font-weight: 800; }
.gfc-thread-meta { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #6e548c; font-size: 11px; }
.gfc-head-action { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 1px solid #d5c7e8; border-radius: 10px; color: #5f1e98; background: #fff; cursor: pointer; text-decoration: none; }
.gfc-head-action:hover { background: #f2eafb; }
.gfc-head-action svg { width: 17px; height: 17px; }
.gfc-context { min-height: 38px; padding: 9px 14px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #e8e0f2; background: #faf7fd; color: #5e407e; font-size: 11px; }
.gfc-context strong { color: #321451; }
.gfc-context-dot { width: 4px; height: 4px; border-radius: 50%; background: #b39bcb; }
.gfc-context-detail { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gfc-status { margin-left: auto; padding: 4px 8px; border-radius: 99px; color: #54336f; background: #eee6f6; font-size: 10px; font-weight: 750; white-space: nowrap; }
.gfc-status--urgent { color: #9b1735; background: #fde6eb; }
.gfc-msgs {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 16px;
  background-color: #f7f3fb;
  background-image: radial-gradient(rgba(123,47,190,.055) 1px, transparent 1px);
  background-size: 18px 18px;
}
.gfc-msgs > div > div { overflow-wrap: anywhere; }
.gfc-support-msg { max-width: 79%; margin: 0 0 9px; padding: 10px 13px; border: 1px solid #e1d7ee; border-radius: 14px 14px 14px 4px; color: #2c1646; background: #fff; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; box-shadow: 0 1px 2px rgba(31,0,70,.05); }
.gfc-support-msg.is-mine { margin-left: auto; border: 0; border-radius: 14px 14px 4px 14px; color: #fff; background: #7b2fbe; }
.gfc-support-msg a { color: inherit; font-weight: 750; text-decoration: underline; }
.gfc-msg-label { margin-bottom: 3px; color: #65437f; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.gfc-support-msg.is-mine .gfc-msg-label { color: rgba(255,255,255,.75); }
.gfc-typing { display: inline-flex; gap: 4px; align-items: center; min-width: 48px; }
.gfc-typing i { width: 6px; height: 6px; border-radius: 50%; background: #8d72a9; animation: gfc-typing 1s infinite alternate; }
.gfc-typing i:nth-child(2) { animation-delay: .18s; }.gfc-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes gfc-typing { to { opacity: .25; transform: translateY(-2px); } }
.gfc-network { padding: 8px 13px; color: #614000; background: #fff7d6; border-bottom: 1px solid #ecd995; font-size: 12px; line-height: 1.4; }
.gfc-network[hidden] { display: none; }
.gfc-error { display: none; padding: 8px 13px; color: #8b1230; background: #fff0f3; border-top: 1px solid #f7c9d3; font-size: 12px; }
.gfc-error.is-visible { display: block; }
.gfc-file-pill { display: none; min-height: 38px; margin: 7px 12px 0; padding: 6px 9px; align-items: center; gap: 7px; border-radius: 8px; color: #573277; background: #f2eafb; font-size: 11px; }
.gfc-file-pill.is-visible { display: flex; }
.gfc-file-pill > svg { width: 17px; height: 17px; flex: 0 0 auto; }
.gfc-file-pill span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gfc-file-remove { width: 32px; height: 32px; border: 0; color: inherit; background: none; cursor: pointer; font-size: 18px; }
.gfc-composer { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 7px; border-top: 1px solid #e4daf0; background: #fff; }
.gfc-attach { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 0; border-radius: 11px; color: #654080; background: #f1eafb; cursor: pointer; }
.gfc-attach svg { width: 17px; height: 17px; }
.gfc-input { flex: 1; min-width: 0; min-height: 44px; max-height: 104px; resize: none; padding: 11px 12px; border: 1px solid #d5c7e8; border-radius: 12px; outline: 0; color: #25103d; background: #fcfbfd; font: inherit; font-size: 13px; line-height: 1.45; }
.gfc-input:focus { border-color: #9b48ed; box-shadow: 0 0 0 2px rgba(155,72,237,.1); }
.gfc-send { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; border: 0; border-radius: 12px; color: #fff; background: #6f27ad; cursor: pointer; }
.gfc-send:disabled, .gfc-attach:disabled, .gfc-input:disabled { opacity: .5; cursor: not-allowed; }
.gfc-send svg { width: 17px; height: 17px; }
.gfc-newest { position: absolute; left: 50%; bottom: 72px; z-index: 2; transform: translateX(-50%); min-height: 40px; padding: 8px 14px; border: 1px solid #d5c7e8; border-radius: 999px; color: #532174; background: #fff; box-shadow: 0 5px 18px rgba(31,0,70,.16); font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
.gfc-newest[hidden] { display: none; }
.gfc-toast { position: absolute; right: 0; bottom: 70px; width: 290px; padding: 12px 14px; border: 1px solid #d7c8e9; border-radius: 13px; color: #2e154a; background: #fff; box-shadow: 0 12px 36px rgba(31,0,70,.18); font-size: 12px; line-height: 1.45; animation: gfc-open .18s ease; }
.gfc-toast[hidden] { display: none; }
.gfc-toast strong { display: block; margin-bottom: 2px; color: #5f1e98; font-size: 13px; }
.gfc-support-cta { display: inline-flex; margin-top: 9px; padding: 7px 10px; border-radius: 8px; color: #fff !important; background: #168b60; text-decoration: none !important; }
.gfc-list-head, .gfc-filters, .gfc-load-more, .gfc-thread-head,
.gfc-context, .gfc-network, .gfc-error, .gfc-file-pill, .gfc-composer {
  flex: 0 0 auto;
}
body.mp-drawer-open .gfc-stack { display: none; }
@media (max-width: 720px) {
  .gfc-stack { right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .gfc-panel { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; border: 0; border-radius: 0; animation: gfc-mobile-open .2s ease both; }
  @keyframes gfc-mobile-open { from { opacity: 0; transform: translateY(18px); } }
  .gfc-shell { display: block; height: 100%; }
  .gfc-list-pane, .gfc-thread-pane { width: 100%; height: 100%; border: 0; }
  .gfc-thread-pane { display: none; }
  .gfc-stack.gfc-mobile-thread .gfc-list-pane { display: none; }
  .gfc-stack.gfc-mobile-thread .gfc-thread-pane { display: flex; }
  .gfc-back { display: flex; }
  .gfc-list-head { padding-top: calc(17px + env(safe-area-inset-top)); }
  .gfc-thread-head { padding-top: calc(10px + env(safe-area-inset-top)); min-height: calc(68px + env(safe-area-inset-top)); }
  .gfc-close, .gfc-back, .gfc-head-action { width: 44px; height: 44px; }
  .gfc-search, .gfc-input { font-size: 16px; }
  .gfc-context { font-size: 12px; }
  .gfc-item { min-height: 84px; padding-left: 15px; padding-right: 15px; }
  .gfc-msgs { padding: 16px 12px; }
  .gfc-support-msg { max-width: 86%; font-size: 12px; }
  .gfc-toast { position: fixed; right: 14px; bottom: calc(154px + env(safe-area-inset-bottom)); width: min(300px, calc(100vw - 28px)); }
  .gfc-open > .gfc-fab { display: none; }
}
@media (min-width: 721px) and (max-width: 960px) {
  .gfc-stack { right: 16px; bottom: 16px; }
  .gfc-panel { width: calc(100vw - 32px); height: min(680px, calc(100vh - 104px)); }
  .gfc-shell { grid-template-columns: minmax(286px, 42%) minmax(0, 1fr); }
}
@media print { .gfc-stack { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .gfc-panel, .gfc-toast, .gfc-badge { animation: none !important; transition: none !important; } }
@media (forced-colors: active) { .gfc-fab, .gfc-send, .gfc-unread { forced-color-adjust: none; } }
