.order-chat-card {
  width: 100%;
  max-width: 26rem;
  margin-top: 1rem;
  border-radius: 1.6rem;
  overflow: hidden;
  border: 1px solid rgba(216, 223, 232, 0.9);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.16);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(14px);
}

.order-chat-card.is-hidden {
  display: none;
}

.order-chat__launcher {
  display: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.order-chat__page-toggle {
  position: relative;
  min-width: 3.4rem;
  min-height: 3.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
}

.order-chat__page-toggle.is-active {
  color: #1d4ed8;
  border-color: #93c5fd;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
}

.order-chat__page-toggle .fa-comments {
  font-size: 1rem;
}

.order-chat__page-badge {
  position: absolute;
  top: -0.42rem;
  right: -0.38rem;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.24);
}

.order-chat-card .card-body {
  display: flex;
  flex-direction: column;
  min-height: 40rem;
  padding: 0;
}

.order-chat__header {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1rem 1rem 0.9rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 252, 0.94) 100%);
}

.order-chat__header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.order-chat__identity {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
  flex: 1 1 auto;
}

.order-chat__avatar {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #60a5fa 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(96, 165, 250, 0.28);
}

.order-chat__avatar-image,
.order-chat__launcher-image,
.order-chat-message__avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.order-chat__identity-main {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
}

.order-chat__eyebrow {
  margin-bottom: 0;
  color: #8b5cf6;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-transform: uppercase;
}

.order-chat__title {
  margin: 0;
  max-width: 100%;
  font-size: 1.22rem;
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  word-break: normal;
  overflow-wrap: normal;
}

.order-chat__status {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  margin-top: 0;
  color: #64748b;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-chat__header-actions {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  width: 100%;
}

.order-chat__status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14);
}

.order-chat__status-dot.is-offline {
  background: #94a3b8;
  box-shadow: 0 0 0 4px rgba(148, 163, 184, 0.18);
}

.order-chat__order-badge {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  padding: 0.72rem 0.9rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  border: 1px solid #ddd6fe;
  text-align: left;
  overflow: hidden;
}

.order-chat__order-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7c3aed;
}

.order-chat__order-number {
  display: block;
  color: #243b64;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.order-chat__header-btn {
  width: 2.35rem;
  height: 2.35rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.96);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.order-chat__header-btn:hover,
.order-chat__header-btn:focus {
  background: #e2e8f0;
  color: #0f172a;
  transform: translateY(-1px);
}

.order-chat__messages {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  overflow-y: auto;
  padding: 1rem;
  margin-bottom: 0;
  background:
    radial-gradient(circle at top right, rgba(191, 219, 254, 0.35), transparent 26%),
    linear-gradient(180deg, #f8fafc 0%, #ffffff 38%, #ffffff 100%);
}

.order-chat__empty {
  padding: 2.2rem 1rem;
  text-align: center;
  border: 1px dashed #cbd5e1;
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.72);
}

.order-chat__empty-icon {
  font-size: 1.6rem;
  color: #94a3b8;
  margin-bottom: 0.8rem;
}

.order-chat__empty-title {
  font-weight: 700;
  color: #0f172a;
}

.order-chat__empty-text {
  color: #64748b;
}

.order-chat-message {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
}

.order-chat-message--own {
  justify-content: flex-end;
  align-items: flex-start;
}

.order-chat-message--peer {
  justify-content: flex-start;
  align-items: flex-end;
}

.order-chat-message__avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 800;
}

.order-chat-message--own .order-chat-message__avatar,
.order-chat-message--own .order-chat-message__author {
  display: none;
}

.order-chat-message__content {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-width: 0;
  max-width: 82%;
}

.order-chat-message__meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
}

.order-chat-message--own .order-chat-message__meta {
  justify-content: flex-end;
}

.order-chat-message__author {
  padding-left: 0.2rem;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 700;
}

.order-chat-message__time {
  color: #64748b;
}

.order-chat-message__bubble {
  width: fit-content;
  max-width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 1.35rem;
  border: 1px solid rgba(226, 232, 240, 0.85);
  background: #f3f4f6;
  color: #0f172a;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
  line-height: 1.45;
}

.order-chat-message__bubble p:last-child {
  margin-bottom: 0;
}

