.ql-toolbar.ql-snow {
  /* Editor (Quill) */
  background: #fff;
  border: 1px solid #ddd;
  box-sizing: border-box;
  max-width: 100%;
  padding: 6px 8px !important;
}
.ql-container.ql-snow {
  border: 1px solid #ddd;
  box-sizing: border-box;
  max-width: 100%;
}
.ql-formats button {
  outline: none;
}

/* Toolbar group separators */
.ql-toolbar .ql-formats {
  margin-right: 6px;
  padding-right: 6px;
  position: relative;
}

.ql-toolbar .ql-formats:not(:last-of-type)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 20px;
  background: #ddd;
}

body.dark .ql-toolbar .ql-formats:not(:last-of-type)::after {
  background: #404040;
}

/* Toolbar button tooltips */
.ql-toolbar button[data-tooltip]::before,
.ql-toolbar .ql-picker[data-tooltip]::before,
.focus-mode-toggle[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.ql-toolbar button[data-tooltip]:hover::before,
.ql-toolbar .ql-picker[data-tooltip]:hover::before,
.focus-mode-toggle[data-tooltip]:hover::before {
  opacity: 1;
}

/* Tooltip arrow */
.ql-toolbar button[data-tooltip]::after,
.ql-toolbar .ql-picker[data-tooltip]::after,
.focus-mode-toggle[data-tooltip]::after {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(0, 0, 0, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10000;
}

.ql-toolbar button[data-tooltip]:hover::after,
.ql-toolbar .ql-picker[data-tooltip]:hover::after,
.focus-mode-toggle[data-tooltip]:hover::after {
  opacity: 1;
}

/* Modern toolbar icon styling (matches focus mode floating toolbar) */
.ql-toolbar .ql-formats button,
.ql-toolbar.ql-snow .ql-formats button {
  background: transparent;
  border: none;
  border-radius: var(--toolbar-icon-radius);
  width: 32px;
  height: 32px;
  margin: 0 1px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--toolbar-icon-color);
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
  outline: none;
}

.ql-toolbar .ql-formats button svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.ql-toolbar .ql-formats button .ql-stroke {
  stroke: currentColor !important;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ql-toolbar .ql-formats button .ql-fill,
.ql-toolbar .ql-formats button .ql-even {
  fill: currentColor !important;
  stroke: none;
}

.ql-toolbar .ql-formats button .ql-thin {
  stroke-width: 1;
}

/* Ensure stroke-miter elements also inherit color */
.ql-toolbar .ql-formats button .ql-stroke-miter {
  stroke: currentColor !important;
  fill: none;
}

/* Ensure list buttons (bullet/ordered) display correctly */
.ql-toolbar .ql-formats button.ql-list svg,
.ql-toolbar.ql-snow .ql-formats button.ql-list svg {
  width: 18px;
  height: 18px;
}

.ql-toolbar .ql-formats button.ql-list .ql-stroke,
.ql-toolbar.ql-snow .ql-formats button.ql-list .ql-stroke {
  stroke: currentColor !important;
}

.ql-toolbar .ql-formats button.ql-list .ql-fill,
.ql-toolbar.ql-snow .ql-formats button.ql-list .ql-fill {
  fill: currentColor !important;
}

/* Prevent Quill from hiding/showing different SVG elements on active state */
.ql-toolbar .ql-formats button.ql-list svg,
.ql-toolbar.ql-snow .ql-formats button.ql-list svg {
  display: inline !important;
}

.ql-toolbar .ql-formats button.ql-list.ql-active svg:last-child,
.ql-toolbar.ql-snow .ql-formats button.ql-list.ql-active svg:last-child {
  display: none !important;
}

.ql-toolbar .ql-formats button.ql-list.ql-active svg:first-child,
.ql-toolbar.ql-snow .ql-formats button.ql-list.ql-active svg:first-child {
  display: inline !important;
}

.ql-toolbar .ql-formats button i {
  color: currentColor;
  font-size: 17px;
  line-height: 1;
  pointer-events: none;
}

.ql-toolbar .ql-formats button:hover,
.ql-toolbar.ql-snow .ql-formats button:hover {
  background: #f0f0f0 !important;
  color: var(--toolbar-icon-hover-color) !important;
  transform: none;
}

/* Override Quill default blue hover for SVG icons */
.ql-toolbar .ql-formats button:hover .ql-stroke,
.ql-toolbar.ql-snow .ql-formats button:hover .ql-stroke {
  stroke: var(--toolbar-icon-hover-color) !important;
}

.ql-toolbar .ql-formats button:hover .ql-fill,
.ql-toolbar.ql-snow .ql-formats button:hover .ql-fill {
  fill: var(--toolbar-icon-hover-color) !important;
}

.ql-toolbar .ql-formats button:focus,
.ql-toolbar .ql-formats button:focus-visible,
.ql-toolbar.ql-snow .ql-formats button:focus,
.ql-toolbar.ql-snow .ql-formats button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--toolbar-icon-focus-ring);
}

