.conv-layout {
  padding: 0;
  display: grid;
  grid-template-columns: 300px 1fr;
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  min-height: calc(100dvh - 60px);
  max-height: none; 
  overflow: hidden;
}

.conv-list {
  border-right: 1px solid #dbe4f0;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  min-height: 0;
  background: #fbfdff;
}

.conv-list-head {
  padding: 14px 14px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 1px solid #dbe4f0;
  gap: 12px;
}

.conv-list-head-copy {
  display: grid;
  gap: 4px;
}

.conv-list-head-copy strong {
  font-size: 18px;
  color: #123a78;
}

.conv-list-head-copy small {
  color: #60708a;
  line-height: 1.35;
}

.conv-list-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conv-searchbar {
  padding: 12px 14px;
  border-bottom: 1px solid #dbe4f0;
  background: #f8fbff;
}

.conv-searchbar input {
  width: 100%;
  border-radius: 10px;
  padding: 9px 11px;
  border: 1px solid #dbe4f0;
  font-size: 14px;
  background: #fff;
}

.conv-searchbar input:focus {
  outline: none;
  border-color: #2463d3;
  box-shadow: 0 0 0 3px rgba(36, 99, 211, 0.12);
}

.conv-quick-filters {
  display: flex;
  gap: 8px;
  padding: 10px 14px 12px;
  border-bottom: 1px solid #dbe4f0;
  background: #f8fbff;
  overflow-x: auto;
}

.conv-filter-pill {
  border: 1px solid #dbe4f0;
  background: #fff;
  color: #35527c;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.conv-filter-pill:hover {
  border-color: #b7ccf0;
  background: #edf4ff;
}

.conv-filter-pill.is-active {
  background: #2463d3;
  border-color: #2463d3;
  color: #fff;
}

.conv-filter-wrap {
  padding: 10px 12px;
  border-bottom: 1px solid #dbe4f0;
  background: #f8fbff;
  display: grid;
  gap: 8px;
}

.conv-filter-wrap select {
  width: 100%;
  border-radius: 9px;
  padding: 9px 10px;
  border: 1px solid #dbe4f0;
  font-size: 14px;
  background: #fff;
}

.conv-filter-wrap input {
  width: 100%;
  border-radius: 9px;
  padding: 9px 10px;
  border: 1px solid #dbe4f0;
  font-size: 14px;
  background: #fff;
}

.conv-items {
  overflow: auto;
  min-height: 0;
  background: #fbfdff;
}

.conv-list-state {
  margin: 18px 14px;
  padding: 16px;
  border: 1px dashed #c6d7f2;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
  display: grid;
  gap: 6px;
}

.conv-list-state strong {
  color: #123a78;
}

.conv-list-state p {
  margin: 0;
  color: #5d6f8a;
  line-height: 1.45;
}

.conv-list-state--loader {
  border-style: solid;
  background: #ffffff;
}

.conv-list-state--loader .app-lottie-loader {
  padding: 8px 4px;
}

.conv-list-state--loader .app-lottie-loader__anim {
  width: 130px;
  height: 130px;
}

.conv-list-state--loader .app-lottie-loader__copy strong {
  font-size: 16px;
}

.conv-list-state--loader .app-lottie-loader__copy p {
  font-size: 13px;
}

.conv-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #e8eef8;
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 6px;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.conv-item-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.conv-item-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #eaf1ff;
  color: #2a63c9;
  border: 1px solid #d5e1f8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.conv-item-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.conv-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.conv-item-title-wrap {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.conv-item-head-side {
  display: grid;
  gap: 6px;
  justify-items: end;
}

.conv-item:hover {
  background: #f7faff;
  transform: translateY(-1px);
}

.conv-item.is-active {
  background: #eef5ff;
  box-shadow: inset 0 0 0 1px #bcd2f3;
}

.conv-item.has-unread {
  background: #f2fbf6;
}

.conv-item.has-unread.is-active {
  background: #e4f6ec;
}

