/* =========================================================
   CHAT PAGE
========================================================= */

.chat-main {
  padding-bottom: 90px;
}

.chat-page {
  width: 100%;
}

/* ---------------------------------------------------------
   PAGE HEADER
--------------------------------------------------------- */

.chat-page-header {
  padding: 22px 18px 14px;
}

.chat-page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  color: var(--color-ink);
  letter-spacing: -0.02em;
}

.chat-page-subtitle {
  margin: 5px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--color-ink-soft);
}

/* ---------------------------------------------------------
   CHAT TABS
--------------------------------------------------------- */

.chat-tabs {
  display: flex;
  gap: 8px;
  padding: 4px 16px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chat-tabs::-webkit-scrollbar {
  display: none;
}

.chat-tab {
  flex: 1;
  min-width: 125px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-white);
  color: var(--color-ink-soft);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.chat-tab:hover {
  transform: translateY(-1px);
  background: var(--color-surface);
}

.chat-tab.is-active {
  color: var(--color-white);
  background: linear-gradient(
    135deg,
    var(--color-primary-dark) 0%,
    var(--color-primary) 100%
  );
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(18, 53, 120, 0.22);
}

.chat-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-tab-icon svg {
  width: 15px;
  height: 15px;
}

/* ---------------------------------------------------------
   TAB CONTENT
--------------------------------------------------------- */

.chat-tab-content {
  padding: 0 16px 24px;
}

/* ---------------------------------------------------------
   DISCOVERY HEADER
--------------------------------------------------------- */

.chat-discovery {
  width: 100%;
}

.chat-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 14px;
}

.chat-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--color-ink);
}

.chat-section-subtitle {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--color-ink-soft);
}

/* ---------------------------------------------------------
   PROFILE GRID
--------------------------------------------------------- */

.chat-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* ---------------------------------------------------------
   PROFILE CARD
--------------------------------------------------------- */

.chat-profile-card {
  position: relative;
  overflow: hidden;
  padding: 14px;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(16, 27, 51, 0.07);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.chat-profile-card::before {
  content: "";
  position: absolute;
  top: -45px;
  right: -35px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--color-primary-tint);
  opacity: 0.65;
  pointer-events: none;
}

.chat-profile-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(16, 27, 51, 0.12);
}

/* ---------------------------------------------------------
   PROFILE TOP
--------------------------------------------------------- */

.chat-profile-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Avatar */

.chat-profile-avatar-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}

.chat-profile-avatar {
  width: 58px;
  height: 58px;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid var(--color-white);
  box-shadow: 0 4px 12px rgba(16, 27, 51, 0.16);
  background: var(--color-primary-tint);
}

/* Online dot */

.chat-online-dot {
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--color-white);
}

/* ---------------------------------------------------------
   PROFILE NAME
--------------------------------------------------------- */

.chat-profile-main {
  min-width: 0;
}

.chat-profile-name-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.chat-profile-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--color-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-profile-country {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  line-height: 1;
}

.chat-profile-from {
  margin: 4px 0 0;
  font-size: 10.5px;
  color: var(--color-primary);
  font-weight: 700;
}

/* ---------------------------------------------------------
   BIO
--------------------------------------------------------- */

.chat-profile-bio {
  position: relative;
  z-index: 1;
  margin: 13px 0 10px;
  min-height: 49px;
  color: var(--color-ink-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

/* ---------------------------------------------------------
   PHONE / NUMBER
--------------------------------------------------------- */

.chat-profile-number {
  position: relative;
  z-index: 1;
  margin: 0 0 11px;
  padding: 7px 9px;
  border-radius: 8px;
  background: var(--color-surface);
  color: var(--color-ink-soft);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------
   ACTIONS
--------------------------------------------------------- */

.chat-profile-actions {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}

.chat-start-btn,
.chat-status-btn {
  min-height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 9px;
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.chat-start-btn {
  border: none;
  color: var(--color-white);
  background: linear-gradient(
    135deg,
    var(--color-primary-dark),
    var(--color-primary)
  );
}

.chat-start-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(18, 53, 120, 0.2);
}

.chat-status-btn {
  border: 1px solid var(--color-border);
  background: var(--color-white);
  color: var(--color-ink-soft);
}

.chat-status-btn:hover {
  background: var(--color-surface);
  color: var(--color-primary);
}

.chat-start-btn svg,
.chat-status-btn svg {
  width: 14px;
  height: 14px;
}

/* ---------------------------------------------------------
   EMPTY STATE
--------------------------------------------------------- */

.chat-empty {
  padding: 50px 22px;
  text-align: center;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 18px;
  box-shadow: 0 5px 18px rgba(16, 27, 51, 0.06);
}

.chat-empty-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary-tint);
  color: var(--color-primary);
}

.chat-empty-icon svg {
  width: 27px;
  height: 27px;
}

.chat-empty-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  color: var(--color-ink);
}

