html,
body {
  width: 100%;
  height: 100%;
}

:host {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

#cl-shadow-root {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  height: 100% !important;
}

#cl-shadow-root > :not(style):has(#chainlit-copilot-chat) {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

[data-radix-popper-content-wrapper]:has(#chainlit-copilot-chat) {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  position: static !important;
  inset: auto !important;
  transform: none !important;
  width: 100% !important;
  height: 100% !important;
}

[data-radix-popper-content-wrapper]:has(#chainlit-copilot-chat)
  > div[data-state="open"] {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  max-height: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

#chainlit-copilot-chat {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

/* #chainlit-copilot-chat > .flex.flex-grow.overflow-y-auto {
  display: flex !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
} */

/* #chainlit-copilot-chat .flex.flex-col.mx-auto.w-full.flex-grow {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  height: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
} */

#chainlit-copilot-button {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Cacher le bouton plein écran dans l'en-tête du copilot */
#chainlit-copilot-chat .lucide-maximize,
#chainlit-copilot-chat .lucide-minimize {
  display: none !important;
  pointer-events: none !important;
}
/* Désactiver le curseur pointer sur le bouton parent */
#chainlit-copilot-chat button:has(.lucide-maximize),
#chainlit-copilot-chat button:has(.lucide-minimize) {
  pointer-events: none !important;
  cursor: default !important;
}

/* Masquer les boutons de feedback dans le copilot (shadow DOM) */
/* #chainlit-copilot-chat .positive-feedback-off,
#chainlit-copilot-chat .positive-feedback-on,
#chainlit-copilot-chat .negative-feedback-off,
#chainlit-copilot-chat .negative-feedback-on {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
} */

/* Masquer le bouton d'édition de commentaire dans le copilot */
/* #chainlit-copilot-chat button:has(.lucide-message-circle) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
} */

/* Masquer le bouton copier natif de Chainlit */
button:has(.lucide-copy) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Masquer le bouton d'envoi de feedback */
/* #submit-feedback {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
} */

/* Masquer les boutons de feedback dans la webapp */
/* .positive-feedback-off,
.positive-feedback-on,
.negative-feedback-off,
.negative-feedback-on {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
} */

.editable-draft-card {
  width: 100%;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.06);
}

.editable-draft-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: #ffffff;
}

.editable-draft-separator {
  height: 1px;
  width: 100%;
  background: #e5e7eb;
}

.editable-draft-body {
  padding: 18px 20px 22px 20px;
  background: #ffffff;
}

.editable-draft-subject {
  margin-bottom: 18px;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.5;
  color: #020617;
}

.editable-draft-subject-separator {
  height: 1px;
  width: 100%;
  margin-bottom: 8px;
  background: #e5e7eb;
}

.editable-draft-editor {
  min-height: 320px;
  width: 100%;
  background: #ffffff;
  color: #020617;
  font-size: 16px;
  line-height: 1.75;
  outline: none;
  white-space: pre-wrap;

  border: none;
  border-radius: 0;
  box-shadow: none;
}

.editable-draft-preview-shell {
  position: relative;
  min-height: 320px;
  width: 100%;
  background: #ffffff;
}

.editable-draft-preview-editor {
  min-height: 320px;
  width: 100%;

  background: #ffffff;
  color: #020617;

  font-size: 16px;
  line-height: 1.75;

  white-space: pre-wrap;
  outline: none;
}

.editable-draft-preview-text {
  white-space: pre-wrap;
}

.editable-draft-suggestion-actions {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 20;

  display: flex;
  width: fit-content;
  align-items: center;
  gap: 6px;

  transform: translateX(-50%);

  padding: 6px;

  border: 1px solid #d1d5db;
  border-radius: 16px;

  background: #ffffff;
  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.12),
    0 2px 6px rgba(15, 23, 42, 0.06);
}

.editable-draft-suggestion-change-region {
  position: relative;

  display: block;

  margin: 4px 0;
  padding-top: 46px;

  white-space: pre-wrap;
}

.editable-draft-suggestion-change-region-inline {
  position: relative;

  display: inline-block;

  padding-top: 42px;

  white-space: pre-wrap;
  vertical-align: baseline;
}

.editable-draft-suggestion-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 64px;
  height: 32px;
  padding: 0 12px;

  border-radius: 10px;

  font-size: 13px;
  font-weight: 500;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.editable-draft-suggestion-button-secondary {
  border: none;
  background: transparent;
  color: #111827;
}

.editable-draft-suggestion-button-secondary:hover {
  background: #f8fafc;
}

.editable-draft-suggestion-button-primary {
  border: none;
  background: #2186f3;
  color: #ffffff;
}

.editable-draft-suggestion-button-primary:hover {
  background: #1677ee;
}

