.dclc-chatbot-root {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 9999;
  width: 360px;
  max-width: calc(100vw - 24px);
  font-family: Arial, sans-serif;
}

.dclc-toggle,
.dclc-chat-form button,
.dclc-lead-gate button {
  cursor: pointer;
}

.dclc-toggle {
  width: 100%;
  border: 0;
  background: #111827;
  color: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.dclc-toggle-mode-icon {
  width: auto;
  min-width: 58px;
  min-height: 58px;
  padding: 12px;
  border-radius: 999px;
}

.dclc-toggle-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.dclc-toggle-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.dclc-toggle-mode-both .dclc-toggle-icon {
  width: 20px;
  height: 20px;
}

.dclc-toggle-text {
  display: inline-block;
}


.dclc-panel:not([hidden]) {
  position: relative;
  right: -10px;
  bottom: -10px;
}

.dclc-panel {
  margin-top: 10px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0,0,0,.15);
}

.dclc-header {
  background: #f3f4f6;
  padding: 14px 16px;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}

.dclc-messages {
  max-height: 360px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dclc-message {
  padding: 9px 11px;
  border-radius: 12px;
  line-height: 1.45;
  white-space: normal;
  font-size: 13px;
}

.dclc-assistant {
  background: #f3f4f6;
  color: #111827;
}

.dclc-user {
  background: #111827;
  color: #fff;
  align-self: flex-end;
}

.dclc-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 14px 8px;
}

.dclc-sources a {
  font-size: 12px;
  text-decoration: none;
}

.dclc-chat-form,
.dclc-lead-gate {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #e5e7eb;
}

.dclc-chat-form textarea,
.dclc-lead-gate input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.dclc-chat-form textarea {
  min-height: 82px;
  resize: vertical;
}

.dclc-chat-form button,
.dclc-lead-gate button {
  border: 0;
  background: #111827;
  color: #fff;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.dclc-lead-gate label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #374151;
}


.dclc-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 14px 14px;
}

.dclc-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 0;
  background: #111827;
  color: #fff;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14px;
}

.dclc-action-secondary {
  background: #f3f4f6;
  color: #111827;
  border: 1px solid #d1d5db;
}


.dclc-message p {
  margin: 0 0 8px;
}

.dclc-message p:last-child {
  margin-bottom: 0;
}

.dclc-message ul,
.dclc-message ol {
  margin: 8px 0 0 18px;
  padding: 0;
}

.dclc-message li {
  margin: 0 0 5px;
}

.dclc-sources {
  padding-top: 4px;
}

.dclc-sources a {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111827;
}

.dclc-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 0 0;
}

.dclc-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(17,24,39,.14);
}

.dclc-action-button:hover {
  transform: translateY(-1px);
}

.dclc-action-secondary {
  background: linear-gradient(135deg, #9a7b4f, #c7a56a);
  color: #fff;
}

.dclc-action-call {
  background: #ffffff;
  color: #111827;
  border-color: #d1d5db;
  box-shadow: none;
}


.dclc-chat-form button:disabled,
.dclc-chat-form textarea:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}


.dclc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dclc-header-title {
  min-width: 0;
}

.dclc-close {
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 999px;
}

.dclc-close:hover {
  background: rgba(17,24,39,.06);
}


.dclc-sources-heading {
  padding: 6px 14px 0;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}


.dclc-panel[hidden] {
  display: none !important;
}

.dclc-chat-form {
  display: grid;
}

.dclc-sources-block {
  padding: 6px 14px 0;
}

.dclc-sources-heading {
  padding: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.dclc-sources {
  display: grid;
  gap: 8px;
  padding: 0 0 8px;
}

.dclc-source-item {
  display: grid;
  gap: 4px;
}

.dclc-source-indicator {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #f3f4f6;
  color: #374151;
}

.dclc-source-indicator-page {
  background: #e8f0fe;
  color: #1d4ed8;
}

.dclc-source-indicator-post {
  background: #fef3c7;
  color: #92400e;
}

.dclc-source-link {
  font-size: 12px;
  line-height: 1.4;
  color: #111827;
  text-decoration: none;
}

.dclc-source-link:hover {
  text-decoration: underline;
}


.linzila-chatbot-meta {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.linzila-chatbot-meta-label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: #374151;
}

.linzila-chatbot-meta-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
}

.linzila-chatbot-assistant-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 6px;
}

.linzila-chatbot-assistant-submeta {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  padding: 0 14px 4px;
}

.linzila-chatbot-assistant-icon {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 28px;
}

.linzila-chatbot-assistant-name {
  font-size: 12px;
  font-weight: 700;
  color: #111827;
}


.linzila-chatbot-assistant-block {
  display: grid;
  gap: 4px;
}

.linzila-chatbot-assistant-submeta-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 2px;
}

.linzila-chatbot-assistant-icon-small {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 20px;
}

.linzila-chatbot-assistant-submeta-block .linzila-chatbot-assistant-submeta {
  padding: 0;
}


.linzila-chatbot-assistant-block {
  display: grid;
  gap: 4px;
}

