/**
 * Chat DC — Styles for EpicentreCMS chat widget.
 * Adapted from chat_dc_7291.css with EpicentreCMS dark theme integration.
 */

:root {
  --chat_dc_c0: var(--bg-body, rgb(26, 26, 31));
  --chat_dc_c1: var(--bg-block, rgb(34, 33, 39));
  --chat_dc_c2: var(--bg-hover, rgb(42, 41, 49));
  --chat_dc_c3: rgb(54, 53, 62);
  --chat_dc_c4: rgb(58, 56, 70);
  --chat_dc_acc: var(--accent, rgb(108, 151, 212));
  --chat_dc_acc2: rgb(140, 175, 220);
  --chat_dc_acc3: rgb(80, 120, 180);
  --chat_dc_gn: rgb(71, 188, 138);
  --chat_dc_rd: rgb(216, 87, 82);
  --chat_dc_gd: rgb(207, 106, 50);
  --chat_dc_t1: rgb(230, 230, 230);
  --chat_dc_t2: rgb(183, 180, 191);
  --chat_dc_t3: rgb(140, 138, 150);
  --chat_dc_t4: rgb(174, 174, 174);
  --chat_dc_r: 6px;
  --chat_dc_r2: 10px;
}

/* ====== Container ====== */
.chat_dc_wrap {
  display: flex;
  height: 440px;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
  background: var(--chat_dc_c0);
  border-radius: var(--chat_dc_r2);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--border, rgba(42, 41, 49, 1));
}

/* ====== Sidebar ====== */
.chat_dc_sidebar {
  width: 289px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--chat_dc_c1);
  border-right: 1px solid rgba(108,151,212,.1);
}
.chat_dc_sb_backdrop { display: none; }
.chat_dc_sb_head {
  padding: 12px;
  border-bottom: 1px solid rgba(108,151,212,.08);
  background: linear-gradient(180deg, rgba(34,33,39,.9) 0%, rgba(30,29,35,.55) 100%);
}
.chat_dc_sb_tabs {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 3px;
  border-radius: 14px;
  background: rgba(26,26,31,.55);
  border: 1px solid rgba(108,151,212,.14);
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), 0 10px 26px rgba(0,0,0,.25);
}
.chat_dc_sb_tabs::before {
  content: '';
  position: absolute;
  top: 3px; left: 3px; bottom: 3px;
  width: calc(50% - 3px);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(108,151,212,.26) 0%, rgba(108,151,212,.12) 55%, rgba(140,175,220,.16) 100%);
  border: 1px solid rgba(108,151,212,.22);
  box-shadow: 0 10px 26px rgba(0,0,0,.40), 0 0 0 1px rgba(108,151,212,.07);
  transform: translateX(0);
  transition: transform .18s ease;
}
.chat_dc_sb_tabs.is_visitors::before { transform: translateX(100%); }
.chat_dc_tab {
  position: relative;
  z-index: 1;
  flex: 1;
  height: 34px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: rgba(183,180,191,.75);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .7px;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .15s, transform .12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 10px;
}
.chat_dc_tab:active { transform: translateY(1px); }
.chat_dc_tab_ic { font-size: 12px; opacity: .85; transition: opacity .15s; }
.chat_dc_tab:hover { color: var(--chat_dc_acc2); }
.chat_dc_tab:hover .chat_dc_tab_ic { opacity: 1; }
.chat_dc_tab.is_on { color: var(--chat_dc_t1); }
.chat_dc_tab.is_on .chat_dc_tab_ic { opacity: 1; }

