.contactline .user-image {
  position: relative;
}

.chat-ring {
  --chat-ring: #b7b9cc;
}

.chat-ring img.rounded-circle,
.chat-ring i.rounded-circle {
  box-shadow: 0 0 0 3px var(--chat-ring);
}

.chat-ring.is-available { --chat-ring: #1cc88a; }
.chat-ring.is-away,
.chat-ring.is-brb { --chat-ring: #f6c23e; }
.chat-ring.is-busy,
.chat-ring.is-dnd,
.chat-ring.is-call { --chat-ring: #e74a3b; }
.chat-ring.is-offline { --chat-ring: #b7b9cc; }

.chat-ring {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.chat-ring::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -3px;
  width: 16px;
  height: 16px;
  border: 2px solid var(--dm-surface, #fff);
  border-radius: 50%;
  background-color: var(--chat-ring);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 12px 12px;
  box-sizing: border-box;
  pointer-events: none;
}

.profile-card .avatar-wrapper.chat-ring {
  position: absolute;
  display: block;
}

.profile-card .avatar-wrapper.chat-ring .avatar-circle {
  box-shadow: 0 0 0 4px var(--chat-ring);
}

.profile-card .avatar-wrapper.chat-ring::after {
  right: 2px;
  bottom: 2px;
  width: 24px;
  height: 24px;
  background-size: 18px 18px;
}

.chat-ring.is-available::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2l2.1 2.1L9 4.2' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.chat-ring.is-dnd::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3.2 6h5.6' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
}

.chat-ring.is-away::after,
.chat-ring.is-brb::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M6 3v3.2l2 1.3' fill='none' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.chat-ring.is-offline::after {
  background-color: var(--dm-surface, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='4.6' fill='none' stroke='%23858796' stroke-width='1.6'/%3E%3Cpath d='M4.4 4.4l3.2 3.2M7.6 4.4L4.4 7.6' fill='none' stroke='%23858796' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
}

.vs1-chat-status {
  font-size: 0.875rem;
  opacity: 0.8;
}

.chat-status-icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 10px;
  border-radius: 50%;
  vertical-align: -2px;
  background: #b7b9cc;
}

.chat-status-icon.is-available { background: #1cc88a; }
.chat-status-icon.is-busy,
.chat-status-icon.is-call,
.chat-status-icon.is-dnd { background: #e74a3b; }
.chat-status-icon.is-brb,
.chat-status-icon.is-away { background: #f6c23e; }
.chat-status-icon.is-offline { background: transparent; box-shadow: inset 0 0 0 2px #858796; }

.chat-status-icon.is-dnd::after {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: calc(50% - 1px);
  height: 2px;
  background: #fff;
}

.chat-status-reset {
  width: 14px;
  margin-right: 10px;
  text-align: center;
}

.chatStatusOption.is-active {
  font-weight: 700;
}

.chatStatusToggle {
  display: flex;
  align-items: center;
  max-width: 18rem;
  overflow-wrap: anywhere;
  white-space: normal;
}

.chat-status-current {
  margin-left: auto;
  padding-left: 1rem;
  font-size: 0.8125rem;
  opacity: 0.8;
}

.chatStatusToggle .chat-status-chevron {
  margin-left: 0;
  padding-left: 0.5rem;
}

.chat-status-chevron {
  margin-left: auto;
  padding-left: 1rem;
  font-size: 0.75rem;
  opacity: 0.7;
}

.chatStatusToggle[aria-expanded="true"] .chat-status-chevron {
  transform: rotate(90deg);
}

.chat-status-list {
  padding-left: 0.75rem;
  border-top: 1px solid var(--dm-border, #e3e6f0);
  border-bottom: 1px solid var(--dm-border, #e3e6f0);
}

.chat-status-list[hidden] {
  display: none;
}

.vs1-chat-search-toggle {
  color: inherit;
  font-size: 1.125rem;
}

.vs1-chat-search {
  padding: 0.5rem 1rem;
  background: var(--dm-surface-2, #f8f9fc);
}

.vs1-chat-search-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.vs1-chat-search-row .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.vs1-chat-search-all {
  flex: 0 0 auto;
  white-space: nowrap;
}

.vs1-chat-search-note {
  margin: 0.375rem 0 0;
  font-size: 0.875rem;
  opacity: 0.8;
}

.vs1-chat-search-note:empty {
  display: none;
}

.vs1-chat-search-results {
  max-height: 16rem;
  margin: 0.375rem 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.vs1-chat-search-results:empty {
  display: none;
}

.vs1-chat-search-result {
  display: block;
  width: 100%;
  padding: 0.5rem 0.625rem;
  background: var(--dm-surface, #fff);
  border: 1px solid var(--dm-border, #e3e6f0);
  border-radius: 0.35rem;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.vs1-chat-search-results li + li {
  margin-top: 0.25rem;
}

.vs1-chat-search-result:hover,
.vs1-chat-search-result:focus-visible {
  border-color: #00a3d3;
  outline: none;
}

.vs1-chat-search-meta,
.vs1-chat-search-snippet {
  display: block;
  overflow-wrap: anywhere;
}

.vs1-chat-search-meta {
  font-size: 0.8125rem;
  opacity: 0.8;
}

.vs1-chat-replying {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 1.5rem;
  padding: 0.375rem 0.625rem;
  background: var(--dm-surface-2, #f8f9fc);
  border-left: 3px solid #00a3d3;
  border-radius: 0.2rem;
  font-size: 0.875rem;
}

.vs1-chat-replying-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-reply-quote {
  display: block;
  width: 100%;
  margin-bottom: 0.375rem;
  padding: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.06);
  border: 0;
  border-left: 3px solid #00a3d3;
  border-radius: 0.2rem;
  color: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
}

.chat-reply-quote strong,
.chat-reply-quote span {
  display: block;
  overflow-wrap: anywhere;
}

.chat-reply-quote:focus-visible {
  outline: 2px solid #00a3d3;
}

.message-wrapper.chat-jump-highlight .msg-box {
  box-shadow: 0 0 0 0.15rem rgba(0, 163, 211, 0.6);
  transition: box-shadow 0.3s;
}

@media (max-width: 576px) {
  .vs1-chat-search-row {
    flex-wrap: wrap;
  }

  .vs1-chat-replying {
    margin: 0 0.5rem;
  }
}

.chat-import {
  margin: 4px 0 8px;
  padding: 12px;
  border: 1px solid var(--dm-border, #e3e6f0);
  border-radius: 8px;
  background: var(--dm-surface-2, #f8f9fc);
}

.chat-import-help {
  margin: 0 0 10px;
  font-size: 0.9375rem;
}

.chat-import-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}

.chat-import-filename {
  min-width: 0;
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}

.chat-import-note {
  margin-top: 10px;
  font-size: 0.9375rem;
}

.chat-import-note.is-error {
  color: #c0392b;
}

.chat-import-list {
  max-height: 320px;
  margin: 10px 0;
  overflow: auto;
  border: 1px solid var(--dm-border, #e3e6f0);
  border-radius: 6px;
  background: var(--dm-surface, #fff);
}

.chat-import-table {
  margin: 0;
  font-size: 0.875rem;
}

.chat-import-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--dm-surface-2, #f8f9fc);
  white-space: nowrap;
}

.chat-import-table td {
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.chat-import-tick {
  width: 40px;
}

.chat-import-table tr.is-locked td {
  opacity: 0.75;
}

.chat-import-status.is-ready {
  font-weight: 600;
}

.chat-import-status.is-done {
  color: #13855c;
  font-weight: 600;
}

.chat-import-status.is-error {
  color: #c0392b;
  font-weight: 600;
}

.chat-cal-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.chat-cal-range {
  margin-left: 8px;
  font-weight: 600;
}

.chat-cal-note {
  margin-bottom: 12px;
}

.chat-cal-note.is-error {
  color: #c0392b;
}

.chat-cal-day {
  margin-bottom: 16px;
}

.chat-cal-dayname {
  margin: 0 0 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--dm-border, #e3e6f0);
  font-size: 1rem;
  font-weight: 700;
}

.chat-cal-todaytag {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 10px;
  background: #00a3d3;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  vertical-align: middle;
}

.chat-cal-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--dm-border, #e3e6f0);
  border-left: 4px solid #00a3d3;
  border-radius: 6px;
  background: var(--dm-surface, #fff);
}

.chat-cal-item.is-live {
  border-left-color: #1cc88a;
}

.chat-cal-item.is-ended {
  border-left-color: #b7b9cc;
  opacity: 0.75;
}

.chat-cal-time {
  flex: 0 0 150px;
  font-weight: 600;
  white-space: nowrap;
}

.chat-cal-main {
  flex: 1 1 180px;
  min-width: 0;
}

.chat-cal-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.chat-cal-sub {
  font-size: 0.875rem;
  opacity: 0.8;
  overflow-wrap: anywhere;
}

.chat-cal-badge {
  padding: 2px 10px;
  border: 1px solid var(--dm-border, #e3e6f0);
  border-radius: 10px;
  background: var(--dm-surface-2, #f8f9fc);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.chat-cal-state {
  font-size: 0.8125rem;
  opacity: 0.8;
}

.chat-cal-empty {
  padding: 6px 0;
  font-size: 0.9375rem;
  opacity: 0.7;
}

.chat-toolbar-label {
  margin-left: 0.5rem;
}

@media (max-width: 1199.98px) {
  .chat-toolbar-label {
    display: none;
  }
}

.chat-push {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--dm-border, #e3e6f0);
  border-radius: 10px;
  background: var(--dm-paper, #fff);
}

.chat-push-title {
  margin: 0 0 8px;
  font-weight: 600;
}

.chat-push-text {
  margin: 0 0 12px;
}

.chat-push-text.is-error {
  color: #c0392b;
}

.msg-box .chat-file-card .mobile-file-name,
.msg-box .chat-file-card .chat-file-name,
.msg-box .chat-file-card .chat-file-icon {
  color: var(--dm-text, #5a5c69);
}

.contactline .contactline-data {
  min-width: 0;
}

.contactline .contact-name {
  display: -webkit-box;
  min-width: 0;
  max-height: 2.6em;
  overflow: hidden;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.vs1-chat-head-name {
  min-width: 0;
}

.vs1-chat-head-name strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.25;
  overflow-wrap: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.row:has(> .vs1-mobile-chat-col) {
  margin-right: 0;
  margin-left: 0;
}

.vs1-mobile-chat-col {
  padding-right: 0;
  padding-left: 0;
}

@media (max-width: 575.98px) {
  .vs1-chat-headbar {
    padding-right: 0.75rem !important;
    padding-left: 0.75rem !important;
  }

  .vs1-chat-head img[width="60"],
  .vs1-chat-head .rounded-circle[style*="60px"] {
    width: 44px !important;
    height: 44px !important;
  }

  .vs1-chat-head button.rounded-circle i {
    font-size: 18px !important;
  }

  .vs1-chat-head .vs1-chat-search-toggle {
    padding-right: 0.5rem;
    padding-left: 0.25rem;
  }
}

div.contactline {
  padding-right: 0.25rem;
  padding-left: 0.5rem;
}

.contactline .contact-name {
  margin-left: 0.5rem !important;
  font-size: 0.9375rem;
}

.contactline:has(.chat-ring.is-available) { --chat-row: #1cc88a; }
.contactline:has(.chat-ring.is-away),
.contactline:has(.chat-ring.is-brb) { --chat-row: #f6c23e; }
.contactline:has(.chat-ring.is-busy),
.contactline:has(.chat-ring.is-dnd),
.contactline:has(.chat-ring.is-call) { --chat-row: #e74a3b; }
.contactline:has(.chat-ring.is-offline) { --chat-row: #858796; }

div.contactline:has(.chat-ring) {
  background-color: color-mix(in srgb, var(--chat-row) 9%, var(--dm-surface, #fff));
}

div.contactline.active:has(.chat-ring) {
  background-color: color-mix(in srgb, var(--chat-row) 24%, var(--dm-surface, #fff)) !important;
}

html.dark-mode div.contactline:has(.chat-ring) {
  background-color: color-mix(in srgb, var(--chat-row) 14%, var(--dm-surface, #0f2430)) !important;
}

html.dark-mode div.contactline.active:has(.chat-ring) {
  background-color: color-mix(in srgb, var(--chat-row) 30%, var(--dm-surface, #0f2430)) !important;
}

.chat-nick-label {
  font-weight: 600;
}

.chat-nick-text {
  margin: 8px 0 0;
}

.chat-nick-text.is-error {
  color: #c0392b;
}

.chat-nick .modal-footer {
  flex-wrap: wrap;
  gap: 8px;
}

.chat-links-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--dm-border, #e3e6f0);
}

.chat-links-name {
  min-width: 0;
  overflow-wrap: anywhere;
}

.message-content a.chat-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: #0b5cad;
  text-decoration: underline !important;
  cursor: pointer;
}

html.dark-mode .message-content a.chat-link,
.message-wrapper:has(.msg-box:hover, .reaction-holder:hover) .message-content a.chat-link {
  color: inherit;
}

.message-content a.chat-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
  border-radius: 2px;
}

.dropdown-content.chat-msg-menu {
  min-width: 200px;
  padding: 4px;
  background-color: var(--dm-paper, #fff);
  border: 1px solid var(--dm-border, #d1d3e2);
  border-radius: 0.35rem;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  z-index: 5;
}

.dropdown-content.chat-msg-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-radius: 0.2rem;
  color: var(--dm-text, #3a3b45) !important;
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.18s ease;
}

.dropdown-content.chat-msg-menu a i {
  flex: 0 0 18px;
  width: 18px;
  text-align: center;
  font-size: 15px;
  color: var(--dm-text-muted, #6e707e);
}

.dropdown-content.chat-msg-menu a:hover,
.dropdown-content.chat-msg-menu a:focus-visible {
  background-color: var(--dm-surface-2, #eef1f6);
  outline: none;
}

.dropdown-content.chat-msg-menu a:focus-visible {
  box-shadow: inset 0 0 0 2px #00a3d3;
}

.dropdown-content.chat-msg-menu a.delete-menu,
.dropdown-content.chat-msg-menu a.delete-menu i {
  color: var(--dm-red-text, #c0392b) !important;
}

.chat-msg-menu-sep {
  height: 1px;
  margin: 4px 8px;
  background-color: var(--dm-border, #e3e6f0);
}

.vs1-meeting-alerts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1080;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 32px));
}

.vs1-meeting-alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 4px solid #00a3d3;
  background: var(--dm-paper, #ffffff);
  color: var(--dm-text, #3a3b45);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.vs1-meeting-alert-started {
  border-left-color: #1cc88a;
}

.vs1-meeting-alert-icon {
  margin-top: 3px;
  color: #00a3d3;
}

.vs1-meeting-alert-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vs1-meeting-alert-body strong {
  overflow-wrap: anywhere;
}

.vs1-meeting-alert-body span {
  font-size: 13px;
  color: var(--dm-muted, #5a5c69);
}

.vs1-meeting-alert-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.msg-box .message-content ol,
.msg-box .message-content ul {
  margin: 4px 0;
  padding-left: 24px;
  white-space: normal;
}

.msg-box .message-content li {
  margin: 4px 0;
  padding-left: 2px;
}

.msg-box .message-content code {
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.92em;
  background-color: var(--dm-surface-2, rgba(0, 0, 0, 0.06));
  color: inherit;
}

.message-content .chat-file-ref {
  color: #0b5cad;
  text-decoration: underline;
  overflow-wrap: anywhere;
}

html.dark-mode .message-content .chat-file-ref,
.message-wrapper:has(.msg-box:hover, .reaction-holder:hover) .message-content .chat-file-ref {
  color: inherit;
}
