/* Unified conversations workspace */
.conversation-workspace {
  position: relative;
  min-height: 620px;
  display: grid;
  grid-template-columns: clamp(310px, 24vw, 350px) minmax(430px, 1fr) clamp(300px, 23vw, 340px);
  gap: 0;
  overflow: hidden;
  border: 1px solid #D9E1E8;
  border-radius: 8px;
  background: #FFFFFF;
  box-shadow: 0 10px 28px rgba(29, 39, 51, 0.07);
  color: #192434;
}

.conversation-inbox,
.conversation-thread,
.conversation-context {
  min-width: 0;
  min-height: 0;
  background: #FFFFFF;
}

.conversation-inbox {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid #DDE5EC;
}

.conversation-inbox-head {
  min-height: 68px;
  padding: 10px 14px;
}

.conversation-inbox-head h2 {
  margin: 0;
  color: #172033;
  font-size: 19px;
  line-height: 1.2;
}

.conversation-inbox-head span {
  display: block;
  margin-top: 3px;
  color: #7A8798;
  font-size: 14px;
}

.conversation-inbox-head .icon-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  border-radius: 7px;
  background: #119B73;
  color: #FFFFFF;
}

.conversation-filters {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
  background: #F8FAFB;
}

.conversation-search {
  grid-column: 1 / -1;
}

.conversation-sync-status {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid #DDE5EC;
  border-bottom: 1px solid #DDE5EC;
  background: #F4F8FA;
  color: #334155;
}

.conversation-sync-status[hidden] {
  display: none;
}

.conversation-sync-status > i {
  width: 10px;
  height: 10px;
  border: 2px solid #A7B4C2;
  border-top-color: #078C86;
  border-radius: 50%;
}

.conversation-sync-status.is-syncing > i {
  animation: conversation-sync-spin 0.9s linear infinite;
}

.conversation-sync-status.is-incomplete > i {
  border: 0;
  border-radius: 50%;
  background: #D99216;
}

.conversation-sync-status span,
.conversation-sync-status strong,
.conversation-sync-status small {
  min-width: 0;
}

.conversation-sync-status strong,
.conversation-sync-status small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-sync-status strong {
  font-size: 13px;
  line-height: 1.25;
}

.conversation-sync-status small {
  margin-top: 1px;
  color: #687587;
  font-size: 12px;
}

.conversation-sync-status button {
  padding: 5px 7px;
  border: 0;
  background: transparent;
  color: #087E78;
  font-weight: 700;
  cursor: pointer;
}

@keyframes conversation-sync-spin {
  to { transform: rotate(360deg); }
}

.conversation-control {
  width: 100%;
  min-height: 40px;
  border-radius: 6px;
  font-size: 14px;
}

.conversation-list {
  max-height: none;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.conversation-list.loading-more::after {
  content: 'Cargando conversaciones...';
  display: block;
  padding: 12px;
  color: #687587;
  font-size: 13px;
  text-align: center;
}

.conversation-list.loading {
  opacity: 0.55;
  pointer-events: none;
}

.conversation-row {
  min-height: 82px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  grid-template-areas:
    "avatar title time"
    "avatar preview unread"
    "chips chips chips";
  gap: 2px 9px;
  padding: 10px 11px 9px 9px;
  border-left-width: 3px;
}

.conversation-row.active {
  background: #EAF7F5;
  border-left-color: #119B73;
}

.conversation-row:hover,
.conversation-row:focus-visible {
  background: #F1F8F7;
}

.conversation-row-menu {
  position: fixed;
  z-index: 1500;
  width: 224px;
  padding: 6px;
  border: 1px solid #D6DFE7;
  border-radius: 7px;
  background: #FFFFFF;
  box-shadow: 0 12px 30px rgba(24, 36, 52, 0.18);
}

.conversation-row-menu[hidden] {
  display: none;
}

.conversation-row-menu button {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #253247;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.conversation-row-menu button:hover,
.conversation-row-menu button:focus-visible {
  outline: none;
  background: #F0F5F7;
}

.conversation-row-menu button.danger {
  color: #A53838;
}

.conversation-row-menu button.danger:hover,
.conversation-row-menu button.danger:focus-visible {
  background: #FFF0F0;
}

.conversation-row-menu .nav-icon {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
}

.message-context-menu {
  width: 150px;
}

.message-context-menu button {
  gap: 8px;
  padding-right: 6px;
  padding-left: 6px;
}

.message-context-menu [data-message-menu-action="delete"] {
  margin-top: 4px;
  padding-top: 11px;
  box-shadow: inset 0 1px #E3E8ED;
}

.conversation-row .avatar {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.row-title {
  font-size: 15px;
}

.row-time {
  padding-top: 1px;
  font-size: 12px;
  white-space: nowrap;
}

.row-preview {
  color: #667386;
  font-size: 14px;
}

.row-typing {
  color: #008b78;
  font-weight: 700;
  white-space: nowrap;
}

.row-typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 3px;
  vertical-align: middle;
}

.row-typing-dots i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  animation: conversation-row-typing 1.1s infinite ease-in-out;
}

.row-typing-dots i:nth-child(2) { animation-delay: 0.14s; }
.row-typing-dots i:nth-child(3) { animation-delay: 0.28s; }

@keyframes conversation-row-typing {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-1px); }
}

