/* Arabic academy chat: independent from the legacy assistant panel. */
.academy-chat{--ac-ink:#153c3d;--ac-gold:#d3b377;--ac-cream:#faf7f0;--ac-line:#deded1;color:var(--ac-ink);background:var(--ac-cream);border:1px solid #57716b44;border-radius:22px;padding:0;position:fixed;inset:auto 22px calc(86px + env(safe-area-inset-bottom,0px)) auto;z-index:1000;width:min(410px,calc(100% - 32px));height:min(620px,calc(100dvh - 116px - env(safe-area-inset-bottom,0px)));max-height:calc(100dvh - 116px - env(safe-area-inset-bottom,0px));margin:0;box-shadow:0 12px 45px #102a2b29;overflow:hidden;direction:rtl;text-align:right;font-family:Cairo,sans-serif;font-size:14px;line-height:1.8}
.academy-chat[open]{display:flex;flex-direction:column}
.academy-chat *{box-sizing:border-box}
.academy-chat [hidden]{display:none!important}
.academy-chat button,.academy-chat input,.academy-chat textarea,.academy-chat a{font:inherit;letter-spacing:0}
.academy-chat button{cursor:pointer;touch-action:manipulation}
.academy-chat button:disabled{cursor:not-allowed;opacity:.55}
.academy-chat button:focus-visible,.academy-chat a:focus-visible,.academy-chat input:focus-visible,.academy-chat textarea:focus-visible{outline:3px solid #b48b47;outline-offset:3px}
.academy-chat p,.academy-chat h2,.academy-chat h3{margin:0;letter-spacing:0;white-space:normal}
.academy-chat a{text-underline-offset:4px}
.academy-chat .ac-icon{width:21px;height:21px;flex-shrink:0;display:block}
.ac-header{display:flex;align-items:center;gap:10px;padding:14px 16px;background:#153c3d;color:#fffaf0;flex-shrink:0;position:relative;border-bottom:3px solid #d3b377}
.ac-brand{width:38px;height:38px;display:grid;place-items:center;border:1px solid #d3b37770;border-radius:15px;background:#fff7db0b;color:#e2c38b;flex-shrink:0}
.ac-brand .ac-icon{width:22px;height:22px}
.ac-heading{min-width:0;flex:1}
.academy-chat .ac-identity{font-size:10px;line-height:1.6;color:#e2c38b;margin-bottom:3px}
.academy-chat .ac-title{font-size:17px;font-weight:650;color:#fffaf0;line-height:1.7}
.academy-chat .ac-subtitle{font-size:10px;color:#d3dfd6;line-height:1.8;margin-top:3px;max-width:37ch}
.ac-close{align-self:flex-start;display:grid;place-items:center;width:40px;height:40px;border:1px solid #fff9e52b;background:#fff8e509;color:#fffaf0;border-radius:50%;flex-shrink:0;padding:0}
.ac-close:hover{background:#fff8e51a}
.ac-body{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.ac-loading{height:100%;min-height:180px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:28px;color:#5a6d63}
.ac-spinner{height:27px;width:27px;border:2px solid #d3b37755;border-top-color:#93713b;border-radius:50%;animation:ac-spin .8s linear infinite}
.ac-chat{display:flex;flex-direction:column;min-height:0;flex:1;overflow-y:auto;overscroll-behavior:contain}
.ac-toolbar{display:flex;gap:12px;align-items:center;justify-content:space-between;background:#eeeade;padding:6px 16px;flex-wrap:wrap;border-bottom:1px solid #e0ddcf;flex-shrink:0}
.ac-course-label{font-size:11px;line-height:1.8;min-width:0;font-weight:650}
.ac-session-actions{display:flex;gap:13px;align-items:center;flex-shrink:0}
.academy-chat .ac-text-button{display:inline-flex;align-items:center;justify-content:center;gap:5px;font-size:11px;line-height:1.7;color:#49665b;background:none;border:0;padding:5px 0;text-decoration:underline;text-underline-offset:4px;min-height:30px}
.ac-text-button .ac-icon{width:13px;height:13px}
.academy-chat .ac-disclosure{padding:8px 16px;font-size:9px;line-height:1.9;color:#6a756c;background:#f9f7f0;border-bottom:1px solid #e7e5d9;flex-shrink:0}
.ac-inline-link{color:#315d54;text-decoration:underline;font-size:inherit}
.ac-availability{display:flex;align-items:center;gap:12px;justify-content:space-between;margin:11px 20px 0;background:#f6ead8;border:1px solid #d8bd83;border-radius:10px;padding:10px 12px;color:#695329;font-size:12px;line-height:1.9;flex-shrink:0}
.ac-availability .ac-text-button{white-space:nowrap;flex-shrink:0;color:#695329}
.ac-messages{display:flex;flex-direction:column;gap:17px;flex:1;min-height:90px;overflow-y:auto;overscroll-behavior:contain;padding:16px;scrollbar-width:thin;scrollbar-color:#bac6bc transparent}
.ac-welcome{padding:5px 0 10px;max-width:43ch;flex-shrink:0}
.ac-welcome-icon{display:grid;place-items:center;color:#99753c;background:#ede8d94d;border:1px solid #c4ad7c60;border-radius:13px;width:39px;height:39px;margin-bottom:14px}
.academy-chat .ac-welcome h3{font-size:19px;font-weight:650;line-height:1.75;color:#153c3d;margin-bottom:7px}
.academy-chat .ac-welcome p{font-size:13px;line-height:2;color:#5d6c61}
.ac-message{border:1px solid #e1e2d7;border-radius:15px 3px 15px 15px;background:#fffefa;max-width:94%;padding:13px 15px;align-self:flex-start;overflow-wrap:anywhere;flex-shrink:0}
.ac-message-user{align-self:flex-end;background:#e9eedf;border-color:#dbe2cf;border-radius:3px 15px 15px 15px}
.ac-message-author{display:block;font-size:10px;color:#73806b;font-weight:650;margin-bottom:6px;line-height:1.7}
.academy-chat .ac-message p{font-size:13px;line-height:2;white-space:pre-wrap;color:#23483f;unicode-bidi:plaintext}
.ac-sent-image{display:block;max-width:100%;width:auto;max-height:160px;object-fit:contain;border-radius:8px;margin-block:4px 10px;background:#fffefa}
.ac-sources{display:flex;flex-wrap:wrap;gap:6px;margin-top:13px;padding-top:10px;border-top:1px solid #e1e4d7}
.ac-source-label{display:block;flex-basis:100%;font-size:10px;color:#768170}
.ac-sources a{font-size:11px;line-height:1.8;max-width:100%;padding:4px 9px;border-radius:5px;background:#eeefdf;color:#395c4e;text-decoration:underline;overflow-wrap:anywhere}
.ac-waiting{display:flex;align-items:center;gap:9px;font-size:11px;color:#75846f;flex-shrink:0;padding-inline:4px}
.ac-waiting-dots{font-size:20px;letter-spacing:3px;color:#a78548;animation:ac-breathe 1.2s ease-in-out infinite}
.ac-prompts{display:flex;gap:7px;padding:0 16px 10px;overflow-x:auto;flex-shrink:0;scrollbar-width:thin;overscroll-behavior-x:contain}
.academy-chat .ac-prompt{background:#fffdf8;border:1px solid #d6dbc8;border-radius:99px;padding:8px 13px;line-height:1.7;font-size:11px;color:#496252;white-space:nowrap;flex-shrink:0;min-height:38px}
.ac-prompt:hover{background:#edf0e3;border-color:#aebc9e}
.ac-composer{padding:12px 16px;background:#fffdf8;border-top:1px solid #dfdfd0;flex-shrink:0}
.academy-chat .ac-message-input{display:block;width:100%;min-height:58px;max-height:95px;resize:vertical;border:1px solid #ccd2c5;border-radius:12px;background:#fffefb;color:#173d3e;font-size:15px;line-height:1.85;padding:11px 13px;box-shadow:inset 0 1px 3px #14382f04}
.ac-message-input::placeholder{font-size:13px;color:#87907e}
.ac-message-input:disabled{background:#f1f2e9;resize:none}
.ac-composer-bottom{display:flex;align-items:center;gap:12px;padding-top:9px}
.academy-chat .ac-send{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-width:95px;min-height:43px;padding:9px 14px;background:#153c3d;color:#fffaf0;border:1px solid #153c3d;border-radius:10px;font-size:13px;line-height:1.6;margin-inline-start:auto}
.ac-send .ac-icon{width:17px;height:17px;transform:scaleX(-1)}
.ac-send:not(:disabled):hover{background:#26534f}
.academy-chat .ac-attach{display:inline-flex;align-items:center;gap:7px;padding:8px 0;background:none;border:0;color:#3c6457;font-size:12px;line-height:1.6;min-height:40px}
.ac-attach .ac-icon{width:18px;height:18px}
.ac-character-count{font-size:10px;color:#86907f;white-space:nowrap}
.ac-web-option{padding-top:8px;display:flex;flex-direction:column;gap:2px}
.ac-web-label{display:flex;align-items:center;gap:7px;color:#496252;font-size:11px;cursor:pointer;line-height:1.7}
.ac-web-label input{accent-color:#315d54;width:16px;height:16px;flex-shrink:0}
.ac-web-option small{font-size:9px;color:#85907d;padding-inline-start:23px;line-height:1.8}
.academy-chat .ac-input-hint{font-size:9px;line-height:1.8;color:#85907d;margin-top:7px}
.academy-chat .ac-status{font-size:12px;line-height:1.8;color:#914d37;background:#f8eee6;border:1px solid #e7cdbb;border-radius:8px;padding:8px 11px;margin-bottom:10px}
.ac-image-preview{display:flex;align-items:center;gap:10px;background:#f0f2e7;border:1px solid #d6ddca;border-radius:10px;padding:8px;margin-bottom:10px}
.ac-image-preview img{width:53px;height:53px;object-fit:contain;background:#fffefa;border-radius:6px;flex-shrink:0}
.ac-image-preview>div{flex:1;min-width:0}
.ac-image-preview strong{display:block;font-size:11px;font-weight:600;color:#365747;overflow-wrap:anywhere;line-height:1.6}
.ac-image-preview small{display:block;font-size:9px;color:#7c8973;margin-top:4px}
.ac-remove-image{display:grid;place-items:center;width:34px;height:34px;padding:0;background:none;border:1px solid #d1d9c7;border-radius:50%;color:#55724b;flex-shrink:0}
.ac-remove-image .ac-icon{width:15px;height:15px}
.ac-gate{padding:22px;overflow-y:auto;display:flex;align-items:flex-start;flex-direction:column;gap:14px}
.ac-gate-seal{display:grid;place-items:center;width:58px;height:58px;border:1px solid #d3b377;background:#f3ead6;border-radius:18px;color:#9f7c3e;margin-bottom:4px}
.ac-gate-seal .ac-icon{width:25px;height:25px}
.academy-chat .ac-eyebrow{font-size:11px;font-weight:650;color:#9a783b;line-height:1.8}
.academy-chat .ac-gate h3{font-size:22px;font-weight:600;line-height:1.7;max-width:22ch;color:#153c3d}
.academy-chat .ac-gate>p:not(.ac-eyebrow):not(.ac-gate-note):not(.ac-gate-status){color:#68735f;font-size:14px;line-height:2}
.ac-gate-actions{display:grid;gap:10px;width:100%;margin-top:4px}
.academy-chat .ac-primary,.academy-chat .ac-secondary{display:flex;align-items:center;justify-content:center;min-height:48px;text-align:center;font-size:13px;font-weight:650;line-height:1.8;border:1px solid #153c3d;border-radius:10px;padding:11px 16px;text-decoration:none;background:#153c3d;color:#fffaf0}
.academy-chat .ac-secondary{background:transparent;color:#153c3d;border-color:#c5d0bb}
.academy-chat .ac-primary:hover{background:#26534f}
.academy-chat .ac-secondary:hover{background:#edf0e5}
.ac-gate>.ac-inline-link{font-size:12px}
.academy-chat .ac-gate-note{font-size:10px;line-height:1.8;color:#85907c;border-top:1px solid #e4e4d5;padding-top:14px;width:100%;margin-top:3px}
.academy-chat .ac-gate-status{font-size:11px;line-height:1.8;color:#9a6934;background:#f4ead7;border-radius:8px;padding:10px 12px;width:100%}
.ac-visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
@keyframes ac-spin{to{transform:rotate(360deg)}}
@keyframes ac-breathe{50%{opacity:.4}}
/* The launcher is also the resume control; no full-page overlay or scroll lock. */
.academy-help-launcher .ac-launcher-status{font-size:10px;line-height:1.6;padding:3px 8px;background:#fff9e51a;border-radius:99px;white-space:nowrap}
.academy-help-launcher .ac-launcher-status[hidden]{display:none}
.academy-help-launcher.ac-has-reply .ac-launcher-status{color:#153c3d;background:#e2c38b}
.academy-help-launcher[aria-expanded="true"]{box-shadow:none}
@media(max-width:600px){
 .academy-chat{inset:auto 12px calc(78px + env(safe-area-inset-bottom,0px)) auto;width:calc(100% - 24px);height:min(570px,72dvh);max-height:calc(100dvh - 100px - env(safe-area-inset-bottom,0px));border-radius:18px}
 .ac-header{gap:9px;padding:12px 14px}.ac-brand{display:none}.academy-chat .ac-title{font-size:17px}.ac-close{width:40px;height:40px}
 .ac-toolbar{padding-inline:14px;gap:3px 10px}.ac-session-actions{margin-inline-start:auto}.ac-course-label{font-size:10px}
 .academy-chat .ac-disclosure{padding:7px 14px}.ac-messages{padding:14px;gap:12px}.ac-prompts{padding-inline:14px}
 .ac-composer{padding:10px 14px}.academy-chat .ac-message-input{font-size:16px;min-height:55px;max-height:85px}
 .ac-message{max-width:96%;padding:12px}.academy-chat .ac-welcome h3{font-size:17px}.ac-welcome-icon{margin-bottom:8px}
 .ac-gate{padding:20px}.academy-chat .ac-gate h3{font-size:22px}.ac-availability{margin-inline:14px}
 .ac-send{min-height:44px!important}.ac-remove-image{min-height:40px}.ac-image-preview img{width:40px;height:40px}
 .academy-help-launcher{right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px))}
}
@media(max-height:700px){
 .academy-chat{height:calc(100dvh - 96px - env(safe-area-inset-bottom,0px));max-height:calc(100dvh - 96px - env(safe-area-inset-bottom,0px));bottom:calc(72px + env(safe-area-inset-bottom,0px))}
 .ac-header{padding-block:9px}.ac-brand{display:none}.academy-chat .ac-subtitle{display:none}
 .academy-chat .ac-disclosure{padding-block:6px}.ac-messages{min-height:90px;padding-block:12px}.ac-prompts{display:none}
 .ac-composer{padding-block:8px}.academy-chat .ac-message-input{min-height:48px;height:48px;max-height:70px}
 .ac-web-option{padding-top:5px}.ac-welcome{padding-top:0}.ac-welcome-icon{display:none}.ac-image-preview img{height:38px;width:38px}.ac-gate{padding-block:18px}
}
@media(prefers-reduced-motion:reduce){.ac-spinner,.ac-waiting-dots{animation:none}.academy-chat *{scroll-behavior:auto!important}}

.ac-prompts{scrollbar-width:none}.ac-prompts::-webkit-scrollbar{display:none}
