.hm_chat_card {
  margin: 0px 0;
  padding: 0;
  background: #fff;
  border: 1px solid #e1e1e1;
  border-radius: 10px;
  overflow: hidden;
}

.hm_chat_card:has(.hm_emo_layer.is-open),
.hm_chat_widget:has(.hm_emo_layer.is-open) {
  overflow: visible;
}

.hm_chat_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0;
  padding: 10px 12px 9px;
  background: #f3f4f6;
  border-bottom: 1px solid #eaecf0;
  border-radius: 10px 10px 0 0;
  position: relative;
  z-index: 1;
}

.hm_chat_title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: #1f2937;
}

.hm_chat_title i {
  display: none;
}

.hm_chat_help_btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-left: 1px;
  padding: 0;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  background: #ffffff;
  color: #6b7280;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.hm_chat_help_btn:hover,
.hm_chat_help_btn:focus {
  border-color: #9ca3af;
  background: #e5e7eb;
  color: #374151;
}

.hm_chat_help_modal[hidden] {
  display: none !important;
}

.hm_chat_help_modal {
  position: fixed;
  inset: 0;
  z-index: 12070;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.hm_chat_help_backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .42);
}

.hm_chat_help_panel {
  position: relative;
  z-index: 1;
  width: min(340px, 100%);
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .22);
}

.hm_chat_help_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 16px 12px;
  border-bottom: 1px solid #eef2f7;
}

.hm_chat_help_head strong {
  color: #111827;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.hm_chat_help_close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.hm_chat_help_body {
  padding: 14px 16px 16px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
}

.hm_chat_help_body ul,
.hm_chat_help_body ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
}

.hm_chat_help_body ul {
  padding-left: 0;
  list-style: none;
}

.hm_chat_help_body li {
  margin: 0;
}

.hm_chat_help_body b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-right: 5px;
  border-radius: 999px;
  background: #eef2ff;
  color: #010066;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

.hm_chat_help_body p {
  margin: 12px 0 0;
  padding-top: 12px;
  border-top: 1px solid #eef2f7;
  color: #b91c1c;
  font-weight: 600;
  text-align: center;
  word-break: keep-all;
}

/* 채팅 상태 */
.hm_chat_state {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}

.hm_chat_state--online {
  background: #ffffff;
  border-color: #d1d5db;
  color: #374151;
}

.hm_chat_state--connecting,
.hm_chat_state--locked {
  background: #e5e7eb;
  border-color: #d1d5db;
  color: #6b7280;
}

.hm_chat_state--error {
  background: #fff0f0;
  border-color: #fcc;
  color: #c0392b;
}

.hm_chat_widget {
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: hidden;
  transition: background 0.2s ease;
}

/* 채팅 메시지 */
.hm_chat_messages {
  position: relative;
  height: 405px;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(1, 0, 102, 0.18) transparent;
}

.hm_chat_loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(-28px);
  pointer-events: none;
}

.hm_chat_loading span {
  width: 34px;
  height: 34px;
  border: 3px solid rgba(1, 0, 102, .13);
  border-top-color: #010066;
  border-radius: 50%;
  animation: hmChatSpin .75s linear infinite;
}

.hm_chat_loading em {
  margin-top: 9px;
  color: #64748b;
  font-size: 12px;
  font-style: normal;
  letter-spacing: .02em;
}

.hm_chat_messages:not(.is-loading) .hm_chat_loading {
  display: none;
}

@keyframes hmChatSpin {
  to { transform: rotate(360deg); }
}

.hm_chat_messages::-webkit-scrollbar {
  width: 4px;
}

.hm_chat_messages::-webkit-scrollbar-track {
  background: transparent;
}

.hm_chat_messages::-webkit-scrollbar-thumb {
  background: rgba(1, 0, 102, 0.18);
  border-radius: 999px;
}

