.wk_mp_chat_container {
  border: 0;
  padding: 10px 0;
  background: transparent;
  margin-bottom: 20px;
}

body#module-wkmpchat-chat :focus-visible {
  outline: none;
  box-shadow: none;
}

body#module-wkmpchat-chat #columns {
  padding-bottom: 0 !important;
}
.wk_mp_chat_header {
  margin-bottom: 6px;
}
.wk_mp_chat_subtitle {
  font-size: 12px;
  color: #767676;
  margin-top: -4px;
  margin-bottom: 8px;
}
.wk_mp_chat_subtitle_link {
  color: #767676;
  text-decoration: none;
}
.wk_mp_chat_subtitle_link:hover {
  color: #333333;
  text-decoration: none;
}

.wk_mp_chat_box {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  border: none;
  padding: 35px 14px 14px 14px;
  margin-bottom: 12px;
  background: #f5f7fa;
  border-radius: 8px;
}

.wk_mp_chat_message {
  margin-bottom: 30px;
  max-width: 75%;
  position: relative;
  width: fit-content;
  display: flex;
  flex-direction: column;
}

.wk_mp_chat_message.sent {
  align-self: flex-end;
  text-align: right;
  margin-right: 24px;
  align-items: flex-end;
}

.wk_mp_chat_message.received {
  align-self: flex-start;
  text-align: left;
  align-items: flex-start;
}

.wk_mp_chat_message .message_content {
  padding: 9px 14px;
  border-radius: 18px;
  display: inline-block;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}

.wk_mp_chat_message.sent .message_content {
  background: #2b2b2b;
  border: 1px solid #2b2b2b;
}

.wk_mp_chat_message.received .message_content {
  background: #f3f3f3;
  border: 1px solid #e5e5e5;
  min-width: 80px;
}

.wk_mp_chat_message .message_text {
  display: inline-block;
  color: #2c3e50;
  line-height: 1.35;
  word-wrap: break-word;
  white-space: pre-wrap;
}

/* Image messages */
.wk_mp_chat_message .message_image {
  display: inline-block;
  max-width: 240px;
}
.wk_mp_chat_message .message_image img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  display: block;
}