.chat-empty-text {
  max-width: 290px;
  margin: 7px auto 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--color-ink-soft);
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 430px) {
  .chat-profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .chat-profile-card {
    padding: 15px;
  }

  .chat-profile-avatar-wrap,
  .chat-profile-avatar {
    width: 62px;
    height: 62px;
  }

  .chat-profile-bio {
    min-height: auto;
  }
}

@media (min-width: 768px) {
  .chat-profile-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1100px) {
  .chat-profile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chat-tab-content {
    max-width: 1200px;
    margin: 0 auto;
  }

  .chat-page-header,
  .chat-tabs {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* =========================================================
   CHAT PANEL
========================================================= */

.chat-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: flex-end;
  justify-content: center;

  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(4px);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.chat-panel-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}


/* =========================================================
   PANEL
========================================================= */

.chat-panel {
  width: min(680px, 100%);
  height: min(660px, 92vh);

  display: flex;
  flex-direction: column;

  background: #ffffff;

  border-radius: 22px 22px 0 0;

  box-shadow:
    0 -12px 40px rgba(15, 23, 42, 0.16);

  overflow: hidden;

  transform: translateY(30px);

  transition:
    transform 0.28s ease;
}

.chat-panel-overlay.is-visible .chat-panel {
  transform: translateY(0);
}


/* =========================================================
   HEADER
========================================================= */

.chat-panel-header {
  flex-shrink: 0;

  display: flex;
  align-items: center;
  gap: 12px;

  padding: 14px 16px;

  background: #1d4ed8;

  border-bottom: 1px solid #eef2f7;
}

.chat-panel-avatar {
  position: relative;

  width: 46px;
  height: 46px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-radius: 50%;

  background: #f1f5f9;

  color: #64748b;
}

.chat-panel-avatar img {
  width: 100%;
  height: 100%;

  object-fit: cover;
}

.chat-panel-header-info {
  min-width: 0;
  flex: 1;
  color:#ffffff;
}

.chat-panel-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  color:#ffffff;
}

.chat-panel-name {
  margin: 0;

  max-width: 100%;

  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  font-size: 15px;
  font-weight: 700;

  color: #ffffff;
}

.chat-panel-online {
  width: 9px;
  height: 9px;

  flex-shrink: 0;

  border-radius: 50%;

  background: #22c55e;

  box-shadow:
    0 0 0 3px #dcfce7;
}

.chat-panel-status {
  margin: 3px 0 0;

  font-size: 12px;
  font-weight:700;
background:white;
padding:5px;
border-radius:12px;
  color: #000000;
}

.chat-panel-close {
  width: 38px;
  height: 38px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 50%;

  background: #f8fafc;

  color: #64748b;

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.chat-panel-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.chat-panel-close:active {
  transform: scale(0.94);
}

.chat-panel-close .icon {
  width: 18px;
  height: 18px;
}


/* =========================================================
   MESSAGES
========================================================= */

.chat-panel-messages {
  flex: 1;
  min-height: 0;

  display: flex;
  flex-direction: column;

  gap: 7px;

  padding: 18px 16px;

  overflow-y: auto;
  overflow-x: hidden;

  background: #f8fafc;

  scroll-behavior: smooth;
}

.chat-panel-messages::-webkit-scrollbar {
  width: 5px;
}

.chat-panel-messages::-webkit-scrollbar-thumb {
  border-radius: 10px;
  background: #cbd5e1;
}


/* =========================================================
   MESSAGE ROWS
========================================================= */

.chat-message-row {
  width: 100%;

  display: flex;
}

.chat-message-row-sent {
  justify-content: flex-end;
}

.chat-message-row-received {
  justify-content: flex-start;
}


/* =========================================================
   MESSAGE BUBBLES
========================================================= */

.chat-message {
  max-width: min(76%, 460px);

  padding: 10px 13px;

  border-radius: 16px;

  font-size: 14px;
  line-height: 1.5;

  overflow-wrap: anywhere;

  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04);
}

