.science-editor{margin:8px 0 14px;padding:12px;border:1px solid var(--line);border-radius:12px;background:#f7fafc;color:var(--ink)}
.science-editor-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:9px}.science-editor-head strong{font-size:13px}.science-editor-head select{border:1px solid #c8d7e0;border-radius:8px;padding:7px 9px;background:#fff;color:var(--ink);font:inherit}
.science-palette{display:flex;flex-wrap:wrap;gap:7px}.science-palette button,.science-open{border:1px solid #c8d7e0;border-radius:8px;background:#fff;color:#19334f;padding:7px 10px;font:inherit;font-size:12px;font-weight:700}.science-palette button:hover,.science-open:hover{border-color:#1676c2;background:#eef7fc}.science-open{margin-top:8px;background:#e7f2f8;border-color:#b7ccda}.science-preview{min-height:32px;margin-top:9px;padding:8px 10px;border:1px dashed #c8d7e0;border-radius:8px;background:#fff;color:#19334f;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;direction:rtl}.science-preview:empty:before{content:"معاينة الصيغ المنسقة ستظهر هنا.";color:#60768a;font-size:12px}
.science-equation-modal{position:fixed;inset:0;z-index:120;background:#081827c9;display:grid;place-items:center;padding:16px}.science-equation-modal[hidden]{display:none}.science-equation-dialog{width:min(760px,100%);max-height:min(90vh,900px);overflow:auto;background:#fff;color:#19334f;border:1px solid #cbd9e2;border-radius:16px;padding:clamp(16px,3vw,26px);box-shadow:0 20px 70px #0005}.science-equation-dialog h2{margin:0 0 7px;font-size:20px}.science-equation-dialog p{margin:0 0 14px;color:#526a7d;line-height:1.7;font-size:13px}.science-equation-dialog label{display:grid;gap:6px;font-size:13px;font-weight:700;margin:10px 0}.science-equation-dialog select,.science-chem-source{width:100%;border:1px solid #c8d7e0;border-radius:9px;padding:10px 12px;color:#19334f;background:white;font:inherit}.science-chem-source{min-height:90px;direction:ltr;text-align:left;resize:vertical;font-family:Consolas,monospace}.science-math-field{display:block;width:100%;min-height:68px;margin:8px 0;border:1px solid #b9ccd8;border-radius:10px;padding:12px;background:#fff;color:#19334f;font-size:23px;direction:ltr}.science-math-field:focus{outline:3px solid #91d8dc;outline-offset:2px}.science-equation-preview{min-height:58px;margin:12px 0;padding:12px;border:1px dashed #aec4d1;border-radius:10px;background:#f5f8fa;color:#19334f;display:flex;align-items:center;justify-content:center;overflow:auto;direction:ltr}.science-equation-palette{display:flex;flex-wrap:wrap;gap:7px;margin:8px 0}.science-equation-palette button{border:1px solid #c8d7e0;border-radius:8px;background:#f7fafc;color:#19334f;padding:7px 9px;font:inherit;font-size:12px}.science-equation-actions{display:flex;justify-content:flex-end;gap:9px;flex-wrap:wrap;margin-top:15px}.science-equation-actions .btn{min-height:42px}
math-field:not(:defined){visibility:hidden}
@media(max-width:600px){.science-editor{padding:10px}.science-palette button{min-height:40px}.science-equation-modal{padding:8px}.science-equation-dialog{max-height:94vh;padding:15px}.science-equation-actions{display:grid;grid-template-columns:1fr}.science-equation-actions .btn{width:100%}.science-math-field{font-size:20px}}
.transfer-warning{margin:10px 0 0;padding:10px 12px;border:1px solid #e4ba59;border-radius:9px;background:#fff5d9;color:#694a09;font-size:12px;line-height:1.7}

.science-tool-toggle{border:1px solid #c8d7e0;border-radius:8px;background:#fff;color:#19334f;padding:7px 10px;font:inherit;font-size:12px;font-weight:700}
.option+.science-editor{grid-column:1/-1;width:100%;margin:-3px 0 8px;padding:8px;background:#f8fafb}
.option+.science-editor .science-open{margin-top:7px}
.science-editor [hidden]{display:none!important}
@media(max-width:600px){.science-editor-head{align-items:stretch}.science-editor-head select,.science-tool-toggle{min-height:40px;flex:1}.science-palette{max-height:180px;overflow:auto}}
