/* =========================================================
   SPOT CHAT — BUILD CONSOLIDADO

   O shell fechado usa o atributo nativo hidden.
   Mesmo antes de qualquer outra regra, fica fora da renderização.
   ========================================================= */

.spot-chat-shell[hidden]{
  display:none !important;
  visibility:hidden !important;
  opacity:0 !important;
  pointer-events:none !important;
}

/* =========================================================
   SPOT CHAT — LAYOUT TIPO TEAMS / KYVIA
   Mantém backend multiempresa já existente
   ========================================================= */

:root{
  --spot-chat-bg:#ffffff;
  --spot-chat-sidebar:#f5f5f6;
  --spot-chat-soft:#f0f0f2;
  --spot-chat-border:#e1e1e4;
  --spot-chat-text:#171717;
  --spot-chat-muted:#777b82;
  --spot-chat-accent:#171717;
}

html.spot-chat-lock,
body.spot-chat-lock{
  overflow:hidden !important;
}

.spot-chat-shell,
.spot-chat-shell *{
  box-sizing:border-box;
}

.spot-chat-backdrop{
  display:none !important;
}

.spot-chat-shell{
  position:fixed;
  inset:0;
  width:100vw;
  height:100dvh;
  background:var(--spot-chat-bg);
  display:grid;
  grid-template-columns:320px minmax(0,1fr);
  overflow:hidden;

  opacity:0;
  pointer-events:none;
  transform:translateY(10px);
  transition:opacity .18s ease,transform .2s ease;

  z-index:1000001;
  color:var(--spot-chat-text);
  font-family:inherit;
}

.spot-chat-shell.open{
  display:grid;
  opacity:1;
  pointer-events:auto;
  transform:none;
}

/* =========================
   SIDEBAR
   ========================= */

.spot-chat-list-pane{
  min-width:0;
  display:flex;
  flex-direction:column;
  background:var(--spot-chat-sidebar);
  border-right:1px solid var(--spot-chat-border);
}

.spot-chat-list-head{
  padding:18px 14px 12px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:10px;
}

.spot-chat-list-title{
  min-width:0;
}

.spot-chat-list-title h2{
  margin:0;
  font-size:22px;
  line-height:1.05;
  font-weight:800;
  letter-spacing:-.02em;
}

