.tutor-dialog{padding:0;border:1px solid #dce9e0;border-radius:18px;width:100%;height:680px;max-height:85dvh;margin:12px 0 28px;color:#193d39;background:#fff;overflow:hidden;font-family:Cairo,Tahoma,sans-serif}.tutor-dialog:not([hidden]){display:flex;flex-direction:column}.tutor-dialog[hidden]{display:none}.tutor-dialog button{font:inherit}.tutor-head{display:flex;align-items:center;gap:14px;padding:20px 26px;color:white;background:#064e4a;flex-shrink:0}.tutor-brand-icon{display:grid;place-items:center;width:48px;height:56px;border-radius:14px;background:#ffffff12}.tutor-brand-icon svg{height:40px;width:33px}.tutor-head h2{font-size:21px;margin:0;color:white;line-height:1.5}.tutor-head h2 span{font-family:Arial,sans-serif;display:inline-block;vertical-align:middle;font-size:10px;letter-spacing:1px;padding:3px 6px;background:#ffad81;color:#294742;border-radius:5px;margin-inline-start:6px}.tutor-head p{margin:3px 0 0;font-size:12px;color:#cfdfdb}.tutor-close{margin-inline-start:auto;width:38px;height:38px;display:grid;place-items:center;font-size:26px!important;border:1px solid #ffffff30;border-radius:50%;color:white;background:transparent}.tutor-close:hover{background:#ffffff18}.tutor-context{display:flex;align-items:center;justify-content:space-between;padding:12px 26px;border-bottom:1px solid #e5eeea;font-size:11px;flex-shrink:0;background:#fff}.tutor-context>span{display:flex;align-items:center;gap:7px}.tutor-live-dot{width:7px;height:7px;border-radius:50%;background:#a6b4b0}.tutor-live-dot.connected{background:#2d8765;box-shadow:0 0 0 3px #e8f3ed}.tutor-context button{padding:4px 0;border:0;background:none;font-size:11px;color:#56746d}.tutor-context button:hover{color:#064e4a}.tutor-scroll{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c1d4cc transparent;padding:24px 28px;background:#fafcfb}.tutor-welcome{text-align:center;padding:6px 0 8px}.tutor-welcome[hidden]{display:none}.tutor-welcome-icon{display:grid;place-items:center;width:66px;height:72px;background:#fff0e5;border-radius:22px;margin:0 auto 14px;color:#064e4a;transform:rotate(-5deg)}.tutor-welcome-icon svg{width:34px;height:47px;transform:rotate(5deg)}.tutor-kicker{font-size:10px;color:#9c603b;font-weight:700}.tutor-welcome h3{margin:6px 0 9px;font-size:23px;letter-spacing:-.4px}.tutor-welcome p{font-size:13px;color:#657972;line-height:1.9;margin:0 0 20px}.tutor-prompts{display:grid;gap:8px;max-width:450px;margin:auto}.tutor-prompts button{display:flex;align-items:center;justify-content:space-between;gap:12px;border:1px solid #e0e9e3;border-radius:12px;background:white;padding:12px 16px;text-align:right;font-size:12px;color:#35574f;transition:background .15s,border-color .15s}.tutor-prompts button:hover{background:#fff4ed;border-color:#e9b899}.tutor-prompts button span{font-size:18px;color:#b57950}.tutor-message{max-width:95%;margin:0 0 22px;line-height:1.95}.tutor-message-label{font-size:10px;font-weight:700;color:#647b73;margin:0 3px 6px}.tutor-message-body{font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;padding:17px 20px;border:1px solid #e1eae4;border-radius:16px 4px 16px 16px;background:white;box-shadow:0 2px 5px #064e4a03}.tutor-message.user{max-width:85%;margin-inline-start:auto}.tutor-message.user .tutor-message-body{background:#fff0e5;border-color:#f3dccb;border-radius:4px 16px 16px 16px}.tutor-message.user .tutor-message-label{text-align:left}.tutor-message.assistant .tutor-message-label{color:#096255}.tutor-message.is-thinking .tutor-message-body{color:#6c8179;font-size:12px}.tutor-message.is-thinking .tutor-message-body:after{content:' • • •';display:inline-block;letter-spacing:3px;color:#bc805a;animation:tutor-pulse 1.3s infinite}.tutor-composer{padding:12px 24px 16px;border-top:1px solid #e5ede8;background:white;flex-shrink:0}.tutor-composer [data-status]{font-size:11px;color:#60786e;line-height:1.7;margin:0 0 8px}.tutor-composer [data-status]:empty{display:none}.tutor-composer [data-status].is-error{padding:8px 12px;background:#fff0e6;color:#8b432b;border-radius:9px}.tutor-input-wrap{display:flex;align-items:flex-end;gap:8px;border:1px solid #cdded5;border-radius:15px;background:#fcfdfc;padding:10px}.tutor-input-wrap:focus-within{border-color:#438a78;box-shadow:0 0 0 3px #438a7812}.tutor-dialog textarea{min-width:0;flex:1;width:100%;resize:none;border:0;outline:0!important;background:transparent;box-shadow:none;font:inherit;font-size:13px;line-height:1.8;min-height:50px;max-height:105px;padding:3px 5px;margin:0;color:#193d39}.tutor-dialog textarea::placeholder{color:#83978d}.tutor-send{width:42px;height:42px;flex-shrink:0;display:grid;place-items:center;background:#064e4a;color:#fff;border:0;border-radius:12px}.tutor-send svg{width:21px;height:21px}.tutor-send:disabled{opacity:.4}.tutor-send:hover:not(:disabled){background:#087064}.tutor-input-meta{display:flex;justify-content:space-between;gap:8px;font-size:9px;color:#60776e;margin:7px 3px}.tutor-disclaimer{text-align:center;font-size:9px!important;color:#718179;line-height:1.7;margin:7px 0 0!important}.tutor-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.tutor-launch{display:flex;align-items:center;gap:14px;text-align:right;background:#f1f7f3;border:1px solid #dce9e0;padding:19px 22px;border-radius:15px;margin-top:24px}.tutor-launch-icon{background:#fff0e4;border-radius:12px;width:44px;height:50px;display:grid;place-items:center;flex-shrink:0}.tutor-launch svg{width:25px;height:34px}.tutor-launch strong{font-size:14px;color:#164e43}.tutor-launch p{font-size:11px;margin:3px 0 0;color:#667d71}.tutor-launch button{margin-inline-start:auto;white-space:nowrap;font-size:12px;background:#064e4a;border:0;color:white;padding:10px 16px;border-radius:10px}.tutor-launch button span{padding-inline-start:10px}@keyframes tutor-pulse{50%{opacity:.35}}@media(prefers-reduced-motion:reduce){.tutor-message.is-thinking .tutor-message-body:after{animation:none}}
@media(max-width:600px){.tutor-dialog{width:100%;height:640px;max-height:85dvh;border-radius:15px;margin:10px 0 24px}.tutor-head{padding:16px 18px}.tutor-head h2{font-size:19px}.tutor-context{padding:10px 18px;font-size:10px}.tutor-scroll{padding:20px 17px}.tutor-welcome h3{font-size:21px}.tutor-welcome p{font-size:12px}.tutor-welcome-icon{width:55px;height:60px}.tutor-prompts button{font-size:11px;padding:11px 12px}.tutor-composer{padding:10px 14px max(12px,env(safe-area-inset-bottom))}.tutor-message-body{padding:13px 15px;font-size:14px}.tutor-input-meta>span:first-child{visibility:hidden}.tutor-launch{flex-wrap:wrap;padding:16px;gap:10px}.tutor-launch button{width:100%;margin-top:4px}.tutor-dialog textarea{font-size:16px}.tutor-disclaimer{font-size:9px!important}}
@media(max-height:800px){.tutor-scroll{padding-top:16px;padding-bottom:16px}.tutor-welcome-icon{height:44px;width:44px;margin-bottom:8px;border-radius:14px}.tutor-welcome-icon svg{height:32px;width:24px}.tutor-welcome h3{font-size:20px;margin:4px 0}.tutor-welcome p{font-size:11px;margin-bottom:12px}.tutor-prompts button{padding:8px 12px}.tutor-welcome{padding:0}}

.tutor-current{margin:0;padding:10px 20px;background:#f0f7f4;color:#285e50;font-size:12px;line-height:1.8}.tutor-quick-actions{display:flex;flex-wrap:wrap;gap:7px;padding:10px 18px;border-bottom:1px solid #e5ece8}.tutor-quick-actions button{background:#fff3e9;border:1px solid #edd0ba;color:#724b32;padding:9px 12px;border-radius:9px;font:inherit;font-size:12px}.tutor-quick-actions button:disabled{opacity:.5}

.tutor-quiz-choices{display:flex;flex-wrap:wrap;gap:8px;margin:12px 8px 20px}.tutor-quiz-choices button{flex:1 1 140px;background:#f0f8f4;color:#175447;border:1px solid #b7d7c9;border-radius:10px;padding:13px;font:inherit;cursor:pointer}.tutor-quiz-choices button:focus-visible{outline:3px solid #e7a77b}.tutor-quiz-choices button:disabled{opacity:.5}

/* Compact inline tutoring workspace: reading space first, controls within reach. */
.tutor-dialog{max-width:780px;height:600px;max-height:82dvh;margin:12px auto 24px;border-radius:20px;box-shadow:0 12px 32px #064e4a0b}
.tutor-dialog:not([hidden]){animation:tutor-reveal .22s ease-out}
.tutor-head{padding:14px 18px;gap:10px;background:#064e4a}
.tutor-brand-icon{width:38px;height:42px;border-radius:12px;flex-shrink:0}
.tutor-brand-icon svg{width:24px;height:32px}
.tutor-head h2{font-size:18px}.tutor-head p{font-size:10px;margin:1px 0 0}
.tutor-close{width:44px;height:44px;border-radius:12px;cursor:pointer}
.tutor-context{padding:7px 18px;gap:12px}.tutor-context>span{min-width:0;line-height:1.6}.tutor-context button{min-height:36px;white-space:nowrap}
.tutor-current{padding:7px 18px;font-size:11px;max-height:64px;overflow:auto}
.tutor-quick-actions{flex-wrap:nowrap;flex-shrink:0;overflow-x:auto;padding:8px 16px;gap:6px;scrollbar-width:thin}
.tutor-quick-actions button{white-space:nowrap;flex-shrink:0;min-height:40px;padding:8px 11px;font-size:11px;background:#fff7f0;border-color:#f0dece;border-radius:20px;cursor:pointer}
.tutor-scroll{padding:18px 20px;min-height:110px}
.tutor-welcome{padding:3px 0}.tutor-welcome-icon{width:40px;height:44px;border-radius:13px;margin-bottom:7px}.tutor-welcome-icon svg{width:23px;height:30px}
.tutor-welcome h3{font-size:19px;margin:5px 0}.tutor-welcome p{font-size:12px;margin-bottom:12px}
.tutor-prompts{gap:6px;max-width:480px}.tutor-prompts button{padding:9px 12px;min-height:40px;font-size:11px}
.tutor-message{margin-bottom:16px}.tutor-message-body{padding:12px 15px;font-size:14px;line-height:1.9}
.tutor-composer{padding:9px 16px 10px}.tutor-input-wrap{padding:6px;border-radius:14px}
.tutor-dialog textarea{min-height:40px;max-height:96px;padding:7px 8px;font-size:14px}
.tutor-send{width:44px;height:44px;border-radius:10px}.tutor-input-meta{margin:4px 3px}.tutor-disclaimer{margin-top:3px!important}
.tutor-launch{max-width:780px;margin:22px auto 0;padding:14px 16px;gap:12px;border-radius:17px;background:linear-gradient(110deg,#fff7f0,#f1f7f3)}
.tutor-launch strong{font-size:14px}.tutor-launch p{font-size:11px}.tutor-launch button{min-height:44px;cursor:pointer}.tutor-launch-icon{width:38px;height:42px}
.tutor-dialog button:focus-visible,.tutor-launch button:focus-visible{outline:3px solid #ffad81;outline-offset:3px}
@keyframes tutor-reveal{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media(max-width:600px){.tutor-dialog{height:590px;max-height:85dvh;border-radius:16px}.tutor-head{padding:11px 12px}.tutor-context{padding:5px 12px;font-size:10px}.tutor-current{padding:6px 12px;font-size:10px}.tutor-quick-actions{padding:7px 10px}.tutor-scroll{padding:14px 12px}.tutor-composer{padding:8px 10px max(8px,env(safe-area-inset-bottom))}.tutor-dialog textarea{font-size:16px}.tutor-launch{padding:12px;gap:9px}.tutor-launch>div{flex:1;min-width:160px}.tutor-launch button{width:100%;margin:0}.tutor-welcome p br{display:none}.tutor-welcome h3{font-size:18px}}
@media(max-height:550px){.tutor-dialog{height:520px;max-height:none}}
@media(prefers-reduced-motion:reduce){.tutor-dialog:not([hidden]){animation:none}}

.lesson-view .tutor-dialog .tutor-quick-actions{display:flex;flex-wrap:nowrap}
.lesson-view .tutor-dialog .tutor-head{padding:11px 14px}
.lesson-view .tutor-dialog .tutor-composer{padding:8px 12px}
.tutor-dialog#lesson-tutor:has(.tutor-visual){height:600px;max-height:82dvh}
.tutor-dialog#lesson-tutor:has(.tutor-visual) .tutor-scroll{flex:1;min-height:110px;overflow-y:auto}
@media(max-width:600px){.tutor-dialog#lesson-tutor:has(.tutor-visual){height:590px;max-height:85dvh}}
@media(max-height:550px){.tutor-dialog#lesson-tutor:has(.tutor-visual){height:520px;max-height:none}}

/* Persistent lesson launcher and non-modal, minimizable conversation. */
.tutor-floating{position:fixed;left:22px;bottom:20px;z-index:40;display:flex;align-items:center;gap:9px;min-height:48px;padding:9px 15px;background:#064e4a;color:#fff;border:1px solid #ffffff80;border-radius:28px;box-shadow:0 5px 18px #064e4a25;font:700 12px Cairo,Tahoma,sans-serif;cursor:pointer}
.tutor-floating[hidden]{display:none}.tutor-floating svg{width:23px;height:29px}.tutor-floating:hover{background:#0b625c}.tutor-floating:focus-visible{outline:3px solid #ffad81;outline-offset:3px}
#lesson-tutor.tutor-dialog,#lesson-tutor.tutor-dialog:has(.tutor-visual){position:fixed;left:22px;bottom:82px;z-index:39;width:min(440px,calc(100vw - 32px));height:min(620px,calc(100dvh - 104px));max-height:calc(100dvh - 104px);margin:0;border:1px solid #c9ddd3;box-shadow:0 16px 55px #123e3929}
#lesson-tutor .tutor-scroll{min-height:70px}
#lesson-tutor .tutor-welcome h3{font-size:18px}#lesson-tutor .tutor-context{font-size:10px}
@media(max-width:600px){.tutor-floating{left:12px;bottom:max(12px,env(safe-area-inset-bottom));min-height:46px;padding:8px 13px;font-size:11px}#lesson-tutor.tutor-dialog,#lesson-tutor.tutor-dialog:has(.tutor-visual){left:12px;bottom:calc(72px + env(safe-area-inset-bottom));width:calc(100% - 24px);height:min(600px,calc(100dvh - 96px - env(safe-area-inset-bottom)));max-height:calc(100dvh - 96px - env(safe-area-inset-bottom))}}
@media(max-height:550px){#lesson-tutor .tutor-head p,#lesson-tutor .tutor-current,#lesson-tutor .tutor-input-meta,#lesson-tutor .tutor-disclaimer{display:none}#lesson-tutor .tutor-head{padding:6px 12px}#lesson-tutor .tutor-context{padding:2px 12px}#lesson-tutor .tutor-quick-actions{padding:4px 10px}#lesson-tutor .tutor-scroll{min-height:45px}}

/* Roomier reading area, bounded by the available screen. */
#lesson-tutor.tutor-dialog,#lesson-tutor.tutor-dialog:has(.tutor-visual){width:min(620px,calc(100% - 44px));height:min(760px,calc(100dvh - 104px))}
@media(max-width:600px){#lesson-tutor.tutor-dialog,#lesson-tutor.tutor-dialog:has(.tutor-visual){width:calc(100% - 24px);height:calc(100dvh - 96px - env(safe-area-inset-bottom))}}

.tutor-cloud-status{padding:6px 16px;background:#f8faf8;border-bottom:1px solid #e2ebe5;font-size:10px;color:#476c60;flex-shrink:0;line-height:1.7}
.tutor-cloud-status button{font:inherit;border:1px solid #ddc4b1;border-radius:8px;background:#fff2e8;color:#684a37;padding:7px 10px;margin:5px 0 0 6px;min-height:36px;cursor:pointer}