.wk_translation_block {
  margin-top: 6px;
  background: #eef3ff;
  border: 1px solid #d6e0ff;
  border-radius: 8px;
  padding: 8px 10px;
  color: #2c3e50;
  max-width: 100%;
}
.wk_translation_title {
  font-size: 12px;
  color: #5b6da0;
  margin-bottom: 4px;
}
.wk_translation_text {
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.wk_translation_hide {
  display: inline-block;
  font-size: 12px;
  color: #3a56cc;
  text-decoration: none;
}
.wk_translation_hide:hover {
  text-decoration: underline;
}
.wk_translate_loading {
  display: inline-block;
  margin-left: 8px;
  font-size: 12px;
  color: #8e9aa7;
}
.wk_mp_chat_message.sent .message_text {
  color: #ffffff;
}
.wk_mp_chat_message.received .message_text {
  color: #222222;
}

/* Meta fills the row so "edited" stays left and time/ticks go right. */
.wk_mp_chat_message .message_meta {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
  color: #8e9aa7;
}

/* Push the time (and the read ticks after it) to the right edge. */
.wk_mp_chat_message .message_meta .message_time {
  margin-left: auto;
}

.wk_mp_chat_message.sent .message_meta {
  color: rgba(255, 255, 255, 0.75);
}
.wk_mp_chat_message.received .message_meta {
  color: #8e9aa7;
}

.wk_mp_chat_message .message_time {
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.wk_mp_chat_message .wk_edited_label {
  font-style: italic;
  opacity: 0.85;
  white-space: nowrap;
}

.wk_mp_chat_message .message_status {
  margin-left: 4px;
  opacity: 0.85;
  font-size: 0;
  display: inline-flex;
  align-items: center;
  gap: 0;
  white-space: nowrap;
}

.wk_mp_chat_message .message_status i {
  font-size: 11px;
  line-height: 1;
}

.wk_mp_chat_message .message_status i.check::before {
  content: "\f00c";
  font-family: "FontAwesome";
  font-style: normal;
  font-weight: normal;
}

.wk_mp_chat_message .message_status.read {
  color: #3f84c3;
  opacity: 1;
}

.wk_mp_chat_message .message_status.read i + i,
.wk_mp_chat_message .message_status.sent i + i {
  margin-left: -4px;
}

.wk_mp_chat_message .message_status.sent {
  color: rgba(255, 255, 255, 0.78);
}

.wk_mp_chat_message .message_status.failed {
  color: #ffb4ad;
}
.wk_msg_highlight .message_content {
  box-shadow:
    0 0 0 2px #3a8cff inset,
    0 0 10px rgba(58, 140, 255, 0.35);
}

/* Reply: "X replied to Y" header + quoted message shown above the bubble. */
.wk_reply_header {
  font-size: 12px;
  color: #8a929c;
  margin: 0 8px 3px;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.wk_reply_header i {
  font-size: 12px;
  opacity: 0.85;
}
.wk_mp_chat_message.sent .wk_reply_header {
  justify-content: flex-end;
}
.wk_reply_quote {
  position: relative;
  z-index: 2;
  display: inline-block;
  max-width: 100%;
  box-sizing: border-box;
  border-radius: 16px;
  padding: 6px 11px;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  word-break: break-word;
  white-space: pre-wrap;
}
/* Quote of the OTHER person's message: their bubble color, a bit lighter. */
.wk_reply_quote_other {
  background: #f6f7f9;
  border: 1px solid #e3e6ea;
  color: #5a636d;
}
/* Quote of YOUR OWN message: your bubble color (--on-secondary), lightened via alpha. */
.wk_reply_quote_own {
  background: #e2e8ee; /* fallback for browsers without relative color syntax */
  background: rgb(from var(--on-secondary) r g b / 0.15);
  color: var(--on-secondary);
}
/* Small gap between the quote and the reply bubble (quote stays fully clickable). */
.wk_reply_quote + .message_content {
  margin-top: 3px;
}
.wk_mp_actions {
  position: absolute;
  right: 10px;
  top: -18px;
  display: none;
  gap: 8px;
  font-size: 11px;
}
.wk_mp_actions a {
  color: #666;
  margin-left: 8px;
}
.wk_mp_chat_message .message_content:hover .wk_mp_actions {
  display: none;
}

/* Reaction Toolbar - Hidden by default, shown on hover */
.wk_msg_toolbar {
  display: none;
  position: absolute;
  top: -38px;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 20px;
  padding: 4px 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  z-index: 100;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.wk_mp_chat_message.received .wk_msg_toolbar {
  right: auto;
  left: 0;
}

.wk_mp_chat_message .message_content:hover .wk_msg_toolbar {
  display: flex;
  animation: fadeIn 0.2s ease-in-out;
}

/* Once a reaction is chosen, hide the bar immediately until the pointer leaves. */
.wk_mp_chat_message .message_content.wk_suppress_toolbar .wk_msg_toolbar {
  display: none !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wk_msg_reaction_btn,
.wk_msg_reaction_more_btn,
.wk_msg_more_btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 6px;
  border-radius: 50%;
  transition:
    transform 0.2s,
    background 0.2s;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  width: 28px;
  height: 28px;
}

.wk_msg_reaction_btn:hover,
.wk_msg_reaction_more_btn:hover,
.wk_msg_more_btn:hover {
  background: #f0f0f0;
  transform: scale(1.15);
}

.wk_msg_more_btn i,
.wk_msg_reaction_more_btn i {
  font-size: 14px;
}

/* In-bubble meta row: "edited" on the left, time/ticks on the right. */
.wk_msg_footer {
  display: flex;
  align-items: center;
  margin-top: 4px;
  min-width: 0;
}

/* Reaction chip attached to the bubble's bottom-right corner (Messenger style). */
.wk_msg_reactions {
  position: absolute;
  right: 8px;
  left: auto;
  bottom: -13px;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 11;
}

.wk_msg_reaction_item {
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 999px;
  padding: 1px 6px;
  min-height: 18px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  transition: transform 0.15s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.14);
}

.wk_msg_reaction_item .wk_emoji {
  font-size: 13px;
  line-height: 1;
}

.wk_msg_reaction_item .wk_react_count {
  font-size: 11px;
  font-weight: 600;
  color: #5f6368;
}

.wk_msg_reaction_item:hover {
  border-color: #d0d0d0;
  transform: scale(1.08);
}

.wk_msg_reaction_item.wk_my_reacted {
  background: #e8f0fe;
  border-color: #1a73e8;
}

.wk_mp_chat_error {
  color: #e74c3c;
  margin: 4px 0 0;
  padding: 0;
  background: transparent;
  border: none;
  display: block;
  font-weight: 600;
  font-size: 12px;
}

.wk_mp_chat_message.sent .wk_mp_chat_error {
  width: 100%;
  min-width: 0;
  max-width: none;
  text-align: right;
  white-space: normal;
  overflow: visible;
  overflow-wrap: break-word;
}
.wk_mp_chat_warn_icon {
  color: #e74c3c;
}
.wk_mp_warn {
  width: 14px;
  height: 14px;
  display: inline-block;
  border-radius: 50%;
  background: #e74c3c;
  color: #fff;
  font-size: 10px;
  line-height: 14px;
}
.wk_mp_error_text {
  color: #e74c3c;
}
.wk_mp_fail_icon {
  position: absolute;
  right: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid #e74c3c;
  color: #e74c3c;
  font-size: 12px;
  line-height: 18px;
  background: #fff;
}

.wk_mp_chat_day_separator {
  text-align: center;
  font-size: 12px;
  color: #484848;
  display: block;
  align-self: center;
  width: 100%;
  margin: 16px auto;
  padding: 0;
  background: transparent;
  font-weight: 600;
}

.wk_mp_chat_input_area {
  margin-top: 10px;
}

/* Input Area Redesign */
.wk_mp_chat_input_wrapper {
  border-radius: 8px !important;
}

.wk_mp_chat_input_wrapper:focus-within {
  border-color: #2b2b2b;
  box-shadow: 0 0 0 1px #2b2b2b;
}

/* Image Preview Styles */
#wk_image_preview,
.wk_mp_image_preview {
  display: none;
  padding: 10px 10px 0 10px;
  width: 100%;
  gap: 8px;
  flex-wrap: wrap;
  border-bottom: none;
  margin-bottom: 5px;
}

.wk_image_preview_item {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  border: none;
  box-shadow: none;
}

.wk_image_preview_item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}

.wk_image_preview_close {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #fff;
  color: #000;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  text-align: center;
  line-height: 16px;
  font-size: 10px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
  font-weight: bold;
}

.wk_image_preview_close:hover {
  transform: scale(1.1);
  background: #f0f0f0;
}

/* Previews */
#wk_reply_preview,
#wk_edit_preview {
  background: #f7f7f7;
  padding: 12px 44px 12px 16px;
  border: 1px solid #ebebeb;
  position: relative;
  display: none;
  width: 100%;
  max-width: 100%;
  margin: 0 0 10px 0;
  border-radius: 12px;
  box-sizing: border-box;
}

.wk_reply_title,
.wk_edit_title {
  font-weight: 600;
  font-size: 13px;
  color: #222;
  margin-bottom: 2px;
}

.wk_reply_text,
.wk_edit_text {
  font-size: 13px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wk_reply_cancel,
.wk_edit_cancel {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 14px;
  color: #717171;
  width: 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  border-radius: 50%;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif; /* Ensure consistent cross rendering */
}

.wk_reply_cancel:hover,
.wk_edit_cancel:hover {
  background: #ddd;
  color: #000;
}

/* Input Inner Row */
.wk_mp_input_inner {
  display: flex;
  align-items: flex-end;
  position: relative;
  width: 100%;
  padding: 0;
  gap: 8px;
}
.wk_context_menu {
  position: fixed;
  z-index: 9999;
  width: 176px;
  max-width: calc(100vw - 24px);
  min-width: 160px;
  background: #2b2b2b;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  padding: 8px 0;
}
.wk_context_menu.hidden {
  display: none;
}
.wk_context_menu a {
  display: block;
  padding: 8px 12px;
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
}
.wk_context_menu a:hover {
  background: #3a3a3a;
}
.wk_context_menu a i {
  margin-right: 8px;
  width: 16px;
  text-align: center;
  display: inline-block;
}
.wk_context_menu.wk_ctx_left::after,
.wk_context_menu.wk_ctx_right::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}
.wk_context_menu.wk_ctx_left::after {
  right: -8px;
  border-left: 8px solid #2b2b2b;
}
.wk_context_menu.wk_ctx_right::after {
  left: -8px;
  border-right: 8px solid #2b2b2b;
}
.wk_context_menu.wk_ctx_overlay::after {
  display: none;
}
#wk_delete_overlay {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9998;
}
.wk_modal {
  position: fixed;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
  width: 360px;
  z-index: 9999;
}
.wk_modal.hidden,
#wk_delete_overlay.hidden {
  display: none;
}
.wk_modal_body {
  padding: 16px 16px 8px 16px;
}
.wk_modal_title {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  margin-bottom: 10px;
}
.wk_modal_checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
}
.wk_modal_actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 8px 16px 16px 16px;
}
.wk_btn {
  border: 1px solid #ccc;
  background: #f8f8f8;
  color: #333;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.wk_btn_delete {
  background: #e74c3c;
  border-color: #e74c3c;
  color: #fff;
}

