[data-order-chat-host] {
  display: grid;
  gap: 8px;
  min-width: 0;
}

[data-order-chat-host]:empty {
  display: none;
}

[data-order-chat-host] .order-chat-panel {
  position: static;
  left: auto;
  bottom: auto;
  z-index: auto;
  width: 100%;
  max-height: none;
  padding: 10px;
  border-radius: 10px;
  box-shadow: none;
  transform: none;
}

.order-chat-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent-soft, #ffe9a8);
  color: var(--ink, #00333a);
  font-size: .72rem;
  font-weight: 900;
  line-height: 1;
}

.order-chat-panel {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 28px));
  padding: 12px;
  border: 1px solid var(--line, #c7dddd);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(0, 65, 70, .18);
  transform: translateX(-50%);
}

.order-chat-panel[hidden] {
  display: none;
}

.order-chat-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-chat-panel__messages {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line, #c7dddd);
  border-radius: 8px;
  background: #f5fbfa;
}

.order-chat-panel__messages[hidden] {
  display: none;
}

.order-chat-message {
  width: fit-content;
  max-width: 86%;
  padding: 8px 10px;
  border: 1px solid var(--line, #c7dddd);
  border-radius: 10px;
  background: #fff;
}

.order-chat-message.is-own {
  justify-self: end;
  background: #e8f7f4;
}

.order-chat-message p {
  margin: 0;
  color: var(--ink, #00333a);
  font-weight: 750;
}

.order-chat-message small {
  display: block;
  margin-top: 4px;
  color: var(--muted, #5f7378);
  font-weight: 700;
}

.order-chat-panel__form {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.order-chat-panel__form textarea {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  min-height: 44px;
  margin: 0;
  border: 1px solid var(--line, #c7dddd);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink, #00333a);
  font: inherit;
  font-weight: 800;
  resize: vertical;
}

.order-chat-panel__form button {
  flex: 0 0 auto;
  align-self: stretch;
  min-width: 92px;
  width: auto;
  min-height: 44px;
  margin: 0;
}
