.mp-chat {
  --mp-chat-accent: #1ba6b2;
  --mp-chat-ink: #263744;
  --mp-chat-soft: #f4f7f8;
  --mp-chat-border: #d9e5e9;
  --mp-chat-text: #1d2a31;
  --mp-chat-muted: #74838c;
  --mp-chat-danger: #f05a28;
  --mp-chat-notice-bg: #fff7ea;
  --mp-chat-bg: #ffffff;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 400px;
  min-height: 320px;
  border: 1px solid #cfdfe5;
  border-radius: 12px;
  background: var(--mp-chat-bg);
  color: var(--mp-chat-text);
  display: grid;
  grid-template-rows: 34px 30px 30px auto 1fr auto;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  text-rendering: auto;
  -webkit-font-smoothing: subpixel-antialiased;
  box-sizing: border-box;
  position: relative;
  z-index: 10020;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(25, 42, 51, .12);
}

.mp-chat *,
.mp-chat *::before,
.mp-chat *::after {
  box-sizing: border-box;
}

.mp-chat [hidden] {
  display: none !important;
}

.mp-chat__topbar {
  background: linear-gradient(135deg, #253747 0%, #263744 58%, #1ba6b2 100%);
  color: #ffffff;
  border-bottom: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 13px;
  font-weight: 800;
  min-width: 0;
}

.mp-chat__title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-chat__online {
  flex: 0 0 auto;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px;
  padding: 2px 7px;
}

.mp-chat__point-strip {
  appearance: none;
  border: 0;
  border-bottom: 1px solid #dce7eb;
  background: linear-gradient(90deg, #fff6e8 0%, #fffaf4 48%, #ecfbfc 100%);
  color: #f05a28;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 30px;
  min-width: 0;
  overflow: hidden;
  padding: 0 8px;
  width: 100%;
}

.mp-chat__point-strip[aria-pressed="true"],
.mp-chat__point-strip:hover {
  background: linear-gradient(90deg, #ffe8d5 0%, #fff1e4 46%, #ddf8fb 100%);
  color: #d84413;
}

.mp-chat__point-strip.is-trade-pulse {
  animation: mp-chat-trade-pulse .7s ease;
}

.mp-chat__point-title {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  min-width: 0;
  white-space: nowrap;
}

.mp-chat__point-title b {
  color: #f05a28;
}

.mp-chat__point-counts {
  align-items: center;
  display: inline-flex;
  gap: 4px;
  min-width: 0;
}

.mp-chat__point-counts em {
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(27, 166, 178, .18);
  border-radius: 999px;
  color: #526571;
  display: inline-block;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 18px;
  padding: 0 6px;
  white-space: nowrap;
}

.mp-chat__point-counts em:first-child {
  border-color: rgba(27, 166, 178, .25);
  color: #168d98;
}

.mp-chat__point-counts em:last-child {
  border-color: rgba(240, 90, 40, .22);
  color: #e4521f;
}

@keyframes mp-chat-trade-pulse {
  0% { transform: scale(1); box-shadow: inset 0 0 0 rgba(240, 90, 40, 0); }
  35% { transform: scale(1.018); box-shadow: inset 0 -2px 0 rgba(240, 90, 40, .36); }
  100% { transform: scale(1); box-shadow: inset 0 0 0 rgba(240, 90, 40, 0); }
}

.mp-chat__logo {
  width: 20px;
  height: 20px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .18);
  color: #ffffff;
  display: inline-grid;
  place-items: center;
}

.mp-chat__tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(44px, 1fr));
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid #dce7eb;
  background: linear-gradient(#f8fbfc, #eef5f7);
}

.mp-chat__tab {
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #667882;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  padding: 0;
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.mp-chat__tab > * {
  pointer-events: none;
}

.mp-chat__tab:last-child {
  border-right: 0;
}

.mp-chat__tab[aria-selected="true"] {
  color: #ffffff;
  background: var(--mp-chat-ink);
  box-shadow: 0 4px 10px rgba(36, 49, 58, .18);
}

.mp-chat__tab:hover {
  background: #ffffff;
  color: var(--mp-chat-accent);
}

.mp-chat__tab svg,
.mp-chat__send svg,
.mp-chat__add svg,
.mp-chat__action svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

.mp-chat__tab svg {
  width: 17px;
  height: 17px;
  stroke-width: 2.3;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .8));
}

