/* After Quill binds, hide the real textarea (global forms.css targets textarea). */
textarea.note-quill-textarea.matrix-quill-bound,
textarea.feedback-quill-textarea.matrix-quill-bound,
textarea.agreement-quill-textarea.matrix-quill-bound,
textarea.ContractTerms.matrix-quill-bound,
textarea.email-quill-textarea.matrix-quill-bound,
textarea.newemail.matrix-quill-bound,
textarea.EditSignature.matrix-quill-bound,
textarea.option-richtext-textarea.matrix-quill-bound,
textarea.line-desc-quill-textarea.matrix-quill-bound,
textarea.note-quill-textarea.feedback-quill-bound,
textarea.feedback-quill-textarea.feedback-quill-bound,
textarea.line-desc-quill-textarea.feedback-quill-bound {
    display: none !important;
}

.matrix-quill-wrapper,
.feedback-quill-wrapper {
    border: 1px solid #dcdcdc;
    border-radius: 4px;
    background: #fff;
}

.feedback-rich-text-field {
    width: 100%;
}

.matrix-quill-agreement .matrix-quill-editor,
.matrix-quill-agreement .feedback-quill-editor {
    min-height: 300px;
}

/* Toolbar sits beside .ql-container; Snow theme expects .ql-snow .ql-toolbar (see quill.snow.css). */
.feedback-quill-toolbar {
    border-bottom: 1px solid #dcdcdc;
}

.feedback-quill-editor {
    height: 250px;
    overflow-y: auto;
}

/*
  layout.css has .white-bg li { list-style: disc; } for normal content. That turns the CSS ::marker
  back on for Quill list items while Quill also paints a bullet on li::before — double bullets in the editor.
  Saved HTML is shown outside .ql-editor, so it still looks correct. Kill native markers only here.
*/
.matrix-quill-wrapper.ql-snow .ql-editor li,
.feedback-quill-wrapper.ql-snow .ql-editor li {
    list-style: none !important;
}

/*
  Rich-text OUTPUT — saved Quill HTML rendered read-only, i.e. outside .ql-editor, where Quill's own
  li::before bullets are NOT in play.

  The comment above assumed .white-bg li { list-style: disc } (layout.css) would supply markers for
  saved HTML. That only rescues containers that happen to sit inside .white-bg. The newer .app-card
  pages — Edit Product is one — and several billing surfaces do not, so the global ul reset
  (list-style:none; padding-left:0) silently swallowed every saved bullet. Restore markers explicitly
  here rather than depending on an incidental layout class.

  .rich-text-output is the shared hook for any new render site; the rest are the containers that
  already render sanitised description HTML. Deliberately NOT keyed to a generic utility class.
*/
.rich-text-output ul,
.product-description-readonly ul,
.billing-item-desc-rt ul,
.billing-item-desc ul,
.qr-desc ul,
.po-line-desc ul,
.vph-line-meta ul,
.project-description-richtext ul,
.project-milestone-note-text ul,
.job-description-richtext ul {
    list-style: disc outside;
    padding-left: 1.5em;
    margin: 0 0 0.35em;
}

.rich-text-output ol,
.product-description-readonly ol,
.billing-item-desc-rt ol,
.billing-item-desc ol,
.qr-desc ol,
.po-line-desc ol,
.vph-line-meta ol,
.project-description-richtext ol,
.project-milestone-note-text ol,
.job-description-richtext ol {
    list-style: decimal outside;
    padding-left: 1.5em;
    margin: 0 0 0.35em;
}

.rich-text-output li,
.product-description-readonly li,
.billing-item-desc-rt li,
.billing-item-desc li,
.qr-desc li,
.po-line-desc li,
.vph-line-meta li,
.project-description-richtext li,
.project-milestone-note-text li,
.job-description-richtext li {
    list-style: inherit;
    display: list-item;
}

/*
  Quill Snow uses the same gutter on ul/ol and on li, so indent stacks (~2× per level).
  Outer pulls the whole list toward body text; inner must stay ~1em+ so li::before (~1.2em wide) doesn’t clip.
  ~1em outer+inner total ≈ half of the prior 1em+1em tuning.
*/
.matrix-quill-wrapper.ql-snow .ql-editor,
.feedback-quill-wrapper.ql-snow .ql-editor {
    --fq-list-outer: 0;
    --fq-list-inner: 1em;
}

.matrix-quill-wrapper.ql-snow .ql-editor ol,
.matrix-quill-wrapper.ql-snow .ql-editor ul,
.feedback-quill-wrapper.ql-snow .ql-editor ol,
.feedback-quill-wrapper.ql-snow .ql-editor ul {
    padding-left: var(--fq-list-outer);
}

.matrix-quill-wrapper.ql-snow .ql-editor ol li:not(.ql-direction-rtl),
.matrix-quill-wrapper.ql-snow .ql-editor ul li:not(.ql-direction-rtl),
.feedback-quill-wrapper.ql-snow .ql-editor ol li:not(.ql-direction-rtl),
.feedback-quill-wrapper.ql-snow .ql-editor ul li:not(.ql-direction-rtl) {
    padding-left: var(--fq-list-inner);
}

.matrix-quill-wrapper.ql-snow .ql-editor li:not(.ql-direction-rtl)::before,
.feedback-quill-wrapper.ql-snow .ql-editor li:not(.ql-direction-rtl)::before {
    margin-left: calc(-1 * var(--fq-list-inner));
}

.matrix-quill-wrapper.ql-snow .ql-editor ol li.ql-direction-rtl,
.matrix-quill-wrapper.ql-snow .ql-editor ul li.ql-direction-rtl,
.feedback-quill-wrapper.ql-snow .ql-editor ol li.ql-direction-rtl,
.feedback-quill-wrapper.ql-snow .ql-editor ul li.ql-direction-rtl {
    padding-right: var(--fq-list-inner);
}

.matrix-quill-wrapper.ql-snow .ql-editor li.ql-direction-rtl::before,
.feedback-quill-wrapper.ql-snow .ql-editor li.ql-direction-rtl::before {
    margin-right: calc(-1 * var(--fq-list-inner));
}

/*
  global.css sets * { text-decoration: none }, which hides Quill underline (<u>) and strike (<s>).
  Restore only inside the editor surface so toolbar formatting is visible while typing.
*/
.matrix-quill-wrapper.ql-snow .ql-editor u,
.feedback-quill-wrapper.ql-snow .ql-editor u {
    text-decoration: underline !important;
}

.matrix-quill-wrapper.ql-snow .ql-editor s,
.feedback-quill-wrapper.ql-snow .ql-editor s,
.matrix-quill-wrapper.ql-snow .ql-editor strike,
.feedback-quill-wrapper.ql-snow .ql-editor strike {
    text-decoration: line-through !important;
}

