/* Final chat skin. Loaded last so legacy/mobile rules cannot split the screen. */
.social-app .chat-room {
  box-sizing: border-box;
  z-index: 20;
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 0;
  padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom);
  overflow: hidden;
  color: #242423;
  background: #f4f4f2;
  display: flex;
  flex-direction: column;
}

.social-app.chat-open .chat-room { visibility: visible; transform: none; }
.chat-room .message-day { display: none; }
.chat-room .char-mention-strip[hidden] { display: none !important; }
.chat-room .char-mention-strip:not([hidden]) { flex: 0 0 auto; }

.chat-room .chat-person {
  box-sizing: border-box;
  height: 76px;
  min-width: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 38px 40px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 10px;
  flex: 0 0 76px;
  border-bottom: 1px solid #ddddda;
}
.chat-room .chat-person > button {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #313130;
  background: transparent;
}
.chat-room .chat-person > button svg { width: 19px; height: 19px; fill: currentColor; }
.chat-room .chat-person > .friend-avatar {
  width: 40px;
  height: 40px;
  margin: 0;
  align-self: center;
  border: 1px solid #d2d2cf;
  background: #e4e4e0;
  color: #262625;
  font-size: 11px;
}
.chat-room .chat-person > div:nth-of-type(2) {
  min-width: 0;
  margin: 0;
  align-self: center;
  text-align: left;
}
.chat-room .chat-person > div:nth-of-type(2) strong,
.chat-room .chat-person > div:nth-of-type(2) span { display: block; }
.chat-room .chat-person > div:nth-of-type(2) strong {
  overflow: hidden;
  color: #242423;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: .01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-room .chat-person > div:nth-of-type(2) span {
  margin-top: 4px;
  color: #92928e;
  font-size: 8px;
  line-height: 1;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.chat-room .message-list {
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  padding: 18px 2px 20px;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chat-room .message-list::-webkit-scrollbar { display: none; }
.chat-room .message-row {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin: 0 0 15px;
  display: flex;
  align-items: flex-end;
  gap: 9px;
}
.chat-room .message-row.mine { justify-content: flex-end; }
.chat-room .message-avatar {
  position: relative;
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e4e4e0;
  color: #272726;
  font-size: 8px;
  font-weight: 600;
}
.chat-room .message-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-room .message {
  box-sizing: border-box;
  max-width: min(78%, 420px);
  padding: 1px 0 1px 12px;
  border: 0;
  border-left: 1px solid #c4c4c0;
  border-radius: 0;
  background: transparent;
  color: #2c2c2a;
  box-shadow: none;
  font-size: 11px;
  line-height: 1.58;
  overflow-wrap: anywhere;
}
.chat-room .message.mine {
  align-self: auto;
  padding: 1px 12px 1px 0;
  border: 0;
  border-right: 1px solid #777773;
  border-radius: 0;
  background: transparent;
  color: #20201f;
}
.chat-room .message.character {
  border: 0;
  border-left: 1px solid #aaa9a5;
  border-radius: 0;
  background: transparent;
  color: #2c2c2a;
}
.chat-room .message time {
  display: block;
  margin-top: 5px;
  color: #999995;
  font-size: 7px;
  line-height: 1;
  letter-spacing: .06em;
  opacity: 1;
}
.chat-room .message.mine time { text-align: right; }
.chat-room .message-sending { opacity: .48; }
.chat-room .message-sending time::after { content: " · SENDING"; letter-spacing: .08em; }
.chat-room .message-author {
  margin: 0 0 5px !important;
  color: #999995 !important;
  font-size: 7px !important;
  font-weight: 500 !important;
  letter-spacing: .1em;
}
.chat-room .message-time-divider {
  box-sizing: border-box;
  width: 100%;
  margin: 14px 0 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #999995;
  font-size: 7px;
  line-height: 1;
  letter-spacing: .12em;
  white-space: nowrap;
}
.chat-room .message-time-divider::before,
.chat-room .message-time-divider::after { content: ""; height: 1px; flex: 1; background: #dededb; }

.chat-room .message-composer {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  flex: 0 0 48px;
  margin: 8px 0 10px;
  padding: 0 7px 0 11px;
  align-self: center;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 7px;
  border: 1px solid #d4d4d0;
  border-radius: 18px;
  background: #e9e9e6;
  box-shadow: 0 7px 22px rgba(35, 35, 32, .08);
}
.chat-room .message-composer button {
  width: 27px;
  height: 27px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #bdbdb8;
  border-radius: 50%;
  background: transparent;
  color: #666663;
  font-size: 17px;
  font-weight: 300;
}
.chat-room .message-composer button:last-child {
  width: 32px;
  height: 32px;
  border: 0;
  background: #3a3a39;
  color: #f1f1ee;
}
.chat-room .message-composer button:last-child svg { width: 15px; height: 15px; }
.chat-room .message-composer textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 10px 2px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: #252524;
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.35;
}
.chat-room .message-composer textarea::placeholder { color: #8c8c88; font-size: 11px; }

@media (max-width: 430px) {
  .social-app .chat-room {
    inset: 0;
    height: 100dvh;
    padding: env(safe-area-inset-top) 14px env(safe-area-inset-bottom);
  }
  .chat-room .chat-person { height: 70px; flex-basis: 70px; }
  .chat-room .message-list { padding-top: 16px; }
  .chat-room .message-composer { margin-bottom: 10px; }
}
