/* AI tutor chat (home page console + lesson page panel) */
.ai-msg pre { background: #070c18; border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 12px 14px; overflow-x: auto; margin: 8px 0; font-size: 12px; }
.ai-msg pre code.hljs { background: transparent; padding: 0; }
.ai-msg code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ai-msg :not(pre) > code { background: rgba(56, 189, 248, 0.15); color: #38bdf8; padding: 2px 5px; border-radius: 4px; font-size: 0.9em; }
.ai-msg p { margin: 0 0 8px; }
.ai-msg p:last-child { margin-bottom: 0; }
.ai-msg ul, .ai-msg ol { margin: 0 0 8px 18px; list-style: revert; }
.ai-msg h1, .ai-msg h2, .ai-msg h3 { font-weight: 700; margin: 10px 0 6px; color: #ffffff; }
.ai-msg a { color: #38bdf8; text-decoration: underline; }
.ai-msg table { border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.ai-msg th, .ai-msg td { border: 1px solid rgba(255,255,255,0.12); padding: 4px 8px; }

.ai-counter { font-size: 11.5px; font-weight: 600; color: #94a3b8; white-space: nowrap; }
.ai-counter.low { color: #fbbf24; }
.ai-counter.out { color: #fb7185; }
.ai-clear { background: none; border: 1px solid rgba(255,255,255,0.12); color: #94a3b8; border-radius: 8px; padding: 3px 9px; font-size: 11px; font-weight: 600; cursor: pointer; }
.ai-clear:hover { color: #fff; border-color: rgba(255,255,255,0.3); }
.ai-error-bubble { max-width: 85%; border-radius: 16px 16px 16px 0; border: 1px solid rgba(239,68,68,0.3); background: rgba(69,10,10,0.4); padding: 12px 16px; color: #fecaca; font-size: 14px; }
.ai-error-bubble a { color: #fff; font-weight: 700; text-decoration: underline; }
.ai-chat-scroll { max-height: 420px; overflow-y: auto; }

/* Lesson-page panel */
.ai-lesson-panel > summary { list-style: none; cursor: pointer; }
.ai-lesson-panel > summary::-webkit-details-marker { display: none; }
.ai-lesson-panel[open] .ai-chevron { transform: rotate(180deg); }
.ai-chevron { transition: transform .2s; }

/* Sensitive-data warning bubble */
.ai-warn-bubble { max-width: 90%; border-radius: 16px 16px 16px 0; border: 1px solid rgba(245,158,11,0.4); background: rgba(245,158,11,0.1); padding: 12px 16px; color: #fde68a; font-size: 13.5px; line-height: 1.55; }