.chat_dc_sb_counts {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.chat_dc_sb_count {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(26,26,31,.45);
  border: 1px solid rgba(108,151,212,.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}
.chat_dc_sb_count_ic { color: rgba(140,175,220,.9); opacity: .95; }
.chat_dc_sb_count_num { font-weight: 900; color: var(--chat_dc_t1); font-size: 12px; line-height: 1; }
.chat_dc_sb_count_txt { font-size: 10px; color: rgba(183,180,191,.62); letter-spacing: .2px; }

/* User list */
.chat_dc_users_list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: none;
}
.chat_dc_users_list.is_on { display: block; }
.chat_dc_users_list::-webkit-scrollbar { width: 3px; }
.chat_dc_users_list::-webkit-scrollbar-track { background: transparent; }
.chat_dc_users_list::-webkit-scrollbar-thumb { background: var(--chat_dc_c4); border-radius: 2px; }

.chat_dc_u_item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  cursor: pointer;
  transition: background .15s, transform .15s;
  text-decoration: none;
  border-radius: 12px;
  border: 1px solid rgba(108,151,212,.07);
  background: rgba(30,29,35,.25);
}
.chat_dc_u_item + .chat_dc_u_item { margin-top: 8px; }
.chat_dc_u_item:hover { background: rgba(108,151,212,.07); border-color: rgba(108,151,212,.14); transform: translateY(-1px); }
.chat_dc_u_ava { position: relative; flex-shrink: 0; width: 34px; height: 34px; }
.chat_dc_u_img { width: 34px; height: 34px; border-radius: 10px; display: block; border: 1px solid rgba(108,151,212,.16); object-fit: cover; }
.chat_dc_u_dot {
  position: absolute !important;
  bottom: -2px; right: -2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(30,29,35,.95);
  background: rgba(183,180,191,.25);
  display: block !important;
}
.chat_dc_u_dot.is_on { background: var(--chat_dc_gn); box-shadow: 0 0 10px rgba(76,175,114,.55); animation: chat_dc_presence 1.8s ease-in-out infinite; }
.chat_dc_u_info { flex: 1; min-width: 0; }
.chat_dc_u_name { font-size: 11.5px; font-weight: 700; color: var(--chat_dc_t1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat_dc_u_role { font-size: 9.5px; color: var(--chat_dc_t4); margin-top: 1px; }

/* ====== Chat Panel ====== */
.chat_dc_chat_panel { flex: 1; display: flex; flex-direction: column; background: var(--chat_dc_c1); min-width: 0; }

/* Header */
.chat_dc_head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  background: var(--chat_dc_c2);
  border-bottom: 1px solid rgba(108,151,212,.1);
  flex-shrink: 0;
}
.chat_dc_head_left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.chat_dc_head_icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: rgba(108,151,212,.1);
  border: 1px solid rgba(108,151,212,.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--chat_dc_acc2);
  font-weight: 900;
}
.chat_dc_head_text { min-width: 0; }
.chat_dc_head_label { font-size: 11px; font-weight: 900; letter-spacing: 1.4px; color: var(--chat_dc_t1); text-transform: uppercase; }
.chat_dc_head_sub { font-size: 10px; color: var(--chat_dc_t4); margin-top: 1px; }
.chat_dc_head_right { display: flex; align-items: center; gap: 8px; }

.chat_dc_sb_toggle {
  display: none;
  width: 30px; height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(108,151,212,.18);
  background: rgba(26,26,31,.35);
  cursor: pointer;
  align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, transform .12s;
}
.chat_dc_sb_toggle_svg { width: 16px; height: 16px; fill: rgba(183,180,191,.70); transition: fill .15s; }
.chat_dc_sb_toggle:hover { background: rgba(108,151,212,.14); border-color: rgba(108,151,212,.28); }
.chat_dc_sb_toggle:hover .chat_dc_sb_toggle_svg { fill: rgba(140,175,220,.95); }
.chat_dc_sb_toggle:active { transform: translateY(1px); }

.chat_dc_reload {
  width: 30px; height: 30px;
  border-radius: 10px;
  border: 1px solid rgba(108,151,212,.18);
  background: rgba(26,26,31,.35);
  cursor: pointer;
  display: inline-flex;
  align-items: center; justify-content: center;
  transition: background .15s, border-color .15s, transform .12s;
}
.chat_dc_reload_svg { width: 16px; height: 16px; fill: rgba(183,180,191,.70); transition: fill .15s, transform .15s; }
.chat_dc_reload:hover { background: rgba(108,151,212,.14); border-color: rgba(108,151,212,.28); }
.chat_dc_reload:hover .chat_dc_reload_svg { fill: rgba(140,175,220,.95); }
.chat_dc_reload:active { transform: translateY(1px); }
.chat_dc_reload.is_spin .chat_dc_reload_svg { animation: chat_dc_spin .7s linear; }
@keyframes chat_dc_spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