.conv-item strong {
  display: block;
  color: #163c78;
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.3;
  text-transform: uppercase;
}

.conv-item.has-unread strong {
  color: #0b5d3b;
}

.conv-item-time {
  color: #6b7b93;
  font-size: 11px;
}

.conv-item-time--relative {
  margin-left: auto;
  align-self: center;
}

.conv-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #19a85a;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.conv-item small {
  display: block;
  color: #5c6f8c;
}

.conv-item-state-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.conv-state-pill,
.conv-priority-pill,
.thread-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  border: 1px solid #dbe4f0;
  background: #fff;
  color: #36537c;
}

.conv-state-pill--pending,
.thread-meta-pill--pending {
  background: #fff5e8;
  border-color: #ffd39a;
  color: #9a5700;
}

.conv-state-pill--new,
.thread-meta-pill--new {
  background: #fff0f0;
  border-color: #ffc5c5;
  color: #b32323;
}

.conv-state-pill--active,
.thread-meta-pill--active {
  background: #eef7ff;
  border-color: #bfdcff;
  color: #1453a3;
}

.conv-state-pill--resolved,
.thread-meta-pill--resolved {
  background: #edf8f2;
  border-color: #bfe7cf;
  color: #167347;
}

.conv-priority-pill--unclaimed {
  background: #fff0f0;
  border-color: #ffc5c5;
  color: #b32323;
}

.conv-priority-pill--pending_reply {
  background: #fff5e8;
  border-color: #ffd39a;
  color: #9a5700;
}

.conv-priority-pill--pending_close {
  background: #eef7ff;
  border-color: #bfdcff;
  color: #1453a3;
}

.conv-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.conv-meta-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: #f3f7fc;
  border: 1px solid #dbe4f0;
  color: #4e627f;
  font-size: 10px;
  line-height: 1.2;
}

.conv-alert-row {
  display: grid;
  gap: 4px;
}

.conv-item--high {
  border-left-color: #e07b00;
}

.conv-item--medium {
  border-left-color: #2463d3;
}

.conv-item--resolved {
  border-left-color: #1b8f53;
  opacity: 0.94;
}

.conv-alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 22px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  border: 1px solid transparent;
}

.conv-alert-badge--unclaimed,
.thread-alert--unclaimed {
  background: #fff5e8;
  border-color: #ffd39a;
  color: #9a5700;
}

.conv-alert-badge--pending_reply,
.thread-alert--pending_reply {
  background: #fff0f0;
  border-color: #ffc5c5;
  color: #b32323;
}

.conv-alert-badge--pending_close,
.thread-alert--pending_close {
  background: #eef7ff;
  border-color: #bfdcff;
  color: #1453a3;
}

.msg-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4c6386;
  line-height: 1.35;
  font-size: 12px;
}

.msg-preview strong {
  font-weight: 700;
}

.msg-preview em {
  font-style: italic;
}

.conv-thread {
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  min-height: 0;
}

.conv-thread-head {
  padding: 14px 16px;
  border-bottom: 1px solid #dbe4f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 88px;
  background: #ffffff;
}

.conv-thread-head-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.thread-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #eef0ff;
  color: #4d57d5;
  border: 1px solid #d9e0f2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  letter-spacing: 0.01em;
  flex: 0 0 auto;
}

.thread-head-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.thread-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.conv-thread-head-main strong {
  font-size: 13px;
  color: #123a78;
  line-height: 1.25;
}

.thread-subtitle {
  color: #5f728d;
  font-size: 11px;
}

.thread-status-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.thread-meta-pill--muted {
  background: #f5f8fd;
  color: #5a6d89;
}