.ql-toolbar .ql-formats button.ql-active,
.ql-toolbar.ql-snow .ql-formats button.ql-active {
  background: var(--toolbar-icon-active-bg) !important;
  color: var(--toolbar-icon-active-color) !important;
  box-shadow: var(--toolbar-icon-active-shadow) !important;
}

/* Override Quill default blue active for SVG icons */
.ql-toolbar .ql-formats button.ql-active .ql-stroke,
.ql-toolbar.ql-snow .ql-formats button.ql-active .ql-stroke {
  stroke: var(--toolbar-icon-active-color) !important;
  stroke-width: 2.1;
}

.ql-toolbar .ql-formats button.ql-active .ql-fill,
.ql-toolbar.ql-snow .ql-formats button.ql-active .ql-fill {
  fill: var(--toolbar-icon-active-color) !important;
}

/* Match Quill pickers to toolbar styling */
.ql-toolbar.ql-snow .ql-picker-label,
.ql-toolbar.ql-snow .ql-picker-item {
  color: var(--toolbar-icon-color) !important;
}

.ql-toolbar.ql-snow .ql-picker-label:hover,
.ql-toolbar.ql-snow .ql-picker-label.ql-active,
.ql-toolbar.ql-snow .ql-picker-item:hover,
.ql-toolbar.ql-snow .ql-picker-item.ql-selected {
  color: var(--toolbar-icon-hover-color) !important;
}

/* Override Quill default blue for picker SVG icons */
.ql-toolbar.ql-snow .ql-picker-label .ql-stroke,
.ql-toolbar.ql-snow .ql-picker-label .ql-stroke-miter {
  stroke: currentColor !important;
}

.ql-toolbar.ql-snow .ql-picker-label .ql-fill {
  fill: currentColor !important;
}

.ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke,
.ql-toolbar.ql-snow .ql-picker-label:hover .ql-stroke-miter {
  stroke: var(--toolbar-icon-hover-color) !important;
}

.ql-toolbar.ql-snow .ql-picker-label:hover .ql-fill {
  fill: var(--toolbar-icon-hover-color) !important;
}

.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-options {
  border-color: var(--toolbar-picker-border);
  box-shadow: var(--toolbar-picker-shadow);
}

.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label,
.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-item:hover {
  color: var(--toolbar-icon-hover-color) !important;
}

.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke,
.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-stroke-miter {
  stroke: var(--toolbar-icon-hover-color) !important;
}

.ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label .ql-fill {
  fill: var(--toolbar-icon-hover-color) !important;
}
.alertify-notifier .ajs-message.ajs-error {
  font-size: 11px;
  border: 0;
  text-shadow: none;
}
.alertify-notifier .ajs-message.ajs-success {
  font-size: 11px;
  border: 0;
  text-shadow: none;
}

/* Improved bullet points for unordered lists */
.ql-editor ul > li::before {
  font-size: 1.3em;
  font-weight: bold;
}

.ql-editor li:not(.ql-direction-rtl)::before {
  margin-right: 0.6em !important;
}

