#body {
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- Contact list (left panel) ---- */
#msgers .msg-contact {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px;
  margin: 0;
  border: none;
  border-bottom: 1px solid #e8e8e8;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease;
}

#msgers .msg-contact:hover {
  background: #ebebeb;
}

#msgers .msg-contact--active {
  background: #fff;
  border-left: 3px solid #b3b000;
  padding-left: 11px;
}

#msgers .msg-contact--new .msg-contact__name {
  font-weight: 700;
  color: #1f5c4a;
}

#msgers .msg-contact__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #b3b000;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
}

#msgers .msg-contact--new .msg-contact__avatar {
  background: #1f5c4a;
}

#msgers .msg-contact__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#msgers .msg-contact__name {
  font-size: 0.95rem;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#msgers .msg-contact__time {
  font-size: 0.75rem;
  color: #888;
}

#msgers .msg-contact__badge {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

#msgers .msg-contact--new .msg-contact__badge {
  background: #b3b000;
}

/* Legacy contact rows (fallback) */
.container {
  border: none;
  border-bottom: 1px solid #e8e8e8;
  background-color: transparent;
  border-radius: 0;
  padding: 12px 14px;
  margin: 0;
}

.container::after {
  content: "";
  clear: both;
  display: table;
}

.newemail {
  color: #1f5c4a;
  font-weight: 700;
}

.clickable {
  cursor: pointer;
}

.time-right {
  float: none;
  color: #888;
  font-size: 0.75rem;
}

/* ---- Message thread ---- */
#SentMsgs {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 8px 0 8px 0;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.msg-bubble {
  position: relative;
  max-width: 85%;
  padding: 10px 14px 12px;
  border-radius: 16px;
  line-height: 1.45;
  word-wrap: break-word;
}

.msg-bubble__meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  opacity: 0.85;
}

.msg-bubble__author {
  font-weight: 600;
}

.msg-bubble__time {
  font-weight: 400;
  opacity: 0.9;
}

.msg-bubble__time::before {
  content: "·";
  margin-right: 6px;
  opacity: 0.6;
}

.msg-bubble__text {
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
  -webkit-margin-before: 0;
  -webkit-margin-after: 0;
}

/* You — left, grey */
.msg-bubble--you {
  align-self: flex-start;
  background: #f1f1f1;
  color: #333;
  border-bottom-left-radius: 4px;
}

.msg-bubble--you::after {
  content: "";
  position: absolute;
  left: -6px;
  bottom: 10px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-right-color: #f1f1f1;
  border-left: 0;
}

/* Other party — right, brand green */
.msg-bubble--other {
  align-self: flex-end;
  background: #b3b000;
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg-bubble--other .msg-bubble__meta {
  color: rgba(255, 255, 255, 0.92);
}

.msg-bubble--other::after {
  content: "";
  position: absolute;
  right: -6px;
  bottom: 10px;
  width: 0;
  height: 0;
  border: 6px solid transparent;
  border-left-color: #b3b000;
  border-right: 0;
}

/* Legacy bubble classes (older cached HTML) */
.containermsgs {
  border: none;
  background-color: #f1f1f1;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  padding: 10px 14px;
  margin: 0;
  margin-left: 0;
  text-align: left;
  line-height: 1.45;
  max-width: 72%;
  align-self: flex-start;
}

.containermsgs2 {
  position: relative;
  border: none;
  background-color: #b3b000;
  color: #fff;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  padding: 10px 14px;
  margin: 0;
  margin-left: auto;
  text-align: left;
  line-height: 1.45;
  left: auto;
  width: auto;
  max-width: 72%;
  align-self: flex-end;
}

.tri-right.left-top:after,
.tri-right2.left-top2:after {
  display: none;
}

[contentEditable=true]:empty:not(:focus):before {
  content: attr(data-text);
}
