#chat .section-head { flex: none; }
.notice-register {
  flex: none;
  margin-inline-start: auto;
  min-height: 44px;
  padding: 8px 12px;
  border: var(--fm-border);
  border-radius: var(--fm-button-radius);
  background: var(--fm-bg);
  color: var(--fm-nav-active);
  font: 600 14px/20px var(--fm-font);
}
.notice-register:hover { background: var(--fm-primary-soft); }
dialog.notice-replace-dialog[open] {
  inset: 0; margin: auto; width: min(24rem, calc(100% - 2rem));
  padding: 1.3rem; border-radius: 1.25rem;
}
.notice-replace-dialog h2 { font-size: 1.25rem; }
.chat-profile {
  display: grid;
  place-items: center;
  height: 44px;
  min-width: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}
.chat-profile .profile-face {
  height: 40px;
  width: 40px;
  box-shadow: 0 0 0 2px var(--fm-bg);
}
#chat .chat-notice {
  flex: none;
  min-height: 40px;
  margin: 0 0 8px;
  padding: 8px 12px;
  gap: 8px;
  font-size: 13px;
  line-height: 20px;
  border: var(--fm-border);
  background: #fcf5ed;
  color: var(--fm-text);
  border-radius: var(--fm-button-radius);
}
#chat .notice-mark { font-weight: 600; }
#chat .chat-notice .fm-icon { flex: none; width: 16px; height: 16px; color: var(--fm-icon); }
#chat .chat-card {
  display: flex;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  margin-inline: calc(-1 * var(--content-pad));
  background: var(--fm-bg);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
#chat .message-list {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
  gap: 12px;
  padding: 0 var(--content-pad) 10px;
  overflow: auto;
  scrollbar-width: thin;
}
#chat .chat-day {
  display: flex;
  flex: none;
  align-items: center;
  gap: .7rem;
  width: 100%;
  margin: .25rem 0;
  padding: 0 .3rem;
  border: 0;
  background: transparent;
  color: var(--fm-muted);
  font-size: .78rem;
  text-align: center;
}
#chat .chat-day time {
  padding: .22rem .95rem;
  color: var(--fm-muted);
  background: var(--fm-primary-soft);
  border-radius: 1rem;
}
#chat .chat-day::before, #chat .chat-day::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--fm-line);
}
#chat .message {
  position: relative;
  flex: none;
  max-width: min(100%, calc(82% + 44px));
  padding-inline: 44px 0;
  gap: 0;
  color: var(--fm-text);
}
#chat .message.mine { padding-inline: 0 44px; }
#chat .message.mine.chat-followup { padding-inline-end: 0; }
#chat .chat-followup .chat-avatar,
#chat .chat-followup .message-author {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.chat-avatar {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: #e8cfbd;
  color: #573b2e;
  font-size: .92rem;
  font-weight: 650;
}
.mine .chat-avatar { inset-inline: auto 0; background: #efdbc4; }
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
#chat .message-author { margin: 0 0 4px 2px; font: 500 13px/18px var(--fm-font); color: var(--fm-text); }
#chat .message-text {
  margin: 0;
  padding: 10px 14px;
  color: var(--fm-text);
  border: var(--fm-border);
  border-radius: var(--fm-card-radius);
  box-shadow: var(--fm-card-shadow);
  background: var(--fm-card);
  font: 400 var(--fm-body-size)/var(--fm-body-line) var(--fm-font);
  overflow-wrap: anywhere;
}
#chat .mine .message-text {
  color: var(--fm-text);
  background: var(--fm-outgoing);
  border-color: transparent;
  border-radius: var(--fm-card-radius);
  box-shadow: none;
}
#chat .chat-with-photo { width: min(364px, calc(82% + 44px), 100%); }
.chat-photo-frame {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 8px 0 0;
}
.chat-image-open {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--fm-card-radius);
  background: var(--fm-primary-soft);
  cursor: zoom-in;
}
.chat-image-open img {
  display: block;
  width: 100%;
  aspect-ratio: 10 / 7;
  object-fit: cover;
}
.chat-meta { display: flex; align-items: center; gap: 8px; min-height: 24px; margin-top: 4px; }
#chat .message-time { margin: 0; color: var(--fm-muted); font: 400 var(--fm-meta-size)/var(--fm-meta-line) var(--fm-font); }
.chat-heart {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 1rem;
  color: var(--fm-icon);
  line-height: 1;
  background: transparent;
}
.chat-heart::after { content: ""; position: absolute; inset: -10px; border-radius: inherit; }
.chat-heart .fm-icon { width: 18px; height: 18px; }
.chat-heart-count:not([hidden]) {
  position: absolute;
  bottom: -3px;
  right: -6px;
  min-width: 14px;
  border-radius: 8px;
  background: var(--fm-card);
  color: var(--fm-primary-pressed);
  font: 600 10px/14px var(--fm-font);
}
.chat-heart[aria-pressed="true"] { color: var(--fm-primary); }
.chat-heart[aria-pressed="true"] .fm-icon { fill: currentColor; }
.chat-photo-frame .chat-heart {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px;
  height: 36px;
  border: var(--fm-border);
  border-radius: 50%;
  color: var(--fm-primary);
  background: var(--fm-card);
  box-shadow: var(--fm-card-shadow);
}
.chat-photo-frame .chat-heart::after { inset: -4px; }
.chat-photo-frame .chat-heart .fm-icon { width: 20px; height: 20px; }
#chat .composer {
  flex: none;
  align-items: flex-end;
  min-height: var(--fm-composer-h);
  gap: 8px;
  padding: 9px var(--content-pad) 10px;
  background: var(--fm-bg);
  border-top: var(--fm-border);
  border-radius: 0;
}
#chat .composer textarea {
  border: var(--fm-border);
  border-radius: 22px;
  color: var(--fm-text);
  background: var(--fm-card);
  padding: 9px 14px;
  font: 400 var(--fm-body-size)/var(--fm-body-line) var(--fm-font);
}
#chat .composer textarea::placeholder { color: var(--fm-muted); }
.chat-attach, #chat #send {
  display: grid;
  place-items: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}