.row-chips {
  min-height: 20px;
  flex-wrap: nowrap;
  overflow: hidden;
}

.row-line,
.row-attention {
  min-width: 0;
  display: inline-block;
  overflow: hidden;
  color: #718095;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-attention.is-warning {
  color: #99620a;
  animation: queue-attention-pulse 1.5s ease-in-out infinite;
}

.row-attention.is-overdue { color: #bd3030; }

@keyframes queue-attention-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

.row-line::before {
  content: "";
  width: 6px;
  height: 6px;
  display: inline-block;
  margin-right: 5px;
  border-radius: 50%;
  background: #20A879;
}

.row-line.is-queue::before { display: none; }

.thread-claim {
  min-height: 38px;
  padding: 7px 13px;
}

.row-attention {
  flex: 0 0 auto;
  margin-left: auto;
  color: #9A6410;
}

.row-unread {
  min-width: 20px;
  height: 20px;
  font-size: 12px;
}

.row-unread.is-attention {
  background: #c9820b;
}

.row-unread.is-overdue {
  background: #d3414b;
}

.row-unread[hidden] {
  display: none;
}

.conversation-empty {
  min-height: 240px;
  align-content: center;
  gap: 7px;
  padding: 24px;
  color: #748195;
}

.conversation-empty-icon,
.thread-empty-icon,
.context-empty-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #EAF1F4;
  color: #547084;
}

.conversation-empty-icon .nav-icon,
.thread-empty-icon .nav-icon,
.context-empty-icon .nav-icon {
  width: 25px;
  height: 25px;
}

.conversation-thread {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  overflow: hidden;
  border-right: 1px solid #DDE5EC;
}

.attachment-drop-overlay {
  position: absolute;
  inset: 12px;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  border: 2px dashed #168B79;
  border-radius: 8px;
  background: rgba(244, 250, 249, 0.96);
  color: #176E61;
  pointer-events: none;
}

.attachment-drop-overlay[hidden] { display: none; }
.attachment-drop-overlay .nav-icon { width: 42px; height: 42px; }
.attachment-drop-overlay strong { font-size: 20px; }
.attachment-drop-overlay span { color: #607286; font-size: 14px; }

.thread-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 13px;
}

.thread-header.loading {
  opacity: 0.65;
}