.linzila-chatbot-assistant-submeta-block {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px 2px;
}

.linzila-chatbot-assistant-icon-small {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  object-fit: cover;
  flex: 0 0 20px;
}

.linzila-chatbot-assistant-submeta-block .linzila-chatbot-assistant-submeta {
  padding: 0;
}


.linzila-chatbot-suggestions {
  padding: 0 14px 12px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.linzila-chatbot-suggestions-title {
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  margin: 10px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.linzila-chatbot-suggestion-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.linzila-chatbot-suggestion {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

.linzila-chatbot-suggestion:hover {
  background: #f3f4f6;
}


@media (max-width: 767px) {
  .dclc-chatbot-root {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    max-width: none;
  }

  .dclc-toggle {
    border-radius: 14px;
    font-size: 14px;
    padding: 13px 14px;
  }

  .dclc-panel {
    margin-top: 8px;
    border-radius: 16px;
    max-height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
  }

  .dclc-header {
    padding: 12px 14px;
    flex: 0 0 auto;
  }

  .dclc-messages {
    max-height: none;
    flex: 1 1 auto;
    padding: 12px;
    gap: 8px;
  }

  .dclc-message {
    font-size: 13px;
    padding: 10px 11px;
  }

  .dclc-chat-form {
    padding: 12px;
    gap: 8px;
  }

  .dclc-chat-form textarea {
    min-height: 64px;
    max-height: 120px;
  }

  .linzila-chatbot-meta {
    padding: 12px;
  }

  .linzila-chatbot-suggestions {
    padding: 0 12px 12px;
  }

  .linzila-chatbot-suggestion-list {
    gap: 6px;
  }

  .linzila-chatbot-suggestion {
    font-size: 12px;
    padding: 8px 10px;
    max-width: 100%;
  }

  .dclc-contact-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .dclc-action-button {
    width: 100%;
    justify-content: center;
  }

  .dclc-source-link {
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  .dclc-chatbot-root {
    right: 8px;
    left: 8px;
    bottom: 8px;
  }

  .dclc-panel {
    max-height: calc(100vh - 70px);
  }

  .dclc-header-title {
    font-size: 13px;
  }

  .dclc-close {
    font-size: 11px;
    padding: 5px 7px;
  }

  .linzila-chatbot-assistant-name,
  .linzila-chatbot-assistant-submeta {
    font-size: 11px;
  }
}


.linzila-chatbot-footer-actions {
  padding: 0 14px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.linzila-chatbot-footer-actions .dclc-contact-actions {
  padding: 10px 0 0;
}


.dclc-sources-heading {
  margin-top: 2px;
}

.dclc-source-link {
  display: inline-block;
}


.linzila-chatbot-tab-notice {
  padding: 12px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fafafa;
}

.linzila-chatbot-tab-notice-text {
  font-size: 12px;
  line-height: 1.5;
  color: #374151;
}

.linzila-chatbot-tab-notice-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.linzila-chatbot-tab-notice-button {
  border: 1px solid #d1d5db;
  background: #fff;
  color: #111827;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}


.dclc-source-indicator {
  gap: 5px;
}

.dclc-source-indicator-icon {
  font-size: 11px;
  line-height: 1;
}

.dclc-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dclc-close-mode-icon .dclc-close-text {
  display: none;
}

.dclc-close-mode-text .dclc-close-icon {
  display: none;
}

.dclc-close-mode-text_icon .dclc-close-icon,
.dclc-close-mode-text_icon .dclc-close-text {
  display: inline;
}

/* v0.4.0 alignment update */

.chat-message.bot {
    text-align: left;
    justify-content: flex-start;
}

.chat-message.user {
    text-align: right;
    justify-content: flex-end;
}

.chat-message.bot .chat-name {
    text-align: left;
    display: block;
}

.chat-message.user .chat-name {
    text-align: right;
    display: block;
}


.dclc-chat-form,
.dclc-lead-gate,
.linzila-chatbot-meta {
  display: grid;
  gap: 10px;
}

.linzila-chatbot-meta-confirm:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dclc-user-meta-block {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin: 0 0 2px;
}

.dclc-user-meta-name {
  font-size: 12px;
  color: #6b7280;
  text-align: right;
}

.linzila-chatbot-phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.linzila-chatbot-meta-select {
  width: 42%;
  min-width: 120px;
  padding: 10px 12px;
  border: 1px solid #d0d7de;
  border-radius: 8px;
  background: #fff;
}

.linzila-chatbot-phone-row .linzila-chatbot-meta-input {
  flex: 1 1 auto;
}


.dclc-lead-gate .linzila-chatbot-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: #374151;
}

.dclc-lead-gate .linzila-chatbot-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex: 0 0 16px;
}

.dclc-lead-gate .linzila-chatbot-check-text {
  line-height: 1.5;
}

.dclc-lead-gate .linzila-chatbot-check-text a {
  color: #111827;
  text-decoration: underline;
}


.linzila-chatbot-meta-error {
  font-size: 12px;
  line-height: 1.45;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: -2px;
}


.linzila-chatbot-meta-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  opacity: 0.78;
}