/* Send Button */
#wk_mp_chat_send_btn,
#wk_mp_upload_btn {
  border: 1px solid #999;
  background-color: var(--on-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999;
  transition: all 0.2s ease;
  margin: 0;
  position: relative;
  z-index: 10;
  flex-shrink: 0;
}

#wk_mp_chat_send_btn.active,
#wk_mp_upload_btn.active {
  border-color: #222;
  background: #222;
  color: #fff;
}

#wk_mp_chat_send_btn:hover,
#wk_mp_upload_btn:hover {
  border-color: #222;
  background: #222;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(43, 43, 43, 0.2);
}

#wk_mp_chat_send_btn:disabled,
#wk_mp_upload_btn:disabled {
  border-color: #e0e0e0;
  background: #f5f5f5;
  color: #ccc;
  cursor: not-allowed;
  transform: none;
}

#wk_mp_chat_send_btn i,
#wk_mp_upload_btn i {
  font-size: 12px;
}

.wk_mp_chat_inquiry_block {
  text-align: center;
  margin: 8px auto 20px auto;
  font-size: 13px;
  color: #717171;
  max-width: 90%;
  line-height: 1.5;
}

.wk_mp_chat_inquiry_link {
  color: #717171;
  text-decoration: underline;
  font-weight: 500;
  cursor: pointer;
  margin-left: 4px;
  font-size: 13px;
}