.mp-chat__tab span:not(.mp-chat__icon-text) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.mp-chat__tab[aria-selected="true"] svg {
  color: #ffffff;
}

.mp-chat__tab[data-mp-tab="settings"][aria-selected="true"] svg {
  color: #ffffff;
}

.mp-chat__tab[data-mp-tab="settings"]:hover {
  color: #ff8a2c;
}

.mp-chat__icon-text {
  display: inline-grid;
  place-items: center;
  min-width: 14px;
  height: 14px;
  font-size: 13px;
  line-height: 1;
}

.mp-chat__notice {
  min-height: 30px;
  border-bottom: 1px solid #f2ded0;
  background: #fff9ef;
  color: var(--mp-chat-danger);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  font-size: 13px;
}

.mp-chat__notice button {
  appearance: none;
  border: 0;
  background: transparent;
  color: #9a9a9a;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
}

.mp-chat__body {
  min-height: 0;
  overflow: hidden;
}

.mp-chat__messages,
.mp-chat__member-panel,
.mp-chat__settings-panel,
.mp-chat__custom-panel {
  height: 100%;
  overflow-y: auto;
}

.mp-chat__messages {
  padding: 12px 12px 10px;
  scrollbar-color: #8f979b transparent;
  scrollbar-width: thin;
}

.mp-chat__messages::-webkit-scrollbar {
  width: 8px;
}

.mp-chat__messages::-webkit-scrollbar-track {
  background: transparent;
}

.mp-chat__messages::-webkit-scrollbar-thumb {
  background: #8f979b;
  border-radius: 10px;
  border: 2px solid #ffffff;
}

.mp-chat__empty {
  height: 100%;
  min-height: 220px;
  display: grid;
  place-items: center;
  color: #91a0a8;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.mp-chat__message {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 9px;
  margin: 0 0 9px;
}

.mp-chat__message.is-whisper {
  background: #f5fbfd;
  border: 1px solid #d5edf4;
  border-radius: 8px;
  margin-left: 17px;
  padding: 5px;
  grid-template-columns: 30px 1fr;
}

.mp-chat__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f7fafb;
  border: 1px solid #d6e4e8;
  overflow: hidden;
  font-size: 17px;
  color: #7b8794;
}

