.ai-md { line-height: 1.75; overflow-wrap: anywhere; }
.ai-md h4 { margin: 12px 0 6px; font-size: 16px; line-height: 1.4; }
.ai-md p { margin: 7px 0; }
.ai-md ul, .ai-md ol { margin: 8px 0; padding-left: 22px; }
.ai-md li { margin: 5px 0; }
.ai-md blockquote { margin: 9px 0; padding: 6px 12px; border-left: 3px solid #8ec2ff; background: #f3f8ff; border-radius: 5px; }
.ai-md code { padding: 1px 5px; border-radius: 4px; background: #eef3f8; }
.ai-md hr { border: 0; border-top: 1px solid #dce6f1; margin: 12px 0; }
.ai-md strong { font-weight: 800; }
.feedback.ai .ai-md { color: #254d76; }
.role-avatar { width: 100%; height: 100%; display: grid; place-items: center; border-radius: inherit; font-size: 20px; line-height: 1; }
.contact-avatar .role-avatar, .chat-avatar .role-avatar { width: 100%; height: 100%; }
.role-avatar.teacher { background: linear-gradient(145deg, #4d8dff, #2166ff); color: #fff; }
.role-avatar.student { background: linear-gradient(145deg, #4ad9d8, #17a8a8); color: #fff; }
.wrong-item { border-left: 4px solid #f1a43c; }
.wrong-item.mastered { border-left-color: #35aa86; }
.wrong-label { color: #a16c09; background: #fff4db; border-radius: 5px; padding: 3px 6px; }
.map-editor { grid-template-columns: minmax(0, 1fr); }
.editor-tree { min-width: 0; max-height: min(72vh, 760px); overflow: auto; }
.editor-tree .map-canvas { min-width: 980px; }
.node-form { position: static; min-width: 0; overflow: visible; }
.node-form .field input, .node-form .field textarea, .node-form .field select { width: 100%; }
.map-editor textarea { min-height: 140px; }
.map-node.root b { font-size: 18px; }
@media(max-width:640px){ .ai-md h4 { font-size: 15px; } .role-avatar { font-size: 17px; } }
