.opera-floating-chat {
  position: fixed;
  right: 24px;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 9990;
  font-family: "DM Sans", sans-serif;
  color: #1e293b;
}

.opera-floating-chat * {
  box-sizing: border-box;
}

.opera-floating-chat__launcher {
  position: relative;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 18px;
  background: #123c3d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .28);
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.opera-floating-chat__launcher:hover,
.opera-floating-chat__launcher:focus-visible {
  background: #15636f;
  transform: translateY(-1px);
  box-shadow: 0 20px 48px rgba(15, 23, 42, .32);
  outline: none;
}

.opera-floating-chat__launcher.has-new {
  animation: opera-floating-chat-pulse 1.1s ease-in-out 2;
}

.opera-floating-chat__badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  border: 2px solid #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  display: none;
}

.opera-floating-chat__status {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #94a3b8;
  border: 2px solid #fff;
}

.opera-floating-chat__status.is-online {
  background: #22c55e;
}

.opera-floating-chat__panel {
  width: 380px;
  height: min(640px, calc(100vh - 110px));
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .26);
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.opera-floating-chat.is-open .opera-floating-chat__launcher {
  display: none;
}

.opera-floating-chat.is-open .opera-floating-chat__panel {
  display: flex;
}

.opera-floating-chat__header {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}

.opera-floating-chat__title {
  min-width: 0;
}

.opera-floating-chat__title strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

.opera-floating-chat__title span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
}

.opera-floating-chat__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.opera-floating-chat__icon-btn {
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.opera-floating-chat__icon-btn:hover,
.opera-floating-chat__icon-btn:focus-visible {
  border-color: #cbd5e1;
  background: #fff;
  outline: none;
}

.opera-floating-chat__search {
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.opera-floating-chat__search input {
  width: 100%;
  height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
}

.opera-floating-chat__search input:focus {
  border-color: #1e88c7;
  box-shadow: 0 0 0 3px rgba(30, 136, 199, .12);
}

.opera-floating-chat__body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #f8fafc;
}

.opera-floating-chat__quick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
}

.opera-floating-chat__quick button {
  min-height: 38px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.opera-floating-chat__quick button:hover,
.opera-floating-chat__quick button:focus-visible {
  border-color: #1e88c7;
  color: #15636f;
  outline: none;
}

.opera-floating-chat__content {
  min-height: 0;
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr);
}

.opera-floating-chat__list {
  min-height: 0;
  overflow-y: auto;
  border-right: 1px solid #e2e8f0;
  background: #fff;
}

.opera-floating-chat__conversation {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  text-align: left;
  padding: 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  cursor: pointer;
}

.opera-floating-chat__conversation:hover,
.opera-floating-chat__conversation.is-active {
  background: #f1f5f9;
}

.opera-floating-chat__avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.opera-floating-chat__conversation strong,
.opera-floating-chat__conversation span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opera-floating-chat__conversation strong {
  font-size: 12px;
  color: #1e293b;
}

.opera-floating-chat__conversation span {
  margin-top: 3px;
  font-size: 11px;
  color: #64748b;
}

.opera-floating-chat__conversation small {
  display: inline-flex;
  margin-top: 5px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
}

.opera-floating-chat__main {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.opera-floating-chat__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  background: #f8fafc;
}

.opera-floating-chat__message {
  display: flex;
  margin-top: 8px;
}

.opera-floating-chat__message.is-mine {
  justify-content: flex-end;
}

.opera-floating-chat__bubble {
  max-width: 82%;
  border: 1px solid #e2e8f0;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.opera-floating-chat__message.is-mine .opera-floating-chat__bubble {
  border-color: #123c3d;
  border-radius: 16px 16px 4px 16px;
  background: #123c3d;
  color: #fff;
}

.opera-floating-chat__meta {
  margin-top: 5px;
  font-size: 10px;
  color: #94a3b8;
  text-align: right;
}

.opera-floating-chat__message.is-mine .opera-floating-chat__meta {
  color: rgba(255, 255, 255, .72);
}

.opera-floating-chat__composer {
  border-top: 1px solid #e2e8f0;
  background: #fff;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: end;
}