.mp-chat__avatar-button {
  appearance: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.mp-chat__avatar-button:hover {
  border-color: var(--mp-chat-accent);
}

.mp-chat__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mp-chat__avatar-img,
.mp-chat__avatar-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.mp-chat__avatar-img {
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.mp-chat__avatar-fallback {
  font-weight: 800;
  color: #6f7f89;
  background: #f8fbfc;
}

.mp-chat__avatar svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.mp-chat__meta {
  display: flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  margin-bottom: 1px;
}

.mp-chat__user {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  font-weight: 800;
  color: #172833;
  overflow-wrap: anywhere;
  cursor: pointer;
  font: inherit;
}

.mp-chat__user:hover {
  color: var(--mp-chat-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mp-chat__time {
  color: var(--mp-chat-muted);
  white-space: nowrap;
  font-size: 11px;
}

.mp-chat__message-delete {
  appearance: none;
  border: 0;
  background: transparent;
  color: #a4b0b7;
  cursor: pointer;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  padding: 0;
  font: inherit;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transition: opacity .12s ease, background-color .12s ease, color .12s ease;
}

.mp-chat__message-delete svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

.mp-chat__message:hover .mp-chat__message-delete,
.mp-chat__message:focus-within .mp-chat__message-delete {
  opacity: 1;
}

.mp-chat__message-delete:hover {
  background: #fff1ec;
  color: #f05a28;
}

@media (hover: none) {
  .mp-chat__message-delete {
    opacity: .72;
  }
}

.mp-chat__whisper {
  border: 1px solid #b7e1ef;
  border-radius: 3px;
  color: #17728b;
  background: #eefaff;
  font-size: 10px;
  line-height: 1;
  padding: 2px 4px;
  white-space: nowrap;
}

.mp-chat__whisper-reply {
  appearance: none;
  height: 18px;
  border: 1px solid #b7e1ef;
  border-radius: 999px;
  background: #fff;
  color: #17728b;
  padding: 0 7px;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  cursor: pointer;
  white-space: nowrap;
}

.mp-chat__whisper-reply:hover {
  border-color: var(--mp-chat-accent);
  background: #eefaff;
  color: var(--mp-chat-accent);
}

.mp-chat__text {
  white-space: pre-wrap;
  line-height: 1.6;
  overflow-wrap: anywhere;
  color: #1d2a31;
}

.mp-chat__text.is-bold {
  font-weight: 700;
}

.mp-chat__text.is-underlined {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mp-chat__text.is-italic {
  font-style: italic;
}

.mp-chat__link {
  color: #1976a3;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.mp-chat__link:hover {
  color: var(--mp-chat-accent);
}

.mp-chat__image-link {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 3px 0 2px;
}

.mp-chat__image {
  display: block;
  max-width: min(220px, 100%);
  max-height: 220px;
  border: 1px solid #e6eaf0;
  border-radius: 6px;
  object-fit: cover;
  background: #f7f9fb;
}

.mp-chat__composer {
  border-top: 1px solid #dce7eb;
  display: grid;
  flex: 0 0 auto;
  background: #f2f6f7;
}

.mp-chat__composer-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 38px;
  align-items: center;
  height: 42px;
  min-height: 42px;
  padding: 5px;
  gap: 5px;
}

.mp-chat__whisper-mode {
  min-height: 32px;
  border-bottom: 1px solid #f0e5da;
  background: #fffaf6;
  display: grid;
  grid-template-columns: auto 1fr 22px;
  gap: 6px;
  align-items: center;
  padding: 4px 6px;
  color: #d95d00;
  font-size: 12px;
  font-weight: 800;
}

.mp-chat__whisper-mode[hidden] {
  display: none;
}

.mp-chat__whisper-target {
  min-width: 0;
  height: 22px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #ffd6b4;
  color: #243746;
  padding: 0 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-chat__whisper-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #a7a0a0;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.mp-chat__empty--brand {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: center;
  align-items: center;
  color: #84949d;
}

.mp-chat__brand-orbit {
  width: 66px;
  height: 66px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  position: relative;
  background: radial-gradient(circle at 30% 20%, #ffffff 0 16%, #eff9fb 44%, #dff2f5 100%);
  box-shadow: 0 12px 26px rgba(30, 56, 68, .13);
}

.mp-chat__brand-orbit::before,
.mp-chat__brand-orbit::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 26px;
  border: 2px solid transparent;
}

.mp-chat__brand-orbit::before {
  border-top-color: var(--mp-chat-accent);
  border-right-color: rgba(240, 90, 40, .78);
  animation: mp-chat-brand-spin 1.45s linear infinite;
}

.mp-chat__brand-orbit::after {
  inset: 7px;
  border-left-color: rgba(27, 166, 178, .42);
  border-bottom-color: rgba(240, 90, 40, .34);
  animation: mp-chat-brand-spin 2.4s linear infinite reverse;
}

.mp-chat__brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  background: linear-gradient(135deg, #253747 0%, #1ba6b2 100%);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 8px 16px rgba(27, 166, 178, .25);
  animation: mp-chat-brand-pop 1.8s ease-in-out infinite;
}

.mp-chat__brand-mark svg {
  width: 25px;
  height: 25px;
}

.mp-chat__empty-logo {
  display: grid;
  gap: 1px;
  text-align: center;
}

.mp-chat__empty-logo span {
  color: #243746;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.15;
}

.mp-chat__empty-logo em {
  color: #1ba6b2;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  opacity: .88;
}

.mp-chat__loading-line {
  width: 92px;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: #e7f1f4;
}

.mp-chat__loading-line i {
  display: block;
  width: 38px;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1ba6b2, #f05a28);
  animation: mp-chat-brand-line 1.05s ease-in-out infinite;
}

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

@keyframes mp-chat-brand-pop {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes mp-chat-brand-line {
  0% { transform: translateX(-42px); }
  50% { transform: translateX(48px); }
  100% { transform: translateX(96px); }
}

.mp-chat__add,
.mp-chat__send,
.mp-chat__action {
  appearance: none;
  border: 0;
  background: transparent;
  color: #6d7c85;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.mp-chat__add,
.mp-chat__send {
  width: 100%;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  align-self: center;
}

.mp-chat__add {
  border: 1px solid #d6e3e7;
  border-radius: 10px;
  background: #ffffff;
}

.mp-chat__actions {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 5px 8px;
  border-bottom: 1px solid #dde9ed;
  background: #fbfdfd;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mp-chat__actions::-webkit-scrollbar {
  display: none;
}

.mp-chat__emoji-panel {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 82px;
  z-index: 100;
  display: grid;
  grid-template-columns: repeat(10, minmax(24px, 1fr));
  gap: 4px;
  padding: 7px;
  border: 1px solid #d6e5e9;
  border-radius: 12px;
  background: #ffffff;
  max-height: 118px;
  overflow-y: auto;
  box-shadow: 0 14px 30px rgba(25, 42, 51, .18);
}

.mp-chat__emoji-panel[hidden] {
  display: none;
}

.mp-chat__emoji {
  appearance: none;
  border: 1px solid #e3ecef;
  border-radius: 8px;
  background: #f8fbfc;
  min-width: 0;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.mp-chat__emoji:hover {
  background: #edf8fa;
  border-color: #bfe3e7;
}

.mp-chat__action {
  flex: 0 0 27px;
  width: 27px;
  min-height: 24px;
  border-radius: 999px;
  color: #65757f;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid #e2ebee;
  background: #ffffff;
}

.mp-chat__action:hover,
.mp-chat__add:hover {
  background: #f5fbfc;
  color: var(--mp-chat-accent);
  border-color: #bfe3e7;
}

.mp-chat__action.is-active {
  background: var(--mp-chat-ink);
  color: var(--mp-chat-accent);
  border-color: var(--mp-chat-ink);
  box-shadow: none;
}

.mp-chat__action[data-mp-action="color"] {
  color: #ff5b2e;
}

.mp-chat__send {
  background: var(--mp-chat-accent);
  color: #ffffff;
  border-radius: 10px;
  line-height: 1;
}

.mp-chat__input {
  border: 1px solid #d6e3e7;
  border-radius: 10px;
  resize: none;
  min-width: 0;
  width: 100%;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  padding: 6px 11px;
  color: var(--mp-chat-text);
  background: #ffffff;
  font: inherit;
  outline: 0;
  overflow-y: hidden;
  overflow-x: hidden;
  white-space: pre-wrap;
  line-height: 1.45;
}

.mp-chat__input::placeholder {
  color: #65747d;
}

.mp-chat__input.is-bold {
  font-weight: 700;
}

.mp-chat__input.is-underline {
  text-decoration: underline;
}

.mp-chat__input.is-italic {
  font-style: italic;
}

.mp-chat__member-panel,
.mp-chat__settings-panel,
.mp-chat__custom-panel {
  padding: 8px;
  background: #fbfcfc;
}

.mp-chat__member-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #1b2a31;
}

.mp-chat__member-head span {
  color: var(--mp-chat-muted);
  font-size: 11px;
}

.mp-chat__member-group {
  margin-bottom: 12px;
}

.mp-chat__member-group h3 {
  margin: 0 0 5px;
  color: #66747b;
  font-size: 11px;
  font-weight: 800;
}

.mp-chat__member {
  display: grid;
  grid-template-columns: 30px 1fr 10px;
  gap: 7px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #edf0f1;
}

.mp-chat__member-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.mp-chat__member-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-chat__badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 16px;
  border-radius: 3px;
  padding: 0 4px;
  color: #ffffff;
  background: #77828a;
  font-size: 10px;
  font-weight: 800;
}

.mp-chat__badge--owner {
  background: #f05a28;
}

.mp-chat__badge--manager {
  background: #4f86c6;
}

.mp-chat__status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #bfc7cc;
}

.mp-chat__status.is-online {
  background: #2dbd68;
}

.mp-chat__settings-panel {
  color: #293941;
}

.mp-chat__settings-panel:not([hidden]) {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #ffffff;
}

.mp-chat.is-settings .mp-chat__composer,
.mp-chat.is-point-trade .mp-chat__composer {
  display: none;
}

.mp-chat__settings-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 9px 10px 12px;
}

.mp-chat__settings-note {
  margin: 0 0 10px;
  color: #4d5e68;
  font-size: 12px;
  line-height: 1.5;
}

.mp-chat__settings-section {
  margin: 0;
  padding: 0 0 12px;
  border-bottom: 1px solid #d5dde2;
}

.mp-chat__settings-section + .mp-chat__settings-section {
  padding-top: 12px;
}

.mp-chat__settings-section h3 {
  margin: 0 0 7px;
  color: #000000;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.mp-chat__settings-section label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin: 0 0 7px;
  color: #15232c;
  font-size: 12px;
  line-height: 1.55;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.mp-chat__settings-section input[type="checkbox"] {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  margin: 3px 0 0;
  accent-color: #2d9deb;
}

.mp-chat__settings-section label span {
  display: block;
  min-width: 0;
}

.mp-chat__settings-alert {
  background: #fff8b9;
  color: #41390b;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.65;
  word-break: keep-all;
}

.mp-chat__settings-footer {
  flex: 0 0 31px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--mp-chat-border);
  background: #f7fafb;
}

.mp-chat__settings-footer button {
  appearance: none;
  border: 0;
  border-right: 1px solid #d9e6ea;
  background: #ffffff;
  color: #5d6970;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mp-chat__settings-footer button:last-child {
  border-right: 0;
  background: #2da8ef;
  color: #ffffff;
}

.mp-chat__custom-panel {
  color: #26343b;
  line-height: 1.6;
}

.mp-chat__user-menu {
  position: absolute;
  z-index: 20;
  width: 178px;
  border: 1px solid #d7e2e6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(31, 41, 51, .18);
  overflow-y: auto;
  max-height: min(360px, calc(100% - 16px));
  font-size: 13px;
}

.mp-chat__user-menu-head {
  padding: 8px 10px;
  background: linear-gradient(135deg, var(--mp-chat-ink), var(--mp-chat-accent));
  color: #fff;
  font-weight: 900;
}

.mp-chat__user-menu button {
  appearance: none;
  width: 100%;
  min-height: 36px;
  border: 0;
  border-bottom: 1px solid #edf0f3;
  background: #fff;
  color: #3d4954;
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 0 13px;
  text-align: left;
  font: inherit;
}

.mp-chat__user-menu button:last-child {
  border-bottom: 0;
}

.mp-chat__user-menu button:hover {
  background: #f3fbfc;
  color: var(--mp-chat-accent);
}

.mp-chat.is-readonly .mp-chat__composer {
  background: #f8fafc;
}

.mp-chat.is-readonly .mp-chat__input {
  color: #8a9297;
  background: #f8fafc;
  cursor: not-allowed;
}

.mp-chat.is-readonly .mp-chat__add,
.mp-chat.is-readonly .mp-chat__send,
.mp-chat.is-readonly .mp-chat__action {
  color: #b2bbc2;
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 480px) {
  .mp-chat {
    width: 100%;
    height: min(520px, calc(100dvh - 16px));
    min-height: 360px;
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(25, 42, 51, .10);
    grid-template-rows: 36px 30px 34px auto 1fr auto;
    font-size: 13px;
  }

  .mp-chat__topbar {
    padding: 0 10px;
    gap: 6px;
  }

  .mp-chat__online {
    font-size: 11px;
    padding: 1px 6px;
  }

  .mp-chat__tabs {
    gap: 6px;
    padding: 5px 8px;
  }

  .mp-chat__messages {
    padding: 10px 9px 8px;
  }

  .mp-chat__message {
    grid-template-columns: 36px 1fr;
    gap: 8px;
    margin-bottom: 8px;
  }

  .mp-chat__avatar {
    width: 34px;
    height: 34px;
  }

  .mp-chat__image {
    max-width: min(180px, 100%);
    max-height: 180px;
  }

  .mp-chat__actions {
    padding: 5px 6px;
  }

  .mp-chat__emoji-panel {
    grid-template-columns: repeat(8, minmax(24px, 1fr));
    max-height: 108px;
    padding: 6px;
  }

  .mp-chat__composer-row {
    grid-template-columns: 31px minmax(0, 1fr) 36px;
    min-height: 42px;
    padding: 5px;
  }

  .mp-chat__input {
    height: 32px;
    padding: 6px 9px;
  }
}

.mp-chat__badge {
  display: none !important;
}

.mp-chat__trade {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  padding: 8px;
}

.mp-chat__trade-form {
  display: grid;
  grid-template-columns: 82px minmax(76px, .72fr) minmax(0, 1fr) 52px;
  gap: 7px;
  align-items: center;
}

.mp-chat__trade-form select,
.mp-chat__trade-form input,
.mp-chat__trade-form button {
  height: 30px;
  border: 1px solid #dbe7eb;
  border-radius: 8px;
  background: #fff;
  color: #263744;
  font: inherit;
  font-size: 12px;
}

.mp-chat__trade-form input {
  min-width: 0;
  padding: 0 8px;
}

.mp-chat__trade-form button {
  border-color: var(--mp-chat-accent);
  background: var(--mp-chat-accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.mp-chat__trade-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  height: 30px;
  padding: 2px;
  border: 1px solid #dbe7eb;
  border-radius: 9px;
  background: #edf6f7;
  overflow: hidden;
}

.mp-chat__trade-type-toggle button {
  height: 24px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #52707c;
  font-size: 12px;
  font-weight: 900;
  line-height: 24px;
}

.mp-chat__trade-type-toggle button[aria-pressed="true"] {
  background: var(--mp-chat-accent);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(27, 166, 178, .22);
}

.mp-chat__trade-list {
  min-height: 0;
  overflow-y: auto;
  display: grid;
  align-content: start;
  gap: 7px;
}

.mp-chat__trade-item {
  border: 1px solid #dce8ec;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.mp-chat__trade-item > div {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #72828c;
  font-size: 11px;
}

.mp-chat__trade-type {
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  padding: 3px 5px;
}

.mp-chat__trade-type.is-sell {
  background: #1ba6b2;
}

.mp-chat__trade-type.is-buy {
  background: #ff7a2a;
}

.mp-chat__trade-user {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: #1f2f3c;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.mp-chat__trade-item p {
  margin: 5px 0 7px;
  color: #1d2a31;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.mp-chat__trade-item nav {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mp-chat__trade-item nav button {
  height: 24px;
  border: 1px solid #dbe7eb;
  border-radius: 999px;
  background: #f8fbfc;
  color: #40515b;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 0 8px;
  cursor: pointer;
}

.mp-chat__trade-item nav button:hover {
  border-color: var(--mp-chat-accent);
  color: var(--mp-chat-accent);
}

.mp-chat__trade-empty {
  padding: 42px 0;
  color: #8a9aa3;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 420px) {
  .mp-chat__trade-form {
    grid-template-columns: 78px 1fr 46px;
  }

  .mp-chat__trade-form input[name="memo"] {
    grid-column: 1 / -1;
  }
}

.mp-chat__operator-star,
.mp-chat__operator-crown {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-right: 2px;
  border-radius: 50%;
  color: #ffb300;
  font-size: 12px;
  line-height: 1;
  text-shadow: 0 1px 0 #7a4300, 0 0 5px rgba(255, 179, 0, .38);
  flex: 0 0 auto;
}

.mp-chat__member-list .mp-chat__operator-star,
.mp-chat__member-list .mp-chat__operator-crown {
  margin-left: -2px;
  margin-right: 1px;
}


/* Image upload disabled: hide legacy upload plus buttons. */
.mp-chat__add,
.mp-chat__action[title="????"],
.mp-chat__action[data-mp-action="file"] {
  display: none !important;
}




/* Image upload disabled: composer uses input + send only. */
.mp-chat__composer-row {
  grid-template-columns: minmax(0, 1fr) 38px !important;
}
.mp-chat__composer-row .mp-chat__input {
  grid-column: 1;
}
.mp-chat__composer-row .mp-chat__send {
  grid-column: 2;
}
.mp-chat__composer-row .mp-chat__add {
  display: none !important;
}


/* Keep operator mark attached to the nickname in chat messages. */
.mp-chat__meta .mp-chat__user .mp-chat__operator-star,
.mp-chat__meta .mp-chat__user .mp-chat__operator-crown {
  display: inline-grid;
  width: 12px;
  height: 12px;
  margin: 0 0 0 3px;
  font-size: 10px;
  vertical-align: 1px;
  flex: 0 0 auto;
}