.chat-message-sent {
  color: #ffffff;

  background: #2563eb;

  border-bottom-right-radius: 5px;
}

.chat-message-received {
  color: #172033;

  background: #ffffff;

  border: 1px solid #edf1f5;

  border-bottom-left-radius: 5px;
}


/* =========================================================
   LOADING SKELETON
========================================================= */

.chat-messages-skeleton {
  width: 100%;

  display: flex;
  flex-direction: column;
  gap: 12px;

  padding-top: 8px;
}

.chat-skeleton-message {
  height: 42px;

  border-radius: 16px;

  background: linear-gradient(
    90deg,
    #e9eef5 25%,
    #f4f7fa 50%,
    #e9eef5 75%
  );

  background-size: 200% 100%;

  animation: chatSkeletonLoading 1.4s infinite;
}

.chat-skeleton-received {
  width: 48%;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.chat-skeleton-sent {
  width: 58%;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.chat-skeleton-message:nth-child(3) {
  width: 39%;
}

.chat-skeleton-message:nth-child(4) {
  width: 52%;
}

@keyframes chatSkeletonLoading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}


/* =========================================================
   WAITING / EMPTY STATE
========================================================= */
.chat-waiting-state {
  width: 100%;
  min-height: 260px;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: 40px 24px;

  text-align: center;
  box-sizing: border-box;
}

.chat-waiting-icon {
  width: 58px;
  height: 58px;

  display: flex;
  align-items: center;
  justify-content: center;

  margin-bottom: 16px;

  border-radius: 50%;

  background: #eef4ff;
  color: #2563eb;

  box-shadow:
    0 4px 14px rgba(37, 99, 235, 0.08);
}

.chat-waiting-icon .icon {
  width: 25px;
  height: 25px;
}

.chat-waiting-title {
  margin: 0 0 6px;

  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;

  color: #172033;
}

.chat-waiting-text {
  max-width: 340px;

  margin: 0;

  font-size: 13px;
  line-height: 1.6;

  color: #64748b;
}

/* =========================================================
   COMPOSER
========================================================= */

.chat-panel-composer {
  flex-shrink: 0;

  display: flex;
  align-items: flex-end;
  gap: 9px;

  padding: 11px 13px;

  background: #ffffff;

  border-top: 1px solid #eef2f7;
}

.chat-panel-input {
  flex: 1;

  min-width: 0;

  min-height: 42px;
  max-height: 120px;

  padding: 11px 13px;

  resize: none;

  border: 1px solid #dbe3ec;
  border-radius: 14px;

  outline: none;

  background: #f8fafc;

  color: #172033;

  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.chat-panel-input::placeholder {
  color: #94a3b8;
}

.chat-panel-input:focus {
  background: #ffffff;

  border-color: #93c5fd;

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.08);
}

.chat-panel-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.chat-panel-send {
  width: 42px;
  height: 42px;

  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 13px;

  background: #2563eb;

  color: #ffffff;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease,
    opacity 0.2s ease;
}

.chat-panel-send:hover {
  background: #1d4ed8;
}

.chat-panel-send:active {
  transform: scale(0.94);
}

.chat-panel-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-panel-send .icon {
  width: 18px;
  height: 18px;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 640px) {

  .chat-panel-overlay {
    align-items: stretch;
  }

  .chat-panel {
    width: 100%;
    height: 100dvh;

    max-height: none;

    border-radius: 0;

    transform: translateY(20px);
  }

  .chat-panel-header {
    padding:
      calc(10px + env(safe-area-inset-top))
      13px
      10px;
  }

  .chat-panel-messages {
    padding: 14px 12px;
  }

  .chat-message {
    max-width: 82%;

    font-size: 14px;
  }

  .chat-panel-composer {
    padding:
      9px 10px
      calc(9px + env(safe-area-inset-bottom));
  }

  .chat-panel-input {
    min-height: 42px;
  }

}


/* =========================================================
   SMALL PHONES
========================================================= */

@media (max-width: 380px) {

  .chat-panel-avatar {
    width: 42px;
    height: 42px;
  }

  .chat-panel-name {
    font-size: 14px;
  }

  .chat-message {
    max-width: 86%;
  }

}

/* =========================================================
   CHAT SESSION BAR
   ========================================================= */

.chat-session-bar {
  flex: 0 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 9px 18px;

  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;

  font-size: 13px;
}

.chat-session-label {
  color: #64748b;
  font-weight: 500;
}

.chat-session-timer {
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;

  color: #2563eb;

  padding: 4px 9px;

  background: #eff6ff;
  border-radius: 8px;
}

.chat-session-bar.is-ending .chat-session-timer {
  color: #dc2626;
  background: #fef2f2;
}

.chat-session-bar.is-complete .chat-session-timer {
  color: #64748b;
  background: #f1f5f9;
}


/* =========================================================
   MESSAGES AREA
   ========================================================= */

.chat-panel-messages {
  flex: 1 1 auto;

  min-height: 0;

  overflow-y: auto;

  padding: 18px;

  display: flex;
  flex-direction: column;
  gap: 8px;

  background: #f8fafc;

  scroll-behavior: smooth;
}


/* =========================================================
   MESSAGE ROWS
   ========================================================= */

.chat-message-row {
  display: flex;
  width: 100%;
}

.chat-message-row-sent {
  justify-content: flex-end;
}

.chat-message-row-received {
  justify-content: flex-start;
}


/* =========================================================
   MESSAGE BUBBLES
   ========================================================= */

.chat-message {
  max-width: min(75%, 480px);

  padding: 10px 14px;

  border-radius: 16px;

  font-size: 14px;
  line-height: 1.5;

  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-message-sent {
  color: #ffffff;

  background: #2563eb;

  border-bottom-right-radius: 5px;
}

.chat-message-received {
  color: #1e293b;

  background: #ffffff;

  border: 1px solid #e2e8f0;

  border-bottom-left-radius: 5px;

  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04);
}


/* =========================================================
   COMPOSER
   ========================================================= */

.chat-panel-composer {
  flex: 0 0 auto;

  display: flex;
  align-items: flex-end;
  gap: 9px;

  padding: 12px 14px;

  background: #ffffff;

  border-top: 1px solid #e2e8f0;
}


/* =========================================================
   MESSAGE INPUT
   ========================================================= */

.chat-panel-input {
  flex: 1;

  min-width: 0;

  min-height: 44px;
  max-height: 120px;

  resize: none;

  padding: 11px 13px;

  border: 1px solid #dbe2ea;
  border-radius: 14px;

  background: #f8fafc;

  color: #0f172a;

  font-family: inherit;
  font-size: 14px;
  line-height: 1.4;

  outline: none;

  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.chat-panel-input::placeholder {
  color: #94a3b8;
}

.chat-panel-input:focus {
  background: #ffffff;

  border-color: #93c5fd;

  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.08);
}

.chat-panel-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}