.order-chat-message--peer .order-chat-message__bubble {
  border-bottom-left-radius: 0.45rem;
  background: linear-gradient(180deg, #f3f4f6 0%, #eef2f7 100%);
}

.order-chat-message--own .order-chat-message__bubble {
  margin-left: auto;
  border-color: rgba(96, 165, 250, 0.25);
  border-bottom-right-radius: 0.45rem;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}

.order-chat__composer {
  border-top: 1px solid rgba(226, 232, 240, 0.9);
  padding: 0.95rem 1rem 1rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.order-chat__input {
  min-height: 3.25rem;
  max-height: 7rem;
  resize: none;
  border-radius: 999px;
  padding: 0.9rem 1rem;
  border: 1px solid #e2e8f0;
  background: #f3f4f6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.order-chat__input:focus {
  background: #ffffff;
  border-color: #bfdbfe;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}

.order-chat__composer-row {
  display: flex;
  align-items: flex-end;
  gap: 0.7rem;
}

.order-chat__submit {
  border-radius: 999px;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  flex-shrink: 0;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 14px 24px rgba(37, 99, 235, 0.26);
}

.order-chat__composer-note {
  margin-top: 0.65rem;
  color: #64748b;
  font-size: 0.72rem;
}

.order-chat-card--floating.is-collapsed {
  position: fixed;
  top: auto;
  left: auto;
  right: 1rem;
  bottom: 1rem;
  z-index: 1040;
  width: 5.1rem;
  height: 5.1rem;
  min-height: 0;
  max-width: none;
  margin-top: 0;
  padding: 0;
  border: 0;
  border-radius: 999px;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  overflow: visible;
}

.order-chat-card--floating.is-collapsed .card-body {
  display: none;
}

.order-chat-card--floating.is-collapsed .order-chat__launcher {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.order-chat__launcher-avatar {
  width: 4.4rem;
  height: 4.4rem;
  border-radius: 999px;
  overflow: hidden;
  border: 4px solid #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
  background: linear-gradient(135deg, #60a5fa 0%, #7c3aed 100%);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
}

.order-chat__launcher-dot {
  position: absolute;
  right: 0.22rem;
  bottom: 0.28rem;
  width: 1rem;
  height: 1rem;
  border-radius: 999px;
  background: #22c55e;
  border: 3px solid #ffffff;
  box-shadow: 0 6px 12px rgba(34, 197, 94, 0.25);
}

.order-chat__launcher-dot.is-offline {
  background: #94a3b8;
  box-shadow: 0 6px 12px rgba(148, 163, 184, 0.22);
}

.order-chat__launcher-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.2rem;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #ef4444;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28);
}

@media (min-width: 992px) {
  .order-chat-card--floating {
    position: fixed;
    top: 5.75rem;
    right: 1.1rem;
    bottom: 1.1rem;
    z-index: 1040;
    margin-top: 0;
    width: min(24rem, calc(100vw - 2rem));
    max-width: none;
  }

  .order-chat-card--floating .card-body {
    min-height: 0;
    height: 100%;
  }
}

@media (min-width: 1200px) {
  .order-chat-card--floating {
    width: 25.5rem;
    right: 1.5rem;
  }
}

@media (max-width: 767.98px) {
  .order-chat-card--floating {
    position: fixed;
    top: auto;
    right: 0.85rem;
    bottom: calc(0.65rem + env(safe-area-inset-bottom));
    left: 0.85rem;
    z-index: 1040;
    width: auto;
    max-width: none;
    height: min(32rem, calc(100dvh - 6.25rem - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    max-height: calc(100dvh - 6.25rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    margin-top: 0;
    border-radius: 1.25rem;
  }

  .order-chat-card--floating .card-body {
    min-height: 0;
    height: 100%;
  }

  .order-chat__header {
    gap: 0.75rem;
    padding: 0.85rem 0.85rem 0.75rem;
  }

  .order-chat__header-top {
    gap: 0.65rem;
  }

  .order-chat__identity {
    gap: 0.7rem;
  }

  .order-chat__avatar {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 0.9rem;
  }

  .order-chat__eyebrow {
    font-size: 0.64rem;
  }

  .order-chat__title {
    font-size: 1.05rem;
    line-height: 1.15;
  }

  .order-chat__status {
    margin-top: 0.16rem;
    font-size: 0.82rem;
    white-space: normal;
  }

  .order-chat__header-actions {
    gap: 0.55rem;
  }

  .order-chat__order-badge {
    padding: 0.6rem 0.75rem;
    border-radius: 0.95rem;
  }

  .order-chat__order-number {
    font-size: 0.92rem;
  }

  .order-chat__header-btn {
    width: 2.2rem;
    height: 2.2rem;
  }

  .order-chat__messages {
    gap: 0.75rem;
    padding: 0.85rem 0.85rem 0.95rem;
  }

  .order-chat-message {
    gap: 0.5rem;
  }

  .order-chat-message__avatar {
    width: 1.75rem;
    height: 1.75rem;
  }

  .order-chat-message__content {
    max-width: min(72%, calc(100% - 2.25rem));
  }

  .order-chat-message__bubble {
    padding: 0.68rem 0.8rem;
    border-radius: 1.05rem;
    font-size: 0.92rem;
    line-height: 1.35;
  }

  .order-chat__composer {
    padding: 0.75rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
  }

  .order-chat__composer-row {
    gap: 0.55rem;
  }

  .order-chat__input {
    min-height: 2.9rem;
    padding: 0.78rem 0.95rem;
    font-size: 0.95rem;
  }

  .order-chat__submit {
    width: 3rem;
    height: 3rem;
  }

  .order-chat__composer-note {
    display: none;
  }
}
