.huimengyu-chat__messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: var(--dressup-chat-message-padding, 14px 12px 8px);
}

.huimengyu-chat__time-separator {
  display: flex;
  justify-content: center;
  margin: 8px 0 12px;
}

.huimengyu-chat__time-separator-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  color: rgba(23, 24, 26, 0.42);
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.huimengyu-chat__time-separator--system {
  margin: 6px 0 12px;
}

.huimengyu-message-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: var(--dressup-chat-message-gap, 12px);
}

.huimengyu-message-row--self {
  justify-content: flex-end;
}

.huimengyu-message-row--system {
  justify-content: center;
  margin-bottom: 0;
}

.huimengyu-message-row__main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 0 1 calc(100% - 42px);
  max-width: calc(100% - 42px);
  min-width: 0;
  padding-top: 0;
}

.huimengyu-message-row__main > .huimengyu-message-bubble {
  max-width: 100%;
}

.huimengyu-message-row__sender {
  margin: 0 0 4px 2px;
  font-size: 11px;
  line-height: 1.4;
  color: rgba(23, 24, 26, 0.46);
}

.huimengyu-message-bubble {
  position: relative;
  max-width: var(--dressup-bubble-max-width, calc(100% - 84px));
  padding: var(--dressup-bubble-padding, 10px 12px);
  border-radius: var(--dressup-bubble-radius, 18px);
  box-shadow: var(--dressup-bubble-shadow, 0 8px 18px rgba(20, 22, 26, 0.04));
}

.huimengyu-message-bubble--dream {
  border: 1px solid var(--dressup-bubble-dream-border, rgba(20, 22, 26, 0.08));
  background: var(--dressup-bubble-dream-background, rgba(255, 255, 255, 0.9));
  color: var(--dressup-bubble-dream-text, #16181b);
}

.huimengyu-message-bubble--self {
  border: 1px solid var(--dressup-bubble-self-border, rgba(64, 73, 85, 0.08));
  background: var(--dressup-bubble-self-background, linear-gradient(180deg, #dfe3ea, #d4d9e2));
  color: var(--dressup-bubble-self-text, #16181b);
}

.huimengyu-message-bubble--image {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 18px;
  overflow: hidden;
}

.huimengyu-message-bubble__media {
  display: block;
  line-height: 0;
}

.huimengyu-message-bubble__image {
  display: block;
  max-width: min(220px, 56vw);
  width: auto;
  height: auto;
  border-radius: 18px;
  object-fit: cover;
}

.huimengyu-message-bubble__text {
  margin: 0;
  font-size: var(--dressup-bubble-font-size, 13px);
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  color: inherit;
}

.huimengyu-message-row__avatar {
  flex: 0 0 34px;
  margin-top: 0;
  align-self: flex-start;
}

.huimengyu-message-row__avatar--self {
  background: linear-gradient(145deg, #cfd4dc, #e9ecf2);
  color: #4d5561;
}

.huimengyu-chat__bottom {
  flex: 0 0 auto;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--dressup-chat-composer-border, rgba(22, 24, 28, 0.06));
  background: var(--dressup-chat-composer-background, rgba(246, 247, 249, 0.92));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.huimengyu-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.huimengyu-composer__icon-button,
.huimengyu-composer__emoji-button,
.huimengyu-composer__send-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0;
  border: 1px solid rgba(21, 24, 28, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  color: #17191d;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  cursor: pointer;
}

.huimengyu-composer__icon-button,
.huimengyu-composer__emoji-button {
  width: 36px;
  font-size: 20px;
  line-height: 1;
}

.huimengyu-composer__input-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(21, 24, 28, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
}

.huimengyu-composer__input {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: #17181a;
}

.huimengyu-composer__input::placeholder {
  color: rgba(23, 24, 26, 0.34);
}

.huimengyu-composer__input-wrap:focus-within {
  border-color: rgba(75, 88, 110, 0.18);
  box-shadow: 0 0 0 3px rgba(160, 171, 189, 0.12);
}

.huimengyu-composer__icon-button:focus-visible,
.huimengyu-composer__emoji-button:focus-visible,
.huimengyu-composer__send-button:focus-visible {
  border-color: rgba(75, 88, 110, 0.18);
  box-shadow: 0 0 0 3px rgba(160, 171, 189, 0.12);
}

.huimengyu-composer__send-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
  font-size: 13px;
  background: var(--dressup-chat-send-button-background, rgba(255, 255, 255, 0.72));
  color: var(--dressup-chat-send-button-color, #17191d);
}

.huimengyu-composer__send-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.huimengyu-composer-emoji-match {
  display: flex;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  min-height: 74px;
  margin: 0 0 8px;
  padding: 0 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.huimengyu-composer-emoji-match::-webkit-scrollbar {
  display: none;
}

.huimengyu-composer-emoji-match.is-empty {
  display: none;
}

.huimengyu-composer-emoji-match__item {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  width: 64px;
  min-height: 70px;
  padding: 6px 6px 5px;
  border: 1px solid rgba(22, 24, 28, 0.08);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 8px 20px rgba(20, 22, 26, 0.06);
  color: rgba(23, 24, 26, 0.72);
  cursor: pointer;
}

.huimengyu-composer-emoji-match__image {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(246, 247, 249, 0.76);
}

.huimengyu-composer-emoji-match__symbol {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(246, 247, 249, 0.76);
  font-size: 24px;
  line-height: 1;
}

.huimengyu-composer-emoji-match__name {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
}

.huimengyu-composer-menu {
  margin-top: 10px;
  padding: 14px 12px 10px;
  border: 1px solid rgba(21, 24, 28, 0.07);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.huimengyu-composer-menu__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.huimengyu-composer-menu__item {
  display: grid;
  gap: 7px;
  justify-items: center;
  padding: 6px 4px 4px;
  border: 0;
  background: transparent;
  color: rgba(23, 24, 26, 0.56);
}

.huimengyu-composer-menu__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(22, 24, 28, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(250, 250, 251, 0.92), rgba(237, 239, 242, 0.96));
  color: #50565f;
  font-size: 14px;
}

.huimengyu-composer-menu__label {
  font-size: 11px;
  color: rgba(23, 24, 26, 0.52);
}

.huimengyu-composer-menu__hint {
  margin: 12px 2px 0;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(23, 24, 26, 0.42);
}

@media (max-width: 420px) {
  .huimengyu-message-bubble {
    max-width: var(--dressup-bubble-max-width, calc(100% - 72px));
  }

  .huimengyu-message-bubble__image {
    max-width: min(200px, 58vw);
  }

  .huimengyu-chat__messages {
    padding-left: 10px;
    padding-right: 10px;
  }

  .huimengyu-chat__bottom {
    padding-left: 8px;
    padding-right: 8px;
  }

  .huimengyu-composer {
    gap: 6px;
  }

  .huimengyu-composer-menu__grid {
    gap: 8px;
  }
}
