/* Extra tools for the existing contract HTML editor only. Does not affect other forms. */
.agp-contract-editor-extras{display:flex;flex-wrap:wrap;align-items:end;gap:7px;background:#101827;border-bottom:1px solid #334155;padding:10px;color:#e2e8f0;position:relative;z-index:2}
.agp-rich-select-label,.agp-rich-color-label{display:flex;flex-direction:column;gap:3px;font-size:11px;font-weight:600;color:#cbd5e1}
.agp-rich-select{background:#020617;border:1px solid #475569;border-radius:7px;color:#f1f5f9;padding:6px 7px;max-width:156px;font-size:12px;min-height:34px}
.agp-rich-color-label input{height:34px;width:53px;background:transparent;border:1px solid #475569;border-radius:7px;cursor:pointer}
.agp-rich-btn{border:1px solid #475569;background:#1e293b;color:#f1f5f9;min-height:34px;padding:6px 9px;border-radius:7px;font-size:12px;font-weight:600;cursor:pointer}
.agp-rich-btn:hover,.agp-rich-btn:focus-visible{background:#334155;outline:2px solid #f59e0b;outline-offset:1px}
.agp-rich-fields-panel{background:#111827;border-bottom:1px solid #475569;padding:12px;max-height:320px;overflow:auto;color:#fff}
.agp-rich-fields-panel[hidden]{display:none}
.agp-rich-panel-header{font-size:13px;font-weight:700;margin-bottom:8px}
.agp-rich-field-search{display:block;background:#020617;border:1px solid #64748b;border-radius:8px;color:white;width:100%;padding:8px;margin-bottom:8px;font-size:13px}
.agp-rich-fields-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(215px,1fr));gap:5px;max-height:190px;overflow:auto}
.agp-rich-field{min-width:0;text-align:left;overflow-wrap:anywhere;font-family:inherit;cursor:grab}
/* Tailwind preflight resets native bullet styles; restore them only inside the rich editor and contract preview. */
[contenteditable="true"][data-placeholder] ul{list-style-type:disc;padding-left:2rem;margin:.5em 0}
[contenteditable="true"][data-placeholder] ol{list-style-type:decimal;padding-left:2rem;margin:.5em 0}
[contenteditable="true"][data-placeholder] ul[style*="circle"]{list-style-type:circle}
[contenteditable="true"][data-placeholder] ul[style*="square"]{list-style-type:square}
[contenteditable="true"][data-placeholder] ol[style*="roman"]{list-style-type:lower-roman}
[contenteditable="true"][data-placeholder] li{display:list-item;margin:.15em 0}
@media(max-width:640px){.agp-contract-editor-extras{gap:6px;padding:8px}.agp-rich-select{max-width:115px}.agp-rich-fields-list{grid-template-columns:1fr}}

/* Desktop: field panel sits beside the contract, not on top of its text. */
@media(min-width:901px){
 .agp-editor-has-fields{display:grid!important;grid-template-columns:minmax(0,1fr) 285px;grid-template-rows:auto auto minmax(200px,1fr);align-items:stretch}
 .agp-editor-has-fields > :first-child,.agp-editor-has-fields > .agp-contract-editor-extras{grid-column:1/-1}
 .agp-editor-has-fields > .agp-rich-fields-panel{grid-column:2;grid-row:3;border-left:1px solid #475569;border-bottom:0;max-height:520px}
 .agp-editor-has-fields > [contenteditable="true"]{grid-column:1;grid-row:3;min-width:0}
}