/* =========================================================
   SEND BUTTON
   ========================================================= */

.chat-panel-send {
  flex: 0 0 44px;

  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 13px;

  background: #2563eb;
  color: #ffffff;

  cursor: pointer;

  transition:
    transform 0.18s ease,
    background 0.18s ease,
    opacity 0.18s ease;
}

.chat-panel-send:hover {
  background: #1d4ed8;

  transform: translateY(-1px);
}

.chat-panel-send:active {
  transform: translateY(0);
}

.chat-panel-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}


/* =========================================================
   CHAT COMPLETED / REDEEM
   ========================================================= */

.chat-completed-btn {
  width: 100%;
  min-height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  padding: 11px 16px;

  border: none;
  border-radius: 13px;

  background: #16a34a;
  color: #ffffff;

  font-family: inherit;
  font-size: 14px;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.18s ease;
}

.chat-completed-btn:hover {
  background: #15803d;
  transform: translateY(-1px);
}

.chat-completed-btn:active {
  transform: translateY(0);
}

.chat-completed-btn span {
  display: flex;
  align-items: center;
  justify-content: center;
}


/* =========================================================
   SCROLLBAR
   ========================================================= */

.chat-panel-messages::-webkit-scrollbar {
  width: 6px;
}

.chat-panel-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-panel-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}