.hm_chat_messages::-webkit-scrollbar-thumb:hover {
  background: rgba(1, 0, 102, 0.35);
}

/* 채팅 메시지 아이템 */
.hm_chat_item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  column-gap: 9px;
  align-items: start;
  margin-bottom: 8px;
  padding: 1px 8px;
}

.hm_chat_item.hm_chat_item--mine {
  background: transparent;
}

.hm_chat_item_head {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 1px;
}

.hm_chat_level_badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  max-width: 80px;
  height: 16px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid rgba(100, 116, 139, 0.22);
  background: #eef2f6;
  color: #64748b;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.hm_chat_my_badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 20px;
  height: 13px;
  padding: 0 5px;
  border: 1px solid rgba(1, 0, 102, 0.22);
  border-radius: 999px;
  background: rgba(1, 0, 102, 0.055);
  color: #010066;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
}

.hm_chat_user {
  font-size: 14px;
  font-weight: 400;
  color: #0a0a0a;
}

.hm_chat_item.hm_chat_item--mine .hm_chat_user {
  font-weight: 600;
}

/* 직접 채팅 클릭 시 밑줄 제거 */
.hm_chat_user--direct-click,
.hm_chat_user--admin-click {
  cursor: pointer;
  border-bottom: 0px dashed #94a3b8;
}

.hm_chat_user--direct-click:hover,
.hm_chat_user--admin-click:hover {
  color: #010066;
}

