
/* Shared text controls for questions, lessons, assignments and open answers. */
.rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) { display:flex; align-items:center; flex-wrap:wrap; gap:6px; padding:10px; background:var(--ui-surface-alt); border-bottom:1px solid var(--ui-border); }
.rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) button { min-width:40px; width:auto; height:40px; padding:0 9px; border:1px solid var(--ui-control-border); border-radius:6px; display:inline-flex; align-items:center; justify-content:center; gap:6px; background:var(--ui-input-bg); color:var(--ui-text); box-shadow:none; }
.rich-editor-toolbar button svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.8; }
.rich-editor-toolbar button i { font-size:22px; }
.rich-editor-toolbar button[aria-pressed="true"], .ql-toolbar.ql-snow button.ql-active { background:var(--ui-accent-soft); color:var(--ui-accent); border:1px solid var(--ui-accent); box-shadow:inset 0 0 0 1px var(--ui-accent); }
.rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) button:hover { background:var(--ui-accent-soft); color:var(--ui-accent); }
.rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) select { height:40px; width:auto; max-width:100%; flex:0 1 auto; margin:0; padding:5px 28px 5px 10px; border:1px solid var(--ui-control-border); border-radius:6px; background:var(--ui-input-bg); color:var(--ui-text); font-size:14px; }
.rich-editor-toolbar :is(button,select):focus-visible { outline:2px solid var(--ui-accent); outline-offset:2px; }
:is(.lesson-layout-editor,.student-open-answer-input).rich-editor-surface { border:1px solid var(--ui-control-border); background:var(--ui-input-bg); color:var(--ui-text); padding:16px; min-height:180px; line-height:1.6; }
.rich-editor-surface:focus { border-color:var(--ui-accent); outline:1px solid var(--ui-accent); outline-offset:-1px; }
.rich-editor-insert-dialog { width:min(520px,calc(100vw - 24px)); max-height:85dvh; overflow:auto; padding:22px; border:1px solid var(--ui-control-border); border-radius:8px; background:var(--ui-surface); color:var(--ui-text); }
.rich-editor-insert-dialog::backdrop { background:rgba(0,0,0,.55); }
.rich-editor-insert-dialog form { display:grid; gap:14px; }
.rich-editor-insert-dialog h3,.rich-editor-insert-dialog p { margin:0; }
.rich-editor-insert-dialog p,.rich-editor-insert-dialog small { color:var(--ui-text-muted); }
.rich-editor-insert-dialog label { display:grid; gap:6px; }
.rich-editor-insert-dialog :is(input:not([type=checkbox]),math-field) { box-sizing:border-box; width:100%; padding:10px; border:1px solid var(--ui-control-border); border-radius:6px; background:var(--ui-input-bg); color:var(--ui-text); }
.rich-editor-insert-dialog footer { display:flex; justify-content:flex-end; gap:10px; }
.homework-feedback-editor [data-feedback-existing-video] { margin-top:12px; }
.homework-feedback-editor [data-feedback-existing-video][hidden] { display:none; }
.homework-feedback-editor [data-feedback-existing-video] :is(video,iframe) { width:100%; max-width:640px; }
.homework-feedback-video-player video { width:100%; max-height:480px; }
.standalone-homework-mode-hint { margin:8px 0 16px; color:var(--ui-text-muted); }
@media(max-width:760px) { .rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) { padding:8px; gap:5px; } .rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) select { flex:1 1 120px; min-width:0; } }

/* Toolbar controls keep their compact layout inside legacy full-width forms. */
.rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) select { width:auto !important; min-width:100px; max-width:220px; min-height:44px; height:44px; flex:0 1 auto; font-size:14px; }
.rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) button { min-width:44px; min-height:44px; height:44px; flex:0 0 auto; cursor:pointer; }
@media(max-width:760px) { .rich-editor-toolbar:is(.lesson-layout-toolbar,.student-open-answer-toolbar) select { flex:1 1 120px; min-width:0; max-width:100%; font-size:16px; } }