.chat-panel-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}


/* =========================================================
   LARGE SCREENS
   ========================================================= */

@media (min-width: 900px) {

  .chat-panel {
    width: min(640px, 94vw);

    height: min(650px, 86vh);

    border-radius: 20px;

    margin-bottom: 20px;
  }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 600px) {

  .chat-panel {
    width: 100%;
    height: min(700px, 92vh);

    border-radius: 20px 20px 0 0;
  }

  .chat-panel-messages {
    padding: 14px;
  }

  .chat-message {
    max-width: 84%;
    font-size: 14px;
  }

  .chat-panel-composer {
    padding: 10px;
  }

  .chat-session-bar {
    padding: 8px 14px;
  }

}

.chat-typing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;

  width: fit-content;
  margin: 6px 0 10px 8px;
  padding: 9px 13px;

  background: #f1f3f5;
  border-radius: 16px 16px 16px 5px;

  color: #6b7280;
  font-size: 13px;
  font-weight: 500;

  animation: chatTypingFadeIn 0.2s ease;
}

.chat-typing-dot {
  width: 5px;
  height: 5px;

  border-radius: 50%;
  background: #8b8f97;

  animation: chatTypingBounce 1.2s infinite ease-in-out;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes chatTypingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.45;
  }

  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes chatTypingFadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-message-ticks {
  display: flex;
  justify-content: flex-end;
  margin: 2px 4px 0 0;
  color: var(--color-ink-faint, #93a0bd);
}

.chat-message-ticks.is-seen {
  color: var(--color-primary, #1b4db1);
}

.chat-toast-stack {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.chat-toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 300px;
  max-width: calc(100vw - 40px);
  background: var(--color-white, #fff);
  border-radius: var(--radius-md, 12px);
  box-shadow: var(--shadow-lift, 0 20px 48px rgba(18,53,120,0.16));
  padding: 12px 14px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.chat-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.chat-toast-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--color-primary-tint, #e8effc);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-toast-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-toast-body {
  flex: 1;
  min-width: 0;
}

.chat-toast-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-ink, #101b33);
}

.chat-toast-preview {
  font-size: 12.5px;
  color: var(--color-ink-soft, #5b6b8c);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-toast-close {
  background: none;
  border: none;
  color: var(--color-ink-faint, #93a0bd);
  cursor: pointer;
  flex-shrink: 0;
  padding: 2px;
}

/* ================================
   CHAT REWARD BUTTON
================================ */

.redeem-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: redeemSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes redeemSpin {
  to {
    transform: rotate(360deg);
  }
}


/* Redeeming state */

.redeemBtn.is-redeeming {
  opacity: 0.75;
  cursor: wait;
  pointer-events: none;
}


/* Successfully redeemed */

.redeemBtn.is-redeemed {
  cursor: default;
  opacity: 1;
}

.chat-open-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-open-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: var(--color-white, #fff);
  border: 1px solid var(--color-border, #dfe6f5);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chat-open-row:hover {
  border-color: var(--color-primary-light, #4c7fe0);
  box-shadow: 0 4px 14px rgba(18, 53, 120, 0.08);
}

.chat-open-row-skeleton {
  height: 58px;
  background: linear-gradient(90deg, #f0f3f9 25%, #e6ebf5 37%, #f0f3f9 63%);
  background-size: 400% 100%;
  animation: chat-open-shimmer 1.4s ease infinite;
  border: none;
  cursor: default;
}

@keyframes chat-open-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.chat-open-avatar {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-primary-tint, #e8effc);
  color: var(--color-primary, #1b4db1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-open-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.chat-open-info {
  flex: 1;
  min-width: 0;
}

.chat-open-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-open-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-ink, #101b33);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-open-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--color-primary, #1b4db1);
  background: var(--color-primary-tint, #e8effc);
  padding: 2px 8px;
  border-radius: 999px;
}

.chat-open-preview {
  margin-top: 3px;
  font-size: 12px;
  color: var(--color-ink-soft, #5b6b8c);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}