/*
 * Brasil Wap — Messenger (mobile)
 * Layout mobile em todas as larguras. Sem sidebar/desktop.
 * CSS escopado em .msgr. Não altera o topo, o rodapé nem as cores do site.
 * Compatível com Android 7 / iOS 12 (flexbox + margens, sem gap/grid).
 */

.msgr {
  --msgr-blue: #005e89;
  --msgr-blue-strong: #0b63a5;
  --msgr-ink: #111827;
  --msgr-muted: #5b6b73;
  --msgr-line: #d7e7ec;
  --msgr-line-soft: #edf4f6;
  --msgr-surface: #ffffff;
  --msgr-surface-2: #f7fbfc;
  --msgr-soft: #eaf6ff;
  --msgr-danger: #d92d20;
  --msgr-danger-bg: #fff5f4;
  --msgr-brand: linear-gradient(60deg, #64b3f4 0%, #c2e59c 100%);
  --msgr-radius: 14px;
  --msgr-radius-sm: 10px;
  --msgr-shadow: 0 1px 2px rgba(0, 40, 60, 0.06), 0 8px 24px rgba(0, 40, 60, 0.07);
  display: block;
  max-width: 1032px;
  margin: 0 auto 18px;
  color: var(--msgr-ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

.msgr *,
.msgr *::before,
.msgr *::after {
  box-sizing: border-box;
}

.msgr a {
  text-decoration: none;
}

.msgr a:hover {
  text-decoration: none;
  text-shadow: none;
}

.msgr i {
  line-height: 1;
}

.msgr img {
  max-width: 100%;
}

.msgr a:focus,
.msgr summary:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* Ações principais e filtros (sempre no topo, como no mobile) */
.msgr-mobile-tools {
  display: block;
  margin-bottom: 10px;
  padding: 10px;
  background: var(--msgr-surface);
  border: 1px solid var(--msgr-line);
  border-radius: var(--msgr-radius);
  box-shadow: var(--msgr-shadow);
}

.msgr-mobile-row {
  display: flex;
  align-items: center;
}

.msgr-mobile-row > .msgr-btn {
  flex: 1;
  width: auto;
  min-height: 38px;
}

.msgr-more {
  position: relative;
  flex: none;
  margin-left: 8px;
}

.msgr-more-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--msgr-line);
  border-radius: 9px;
  background: #fff;
  color: var(--msgr-blue);
  cursor: pointer;
  list-style: none;
}

.msgr-more-btn::-webkit-details-marker {
  display: none;
}

.msgr-more-btn:hover {
  background: #f6fbff;
}

.msgr-more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 210px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--msgr-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 40, 60, 0.18);
}

.msgr-more-menu a,
.msgr-more-menu a:visited {
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--msgr-ink);
  font-size: 13px;
  font-weight: 700;
}

.msgr-more-menu a:hover,
.msgr-more-menu a:active {
  background: var(--msgr-surface-2);
  color: var(--msgr-ink);
  font-weight: 700;
}

.msgr-more-menu a.is-danger,
.msgr-more-menu a.is-danger:visited {
  color: var(--msgr-danger);
}

.msgr-more-menu a.is-danger:hover,
.msgr-more-menu a.is-danger:active {
  background: var(--msgr-danger-bg);
  color: var(--msgr-danger);
}

.msgr-more-menu i {
  width: 16px;
  margin-right: 9px;
  text-align: center;
}

