/* Shared Quill editor styles */
.quill-editor-wrapper {
  --quill-base-min-height: 120px;
  position: relative;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  display: block;
  margin-top: .5rem;
}
.label-summer:has([data-quill-editor-wrapper]) > [data-quill-editor-wrapper] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.label-summer:has([data-quill-editor-wrapper]) {
  position: relative;
}
.label-summer:has([data-quill-editor-wrapper]) > label.form-label.summer {
  position: absolute;
  top: 10px;
  left: 5px;
  right: auto;
  margin: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.92);
  padding: 0 6px;
  border-radius: 4px;
  transition: top .18s ease;
}
.label-summer.quill-toolbar-visible > label.form-label.summer {
  top: calc(var(--quill-toolbar-height, 40px) + 8px);
}
.label-summer:has([data-quill-editor-wrapper]) .quill-editor-wrapper .ql-editor {
  padding-top: 16px;
}
.label-summer:has([data-quill-editor-wrapper]) .quill-editor-wrapper.quill-focus .ql-editor,
.label-summer:has([data-quill-editor-wrapper]) .quill-editor-wrapper.quill-code .ql-editor {
  /* padding-top géré dynamiquement par syncToolbarPadding() */
}
.label-summer:has([data-quill-editor-wrapper]) .quill-editor-wrapper .quill-code-view {
  padding-top: 24px;
}

.quill-editor-wrapper .ql-editor {
  min-height: var(--quill-base-min-height, 120px);
  font-size: 14px;
  line-height: 1.6;
  transition: padding-top .15s ease;
}
.quill-editor-wrapper .ql-editor ::selection {
  background: rgba(13, 110, 253, 0.18);
  color: inherit;
}
.quill-editor-wrapper .ql-editor ::-moz-selection {
  background: rgba(13, 110, 253, 0.18);
  color: inherit;
}
.quill-editor-wrapper .ql-toolbar.ql-snow {
  border-radius: 6px 6px 0 0;
  background: #fff;
  border-bottom: 1px solid #ccc;
}
.quill-editor-wrapper .ql-container.ql-snow {
  border-radius: 6px;
  border-top: 1px solid #ccc !important;
  min-height: var(--quill-base-min-height, 120px);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.quill-editor-wrapper .quill-code-view {
  display: none;
  width: 100%;
  min-height: var(--quill-base-min-height, 120px);
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 6px 6px;
  padding: 12px;
  background: #1e1e1e;
  color: #d4d4d4;
  tab-size: 4;
  resize: vertical;
}
.quill-editor-wrapper .quill-code-view:focus {
  outline: 2px solid #0d6efd;
  outline-offset: -2px;
}

.quill-editor-wrapper .ql-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  padding: 4px 8px;
  border-bottom: 1px solid #ccc;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, visibility .15s ease;
}
.quill-editor-wrapper .ql-toolbar.ql-snow {
  padding: 4px 8px !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.quill-editor-wrapper.quill-focus,
.quill-editor-wrapper.quill-code,
.quill-editor-wrapper.quill-fullscreen {
  overflow: visible;
}
.quill-editor-wrapper.quill-focus .ql-toolbar,
.quill-editor-wrapper.quill-code .ql-toolbar,
.quill-editor-wrapper.quill-fullscreen .ql-toolbar {
  visibility: visible;
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
}
.quill-editor-wrapper.quill-focus .ql-toolbar.ql-snow,
.quill-editor-wrapper.quill-code .ql-toolbar.ql-snow,
.quill-editor-wrapper.quill-fullscreen .ql-toolbar.ql-snow {
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
  pointer-events: auto !important;
}
.quill-editor-wrapper.quill-focus .ql-editor,
.quill-editor-wrapper.quill-code .ql-editor {
  /* padding-top géré dynamiquement par syncToolbarPadding() */
}

.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats button,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats .ql-picker-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-picker-options {
  z-index: 20;
}
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats button .sfs,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats .ql-picker-label .sfs {
  color: #444;
  font-size: 16px;
  line-height: 1;
}
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs,
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs-1,
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs-2,
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs-3,
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs-4,
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs-6,
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs-7,
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs-8,
.quill-editor-wrapper .ql-toolbar.ql-snow i.sfs-9 {
  margin-right: 0;
}
.quill-editor-wrapper .ql-toolbar.ql-snow button:focus,
.quill-editor-wrapper .ql-toolbar.ql-snow button:focus-visible,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-picker-label:focus,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-picker-label:focus-visible {
  outline: none;
  box-shadow: none;
}
.quill-editor-wrapper .ql-snow .ql-picker.ql-expanded .ql-picker-label {
  border-color: transparent;
}
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats button,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats .ql-picker-label {
  padding-left: 5px;
  padding-right: 5px;
  margin-left: 0;
  margin-right: 0;
  border-radius: 3px;
  transition: background-color .12s ease;
}
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats button:hover,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats .ql-picker-label:hover {
  background: #eee;
}
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats button:hover .sfs,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats button.ql-active .sfs,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats .ql-picker-label:hover .sfs {
  color: #06c;
}

.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats {
  margin-right: 3px;
}
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-formats + .ql-formats {
  border-left: 1px solid rgba(81, 89, 108, 0.28);
  margin-left: 3px;
  padding-left: 4px;
}

.quill-editor-wrapper .ql-toolbar .ql-header .ql-picker-label::before {
  content: none !important;
}
.quill-editor-wrapper .ql-toolbar .ql-header .ql-picker-label .ql-header-icon {
  margin-right: 6px;
  font-size: 14px;
  line-height: 1;
  color: #444;
}
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-header.ql-picker .ql-picker-label,
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-header.ql-picker.ql-expanded .ql-picker-label {
  justify-content: flex-start;
  text-align: left;
}
.quill-editor-wrapper .ql-toolbar.ql-snow .ql-header.ql-picker .ql-picker-item {
  text-align: left;
}
.quill-editor-wrapper .ql-toolbar .ql-header .ql-picker-label .ql-header-text {
  font-size: 13px;
  color: #444;
}

/* Resize image overlay au-dessus de la toolbar */
#editor-resizer {
  z-index: 10;
}