.wk_mp_chat_inquiry_link:hover {
  color: #222;
}

.wk_mp_chat_sender_header {
  margin-bottom: 4px;
  font-size: 12px;
  color: #767676;
  margin-left: 2px;
}

.wk_mp_chat_message.sent .wk_mp_chat_sender_header {
  display: none;
}

.wk_mp_sender_name {
  font-weight: 500;
}

.wk_mp_sender_role {
  font-weight: 400;
}

.wk_mp_sender_time {
  margin-left: 4px;
  color: #767676;
}

/* Mobile controls */
.wk_mobile_controls {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  column-gap: 16px;
}
.wk_mobile_back,
.wk_mobile_controls .wk_mobile_details,
.wk_mobile_close_details {
  min-height: 28px;
  padding: 5px 12px;
  font-size: 14px;
  line-height: 1;
  color: #222 !important;
  border: none;
  background: none;
}
.wk_mobile_controls .wk_mobile_back {
  width: 44px;
  padding-left: 0;
  padding-right: 0;
}
.wk_mobile_controls .wk_mobile_details {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}
.wk_mobile_controls .wk_mobile_back i,
.wk_mobile_controls .wk_mobile_details i {
  color: #222 !important;
}
.wk_desktop_title {
  display: none !important;
}
.wk_mobile_title {
  text-align: center;
  min-width: 0;
}
.wk_mobile_title h2 {
  margin: 0;
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: black;
}