.thread-alert {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.thread-alert strong {
  font-size: 11px;
}

.conv-thread-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.conv-thread-btn {
  min-height: 42px;
  border-radius: 12px;
  padding-inline: 16px;
}

.conv-thread-btn--main {
  min-width: 128px;
}

.conv-thread-btn.is-busy,
.reply-bar .btn.is-busy,
.cliente-actions .btn.is-busy {
  position: relative;
  opacity: 0.82;
  cursor: wait;
}

.conv-thread-btn.is-busy::after,
.reply-bar .btn.is-busy::after,
.cliente-actions .btn.is-busy::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border-radius: 999px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  display: inline-block;
  vertical-align: -2px;
  animation: convBtnSpin 0.8s linear infinite;
}

/* Conversations history header balance */
#histThreadTitle {
  font-size: 24px;
  line-height: 1.1;
  text-transform: none;
  letter-spacing: 0;
}

#histThreadSubtitle {
  font-size: 13px;
}

#histThreadMeta {
  display: none;
}

.hist-thread-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.hist-thread-kpi-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hist-thread-kpi {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #dbe4f0;
  background: #f5f8fd;
  color: #4f6483;
  font-size: 12px;
}

#histThreadActions {
  align-items: center;
  gap: 7px;
}

#histThreadActions .btn {
  min-height: 38px;
  border-radius: 11px;
  padding: 7px 12px;
}

#histThreadActions .badge {
  height: 30px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 1200px) {
  #histThreadTitle {
    font-size: 20px;
  }

  #histThreadActions .btn {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 12px;
  }
}

.btn-sm {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 33, 59, 0.34);
  display: grid;
  place-items: center;
  z-index: 80;
  padding: 12px;
}