.quill-editor-wrapper .ql-snow .ql-tooltip::before { content: "Lien : "; }
.quill-editor-wrapper .ql-snow .ql-tooltip a.ql-action::after { content: "Modifier"; }
.quill-editor-wrapper .ql-snow .ql-tooltip a.ql-remove::before { content: "Supprimer"; }
.quill-editor-wrapper .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: "Enregistrer"; }
.quill-editor-wrapper .ql-snow .ql-tooltip[data-mode="link"]::before { content: "Lien :"; }
.quill-editor-wrapper .ql-snow .ql-tooltip[data-mode="video"]::before { content: "Vidéo :"; }
.quill-editor-wrapper .ql-snow .ql-tooltip[data-mode="formula"]::before { content: "Formule :"; }

.quill-editor-wrapper .ql-toolbar .ql-code-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  padding: 0;
  cursor: pointer;
  color: #444;
  border: none;
  background: none;
}
.quill-editor-wrapper .ql-toolbar .ql-code-toggle:hover {
  color: #06c;
}
.quill-editor-wrapper .ql-toolbar .ql-code-toggle.active {
  background: #eee;
  border-radius: .1rem;
}
.quill-editor-wrapper .ql-toolbar .ql-fullscreen {
  padding: 3px 6px;
  cursor: pointer;
}
.quill-editor-wrapper .ql-toolbar .ql-more-toggle {
  display: none;
  padding: 3px 6px;
  cursor: pointer;
  opacity: .5;
}

.quill-editor-wrapper.quill-fullscreen {
  position: fixed !important;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.quill-editor-wrapper.quill-fullscreen .ql-toolbar {
  border-radius: 0;
  flex-shrink: 0;
}
.quill-editor-wrapper.quill-fullscreen .ql-container {
  border-radius: 0;
  flex: 1;
  overflow-y: auto;
}
.quill-editor-wrapper.quill-fullscreen .quill-code-view {
  border-radius: 0;
  flex: 1;
}

.quill-editor-wrapper.quill-compact .ql-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  row-gap: 4px;
}
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-formats { margin-bottom: 0; }
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-formats.compact-optional { display: none; }
.quill-editor-wrapper.quill-compact.quill-compact-open .ql-toolbar .ql-formats.compact-optional { display: inline-block; }
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-more-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-code-toggle,
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-video,
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-media-insert,
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-ai-generate { display: none; }
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-header.ql-picker { width: auto; }
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-header .ql-picker-label {
  justify-content: center;
  padding-left: 5px;
  padding-right: 5px;
}
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-header .ql-picker-label .ql-header-text,
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-header .ql-picker-label svg { display: none; }
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-link,
.quill-editor-wrapper.quill-compact .ql-toolbar .ql-video { display: none; }

.quill-demo-section { margin-bottom: 2rem; }
.quill-demo-section h6 { margin: 1.5rem 0 .75rem; }
.quill-output-html {
  width: 100%;
  min-height: 100px;
  font-family: monospace;
  font-size: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  background: #1e1e1e;
  color: #d4d4d4;
}
.quill-output-delta {
  width: 100%;
  min-height: 80px;
  font-family: monospace;
  font-size: 11px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  background: #f5f5f5;
  color: #333;
}