.chat_dc_live { display: flex; align-items: center; gap: 6px; color: var(--chat_dc_t4); font-size: 10px; }
.chat_dc_live_dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--chat_dc_gn);
  box-shadow: 0 0 6px rgba(76,175,114,.5);
  animation: chat_dc_pulse 2s ease-in-out infinite;
}
@keyframes chat_dc_pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* ====== Pinned ====== */
.chat_dc_pinned {
  display: none;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(108,151,212,.1);
  background: linear-gradient(135deg, rgba(108,151,212,.14), rgba(30,29,35,0));
  padding: 10px;
}
.chat_dc_pinned.is_on { display: block; }
.chat_dc_pin_title { font-size: 10px; font-weight: 900; letter-spacing: 1.2px; color: var(--chat_dc_acc2); text-transform: uppercase; margin-bottom: 6px; }
.chat_dc_pin_item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px;
  padding-right: 110px;
  border-radius: 8px;
  background: rgba(26,26,31,.45);
  border: 1px solid rgba(108,151,212,.12);
  position: relative;
}
.chat_dc_pin_item.has_bg { overflow: hidden; border-radius: 12px; background: rgba(26,26,31,.55); border-color: rgba(108,151,212,.16); }
.chat_dc_pin_item.has_bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--chat_dc_bg);
  background-size: cover; background-position: center;
  opacity: .12; filter: saturate(.82) contrast(.88) blur(.2px);
  transform: scale(1.06); z-index: 0; border-radius: inherit;
}
.chat_dc_pin_item.has_bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(26,26,31,.78) 0%, rgba(26,26,31,.56) 35%, rgba(26,26,31,.82) 100%);
  z-index: 0; border-radius: inherit;
}
.chat_dc_pin_item.has_bg > * { position: relative; z-index: 1; }
.chat_dc_pin_txt { font-size: 12px; color: var(--chat_dc_t2); line-height: 1.45; word-break: break-word; }
.chat_dc_pin_meta { font-size: 10px; color: var(--chat_dc_t4); margin-bottom: 2px; }
.chat_dc_pin_badges { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.chat_dc_pin_unpin {
  position: absolute; right: 10px; top: 10px;
  height: 28px; padding: 0 10px;
  border-radius: 10px;
  border: 1px solid rgba(108,151,212,.18);
  background: rgba(108,151,212,.10);
  color: var(--chat_dc_t2);
  cursor: pointer; font-size: 11px; font-weight: 900;
}
.chat_dc_pin_unpin:hover { background: rgba(108,151,212,.16); color: var(--chat_dc_acc2); }

/* ====== Messages area ====== */
.chat_dc_msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: linear-gradient(to bottom, var(--chat_dc_c0), var(--chat_dc_c1));
  position: relative;
}
.chat_dc_msgs::-webkit-scrollbar { width: 3px; }
.chat_dc_msgs::-webkit-scrollbar-thumb { background: var(--chat_dc_c4); border-radius: 2px; }

/* ====== Typing indicator ====== */
.chat_dc_typing {
  display: none;
  align-items: center;
  gap: 8px;
  flex-basis: 100%;
  margin: 0 0 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(26,26,31,.55);
  border: 1px solid rgba(200,151,42,.38);
  box-shadow: 0 10px 26px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.03);
  backdrop-filter: blur(8px);
  color: rgba(232,242,249,.82);
  font-size: 11.5px;
}
.chat_dc_typing.is_on { display: flex; }
.chat_dc_typing_ic { color: rgba(200,151,42,.9); opacity: .95; }
.chat_dc_typing_txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.chat_dc_typing_dots { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.chat_dc_typing_dots span {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(200,151,42,.9);
  opacity: .35;
  animation: chat_dc_dot 1.2s ease-in-out infinite;
}
.chat_dc_typing_dots span:nth-child(2) { animation-delay: .12s; }
.chat_dc_typing_dots span:nth-child(3) { animation-delay: .24s; }
@keyframes chat_dc_dot { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: .95; transform: translateY(-2px); } }