.modal-card {
  width: min(640px, 100%);
  max-height: 82vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.modal-card--wide {
  width: min(920px, 100%);
}

.modal-head {
  border-bottom: 1px solid #dbe4f0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.modal-body {
  padding: 10px;
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
}

.template-pick {
  width: 100%;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.template-pick:hover {
  background: #f7faff;
  border-color: #c8d9f5;
}

.template-pick strong,
.template-pick small {
  display: block;
}

.template-pick strong {
  color: #113f87;
  margin-bottom: 4px;
}

.template-pick small {
  color: #5c6f8c;
}

.help-list {
  margin: 0;
  padding-left: 18px;
  color: #2b4266;
  display: grid;
  gap: 6px;
}

.customer-summary {
  display: grid;
  gap: 4px;
  padding: 2px 2px 8px;
}

.customer-summary strong {
  font-size: 24px;
  color: #123a78;
}

.customer-summary small {
  color: #5c6f8c;
}

.customer-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.customer-card {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  padding: 12px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
  align-self: start;
}

.customer-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.customer-data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.customer-data-item {
  border: 1px solid #e4ecf7;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.customer-data-item small {
  color: #61728d;
}

.customer-data-item strong {
  color: #183763;
  word-break: break-word;
}

.thread-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.thread-meta-item {
  border: 1px solid #e4ecf7;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fbfdff;
  display: grid;
  gap: 4px;
}

.thread-meta-item small {
  color: #61728d;
}

.thread-meta-item strong {
  color: #183763;
  word-break: break-word;
}

.thread-meta-events {
  display: grid;
  gap: 8px;
}

.thread-meta-event {
  border: 1px solid #e4ecf7;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.thread-meta-event__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.thread-meta-event__head strong {
  color: #123a78;
}

.thread-meta-event__head small,
.thread-meta-event p {
  color: #5c6f8c;
}

.thread-meta-event p {
  margin: 0;
}

.start-chat-modal {
  align-content: start;
}

.start-chat-steps {
  display: flex;
  gap: 8px;
  align-items: center;
}

.start-chat-step {
  border: 1px solid #dbe4f0;
  color: #5c6f8c;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.start-chat-step.is-active {
  background: #edf4ff;
  border-color: #b9cff5;
  color: #113f87;
}

.start-chat-grid--number {
  grid-template-columns: 1fr auto;
  align-items: end;
}

.start-chat-number-actions {
  display: flex;
  align-items: end;
  height: 100%;
}

.start-chat-number-actions .btn {
  min-width: 150px;
}

.start-chat-picked {
  margin-top: -2px;
}

.start-chat-filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.start-chat-filter-check input {
  width: auto;
  min-width: auto;
}

.start-chat-contacts-list {
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 8px;
  max-height: 340px;
  overflow: auto;
  display: grid;
  gap: 6px;
}

.start-chat-modal textarea,
.start-chat-modal input,
.start-chat-modal select {
  width: 100%;
  border-radius: 9px;
  padding: 9px 10px;
  border: 1px solid #dbe4f0;
  font-size: 14px;
  background: #fff;
}

.start-chat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.start-chat-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.start-chat-mode {
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  min-height: 40px;
  background: #fff;
  color: #2d4f83;
  font-weight: 700;
}

.start-chat-mode.is-active {
  border-color: #2f67d2;
  background: #edf4ff;
  color: #1d4fa8;
}

.start-chat-mode:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.start-chat-mode-hint {
  margin-top: -2px;
  margin-bottom: 8px;
}

.start-chat-meta-params {
  margin-top: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 10px;
  background: #fbfdff;
  display: grid;
  gap: 10px;
}

.start-chat-meta-params__head {
  display: grid;
  gap: 2px;
}

.start-chat-meta-params__head strong {
  color: #153d77;
}

.start-chat-meta-params__head small {
  color: #5f7493;
}

.start-chat-meta-preview {
  margin-top: 10px;
  border: 1px solid #dbe4f0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fbff;
  display: grid;
  gap: 8px;
}

.start-chat-meta-preview__head {
  display: grid;
  gap: 2px;
}

.start-chat-meta-preview__head strong {
  color: #153d77;
}

.start-chat-meta-preview__head small {
  color: #5f7493;
}

.start-chat-meta-preview__body {
  border-radius: 14px 14px 8px 14px;
  background: linear-gradient(180deg, #dff8ea 0%, #d4f4e2 100%);
  color: #163d2d;
  padding: 12px 14px;
  line-height: 1.5;
  min-height: 62px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #c6e8d4;
}

.start-chat-actions {
  display: flex;
  justify-content: flex-end;
}

.thread-body {
  padding: 16px;
  overflow: auto;
  min-height: 0;
  display: grid;
  gap: 10px;
  align-content: start;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.thread-empty-state {
  align-self: center;
  justify-self: center;
  max-width: 420px;
  padding: 24px;
  border: 1px dashed #c6d7f2;
  border-radius: 16px;
  background: #fff;
  display: grid;
  gap: 8px;
  text-align: center;
}

.thread-empty-state strong {
  color: #123a78;
  font-size: 18px;
}

.thread-empty-state p {
  margin: 0;
  color: #60708a;
  line-height: 1.5;
}

.thread-empty-state--loader {
  border-style: solid;
  background: #ffffff;
}

.thread-empty-state--loader .app-lottie-loader__anim {
  width: 210px;
  height: 210px;
}

.thread-empty-state--loader .app-lottie-loader__copy strong {
  font-size: 18px;
}

.thread-empty-state--loader .app-lottie-loader__copy p {
  font-size: 14px;
}

#customerModalBody .thread-empty-state--loader {
  max-width: 720px;
  width: 100%;
  min-height: 320px;
  align-content: center;
}

#customerModalBody .thread-empty-state--loader .app-lottie-loader__anim {
  width: 240px;
  height: 240px;
}

#customerModalBody .conv-customer-loader {
  min-height: 420px;
}

#customerModalBody .conv-customer-loader .app-lottie-loader {
  gap: 12px;
}

#customerModalBody .conv-customer-loader .app-lottie-loader__anim {
  width: 280px;
  height: 280px;
}

.btn-scroll-bottom {
  position: absolute;
  right: 14px;
  bottom: 72px;
  z-index: 3;
  min-width: 34px;
  padding: 6px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(16, 33, 59, 0.15);
}