.wk_mp_badge_sent {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.wk_mp_no_details {
  color: #717171;
  text-align: center;
  margin-top: 40px;
}

/* Emoji Picker - Fixed Position Popover */
#wk_emoji_picker {
  position: fixed;
  top: 0;
  left: 0;
  right: auto;
  bottom: auto;
  width: 380px; /* Wider for better view */
  max-width: calc(100vw - 24px);
  height: 460px; /* Taller */
  max-height: calc(100vh - 24px);
  background: #ffffff;
  border: none;
  border-radius: 16px;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.12),
    0 4px 8px rgba(0, 0, 0, 0.06);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: wkPopIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#wk_emoji_picker.hidden {
  display: none !important;
}

.wk_emoji_header {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  flex-shrink: 0;
}

#wk_emoji_search_input {
  width: 100%;
  padding: 10px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  font-size: 14px;
  outline: none;
  background: #f7f7f7;
  transition: all 0.2s;
}

#wk_emoji_search_input:focus {
  background: #fff;
  border-color: #2b2b2b;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

.wk_emoji_categories {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.wk_emoji_cat {
  cursor: pointer;
  font-size: 20px;
  opacity: 0.4;
  transition: all 0.2s;
  padding: 6px;
  border-radius: 8px;
  filter: grayscale(100%);
}

.wk_emoji_cat:hover {
  background: #f7f7f7;
  opacity: 0.8;
  filter: grayscale(0%);
}

.wk_emoji_cat.active {
  opacity: 1;
  background: #f0f0f0;
  filter: grayscale(0%);
  transform: scale(1.1);
}

.wk_emoji_grid {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 4px;
  align-content: start;
}

/* Updated class name to match JS generation */
.wk_emoji_btn {
  cursor: pointer;
  font-size: 24px; /* Smaller emojis */
  line-height: 1.2;
  text-align: center;
  padding: 6px;
  border-radius: 8px;
  transition:
    transform 0.1s,
    background 0.1s;
  user-select: none;
  display: inline-block;
}

.wk_emoji_btn:hover {
  background: #f0f0f0;
  transform: scale(1.2);
}

.wk_emoji_empty {
  text-align: center;
  padding: 40px 20px;
  color: #999;
  font-size: 14px;
}

.wk_mp_unread_badge {
  background-color: #f04438;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav_toggle .wk_nav_unread_badge,
.wk_menu_message_badge {
  min-width: 16px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e91e63;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

.nav_toggle .wk_nav_unread_badge {
  min-width: 0;
  width: 12px;
  height: 12px;
  padding: 0;
  position: absolute;
  top: 4px;
  right: 3px;
  font-size: 0;
  line-height: 0;
}

#menu_cont .navigation-link.wk_nav_messages_link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

#menu_cont .navigation-link.wk_nav_messages_link .wk_menu_message_badge {
  margin-left: auto;
}

/* Image Grid Styles */
.wk_image_group_container .wk_image_group_content {
  background: transparent !important;
  padding: 0 !important;
  box-shadow: none !important;
  max-width: 300px; /* Limit width */
}

.wk_image_grid {
  display: grid;
  gap: 4px;
  border-radius: 12px;
  overflow: hidden;
}

.wk_image_grid_2,
.wk_image_grid_4 {
  grid-template-columns: 1fr 1fr;
}

.wk_image_grid_3 {
  grid-template-columns: repeat(3, 1fr);
}

.wk_image_grid_item {
  position: relative;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.wk_image_grid_item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}

.wk_image_grid_item img:hover {
  transform: scale(1.05);
}

.wk_image_grid_overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: bold;
  pointer-events: none;
}

/* Adjust meta position for grid */
.wk_image_group_container .message_meta {
  position: absolute;
  bottom: 4px;
  right: 6px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 3px;
  z-index: 2;
}

.wk_image_group_container .message_time {
  color: #fff;
}

.wk_image_group_container {
  position: relative;
  display: inline-block; /* Ensure it wraps content */
}

/* =========================================
   GoSabai chat redesign
   Matches the Messages / Chat layout, with Reservation shown on demand.
   ========================================= */
body#module-wkmpchat-chat .columns-container .container {
  width: 100% !important;
  max-width: 1024px !important;
  padding-left: 0;
  padding-right: 0;
}