.hm_chat_ban_menu {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px 6px 6px;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hm_chat_ban_menu_nick {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  padding: 0 6px 6px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 2px;
}

.hm_chat_ban_btn {
  width: 100%;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.hm_chat_ban_btn.hm_chat_direct_start_btn {
  background: #eef2ff;
  color: #3730a3;
}

.hm_chat_ban_btn.hm_chat_direct_start_btn:hover {
  background: #020080;
  color: #fff;
}

.hm_chat_ban_btn.hm_chat_memo_start_btn {
  background: #eef2ff;
  color: #3730a3;
}

.hm_chat_ban_btn.hm_chat_memo_start_btn:hover {
  background: #020080;
  color: #fff;
}

.hm_chat_ban_btn.hm_chat_direct_start_btn--disabled,
.hm_chat_ban_btn.hm_chat_direct_start_btn--disabled:hover,
.hm_chat_ban_btn.hm_chat_direct_start_btn:disabled {
  background: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
}

.hm_chat_ban_btn--ban {
  background: #fff1f2;
  color: #e11d48;
}

.hm_chat_ban_btn--ban:hover {
  background: #ffe4e6;
}

.hm_chat_action_confirm[hidden] {
  display: none !important;
}

.hm_chat_action_confirm {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.hm_chat_action_confirm__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
}

.hm_chat_action_confirm__panel {
  position: relative;
  z-index: 1;
  width: min(320px, calc(100vw - 40px));
  padding: 22px 20px 18px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
  text-align: center;
  box-sizing: border-box;
}

.hm_chat_action_confirm__title {
  margin: 0;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
}

.hm_chat_action_confirm__desc {
  margin: 10px 0 0;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
  word-break: keep-all;
}

.hm_chat_action_confirm__desc strong {
  color: #111827;
  font-weight: 700;
}

.hm_chat_action_confirm__actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.hm_chat_action_confirm__btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.hm_chat_action_confirm__btn--cancel {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
}

.hm_chat_action_confirm__btn--ok {
  border: 1px solid #010066;
  background: #010066;
  color: #fff;
}

.hm_chat_action_confirm__btn:hover,
.hm_chat_action_confirm__btn:focus {
  opacity: .92;
}

.hm_chat_ban_notice {
  margin: 6px 8px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.hm_chat_ban_notice--ban {
  background: #fff1f2;
  color: #e11d48;
  border: 1px solid #fecdd3;
}

.hm_chat_ban_notice--unban {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.hm_chat_avatar {
  width: 35px;
  height: 35px;
  border-radius: 40%;
  border: 1px solid #d8dde7;
  background: linear-gradient(180deg, #f4f6fb 0%, #e8edf6 100%);
  color: #7b8497;
  font-size: 12px;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
  overflow: hidden;
  align-self: start;
  margin-top: 4px;
  flex-shrink: 0;
}

.hm_chat_avatar--has-img {
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.72);
}

.hm_chat_avatar_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 40%;
}

.hm_chat_item_content {
  min-width: 0;
  max-width: 93%;
}

.hm_chat_msg {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.7;
  color: rgba(0, 0, 0, 0.8);
  white-space: pre-wrap;
  word-break: break-word;
}

.hm_chat_msg .hm-em {
  font-size: 21px;
  line-height: 1;
  vertical-align: -0.15em;
  display: inline-block;
}

@supports (-webkit-hyphens: none) {
  .hm_chat_msg .hm-em {
    font-size: 18px;
  }
}

.hm_chat_time {
  display: inline;
  font-size: 85%;
  font-weight: 400;
  color: #666;
  letter-spacing: 0.2px;
  line-height: 1.35;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: baseline;
}

.hm_chat_form {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 7px;
  padding: 8px;
  border-top: 1px solid #eaecf0;
  background: #f8f9fb;
  box-sizing: border-box;
}

.hm_chat_form.is-disabled {
  background: #f1f3f5;
}

.hm_chat_input {
  -webkit-appearance: none;
  appearance: none;
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  margin: 0;
  box-sizing: border-box;
  border: 1px solid #dde1e9;
  border-radius: 8px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 34px;
  color: #1a2a40;
  background-color: #fff;
  background-clip: padding-box;
  box-shadow: none;
}

.hm_chat_input::-webkit-search-decoration,
.hm_chat_input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.hm_chat_input:focus {
  outline: none;
  border-color: rgba(1, 0, 102, 0.3);
  box-shadow: 0 0 0 2px rgba(1, 0, 102, 0.08);
}

.hm_chat_input:focus::placeholder {
  opacity: 0;
  transition: opacity 0.15s;
}

.hm_chat_input::placeholder {
  transition: opacity 0.15s;
}

.hm_chat_form.is-disabled .hm_chat_input {
  background: #eef0f4;
  border-color: #dde1e9;
  color: #9aa3b8;
  cursor: not-allowed;
}

.hm_chat_send {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 40px;
  height: 36px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  background: var(--hm-blue, #010066);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease;
}

.hm_chat_send:hover {
  background: #1a1a80;
  box-shadow: none;
}

.hm_chat_send:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(1, 0, 102, 0.25);
}

.hm_chat_send:focus:not(:focus-visible) {
  box-shadow: none;
}

.hm_chat_send:focus-visible {
  box-shadow: 0 0 0 2px rgba(1, 0, 102, 0.25);
}

.hm_chat_form.is-disabled .hm_chat_send {
  background: #c8cdd8;
  cursor: not-allowed;
}

.hm_chat_form .hm_emo_wrap {
  position: static;
  flex: 0 0 auto;
  margin: 0 -3px 0 -2px;
}

.hm_chat_form:has(.hm_emo_layer.is-open) {
  z-index: 221;
}

.hm_chat_form .hm_emo_trigger_row {
  margin: 0;
}

.hm_chat_form .hm_emo_trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.hm_chat_form .hm_emo_trigger .hm_emo_label {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  font-size: 0;
  line-height: 0;
}

.hm_chat_form .hm_emo_trigger img {
  display: block;
  width: var(--hm-pc-emo-size, 26px);
  height: var(--hm-pc-emo-size, 26px);
  object-fit: contain;
}
.hm_chat_form .hm_emo_trigger img[src=""],
.hm_chat_form .hm_emo_trigger img:not([src]) {
  display: none;
}

.hm_chat_form .hm_emo_layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 2px);
  width: 100%;
  max-width: none;
  height: 212px;
  max-height: none;
  z-index: 220;
  border-radius: 0;
  background: #fff;
  border-color: #e5e7eb;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
  overflow: hidden;
}

.hm_chat_form .hm_emo_layer.is-open {
  display: flex !important;
  flex-direction: column-reverse;
}

.hm_chat_form .hm_emo_tabs {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  padding: 0;
  border-top: 1px solid #eef2f7;
  border-bottom: 0;
  background: #fff;
  overflow: visible;
}

.hm_chat_form .hm_emo_tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  padding: 0 4px;
  border-bottom: 2px solid transparent;
  font-weight: 400;
  text-align: center;
  color: #9ca3af;
}