.reply-bar {
  border-top: 1px solid #dbe4f0;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  background: #fff;
  position: sticky;
  bottom: 0;
  z-index: 2;
}

.reply-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
}

.cliente-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.reply-lock-msg {
  margin: 0;
  font-size: 12px;
}

.reply-typing-hint {
  color: #2463d3;
  font-size: 12px;
  font-weight: 700;
}

.recording-status {
  border: 1px solid #ffd4d4;
  background: #fff5f5;
  color: #8b1e1e;
  border-radius: 9px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.recording-status.is-processing,
.recording-status.is-uploading {
  border-color: #ffd79a;
  background: #fff9ef;
  color: #7a4b00;
}

.recording-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d63638;
  box-shadow: 0 0 0 0 rgba(214, 54, 56, 0.45);
  animation: recPulse 1.2s infinite;
}

.recording-status.is-processing .recording-dot,
.recording-status.is-uploading .recording-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35);
}

.recording-label {
  font-size: 13px;
  font-weight: 600;
}

.recording-timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  font-weight: 700;
  margin-left: auto;
}

.recording-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.recording-bars i {
  display: block;
  width: 2px;
  height: 6px;
  background: #d63638;
  border-radius: 2px;
  animation: recBars 1s ease-in-out infinite;
}

.recording-status.is-processing .recording-bars i,
.recording-status.is-uploading .recording-bars i {
  background: #f59e0b;
  animation: none;
  height: 6px;
  opacity: 0.75;
}

.recording-bars i:nth-child(2) {
  animation-delay: 0.12s;
}

.recording-bars i:nth-child(3) {
  animation-delay: 0.24s;
}

.recording-bars i:nth-child(4) {
  animation-delay: 0.36s;
}

.recording-bars i:nth-child(5) {
  animation-delay: 0.48s;
}

.reply-tools select {
  max-width: 240px;
}

.reply-compose {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 8px;
  align-items: end;
}

.reply-input-wrap {
  position: relative;
  min-width: 0;
}

.reply-bar input,
.reply-bar textarea,
.reply-tools select {
  border-radius: 9px;
  padding: 9px 10px;
  border: 1px solid #dbe4f0;
  font-size: 14px;
}

.reply-bar textarea {
  resize: none;
  height: 42px;
  min-height: 42px;
  max-height: 42px;
  line-height: 1.42;
  font-family: inherit;
  width: 100%;
  background: #fbfdff;
}

.reply-slash-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(16, 33, 59, 0.16);
  overflow: hidden;
  z-index: 16;
  max-height: 280px;
  overflow-y: auto;
}

.reply-slash-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #edf2fa;
  background: #fff;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
}

.reply-slash-item:last-child {
  border-bottom: 0;
}

.reply-slash-item strong {
  color: #113f87;
}

.reply-slash-item small,
.reply-slash-empty {
  color: #60708a;
}

.reply-slash-item:hover,
.reply-slash-item.is-active {
  background: #edf4ff;
}

.reply-slash-empty {
  padding: 12px;
}

.reply-bar .btn {
  min-width: 84px;
  padding: 9px 12px;
}

#btnAttachMenu {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

#btnReplySend {
  min-width: 108px;
  box-shadow: 0 10px 24px rgba(36, 99, 211, 0.18);
}

.btn-mic {
  min-width: 42px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #1f67dd;
}

.mic-btn-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-mic.is-recording {
  color: #d63638;
  border-color: #efb2b3;
  background: #fff2f2;
}

.attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 8px;
  width: 220px;
  padding: 8px;
  display: grid;
  gap: 6px;
  z-index: 12;
}

.attach-menu .btn {
  width: 100%;
  justify-content: flex-start;
}

.btn-danger {
  background: #d63638;
  color: #fff;
  border-color: #d63638;
}

.btn-danger:hover {
  background: #b92d2f;
  border-color: #b92d2f;
}

@keyframes recPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(214, 54, 56, 0.45);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(214, 54, 56, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(214, 54, 56, 0);
  }
}

