/* DoorForce Chat — navy / red / white */
.df-chat-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 0;
  min-height: min(70vh, 720px);
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}
.df-chat-sidebar {
  border-right: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fafc 0%, #fff 40%);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.df-chat-sidebar-head {
  padding: 14px 14px 10px;
  border-bottom: 1px solid #e2e8f0;
}
.df-chat-sidebar-head h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  color: #0b1f3a;
}
.df-chat-search {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.88rem;
}
.df-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.df-chat-list {
  overflow: auto;
  flex: 1;
  min-height: 0;
}
.df-chat-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: transparent;
  padding: 12px 14px;
  cursor: pointer;
}
.df-chat-item:hover { background: #f8fafc; }
.df-chat-item.is-active { background: rgba(11, 31, 58, 0.06); border-left: 3px solid #bf0a30; }
.df-chat-item-title {
  font-weight: 700;
  color: #0b1f3a;
  font-size: 0.9rem;
}
.df-chat-item-preview {
  color: #64748b;
  font-size: 0.78rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.df-chat-item-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 0.72rem;
  color: #94a3b8;
}
.df-chat-badge {
  background: #bf0a30;
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-weight: 700;
  font-size: 0.7rem;
}
.df-chat-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
}
.df-chat-main-head {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.df-chat-main-head h3 {
  margin: 0;
  color: #0b1f3a;
  font-size: 1rem;
}
.df-chat-messages {
  flex: 1;
  overflow: auto;
  padding: 16px;
  background:
    radial-gradient(800px 200px at 0% 0%, rgba(191, 10, 48, 0.04), transparent 50%),
    #f8fafc;
}
.df-chat-empty {
  color: #64748b;
  text-align: center;
  padding: 48px 16px;
  font-size: 0.92rem;
}
.df-chat-bubble {
  max-width: min(520px, 88%);
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.df-chat-bubble.is-mine {
  margin-left: auto;
  background: #0b1f3a;
  color: #fff;
  border-color: #0b1f3a;
}
.df-chat-bubble.is-pending { opacity: 0.7; border-style: dashed; }
.df-chat-bubble-meta {
  font-size: 0.72rem;
  opacity: 0.75;
  margin-bottom: 4px;
}
.df-chat-bubble-text { white-space: pre-wrap; word-break: break-word; font-size: 0.9rem; }
.df-chat-attach {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.8rem;
  text-decoration: underline;
}
.df-chat-bubble.is-mine .df-chat-attach { color: #fecaca; }
.df-chat-img-preview {
  max-width: 220px;
  max-height: 160px;
  border-radius: 8px;
  margin-top: 6px;
  display: block;
}
.df-chat-composer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
  align-items: end;
}
.df-chat-composer textarea {
  width: 100%;
  min-height: 44px;
  max-height: 120px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px;
  font: inherit;
}
.df-chat-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #bf0a30;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
}
.df-chat-nav-badge:empty,
.df-chat-nav-badge[data-count="0"] { display: none; }
@media (max-width: 860px) {
  .df-chat-shell {
    grid-template-columns: 1fr;
    min-height: 70vh;
  }
  .df-chat-sidebar {
    max-height: 40vh;
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }
}
