/* SmartCBT 24.7 — complete, readable GFM output for AI explanations. */
.ap-md-rendered,.ap19-initial-text,.ap20-learning-body,.ap18-message-body{overflow-wrap:anywhere}
.ap-md-rendered>:first-child,.ap19-initial-text>:first-child,.ap20-learning-body>:first-child,.ap18-message-body>:first-child{margin-top:0}
.ap-md-rendered>:last-child,.ap19-initial-text>:last-child,.ap20-learning-body>:last-child,.ap18-message-body>:last-child{margin-bottom:0}
.ap-md-rendered h1,.ap-md-rendered h2,.ap-md-rendered h3,.ap-md-rendered h4,.ap-md-rendered h5,.ap-md-rendered h6,.ap19-initial-text h1,.ap19-initial-text h2,.ap19-initial-text h3,.ap18-message-body h1,.ap18-message-body h2,.ap18-message-body h3{margin:20px 0 8px;color:var(--ap-heading);font-weight:850;line-height:1.3}
.ap-md-rendered h1,.ap19-initial-text h1,.ap18-message-body h1{font-size:22px}.ap-md-rendered h2,.ap19-initial-text h2,.ap18-message-body h2{font-size:19px}.ap-md-rendered h3,.ap19-initial-text h3,.ap18-message-body h3{font-size:16px}
.ap-md-rendered p,.ap19-initial-text p,.ap20-learning-body p,.ap18-message-body p{margin:9px 0;line-height:1.72}
.ap-md-rendered ul,.ap-md-rendered ol,.ap19-initial-text ul,.ap19-initial-text ol,.ap20-learning-body ul,.ap20-learning-body ol,.ap18-message-body ul,.ap18-message-body ol{margin:10px 0;padding-left:24px}.ap-md-rendered li,.ap19-initial-text li,.ap20-learning-body li,.ap18-message-body li{margin:5px 0;line-height:1.65}
.ap-md-rendered blockquote,.ap19-initial-text blockquote,.ap20-learning-body blockquote,.ap18-message-body blockquote{margin:13px 0;padding:11px 15px;border-left:4px solid var(--ap-primary);border-radius:0 10px 10px 0;background:var(--ap-primary-soft);color:var(--ap-secondary)}
.ap-md-rendered pre,.ap19-initial-text pre,.ap20-learning-body pre,.ap18-message-body pre{max-width:100%;margin:13px 0;padding:14px;overflow:auto;border:1px solid var(--ap-p200);border-radius:11px;background:#0f172a;color:#e2e8f0;white-space:pre}
.ap-md-rendered code,.ap19-initial-text code,.ap20-learning-body code,.ap18-message-body code{padding:2px 5px;border-radius:5px;background:rgba(var(--ap-primary-rgb),.09);color:var(--ap-primary-dark);font:600 .92em/1.5 Consolas,Monaco,monospace}.ap-md-rendered pre code,.ap19-initial-text pre code,.ap20-learning-body pre code,.ap18-message-body pre code{padding:0;background:transparent;color:inherit;font-weight:400}
.ap-md-rendered a,.ap19-initial-text a,.ap20-learning-body a,.ap18-message-body a{color:var(--ap-link);font-weight:700;text-decoration:underline;text-underline-offset:2px}.ap-md-rendered del,.ap19-initial-text del,.ap20-learning-body del,.ap18-message-body del{color:var(--ap-muted)}.ap-md-rendered hr,.ap19-initial-text hr,.ap20-learning-body hr,.ap18-message-body hr{margin:18px 0;border:0;border-top:1px solid var(--ap-p200)}
.ap-md-rendered table,.ap19-initial-text table,.ap20-learning-body table,.ap18-message-body table{width:100%;margin:14px 0;border-collapse:separate;border-spacing:0;border:1px solid var(--ap-p200);border-radius:11px;background:#fff}
.ap-md-rendered th,.ap-md-rendered td,.ap19-initial-text th,.ap19-initial-text td,.ap20-learning-body th,.ap20-learning-body td,.ap18-message-body th,.ap18-message-body td{padding:9px 11px;border-right:1px solid var(--ap-p200);border-bottom:1px solid var(--ap-p200);text-align:left;vertical-align:top}.ap-md-rendered th:last-child,.ap-md-rendered td:last-child,.ap19-initial-text th:last-child,.ap19-initial-text td:last-child,.ap20-learning-body th:last-child,.ap20-learning-body td:last-child,.ap18-message-body th:last-child,.ap18-message-body td:last-child{border-right:0}.ap-md-rendered tbody tr:last-child td,.ap19-initial-text tbody tr:last-child td,.ap20-learning-body tbody tr:last-child td,.ap18-message-body tbody tr:last-child td{border-bottom:0}.ap-md-rendered th,.ap19-initial-text th,.ap20-learning-body th,.ap18-message-body th{background:var(--ap-secondary);color:var(--ap-on-secondary);font-weight:800}
.ap-md-rendered [data-align=center],.ap19-initial-text [data-align=center],.ap20-learning-body [data-align=center],.ap18-message-body [data-align=center]{text-align:center}.ap-md-rendered [data-align=right],.ap19-initial-text [data-align=right],.ap20-learning-body [data-align=right],.ap18-message-body [data-align=right]{text-align:right}
.ap-md-task-list,.task-list{padding-left:5px!important;list-style:none}.ap-md-task-list input,.task-list input{margin:0 8px 0 0;vertical-align:-1px}
@media(max-width:600px){.ap-md-rendered table,.ap19-initial-text table,.ap20-learning-body table,.ap18-message-body table{display:block;overflow-x:auto;white-space:nowrap}.ap-md-rendered th,.ap-md-rendered td,.ap19-initial-text th,.ap19-initial-text td,.ap20-learning-body th,.ap20-learning-body td,.ap18-message-body th,.ap18-message-body td{min-width:120px}}
.ap-md-table-wrap{max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain;border-radius:11px}
.ap-md-rendered table,.ap19-initial-text table,.ap20-learning-body table,.ap18-message-body table{table-layout:auto}
.ap-md-rendered th,.ap-md-rendered td,.ap19-initial-text th,.ap19-initial-text td,.ap20-learning-body th,.ap20-learning-body td,.ap18-message-body th,.ap18-message-body td{overflow-wrap:break-word}
/* Structured AI explanations remain legible in the educator report and chat. */
.sc-progress-ai-result .ap-md-rendered,.ap18-message-body,.ap19-initial-text,.ap20-learning-body{font-size:13px;line-height:1.72;font-weight:400;color:var(--ap-text)}
.sc-progress-ai-result .ap-md-rendered h2,.sc-progress-ai-result .ap-md-rendered h3{margin:20px 0 9px;color:var(--ap-heading);font-weight:800;line-height:1.38}
.sc-progress-ai-result .ap-md-rendered p{margin:10px 0 13px;line-height:1.75;font-weight:400}
.sc-progress-ai-result .ap-md-rendered strong{font-weight:750}
.sc-progress-ai-result .ap-md-rendered ol,.sc-progress-ai-result .ap-md-rendered ul{margin:12px 0 16px;padding-left:23px}
.sc-progress-ai-result .ap-md-rendered li{margin:8px 0;line-height:1.7;font-weight:400}
.sc-progress-ai-result .ap-md-table-wrap{margin:16px 0;border:1px solid var(--ap-p200);border-radius:12px;background:#fff;overflow-x:auto}
.sc-progress-ai-result .ap-md-table-wrap table{margin:0;min-width:420px;border:0;border-radius:0}
.sc-progress-ai-result .ap-md-table-wrap th{background:linear-gradient(110deg,var(--ap-primary),var(--ap-secondary));color:#fff}
.sc-progress-ai-result .ap-md-table-wrap td{font-weight:400;line-height:1.55}