.chat-attach { color: var(--fm-icon); background: var(--fm-bg); border: var(--fm-border); }
.chat-attach .fm-icon, #chat #send .fm-icon { width: 22px; height: 22px; }
#chat #send { border: 0; background: var(--fm-primary); color: white; }
#chat #send:hover { background: var(--fm-primary-hover); }
#chat #send:active { background: var(--fm-primary-pressed); }
#chat #chat-status:not(:empty) { flex: none; margin: .18rem 0; font-size: .82rem; }
.chat-pending {
  display: flex;
  flex: none;
  align-items: center;
  gap: .6rem;
  padding: .5rem .8rem;
  border-top: var(--fm-border);
  background: var(--fm-bg);
  color: var(--fm-text);
}
.chat-pending img { width: 48px; height: 48px; object-fit: cover; border-radius: .5rem; }
.chat-pending span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .86rem; }
.chat-remove { min-height: 44px; padding: .2rem .62rem; border: 0; background: transparent; color: #824531; }
.chat-pending[hidden] { display: none; }
@media (min-height: 700px) and (max-height: 850px) {
  #chat .message-list { padding-bottom: 6px; }
  #chat .message.chat-followup { margin-top: -6px; }
  #chat .message-text { padding-block: 8px; }
  #chat .chat-with-photo { width: min(348px, calc(82% + 44px), 100%); }
  #chat .chat-meta { margin-top: 2px; }
}
@media(max-height: 560px) {
  #chat .chat-notice { margin-bottom: .2rem; min-height: 32px; }
  #chat .message-list { gap: .45rem; padding-block: .3rem; }
  #chat .composer { padding-block: .35rem; }
  .chat-pending img { width: 30px; height: 30px; }
}