body#module-wkmpchat-chat .breadcrumb,
body#module-wkmpchat-chat .page-heading {
  display: none;
}

.wk_mp_chat_layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  height: calc(100vh - 118px);
  min-height: 680px;
}

.wk_mp_chat_sidebar,
.wk_mp_chat_main,
.wk_mp_chat_details {
  min-height: 0;
  background: #fff;
}

.wk_mp_chat_main,
.wk_mp_chat_details {
  position: relative;
}

.wk_mp_chat_loading_overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.wk_mp_chat_layout.wk_mp_chat_loading .wk_mp_chat_loading_overlay {
  display: flex;
}

.wk_mp_chat_layout.wk_mp_chat_loading .wk_mp_chat_container,
.wk_mp_chat_layout.wk_mp_chat_loading .wk_mp_chat_details > .wk_mp_details_header,
.wk_mp_chat_layout.wk_mp_chat_loading .wk_mp_chat_details > .wk_mp_details_body,
.wk_mp_chat_layout.wk_mp_chat_loading .wk_mp_chat_main > .wk_mp_chat_container > * {
  visibility: hidden;
}

.wk_mp_chat_loading_card {
  width: min(100%, 520px);
  border-radius: 24px;
  padding: 28px 24px;
  background: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.08);
}

.wk_mp_chat_loading_card_details {
  width: min(100%, 360px);
}

.wk_mp_chat_loading_line {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e1e7ef 0%, #f7fafc 50%, #e1e7ef 100%);
  background-size: 200% 100%;
  animation: wkChatSkeleton 1.4s ease-in-out infinite;
  margin: 0 0 16px;
}

.wk_mp_chat_loading_line_lg {
  width: 100%;
  height: 18px;
}

.wk_mp_chat_loading_line_md {
  width: 82%;
}

.wk_mp_chat_loading_line_md.short {
  width: 56%;
}

.wk_mp_chat_loading_line_sm {
  width: 38%;
}