/* ====== Message bubbles ====== */
.chat_dc_msg {
  display: flex;
  gap: 9px;
  padding: 6px;
  border-radius: 8px;
  transition: background .12s;
  position: relative;
  animation: chat_dc_pop .18s ease;
}
.chat_dc_msg.has_bg {
  overflow: hidden;
  border-radius: 14px;
  background: rgba(26,26,31,.55);
  border: 1px solid rgba(108,151,212,.14);
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  padding: 10px;
  isolation: isolate;
}
.chat_dc_msg.has_bg::before {
  content: '';
  position: absolute; inset: 0;
  background-image: var(--chat_dc_bg);
  background-size: cover; background-position: center;
  opacity: .35; filter: saturate(.9) brightness(.7);
  z-index: 0; border-radius: inherit;
}
.chat_dc_msg.has_bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(26,26,31,.5) 0%, rgba(26,26,31,.3) 50%, rgba(26,26,31,.5) 100%);
  z-index: 0; border-radius: inherit;
}
.chat_dc_msg.has_bg > * { position: relative; z-index: 1; }
.chat_dc_msg.has_bg .chat_dc_msg_actions { z-index: 2; }
@keyframes chat_dc_pop { from { transform: translateY(4px); opacity: .7; } to { transform: none; opacity: 1; } }
.chat_dc_msg:hover { background: rgba(108,151,212,.05); }
.chat_dc_msg:hover .chat_dc_msg_actions { opacity: 1; }