.hm_chat_form .hm_emo_tab.is-active {
  color: #010066;
  border-bottom-color: #010066;
  font-weight: 500;
}

.hm_chat_form .hm_emo_grids {
  flex: 1 1 auto;
  height: auto;
  padding: 10px;
  overflow-x: hidden;
  background: #fff;
}

.hm_chat_form .hm_emo_grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 4px;
  width: 100%;
  max-width: 100%;
}
.hm_chat_form .hm_emo_grid.is-active {
  display: grid;
}

.hm_chat_form .hm_emo_item {
  width: 40px;
  height: 40px;
  justify-self: center;
}

.hm_chat_form .hm_emo_item img {
  width: var(--hm-pc-emo-size, 26px);
  height: var(--hm-pc-emo-size, 26px);
  object-fit: contain;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_form .hm_emo_layer {
  background: #1b1b1f;
  border-color: #34343a;
  box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.32);
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_form .hm_emo_tabs {
  background: #111827;
  border-top-color: #2b3446;
  border-bottom-color: #2b3446;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_form .hm_emo_tab {
  color: #94a3b8;
  border-bottom-color: transparent;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_form .hm_emo_tab.is-active {
  color: #c7d2fe;
  border-bottom-color: #8ea2ff;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_form .hm_emo_grids {
  background: #1b1b1f;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_form .hm_emo_item:hover,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_form .hm_emo_item:focus {
  background: #273244;
}

.hm_chat_form.is-disabled .hm_emo_trigger {
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.hm_chat_emo_img {
  display: inline-block;
  width: var(--hm-pc-emo-size, 26px);
  height: var(--hm-pc-emo-size, 26px);
  max-width: var(--hm-pc-emo-size, 26px);
  max-height: var(--hm-pc-emo-size, 26px);
  object-fit: contain;
  vertical-align: -0.28em;
  margin: 0 1px;
}

.hm_chat_emoji_btn {
  flex-shrink: 0;
  width: 26px;
  height: 30px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  padding: 0 0 0 2px;
  margin-right: -1px;
  position: relative;
  top: 1px;
  border-radius: 6px;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hm_chat_emoji_btn:hover {
  background: rgba(0, 0, 0, 0.07);
}

.hm_emoji_picker {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 200;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 2px;
  padding: 8px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.13);
  max-height: 200px;
  overflow-y: auto;
}

.hm_emoji_item {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px 2px;
  border-radius: 6px;
  transition: background 0.1s;
  text-align: center;
}

.hm_emoji_item:hover {
  background: #f1f5f9;
}

.hm_direct_panel {
  margin: 10px 12px 0;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  box-sizing: border-box;
}

.hm_direct_panel_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #1f2937;
  font-size: 13px;
}

.hm_direct_inbox_btn {
  flex: 1 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  padding: 7px 8px;
  background: #fff;
  color: #111827;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

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

.hm_direct_inbox_badge {
  flex: 0 0 auto;
  border: 1px solid #fcc;
  border-radius: 999px;
  padding: 2px 6px;
  background: #fff0f0;
  color: #c0392b;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.25;
}

.hm_direct_refresh {
  border: 0;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.hm_direct_notice {
  margin-bottom: 8px;
  padding: 8px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.4;
}

.hm_direct_notice_actions {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}

.hm_direct_notice_actions button,
.hm_direct_room_btn {
  border: 0;
  border-radius: 32%;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

.hm_direct_accept {
  background: #010066;
  color: #fff;
}

.hm_direct_reject {
  background: #e5e7eb;
  color: #374151;
}

.hm_direct_list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 132px;
  overflow: hidden;
}

.hm_direct_empty {
  margin: 0;
  padding: 8px 4px;
  color: #94a3b8;
  font-size: 12px;
  text-align: center;
}

.hm_direct_room {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 8px;
  background: #fff;
  text-align: left;
  box-sizing: border-box;
  cursor: pointer;
}

.hm_direct_room:nth-child(n+3) {
  display: none;
}

.hm_direct_room:hover {
  border-color: #c7d2fe;
}

.hm_direct_room_top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  font-size: 12px;
  color: #111827;
  font-weight: 700;
}

.hm_direct_room_meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}

.hm_direct_badge {
  flex: 0 0 auto;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
}

.hm_direct_badge.is-active {
  background: #eef6ee;
  border-color: #c3e6c3;
  color: #2d6a2d;
}

.hm_direct_badge.is-closed,
.hm_direct_badge.is-rejected {
  background: #fff0f0;
  border-color: #fcc;
  color: #c0392b;
}

.hm_direct_preview {
  margin-top: 4px;
  color: #6b7280;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hm_direct_modal {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 12030;
  width: 320px;
  max-width: calc(100vw - 32px);
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.hm_direct_modal[hidden] {
  display: none !important;
}

.hm_direct_modal_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.hm_direct_modal_title {
  margin: 0;
  color: #111827;
  font-size: 14px;
  font-weight: 800;
}

.hm_direct_modal_close {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.hm_direct_messages {
  height: 260px;
  overflow-y: auto;
  padding: 10px;
  background: #fff;
}

.hm_direct_msg {
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hm_direct_msg.is-mine {
  align-items: flex-end;
}

.hm_direct_msg_bubble {
  max-width: 82%;
  padding: 7px 9px;
  border-radius: 12px;
  background: #f1f5f9;
  color: #111827;
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.hm_direct_msg.is-mine .hm_direct_msg_bubble {
  background: #010066;
  color: #fff;
}

.hm_direct_msg_meta {
  margin-top: 3px;
  color: #94a3b8;
  font-size: 10px;
}

.hm_direct_form {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}

.hm_direct_input {
  flex: 1 1 auto;
  min-width: 0;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 9px;
  padding: 0 10px;
  font-size: 13px;
  box-sizing: border-box;
}

.hm_direct_send {
  flex: 0 0 auto;
  border: 0;
  border-radius: 9px;
  padding: 0 12px;
  background: #010066;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_card {
  background: #111827;
  border-color: #293241;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_head {
  background: #182235;
  border-bottom-color: #293241;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_title {
  color: #e5e7eb;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_btn {
  background: #111827;
  border-color: #3b4454;
  color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_btn:hover,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_btn:focus {
  background: #1f2937;
  border-color: #566176;
  color: #e5e7eb;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_state--online {
  background: #0f172a;
  border-color: #3b4454;
  color: #cbd5e1;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_state--connecting,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_state--locked {
  background: #1f2937;
  border-color: #3b4454;
  color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_messages {
  background: #111827;
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_loading span {
  border-color: rgba(148, 163, 184, 0.2);
  border-top-color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_loading em,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_time {
  color: #7c8797;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_user {
  color: #e5e7eb;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_msg {
  color: #cbd5e1;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_level_badge {
  background: #1f2937;
  border-color: #3b4454;
  color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_my_badge {
  background: rgba(124, 140, 255, 0.14);
  border-color: rgba(124, 140, 255, 0.34);
  color: #c7d2fe;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_avatar {
  background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
  border-color: #3b4454;
  color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_form {
  background: #0f172a;
  border-top-color: #293241;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_input {
  background-color: #111827;
  border-color: #293241;
  color: #e5e7eb;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_input::placeholder {
  color: #7c8797;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_input:focus {
  border-color: rgba(124, 140, 255, 0.5);
  box-shadow: 0 0 0 2px rgba(124, 140, 255, 0.16);
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_send {
  background: #2f3fa0;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_send:hover {
  background: #3f51b5;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_panel,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_ban_menu,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_direct_modal {
  background: #111827;
  border-color: #293241;
  color: #e5e7eb;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_ban_menu {
  background: #1b2537;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_ban_menu_nick {
  color: #cbd5e1;
  border-bottom-color: #293241;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_ban_btn.hm_chat_direct_start_btn,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_ban_btn.hm_chat_memo_start_btn {
  background: #26335f;
  color: #dbe4ff;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_ban_btn.hm_chat_direct_start_btn:hover,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_ban_btn.hm_chat_memo_start_btn:hover {
  background: #3f51b5;
  color: #fff;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_head,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_direct_modal_head {
  background: #182235;
  border-bottom-color: #293241;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_head strong,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_direct_modal_title {
  color: #e5e7eb;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_body {
  color: #cbd5e1;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_backdrop {
  background: rgba(2, 6, 23, 0.62);
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_action_confirm__backdrop {
  background: rgba(2, 6, 23, 0.62);
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_action_confirm__panel {
  background: #172033;
  border: 1px solid #293241;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.48);
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_action_confirm__title,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_action_confirm__desc strong {
  color: #f8fafc;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_action_confirm__desc {
  color: #94a3b8;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_action_confirm__btn--cancel {
  border-color: #3b4454;
  background: #1f2937;
  color: #cbd5e1;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_action_confirm__btn--ok {
  border-color: #5c6bc0;
  background: #5c6bc0;
  color: #fff;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_panel {
  background: #111827;
  border: 1px solid #293241;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.48);
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_close {
  background: #172033;
  border: 1px solid #3b4454;
  color: #cbd5e1;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_close:hover,
html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_close:focus {
  background: #1f2937;
  border-color: #566176;
  color: #fff;
}

html[data-hm-theme="dark"] body:not(.hm-mobile) .hm_chat_help_body p {
  border-top-color: #dbe4f0;
}

@media (prefers-color-scheme: dark) {
  body:not(.hm-mobile) .hm_chat_card {
    background: #111827;
    border-color: #293241;
  }

  body:not(.hm-mobile) .hm_chat_head {
    background: #182235;
    border-bottom-color: #293241;
  }

  body:not(.hm-mobile) .hm_chat_title {
    color: #e5e7eb;
  }

  body:not(.hm-mobile) .hm_chat_help_btn {
    background: #111827;
    border-color: #3b4454;
    color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_chat_help_btn:hover,
  body:not(.hm-mobile) .hm_chat_help_btn:focus {
    background: #1f2937;
    border-color: #566176;
    color: #e5e7eb;
  }

  body:not(.hm-mobile) .hm_chat_state--online {
    background: #0f172a;
    border-color: #3b4454;
    color: #cbd5e1;
  }

  body:not(.hm-mobile) .hm_chat_state--connecting,
  body:not(.hm-mobile) .hm_chat_state--locked {
    background: #1f2937;
    border-color: #3b4454;
    color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_chat_messages {
    background: #111827;
    scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
  }

  body:not(.hm-mobile) .hm_chat_messages::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
  }

  body:not(.hm-mobile) .hm_chat_messages::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
  }

  body:not(.hm-mobile) .hm_chat_loading span {
    border-color: rgba(148, 163, 184, 0.2);
    border-top-color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_chat_loading em,
  body:not(.hm-mobile) .hm_chat_time {
    color: #7c8797;
  }

  body:not(.hm-mobile) .hm_chat_user {
    color: #e5e7eb;
  }

  body:not(.hm-mobile) .hm_chat_msg {
    color: #cbd5e1;
  }

  body:not(.hm-mobile) .hm_chat_level_badge {
    background: #1f2937;
    border-color: #3b4454;
    color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_chat_my_badge {
    background: rgba(124, 140, 255, 0.14);
    border-color: rgba(124, 140, 255, 0.34);
    color: #c7d2fe;
  }

  body:not(.hm-mobile) .hm_chat_avatar {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border-color: #3b4454;
    color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_chat_form {
    background: #0f172a;
    border-top-color: #293241;
  }

  body:not(.hm-mobile) .hm_chat_input {
    background-color: #111827;
    border-color: #293241;
    color: #e5e7eb;
  }

  body:not(.hm-mobile) .hm_chat_input::placeholder {
    color: #7c8797;
  }

  body:not(.hm-mobile) .hm_chat_input:focus {
    border-color: rgba(124, 140, 255, 0.5);
    box-shadow: 0 0 0 2px rgba(124, 140, 255, 0.16);
  }

  body:not(.hm-mobile) .hm_chat_send {
    background: #2f3fa0;
  }

  body:not(.hm-mobile) .hm_chat_send:hover {
    background: #3f51b5;
  }

  body:not(.hm-mobile) .hm_chat_help_panel,
  body:not(.hm-mobile) .hm_chat_ban_menu,
  body:not(.hm-mobile) .hm_direct_modal {
    background: #111827;
    border-color: #293241;
    color: #e5e7eb;
  }

  body:not(.hm-mobile) .hm_chat_ban_menu {
    background: #1b2537;
  }

  body:not(.hm-mobile) .hm_chat_ban_menu_nick {
    color: #cbd5e1;
    border-bottom-color: #293241;
  }

  body:not(.hm-mobile) .hm_chat_ban_btn.hm_chat_direct_start_btn,
  body:not(.hm-mobile) .hm_chat_ban_btn.hm_chat_memo_start_btn {
    background: #26335f;
    color: #dbe4ff;
  }

  body:not(.hm-mobile) .hm_chat_ban_btn.hm_chat_direct_start_btn:hover,
  body:not(.hm-mobile) .hm_chat_ban_btn.hm_chat_memo_start_btn:hover {
    background: #3f51b5;
    color: #fff;
  }

  body:not(.hm-mobile) .hm_chat_help_head,
  body:not(.hm-mobile) .hm_direct_modal_head {
    background: #182235;
    border-bottom-color: #293241;
  }

  body:not(.hm-mobile) .hm_chat_help_head strong,
  body:not(.hm-mobile) .hm_direct_modal_title {
    color: #e5e7eb;
  }

  body:not(.hm-mobile) .hm_chat_help_body {
    color: #cbd5e1;
  }

  body:not(.hm-mobile) .hm_chat_action_confirm__backdrop {
    background: rgba(2, 6, 23, 0.62);
  }

  body:not(.hm-mobile) .hm_chat_action_confirm__panel {
    background: #172033;
    border: 1px solid #293241;
    box-shadow: 0 22px 56px rgba(0, 0, 0, 0.48);
  }

  body:not(.hm-mobile) .hm_chat_action_confirm__title,
  body:not(.hm-mobile) .hm_chat_action_confirm__desc strong {
    color: #f8fafc;
  }

  body:not(.hm-mobile) .hm_chat_action_confirm__desc {
    color: #94a3b8;
  }

  body:not(.hm-mobile) .hm_chat_action_confirm__btn--cancel {
    border-color: #3b4454;
    background: #1f2937;
    color: #cbd5e1;
  }

  body:not(.hm-mobile) .hm_chat_action_confirm__btn--ok {
    border-color: #5c6bc0;
    background: #5c6bc0;
    color: #fff;
  }
}