.msgr-tabs {
  display: flex;
  overflow-x: auto;
  padding: 10px 0 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.msgr-tabs::-webkit-scrollbar {
  display: none;
}

.msgr-tab,
.msgr-tab:visited {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 32px;
  margin-right: 6px;
  padding: 0 11px;
  border: 1px solid var(--msgr-line);
  border-radius: 999px;
  background: #fff;
  color: var(--msgr-muted);
  font-size: 12px;
  font-weight: 700;
}

.msgr-tab:last-child {
  margin-right: 0;
}

.msgr-tab:hover,
.msgr-tab:active {
  color: var(--msgr-muted);
  font-weight: 700;
}

.msgr-tab.is-active,
.msgr-tab.is-active:visited {
  background: var(--msgr-soft);
  border-color: #bfe0ff;
  color: var(--msgr-blue-strong);
}

.msgr-tab .msgr-count {
  margin-left: 5px;
}

.msgr-count {
  display: inline-block;
  min-width: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #eef4f6;
  color: var(--msgr-muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.msgr-tab.is-active .msgr-count {
  background: #d6edff;
  color: var(--msgr-blue-strong);
}

.msgr-count-alert {
  background: #fff0ef;
  color: var(--msgr-danger);
}

/* Botões */
.msgr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: var(--msgr-radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.msgr-btn i {
  width: 16px;
  margin-right: 8px;
  text-align: center;
}

.msgr-btn-primary,
.msgr-btn-primary:visited {
  background: var(--msgr-brand);
  border-color: rgba(0, 94, 137, 0.18);
  box-shadow: 0 2px 8px rgba(0, 94, 137, 0.18);
  color: #063344;
}

.msgr-btn-primary:hover,
.msgr-btn-primary:active {
  color: #063344;
  filter: brightness(0.98);
  font-weight: 800;
}

/* Caixa de entrada */
.msgr-inbox {
  display: block;
  width: auto;
  min-width: 0;
  overflow: hidden;
  background: var(--msgr-surface);
  border: 1px solid var(--msgr-line);
  border-radius: var(--msgr-radius);
  box-shadow: var(--msgr-shadow);
}

.msgr-head {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  border-bottom: 1px solid var(--msgr-line);
  background: linear-gradient(180deg, #ffffff, #f8fcfd);
}

.msgr-head-text {
  flex: 1;
  min-width: 0;
}

.msgr-title {
  margin: 0;
  color: var(--msgr-blue);
  font-family: "Luckiest Guy", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 21px;
  font-weight: 400;
  letter-spacing: 0.2px;
  line-height: 1.1;
}

.msgr-summary {
  margin: 2px 0 0;
  color: var(--msgr-muted);
  font-size: 12px;
  line-height: 1.35;
}

.msgr-dot-sep {
  margin: 0 4px;
}

.msgr-refresh,
.msgr-refresh:visited {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: 12px;
  border: 1px solid var(--msgr-line);
  border-radius: 9px;
  background: #fff;
  color: var(--msgr-blue);
}

.msgr-refresh:hover,
.msgr-refresh:active {
  background: #f6fbff;
  color: var(--msgr-blue-strong);
}

.msgr-refresh i {
  font-size: 15px;
}

/* Lista de conversas */
.msgr-list {
  display: block;
  min-width: 0;
}

.msgr-msg,
.msgr-msg:visited {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 12px 10px;
  border-bottom: 1px solid var(--msgr-line-soft);
  color: var(--msgr-ink);
  font-weight: 400;
}

.msgr-msg:last-child {
  border-bottom: 0;
}

.msgr-msg:hover,
.msgr-msg:active {
  background: #f8fcfd;
  color: var(--msgr-ink);
  font-weight: 400;
}

.msgr-msg.is-unread {
  background: #f2fbff;
}

.msgr-msg.is-unread:hover,
.msgr-msg.is-unread:active {
  background: #eaf7ff;
}

.msgr-msg.is-unread::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #64b3f4;
}

.msgr-avatar {
  display: block;
  flex: none;
  width: 40px;
  height: 40px;
  margin-right: 11px;
}

.msgr-avatar img {
  display: block;
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 7px rgba(0, 40, 60, 0.16);
  object-fit: cover;
}

.msgr-avatar img.is-online {
  border-color: #00cd00;
  box-shadow: 0 0 0 2px #fff, 0 2px 7px rgba(0, 40, 60, 0.16);
  animation: none;
}

.msgr-msg-body {
  display: block;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.msgr-msg-top {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.msgr-name {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msgr-name > span {
  font-size: 13px !important;
}

.msgr-name img {
  vertical-align: -3px;
}

.msgr-preview {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--msgr-muted);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msgr-msg.is-unread .msgr-preview {
  color: #374b54;
  font-weight: 600;
}

.msgr-msg.is-unread:hover .msgr-preview {
  font-weight: 600;
}

.msgr-you {
  color: var(--msgr-blue);
  font-weight: 800;
}

.msgr-preview img {
  width: 16px !important;
  height: 16px !important;
  border-radius: 3px;
  vertical-align: -3px;
}

.msgr-preview .titulo {
  display: none !important;
}

.msgr-preview .tituloWrapper {
  display: inline;
}

.msgr-msg-meta {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-end;
  min-width: 34px;
  margin-left: 11px;
}

.msgr-msg-meta .msgr-state,
.msgr-msg-meta .msgr-dot {
  margin-top: 5px;
}

.msgr-time {
  color: var(--msgr-muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.msgr-state {
  color: var(--msgr-muted);
  font-size: 11px;
}

.msgr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64b3f4;
  box-shadow: 0 0 0 3px #dff3ff;
}

/* Carregar mais */
.msgr-loadmore {
  padding: 14px 16px;
  border-top: 1px solid var(--msgr-line);
  background: #fbfdfe;
  text-align: center;
}

.msgr-loadmore a,
.msgr-loadmore a:visited {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--msgr-line);
  border-radius: 9px;
  background: #fff;
  color: var(--msgr-blue);
  font-size: 12px;
  font-weight: 800;
}

.msgr-loadmore a i {
  margin-right: 7px;
}

.msgr-loadmore a:hover,
.msgr-loadmore a:active {
  background: #f6fbff;
  color: var(--msgr-blue-strong);
  font-weight: 800;
}

/* Estado vazio */
.msgr-empty {
  padding: 38px 20px 42px;
  color: var(--msgr-muted);
  text-align: center;
}

.msgr-empty > i {
  display: block;
  margin-bottom: 10px;
  color: #9fc9dd;
  font-size: 34px;
}

.msgr-empty b {
  display: block;
  margin-bottom: 4px;
  color: var(--msgr-ink);
  font-size: 15px;
}

.msgr-empty span {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
}

.msgr-empty .msgr-btn {
  display: inline-flex;
  width: auto;
  padding: 0 16px;
}

@media (max-width: 620px) {
  .msgr-summary {
    font-size: 11px;
  }

  .msgr-empty {
    padding: 30px 16px 34px;
  }
}