.editable-draft-suggestion-deleted-inline {
  color: #8b929c;
  text-decoration-line: line-through;
  text-decoration-color: #ef4444;
  text-decoration-thickness: 2px;
  white-space: pre-wrap;
}

.editable-draft-suggestion-deleted-block {
  color: #8b929c;
  text-decoration-line: line-through;
  text-decoration-color: #ef4444;
  text-decoration-thickness: 2px;
  white-space: pre-wrap;
}

.editable-draft-suggestion-inserted-block {
  display: block;

  margin: 6px 0 8px 0;
  padding: 12px 14px;

  border-radius: 0;
  background: #e9f3ff;

  color: #0b74f1;

  white-space: pre-wrap;
}

.editable-draft-suggestion-inserted-near-selection {
  margin-top: 6px;
  margin-bottom: 6px;
}

.editable-draft-suggestion-inserted-inline {
  display: inline;

  margin-left: 4px;
  padding: 1px 3px;

  border-radius: 4px;
  background: #e9f3ff;

  color: #0b74f1;

  white-space: pre-wrap;
}

.editable-draft-suggestion-button-secondary {
  border: none;
  background: transparent;
  color: #111827;
}

.editable-draft-suggestion-button-secondary:hover {
  background: #f8fafc;
}

.editable-draft-suggestion-button-primary {
  border: none;
  background: #2186f3;
  color: #ffffff;
}

.editable-draft-suggestion-button-primary:hover {
  background: #1677ee;
}

.editable-draft-floating-toolbar {
  position: fixed;
  z-index: 2147483647;
  display: flex;
  align-items: center;
  gap: 4px;

  transform: translateX(-50%);

  background: #ffffff !important;
  background-color: #ffffff !important;
  opacity: 1 !important;

  border: 1px solid #e5e7eb;
  border-radius: 16px;

  padding: 6px 8px;

  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.14),
    0 2px 8px rgba(0, 0, 0, 0.08);

  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.editable-draft-floating-toolbar * {
  opacity: 1 !important;
}

.editable-draft-floating-button {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 32px;
  height: 32px;

  border: none;
  border-radius: 8px;

  background: #ffffff !important;
  color: #111827;

  cursor: pointer;
}

.editable-draft-floating-button:hover {
  background: #f3f4f6 !important;
}

.citation-source-feedback-popover {
  background-color: #ffffff !important;
  opacity: 1 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.editable-draft-frozen-selection-highlight {
  background: #bfdbfe;
  color: inherit;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.editable-draft-stop-button {
  position: relative;

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 9999px;

  background: #111827 !important;
  color: #ffffff;

  cursor: pointer;
}

.editable-draft-stop-button::before {
  content: "";
  position: absolute;

  width: calc(100% - 2px);
  height: calc(100% - 2px);

  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;

  animation: editable-draft-spin 0.8s linear infinite;
}

.editable-draft-stop-button-square {
  width: 8px;
  height: 8px;

  border-radius: 2px;
  background: #ffffff;

  z-index: 1;
}

@keyframes editable-draft-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}
.editable-draft-edit-action-button {
  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 9999px;
  cursor: pointer;

  padding: 0;
  flex-shrink: 0;

  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
}

.editable-draft-edit-action-button-sm {
  width: 28px;
  height: 28px;
}

.editable-draft-edit-action-button-md {
  width: 32px;
  height: 32px;
}

.editable-draft-edit-action-icon-sm {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

.editable-draft-edit-action-icon-md {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.editable-draft-edit-action-button-close {
  border: 1px solid #e5e7eb;
  background: #ffffff !important;
  color: #6b7280 !important;
}

.editable-draft-edit-action-button-close:hover {
  background: #f9fafb !important;
  color: #374151 !important;
}

.editable-draft-edit-action-button-submit {
  border: none;
  background: #111827 !important;
  color: #ffffff !important;
}

.editable-draft-edit-action-button-submit:hover {
  background: #1f2937 !important;
  color: #ffffff !important;
}

.editable-draft-edit-action-button-submit svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.editable-draft-edit-action-button-close svg {
  color: currentColor !important;
  stroke: currentColor !important;
}

.editable-draft-edit-action-button-running {
  position: relative;
  border: none;
  background: #111827 !important;
  color: #ffffff !important;
}

.editable-draft-edit-action-button-running::before {
  content: "";
  position: absolute;

  width: calc(100% - 2px);
  height: calc(100% - 2px);

  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;

  animation: editable-draft-spin 0.8s linear infinite;
}

.editable-draft-stop-button-square {
  width: 8px;
  height: 8px;

  border-radius: 2px;
  background: #ffffff;

  z-index: 1;
}
