/* Internal Chat - Light liquid-glass style */
:root {
  --glass-bg: rgba(250, 252, 253, 0.78);
  --glass-border: rgba(255, 255, 255, 0.9);
  --glass-contrast: rgba(2, 18, 20, 0.04);
  --accent: #01454F;
  /* brand base */
  --muted: #6c7b7b;
  --text: #0f2b2c;
}

body.internal-chat-page {
  background: linear-gradient(135deg, #fbfeff 0%, #f3fbfb 100%);
  color: var(--text);
}

body.internal-chat-page main {
  padding-left: 0 !important;
  transition: none !important;
}

@media (min-width: 901px) {
  body.internal-chat-page.sidebar-open > main {
    padding-left: var(--sidebar-width-open) !important;
  }

  body.internal-chat-page.sidebar-closed > main {
    padding-left: var(--sidebar-width-closed) !important;
  }

  body.internal-chat-page.sidebar-closed .sidebar-main:hover + main {
    padding-left: var(--sidebar-width-open) !important;
  }
}

.app-layout {
  display: flex;
  gap: 12px;
  padding: 0.75rem 0.75rem 0;
  height: 100vh;
  max-height: 100vh;
  box-sizing: border-box;
  width: 100%;
  margin-left: 0;
  min-width: 0;
  position: relative;
}

aside.ic-contact-sidebar {
  width: 360px;
  max-width: 42%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 252, 253, 0.76));
  border: 1px solid rgba(1, 69, 79, 0.08);
  border-radius: 18px;
  padding: 12px;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  box-shadow: 0 20px 45px rgba(16, 34, 38, 0.07), inset 0 1px 0 rgba(255,255,255,0.75);
  overflow: visible;
  flex-shrink: 0;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.wachat-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 12px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(1, 69, 79, 0.95), rgba(2, 103, 114, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 20px rgba(1, 69, 79, 0.12);
  position: relative;
  z-index: 25;
  overflow: visible;
}

.wachat-sidebar-header-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
}

.wachat-sidebar-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 30;
}

.ic-contact-sidebar-close,
.ic-mobile-contacts-trigger {
  display: none;
}

.wachat-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.wachat-header-icon {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 10px;
  background: rgba(255,255,255,0.09);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
}

.wachat-header-icon.is-disabled,
.wachat-header-icon:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.wachat-header-icon:hover {
  background: rgba(255,255,255,0.16);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.wachat-header-icon.is-disabled:hover,
.wachat-header-icon:disabled:hover {
  background: rgba(255,255,255,0.09);
  transform: none;
  box-shadow: none;
}

.wachat-header-icon i {
  font-size: 1rem;
}

.wachat-search-container {
  padding: 0 2px 12px;
}

.wachat-search-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(245,250,252,0.66));
  border: 1px solid rgba(1, 69, 79, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 8px 18px rgba(1,69,79,0.04);
  backdrop-filter: blur(12px) saturate(110%);
  -webkit-backdrop-filter: blur(12px) saturate(110%);
  transition: all 0.2s ease;
}

.wachat-search-wrapper:focus-within {
  background: linear-gradient(180deg, rgba(255,255,255,0.8), rgba(240,248,251,0.72));
  border-color: rgba(1, 69, 79, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 10px 24px rgba(1, 69, 79, 0.08);
}

.wachat-search-icon {
  color: rgba(15, 43, 44, 0.62);
  font-size: 0.98rem;
  flex-shrink: 0;
}

.wachat-search-input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 0.93rem;
  outline: none;
  font-weight: 500;
}

.wachat-search-input::placeholder {
  color: rgba(15, 43, 44, 0.48);
  font-weight: 400;
}

.ic-contact-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 5px;
  margin: 0 2px 10px;
  border: 1px solid rgba(1, 69, 79, 0.08);
  border-radius: 12px;
  background: rgba(1, 69, 79, 0.045);
}

.ic-contact-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 9px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(15, 43, 44, 0.62);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.ic-contact-tab i {
  font-size: 0.88rem;
}

.ic-contact-tab:hover {
  color: var(--text);
}

.ic-contact-tab.is-active {
  background: rgba(255, 255, 255, 0.9);
  color: var(--accent);
  box-shadow: 0 4px 12px rgba(1, 69, 79, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ic-contact-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 120px;
  padding: 20px;
  color: rgba(15, 43, 44, 0.58);
  font-size: 0.84rem;
  text-align: center;
}

.ic-contact-empty i {
  font-size: 1.35rem;
  color: rgba(1, 69, 79, 0.5);
}

body.internal-chat-page.sidebar-closed .ic-contact-sidebar {
  width: 360px;
}

body.internal-chat-page.sidebar-open .ic-contact-sidebar {
  width: 360px;
}

.ic-sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px
}

.ic-sidebar-title {
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text)
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
  background: rgba(16, 34, 38, 0.03);
  margin-bottom: 10px
}

.search-bar input {
  background: transparent;
  border: 0;
  color: inherit;
  outline: none
}

.contact-list .contact {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer
}

.contact-list .contact {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  border: 1px solid #0000000d;
  transition: transform .14s ease, box-shadow .14s ease, background .12s ease
}

.contact-list .contact:hover {
  background: linear-gradient(135deg, rgba(1, 69, 79, 0.06), rgba(2, 103, 114, 0.04));
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(1, 69, 79, 0.08), inset 0 1px 0 rgba(255,255,255,0.4)
}

.contact-list .contact:focus {
  outline: none;
  box-shadow: 0 10px 24px rgba(1, 69, 79, 0.08), inset 0 1px 0 rgba(255,255,255,0.4)
}

.contact-list .contact::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .18s ease, box-shadow .18s ease
}

/* selected state */
.contact-list .contact.selected {
  background: linear-gradient(135deg, rgba(255,255,255,0.62), rgba(176, 247, 239, 0.28));
  border-color: rgba(0, 125, 144, 0.3);
  box-shadow: 0 14px 32px rgba(1, 69, 79, 0.16), inset 0 1px 0 rgba(255,255,255,0.82), inset 3px 0 0 #36b8ae;
  backdrop-filter: blur(14px) saturate(145%);
  transform: translateY(-2px);
  overflow: hidden
}

.contact-list .contact.selected::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(112deg, transparent 18%, rgba(255,255,255,0.7) 42%, transparent 64%);
  transform: translateX(-125%);
  animation: contact-glass-shimmer 3.8s ease-in-out infinite;
}

.contact-list .contact.selected > * {
  position: relative;
  z-index: 1;
}

.contact-list .contact.has-unread:not(.selected) {
  background: linear-gradient(135deg, rgba(0, 125, 144, 0.1), rgba(255, 255, 255, 0.72));
  border-color: rgba(0, 125, 144, 0.2);
}

.contact-list .contact.selected::after {
  box-shadow: 0 0 0 1px rgba(91, 224, 211, 0.3), 0 14px 36px rgba(1, 69, 79, 0.14);
  opacity: 1
}

@keyframes contact-glass-shimmer {
  0%, 22% { transform: translateX(-125%); opacity: 0; }
  38% { opacity: 1; }
  64%, 100% { transform: translateX(125%); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .contact-list .contact.selected::before { animation: none; }
}

.contact .avatar {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(75deg, #007d90, #01454f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(1, 69, 79, 0.18);
  letter-spacing: 0.04em;
}

.contact .meta {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center
}

.contact-unread-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border-radius: 999px;
  background: #007d90;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 800;
  box-shadow: 0 5px 12px rgba(0, 125, 144, 0.22);
}

.contact .name {
  min-width: 0;
  overflow: hidden;
  font-weight: 600
}

.contact .name-text {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

.contact-preview-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: 3px;
}

.contact-preview {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  color: rgba(15, 43, 44, 0.62);
  font-size: 0.78rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-time {
  flex: 0 0 auto;
  max-width: 40px;
  overflow: hidden;
  color: rgba(15, 43, 44, 0.48);
  font-size: 0.7rem;
  white-space: nowrap;
}

.contact .setor {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: rgba(16, 34, 38, 0.65);
  margin-top: 2px;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.6));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 12px rgba(16, 34, 38, 0.03);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px)
}

.contact .setor i {
  font-size: 0.82rem;
  color: rgba(16, 34, 38, 0.6)
}

.contact .setor .setor-name {
  font-weight: 600;
  color: var(--text);
  font-size: 0.74rem
}

.status-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px
}

.status-inline .status-dot {
  width: 10px;
  height: 10px
}

/* status dot used in contact list and header */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 6px rgba(16, 34, 38, 0.06)
}

.status-dot.online {
  background: #2ecc71;
  box-shadow: 0 6px 14px rgba(46, 204, 113, 0.12);
  animation: pulse 2s infinite
}

.status-dot.offline {
  background: #cfcfcf
}

/* small adjustments for header status */
.chat-header .status-dot {
  width: 12px;
  height: 12px;
  border-width: 2px
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.chat-status #chatSubtitle {
  font-size: 0.95rem;
  color: rgba(16, 34, 38, 0.6)
}

/* name with inline status */
.meta .name {
  display: inline-flex;
  align-items: center;
  gap: 8px
}

.meta .name .status-dot {
  width: 8px;
  height: 8px;
  border-width: 2px
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0.08);
    transform: scale(1.06);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.0);
    transform: scale(1);
  }
}

.chat-area {
  flex: 1;
  margin-left: 0;
  min-width: 0;
  overflow: hidden;
}

.chat-header {
  margin-bottom: 8px
}

.chat-header {
  position: relative
}

.wachat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 12px;
  position: relative;
}

.wachat-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.84), rgba(245,250,252,0.8));
  border: 1px solid rgba(1, 69, 79, 0.08);
  box-shadow: 0 14px 30px rgba(1, 69, 79, 0.06), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  position: relative;
  z-index: 2;
}

.wachat-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.wachat-chat-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 14px;
  background: linear-gradient(75deg, #007d90, #01454f);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
  line-height: 1;
  box-shadow: 0 12px 24px rgba(1, 69, 79, 0.18);
  text-transform: uppercase;
  user-select: none;
}

.wachat-chat-header-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.wachat-chat-header-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: #0f2b2c;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wachat-chat-header-status {
  font-size: 0.74rem;
  color: rgba(15, 43, 44, 0.68);
  letter-spacing: 0.02em;
}

.wachat-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.wachat-selection-actions {
  display: none;
  align-items: center;
  gap: 6px;
  margin-right: 2px;
  padding: 3px;
  border: 1px solid rgba(15, 43, 44, 0.08);
  border-radius: 14px;
  background: rgba(226, 237, 238, 0.42);
  opacity: 0.7;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.wachat-selection-actions.show {
  display: inline-flex;
  animation: selectionActionsIn 0.2s ease-out;
}

.wachat-selection-actions.has-selection {
  opacity: 1;
  border-color: rgba(1, 69, 79, 0.18);
  background: rgba(211, 239, 239, 0.7);
}

.wachat-selection-action {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(1, 69, 79, 0.1);
  border-radius: 11px;
  color: rgba(15, 43, 44, 0.42);
  background: linear-gradient(135deg, rgba(255,255,255,0.46), rgba(214,226,227,0.42));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.78), 0 6px 14px rgba(1,69,79,0.06);
  backdrop-filter: blur(12px) saturate(130%);
  -webkit-backdrop-filter: blur(12px) saturate(130%);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.wachat-selection-actions.has-selection .wachat-selection-action {
  color: var(--accent);
  background: linear-gradient(135deg, rgba(255,255,255,0.82), rgba(185,232,232,0.72));
  border-color: rgba(1, 69, 79, 0.16);
}

.wachat-selection-action:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.56);
  transform: none;
}