@keyframes recBars {
  0%, 100% {
    height: 6px;
    opacity: 0.7;
  }
  50% {
    height: 14px;
    opacity: 1;
  }
}

@keyframes convBtnSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.msg-bubble {
  max-width: 76%;
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid #dbe4f0;
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 33, 58, 0.05);
}

.msg-bubble.in {
  justify-self: start;
  background: #eef5ff;
  border-color: #cfe0fb;
}

.msg-bubble.out {
  justify-self: end;
  background: #eafbf1;
  border-color: #ccefdc;
}

.msg-bubble.status {
  justify-self: center;
  background: #f4f6f9;
  border-color: #dfe5ee;
}

.msg-bubble p {
  margin: 0;
  color: #233a5f;
}

.msg-author {
  display: inline-block;
  margin-bottom: 6px;
  color: #5b6d88;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.msg-text strong {
  font-weight: 700;
}

.msg-text em {
  font-style: italic;
}

.msg-media-link {
  display: inline-block;
  text-decoration: none;
}

.msg-media-wrap {
  display: grid;
  gap: 6px;
  align-content: start;
}

.msg-media-slot {
  min-height: 0;
}

.msg-media-error {
  border: 1px dashed #f0b8b8;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff6f6;
  color: #9f2424;
}

.msg-media {
  display: block;
  max-width: min(320px, 70vw);
  max-height: 320px;
  border-radius: 10px;
  border: 1px solid #cfe0fb;
  object-fit: cover;
}

.msg-media--sticker {
  max-width: 160px;
  max-height: 160px;
  border: 0;
  background: transparent;
}

.msg-video {
  display: block;
  max-width: min(360px, 75vw);
  max-height: 320px;
  border-radius: 10px;
  background: #000;
}

.msg-audio {
  display: block;
  max-width: min(320px, 70vw);
}

.msg-file-card {
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
  min-width: 220px;
  max-width: min(360px, 75vw);
}

.msg-file-card--audio {
  background: #fbfdff;
}

.msg-file-card__head {
  display: grid;
  gap: 3px;
}

.msg-file-card__head strong {
  color: #143b77;
  word-break: break-word;
}

.msg-file-card__head small {
  color: #60708a;
}

.msg-file-card__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.msg-location {
  display: grid;
  gap: 10px;
  min-width: 220px;
}

.msg-location__map-wrap {
  width: min(320px, 70vw);
  height: 180px;
  border: 1px solid #dbe4f0;
  border-radius: 12px;
  overflow: hidden;
  background: #eef3f9;
}

.msg-location__map {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.msg-location__meta {
  display: grid;
  gap: 4px;
}

.msg-location__meta strong {
  font-size: 14px;
  color: #163b78;
}

.msg-location__meta span,
.msg-location__meta small {
  color: #4b5d78;
}

.msg-location__link {
  justify-self: start;
}

.msg-bubble small {
  display: block;
  margin-top: 6px;
  color: #60708a;
  font-size: 12px;
}

@media (max-width: 980px) {
  .conv-layout {
    grid-template-columns: 1fr;
    min-height: auto;
    height: auto;
    max-height: none;
  }

  .conv-list {
    border-right: 0;
    border-bottom: 1px solid #dbe4f0;
  }

  .conv-thread-head {
    flex-direction: column;
    align-items: stretch;
    min-height: 0;
  }

  .conv-thread-actions {
    justify-content: flex-start;
  }

  .thread-avatar {
    width: 42px;
    height: 42px;
    font-size: 18px;
  }

  .conv-thread-btn {
    min-height: 40px;
    padding-inline: 12px;
  }

  .start-chat-grid {
    grid-template-columns: 1fr;
  }

  .start-chat-grid--number {
    grid-template-columns: 1fr;
  }

  .customer-sections,
  .customer-data-grid,
  .thread-meta-grid {
    grid-template-columns: 1fr;
  }
}
