/* Global rich text entry support for Screen LMS.
   Upgrades visible textarea controls without external editor/CDN dependencies. */
.screen-rich-editor-wrap{border:1px solid #cbd5e1;border-radius:14px;background:#fff;margin:6px 0 12px;box-shadow:0 1px 2px rgba(15,23,42,.04);overflow:hidden;max-width:100%}
.screen-rich-editor-wrap:focus-within{border-color:var(--accent,#2563eb);box-shadow:0 0 0 3px rgba(37,99,235,.12)}
.screen-rich-toolbar{display:flex;flex-wrap:wrap;gap:4px;align-items:center;padding:7px;background:#f8fafc;border-bottom:1px solid #e2e8f0}
.screen-rich-toolbar button,.screen-rich-toolbar select{border:1px solid #cbd5e1;background:#fff;color:#0f172a;border-radius:8px;min-height:32px;padding:5px 8px;font:inherit;font-size:.88rem;line-height:1;cursor:pointer}
.screen-rich-toolbar button:hover,.screen-rich-toolbar select:hover{background:#eef2ff;border-color:#93c5fd}
.screen-rich-toolbar button:disabled,.screen-rich-toolbar select:disabled{opacity:.55;cursor:not-allowed}
.screen-rich-toolbar .screen-rich-sep{width:1px;height:24px;background:#cbd5e1;margin:0 2px}
.screen-rich-editor{min-height:126px;padding:12px 14px;outline:none;overflow:auto;line-height:1.55;color:#0f172a;word-break:break-word;background:#fff}
.screen-rich-editor[data-placeholder]:empty:before{content:attr(data-placeholder);color:#94a3b8;pointer-events:none}
.screen-rich-editor p{margin:.35rem 0 .7rem}.screen-rich-editor ul,.screen-rich-editor ol{margin:.35rem 0 .7rem 1.25rem}.screen-rich-editor blockquote{margin:.55rem 0;padding:.55rem .85rem;border-left:4px solid #bfdbfe;background:#eff6ff;border-radius:0 10px 10px 0}.screen-rich-editor pre{white-space:pre-wrap;overflow:auto;background:#0f172a;color:#e2e8f0;border-radius:12px;padding:12px;margin:.7rem 0;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:.92rem}.screen-rich-editor code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:6px;padding:.08rem .25rem}.screen-rich-editor pre code{background:transparent;border:0;padding:0;color:inherit}.screen-rich-editor h2,.screen-rich-editor h3{margin:.6rem 0 .45rem;line-height:1.25}.screen-rich-editor a{color:var(--accent,#2563eb);text-decoration:underline}.screen-rich-editor table{border-collapse:collapse;max-width:100%;margin:.7rem 0}.screen-rich-editor th,.screen-rich-editor td{border:1px solid #cbd5e1;padding:6px 8px}.screen-rich-editor th{background:#f8fafc}.screen-equation{display:inline-block;font-family:"Cambria Math","STIX Two Math","Times New Roman",serif;background:#f8fafc;border:1px solid #cbd5e1;border-radius:8px;padding:.08rem .4rem;margin:0 .08rem;white-space:pre-wrap;line-height:1.35}.screen-equation.block{display:block;margin:.55rem 0;padding:.65rem .8rem;text-align:center;font-size:1.08em}.screen-equation-frac{display:inline-grid;grid-template-rows:auto auto;vertical-align:middle;text-align:center;margin:0 .12rem;line-height:1.12}.screen-equation-num{border-bottom:1px solid currentColor;padding:0 .22rem}.screen-equation-den{padding:0 .22rem}.screen-equation-root{display:inline-flex;align-items:stretch;vertical-align:middle}.screen-equation-radical{font-size:1.18em;line-height:1}.screen-equation-root-body{border-top:1px solid currentColor;padding:.02rem .18rem 0}.screen-rich-help{display:flex;flex-wrap:wrap;gap:6px;align-items:center;justify-content:space-between;padding:6px 10px;border-top:1px solid #e2e8f0;background:#f8fafc;color:#64748b;font-size:.82rem}.screen-rich-mode-badge{font-weight:700;color:#334155}.screen-rich-source{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}.screen-rich-plain .screen-rich-editor{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;white-space:pre-wrap;word-break:normal;overflow:auto;background:#0f172a;color:#e2e8f0;tab-size:4}.screen-rich-plain .screen-rich-editor:empty:before{color:#94a3b8}.screen-rich-plain .screen-rich-help{background:#111827;color:#cbd5e1}.screen-rich-plain .screen-rich-mode-badge{color:#e2e8f0}.rich-text-content{line-height:1.6;overflow-wrap:anywhere}.rich-text-content p{margin:.35rem 0 .75rem}.rich-text-content ul,.rich-text-content ol{margin:.35rem 0 .75rem 1.4rem}.rich-text-content blockquote{margin:.55rem 0;padding:.55rem .85rem;border-left:4px solid #bfdbfe;background:#eff6ff;border-radius:0 10px 10px 0}.rich-text-content pre{white-space:pre-wrap;overflow:auto;background:#0f172a;color:#e2e8f0;border-radius:12px;padding:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:.92rem}.rich-text-content code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;background:#f1f5f9;border:1px solid #e2e8f0;border-radius:6px;padding:.08rem .25rem}.rich-text-content pre code{background:transparent;border:0;padding:0;color:inherit}.rich-text-content table{border-collapse:collapse;max-width:100%;margin:.7rem 0}.rich-text-content th,.rich-text-content td{border:1px solid #cbd5e1;padding:6px 8px}.rich-text-content th{background:#f8fafc}@media(max-width:760px){.screen-rich-toolbar{gap:3px}.screen-rich-toolbar button,.screen-rich-toolbar select{font-size:.82rem;padding:5px 7px}.screen-rich-editor{min-height:150px;font-size:16px}}


/* 2026-06-03 optional rich text mode controls */
.screen-rich-mode-toggle{border:1px solid #cbd5e1;background:#fff;color:#334155;border-radius:8px;min-height:30px;padding:4px 8px;font:inherit;font-size:.82rem;line-height:1;cursor:pointer}.screen-rich-mode-toggle:hover{background:#eef2ff;border-color:#93c5fd;color:#1d4ed8}.screen-rich-return-row{display:flex;justify-content:flex-end;margin:4px 0 2px}.screen-rich-return-row[hidden]{display:none!important}.screen-rich-source-visible{position:static!important;left:auto!important;width:100%!important;min-height:130px!important;opacity:1!important;pointer-events:auto!important;display:block!important;margin:8px 0 12px!important;font-family:inherit!important;white-space:pre-wrap!important}

/* 2026-06-03 plain-text default for optional rich text fields */
.screen-rich-default-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin:4px 0 12px;
  padding:8px 10px;
  border:1px solid #e2e8f0;
  border-radius:10px;
  background:#f8fafc;
  color:#64748b;
  font-size:.84rem;
}
.screen-rich-default-row[hidden]{display:none!important;}
.screen-rich-default-row .screen-rich-mode-toggle{white-space:nowrap;}
@media(max-width:720px){.screen-rich-default-row{align-items:flex-start;flex-direction:column}.screen-rich-default-row .screen-rich-mode-toggle{width:100%;}}


/* 2026-06-06 richer editor controls and pop-out mode */
body.screen-rich-fullscreen-active{overflow:hidden!important;}
.screen-rich-editor-wrap.screen-rich-fullscreen{position:fixed!important;z-index:10000;inset:24px!important;margin:0!important;display:flex!important;flex-direction:column!important;max-width:none!important;border-radius:20px!important;box-shadow:0 30px 90px rgba(15,23,42,.35)!important;background:#fff!important;}
.screen-rich-fullscreen .screen-rich-toolbar{position:sticky;top:0;z-index:2;padding:10px 12px;}
.screen-rich-fullscreen .screen-rich-editor{flex:1;min-height:0!important;font-size:1.02rem;padding:18px 22px;}
.screen-rich-fullscreen .screen-rich-help{position:sticky;bottom:0;}
.screen-rich-fullscreen:before{content:'Expanded rich text editor';display:block;padding:12px 16px;border-bottom:1px solid #e2e8f0;font-weight:900;color:#0f172a;background:#f8fafc;}
.screen-rich-toolbar [data-rich-action="fullscreen"]{font-weight:800;background:#eff6ff;border-color:#93c5fd;color:#1d4ed8;}
@media(max-width:760px){.screen-rich-editor-wrap.screen-rich-fullscreen{inset:8px!important;border-radius:14px!important}.screen-rich-fullscreen .screen-rich-editor{padding:14px 16px}}