@keyframes wkChatSkeleton {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.wk_mp_chat_sidebar {
  width: auto;
  border-right: 1px solid #edf0f3;
  overflow: hidden;
}

.wk_mp_sidebar_title,
.wk_mp_chat_layout .wk_mp_chat_header,
.wk_mp_details_header {
  height: 58px;
  min-height: 58px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #edf0f3;
  background: #fff;
}

.wk_mp_sidebar_title,
.wk_desktop_title,
.wk_mp_details_header h2 {
  color: #111;
  font-size: 20px;
  font-family: "Oxygen", sans-serif;
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

.wk_mp_thread_list {
  height: calc(100% - 58px);
  overflow-y: auto;
  padding: 0 0 16px;
}

.wk_mp_thread_item {
  display: block;
  padding: 16px 0px 16px 16px;
  margin: 0;
  border: 0;
  border-left: 3px solid transparent;
  border-bottom: 1px solid #f0f2f4;
  color: #111;
  background: #fff;
  text-decoration: none;
}

.wk_mp_thread_item.active {
  background: #e7f8f8;
  border-left-color: var(--primary-dark);
  opacity: 10;
}

.wk_mp_thread_item:hover {
  background: #f4fbfb;
  color: #111;
  text-decoration: none;
}

.wk_mp_thread_content {
  position: relative;
  margin-right: 12px;
}

.wk_mp_thread_row_top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 12px;
  margin: 0 0 6px;
}

.wk_mp_thread_content > .wk_mp_unread_badge {
  position: absolute;
  top: auto;
  right: 0;
  bottom: 0;
  transform: none;
}

.wk_mp_thread_name {
  color: #111;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wk_mp_thread_date {
  color: #6b7280;
  font-size: 12px;
  line-height: 1.25;
  display: inline-block;
  margin: 0;
  white-space: nowrap;
}

.wk_mp_thread_row_bottom,
.wk_mp_thread_last_msg,
.wk_sidebar_product_name,
.wk_sidebar_thread_dates {
  color: #59677a;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.3;
}

.wk_mp_thread_row_bottom,
.wk_mp_thread_last_msg {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.wk_sidebar_product_name {
  display: inline;
  color: #59677a;
}

.wk_sidebar_thread_dates {
  display: inline;
}

.wk_sidebar_thread_sep {
  color: #59677a;
  margin: 0 5px;
  font-size: 14px;
}

.wk_mp_chat_main {
  overflow: hidden;
  min-width: 0;
}

.wk_mp_chat_layout .wk_mp_chat_container {
  height: 100%;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
}

.wk_mp_chat_layout .wk_mp_chat_header {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  height: 58px;
  min-height: 58px;
  padding-top: 0;
  padding-bottom: 0;
}

.wk_mp_chat_subtitle {
  display: none;
  color: #59677a;
  font-size: 11px;
  line-height: 1.25;
  margin: 4px 0 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wk_mp_chat_layout .wk_mp_chat_box {
  flex: 1 1 auto;
  min-height: 0 !important;
  padding: 18px 14px 22px !important;
  margin: 0 !important;
  overflow-y: auto !important;
  background: #fff !important;
  border: 0 !important;
}

.wk_mp_chat_message {
  max-width: 78%;
  margin-bottom: 30px;
}

.wk_mp_chat_message.sent {
  align-self: flex-end;
  margin-right: 0;
}

.wk_mp_chat_message.sent:has(.wk_mp_chat_error) {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: min(360px, calc(100% - 32px));
  max-width: min(360px, calc(100% - 32px));
  margin-right: 13px;
}

.wk_mp_chat_message.sent:has(.wk_mp_chat_error) .message_content {
  align-self: flex-end;
}

.wk_mp_chat_message.received {
  align-self: flex-start;
}

.wk_mp_chat_message .message_content {
  border: 0 !important;
  box-shadow: none;
  padding: 10px 14px 22px;
  border-radius: 14px;
  min-width: 0;
  max-width: 100%;
  /* Keep text on the same (left) side as the "edited" mark, not right-aligned. */
  text-align: left;
}

.wk_mp_chat_message.sent .message_content {
  background: #204463;
  color: #fff;
  border-bottom-right-radius: 10px;
  min-width: 90px;
}

.wk_mp_chat_message.received .message_content {
  background: #f0f2f5;
  color: #111827;
  border-top-left-radius: 14px;
}

.wk_mp_chat_message .message_text {
  font-size: 13px;
  line-height: 1.35;
}

.wk_mp_chat_message.sent .message_text {
  color: #fff;
}

.wk_mp_chat_message.received .message_text {
  color: #111827;
}

.wk_mp_chat_message .message_meta {
  font-size: 11px;
  font-weight: 400;
  color: #8e9aa7;
}

.wk_mp_chat_message.sent .message_meta {
  color: rgba(255, 255, 255, 0.75);
}
.wk_mp_chat_message.received .message_meta {
  color: #8e9aa7;
}

.wk_msg_toolbar {
  display: none;
}

/* Date separator shown once at the start of each day's messages. */
.wk_mp_chat_day_separator {
  display: block;
  text-align: center;
  align-self: center;
  width: 100%;
  margin: 18px auto 14px;
  font-size: 12px;
  font-weight: 600;
  color: #8a929c;
  letter-spacing: 0.3px;
}

.wk_mp_chat_layout .wk_mp_chat_input_area {
  flex: 0 0 auto;
  padding: 16px;
  border-top: 1px solid #edf0f3;
  background: #fff;
}

.wk_mp_chat_input_wrapper {
  margin: 0;
  padding: 0;
  border: 1px solid #d6dee6;
  box-shadow: none;
}

.wk_mp_chat_input_wrapper:focus-within {
  border-color: var(--on-secondary);
  box-shadow: 0 0 0 1px rgba(19, 54, 79, 0.16);
}

.wk_mp_input_inner {
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 12px;
}

#wk_mp_chat_message_input {
  height: 36px !important;
  padding: 0;
  line-height: 36px;
  flex: 1;
  border: none;
  background: transparent;
  overflow-y: hidden;
}

#wk_mp_upload_btn,
#wk_mp_chat_send_btn {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #173653;
  box-shadow: none;
}

#wk_mp_upload_btn:hover,
#wk_mp_chat_send_btn:hover,
#wk_mp_chat_send_btn.active,
#wk_mp_upload_btn.active {
  background: transparent;
  color: #173653;
  box-shadow: none;
}