/* Avatar in message */
.chat_dc_m_ava { flex-shrink: 0; position: relative; width: 34px; height: 34px; margin-top: 1px; }
.chat_dc_m_img { width: 34px; height: 34px; border-radius: 7px; border: 1px solid rgba(108,151,212,.12); display: block; object-fit: cover; }
.chat_dc_m_dot {
  position: absolute !important;
  bottom: -2px; right: -2px;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(30,29,35,.95);
  background: rgba(183,180,191,.25);
  display: block !important;
}
.chat_dc_m_dot.is_on { background: var(--chat_dc_gn); box-shadow: 0 0 10px rgba(76,175,114,.55); animation: chat_dc_presence 1.8s ease-in-out infinite; }
@keyframes chat_dc_presence { 0%,100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* Message body */
.chat_dc_m_body { flex: 1; min-width: 0; }
.chat_dc_m_meta { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; flex-wrap: wrap; }
.chat_dc_m_name { font-size: 12px; font-weight: 900; color: var(--chat_dc_t1); letter-spacing: .2px; }
.chat_dc_msg.is_mod .chat_dc_m_name { color: #ff4d4d !important; }
.chat_dc_m_you {
  font-size: 10px; font-weight: 900; color: var(--chat_dc_gd);
  background: rgba(200,151,42,.15); border: 1px solid rgba(200,151,42,.3);
  border-radius: 4px; padding: 0 6px; line-height: 16px;
}
.chat_dc_m_mod {
  font-size: 10px; font-weight: 900; color: #ff4d4d;
  background: rgba(255,77,77,.10); border: 1px solid rgba(255,77,77,.22);
  border-radius: 4px; padding: 0 6px; line-height: 16px;
}
.chat_dc_m_time { font-size: 10px; color: var(--chat_dc_t4); }
.chat_dc_m_edited { margin-left: 6px; font-size: 10px; color: rgba(183,180,191,.55); }
.chat_dc_m_text { font-size: 12.5px; color: var(--chat_dc_t2); line-height: 1.55; word-break: break-word; white-space: pre-wrap; }
.chat_dc_m_text.is_deleted { color: rgba(183,180,191,.55); font-style: italic; }

/* ====== Badges (text labels) ====== */
.chat_dc_m_badges { display: inline-flex; gap: 4px; }
.chat_dc_badge_label {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  background: #6bbfe8;
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 16px;
  letter-spacing: .3px;
  text-transform: uppercase;
}

/* ====== Action buttons ====== */
.chat_dc_msg_actions {
  position: absolute; right: 8px; top: 6px;
  display: flex; gap: 4px; align-items: center;
  opacity: 0; transition: opacity .15s; z-index: 2;
}
.chat_dc_a_btn {
  display: inline-flex; align-items: center; justify-content: center;
  white-space: nowrap; font-size: 10px; height: 22px; padding: 0 8px;
  border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(108,151,212,.12);
  background: rgba(108,151,212,.08);
  color: var(--chat_dc_t4); line-height: 22px; user-select: none;
}
.chat_dc_a_btn:hover { color: var(--chat_dc_acc2); border-color: rgba(108,151,212,.25); background: rgba(108,151,212,.15); }
.chat_dc_a_btn.is_danger { border-color: rgba(212,82,82,.18); background: rgba(212,82,82,.06); color: rgba(212,82,82,.75); }
.chat_dc_a_btn.is_danger:hover { border-color: rgba(212,82,82,.3); background: rgba(212,82,82,.14); color: var(--chat_dc_rd); }
.chat_dc_a_btn.is_gold { border-color: rgba(200,151,42,.25); background: rgba(200,151,42,.08); color: rgba(200,151,42,.9); }
.chat_dc_a_btn.is_gold:hover { border-color: rgba(200,151,42,.4); background: rgba(200,151,42,.15); color: var(--chat_dc_gd); }

/* ====== Reply quote ====== */
.chat_dc_reply_ref {
  margin-bottom: 6px;
  padding: 6px 10px;
  border-left: 2px solid rgba(140,175,220,.9);
  background: rgba(108,151,212,.08);
  border-radius: 0 10px 10px 0;
  color: var(--chat_dc_t2);
  font-size: 12px;
  cursor: pointer;
}
.chat_dc_reply_ref:hover { background: rgba(108,151,212,.12); }
.chat_dc_reply_arrow { color: var(--chat_dc_acc2); font-weight: 900; }
.chat_dc_text_main { display: block; }
.chat_dc_link {
  display: inline-block; padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(108,151,212,.22);
  background: rgba(108,151,212,.08);
  color: var(--chat_dc_acc2);
  text-decoration: none;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: baseline;
}
.chat_dc_link:hover { background: rgba(108,151,212,.14); border-color: rgba(108,151,212,.32); text-decoration: none; }

/* ====== Input area ====== */
.chat_dc_input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--chat_dc_c2);
  border-top: 1px solid rgba(108,151,212,.1);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.chat_dc_reply_bar {
  display: none;
  align-items: center;
  gap: 10px;
  flex: 1; min-width: 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(108,151,212,.08);
  border: 1px solid rgba(108,151,212,.18);
  flex-basis: 100%;
}
.chat_dc_reply_bar.is_on { display: flex; }
.chat_dc_reply_text { flex: 1; min-width: 0; color: var(--chat_dc_t2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat_dc_reply_cancel {
  width: 26px; height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(108,151,212,.18);
  background: rgba(26,26,31,.35);
  color: var(--chat_dc_t2);
  cursor: pointer; font-size: 16px; line-height: 24px; padding: 0;
}
.chat_dc_reply_cancel:hover { background: rgba(108,151,212,.15); color: var(--chat_dc_acc2); }
.chat_dc_inp_wrap { flex: 1; position: relative; min-width: 0; }
.chat_dc_inp {
  width: 100%;
  background: var(--chat_dc_c0);
  border: 1px solid rgba(108,151,212,.15);
  border-radius: 8px;
  color: var(--chat_dc_t1);
  font-size: 12.5px;
  padding: 8px 12px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.chat_dc_inp::placeholder { color: var(--chat_dc_t4); }
.chat_dc_inp:focus { border-color: rgba(108,151,212,.45); box-shadow: 0 0 0 3px rgba(108,151,212,.08); }
.chat_dc_send {
  width: 40px; height: 36px;
  border-radius: 8px;
  background: var(--chat_dc_acc3);
  border: 1px solid rgba(108,151,212,.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  flex-shrink: 0;
  color: #081018; font-weight: 900;
}
.chat_dc_send:hover { background: var(--chat_dc_acc); box-shadow: 0 2px 12px rgba(108,151,212,.35); }
.chat_dc_send:active { transform: scale(.94); }
.chat_dc_notice { font-size: 12px; color: var(--chat_dc_t4); text-align: center; width: 100%; }
.chat_dc_notice a { color: var(--chat_dc_acc2); text-decoration: none; }
.chat_dc_notice a:hover { text-decoration: underline; }

/* ====== Color palette ====== */
.chat_dc_palette { position: relative; display: flex; align-items: center; flex-shrink: 0; }
.chat_dc_palette_btn {
  width: 40px; height: 36px;
  border-radius: 999px;
  background: rgba(108,151,212,.10);
  border: 1px solid rgba(108,151,212,.18);
  cursor: pointer; transition: all .15s;
  padding: 0; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.chat_dc_palette_ic {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: rgba(183,180,191,.55);
  transition: color .15s, transform .15s, opacity .15s;
}
.chat_dc_palette_dot {
  display: inline-block; width: 16px; height: 16px;
  border-radius: 999px;
  background: rgba(183,180,191,.35);
  box-shadow: 0 0 0 2px rgba(26,26,31,.55), 0 0 0 1px rgba(108,151,212,.18) inset;
}
.chat_dc_palette_btn:hover { background: rgba(108,151,212,.16); border-color: rgba(108,151,212,.28); }
.chat_dc_palette_btn:hover .chat_dc_palette_ic { color: rgba(140,175,220,.85); }
.chat_dc_palette_panel {
  position: absolute; right: 0; bottom: calc(100% + 10px);
  display: none;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px; padding: 10px;
  border-radius: 12px;
  background: rgba(30,29,35,.92);
  border: 1px solid rgba(108,151,212,.18);
  box-shadow: 0 18px 40px rgba(0,0,0,.45);
  backdrop-filter: blur(10px);
  z-index: 5;
}
.chat_dc_palette_panel.is_open { display: grid; }
.chat_dc_sw {
  width: 22px; height: 22px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--c, rgba(183,180,191,.0));
  position: relative; cursor: pointer;
}
.chat_dc_sw[data-chat-dc-color=""] { background: linear-gradient(135deg, rgba(183,180,191,.18), rgba(108,151,212,.06)); border-color: rgba(108,151,212,.18); }
.chat_dc_sw.is_on { outline: 2px solid rgba(140,175,220,.75); outline-offset: 2px; }
.chat_dc_sw::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%);
  white-space: nowrap; pointer-events: none; opacity: 0;
  transition: opacity .12s, transform .12s;
  padding: 5px 9px; border-radius: 10px;
  background: rgba(26,26,31,.92);
  border: 1px solid rgba(108,151,212,.18);
  color: var(--chat_dc_t2); font-size: 10.5px;
}
.chat_dc_sw:hover::after { opacity: 1; transform: translateX(-50%) translateY(-2px); }

/* ====== Editor (inline edit for moderators) ====== */
.chat_dc_editor { margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.chat_dc_editor textarea {
  flex: 1; min-width: 0; resize: vertical;
  min-height: 48px; max-height: 120px;
  background: var(--chat_dc_c0);
  border: 1px solid rgba(108,151,212,.18);
  border-radius: 8px;
  color: var(--chat_dc_t1);
  padding: 8px 10px; font-size: 12.5px; outline: none;
}
.chat_dc_editor_btn {
  height: 30px; border-radius: 8px; padding: 0 10px;
  border: 1px solid rgba(108,151,212,.18);
  background: rgba(108,151,212,.1);
  color: var(--chat_dc_t2);
  cursor: pointer; font-size: 11px; font-weight: 800;
}
.chat_dc_editor_btn:hover { background: rgba(108,151,212,.16); }
.chat_dc_editor_btn.is_danger { border-color: rgba(212,82,82,.2); background: rgba(212,82,82,.08); color: rgba(212,82,82,.85); }

/* ====== Responsive ====== */
@media (max-width: 820px) {
  .chat_dc_wrap { height: min(78vh, 720px); position: relative; }
  .chat_dc_sb_toggle { display: inline-flex; }

  .chat_dc_sidebar {
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: min(84vw, 320px);
    z-index: 40;
    transform: translateX(-105%);
    transition: transform .2s ease;
    border-right: 1px solid rgba(108,151,212,.14);
    box-shadow: 0 24px 60px rgba(0,0,0,.55);
  }

  .chat_dc_sb_backdrop {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 35;
    background: rgba(0,0,0,.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .chat_dc_wrap.chat_dc_sb_open .chat_dc_sidebar { transform: none; }
  .chat_dc_wrap.chat_dc_sb_open .chat_dc_sb_backdrop { opacity: 1; pointer-events: auto; }

  .chat_dc_chat_panel { min-height: 0; height: 100%; }
  .chat_dc_msgs { min-height: 0; flex: 1; }
  .chat_dc_inp { font-size: 16px; }
}