.wachat-selection-actions.has-selection .wachat-selection-action:not(:disabled):hover,
.wachat-selection-actions.has-selection .wachat-selection-action:not(:disabled):focus-visible {
  color: #ffffff;
  background: linear-gradient(135deg, #01454f, #026672);
  box-shadow: 0 8px 18px rgba(1,69,79,0.16), inset 0 1px 0 rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.wachat-selection-action:focus-visible {
  outline: 2px solid rgba(2,103,114,0.35);
  outline-offset: 2px;
}

.wachat-selection-action i {
  font-size: 1.05rem;
  line-height: 1;
}

.wachat-selection-actions #icDeleteSelectedBtn,
.wachat-selection-actions.has-selection #icDeleteSelectedBtn {
  color: #b42334;
}

.wachat-selection-actions #icDeleteSelectedBtn:disabled {
  color: rgba(180, 35, 52, 0.45);
}

@keyframes selectionActionsIn {
  from { opacity: 0; transform: translateY(-3px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  overflow: visible;
  z-index: 20;
}

.btn-icon,
.wachat-header-icon {
  background: transparent;
  border: 0;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}

.wachat-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(1, 69, 79, 0.08);
  background: rgba(255,255,255,0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 6px 16px rgba(1,69,79,0.04);
  transition: all 0.2s ease;
  border-radius: 12px;
}

.btn-icon i,
.wachat-header-icon i {
  font-size: 1.15rem;
  line-height: 1;
}

.wachat-header-icon:hover {
  background: linear-gradient(135deg, rgba(1,69,79,0.94), rgba(2,103,114,0.88));
  color: #ffffff;
  border-color: rgba(1,69,79,0.15);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(1, 69, 79, 0.12);
}

.wachat-chat-header-name {
  font-size: 1.08rem;
  font-weight: 700;
  color: #0f2b2c;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wachat-chat-header-status {
  font-size: 0.74rem;
  color: rgba(15, 43, 44, 0.68);
  letter-spacing: 0.02em;
}

/* header menu panel - positioned absolutely relative to chat-header-right */
.header-menu {
  position: absolute;
  display: none;
  z-index: 3000;
  right: 0;
  top: calc(100% + 10px);
  opacity: 0;
  transform-origin: top right;
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
  filter: drop-shadow(0 18px 28px rgba(0, 55, 63, 0.12));
}

.header-menu.show,
.header-menu.hide {
  pointer-events: auto;
}

.header-menu .menu-panel {
  position: relative;
  z-index: 2;
  min-width: 196px;
  max-width: calc(100vw - 24px);
  background: linear-gradient(145deg, rgba(249, 255, 255, 0.86), rgba(218, 243, 242, 0.72) 58%, rgba(196, 232, 232, 0.68));
  border: 1px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 22px 50px rgba(1, 69, 79, 0.2), 0 5px 16px rgba(31, 90, 98, 0.1), inset 0 1px 0 rgba(255,255,255,0.92), inset 0 -1px 0 rgba(1,69,79,0.06);
  backdrop-filter: blur(26px) saturate(155%);
  -webkit-backdrop-filter: blur(26px) saturate(155%);
  border-radius: 18px;
  padding: 7px;
  overflow: visible;
}

.header-menu .menu-panel::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 17px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
}

.header-menu .menu-panel::before {
  content: "";
  position: absolute;
  top: -8px;
  right: 14px;
  width: 14px;
  height: 14px;
  background: rgba(232, 249, 248, 0.82);
  border-left: 1px solid rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.72);
  transform: rotate(45deg);
  border-radius: 2px;
  z-index: 0;
  backdrop-filter: blur(20px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), -3px -3px 12px rgba(1, 69, 79, 0.04);
}

.header-menu ul {
  list-style: none;
  margin: 0;
  padding: 3px;
  position: relative;
  z-index: 1;
}

.header-menu .menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #183f45;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.header-menu .menu-item:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(126, 226, 219, 0.2));
  border-color: rgba(22, 129, 138, 0.16);
  color: #014651;
  transform: translateX(2px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 5px 12px rgba(1, 69, 79, 0.06);
}

.header-menu button.menu-item {
  width: 100%;
  border: 0;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}

.header-menu .menu-item i {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  margin-right: 0;
  border: 1px solid rgba(22, 129, 138, 0.12);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.54);
  color: #16818a;
  font-size: 0.92rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.header-menu .menu-item:hover i {
  background: #16818a;
  color: #f4ffff;
  transform: scale(1.04);
}

.group-create-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.group-create-modal.is-open {
  display: flex;
}

.group-create-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 34, 39, 0.46);
  backdrop-filter: blur(14px);
}

.group-create-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: min(720px, calc(100dvh - 48px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(236, 249, 248, 0.84));
  box-shadow: 0 28px 80px rgba(0, 34, 40, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  color: #12363c;
}

.group-create-header,
.group-create-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 24px;
}

.group-create-header {
  justify-content: space-between;
  border-bottom: 1px solid rgba(21, 92, 99, 0.1);
}

.group-create-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.group-create-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 15px;
  background: linear-gradient(135deg, #014651, #16818a);
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 10px 22px rgba(1, 70, 81, 0.22);
}

.group-create-heading h2 {
  margin: 0;
  color: #123b42;
  font-size: 1.25rem;
  font-weight: 750;
}

.group-create-heading p {
  margin: 4px 0 0;
  color: #668087;
  font-size: 0.86rem;
}

.group-create-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: rgba(1, 70, 81, 0.08);
  color: #2d6269;
  cursor: pointer;
}

.group-create-close:hover {
  background: rgba(1, 70, 81, 0.15);
}

.group-create-body {
  min-height: 0;
  overflow: auto;
  padding: 22px 24px 10px;
}

.group-create-label {
  display: block;
  margin-bottom: 8px;
  color: #315960;
  font-size: 0.8rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.group-create-input-wrap,
.group-create-search {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(39, 111, 118, 0.16);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #649098;
}

.group-create-input-wrap {
  padding: 0 14px;
}

.group-create-input-wrap input,
.group-create-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #173f46;
}

.group-create-input-wrap input {
  height: 46px;
}

.group-create-members-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 22px;
}

.group-create-members-head .group-create-label {
  margin-bottom: 8px;
}

#icGroupSelectedCount {
  color: #16818a;
  font-size: 0.82rem;
  font-weight: 700;
}

.group-create-search {
  padding: 0 14px;
}

.group-create-search input {
  height: 40px;
}

.group-create-members {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  max-height: 280px;
  overflow: auto;
  padding-right: 4px;
}

.group-member-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.group-member-option:hover,
.group-member-option.is-selected {
  border-color: rgba(22, 129, 138, 0.28);
  background: rgba(220, 247, 245, 0.82);
  transform: translateY(-1px);
}

.group-member-check {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(22, 129, 138, 0.32);
  border-radius: 7px;
  color: #fff;
  font-size: 0.75rem;
}

.group-member-option.is-selected .group-member-check {
  border-color: #16818a;
  background: #16818a;
}

.group-member-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #d9eeed;
  color: #17636b;
  font-size: 0.78rem;
  font-weight: 800;
}

.group-member-copy {
  min-width: 0;
}

.group-member-copy strong,
.group-member-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member-copy strong {
  color: #214a51;
  font-size: 0.92rem;
}

.group-member-copy small {
  margin-top: 2px;
  color: #789198;
  font-size: 0.76rem;
}

.group-create-empty {
  padding: 22px 12px;
  color: #789198;
  text-align: center;
  font-size: 0.88rem;
}

.group-create-footer {
  justify-content: flex-end;
  border-top: 1px solid rgba(21, 92, 99, 0.1);
  background: rgba(255, 255, 255, 0.35);
}

.group-create-feedback {
  flex: 1;
  color: #b34a42;
  font-size: 0.8rem;
}

.group-create-feedback.is-success {
  color: #16818a;
}