.thread-header-main,
.thread-contact-placeholder {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.thread-contact {
  min-width: 0;
}

.thread-contact > div,
.thread-contact-placeholder > div {
  min-width: 0;
}

.thread-title {
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-subtitle {
  overflow: hidden;
  min-height: 18px;
  margin-top: 2px;
  color: #687587;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-availability {
  color: #0B8D79;
  font-size: 13px;
  font-weight: 600;
}

.thread-availability[hidden] { display: none; }

.thread-line-dot {
  display: inline-block;
  margin: 0 5px;
}

.thread-actions {
  flex: 0 0 auto;
}

.thread-status {
  min-width: 116px;
  min-height: 38px;
  padding: 7px 28px 7px 12px;
  background: #FFFFFF;
}

.line-connection {
  width: 9px;
  height: 9px;
  display: block;
  border-radius: 50%;
  background: #C64747;
}

.line-connection.online {
  background: #15966A;
}

.thread-mobile-button {
  display: none;
}

.message-list {
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 18px clamp(16px, 3vw, 38px);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background-color: #F4F3EF;
  background-image:
    linear-gradient(rgba(248, 247, 244, 0.28), rgba(248, 247, 244, 0.28)),
    url('/assets/img/chat-pattern-intekconnect.webp');
  background-repeat: repeat;
  background-size: auto, 620px 620px;
}

.thread-empty-state {
  min-height: 100%;
  gap: 9px;
}

.thread-empty-state strong {
  color: #344254;
  font-size: 16px;
}

.thread-empty-state span:last-child {
  max-width: 350px;
  font-size: 14px;
}

.thread-empty-state.compact {
  min-height: 240px;
}

.message-history {
  align-self: stretch;
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.message-history .btn {
  min-height: 34px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 13px;
}

.message-date {
  position: relative;
  z-index: 1;
  display: flex;
  align-self: stretch;
  justify-content: center;
  margin: 8px 0 14px;
  pointer-events: none;
}

.message-active-date {
  position: absolute;
  left: 50%;
  z-index: 6;
  max-width: calc(100% - 48px);
  transform: translateX(-50%);
  border: 1px solid rgba(95, 108, 119, 0.18);
  border-radius: 6px;
  padding: 5px 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 7px rgba(29, 39, 51, 0.1);
  color: #617081;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
}

.message-active-date[hidden] {
  display: none;
}

.message-date span {
  padding: 5px 10px;
  border: 1px solid rgba(95, 108, 119, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 6px rgba(29, 39, 51, 0.05);
  color: #617081;
  font-size: 12px;
  font-weight: 700;
}

.message-bubble {
  box-sizing: border-box;
  width: fit-content;
  max-width: min(590px, 78%);
  margin: 0;
  padding: 7px 10px 5px;
  border-radius: 7px;
  box-shadow: 0 1px 4px rgba(29, 39, 51, 0.07);
}

.message-bubble.outgoing {
  align-self: flex-end;
  margin-left: 0;
  background: #DDF5E4;
}

.message-bubble.incoming {
  align-self: flex-start;
}

.message-bubble.internal {
  align-self: center;
  width: fit-content;
  max-width: min(640px, 88%);
  margin: 0;
  padding: 10px 12px;
  background: #FFF4D6;
}

.message-author {
  display: block;
  margin-bottom: 3px;
  color: #9A6410;
  font-size: 12px;
}

.message-text {
  font-size: 15px;
  line-height: 1.4;
}

.message-meta {
  min-height: 17px;
  gap: 5px;
  font-size: 11px;
}

.message-text > .message-meta {
  display: inline-flex;
  min-height: 0;
  margin: 0 0 0 8px;
  line-height: 1;
  white-space: nowrap;
  vertical-align: baseline;
}

.message-delivery {
  color: #6D7A8D;
  font-weight: 700;
}

.message-delivery.read {
  color: #0788C7;
  font-weight: 900;
}

.message-delivery.failed {
  color: #C64747;
  font-weight: 900;
}

.message-delivery.pending {
  color: #9A6410;
  font-size: 13px;
  font-weight: 800;
}

.message-bubble.outgoing.policy-hold {
  border: 1px solid #E4C477;
  background: #FFF9E8;
}

.message-policy-hold {
  display: flex;
  gap: 7px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(154, 100, 16, 0.22);
  color: #77521A;
  line-height: 1.25;
}

.message-policy-hold > span:last-child {
  display: grid;
  gap: 2px;
}

.message-policy-hold strong,
.message-policy-hold small {
  font-size: 12px;
}

.message-policy-hold small {
  color: #796A53;
}

.message-policy-clock {
  flex: 0 0 auto;
  font-size: 15px;
  font-weight: 800;
}

.message-media.image {
  display: block;
  width: auto;
  max-width: 240px;
  margin: 0 0 4px;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.message-media.image[data-media-kind="gif-image"] {
  display: block;
  width: auto;
  max-width: 240px;
  margin: 0 0 4px;
  padding: 0;
  outline: none;
  border: 0;
  box-shadow: none;
  border-radius: 6px;
}

.message-media.image[data-media-kind="gif-image"] img {
  width: auto;
  max-width: 240px;
  max-height: 220px;
  object-fit: contain;
  background: transparent;
}

.message-media.video-preview[data-media-kind="gif-video"] {
  display: block;
  width: auto;
  max-width: 240px;
  max-height: 220px;
  margin: 0 0 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 0;
}

.message-media.video-preview[data-media-kind="gif-video"] video {
  width: auto;
  max-width: 240px;
  max-height: 220px;
  height: auto;
  object-fit: contain;
  background: transparent;
}

.message-media.image img {
  display: block;
  width: auto;
  max-width: min(240px, 100%);
  max-height: 220px;
  border-radius: 5px;
  object-fit: contain;
}

.video-preview {
  position: relative;
  display: block;
  width: auto;
  max-width: 240px;
  margin: 0 0 4px;
  overflow: hidden;
  border: 0;
  border-radius: 5px;
  padding: 0;
  background: #18202A;
  cursor: pointer;
}

.video-preview video {
  display: block;
  width: auto;
  max-width: min(240px, 100%);
  max-height: 220px;
  object-fit: contain;
  pointer-events: none;
}

.media-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #1D344D;
  transform: translate(-50%, -50%);
}

.message-bubble.has-visual-media {
  width: fit-content;
  max-width: min(268px, 92%);
  padding: 8px 8px 5px;
}

.message-bubble.has-visual-media .message-text {
  max-width: 240px;
  margin-top: 5px;
}

.message-bubble.has-audio {
  width: fit-content;
  max-width: min(325px, 92%);
}

.message-bubble.has-audio .message-media.message-audio {
  width: min(285px, calc(100vw - 110px));
  max-width: 100%;
  margin: 0 0 4px;
}

.message-bubble.has-file {
  width: fit-content;
  max-width: min(390px, 92%);
}

.conversation-media-dialog {
  width: min(920px, calc(100vw - 28px));
  max-width: none;
  max-height: calc(100dvh - 28px);
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.conversation-media-dialog::backdrop {
  background: rgba(13, 24, 37, 0.76);
}

.attachment-preview-dialog {
  width: min(880px, calc(100vw - 28px));
  max-width: none;
  height: min(720px, calc(100dvh - 28px));
  max-height: none;
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: #F8FAFB;
}

.attachment-preview-dialog::backdrop { background: rgba(13, 24, 37, 0.72); }

.attachment-preview-card {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.attachment-preview-card header {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid #DDE5EC;
  background: #FFFFFF;
}

.attachment-preview-card header div { min-width: 0; display: grid; gap: 2px; }
.attachment-preview-card header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attachment-preview-card header span { color: #687587; font-size: 12px; }

.attachment-preview-close {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #263547;
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.attachment-preview-close:hover { background: #EDF2F4; }

.attachment-preview-stage {
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  background: #EEF2F3;
}

.attachment-preview-stage img,
.attachment-preview-stage video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.attachment-preview-stage iframe { width: 100%; height: 100%; border: 0; background: #FFFFFF; }

.attachment-file-preview {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #304155;
  text-align: center;
}

.attachment-file-preview .nav-icon { width: 72px; height: 72px; color: #168B79; }
.attachment-file-preview span { color: #718094; font-size: 13px; }
.attachment-file-preview.audio { width: min(520px, 100%); }
.attachment-file-preview.audio audio { width: 100%; }

.attachment-preview-card footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  align-items: end;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid #DDE5EC;
  background: #FFFFFF;
}

.attachment-preview-card footer textarea { min-height: 44px; max-height: 112px; resize: vertical; }
.attachment-preview-card footer .send-btn { width: 46px; min-width: 46px; height: 44px; }

.conversation-media-card {
  display: grid;
  grid-template-rows: auto minmax(180px, 1fr) auto;
  overflow: hidden;
  border-radius: 8px;
  background: #FFFFFF;
}

.conversation-media-card header,
.conversation-media-card footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
}

.conversation-media-card header {
  justify-content: space-between;
  border-bottom: 1px solid #DDE5EC;
}

.conversation-media-card h2 {
  margin: 0;
  font-size: 18px;
}

.conversation-media-card footer {
  justify-content: flex-end;
  border-top: 1px solid #DDE5EC;
}

.conversation-media-stage {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 14px;
  background: #111820;
}

.conversation-media-stage img,
.conversation-media-stage video {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 190px);
  object-fit: contain;
}

.message-media audio,
.message-media video {
  max-width: 100%;
}

.new-messages-button {
  position: absolute;
  right: 22px;
  bottom: 112px;
  z-index: 3;
  min-height: 34px;
  border: 0;
  border-radius: 18px;
  padding: 7px 13px;
  background: #263F62;
  box-shadow: 0 6px 18px rgba(29, 39, 51, 0.2);
  color: #FFFFFF;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
}

.conversation-composer {
  position: relative;
  border-top: 1px solid #DDE5EC;
  background: #FFFFFF;
}

.contact-activity {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-top: 1px solid #DDE5EC;
  padding: 4px 14px;
  background: #F7FCFC;
  color: #0B8D79;
  font-size: 12px;
  font-weight: 700;
}

.contact-activity[hidden] { display: none; }
.contact-activity.is-recording { color: #A7434E; }

.contact-activity-dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.contact-activity-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: contact-activity-pulse 1.15s infinite ease-in-out;
}

.contact-activity-dots i:nth-child(2) { animation-delay: 0.15s; }
.contact-activity-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes contact-activity-pulse {
  0%, 60%, 100% { opacity: 0.35; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.conversation-composer[aria-disabled="true"] {
  background: #F8FAFB;
}

.composer-tab {
  min-height: 34px;
  font-size: 13px;
}

.composer-tab:disabled {
  cursor: default;
  opacity: 0.6;
}

.reply-box {
  position: relative;
  grid-template-columns: 40px minmax(0, 1fr) 40px 40px 40px 40px;
  align-items: end;
  gap: 7px;
  padding: 8px 11px 11px;
}

.composer-reply-preview,
.voice-recorder {
  grid-column: 1 / -1;
}

.composer-reply-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  border-left: 3px solid #198F70;
  border-radius: 5px;
  padding: 7px 8px 7px 10px;
  background: #F0F7F5;
}

.composer-reply-preview[hidden],
.voice-recorder[hidden] {
  display: none;
}

.composer-reply-preview > div {
  min-width: 0;
  display: grid;
  flex: 1;
}

.composer-reply-preview strong {
  color: #176C58;
  font-size: 12px;
}

.composer-reply-preview span {
  overflow: hidden;
  color: #536273;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-reply-preview .icon-btn {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  font-size: 20px;
}

.voice-recorder {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border: 1px solid #E0E6EB;
  border-radius: 7px;
  background: #FAFBFC;
}

.voice-recording-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #D44242;
  box-shadow: 0 0 0 4px rgba(212, 66, 66, 0.12);
}

.voice-recorder time {
  margin-right: auto;
  color: #536273;
  font-variant-numeric: tabular-nums;
}

.reply-box.is-recording > :not(.voice-recorder, input) {
  display: none;
}

.reply-box.note-compose {
  grid-template-columns: minmax(0, 1fr) auto;
  background: #FFFCF4;
}

.message-compose-input {
  min-height: 42px;
  max-height: 132px;
  resize: none;
  padding: 9px 11px;
  border-radius: 7px;
  font-size: 15px;
  line-height: 1.45;
}

.composer-icon,
.send-btn {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
}

.send-btn {
  background: #119B73;
}

.note-save {
  min-height: 42px;
}

.emoji-picker {
  position: absolute;
  right: 51px;
  bottom: 58px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 250px;
  padding: 8px;
  border: 1px solid #D9E1E8;
  border-radius: 7px;
  background: #FFFFFF;
  box-shadow: 0 10px 24px rgba(29, 39, 51, 0.16);
}

.emoji-picker button {
  min-height: 34px;
  border: 0;
  border-radius: 5px;
  padding: 5px 8px;
  background: #F2F5F7;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
}

.composer-emoji-picker {
  left: 58px;
  right: auto;
  width: min(285px, calc(100vw - 88px));
  max-width: 285px;
  max-height: 280px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding: 11px;
}

.composer-emoji-picker section {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.composer-emoji-picker section strong {
  width: 100%;
  margin-bottom: 3px;
  color: #617184;
  font-size: 11px;
}

.composer-emoji-picker button {
  width: 35px;
  height: 35px;
  min-height: 35px;
  padding: 3px;
  background: transparent;
  font-size: 21px;
}

.composer-emoji-picker button:hover,
.composer-emoji-picker button:focus-visible {
  background: #EAF8FA;
  outline: 0;
}

.template-picker {
  right: 58px;
  width: min(360px, calc(100vw - 32px));
  max-width: 360px;
  display: grid;
  gap: 4px;
  max-height: 280px;
  overflow-y: auto;
}

.template-picker button {
  display: grid;
  gap: 2px;
  text-align: left;
}

.template-picker button strong {
  color: #2B3748;
  font-size: 14px;
}

.template-picker button span {
  color: #748195;
  font-size: 12px;
}

.message-bubble {
  position: relative;
}

.message-bubble.emoji-only {
  border-color: transparent;
  padding: 2px 4px 5px;
  background: transparent;
  box-shadow: none;
}

.message-bubble.emoji-only .message-text {
  font-size: 40px;
  line-height: 1.15;
}

.message-reaction-picker {
  position: absolute;
  bottom: calc(100% + 5px);
  right: 0;
  z-index: 5;
  display: flex;
  gap: 3px;
  border: 1px solid #D8E0E7;
  border-radius: 7px;
  padding: 5px;
  background: #FFFFFF;
  box-shadow: 0 8px 22px rgba(29, 39, 51, 0.16);
}

.message-reaction-picker[hidden] {
  display: none;
}

.message-reaction-picker button {
  width: 31px;
  height: 31px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.message-reaction-picker button:hover {
  background: #F1F4F6;
}

.message-reaction-summary {
  position: absolute;
  right: 8px;
  bottom: -10px;
  min-height: 22px;
  border: 1px solid #D8E0E7;
  border-radius: 11px;
  padding: 1px 6px;
  background: #FFFFFF;
  box-shadow: 0 2px 5px rgba(29, 39, 51, 0.1);
  font-size: 14px;
}

.message-bubble:has(.message-reaction-summary) {
  margin-bottom: 15px;
}

.message-bubble.revoked .message-text {
  color: #748195;
  font-style: italic;
}

.view-deleted-message {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  border: 0;
  padding: 0;
  background: transparent;
  color: #536273;
  cursor: pointer;
  vertical-align: middle;
}

.view-deleted-message svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.deleted-message-content {
  min-height: 76px;
  border-left: 3px solid #169B83;
  padding: 12px 14px;
  background: #F4F8F7;
  color: #1D2733;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.deleted-message-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.deleted-message-details div { display: grid; gap: 3px; }
.deleted-message-details dt { color: #647286; font-size: 12px; font-weight: 700; }
.deleted-message-details dd { margin: 0; color: #1D2733; font-size: 14px; }

.message-inline-action {
  border: 1px solid #D8E0E7;
  border-radius: 5px;
  background: #FFFFFF;
  color: #536273;
  cursor: pointer;
  font: inherit;
}

.message-quote {
  width: 100%;
  display: grid;
  gap: 2px;
  margin: 2px 0 7px;
  border: 0;
  border-left: 3px solid #2B8A72;
  border-radius: 4px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.58);
  cursor: pointer;
  text-align: left;
}

.message-quote strong {
  color: #176C58;
  font-size: 12px;
}

.message-quote span {
  overflow: hidden;
  color: #536273;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.message-bubble.highlight {
  outline: 3px solid rgba(43, 138, 114, 0.32);
}

.audio-transcription {
  margin-top: 7px;
  border-left: 3px solid #3479A8;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.55);
}

.audio-transcription strong {
  color: #315C7A;
  font-size: 12px;
}

.audio-transcription p {
  margin: 3px 0 0;
  color: #344254;
  font-size: 14px;
  line-height: 1.4;
}

.message-inline-action {
  min-height: 30px;
  margin-top: 6px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.customer-note-list {
  display: grid;
  gap: 7px;
  margin-bottom: 9px;
}

.customer-note-item {
  border-left: 3px solid #D69A2D;
  border-radius: 4px;
  padding: 8px 9px;
  background: #FFF9EA;
}

.customer-note-item p {
  margin: 0 0 4px;
  color: #4A4338;
  font-size: 13px;
  line-height: 1.4;
}

.customer-note-item small {
  color: #796C59;
  font-size: 11px;
}

.customer-note-form {
  display: grid;
  gap: 7px;
}

.customer-note-form .textarea {
  min-height: 66px;
  resize: vertical;
  font-size: 14px;
}

.conversation-details {
  display: grid;
  gap: 10px;
}

.context-select-row {
  display: grid;
  gap: 5px;
  color: #748195;
  font-size: 13px;
}

.context-select-row .select {
  min-height: 38px;
  font-size: 13px;
}

.conversation-context {
  display: block;
  overflow-y: auto;
  background: #FAFBFC;
  scrollbar-gutter: stable;
}

.context-empty {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 28px;
  color: #748195;
  text-align: center;
}

.context-empty strong {
  color: #344254;
  font-size: 15px;
}

.context-empty span:last-child {
  max-width: 250px;
  font-size: 14px;
}

.context-content {
  min-height: 100%;
}

.context-mobile-head {
  display: none;
}

.context-card {
  border-bottom: 1px solid #DDE5EC;
  background: #FFFFFF;
}

.context-card:last-child {
  border-bottom: 0;
}

.context-card-header {
  min-height: 48px;
  padding: 11px 14px;
  border-bottom: 0;
  font-size: 14px;
}

.context-card-body {
  padding: 2px 14px 15px;
}

.customer-card,
.customer-link-panel {
  gap: 12px;
}

.customer-card-head,
.customer-link-head {
  padding: 3px 0 12px;
  border-bottom: 1px solid #E3EAF1;
}

.customer-card-title {
  font-size: 15px;
}

.customer-card-meta {
  font-size: 13px;
}

.context-data-group {
  display: grid;
  gap: 7px;
  padding-top: 2px;
}

.context-data-title {
  color: #657386;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.context-fact {
  display: grid;
  grid-template-columns: minmax(84px, auto) minmax(0, 1fr);
  gap: 10px;
  font-size: 13px;
}

.context-fact span {
  color: #748195;
}

.context-fact strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #2B3748;
  font-weight: 650;
  text-align: right;
}

.context-service-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.context-service-list span {
  padding: 4px 7px;
  border-radius: 5px;
  background: #EAF4F2;
  color: #176C58;
  font-size: 12px;
  font-weight: 700;
}

.context-muted {
  color: #7A8798;
  font-size: 13px;
}

.context-note {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-left: 3px solid #D69A2D;
  border-radius: 4px;
  background: #FFF9EA;
  color: #5E5140;
  font-size: 13px;
}

.context-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.btn.quiet {
  border: 1px solid transparent;
  background: transparent;
  color: #687587;
}

.customer-link-empty {
  padding: 12px;
}

.tag-picker {
  grid-template-columns: minmax(0, 1fr) 38px;
}

.tag-picker::before {
  content: none;
}

.tag-picker .select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-style: solid;
  padding: 7px 30px 7px 10px;
  background: #FFFFFF;
  font-weight: 600;
}

.tag-picker .btn {
  display: inline-flex;
}

.tag-picker .icon-btn {
  width: 38px;
  min-width: 38px;
  min-height: 38px;
}

.conversation-toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1000;
  display: grid;
  gap: 8px;
}

.conversation-toast {
  max-width: 360px;
  border-left: 4px solid #C64747;
  border-radius: 6px;
  padding: 11px 13px;
  background: #FFFFFF;
  box-shadow: 0 10px 28px rgba(29, 39, 51, 0.2);
  color: #2B3748;
  font-size: 14px;
}

.conversation-toast.info {
  border-left-color: #3479A8;
}

@media (min-width: 1180px) {
  html.conversation-page .conversation-workspace {
    height: calc(100vh - 102px);
    min-height: 0;
  }

  html.conversation-page .conversation-inbox,
  html.conversation-page .conversation-thread,
  html.conversation-page .conversation-context {
    height: auto;
  }
}

@media (max-width: 1350px) and (min-width: 981px) {
  .conversation-workspace {
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 0;
  }

  .conversation-thread {
    border-right: 0;
  }

  .conversation-context {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 12;
    width: min(360px, 42vw);
    display: none;
    border-left: 1px solid #DDE5EC;
    box-shadow: -12px 0 26px rgba(29, 39, 51, 0.13);
  }

  .conversation-workspace[data-mobile-view="context"] .conversation-context {
    display: block;
  }

  .context-mobile-head {
    min-height: 58px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #DDE5EC;
    background: #FFFFFF;
  }
}

@media (min-width: 1180px) and (max-width: 1400px) {
  .conversation-workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .conversation-thread {
    grid-template-columns: minmax(0, 1fr);
  }

  .conversation-context {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 12;
    width: 300px;
    display: none;
    border-left: 1px solid #DDE5EC;
    box-shadow: none;
  }

  .conversation-workspace[data-mobile-view="context"] {
    grid-template-columns: 300px minmax(390px, 1fr) 300px;
  }

  .conversation-workspace[data-mobile-view="context"] .conversation-context {
    position: static;
    grid-column: 3;
    width: auto;
    display: block;
  }

  .conversation-workspace[data-mobile-view="context"] .context-mobile-head {
    display: flex;
  }

  .conversation-composer,
  .reply-box {
    width: 100%;
    min-width: 0;
  }

  .reply-box {
    grid-template-columns: 36px minmax(0, 1fr) 36px 36px 36px 36px;
    gap: 4px;
    padding-inline: 7px;
  }

  .message-compose-input {
    min-width: 0;
  }

  .composer-icon,
  .send-btn {
    width: 36px;
    min-width: 36px;
  }
}

@media (min-width: 1280px) and (max-width: 1400px) {
  .conversation-workspace,
  .conversation-workspace[data-mobile-view="thread"],
  .conversation-workspace[data-mobile-view="context"] {
    grid-template-columns: 300px minmax(0, 1fr) 300px;
  }

  .conversation-context,
  .conversation-workspace[data-mobile-view="thread"] .conversation-context,
  .conversation-workspace[data-mobile-view="context"] .conversation-context {
    position: static;
    grid-column: 3;
    width: auto;
    display: block;
  }

  .conversation-context .context-mobile-head {
    display: none;
  }
}

@media (min-width: 981px) and (max-width: 1179px) {
  html.conversation-page,
  html.conversation-page body,
  html.conversation-page .app-shell {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  html.conversation-page .main {
    min-height: 0;
    overflow: hidden;
  }

  html.conversation-page .conversation-workspace {
    height: calc(100dvh - 102px);
    min-height: 0;
  }

  html.conversation-page .conversation-inbox,
  html.conversation-page .conversation-thread,
  html.conversation-page .conversation-context {
    height: 100%;
    min-height: 0;
  }

  .conversation-thread {
    grid-template-columns: minmax(0, 1fr);
  }

  .conversation-composer,
  .reply-box {
    width: 100%;
    min-width: 0;
  }

  .message-compose-input {
    min-width: 0;
  }
}

@media (min-width: 981px) and (max-width: 1400px) {
  html.conversation-page.sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  html.conversation-page.sidebar-collapsed .sidebar {
    display: none;
  }
}

@media (max-width: 980px) {
  html.conversation-page,
  html.conversation-page body,
  html.conversation-page .app-shell,
  html.conversation-page .main {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  html.conversation-page .main {
    padding: 0;
  }

  html.conversation-page .flash-stack {
    position: fixed;
    top: 74px;
    right: 10px;
    left: 10px;
    z-index: 1100;
    margin: 0;
  }

  .conversation-workspace {
    width: 100%;
    height: calc(100dvh - 66px);
    min-height: 0;
    grid-template-columns: 1fr;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .conversation-inbox,
  .conversation-thread,
  .conversation-context {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
  }

  .conversation-thread,
  .conversation-context {
    display: none;
  }

  .conversation-workspace[data-mobile-view="thread"] .conversation-inbox,
  .conversation-workspace[data-mobile-view="context"] .conversation-inbox {
    display: none;
  }

  .conversation-workspace[data-mobile-view="thread"] .conversation-thread {
    display: grid;
  }

  .conversation-workspace[data-mobile-view="context"] .conversation-context {
    display: block;
  }

  .thread-mobile-button,
  .context-mobile-head {
    display: flex;
  }

  .context-mobile-head {
    min-height: 58px;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-bottom: 1px solid #DDE5EC;
    background: #FFFFFF;
  }

  .thread-header {
    min-height: 62px;
    padding: 7px 9px;
  }

  .thread-contact .avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .thread-title {
    font-size: 15px;
  }

  .thread-subtitle {
    max-width: 220px;
    font-size: 12px;
  }

  .thread-status {
    display: none;
  }

  .line-connection {
    display: none;
  }

  .message-list {
    min-height: 0;
    padding: 14px 11px;
  }

  .message-bubble {
    max-width: 88%;
  }

  .conversation-list {
    max-height: none;
  }

  .conversation-context {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .conversation-workspace {
    gap: 0;
  }

  .conversation-filters {
    grid-template-columns: 1fr 1fr;
  }

  .thread-header,
  .reply-box,
  .tag-picker {
    grid-template-columns: revert;
  }

  .thread-header,
  .thread-actions {
    flex-wrap: nowrap;
  }

  .reply-box {
    grid-template-columns: 38px minmax(0, 1fr) 38px 38px 38px 38px;
    gap: 5px;
    padding-inline: 7px;
  }

  .reply-box.note-compose {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .composer-icon,
  .send-btn {
    width: 38px;
    min-width: 38px;
    height: 40px;
  }

  .message-bubble {
    max-width: 91%;
  }

  .context-actions {
    grid-template-columns: 1fr;
  }
}
