#zf-chat-root {
  position: fixed;
  z-index: 99999;
  inset-inline-end: 16px;
  inset-block-end: 16px;
  font-family: Vazirmatn, Tahoma, sans-serif;
  direction: rtl;
}
#zf-chat-toggle {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: #1f2d2d;
  color: #f3f8f8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}
#zf-chat-panel {
  position: absolute;
  inset-inline-end: 0;
  inset-block-end: 52px;
  width: min(380px, calc(100vw - 24px));
  height: min(520px, calc(100vh - 96px));
  background: #f7faf9;
  color: #1f2d2d;
  border: 1px solid #c5d5d5;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#zf-chat-panel[hidden] {
  display: none !important;
}
#zf-chat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: #232e3c;
  color: #f3f8f8;
}
#zf-chat-route {
  flex: 1;
  font-size: 11px;
  opacity: 0.8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#zf-chat-close {
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 20px;
  cursor: pointer;
}
#zf-chat-log {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.zf-chat-msg {
  padding: 8px 10px;
  border-radius: 10px;
  max-width: 92%;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}
.zf-chat-user {
  align-self: flex-start;
  background: #dceceb;
}
.zf-chat-assistant {
  align-self: flex-end;
  background: #fff;
  border: 1px solid #d5e0e0;
}
.zf-chat-atts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.zf-chat-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #c5d5d5;
}
.zf-chat-filechip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 8px;
  background: #e8f1f1;
  color: #0a5050;
  text-decoration: none;
  font-size: 12px;
}
#zf-chat-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}
#zf-chat-preview[hidden] {
  display: none !important;
}
.zf-chat-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid #c5d5d5;
  border-radius: 8px;
  font-size: 12px;
  max-width: 100%;
}
.zf-chat-chip button {
  border: 0;
  background: transparent;
  cursor: pointer;
}
#zf-chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #d5e0e0;
  background: #fff;
  align-items: center;
}
#zf-chat-attach {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
}
#zf-chat-input {
  flex: 1;
  border: 1px solid #c5d5d5;
  border-radius: 8px;
  padding: 8px 10px;
}
#zf-chat-form button[type="submit"] {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: #1e5f5f;
  color: #fff;
  cursor: pointer;
}