.opera-floating-chat__composer textarea {
  min-height: 38px;
  max-height: 104px;
  resize: none;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 9px 10px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.opera-floating-chat__composer textarea:focus {
  border-color: #1e88c7;
  box-shadow: 0 0 0 3px rgba(30, 136, 199, .12);
}

.opera-floating-chat__send {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 12px;
  background: #123c3d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.opera-floating-chat__send:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.opera-floating-chat__notice {
  min-height: 100%;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

.opera-floating-chat__toast {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: 260px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, .2);
  padding: 10px 12px;
  display: none;
  font-size: 12px;
}

.opera-floating-chat__toast.is-visible {
  display: block;
}

body.dark .opera-floating-chat__panel,
.dark .opera-floating-chat__panel {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

body.dark .opera-floating-chat__header,
body.dark .opera-floating-chat__search,
body.dark .opera-floating-chat__quick,
body.dark .opera-floating-chat__composer,
.dark .opera-floating-chat__header,
.dark .opera-floating-chat__search,
.dark .opera-floating-chat__quick,
.dark .opera-floating-chat__composer {
  background: #111827;
  border-color: #334155;
}

body.dark .opera-floating-chat__body,
body.dark .opera-floating-chat__messages,
.dark .opera-floating-chat__body,
.dark .opera-floating-chat__messages {
  background: #0f172a;
}

body.dark .opera-floating-chat__title strong,
.dark .opera-floating-chat__title strong {
  color: #f8fafc;
}

body.dark .opera-floating-chat__list,
body.dark .opera-floating-chat__quick button,
body.dark .opera-floating-chat__search input,
body.dark .opera-floating-chat__composer textarea,
body.dark .opera-floating-chat__bubble,
.dark .opera-floating-chat__list,
.dark .opera-floating-chat__quick button,
.dark .opera-floating-chat__search input,
.dark .opera-floating-chat__composer textarea,
.dark .opera-floating-chat__bubble {
  background: #111827;
  border-color: #334155;
  color: #e2e8f0;
}

@keyframes opera-floating-chat-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@media (max-width: 640px) {
  .opera-floating-chat {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .opera-floating-chat__panel {
    width: calc(100vw - 24px);
    height: calc(100dvh - 40px);
    border-radius: 16px;
  }

  .opera-floating-chat__content {
    grid-template-columns: 118px minmax(0, 1fr);
  }

  .opera-floating-chat__quick {
    grid-template-columns: 1fr;
  }
}

/* OPERA FLOATING CHAT UX COMPACTO 20260721 */

.opera-floating-chat__panel {
  width: 460px;
  height: min(640px, calc(100vh - 96px));
}

.opera-floating-chat__header {
  min-height: 52px;
  padding: 10px 12px;
}

.opera-floating-chat__title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.opera-floating-chat__title strong {
  display: block;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
}

.opera-floating-chat__connection-pill {
  min-height: 20px;
  margin: 0 !important;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  display: inline-flex !important;
  align-items: center;
  gap: 5px;
  font-size: 11px !important;
  line-height: 16px;
  white-space: nowrap;
}

.opera-floating-chat__connection-pill.is-online {
  background: #dcfce7;
  color: #166534;
}

.opera-floating-chat__connection-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #94a3b8;
  flex: 0 0 auto;
}

.opera-floating-chat__connection-pill.is-online
.opera-floating-chat__connection-dot {
  background: #22c55e;
}

.opera-floating-chat__actions {
  gap: 3px;
}

.opera-floating-chat__icon-btn,
.opera-floating-chat__composer-button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: 0 0 auto;
}

.opera-floating-chat__icon-btn:hover,
.opera-floating-chat__icon-btn:focus-visible,
.opera-floating-chat__composer-button:hover,
.opera-floating-chat__composer-button:focus-visible {
  border: 0;
  background: #e2e8f0;
  color: #0f172a;
  outline: none;
}

.opera-floating-chat__new-button {
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: #123c3d;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.opera-floating-chat__new-button:hover,
.opera-floating-chat__new-button:focus-visible {
  background: #15636f;
  outline: none;
}

.opera-floating-chat__search {
  padding: 8px 10px 7px;
}

.opera-floating-chat__search input {
  height: 34px;
  border-radius: 10px;
  padding: 0 11px;
  font-size: 12px;
}

.opera-floating-chat__filters {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.opera-floating-chat__filters::-webkit-scrollbar {
  display: none;
}

.opera-floating-chat__filters button {
  min-height: 26px;
  padding: 4px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  white-space: nowrap;
  cursor: pointer;
}

.opera-floating-chat__filters button.is-active {
  border-color: #123c3d;
  background: #123c3d;
  color: #fff;
}

.opera-floating-chat__filter-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
}

.opera-floating-chat__filter-count[hidden] {
  display: none;
}

.opera-floating-chat__body {
  grid-template-rows: minmax(0, 1fr);
}

.opera-floating-chat__content {
  grid-template-columns: 156px minmax(0, 1fr);
}

.opera-floating-chat__conversation {
  position: relative;
  min-height: 60px;
  padding: 9px 8px;
  align-items: start;
}

.opera-floating-chat__conversation.is-active {
  background: #eef6f6;
  box-shadow: inset 3px 0 0 #15636f;
}

.opera-floating-chat__avatar-wrap {
  position: relative;
  width: 30px;
  height: 30px;
}

.opera-floating-chat__avatar {
  background: var(--ofc-avatar-color, #15636f);
  color: #fff;
}

.opera-floating-chat__avatar--header {
  width: 26px;
  height: 26px;
  font-size: 9px;
  flex: 0 0 auto;
}

.opera-floating-chat__conversation-unread {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  margin: 0;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
}

.opera-floating-chat__conversation-copy {
  min-width: 0;
}

.opera-floating-chat__conversation-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.opera-floating-chat__conversation-line strong {
  flex: 1;
  min-width: 0;
}

.opera-floating-chat__conversation-line time {
  flex: 0 0 auto;
  color: #94a3b8;
  font-size: 9px;
}

.opera-floating-chat__preview {
  display: block;
  max-width: 100%;
  margin-top: 4px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opera-floating-chat__conversation-header {
  min-height: 48px;
  padding: 9px 11px;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.opera-floating-chat__conversation-header[hidden] {
  display: none;
}

.opera-floating-chat__conversation-heading {
  min-width: 0;
}

.opera-floating-chat__conversation-heading strong,
.opera-floating-chat__conversation-heading span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.opera-floating-chat__conversation-heading strong {
  color: #1e293b;
  font-size: 12px;
}

.opera-floating-chat__conversation-heading span {
  margin-top: 2px;
  color: #64748b;
  font-size: 10px;
}

.opera-floating-chat__messages {
  padding: 10px;
}

.opera-floating-chat__bubble {
  max-width: 84%;
  padding: 7px 9px;
  border-radius: 14px 14px 14px 4px;
  font-size: 12px;
}

.opera-floating-chat__message.is-mine
.opera-floating-chat__bubble {
  border-radius: 14px 14px 4px 14px;
}

.opera-floating-chat__skeleton {
  min-height: 100%;
}

.opera-floating-chat__skeleton-bubble {
  width: 54%;
  height: 42px;
  margin-top: 12px;
  border-radius: 14px 14px 14px 4px;
  background: linear-gradient(
    90deg,
    #e2e8f0 25%,
    #f1f5f9 38%,
    #e2e8f0 63%
  );
  background-size: 400% 100%;
  animation: opera-floating-chat-skeleton 1.25s ease infinite;
}

.opera-floating-chat__skeleton-bubble.is-right {
  margin-left: auto;
  border-radius: 14px 14px 4px 14px;
}

.opera-floating-chat__skeleton-bubble.is-wide {
  width: 70%;
}

.opera-floating-chat__composer {
  padding: 8px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
}

.opera-floating-chat__composer-button {
  width: 34px;
  height: 34px;
}

.opera-floating-chat__composer textarea {
  flex: 1;
  min-width: 0;
  min-height: 34px;
  height: 34px;
  max-height: 104px;
  padding: 7px 10px;
  border-radius: 10px;
  line-height: 18px;
  overflow-y: auto;
}

.opera-floating-chat__composer textarea::placeholder {
  white-space: nowrap;
}

.opera-floating-chat__send {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: 0 0 auto;
}

.opera-floating-chat__inbox-link {
  min-height: 25px;
  border: 0;
  border-top: 1px solid #f1f5f9;
  background: #fff;
  color: #64748b;
  font-size: 10px;
  cursor: pointer;
}

.opera-floating-chat__inbox-link:hover {
  color: #15636f;
  background: #f8fafc;
}

@keyframes opera-floating-chat-skeleton {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: 0 0;
  }
}

@media (max-width: 640px) {
  .opera-floating-chat__content {
    grid-template-columns: 126px minmax(0, 1fr);
  }

  .opera-floating-chat__new-button span {
    display: none;
  }

  .opera-floating-chat__new-button {
    width: 28px;
    padding: 0;
  }
}