.spot-chat-company{
  display:block;
  margin-top:5px;
  font-size:9px;
  font-weight:800;
  color:#96999f;
  letter-spacing:.08em;
  text-transform:uppercase;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.spot-chat-sidebar-actions{
  display:flex;
  gap:4px;
  align-items:center;
}

.spot-chat-icon-btn{
  width:34px;
  height:34px;
  flex:0 0 34px;
  border:0;
  border-radius:9px;
  background:transparent;
  display:grid;
  place-items:center;
  cursor:pointer;
  color:#4f5258;
}

.spot-chat-icon-btn:hover{
  background:#e8e8ea;
}

.spot-chat-icon-btn svg{
  width:17px;
  height:17px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.spot-chat-filter-bar{
  padding:0 12px 10px;
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.spot-chat-filter{
  height:28px;
  padding:0 10px;
  border:1px solid #d8d8dc;
  border-radius:999px;
  background:#fafafa;
  color:#5f6269;
  font-size:9px;
  font-weight:700;
  cursor:pointer;
}

.spot-chat-filter.active{
  color:#171717;
  background:#fff;
  border-color:#cfd0d4;
}

.spot-chat-search-wrap{
  padding:0 12px 12px;
}

.spot-chat-search-box{
  position:relative;
}

.spot-chat-search-icon{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  width:15px;
  height:15px;
  color:#8d9096;
  pointer-events:none;
}

.spot-chat-search-icon svg{
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.spot-chat-search{
  width:100%;
  height:38px;
  border:1px solid #dcdde0;
  border-radius:10px;
  background:#fff;
  outline:none;
  padding:0 12px 0 36px;
  color:#171717;
  font:inherit;
  font-size:10px;
}

.spot-chat-search:focus{
  border-color:#b7b9be;
}

.spot-chat-section-title{
  padding:5px 14px 7px;
  color:#7c7f86;
  font-size:9px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.07em;
}

.spot-chat-users{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:0 8px 12px;
  scrollbar-width:none;
}

.spot-chat-users::-webkit-scrollbar,
.spot-chat-messages::-webkit-scrollbar{
  display:none;
}

.spot-chat-user{
  width:100%;
  min-height:60px;
  border:0;
  background:transparent;
  border-radius:8px;
  padding:8px 9px;
  display:flex;
  gap:10px;
  align-items:center;
  text-align:left;
  cursor:pointer;
  color:inherit;
  transition:background .12s ease;
}

.spot-chat-user:hover{
  background:#ebebed;
}

.spot-chat-user.active{
  background:#ffffff;
  box-shadow:0 0 0 1px rgba(0,0,0,.035);
}

.spot-chat-avatar{
  width:40px;
  height:40px;
  border-radius:10px;
  overflow:hidden;
  background:#dfe1e4;
  border:1px solid rgba(0,0,0,.08);
  box-sizing:border-box;
  flex:0 0 40px;
  display:grid;
  place-items:center;
  font-size:11px;
  font-weight:800;
  position:relative;
  color:#1a1a1a;
}

.spot-chat-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:inherit;
}

.spot-chat-online-dot{
  position:absolute;
  width:11px;
  height:11px;
  right:-1px;
  bottom:-1px;
  background:#28b96b;
  border:2px solid #fff;
  border-radius:50%;
}

.spot-chat-user-body{
  min-width:0;
  flex:1;
}

.spot-chat-user-row{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
}

.spot-chat-user-name{
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:11px;
  font-weight:800;
}

.spot-chat-user-time{
  flex:0 0 auto;
  font-size:8px;
  color:#91949a;
}

.spot-chat-preview{
  margin-top:4px;
  color:#7c7f85;
  font-size:9px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.spot-chat-unread{
  min-width:18px;
  height:18px;
  padding:0 5px;
  border-radius:999px;
  background:#171717;
  color: #8B8B8B;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:7px;
  font-weight:800;
}

.spot-chat-empty-users{
  padding:24px 16px;
  color:#8a8d93;
  font-size:10px;
  line-height:1.5;
  text-align:center;
}

/* =========================
   ÁREA PRINCIPAL
   ========================= */

.spot-chat-main-pane{
  min-width:0;
  display:flex;
  flex-direction:column;
  background:#fff;
}

.spot-chat-room-head{
  height:78px;
  flex:0 0 78px;
  padding:0 18px;
  border-bottom:1px solid var(--spot-chat-border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  background:#fff;
}

.spot-chat-room-left{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}

.spot-chat-room-user{
  min-width:0;
  display:flex;
  align-items:center;
  gap:10px;
}

.spot-chat-room-meta{
  min-width:0;
}

.spot-chat-room-name{
  display:block;
  font-size:14px;
  font-weight:800;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.spot-chat-room-status{
  display:block;
  margin-top:3px;
  font-size:9px;
  color:var(--spot-chat-muted);
}

.spot-chat-tabs{
  align-self:stretch;
  display:flex;
  align-items:flex-end;
  gap:18px;
  margin-left:8px;
}

.spot-chat-tab{
  height:100%;
  border:0;
  border-bottom:2px solid transparent;
  background:transparent;
  color:#686b72;
  padding:0 2px;
  font-size:10px;
  font-weight:700;
  cursor:default;
}

.spot-chat-tab.active{
  color:#171717;
  border-bottom-color:#171717;
}

.spot-chat-tab[disabled]{
  opacity:.55;
}

.spot-chat-room-actions{
  display:flex;
  align-items:center;
  gap:4px;
}

.spot-chat-mobile-back{
  display:none;
}

/* =========================
   MENSAGENS
   ========================= */

.spot-chat-messages{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:26px clamp(20px,4vw,72px) 20px;
  display:flex;
  flex-direction:column;
  gap:12px;
  background:#fff;
  scrollbar-width:none;
}

.spot-chat-welcome{
  margin:auto;
  width:100%;
  max-width:460px;
  min-height:320px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:32px;
  color:#171717;
}

.spot-chat-empty-visual{
  width:86px;
  height:86px;
  margin-bottom:22px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#f2f3f5;
  border:1px solid #dde0e4;
  color:#525a66;
  box-shadow:
    0 12px 30px rgba(0,0,0,.055),
    inset 0 1px 0 rgba(255,255,255,.9);
}

.spot-chat-empty-visual svg{
  width:44px;
  height:44px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.spot-chat-welcome h2{
  margin:0 0 8px;
  font-size:21px;
  line-height:1.15;
  font-weight:800;
  letter-spacing:-.025em;
  color:#171717;
}

.spot-chat-welcome p{
  margin:0;
  max-width:320px;
  font-size:11px;
  line-height:1.5;
  color:#7a7e85;
}

.spot-chat-message{
  width:100%;
  display:flex;
  align-items:flex-end;
  gap:8px;
}

.spot-chat-message.mine{
  justify-content:flex-end;
}

.spot-chat-message-avatar{
  width:30px;
  height:30px;
  flex:0 0 30px;
  border-radius:8px;
  overflow:hidden;
  background:#dfe1e4;
  border:1px solid rgba(0,0,0,.08);
  box-sizing:border-box;
  display:grid;
  place-items:center;
  font-size:8px;
  font-weight:800;
  color:#1a1a1a;
}

.spot-chat-message-avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:inherit;
}

.spot-chat-message-stack{
  max-width:min(72%,720px);
  display:flex;
  flex-direction:column;
  align-items:flex-start;
}

.spot-chat-message.mine .spot-chat-message-stack{
  align-items:flex-end;
}

.spot-chat-message-author{
  margin:0 0 4px 4px;
  color:#777a80;
  font-size:8px;
  font-weight:600;
}

.spot-chat-bubble{
  padding:9px 12px 7px;
  border-radius:10px;
  background:#f0f0f1;
  color:#202124;
  font-size:10px;
  line-height:1.45;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  box-shadow:0 1px 0 rgba(0,0,0,.025);
}

.spot-chat-message.mine .spot-chat-bubble{
  background:#171717;
  color: #8B8B8B;
}

.spot-chat-time{
  display:block;
  margin-top:4px;
  font-size:7px;
  opacity:.55;
  text-align:right;
}

/* =========================
   COMPOSER
   ========================= */

.spot-chat-compose-wrap{
  flex:0 0 auto;
  padding:10px clamp(14px,3vw,46px) 16px;
  background:#fff;
}

.spot-chat-compose{
  min-height:52px;
  border:1px solid #d9dade;
  border-radius:10px;
  display:flex;
  align-items:flex-end;
  gap:8px;
  padding:5px 7px 5px 12px;
  background:#fff;
}

.spot-chat-input{
  flex:1;
  min-width:0;
  min-height:39px;
  max-height:120px;
  resize:none;
  border:0;
  outline:none;
  padding:10px 0 8px;
  color:#171717;
  background:transparent;
  font:inherit;
  font-size:10px;
  line-height:1.4;
}

.spot-chat-compose-tools{
  display:flex;
  align-items:center;
  gap:2px;
  padding-bottom:2px;
}

.spot-chat-compose-tool{
  width:32px;
  height:32px;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#74777d;
  display:grid;
  place-items:center;
}

.spot-chat-compose-tool[disabled]{
  opacity:.35;
}

.spot-chat-compose-tool svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.spot-chat-send{
  width:36px;
  height:36px;
  flex:0 0 36px;
  border:0;
  border-radius:9px;
  background:#171717;
  color:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
}

.spot-chat-send:disabled{
  opacity:.4;
  cursor:not-allowed;
}

.spot-chat-send svg{
  width:16px;
  height:16px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

/* =========================
   BADGES / BOTÃO AVIÃO
   ========================= */

.spot-chat-launch-badge{
  position:absolute;
  top:-3px;
  right:-3px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:999px;
  background:#171717;
  color: #8B8B8B;
  border:2px solid #f0f1f2;
  align-items:center;
  justify-content:center;
  font-size:7px;
  font-weight:800;
  line-height:1;
  display:none;
}

.spot-chat-launch-badge.show{
  display:flex;
}

#spot-chat-open{
  position:relative;
}

.spot-chat-mobile-launcher{
  display:none !important;
}

/* =========================
   MOBILE
   ========================= */

@media(max-width:768px){
  .spot-chat-shell{
    grid-template-columns:1fr;
  }

  .spot-chat-shell.mobile-room .spot-chat-list-pane{
    display:none;
  }

  .spot-chat-shell:not(.mobile-room) .spot-chat-main-pane{
    display:none;
  }

  .spot-chat-list-pane{
    border-right:0;
  }

  .spot-chat-list-head{
    padding:16px 12px 10px;
  }

  .spot-chat-search-wrap{
    padding:0 10px 10px;
  }

  .spot-chat-filter-bar{
    padding:0 10px 9px;
  }

  .spot-chat-users{
    padding:0 6px 10px;
  }

  .spot-chat-room-head{
    height:68px;
    flex-basis:68px;
    padding:0 10px;
  }

  .spot-chat-mobile-back{
    display:grid;
  }

  .spot-chat-tabs{
    display:none;
  }

  .spot-chat-room-actions{
    display:none;
  }

  .spot-chat-messages{
    padding:16px 11px 12px;
  }

  .spot-chat-message-stack{
    max-width:84%;
  }

  .spot-chat-compose-wrap{
    padding:8px 9px 11px;
  }

  .spot-chat-compose-tool{
    display:none;
  }
}


/* =========================================================
   NOVA CONVERSA — ABRE SOMENTE PELO LÁPIS
   ========================================================= */

.spot-new-chat-overlay{
  position:absolute;
  inset:0;
  z-index:30;
  background:rgba(15,16,18,.30);
  backdrop-filter:blur(7px);
  -webkit-backdrop-filter:blur(7px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:26px;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}

.spot-new-chat-overlay.open{
  opacity:1;
  pointer-events:auto;
}

.spot-new-chat-modal{
  width:min(560px,calc(100vw - 36px));
  max-height:min(700px,calc(100dvh - 52px));
  background:linear-gradient(180deg,#fbfbfc 0%,#f4f5f7 100%);
  border:1px solid rgba(255,255,255,.75);
  border-radius:24px;
  box-shadow:0 32px 90px rgba(0,0,0,.18);
  overflow:hidden;
  display:flex;
  flex-direction:column;
  transform:translateY(12px) scale(.985);
  transition:transform .18s ease;
}

.spot-new-chat-overlay.open .spot-new-chat-modal{
  transform:none;
}

.spot-new-chat-head{
  padding:22px 22px 16px 24px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  border-bottom:1px solid rgba(17,17,17,.06);
  background:rgba(255,255,255,.5);
}

.spot-new-chat-head .spot-chat-icon-btn{
  width:42px;
  height:42px;
  border-radius:14px;
  background:#fff;
  border:1px solid #e6e7eb;
  box-shadow:0 8px 24px rgba(0,0,0,.05);
}

.spot-new-chat-title-box h3{
  margin:0;
  font-size:28px;
  line-height:1.08;
  font-weight:900;
  letter-spacing:-.03em;
  color:#111214;
}

.spot-new-chat-title-box span{
  display:block;
  margin-top:6px;
  font-size:12px;
  line-height:1.45;
  color:#767b85;
  max-width:360px;
}

.spot-new-chat-search-wrap{
  position:relative;
  padding:16px 18px 14px;
}

.spot-new-chat-search-icon{
  position:absolute;
  left:34px;
  top:50%;
  transform:translateY(-50%);
  width:18px;
  height:18px;
  display:grid;
  place-items:center;
  color:#7d838d;
  pointer-events:none;
  z-index:2;
}

.spot-new-chat-search-icon svg{
  width:18px;
  height:18px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.spot-new-chat-search-field{
  display:block;
  width:100%;
  height:54px;
  margin:0;
  padding:0 18px 0 46px;

  border:1px solid #d3d7de;
  border-radius:16px;
  outline:none;

  background:#fff;
  color:#171717;

  font:inherit;
  font-size:14px;
  line-height:normal;

  appearance:none;
  -webkit-appearance:none;

  box-shadow:0 8px 24px rgba(0,0,0,.035);

  transition:
    border-color .15s ease,
    box-shadow .15s ease;
}

.spot-new-chat-search-field::placeholder{
  color:#8a8f97;
  opacity:1;
}

.spot-new-chat-search-field:focus{
  border-color:#9ca2ac;
  box-shadow:0 0 0 3px rgba(17,17,17,.035);
}

.spot-new-chat-users{
  min-height:190px;
  overflow:auto;
  padding:4px 12px 16px;
  scrollbar-width:none;
}

.spot-new-chat-users::-webkit-scrollbar{
  display:none;
}

.spot-new-chat-user{
  width:100%;
  min-height:74px;
  border:1px solid #e6e7eb;
  border-radius:18px;
  background:rgba(255,255,255,.92);
  display:flex;
  align-items:center;
  gap:13px;
  padding:12px 14px;
  text-align:left;
  cursor:pointer;
  color:#171717;
  transition:transform .14s ease, box-shadow .14s ease, border-color .14s ease, background .14s ease;
}

.spot-new-chat-user + .spot-new-chat-user{
  margin-top:10px;
}

.spot-new-chat-user:hover{
  background:#fff;
  border-color:#d3d7df;
  transform:translateY(-1px);
  box-shadow:0 14px 28px rgba(0,0,0,.08);
}

.spot-new-chat-user .spot-chat-avatar{
  width:50px;
  height:50px;
  flex:0 0 50px;
  border-radius:13px;
  font-size:15px;
}

.spot-new-chat-user-info{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:4px;
  flex:1;
}

.spot-new-chat-user-info strong{
  font-size:14px;
  line-height:1.25;
  font-weight:800;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.spot-new-chat-user-info span{
  font-size:12px;
  line-height:1.35;
  color:#7b8088;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.spot-new-chat-user-action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:90px;
  height:34px;
  padding:0 12px;
  border-radius:999px;
  background:#111214;
  color: #8B8B8B;
  font-size:11px;
  font-weight:800;
  letter-spacing:.02em;
}

.spot-new-chat-empty{
  min-height:240px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:24px 18px 28px;
  color:#8c8f95;
}

.spot-new-chat-empty-icon{
  width:72px;
  height:72px;
  border-radius:22px;
  display:grid;
  place-items:center;
  background:linear-gradient(180deg,#ffffff 0%,#f1f3f6 100%);
  border:1px solid #e1e4e9;
  box-shadow:0 16px 36px rgba(0,0,0,.08);
  margin-bottom:16px;
}

.spot-new-chat-empty-icon svg{
  width:30px;
  height:30px;
  stroke:#5e6673;
  fill:none;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}

.spot-new-chat-empty strong{
  font-size:16px;
  font-weight:900;
  color:#191b20;
  line-height:1.25;
}

.spot-new-chat-empty span{
  max-width:320px;
  margin-top:8px;
  font-size:12px;
  line-height:1.55;
  color:#80858f;
}
@media(max-width:768px){
  .spot-new-chat-overlay{
    padding:10px;
    align-items:center;
  }

  .spot-new-chat-modal{
    width:100%;
    max-height:min(88dvh,700px);
    border-radius:22px;
  }

  .spot-new-chat-head{
    padding:18px 18px 14px;
  }

  .spot-new-chat-title-box h3{
    font-size:24px;
  }

  .spot-new-chat-title-box span{
    font-size:11px;
  }

  .spot-new-chat-users{
    flex:1;
    padding:4px 10px 14px;
  }

  .spot-new-chat-user{
    min-height:68px;
    border-radius:16px;
  }

  .spot-new-chat-user-action{
    min-width:78px;
    height:30px;
    font-size:10px;
  }
}


/* SEM CONVERSA SELECIONADA: estes elementos não podem aparecer */
#spot-chat-room-head[hidden],
#spot-chat-compose-wrap[hidden]{
  display:none !important;
}

.spot-chat-main-pane:not(.spot-chat-has-conversation)
.spot-chat-messages{
  padding-top:20px;
  padding-bottom:20px;
}

@media(max-width:768px){
  .spot-chat-welcome{
    min-height:260px;
    padding:24px 18px;
  }

  .spot-chat-empty-visual{
    width:72px;
    height:72px;
    margin-bottom:18px;
  }

  .spot-chat-empty-visual svg{
    width:36px;
    height:36px;
  }

  .spot-chat-welcome h2{
    font-size:18px;
  }

  .spot-chat-welcome p{
    font-size:10px;
  }
}


@media(max-width:768px){
  .spot-new-chat-search-wrap{
    padding:14px 14px 12px;
  }

  .spot-new-chat-search-icon{
    left:29px;
  }

  .spot-new-chat-search-field{
    height:50px;
    border-radius:14px;
    padding-left:43px;
    font-size:13px;
  }
}


/* =========================================================
   V17 — BUSCA DA NOVA CONVERSA
   Mantém o layout premium e corrige somente o ícone.
   ========================================================= */

.spot-new-chat-search-wrap{
  position:relative !important;
}

.spot-new-chat-search-icon{
  position:absolute !important;
  left:34px !important;
  top:50% !important;
  transform:translateY(-50%) !important;

  width:18px !important;
  height:18px !important;

  display:flex !important;
  align-items:center !important;
  justify-content:center !important;

  color:#7d838d !important;
  background:transparent !important;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;

  font-size:0 !important;
  line-height:0 !important;

  pointer-events:none !important;
  z-index:3 !important;
}

.spot-new-chat-search-icon::before,
.spot-new-chat-search-icon::after{
  content:none !important;
  display:none !important;
}

.spot-new-chat-search-icon svg{
  display:block !important;
  width:17px !important;
  height:17px !important;

  fill:none !important;
  stroke:currentColor !important;
  stroke-width:1.7 !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;

  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

.spot-new-chat-search-field{
  padding-left:46px !important;
}

@media(max-width:768px){
  .spot-new-chat-search-icon{
    left:29px !important;
  }

  .spot-new-chat-search-field{
    padding-left:43px !important;
  }
}


/* =========================================================
   V18 FINAL — NOVA CONVERSA PREMIUM
   Referência aprovada pelo usuário.
   ========================================================= */

.spot-new-chat-overlay{
  position:absolute !important;
  inset:0 !important;
  z-index:80 !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding:26px !important;
  background:rgba(21,22,24,.30) !important;
  backdrop-filter:blur(8px) !important;
  -webkit-backdrop-filter:blur(8px) !important;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease !important;
}

.spot-new-chat-overlay.open{
  opacity:1 !important;
  pointer-events:auto !important;
}

.spot-new-chat-modal{
  width:min(560px,calc(100vw - 36px)) !important;
  min-height:438px !important;
  max-height:min(700px,calc(100dvh - 52px)) !important;
  display:flex !important;
  flex-direction:column !important;
  overflow:hidden !important;
  background:linear-gradient(180deg,#fbfbfc 0%,#f4f5f7 100%) !important;
  border:1px solid rgba(255,255,255,.82) !important;
  border-radius:24px !important;
  box-shadow:0 32px 90px rgba(0,0,0,.18) !important;
  transform:translateY(10px) scale(.986);
  transition:transform .18s ease !important;
}

.spot-new-chat-overlay.open .spot-new-chat-modal{
  transform:none !important;
}

.spot-new-chat-head{
  flex:0 0 auto !important;
  min-height:92px !important;
  padding:22px 22px 16px 24px !important;
  display:flex !important;
  align-items:flex-start !important;
  justify-content:space-between !important;
  gap:16px !important;
  background:rgba(255,255,255,.58) !important;
  border-bottom:1px solid rgba(17,17,17,.065) !important;
}

.spot-new-chat-title-box h3{
  margin:0 !important;
  color:#111214 !important;
  font-size:28px !important;
  line-height:1.08 !important;
  font-weight:900 !important;
  letter-spacing:-.035em !important;
}

.spot-new-chat-title-box span{
  display:block !important;
  max-width:390px !important;
  margin-top:7px !important;
  color:#7b8088 !important;
  font-size:12px !important;
  line-height:1.45 !important;
}

.spot-new-chat-head .spot-chat-icon-btn{
  width:42px !important;
  height:42px !important;
  flex:0 0 42px !important;
  display:grid !important;
  place-items:center !important;
  border:1px solid #e2e5e9 !important;
  border-radius:14px !important;
  background:#fff !important;
  color:#555c66 !important;
  box-shadow:0 8px 24px rgba(0,0,0,.045) !important;
}

.spot-new-chat-head .spot-chat-icon-btn svg{
  width:17px !important;
  height:17px !important;
}

.spot-new-chat-search-wrap{
  position:relative !important;
  flex:0 0 auto !important;
  padding:16px 18px 14px !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

.spot-new-chat-search-icon{
  position:absolute !important;
  left:34px !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  z-index:3 !important;
  width:18px !important;
  height:18px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  color:#7d838d !important;
  background:transparent !important;
  border:0 !important;
  outline:0 !important;
  box-shadow:none !important;
  pointer-events:none !important;
  font-size:0 !important;
  line-height:0 !important;
}

.spot-new-chat-search-icon::before,
.spot-new-chat-search-icon::after{
  content:none !important;
  display:none !important;
}

.spot-new-chat-search-icon svg{
  display:block !important;
  width:17px !important;
  height:17px !important;
  fill:none !important;
  stroke:currentColor !important;
  stroke-width:1.7 !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
  background:transparent !important;
  border:0 !important;
  box-shadow:none !important;
}

.spot-new-chat-search-field{
  display:block !important;
  width:100% !important;
  height:54px !important;
  margin:0 !important;
  padding:0 18px 0 46px !important;
  border:1px solid #d3d7de !important;
  border-radius:16px !important;
  outline:0 !important;
  background:#fff !important;
  color:#171717 !important;
  font:inherit !important;
  font-size:14px !important;
  line-height:normal !important;
  appearance:none !important;
  -webkit-appearance:none !important;
  box-shadow:0 8px 24px rgba(0,0,0,.035) !important;
}

.spot-new-chat-search-field::placeholder{
  color:#8a8f97 !important;
  opacity:1 !important;
}

.spot-new-chat-search-field:focus{
  border-color:#9da3ad !important;
  box-shadow:0 0 0 3px rgba(17,17,17,.035) !important;
}

.spot-new-chat-users{
  flex:1 1 auto !important;
  min-height:240px !important;
  overflow:auto !important;
  padding:4px 12px 18px !important;
  scrollbar-width:none !important;
}

.spot-new-chat-users::-webkit-scrollbar{
  display:none !important;
}

.spot-new-chat-empty{
  min-height:240px !important;
  height:100% !important;
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  justify-content:center !important;
  text-align:center !important;
  padding:22px 18px 28px !important;
}

.spot-new-chat-empty-icon{
  width:72px !important;
  height:72px !important;
  flex:0 0 72px !important;
  display:grid !important;
  place-items:center !important;
  margin:0 0 16px !important;
  border:1px solid #e1e4e9 !important;
  border-radius:22px !important;
  background:linear-gradient(180deg,#fff 0%,#f1f3f6 100%) !important;
  color:#5e6673 !important;
  box-shadow:0 16px 36px rgba(0,0,0,.08) !important;
}

.spot-new-chat-empty-icon svg{
  width:30px !important;
  height:30px !important;
  fill:none !important;
  stroke:currentColor !important;
  stroke-width:1.9 !important;
  stroke-linecap:round !important;
  stroke-linejoin:round !important;
}

.spot-new-chat-empty strong{
  margin:0 !important;
  color:#191b20 !important;
  font-size:16px !important;
  line-height:1.25 !important;
  font-weight:900 !important;
}

.spot-new-chat-empty span{
  max-width:330px !important;
  margin:8px 0 0 !important;
  color:#80858f !important;
  font-size:12px !important;
  line-height:1.55 !important;
}

.spot-new-chat-user{
  width:100% !important;
  min-height:74px !important;
  display:flex !important;
  align-items:center !important;
  gap:13px !important;
  padding:12px 14px !important;
  border:1px solid #e6e7eb !important;
  border-radius:18px !important;
  background:rgba(255,255,255,.94) !important;
  color:#171717 !important;
  text-align:left !important;
  cursor:pointer !important;
}

.spot-new-chat-user + .spot-new-chat-user{
  margin-top:10px !important;
}

.spot-new-chat-user-action{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-width:90px !important;
  height:34px !important;
  padding:0 12px !important;
  border-radius:999px !important;
  background:#111214 !important;
  color: #8B8B8B !important;
  font-size:11px !important;
  font-weight:800 !important;
}

@media(max-width:768px){
  .spot-new-chat-overlay{
    padding:10px !important;
  }

  .spot-new-chat-modal{
    width:100% !important;
    min-height:430px !important;
    max-height:min(88dvh,700px) !important;
    border-radius:22px !important;
  }

  .spot-new-chat-head{
    min-height:84px !important;
    padding:18px 18px 14px !important;
  }

  .spot-new-chat-title-box h3{
    font-size:24px !important;
  }

  .spot-new-chat-title-box span{
    font-size:11px !important;
  }

  .spot-new-chat-search-wrap{
    padding:14px 14px 12px !important;
  }

  .spot-new-chat-search-icon{
    left:29px !important;
  }

  .spot-new-chat-search-field{
    height:50px !important;
    padding-left:43px !important;
    border-radius:14px !important;
    font-size:13px !important;
  }
}


/* Chat integrado à mesma área dos módulos. */
.main-wrapper > #spot-chat-shell {
  grid-area: 2 / 1;
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
  min-width: 0;
  max-height: none;
  transform: none !important;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 1;
  --spot-chat-bg: #EEF0F1;
  --spot-chat-sidebar: #EEF0F1;
}
.main-wrapper:has(> #spot-chat-shell.open:not([hidden])) > .content-area {
  visibility: hidden;
  pointer-events: none;
}
.main-wrapper > #spot-chat-shell .spot-chat-main-pane { background: #EEF0F1; }
.main-wrapper > #spot-chat-shell .spot-chat-icon-btn[data-spot-back-to-system="1"] { display:none; }
body:has(#spot-chat-shell.open:not([hidden])) > .fullscreen-prompt { display:none !important; }
@media (min-width:769px) {
  .main-wrapper:has(> #spot-chat-shell.open:not([hidden])) > .header > .spot-module-navigation {
    display:flex; position:absolute; left:12px; top:40px; height:38px; align-items:center; padding:0; z-index:2;
  }
}
@media (max-width:768px) {
  .main-wrapper:has(> #spot-chat-shell.open:not([hidden])) > .header > .spot-module-navigation {
    display:flex; grid-row:2; position:static; align-items:center;
  }
}

/* O Chat usa apenas a área disponível abaixo do cabeçalho. */
@media (max-width:768px) {
  .main-wrapper > #spot-chat-shell {
    grid-template-rows:minmax(0,1fr);
    min-height:0 !important;
    z-index:1 !important;
  }
  .main-wrapper > #spot-chat-shell .spot-chat-list-pane,
  .main-wrapper > #spot-chat-shell .spot-chat-main-pane {
    height:100% !important;
    min-height:0 !important;
    max-height:100%;
    overflow:hidden;
  }
  .main-wrapper > #spot-chat-shell .spot-chat-users,
  .main-wrapper > #spot-chat-shell .spot-chat-messages {
    min-height:0;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
}
