.dllm-chat-launcher {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 220;
  min-height: 44px;
  border: 1px solid #182238;
  border-radius: 999px;
  background: #182238;
  color: #fff;
  padding: 0 16px;
  font: 850 13px/1 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 14px 34px rgba(21, 31, 48, .2);
  cursor: pointer;
}

.dllm-chat-panel {
  position: fixed;
  right: 18px;
  bottom: 76px;
  z-index: 221;
  width: min(520px, calc(100vw - 28px));
  height: min(720px, calc(100vh - 104px));
  display: none;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(21, 31, 48, .22);
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
}

.dllm-chat-panel.open {
  display: grid;
}

.dllm-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  border-bottom: 1px solid #d9e0ea;
  background: #f8fafc;
}

.dllm-chat-head b {
  display: block;
  font-size: 15px;
}

.dllm-chat-head span {
  display: block;
  margin-top: 2px;
  color: #5d6878;
  font-size: 12px;
}

.dllm-chat-head button,
.dllm-chat-context button,
.dllm-chat-compose button {
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #fff;
  color: #111827;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.dllm-chat-head button {
  width: 34px;
  height: 34px;
}

.dllm-chat-context {
  display: grid;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #d9e0ea;
}

.dllm-chat-context p {
  margin: 0;
  color: #465365;
  font-size: 12px;
  line-height: 1.4;
}

.dllm-chat-context b {
  color: #2457d6;
}

.dllm-chat-context button {
  justify-self: start;
  min-height: 32px;
  padding: 0 10px;
}

.dllm-chat-messages {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  background: #f4f6f8;
}

.dllm-chat-message {
  max-width: 88%;
  border: 1px solid #d9e0ea;
  border-radius: 8px;
  background: #fff;
  padding: 10px 11px;
  color: #263244;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.dllm-chat-message.user {
  justify-self: end;
  border-color: #c7d5ff;
  background: #eaf0ff;
}

.dllm-chat-message.error {
  border-color: #f0cc94;
  background: #fff3df;
}

.dllm-chat-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid #d9e0ea;
  background: #fff;
}

.dllm-chat-compose textarea {
  width: 100%;
  min-height: 76px;
  border: 1px solid #b8c3d2;
  border-radius: 8px;
  padding: 10px;
  resize: vertical;
  font: inherit;
  font-size: 13px;
  outline: none;
}

.dllm-chat-compose textarea:focus {
  border-color: #2457d6;
  box-shadow: 0 0 0 3px rgba(36, 87, 214, .12);
}

.dllm-chat-compose button {
  background: #182238;
  color: #fff;
}

@media (max-width: 640px) {
  .dllm-chat-launcher {
    right: 12px;
    bottom: 12px;
  }

  .dllm-chat-panel {
    inset: auto 10px 66px 10px;
    width: auto;
    height: min(76vh, 680px);
  }

  .dllm-chat-compose {
    grid-template-columns: 1fr;
  }

  .dllm-chat-compose button {
    min-height: 40px;
  }

  .dllm-chat-message {
    max-width: 100%;
  }
}