.wk_mp_chat_details {
  display: none;
  flex-direction: column;
  width: auto;
  height: 100%;
  padding: 0;
  border-left: 0;
  overflow: hidden;
}

.wk_mp_details_header {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.wk_mp_details_body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 18px 28px;
}

.wk_mp_listing_card {
  margin: 0 0 16px;
}

.wk_mp_listing_img_wrapper {
  border-radius: 0 0 8px 8px;
  overflow: hidden;
  padding: 16px 0px 16px 0px;
}

.wk_mp_listing_img {
  width: 100%;
  height: clamp(210px, 26vw, 300px);
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.wk_mp_listing_title {
  color: #050505;
  line-height: 1.1;
  margin: 0 0 10px;
  font-weight: 600;
}

.wk_mp_listing_dates,
.wk_mp_listing_location {
  color: #111;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 0;
}

.wk_mp_listing_status {
  color: #ff5a5f;
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 8px;
}

.wk_btn_book {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 37px;
  padding: 8px 43px;
  border: 1px solid #15aaa6;
  border-radius: 8px;
  color: #15aaa6;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
  text-decoration: none !important;
}

.wk_btn_book:visited,
.wk_btn_book:focus,
.wk_btn_book:active {
  text-decoration: none !important;
}

.wk_btn_book:hover {
  background: rgba(21, 170, 166, 0.08);
  color: #118f8c;
  border-color: #118f8c;
  text-decoration: none !important;
}

.wk_mp_trip_details h3 {
  color: #111;
  font-family: "Oxygen", sans-serif;
  font-weight: 700;
  height: 48px;
  line-height: 48px;
  margin: 0;
}

.wk_mp_payment_details {
  margin-top: 16px;
}

.wk_mp_payment_details h3 {
  color: #111;
  font-family: "Oxygen", sans-serif;
  font-weight: 700;
  height: 48px;
  line-height: 48px;
  margin: 0;
}

.wk_mp_detail_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
  padding: 18px 0;
  margin: 0;
  border-top: 1px solid #d7d7d7;
  color: #111;
  font-size: 20px;
}

.wk_mp_detail_item_dates {
  display: none;
}

.wk_mp_detail_label {
  color: #111;
  font-size: 14px;
}

.wk_mp_detail_value {
  color: #111;
  text-align: right;
  white-space: nowrap;
  font-size: 14px;
}

.wk_mp_detail_value_expired {
  color: #ff5a5f;
}

.wk_mp_payment_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 48px;
  padding: 18px 0;
  border-top: 1px solid #d7d7d7;
  color: #111;
  font-size: 20px;
}

.wk_mp_payment_label {
  color: #111;
  font-size: 14px;
}

.wk_mp_payment_value {
  color: #111;
  text-align: right;
  white-space: nowrap;
  font-size: 14px;
}

.wk_mp_payment_total {
  font-weight: 700;
}

.wk_mp_no_threads,
.wk_mp_no_messages,
.wk_mp_no_details {
  color: #667085;
  font-size: 13px;
  text-align: center;
}

.wk_mp_chat_sidebar::-webkit-scrollbar,
.wk_mp_thread_list::-webkit-scrollbar,
.wk_mp_chat_box::-webkit-scrollbar,
.wk_mp_chat_details::-webkit-scrollbar,
.wk_mp_details_body::-webkit-scrollbar {
  width: 6px;
}

.wk_mp_chat_sidebar::-webkit-scrollbar-thumb,
.wk_mp_thread_list::-webkit-scrollbar-thumb,
.wk_mp_chat_box::-webkit-scrollbar-thumb,
.wk_mp_chat_details::-webkit-scrollbar-thumb,
.wk_mp_details_body::-webkit-scrollbar-thumb {
  background: #173653;
  border-radius: 8px;
}

@keyframes wkPopIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