.group-create-cancel,
.group-create-submit {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.group-create-cancel {
  border: 1px solid rgba(39, 111, 118, 0.2);
  background: rgba(255, 255, 255, 0.62);
  color: #39636a;
}

.group-create-cancel:hover {
  border-color: rgba(22, 129, 138, 0.38);
  background: rgba(220, 247, 245, 0.72);
}

.group-create-submit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: linear-gradient(135deg, #014651, #16818a);
  color: #fff;
  box-shadow: 0 9px 18px rgba(1, 70, 81, 0.18);
}

.group-create-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.wachat-group-info-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wachat-group-info-modal.active {
  display: flex;
}

.wachat-group-info-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 30, 35, 0.5);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.wachat-group-info-dialog {
  position: relative;
  width: min(100%, 560px);
  max-height: min(760px, calc(100dvh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(225, 247, 246, 0.84));
  box-shadow: 0 30px 90px rgba(0, 34, 40, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  color: #12363c;
  animation: chatDetailsIn 0.22s ease-out;
}

@keyframes chatDetailsIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.wachat-group-info-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid rgba(21, 92, 99, 0.1);
}

.wachat-group-info-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.wachat-group-info-avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid rgba(164, 244, 241, 0.5);
  border-radius: 17px;
  background: linear-gradient(135deg, #014651, #16818a);
  color: #eaffff;
  font-size: 1.35rem;
  box-shadow: 0 12px 25px rgba(1, 70, 81, 0.22), inset 0 1px 0 rgba(255,255,255,0.35);
}

.wachat-group-info-kicker {
  display: block;
  margin-bottom: 3px;
  color: #16818a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wachat-group-info-heading h2 {
  margin: 0;
  overflow: hidden;
  color: #123b42;
  font-size: 1.3rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wachat-group-info-heading p {
  margin: 4px 0 0;
  color: #668087;
  font-size: 0.82rem;
}

.wachat-group-info-close {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 1px solid rgba(39, 111, 118, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.5);
  color: #39636a;
  cursor: pointer;
}

.wachat-group-info-close:hover {
  background: rgba(220, 247, 245, 0.82);
  color: #014651;
}

.wachat-group-info-body {
  max-height: calc(100dvh - 180px);
  overflow: auto;
  padding: 18px 24px 24px;
}

.wachat-info-section {
  padding: 16px 0;
  border-bottom: 1px solid rgba(21, 92, 99, 0.09);
}

.wachat-info-section:last-child { border-bottom: 0; }

.wachat-info-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
  color: #315960;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.wachat-info-section-title i { color: #16818a; font-size: 0.95rem; }
.wachat-info-section-title small { margin-left: auto; color: #16818a; font-size: 0.75rem; }
.wachat-info-last-message { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid rgba(39,111,118,0.1); border-radius: 14px; background: rgba(255,255,255,0.52); }
.wachat-info-last-message strong { overflow: hidden; color: #214a51; font-size: 0.88rem; text-overflow: ellipsis; white-space: nowrap; }
.wachat-info-last-message small, .wachat-info-value { margin: 0; color: #789198; font-size: 0.78rem; }
.wachat-info-contact-data { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wachat-info-contact-data p { display: flex; flex-direction: column; gap: 3px; margin: 0; padding: 11px 12px; border-radius: 13px; background: rgba(255,255,255,0.48); }
.wachat-info-contact-data b { color: #668087; font-size: 0.68rem; text-transform: uppercase; }
.wachat-info-contact-data span { color: #214a51; font-size: 0.84rem; }
.wachat-info-people { display: grid; gap: 7px; }
.wachat-info-person { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(39,111,118,0.08); border-radius: 13px; background: rgba(255,255,255,0.48); }
.wachat-info-person-avatar { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px; background: #d9eeed; color: #17636b; font-size: 0.72rem; font-weight: 800; }
.wachat-info-person-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.wachat-info-person-copy strong { overflow: hidden; color: #214a51; font-size: 0.84rem; text-overflow: ellipsis; white-space: nowrap; }
.wachat-info-person-copy small { color: #789198; font-size: 0.72rem; }
.wachat-info-owner { margin-left: auto; color: #d09a35; font-size: 0.78rem; }
.wachat-readers-avatar { background: linear-gradient(135deg, #0b898f, #014651); }
.wachat-reader-person { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid rgba(39,111,118,0.08); border-radius: 13px; background: rgba(255,255,255,0.48); }
.wachat-reader-person.is-read { border-color: rgba(22,129,138,0.18); background: linear-gradient(135deg, rgba(220,247,245,0.68), rgba(255,255,255,0.48)); }
.wachat-reader-person.is-pending { opacity: 0.7; }
.wachat-reader-status { margin-left: auto; color: #8b9da0; font-size: 0.95rem; }
.wachat-reader-person.is-read .wachat-reader-status { color: #0b9da1; filter: drop-shadow(0 0 4px rgba(11,157,161,0.32)); }
.wachat-info-media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 9px; }
.wachat-info-media { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-width: 0; min-height: 92px; overflow: hidden; padding: 8px; border: 1px solid rgba(39,111,118,0.1); border-radius: 14px; background: rgba(255,255,255,0.52); color: #17636b; font-size: 0.68rem; text-align: center; transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease; }
.wachat-info-media:hover { transform: translateY(-2px); border-color: rgba(22,129,138,0.3); background: rgba(220,247,245,0.8); }
.wachat-info-media img { width: 100%; height: 62px; object-fit: cover; border-radius: 9px; }
.wachat-info-media > i { font-size: 1.55rem; color: #16818a; }
.wachat-info-media span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wachat-info-media-actions { display: flex; justify-content: center; gap: 5px; }
.wachat-info-media-actions button { display: inline-grid; place-items: center; width: 28px; height: 26px; padding: 0; border: 1px solid rgba(39,111,118,0.16); border-radius: 8px; background: rgba(255,255,255,0.7); color: #17636b; cursor: pointer; }
.wachat-info-media-actions button:hover { background: #d8f6f1; color: #01454f; }
.internal-message-highlight { animation: internal-message-highlight 1.6s ease-out both; }
@keyframes internal-message-highlight { 0% { box-shadow: 0 0 0 0 rgba(8,166,166,0); } 18% { box-shadow: 0 0 0 5px rgba(8,166,166,0.34); } 100% { box-shadow: 0 0 0 0 rgba(8,166,166,0); } }
.wachat-info-empty, .wachat-info-error { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 16px; color: #789198; font-size: 0.8rem; text-align: center; }
.wachat-info-error { color: #b34a42; }
.wachat-group-info-loading { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 180px; color: #668087; font-size: 0.84rem; }
.wachat-group-info-loading i { color: #16818a; animation: chatDetailsSpin 1s linear infinite; }
@keyframes chatDetailsSpin { to { transform: rotate(360deg); } }

.internal-call-modal { position: fixed; inset: 0; z-index: 1400; display: none; align-items: center; justify-content: center; padding: 20px; }
.internal-call-modal.active { display: flex; }
.internal-incoming-call-modal { position: fixed; inset: 0; z-index: 1450; display: none; align-items: center; justify-content: center; padding: 20px; }
.internal-incoming-call-modal.active { display: flex; }
.internal-incoming-call-backdrop { position: absolute; inset: 0; background: rgba(5, 26, 35, 0.62); backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%); }
.internal-incoming-call-dialog { position: relative; width: min(100%, 430px); overflow: hidden; border: 1px solid rgba(255,255,255,0.7); border-radius: 28px; background: linear-gradient(145deg, rgba(252,255,253,0.98), rgba(218,243,239,0.92)); box-shadow: 0 30px 90px rgba(2,18,21,0.42), inset 0 1px 0 rgba(255,255,255,0.96); animation: internalIncomingCallIn .24s ease-out; }
@keyframes internalIncomingCallIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.internal-incoming-call-header { display: flex; align-items: center; gap: 14px; padding: 24px 22px 18px; border-bottom: 1px solid rgba(21,92,99,0.11); }
.internal-incoming-call-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 16px; background: linear-gradient(135deg, #0d9e93, #0a7d90); color: #fff; box-shadow: 0 12px 24px rgba(8,155,150,0.28); }
.internal-incoming-call-kicker { display: block; color: #16818a; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.internal-incoming-call-header h2 { margin: 2px 0 0; color: #133d46; font-size: 1.3rem; }
.internal-incoming-call-header p { margin: 4px 0 0; color: #668087; font-size: .8rem; }
.internal-incoming-call-participants { display: grid; gap: 8px; max-height: 260px; overflow: auto; padding: 18px 22px; }
.internal-incoming-call-participants .internal-call-participant { background: rgba(255,255,255,0.56); }
.internal-incoming-call-actions { display: flex; justify-content: center; gap: 10px; padding: 18px 22px 22px; border-top: 1px solid rgba(21,92,99,0.11); background: rgba(255,255,255,0.38); }
.internal-incoming-call-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; border: 0; border-radius: 12px; padding: 0 18px; cursor: pointer; font-size: .8rem; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.internal-incoming-call-btn:hover { transform: translateY(-1px); }
.internal-incoming-call-btn--secondary { background: rgba(157,86,79,0.12); color: #8c4146; }
.internal-incoming-call-btn--primary { background: linear-gradient(135deg,#0c9d93,#087b90); color: #fff; box-shadow: 0 12px 24px rgba(8,155,150,0.22); }
.internal-call-backdrop { position: absolute; inset: 0; background: rgba(2, 27, 32, 0.58); backdrop-filter: blur(18px) saturate(130%); -webkit-backdrop-filter: blur(18px) saturate(130%); }
.internal-call-dialog { position: relative; width: min(100%, 440px); overflow: hidden; border: 1px solid rgba(255,255,255,0.7); border-radius: 28px; background: linear-gradient(145deg, rgba(244,255,255,0.94), rgba(205,240,239,0.84)); box-shadow: 0 32px 100px rgba(0,25,31,0.38), inset 0 1px 0 rgba(255,255,255,0.95); animation: internalCallIn .24s ease-out; }
@keyframes internalCallIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.internal-call-header { display: flex; align-items: center; gap: 13px; padding: 25px 24px 20px; border-bottom: 1px solid rgba(21,92,99,0.1); }
.internal-call-status-dot { width: 13px; height: 13px; flex: 0 0 13px; border-radius: 50%; background: #27c6b4; box-shadow: 0 0 0 6px rgba(39,198,180,0.15), 0 0 18px rgba(39,198,180,0.65); animation: internalCallPulse 1.4s ease-in-out infinite; }
@keyframes internalCallPulse { 50% { transform: scale(.8); opacity: .65; } }
.internal-call-kicker { display: block; color: #16818a; font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.internal-call-header h2 { margin: 2px 0 0; color: #123b42; font-size: 1.25rem; }
.internal-call-header p { margin: 3px 0 0; color: #668087; font-size: .8rem; }
.internal-call-close { display: grid; place-items: center; width: 34px; height: 34px; margin-left: auto; border: 1px solid rgba(39,111,118,.12); border-radius: 11px; background: rgba(255,255,255,.52); color: #39636a; cursor: pointer; }
.internal-call-participants { display: grid; gap: 8px; max-height: 330px; overflow: auto; padding: 18px 24px; }
.internal-call-participant { display: flex; align-items: center; gap: 10px; padding: 10px 11px; border: 1px solid rgba(39,111,118,.1); border-radius: 15px; background: rgba(255,255,255,.5); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.internal-call-participant.is-speaking { border-color: rgba(18,190,173,.75); box-shadow: 0 0 0 3px rgba(18,190,173,.13), 0 8px 22px rgba(18,190,173,.12); transform: translateY(-1px); }
.internal-call-participant-avatar { display: grid; place-items: center; width: 37px; height: 37px; flex: 0 0 37px; border-radius: 12px; background: linear-gradient(135deg,#d9eeed,#b9e7e4); color: #17636b; }
.internal-call-participant > span:nth-child(2) { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.internal-call-participant strong { color: #214a51; font-size: .85rem; }
.internal-call-participant small { color: #789198; font-size: .72rem; }
.internal-call-participant-state { margin-left: auto; color: #91a4a6; }
.internal-call-participant.is-speaking .internal-call-participant-state { color: #08a899; filter: drop-shadow(0 0 5px rgba(8,168,153,.55)); }
.internal-call-footer { display: flex; justify-content: center; gap: 9px; padding: 18px 24px 23px; border-top: 1px solid rgba(21,92,99,.1); background: rgba(255,255,255,.3); }
.internal-call-action { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border: 1px solid rgba(39,111,118,.14); border-radius: 13px; color: #214a51; background: rgba(255,255,255,.58); font-size: .78rem; font-weight: 750; cursor: pointer; transition: transform .18s ease, background .18s ease, box-shadow .18s ease; }
.internal-call-action:hover { transform: translateY(-1px); background: rgba(220,247,245,.85); box-shadow: 0 8px 18px rgba(1,69,79,.1); }
.internal-call-action--accept { border: 0; background: linear-gradient(135deg,#0b9f8f,#007d90); color: #fff; box-shadow: 0 9px 20px rgba(0,125,144,.2); }
.internal-call-action--end { border: 0; background: linear-gradient(135deg,#bd5550,#943d45); color: #fff; }
.internal-call-action.is-muted { background: rgba(189,85,80,.15); color: #943d45; }
.internal-call-audios { display: block !important; position: fixed; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

.internal-call-toast { position: fixed; top: 18px; right: 18px; z-index: 2500; display: none; width: min(460px, calc(100vw - 28px)); }
.internal-call-toast.active { display: block; }
.internal-call-toast-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid rgba(255,255,255,.54); border-radius: 22px; background: linear-gradient(135deg, rgba(255,255,255,.32), rgba(255,255,255,.18)); backdrop-filter: blur(18px) saturate(155%); -webkit-backdrop-filter: blur(18px) saturate(155%); box-shadow: 0 20px 52px rgba(19,37,51,.22), inset 0 1px 0 rgba(255,255,255,.65); animation: internalCallToastIn .22s ease-out; cursor: grab; user-select: none; }
.internal-call-toast-card:active { cursor: grabbing; }
@keyframes internalCallToastIn { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.internal-call-toast-icon { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 42px; border-radius: 14px; background: linear-gradient(135deg,#0b948d,#0d7f96); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 12px 24px rgba(11,148,141,.35); }
.internal-call-toast-copy { display: grid; min-width: 0; gap: 3px; flex: 1; }
.internal-call-toast-kicker { color: #16818a; font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.internal-call-toast-copy strong { overflow: hidden; color: #173f48; font-size: .92rem; text-overflow: ellipsis; white-space: nowrap; }
.internal-call-toast-copy small { color: #5f7d84; font-size: .72rem; }
.internal-call-toast-status { display: block; color: #8d3546; font-size: .68rem; font-weight: 700; line-height: 1.35; min-height: 1.2em; }
.internal-call-toast-status--recording { color: #a11d36; }
.internal-call-toast-actions { display: flex; gap: 7px; }
.internal-call-toast-button { display: inline-flex; align-items: center; justify-content: center; position: relative; min-width: 40px; height: 40px; padding: 0 12px; border: 0; border-radius: 12px; cursor: pointer; color: #24535b; background: rgba(255,255,255,.4); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 1px 0 rgba(255,255,255,.7); transition: all .18s ease; }
.internal-call-toast-button:hover { transform: translateY(-1px); }
.internal-call-toast-button i { font-size: 1rem; }
.internal-call-toast-button.is-muted { background: rgba(215,90,98,.14); color: #7c2f35; }
.internal-call-toast-button.is-recording { background: rgba(186,30,60,.12); color: #901b2f; }
.internal-call-mic-slash { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-38deg); display: inline-flex; align-items: center; justify-content: center; color: #d3322f; font-weight: 900; line-height: 1; }
.internal-call-mic-slash i { font-size: 1.35rem; }
.internal-call-toast-button--accept { color: #fff; background: linear-gradient(135deg,#0b9f8f,#0d7a90); }
.internal-call-toast-button--record { color: #9d1a2d; background: rgba(184, 24, 35, 0.08); }
.internal-call-toast-button--record.is-recording { color: #fff; background: linear-gradient(135deg,#d93a4b,#a82336); }
.internal-call-toast-button--reject { color: #fff; background: linear-gradient(135deg,#c35e59,#a33a46); }
.internal-call-toast-participants { display: none; }
.internal-call-active-toast .internal-call-toast-card { border-color: rgba(11,159,143,.32); }

@media (max-width: 560px) {
  .internal-call-toast { top: 10px; right: 10px; left: 10px; width: auto; }
}

@media (max-width: 560px) {
  .internal-chat-landing {
    justify-content: flex-start;
    gap: 18px;
    padding: 24px 14px 32px;
  }

  .internal-chat-landing-hero {
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
  }

  .internal-chat-landing-mark {
    width: 52px;
    height: 52px;
    flex-basis: 52px;
  }

  .internal-chat-landing-mark i { font-size: 1.4rem; }
  .internal-chat-landing-copy h2 { font-size: 1.3rem; }
  .internal-chat-landing-copy p { font-size: .82rem; line-height: 1.45; }
  .internal-chat-landing-actions { width: 100%; }
  .internal-chat-landing-action { flex: 1 1 140px; justify-content: center; }
  .internal-chat-landing-section { padding: 13px; }
  .internal-chat-landing-section-head { align-items: flex-start; flex-direction: column; gap: 3px; }

  .group-create-modal {
    padding: 12px;
  }

  .group-create-dialog {
    max-height: calc(100dvh - 24px);
    border-radius: 20px;
  }

  .group-create-header,
  .group-create-footer,
  .group-create-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .wachat-group-info-modal { padding: 12px; }
  .wachat-group-info-dialog { max-height: calc(100dvh - 24px); border-radius: 20px; }
  .wachat-group-info-header, .wachat-group-info-body { padding-left: 18px; padding-right: 18px; }
  .wachat-info-contact-data { grid-template-columns: 1fr; }
}

.header-menu.show {
  display: block;
  opacity: 1;
  transform: translateY(0) scale(1)
}

.header-menu.hide {
  opacity: 0;
  transform: translateY(6px) scale(0.98)
}

.chat-window {
  height: calc(100vh - 150px);
  min-height: 420px;
  overflow: auto;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(245, 252, 255, 0.9));
  border: 1px solid rgba(16, 34, 38, 0.03);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 6px 18px rgba(16, 34, 38, 0.04);
  position: relative;
  box-sizing: border-box
}

.internal-chat-landing {
  position: relative;
  isolation: isolate;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: clamp(24px, 5vw, 58px);
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 12%, rgba(11,159,143,0.1), transparent 28%),
    linear-gradient(135deg, rgba(238,250,249,0.78), rgba(255,255,255,0.28) 48%, rgba(228,244,247,0.64));
  box-sizing: border-box;
  color: var(--text);
}

.internal-chat-landing::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: .28;
  background-image: linear-gradient(rgba(1,69,79,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(1,69,79,.08) 1px, transparent 1px);
  background-size: 30px 30px;
  mask-image: linear-gradient(to bottom right, black, transparent 72%);
  pointer-events: none;
}

.internal-chat-landing-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  width: min(100%, 560px);
  padding: 22px 24px;
  border: 1px solid rgba(1,69,79,.12);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,255,255,.76), rgba(236,249,248,.48));
  box-shadow: 0 18px 40px rgba(1,69,79,.08), inset 0 1px 0 rgba(255,255,255,.94), inset 0 -1px 0 rgba(1,69,79,.04);
  backdrop-filter: blur(12px);
}

.internal-chat-landing-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  flex: 0 0 68px;
  border-radius: 18px;
  color: #eaffff;
  background: linear-gradient(145deg, rgba(1,69,79,.98), rgba(8,137,137,.9));
  box-shadow: 0 18px 34px rgba(1,69,79,0.2), inset 0 1px 0 rgba(255,255,255,.34), inset 0 -8px 18px rgba(0,35,42,.12);
}

.internal-chat-landing-mark i { font-size: 1.8rem; }
.internal-chat-landing-copy h2 { margin: 0 0 5px; font-size: clamp(1.3rem, 2.4vw, 1.8rem); }
.internal-chat-landing-copy h2::after { content: ''; display: block; width: 34px; height: 3px; margin-top: 9px; border-radius: 3px; background: #de9752; }
.internal-chat-landing-copy p { max-width: 390px; margin: 0; color: rgba(15,43,44,0.62); line-height: 1.5; }

.internal-chat-landing-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.internal-chat-landing-action {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(1,69,79,0.16);
  border-radius: 13px;
  color: var(--accent);
  background: rgba(255,255,255,0.74);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 8px 18px rgba(1,69,79,0.07);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease;
}
.internal-chat-landing-action--primary { color: #fff; background: linear-gradient(135deg, #013e48, #087f82); border-color: transparent; box-shadow: 0 12px 24px rgba(1,69,79,.2), inset 0 1px 0 rgba(255,255,255,.18); }
.internal-chat-landing-action:hover { transform: translateY(-1px); box-shadow: 0 12px 22px rgba(1,69,79,0.13); }

.internal-chat-search-panel { width: min(100%, 520px); padding: 15px; border: 1px solid rgba(1,69,79,.1); border-radius: 16px; background: rgba(255,255,255,.62); box-shadow: 0 12px 26px rgba(1,69,79,.06); backdrop-filter: blur(12px); }
.internal-chat-search-panel[hidden] { display: none; }
.internal-chat-search-panel label { display: block; margin-bottom: 7px; color: var(--accent); font-size: .78rem; font-weight: 700; }
.internal-chat-search-field { display: flex; align-items: center; gap: 9px; padding: 9px 12px; border: 1px solid rgba(1,69,79,0.16); border-radius: 13px; background: rgba(255,255,255,0.7); backdrop-filter: blur(14px); }
.internal-chat-search-field input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); }
.internal-chat-search-field button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.internal-chat-search-results { display: grid; gap: 6px; margin-top: 8px; max-height: 220px; overflow: auto; }
.internal-chat-search-result, .internal-chat-recent-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 11px; border: 1px solid rgba(1,69,79,0.09); border-radius: 12px; text-align: left; background: rgba(255,255,255,0.64); color: var(--text); cursor: pointer; }
.internal-chat-search-result:hover, .internal-chat-recent-item:hover { border-color: rgba(1,69,79,0.25); background: rgba(218,243,243,0.7); }
.internal-chat-search-avatar, .internal-chat-recent-avatar { display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; color: #fff; background: #026672; font-size: .72rem; font-weight: 800; }
.internal-chat-search-result > span:last-child, .internal-chat-recent-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.internal-chat-search-result small, .internal-chat-recent-copy small { color: var(--muted); font-size: .72rem; }
.internal-chat-search-empty, .internal-chat-recent-empty { padding: 12px; color: var(--muted); text-align: center; font-size: .8rem; }
.internal-chat-landing-section { width: min(100%, 520px); padding: 17px; border: 1px solid rgba(1,69,79,.1); border-radius: 20px; background: rgba(255,255,255,.62); box-shadow: 0 16px 34px rgba(1,69,79,.07); backdrop-filter: blur(12px); }
.internal-chat-landing-section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 11px; padding-bottom: 10px; border-bottom: 1px solid rgba(1,69,79,.08); }
.internal-chat-landing-section-head h3 { margin: 0; font-size: .92rem; }
.internal-chat-landing-section-head span { color: var(--muted); font-size: .72rem; }
.internal-chat-recent-list { display: grid; gap: 6px; max-height: 180px; overflow: auto; }
.internal-chat-recent-item b { margin-left: auto; min-width: 20px; padding: 3px 6px; border-radius: 9px; color: #fff; background: #026672; text-align: center; font-size: .7rem; }

.message-container {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px
}

.message-container.me {
  align-items: flex-end;
  margin-left: 60px
}

.message-container.them {
  align-items: flex-start;
  margin-right: 60px
}

.message-container.group-message {
  gap: 4px;
  margin-bottom: 14px;
}

.group-message-sender {
  max-width: min(50%, 36ch);
  padding: 0 10px;
  color: #16818a;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-transform: none;
}

.message-container.me .group-message-sender {
  color: #00757c;
  text-align: right;
}

.message-container.them .group-message-sender {
  color: #16818a;
}

/* reply-to preview (quando uma mensagem responde a outra) */
.message-reply-to {
  display: flex;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  margin: -3px 0 11px;
  padding: 8px 10px 9px;
  color: inherit;
  font-size: 0.8rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255,255,255,0.22), rgba(0, 34, 40, 0.14));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 5px 14px rgba(0, 35, 40, 0.08);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.message-reply-to[role="button"] { cursor: pointer; }
.message-reply-to[role="button"]:hover,
.message-reply-to[role="button"]:focus-visible { filter: brightness(.97); }

.message.is-reply-target {
  animation: replyTargetHighlight 1.5s ease-out;
}

@keyframes replyTargetHighlight {
  0% { box-shadow: 0 0 0 0 rgba(11, 159, 143, 0); }
  18% { box-shadow: 0 0 0 4px rgba(11, 159, 143, .48), 0 0 22px 5px rgba(11, 159, 143, .2); }
  48% { box-shadow: 0 0 0 2px rgba(11, 159, 143, .28), 0 0 12px 2px rgba(11, 159, 143, .12); }
  100% { box-shadow: 0 0 0 0 rgba(11, 159, 143, 0); }
}

.reply-line {
  width: 4px;
  flex: 0 0 4px;
  background: linear-gradient(180deg, #a9fff7, #28b9b4);
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(126, 244, 235, 0.5);
}

.reply-content {
  display: flex;
  flex-direction: column;
  gap: 2px
}

.reply-author {
  font-weight: 600;
  color: #a7f3ee;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.reply-author::before {
  content: '↪';
  display: inline-block;
  margin-right: 5px;
  font-size: 0.86rem;
  font-style: normal;
}

.reply-text {
  color: rgba(255,255,255,0.78);
  font-size: 0.78rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden
}

.chat-window .message {
  padding: 12px 44px 30px 15px;
  min-width: 100px;
  box-sizing: border-box;
  border-radius: 18px 18px 6px 18px;
  max-width: min(50%, 36ch);
  margin-bottom: 0;
  word-break: break-word;
  white-space: pre-wrap;
  position: relative;
  isolation: isolate;
  font-weight: 500;
  line-height: 1.5;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.chat-window .message::before {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  border-top: 1px solid rgba(255, 255, 255, 0.3);
  opacity: 0.8;
  pointer-events: none;
}

.message-container.me .message:hover,
.message-container.them .message:hover {
  transform: translateY(-1px);
}

.message-container.me .message {
  background: linear-gradient(135deg, rgba(11, 137, 143, 0.94), rgba(0, 70, 84, 0.9)) !important;
  color: #f7ffff !important;
  box-shadow: 0 12px 28px rgba(0, 76, 87, 0.2), inset 0 1px 0 rgba(255,255,255,0.34), inset -10px -12px 24px rgba(0, 38, 48, 0.1) !important;
  border: 1px solid rgba(164, 244, 241, 0.34) !important;
  border-radius: 18px 18px 6px 18px;
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.message-container.me .message:hover {
  border-color: rgba(164, 244, 241, 0.58) !important;
  box-shadow: 0 15px 32px rgba(0, 76, 87, 0.26), inset 0 1px 0 rgba(255,255,255,0.42), inset -10px -12px 24px rgba(0, 38, 48, 0.12) !important;
}

.message-container.them .message {
  background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(211, 242, 241, 0.72)) !important;
  border: 1px solid rgba(0, 104, 111, 0.15) !important;
  color: #173b3d !important;
  box-shadow: 0 10px 24px rgba(16, 34, 38, 0.08), inset 0 1px 0 rgba(255,255,255,0.94), inset -10px -12px 24px rgba(0, 104, 111, 0.05) !important;
  border-radius: 18px 18px 18px 6px;
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  font-weight: 500;
}

.message-container.them .message:hover {
  border-color: rgba(0, 145, 148, 0.3) !important;
  box-shadow: 0 14px 30px rgba(16, 34, 38, 0.12), inset 0 1px 0 rgba(255,255,255,0.98), inset -10px -12px 24px rgba(0, 104, 111, 0.07) !important;
}

.message-container.them .message-reply-to {
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(186, 235, 234, 0.34));
  border-color: rgba(0, 104, 111, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 5px 14px rgba(0, 104, 111, 0.07);
}

.message-container.them .reply-author {
  color: #00757c;
}

.message-container.them .reply-text {
  color: rgba(23, 59, 61, 0.68);
}

.message-container.them .reply-line {
  background: linear-gradient(180deg, #0a9da1, #8adbd8);
  box-shadow: 0 0 8px rgba(10, 157, 161, 0.25);
}

.chat-window .message:has(.internal-forwarded-label) {
  background: linear-gradient(135deg, rgba(255, 248, 226, 0.92), rgba(247, 226, 174, 0.74)) !important;
  border-color: rgba(174, 122, 28, 0.3) !important;
  color: #4f3a16 !important;
  box-shadow: 0 12px 28px rgba(154, 112, 29, 0.13), inset 0 1px 0 rgba(255,255,255,0.82) !important;
}

.message-container.me .message:has(.internal-forwarded-label) {
  background: linear-gradient(135deg, #01454f42, #0dcaf000) !important;
  color: #01454f !important;
  border-color: #026672 !important;
  box-shadow: 0 10px 24px rgba(1, 69, 79, 0.1), inset 0 1px 0 rgba(255,255,255,0.72) !important;
}

/* deleted message style */
.chat-window .message.deleted {
  color: var(--muted);
  font-style: italic;
  opacity: 0.7;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(245, 245, 245, 0.45));
  border: 1px solid rgba(1, 69, 79, 0.06);
  box-shadow: 0 4px 12px rgba(16, 34, 38, 0.04), inset 0 1px 0 rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.chat-window .message.deleted-for-me {
  color: rgba(23, 59, 61, 0.62);
.internal-media-audio.internal-media-call-recording {
  /* Compact sender recording card: badge left, title middle, meta right, controls below */
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, rgba(255,250,250,0.98), rgba(255,255,255,0.98));
  border: 1px solid rgba(170,30,45,0.08);
  padding: 10px 12px;
  border-radius: 12px;
  min-width: 0;
}

/* header row: badge + title + meta */
.internal-media-call-recording-header {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.internal-media-call-recording-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(90deg,#ff7b7b,#d92e4a);
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 4px;
}
.internal-media-call-recording-label {
  flex: 1 1 auto;
  min-width: 0;
}
.internal-media-call-recording-label strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.15;
  margin: 0;
  color: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.internal-media-call-recording-label small {
  display: block;
  font-size: 0.70rem;
  color: rgba(23,59,61,0.55);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.internal-media-call-recording-meta {
  flex: 0 0 auto;
  color: rgba(23,59,61,0.5);
  font-size: 0.72rem;
}

/* controls row: play/progress/time/download */
.internal-media-audio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.internal-media-audio-controls .internal-media-audio-play {
  flex: 0 0 auto;
}
.internal-media-audio-controls .internal-media-audio-progress {
  flex: 1 1 auto;
}
.internal-media-audio-download { flex: 0 0 auto; }

/* ensure right padding to avoid overlap with message meta/menu */
.message .internal-media-audio.internal-media-call-recording { padding-right: 72px }

@media (max-width: 640px) {
  .internal-media-call-recording-header { gap: 8px }
  .internal-media-call-recording-badge { width: 32px; height: 32px }
  .internal-media-audio-controls { gap: 8px }
}

/* Strong overrides to ensure sender recording card layout applies (high specificity) */
.message .internal-media-audio.internal-media-call-recording {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(255,250,250,0.98), rgba(255,255,255,0.98)) !important;
  border: 1px solid rgba(170,30,45,0.08) !important;
  min-width: 0 !important;
}
.message .internal-media-audio.internal-media-call-recording > .internal-media-call-recording-header {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}
.message .internal-media-audio.internal-media-call-recording .internal-media-call-recording-badge {
  width: 34px !important;
  height: 34px !important;
  flex: 0 0 auto !important;
  border-radius: 8px !important;
}
.message .internal-media-audio.internal-media-call-recording .internal-media-call-recording-label {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
.message .internal-media-audio.internal-media-call-recording .internal-media-call-recording-label strong {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.95rem !important;
}
.message .internal-media-audio.internal-media-call-recording .internal-media-call-recording-label small {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: 0.70rem !important;
  color: rgba(23,59,61,0.55) !important;
}
.message .internal-media-audio.internal-media-call-recording .internal-media-audio-controls {
  display: flex !important;
  gap: 8px !important;
  align-items: center !important;
}
.message .internal-media-audio.internal-media-call-recording .internal-media-audio-progress {
  flex: 1 1 auto !important;
}
.message .internal-media-audio.internal-media-call-recording .internal-media-audio-play {
  flex: 0 0 auto !important;
}
.message .internal-media-audio.internal-media-call-recording .internal-media-audio-download {
  flex: 0 0 auto !important;
}

/* Emergency overrides to fix vertical text, overlap and alignment issues */
.message .internal-media-audio.internal-media-call-recording { position: relative !important; z-index: 0 !important }
.message .internal-media-audio.internal-media-call-recording .internal-media-call-recording-badge { z-index: 3 !important; position: relative !important }
.message .internal-media-audio.internal-media-call-recording .internal-media-call-recording-owner { z-index: 4 !important; position: relative !important }

/* Ensure download label is horizontal and each word/letter not broken */
.message .internal-media-audio.internal-media-call-recording .internal-media-audio-download span {
  display: inline-block !important;
  white-space: nowrap !important;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  letter-spacing: normal !important;
}

/* Ensure play button aligns to left of controls, not centered in the whole card */
.message .internal-media-audio.internal-media-call-recording .internal-media-audio-controls { align-items: center !important }
.message .internal-media-audio.internal-media-call-recording .internal-media-audio-play { align-self: center !important }

/* Push message-meta/menu above the card so they don't hide content */
.message .message-meta, .message .message-menu-btn { z-index: 10 !important }

/* If any span inside audio-link was made column elsewhere, force inline layout */
.message .internal-media-audio.internal-media-call-recording a span, .message .internal-media-audio.internal-media-call-recording span { display: inline-block !important }
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: rgba(235, 255, 255, 0.72);
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  padding: 3px 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(0, 38, 48, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.message-time {
  letter-spacing: 0.01em;
}

.message-container.them .message-meta {
  color: rgba(23, 59, 61, 0.52);
  border-color: rgba(0, 104, 111, 0.12);
  background: rgba(255, 255, 255, 0.48);
}

/* message menu button - elegante com hover e liquid glass */
.message-menu-btn {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  cursor: pointer;
  color: inherit;
  font-size: 0.95rem;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  border-radius: 50%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}

.message:hover .message-menu-btn {
  opacity: 0.92;
}

.message-menu-btn:hover {
  opacity: 1 !important;
  background: rgba(255, 255, 255, 0.35);
  transform: scale(1.06);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 5px 12px rgba(1, 69, 79, 0.14), inset 0 1px 0 rgba(255,255,255,0.3);
}

.message-menu-btn:focus-visible {
  opacity: 1;
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

.message-menu-btn i {
  line-height: 1;
}

.message-container.me .message-menu-btn {
  color: rgba(255, 255, 255, 0.95);
}

.message-container.them .message-menu-btn {
  background: rgba(1, 69, 79, 0.08);
  border-color: rgba(1, 69, 79, 0.12);
  color: rgba(45, 55, 72, 0.75);
}

.message-select-checkbox {
  position: absolute;
  left: 10px;
  top: 50%;
  width: 20px;
  height: 20px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(1, 69, 79, 0.3);
  border-radius: 7px;
  background: rgba(255,255,255,0.68);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 4px 10px rgba(1,69,79,0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) scale(0.78);
  transition: opacity 0.18s ease, transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  z-index: 3;
}

.message-select-checkbox:hover {
  border-color: rgba(1, 69, 79, 0.62);
  background: rgba(220, 247, 246, 0.9);
}

.message-select-checkbox:checked {
  border-color: #026672;
  background: linear-gradient(135deg, #01454f, #0a9da1);
  box-shadow: 0 0 0 3px rgba(13, 202, 240, 0.16), 0 6px 14px rgba(1,69,79,0.22);
}

.message-select-checkbox:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 3px;
  width: 5px;
  height: 9px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.chat-window.selection-mode .message {
  padding-left: 38px;
}

.chat-window.selection-mode .message-select-checkbox {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%) scale(1);
}

.chat-window.selection-mode .message-select-checkbox:focus-visible {
  outline: 2px solid rgba(2, 103, 114, 0.48);
  outline-offset: 2px;
}

.chat-window.selection-mode .message-menu-btn,
.chat-window.selection-mode .message-menu {
  display: none;
}

/* dropdown menu elegante moderno */
.message-menu {
  position: fixed;
  z-index: 9999;
  top: auto;
  left: auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 251, 253, 0.91));
  border: 1px solid rgba(1, 69, 79, 0.1);
  box-shadow: 0 16px 48px rgba(1, 69, 79, 0.16), 0 4px 14px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(255,255,255,0.8);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-radius: 14px;
  padding: 8px;
  min-width: 160px;
  display: none;
  flex-direction: column;
  gap: 4px;
  animation: slideDown 0.25s ease-out;
}

.message-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  width: 14px;
  height: 14px;
  background: rgba(250, 251, 253, 0.91);
  border-left: 1px solid rgba(1, 69, 79, 0.1);
  border-top: 1px solid rgba(1, 69, 79, 0.1);
  transform: rotate(45deg);
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.message-menu.opens-up {
  animation: slideUp 0.25s ease-out;
}

.message-menu.opens-up::before {
  top: auto;
  bottom: -8px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid rgba(1, 69, 79, 0.1);
  border-bottom: 1px solid rgba(1, 69, 79, 0.1);
}

/* Menu position para mensagens ENVIADAS (direita) - aparece à esquerda */
.message-menu.is-outgoing {
  right: auto;
}

.message-menu.is-outgoing::before {
  right: 18px;
}

/* Menu position para mensagens RECEBIDAS (esquerda) - aparece à direita */
.message-menu.is-incoming {
  left: auto;
}

.message-menu.is-incoming::before {
  left: 18px;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-menu.show {
  display: flex;
}

.message-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  padding: 10px 13px;
  border-radius: 9px;
  cursor: pointer;
  color: #2D3748;
  font-weight: 600;
  font-size: 0.93rem;
  text-align: left;
  transition: background 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

.message-menu-item:hover {
  background: linear-gradient(135deg, rgba(1, 69, 79, 0.1), rgba(2, 103, 114, 0.08));
  color: #01454F;
  transform: translateX(2px);
}

.message-menu-item i {
  font-size: 1rem;
  opacity: 0.8;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.message-menu-item:hover i {
  opacity: 1;
  transform: scale(1.1);
}

/* reply preview no formulário */
.reply-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(1, 69, 79, 0.06), rgba(1, 69, 79, 0.03));
  border: 1px solid rgba(1, 69, 79, 0.1);
  border-radius: 10px;
  margin-bottom: 6px;
}

.internal-forwarded-label {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
  color: rgba(1, 69, 79, 0.72);
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 700;
  line-height: 1.1;
}

.internal-forwarded-label i {
  font-size: 0.78rem;
}

.internal-message-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.internal-media-link {
  display: inline-flex;
  max-width: 100%;
  color: inherit;
  text-decoration: none;
}

.internal-media-image {
  display: block;
  width: min(280px, 100%);
  max-height: 300px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(1,69,79,0.14);
}

.internal-media-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 190px;
  max-width: 100%;
  padding: 10px;
  border: 1px solid rgba(1,69,79,0.14);
  border-radius: 11px;
  color: inherit;
  background: rgba(255,255,255,0.18);
  text-decoration: none;
}

.internal-media-file > i { color: #026672; font-size: 1.4rem; }
.internal-media-file span { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.internal-media-file strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.internal-media-file small { opacity: 0.68; }
.internal-media-download-icon { margin-left: auto; color: #026672; }

.internal-media-file.is-downloading,
.internal-media-audio-download.is-downloading {
  pointer-events: none;
  opacity: 0.72;
}

.internal-media-file.is-downloaded,
.internal-media-audio-download.is-downloaded {
  color: #0d6b47;
  border-color: rgba(13, 107, 71, 0.34);
  background: rgba(218, 250, 234, 0.82);
  box-shadow: 0 3px 10px rgba(13, 107, 71, 0.14);
  animation: internal-download-complete 0.5s ease-out both;
}

.internal-media-file.is-downloaded > i,
.internal-media-audio-download.is-downloaded > i {
  color: #0d8a59;
  animation: internal-download-check 0.45s ease-out both;
}

.internal-media-file.is-downloaded .internal-media-download-icon {
  display: none;
}

.internal-media-file.is-downloaded strong::after,
.internal-media-audio-download.is-downloaded span::after {
  content: ' · baixado';
  color: #0d8a59;
  font-size: 0.75rem;
  font-weight: 600;
}

.internal-download-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(2,134,144,0.2);
  border-top-color: #026672;
  border-radius: 50%;
  animation: internal-download-spin 0.75s linear infinite;
}

.internal-download-progress {
  min-width: 32px;
  color: #026672;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@keyframes internal-download-spin {
  to { transform: rotate(360deg); }
}

@keyframes internal-download-complete {
  0% { opacity: 0.7; transform: scale(0.97); box-shadow: 0 0 0 rgba(20, 170, 103, 0); }
  55% { opacity: 1; transform: scale(1.015); box-shadow: 0 0 0 5px rgba(20, 170, 103, 0.12), 0 5px 16px rgba(20, 170, 103, 0.22); }
  100% { opacity: 1; transform: scale(1); box-shadow: 0 3px 10px rgba(13, 107, 71, 0.14); }
}

@keyframes internal-download-check {
  0% { opacity: 0; transform: scale(0.5) rotate(-18deg); }
  70% { opacity: 1; transform: scale(1.16) rotate(4deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

.internal-media-audio {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 11px;
  border: 1px solid rgba(255,255,255,0.58);
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(255,255,255,0.42), rgba(196,236,237,0.26));
  box-shadow: 0 12px 26px rgba(1,69,79,0.12), inset 0 1px 0 rgba(255,255,255,0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.internal-media-audio-player {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.internal-media-audio-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto; /* slightly larger play button */
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.internal-media-audio-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #01454f, #0a8790);
  box-shadow: 0 7px 15px rgba(1,69,79,0.24), inset 0 1px 0 rgba(255,255,255,0.26);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.internal-media-audio-play:hover,
.internal-media-audio-play:focus-visible {
  transform: scale(1.06);
  box-shadow: 0 9px 19px rgba(1,69,79,0.3), 0 0 0 4px rgba(10,135,144,0.12);
}

.internal-media-audio-play i {
  font-size: 1.25rem;
  line-height: 1;
}

.internal-media-audio-play.is-playing {
  background: linear-gradient(145deg, #a94442, #c85b58);
}

.internal-media-audio-progress {
  width: 100%;
  height: 4px;
  accent-color: #026672;
  cursor: pointer;
}

.internal-media-audio-time {
  min-width: 0;
  white-space: nowrap;
  color: rgba(23,59,61,0.7);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.internal-media-audio-download {
  display: inline-flex;
  align-items: center;
  align-self: flex-end;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 8px;
  color: #026672;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255,255,255,0.42);
}

.internal-media-audio-download:hover,
.internal-media-audio-download:focus-visible {
  color: #01454f;
  background: rgba(255,255,255,0.78);
}

.internal-image-modal {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.internal-image-modal.show { display: flex; }
.internal-image-backdrop { position: absolute; inset: 0; background: rgba(1, 20, 24, 0.76); backdrop-filter: blur(8px); }
.internal-image-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(94vw, 980px);
  max-height: 92vh;
  overflow: hidden;
  border: 1px solid rgba(173, 250, 241, 0.25);
  border-radius: 18px;
  background: rgba(3, 37, 42, 0.9);
  box-shadow: 0 24px 70px rgba(0,0,0,0.42), inset 0 1px 0 rgba(255,255,255,0.12);
  backdrop-filter: blur(22px) saturate(135%);
}
.internal-image-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 15px; color: #eaffff; border-bottom: 1px solid rgba(173,250,241,0.14); }
.internal-image-actions { display: flex; align-items: center; gap: 6px; }
.internal-image-download, .internal-image-close { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 1px solid rgba(173,250,241,0.16); border-radius: 10px; color: #cffff9; background: rgba(255,255,255,0.07); cursor: pointer; text-decoration: none; }
.internal-image-download:hover, .internal-image-close:hover { color: #fff; background: rgba(79,224,211,0.2); }
.internal-image-download.is-downloading { width: auto; padding: 0 9px; gap: 5px; pointer-events: none; opacity: 0.72; }
.internal-image-download.is-downloaded { width: auto; padding: 0 11px; gap: 6px; color: #b9f7d7; border-color: rgba(91, 227, 158, 0.58); background: rgba(25, 142, 88, 0.32); box-shadow: 0 4px 14px rgba(20, 170, 103, 0.2); animation: internal-download-complete 0.5s ease-out both; }
.internal-image-download.is-downloaded:hover { color: #eafff2; background: rgba(25, 142, 88, 0.46); }
.internal-image-download.is-downloaded i { animation: internal-download-check 0.45s ease-out both; }
.internal-image-content { display: grid; place-items: center; min-height: 180px; padding: 18px; overflow: auto; }
.internal-image-content img { display: block; max-width: 100%; max-height: calc(92vh - 100px); object-fit: contain; border-radius: 10px; }

.reply-preview-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.reply-preview-text {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reply-cancel-btn {
  background: transparent;
  border: 0;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--muted);
  font-size: 1rem;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.reply-cancel-btn:hover {
  opacity: 1;
}

/* make message bubbles less wide on large screens while keeping responsive behavior */
@media(min-width:1200px) {
  .chat-window .message {
    max-width: min(50%, 36ch)
  }

  .message-container.me {
    margin-left: 80px
  }

  .message-container.them {
    margin-right: 80px
  }
}

@media(min-width:768px) and (max-width:1199px) {
  .message-container.me {
    margin-left: 50px
  }

  .message-container.them {
    margin-right: 50px
  }
}

@media(max-width:767px) {
  .message-container.me {
    margin-left: 30px
  }

  .message-container.them {
    margin-right: 30px
  }
}

.chat-composer {
  margin-top: 6px
}

.chat-confirm-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  visibility: hidden;
  opacity: 0;
  z-index: 5000;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.chat-confirm-modal.show {
  visibility: visible;
  opacity: 1;
}

.chat-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 24, 27, 0.32);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.chat-confirm-dialog {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(420px, 100%);
  padding: 22px 22px 76px;
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255,255,255,0.88), rgba(235,247,248,0.78));
  box-shadow: 0 24px 70px rgba(1, 45, 51, 0.28), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  transform: translateY(8px) scale(0.97);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
}

.chat-confirm-modal.show .chat-confirm-dialog {
  transform: translateY(0) scale(1);
}

.chat-confirm-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(177, 61, 58, 0.16);
  border-radius: 14px;
  color: #a94442;
  background: linear-gradient(145deg, rgba(255,238,237,0.86), rgba(255,218,216,0.54));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 8px 18px rgba(169,68,66,0.1);
}

.chat-confirm-icon i {
  font-size: 1.15rem;
}

.chat-confirm-content {
  min-width: 0;
  flex: 1;
}

.chat-confirm-content h3 {
  margin: 1px 0 5px;
  color: #173b3d;
  font-size: 1rem;
  font-weight: 750;
}

.chat-confirm-content p {
  margin: 0;
  color: rgba(23,59,61,0.7);
  font-size: 0.86rem;
  line-height: 1.45;
}

.chat-confirm-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: absolute;
  right: 22px;
  bottom: 18px;
}

.chat-confirm-btn {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.chat-confirm-cancel {
  color: #315b5e;
  border-color: rgba(1,69,79,0.1);
  background: rgba(255,255,255,0.5);
}

.chat-confirm-danger {
  color: #ffffff;
  background: linear-gradient(135deg, #a94442, #c85b58);
  box-shadow: 0 8px 18px rgba(169,68,66,0.18);
}

.chat-confirm-btn:hover,
.chat-confirm-btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(1,69,79,0.12);
}

.chat-confirm-danger:hover,
.chat-confirm-danger:focus-visible {
  box-shadow: 0 9px 20px rgba(169,68,66,0.25);
}

.chat-confirm-btn:focus-visible {
  outline: 2px solid rgba(2,103,114,0.35);
  outline-offset: 2px;
}

.chat-forward-dialog {
  position: relative;
  width: min(520px, 100%);
  max-height: min(680px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.62);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(232,246,247,0.82));
  box-shadow: 0 26px 80px rgba(1,45,51,0.3), inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(26px) saturate(145%);
  -webkit-backdrop-filter: blur(26px) saturate(145%);
  transform: translateY(8px) scale(0.97);
  transition: transform 0.22s cubic-bezier(.2,.8,.2,1);
}

.chat-confirm-modal.show .chat-forward-dialog {
  transform: translateY(0) scale(1);
}

.chat-forward-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 22px 16px;
}

.chat-forward-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chat-forward-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(1,69,79,0.1);
  border-radius: 14px;
  color: #026672;
  background: linear-gradient(145deg, rgba(222,245,246,0.9), rgba(255,255,255,0.58));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86), 0 8px 18px rgba(1,69,79,0.08);
}

.chat-forward-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  border: 1px solid rgba(1,69,79,0.08);
  border-radius: 10px;
  color: rgba(23,59,61,0.7);
  background: rgba(255,255,255,0.5);
  cursor: pointer;
}

.chat-forward-close:hover {
  color: #ffffff;
  background: #01454f;
}

.chat-forward-tabs {
  display: flex;
  gap: 4px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(1,69,79,0.08);
}

.chat-forward-tab {
  position: relative;
  padding: 10px 4px 12px;
  border: 0;
  color: rgba(23,59,61,0.58);
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.chat-forward-tab + .chat-forward-tab {
  margin-left: 16px;
}

.chat-forward-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: #026672;
  opacity: 0;
  transform: scaleX(0.5);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.chat-forward-tab.is-active {
  color: #01454f;
}

.chat-forward-tab.is-active::after {
  opacity: 1;
  transform: scaleX(1);
}

.chat-forward-panel {
  min-height: 190px;
  overflow: auto;
  padding: 12px 14px;
}

.chat-forward-panel[hidden] {
  display: none;
}

.chat-forward-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chat-forward-target {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: #173b3d;
  background: rgba(255,255,255,0.36);
  text-align: left;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.chat-forward-target:hover,
.chat-forward-target.is-selected {
  border-color: rgba(1,69,79,0.14);
  background: linear-gradient(135deg, rgba(218,241,242,0.78), rgba(255,255,255,0.62));
  transform: translateX(2px);
}

.chat-forward-avatar {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, #01454f, #0a8790);
  font-size: 0.72rem;
  font-weight: 800;
}

.chat-forward-avatar.whatsapp {
  color: #167b4b;
  background: linear-gradient(135deg, rgba(211,247,226,0.92), rgba(255,255,255,0.64));
}

.chat-forward-target-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.chat-forward-target-copy strong,
.chat-forward-target-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-forward-target-copy strong {
  font-size: 0.84rem;
}

.chat-forward-target-copy small,
.chat-forward-loading,
.chat-forward-empty {
  color: rgba(23,59,61,0.58);
  font-size: 0.74rem;
}

.chat-forward-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(1,69,79,0.08);
}

#icForwardSelectedTarget {
  min-width: 0;
  overflow: hidden;
  color: rgba(23,59,61,0.62);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-forward-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.chat-forward-processing {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: inherit;
  background: rgba(232, 248, 248, 0.58);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.chat-forward-processing-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(320px, 100%);
  padding: 22px 18px;
  border: 1px solid rgba(255,255,255,0.72);
  border-radius: 18px;
  color: #173b3d;
  background: linear-gradient(145deg, rgba(255,255,255,0.86), rgba(208,242,242,0.72));
  box-shadow: 0 18px 42px rgba(1,69,79,0.18), inset 0 1px 0 rgba(255,255,255,0.92);
  text-align: center;
}

.chat-forward-processing-card strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 0.88rem;
}

.chat-forward-processing-card small {
  color: rgba(23,59,61,0.62);
  font-size: 0.72rem;
  line-height: 1.4;
}

.chat-forward-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(2,102,114,0.16);
  border-top-color: #026672;
  border-radius: 50%;
  animation: chat-forward-spin 0.8s linear infinite;
}

.chat-forward-processing.is-error .chat-forward-spinner {
  border-color: rgba(169,68,66,0.18);
  border-top-color: #a94442;
  animation: none;
}

.chat-forward-processing.is-error .chat-forward-processing-card {
  color: #7e302e;
  border-color: rgba(169,68,66,0.24);
  background: linear-gradient(145deg, rgba(255,245,244,0.94), rgba(255,225,222,0.8));
}

@keyframes chat-forward-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 520px) {
  .chat-confirm-dialog {
    padding-bottom: 70px;
  }
}

/* Call recording visuals */
.internal-media-call-recording {
  border: 1px solid rgba(160, 30, 45, 0.12);
  background: linear-gradient(180deg, rgba(225,60,80,0.04), rgba(255,255,255,0.02));
  padding: 10px;
  border-radius: 12px;
}
.internal-media-call-recording .internal-media-audio-controls { margin-top: 6px; }
.internal-media-call-recording-badge {
  display: inline-block;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(90deg, rgba(255,245,246,0.9), rgba(250,235,238,0.7));
  color: #8b1a2d;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  margin-bottom: 6px;
  box-shadow: 0 6px 18px rgba(170,30,45,0.06);
  border: 1px solid rgba(170,30,45,0.08);
  transition: transform .18s ease, box-shadow .2s ease;
}

.internal-media-call-recording-badge i { font-size: 1rem; color: #b71d38 }
.internal-media-call-recording-badge:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(170,30,45,0.12) }
.internal-media-call-recording-badge.pulse { animation: callBadgePulse 1.6s infinite; }
@keyframes callBadgePulse { 0% { transform: scale(1) } 50% { transform: scale(1.03) } 100% { transform: scale(1) } }

/* Stronger visual for call recording badge */
.internal-media-call-recording-badge {
  background: linear-gradient(90deg,#ff7b7b,#d92e4a);
  color: #fff;
  border: 0;
  padding: 6px 8px; /* smaller padding for tighter fit */
  font-weight: 900;
  letter-spacing: .02em;
  font-size: 0.82rem; /* slightly smaller text for badge */
}
.internal-media-call-recording-badge i { font-size: 1.05rem; margin-right: 6px }
.internal-media-call-recording-text { font-size: 0.86rem }
.internal-media-call-recording-owner {
  display: inline-block;
  margin-left: 6px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  opacity: 0.95;
}
.internal-media-call-recording-badge { box-shadow: 0 10px 30px rgba(217,46,74,0.18), 0 0 18px rgba(255,123,123,0.08); transform-origin: center; }
.internal-media-call-recording-badge::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 10px;
  right: 8px;
  top: 8px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0) 40%);
  border-radius: 50%;
  opacity: 0.7;
}
.internal-media-call-recording-badge { position: relative }

.internal-media-call-recording-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap; /* allow badge/label to wrap on narrow containers */
}
.internal-media-call-recording-label strong { font-weight: 700; display:block }
.internal-media-call-recording-label small { font-size: .75rem; color: #6b7f85 }
.internal-media-call-recording-remote {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(18, 30, 34, 0.03);
  border: 1px solid rgba(18,30,34,0.04);
}
.internal-media-call-recording-badge { flex: 0 0 auto; min-width: 0 }
.internal-media-call-recording-label { flex: 1 1 auto; min-width: 0; overflow: hidden }
.internal-media-call-recording-label strong, .internal-media-call-recording-label small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.internal-media-call-recording-remote i {
  font-size: 1.2rem;
  color: #a11d36;
}
.internal-media-call-recording-info strong { display: block; font-weight: 700; }
.internal-media-call-recording-info small { display: block; color: #6b7f85; font-size: .8rem }

/* Emphasize play button for recorder's calls */
.internal-media-audio.internal-media-call-recording .internal-media-audio-play i {
  color: #aa1e35;
}
.internal-media-audio.internal-media-call-recording {
  background: linear-gradient(90deg, rgba(255,245,246,0.95), rgba(255,255,255,0.92));
  border: 1px solid rgba(170,30,45,0.12);
  padding: 10px; /* tighter padding for compact layout */
  border-radius: 12px;
  display: flex;
  flex-direction: row; /* horizontal layout: badge + label + player */
  align-items: center;
  gap: 12px;
}

/* Header (badge + label) should not push controls; allow label to truncate */
.internal-media-call-recording-header { display: flex; align-items: center; gap: 10px; min-width: 0 }
.internal-media-call-recording-badge { flex: 0 0 auto; margin-right: 8px }
.internal-media-call-recording-label { flex: 1 1 auto; min-width: 0; overflow: hidden }
.internal-media-call-recording-label strong, .internal-media-call-recording-label small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

/* Reserve space on the right so message meta/menu don't overlap the audio box */
.internal-media-audio.internal-media-call-recording { padding-right: 64px }

/* Refine label typography and spacing to avoid stacked/clipped text */
.internal-media-call-recording-label strong {
  font-size: 0.95rem;
  line-height: 1.1;
  margin: 0;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.internal-media-call-recording-label small {
  display: block;
  font-size: 0.70rem;
  color: rgba(23,59,61,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* Slightly smaller icon inside the badge so text has room */
.internal-media-call-recording-badge i { font-size: 0.92rem }

/* Ensure the download link and controls align to the right cleanly */
.internal-media-audio-download { margin-left: 8px; color: inherit }

/* Lower contrast filename color for less visual weight */
.internal-media-call-recording-label small { color: rgba(23,59,61,0.5) }

/* Place audio controls to the right */
.internal-media-audio-controls { grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px }
.internal-media-audio-download { margin-left: 8px }

/* Ensure on small screens the layout stacks vertically */
@media (max-width: 640px) {
  .internal-media-audio.internal-media-call-recording { flex-direction: column; align-items: stretch }
  .internal-media-call-recording-header { width: 100% }
  .internal-media-audio-controls { grid-template-columns: 38px minmax(0, 1fr) auto }
  .internal-media-audio-play { width: 40px; height: 40px }
}

/* Ensure audio box doesn't overflow its container */
.internal-media-audio.internal-media-call-recording { min-width: 0 }

.chat-composer .input-group {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  position: relative;
}

.chat-composer {
  padding-bottom: 24px;
  position: relative;
}

.chat-composer.is-dragging-files {
  outline: 2px dashed #0b9f8f;
  outline-offset: 6px;
  border-radius: 14px;
  background: rgba(11, 159, 143, 0.08);
}

.wachat-main.is-dragging-files {
  outline: 2px dashed #0b9f8f;
  outline-offset: -6px;
  border-radius: 14px;
  background: rgba(11, 159, 143, 0.08);
}

.wachat-main.is-dragging-files::before {
  content: 'Solte os arquivos para anexar';
  position: absolute;
  inset: 8px;
  z-index: 20;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #087b75;
  background: rgba(238, 255, 253, 0.9);
  font-size: 0.82rem;
  font-weight: 800;
  pointer-events: none;
}

.chat-composer.is-dragging-files::before {
  content: 'Solte os arquivos para anexar';
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #087b75;
  background: rgba(238, 255, 253, 0.9);
  font-size: 0.82rem;
  font-weight: 800;
  pointer-events: none;
}

.ic-voice-recording-panel {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 18px;
  color: #173b3d;
  background: linear-gradient(135deg, rgba(255,255,255,0.78), rgba(214,245,245,0.58));
  box-shadow: 0 12px 28px rgba(1,69,79,0.12), inset 0 1px 0 rgba(255,255,255,0.92);
  backdrop-filter: blur(22px) saturate(145%);
  -webkit-backdrop-filter: blur(22px) saturate(145%);
  overflow: hidden;
}

.ic-voice-recording-panel.is-active {
  display: flex;
  animation: ic-voice-panel-in 0.22s ease-out;
}

.ic-voice-recording-panel.is-recording {
  border-color: rgba(2, 134, 144, 0.36);
}

.ic-voice-recording-panel.is-recording .ic-voice-recording-badge i,
.ic-voice-recording-panel.is-recording .ic-voice-recording-live i {
  animation: ic-voice-pulse 1.15s ease-in-out infinite;
}

.ic-voice-recording-top,
.ic-voice-recording-main,
.ic-voice-recording-details,
.ic-voice-recording-badge,
.ic-voice-recording-live {
  display: flex;
  align-items: center;
}

.ic-voice-recording-top {
  justify-content: space-between;
  gap: 10px;
  color: rgba(23,59,61,0.62);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ic-voice-recording-badge,
.ic-voice-recording-live {
  gap: 5px;
}

.ic-voice-recording-badge {
  color: #026672;
}

.ic-voice-recording-badge i {
  font-size: 0.92rem;
}

.ic-voice-recording-status {
  color: #a94442;
}

.ic-voice-recording-panel.is-preview .ic-voice-recording-status {
  color: #026672;
}

.ic-voice-recording-main {
  gap: 8px;
  min-width: 0;
}

.ic-voice-recording-wave {
  flex: 1 1 auto;
  min-width: 56px;
  height: 36px;
  padding: 4px 0;
  border-top: 1px solid rgba(1,69,79,0.08);
  border-bottom: 1px solid rgba(1,69,79,0.08);
}

.ic-voice-recording-wave canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ic-voice-recording-details {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  min-width: 50px;
  color: #315b5e;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.ic-voice-recording-live {
  color: #a94442;
  font-size: 0.62rem;
  font-weight: 750;
  text-transform: uppercase;
}

.ic-voice-recording-live i {
  font-size: 0.58rem;
}

.ic-voice-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid rgba(1,69,79,0.12);
  border-radius: 12px;
  color: #315b5e;
  background: rgba(255,255,255,0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.ic-voice-action:hover,
.ic-voice-action:focus-visible {
  color: #01454f;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 6px 14px rgba(1,69,79,0.12);
  transform: translateY(-1px);
}

.ic-voice-action--discard:hover,
.ic-voice-action--discard:focus-visible {
  color: #a94442;
}

.ic-voice-action--send {
  color: #fff;
  border-color: rgba(1,69,79,0.28);
  background: linear-gradient(135deg, #01454f, #0a8790);
  box-shadow: 0 7px 16px rgba(1,69,79,0.2);
}

.ic-voice-action--send:hover,
.ic-voice-action--send:focus-visible {
  color: #fff;
  background: linear-gradient(135deg, #013b43, #06717a);
}

.ic-voice-action--resume {
  display: none;
  color: #026672;
}

.ic-voice-recording-panel.is-record-paused .ic-voice-action--pause {
  display: none;
}

.ic-voice-recording-panel.is-record-paused .ic-voice-action--resume {
  display: inline-flex;
}

.chat-composer .input-group.composer-row--recording > #icMessageInput,
.chat-composer .input-group.composer-row--voice-preview > #icMessageInput,
.chat-composer .input-group.composer-row--recording > .ic-composer-tools,
.chat-composer .input-group.composer-row--voice-preview > .ic-composer-tools,
.chat-composer .input-group.composer-row--recording > .ic-selected-files,
.chat-composer .input-group.composer-row--voice-preview > .ic-selected-files,
.chat-composer .input-group.composer-row--recording > button[type="submit"],
.chat-composer .input-group.composer-row--voice-preview > button[type="submit"] {
  display: none;
}

@keyframes ic-voice-pulse {
  0%, 100% { opacity: 0.42; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.12); }
}

@keyframes ic-voice-panel-in {
  from { opacity: 0; transform: translateY(5px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 560px) {
  .ic-voice-recording-panel {
    padding: 9px;
  }

  .ic-voice-recording-main {
    gap: 5px;
  }

  .ic-voice-action {
    width: 31px;
    height: 31px;
    flex-basis: 31px;
    border-radius: 10px;
  }

  .ic-voice-recording-details {
    min-width: 42px;
  }
}

.ic-composer-tools {
  position: relative;
  flex: 0 0 auto;
}

.ic-composer-tools-toggle {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(1, 69, 79, 0.18);
  border-radius: 12px;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(255,255,255,0.86), rgba(215,241,241,0.56));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.94), 0 8px 18px rgba(1,69,79,0.1);
  backdrop-filter: blur(14px) saturate(130%);
  -webkit-backdrop-filter: blur(14px) saturate(130%);
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ic-composer-tools-toggle:hover,
.ic-composer-tools-toggle:focus-visible,
.ic-composer-tools-toggle[aria-expanded="true"] {
  color: #fff;
  border-color: rgba(1,69,79,0.45);
  background: linear-gradient(135deg, #01454f, #078896);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(1,69,79,0.24), 0 0 0 4px rgba(7,136,150,0.1);
}

.ic-composer-tools-toggle i {
  display: inline-block;
  transition: transform 0.2s ease;
}

.ic-composer-tools-toggle[aria-expanded="true"] i {
  transform: rotate(180deg);
}

.ic-composer-tools-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 20;
  display: grid;
  gap: 5px;
  min-width: 178px;
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,0.94), rgba(222,246,245,0.82));
  box-shadow: 0 18px 38px rgba(1,69,79,0.2), inset 0 1px 0 rgba(255,255,255,0.96);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  animation: composer-menu-in 0.18s ease-out both;
}

.ic-composer-tools-menu[hidden] {
  display: none;
}

.ic-composer-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.ic-composer-tool:hover {
  color: var(--accent);
  border-color: rgba(1,69,79,0.1);
  background: rgba(207,239,239,0.78);
  transform: translateX(2px);
}

.header-menu .menu-item:disabled {
  color: rgba(24,63,69,0.38);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.7;
  transform: none;
}

.ic-composer-tool i {
  width: 22px;
  color: #026672;
  text-align: center;
}

.ic-selected-files {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  z-index: 25;
  width: min(360px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid rgba(1,69,79,0.16);
  border-radius: 15px;
  background: rgba(248,253,253,0.9);
  box-shadow: 0 16px 34px rgba(1,69,79,0.16), inset 0 1px 0 rgba(255,255,255,0.86);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
}

.ic-selected-files[hidden] { display: none; }

.ic-selected-files-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 750;
}

#icSelectedFilesCount {
  min-width: 0;
  line-height: 1.25;
}

#icAddMoreFiles {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  color: #026672;
  background: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

#icAddMoreFiles:hover { color: #01454f; }

.ic-selected-files-list {
  display: grid;
  gap: 5px;
  max-height: 190px;
  overflow-y: auto;
}

.ic-selected-file {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(1,69,79,0.09);
  border-radius: 10px;
  color: var(--text);
  background: rgba(255,255,255,0.58);
}

.ic-selected-file > i { color: #026672; font-size: 0.95rem; }
.ic-selected-file span { min-width: 0; font-size: 0.76rem; }
.ic-selected-file .ic-selected-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ic-file-upload-track { width: 74px; height: 5px; flex: 0 0 74px; overflow: hidden; border-radius: 999px; background: rgba(2, 134, 144, 0.14); }
.ic-file-upload-track > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #08a6a6, #36b8ae); transition: width 0.15s ease; }
.ic-file-upload-progress { flex: 0 0 34px; color: #026672; font-size: 0.7rem !important; text-align: right; }
.ic-selected-file button { border: 0; color: #8b3f49; background: transparent; cursor: pointer; }
.ic-selected-file button:hover { color: #b42334; }

.ic-selected-file .ic-file-upload-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  min-width: 18px;
  flex: 0 0 18px;
  box-sizing: border-box;
  border: 2px solid rgba(2,134,144,0.18);
  border-top-color: #026672;
  border-right-color: #08a6a6;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(2,134,144,0.06);
  animation: ic-file-upload-spin 0.75s linear infinite;
}

.ic-file-upload-ready,
.ic-file-upload-error {
  flex: 0 0 auto;
  font-size: 0.86rem;
}

.ic-file-upload-ready { color: #16865a; }
.ic-file-upload-error { color: #b42334; }

@keyframes ic-file-upload-spin {
  to { transform: rotate(360deg); }
}

.chat-composer input.form-control {
  min-height: 46px;
  background: linear-gradient(145deg, rgba(255,255,255,0.84), rgba(235,248,248,0.7));
  border: 1px solid rgba(1, 69, 79, 0.12);
  color: inherit;
  border-radius: 14px;
  padding: 12px 15px;
  flex: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 7px 18px rgba(1,69,79,0.06);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chat-composer input.form-control::placeholder {
  color: rgba(15,43,44,0.48);
}

.chat-composer input.form-control:hover {
  border-color: rgba(1,69,79,0.24);
}

.chat-composer input.form-control:focus {
  border-color: rgba(2,134,144,0.58);
  outline: none;
  background: rgba(255,255,255,0.94);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.96), 0 0 0 4px rgba(2,134,144,0.1), 0 10px 24px rgba(1,69,79,0.1);
}

.chat-composer .btn.btn-primary {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  min-width: 46px;
  background: linear-gradient(135deg, #01454F 0%, #026672 100%);
  border: 0;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(1, 69, 79, 0.25);
  white-space: nowrap;
}

.chat-composer .chat-send-button i {
  font-size: 1.08rem;
  transition: transform 0.2s ease;
}

.chat-composer .chat-send-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.chat-composer .btn.btn-primary:hover {
  background: linear-gradient(135deg, #026672 0%, #013d47 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(1, 69, 79, 0.35);
}

.chat-composer .chat-send-button:not(:disabled):hover i {
  transform: translateX(2px) rotate(-8deg);
}

@keyframes composer-menu-in {
  from { opacity: 0; transform: translateY(6px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-composer .btn.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(1, 69, 79, 0.25);
}

/* subtle animations */
.contact {
  transition: transform .12s ease, box-shadow .12s ease
}

.contact:hover {
  transform: translateY(-2px)
}

/* Responsive */
@media(max-width:800px) {
  body.internal-chat-page {
    overflow: hidden;
  }

  body.internal-chat-page main {
    min-height: 0;
    overflow: hidden;
  }

  .app-layout {
    gap: 0;
    padding: 8px 8px 0;
    height: calc(100dvh - 96px);
  }

  aside.ic-contact-sidebar {
    position: fixed;
    inset: 8px auto 8px 8px;
    z-index: 1300;
    width: min(88vw, 340px);
    max-width: none;
    transform: translateX(calc(-100% - 16px));
    transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease;
    box-shadow: 18px 0 48px rgba(1,36,43,.22);
  }

  aside.ic-contact-sidebar.is-mobile-open {
    transform: translateX(0);
  }

  body.internal-contacts-open::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 1250;
    background: rgba(4,30,35,.36);
    backdrop-filter: blur(3px);
  }

  .ic-contact-sidebar-close {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 10px;
    color: rgba(255,255,255,.92);
    background: rgba(255,255,255,.08);
    cursor: pointer;
  }

  .ic-mobile-contacts-trigger {
    display: none;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(1,69,79,.12);
    border-radius: 12px;
    color: #01454f;
    background: rgba(255,255,255,.72);
    box-shadow: 0 8px 18px rgba(1,69,79,.1);
    cursor: pointer;
  }

  .wachat-chat-header-actions .ic-mobile-contacts-trigger {
    display: grid;
    flex: 0 0 38px;
  }

  .ic-mobile-contacts-trigger:hover {
    background: rgba(220,247,245,.9);
  }

  .wachat-main {
    width: 100%;
    gap: 8px;
    min-height: 0;
  }

  .wachat-selection-actions.show {
    position: absolute;
    left: 5%;
    bottom: 83%;
    z-index: 30;
    gap: 4px;
    margin: 0;
    padding: 3px;
    border-radius: 12px;
    max-width: calc(100% - 10%);
    animation: selectionActionsMobileIn 0.2s ease-out;
    box-shadow: 0 10px 24px rgba(1,69,79,0.18), inset 0 1px 0 rgba(255,255,255,0.82);
  }

  .wachat-selection-action {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 9px;
  }

  .wachat-selection-action i {
    font-size: 0.86rem;
  }

  @keyframes selectionActionsMobileIn {
    from { opacity: 0; transform: translateY(6px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }

  .wachat-chat-header {
    min-height: 58px;
    padding: 8px 10px;
    gap: 8px;
  }

  .wachat-chat-header-info {
    gap: 8px;
    padding-left: 46px;
  }

  .chat-window {
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
    padding: 10px;
    border-radius: 12px;
  }

  .chat-composer {
    flex: 0 0 auto;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
}