/* Dedicated LaTeX authoring UI. Loaded from the same origin under the existing CSP. */
.madar-formula-editor.madar-latex-editor{grid-template-columns:minmax(0,1fr) minmax(250px,340px);align-items:start}
 .madar-formula-editor.madar-latex-editor>label{min-width:0}
 .madar-latex-panel{box-sizing:border-box;display:grid;gap:10px;min-width:0;max-width:100%;padding:14px;border:1px solid #d4deea;border-radius:12px;background:#f8fbff}
 .madar-latex-panel strong{font-weight:700}
 .madar-latex-groups{max-height:300px;overflow:auto;display:grid;gap:10px;overscroll-behavior:contain}
 .madar-latex-group{border:1px solid #dae3ed;border-radius:8px;padding:7px;min-width:0}
 .madar-latex-group legend{font-weight:600;padding-inline:5px}
 .madar-latex-tools{display:flex;flex-wrap:wrap;gap:5px}
 .madar-latex-tools button{font:inherit;font-size:14px;min-width:36px;min-height:34px;border:1px solid #b7c7d9;background:white;border-radius:6px;cursor:pointer;padding:4px 7px}
 .madar-latex-tools button:hover,.madar-latex-tools button:focus-visible{border-color:#3166aa;background:#e6f1ff}
 .madar-latex-panel small{line-height:1.65}
 .madar-paper-preview{box-sizing:border-box;min-height:130px;max-height:360px;overflow:auto;white-space:pre-wrap;overflow-wrap:anywhere;direction:auto;border:1px solid #dae3ed;border-radius:8px;padding:12px;background:white;line-height:1.9}
 @media(max-width:860px){.madar-formula-editor.madar-latex-editor{grid-template-columns:minmax(0,1fr)}.madar-latex-groups{max-height:240px}}
