.dl-chatbot-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1100;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

.dl-chatbot-fab {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border, #253044) 65%, var(--accent, #6366f1) 35%);
  background: linear-gradient(135deg, var(--accent, #6366f1), #818cf8);
  color: #fff;
  box-shadow: 0 12px 28px rgba(8, 12, 22, 0.42);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.dl-chatbot-fab:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 30px rgba(8, 12, 22, 0.48);
}

.dl-chatbot-fab:focus-visible,
.dl-chatbot-close:focus-visible,
.dl-chatbot-send:focus-visible,
.dl-chatbot-input:focus-visible {
  outline: 2px solid var(--focus-ring, rgba(99, 102, 241, 0.45));
  outline-offset: 2px;
}

.dl-chatbot-fab svg {
  width: 22px;
  height: 22px;
}

.dl-chatbot-panel {
  position: absolute;
  right: 0;
  bottom: 70px;
  width: min(370px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 92px));
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--border, #253044) 82%, var(--accent, #6366f1) 18%);
  background: color-mix(in srgb, var(--surface, #1a1d27) 94%, transparent);
  backdrop-filter: blur(10px);
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.48);
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.dl-chatbot-panel[hidden] {
  display: none;
}

.dl-chatbot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border, #253044);
  background: color-mix(in srgb, var(--accent-dim, rgba(99, 102, 241, 0.15)) 70%, transparent);
}

.dl-chatbot-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.1px;
  color: var(--text-primary, #f1f5f9);
  margin: 0;
}

.dl-chatbot-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted, #93a4c2);
}

.dl-chatbot-close {
  border: 1px solid var(--border, #253044);
  background: color-mix(in srgb, var(--surface, #1a1d27) 86%, transparent);
  color: var(--text-muted, #93a4c2);
  border-radius: 8px;
  width: 32px;
  height: 32px;
  cursor: pointer;
}

.dl-chatbot-log {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  background: color-mix(in srgb, var(--bg, #10131b) 65%, transparent);
}

.dl-chatbot-msg {
  max-width: 90%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.dl-chatbot-msg.assistant {
  align-self: flex-start;
  color: var(--text-primary, #f1f5f9);
  background: color-mix(in srgb, var(--surface, #1a1d27) 90%, transparent);
  border: 1px solid var(--border, #253044);
}

.dl-chatbot-msg.user {
  align-self: flex-end;
  color: #fff;
  background: linear-gradient(135deg, var(--accent, #6366f1), #818cf8);
}

.dl-chatbot-msg.system {
  align-self: center;
  font-size: 12px;
  color: var(--text-muted, #93a4c2);
  background: transparent;
  border: 0;
  padding: 2px 8px;
}

.dl-chatbot-footer {
  border-top: 1px solid var(--border, #253044);
  padding: 10px;
  display: grid;
  gap: 8px;
  background: color-mix(in srgb, var(--surface, #1a1d27) 92%, transparent);
}

.dl-chatbot-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.dl-chatbot-input {
  border: 1px solid var(--border, #253044);
  background: color-mix(in srgb, var(--bg, #10131b) 80%, transparent);
  color: var(--text-primary, #f1f5f9);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}

.dl-chatbot-input::placeholder {
  color: color-mix(in srgb, var(--text-muted, #93a4c2) 78%, transparent);
}

.dl-chatbot-send {
  border: 1px solid color-mix(in srgb, var(--border, #253044) 65%, var(--accent, #6366f1) 35%);
  background: color-mix(in srgb, var(--surface, #1a1d27) 65%, var(--accent-dim, rgba(99, 102, 241, 0.15)) 35%);
  color: var(--text-primary, #f1f5f9);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.dl-chatbot-send:disabled,
.dl-chatbot-input:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.dl-chatbot-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-muted, #93a4c2);
}

@media (max-width: 640px) {
  .dl-chatbot-root {
    right: 12px;
    bottom: 12px;
  }

  .dl-chatbot-panel {
    right: 0;
    width: min(360px, calc(100vw - 16px));
    height: min(540px, calc(100vh - 84px));
  }
}
