.mainnav .tutorLauncher{order:3;background:#f0eaff;border:2px solid #ceb9ec;color:#5d4385}
.tutorDialog{box-sizing:border-box;width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 32px);padding:0;border:2px solid #c4e2f0;border-radius:24px;color:#204f72;background:#f5fbff;box-shadow:0 20px 70px #16466c45;overflow:hidden}
.tutorDialog::backdrop{background:#19446b55}.tutorDialog header{display:flex;align-items:start;gap:12px;padding:20px;background:#e4f3f3}.tutorDialog header strong{font-size:24px}.tutorDialog header p{margin:6px 0 0}.tutorDialog button,.tutorDialog a{font:inherit;border-radius:14px;min-height:44px;padding:8px 14px;cursor:pointer}.tutorClose{margin-left:auto;border:0;background:white;font-size:24px!important}.tutorMode{font-size:13px;margin:12px 20px;color:#537085}.tutorMessages{box-sizing:border-box;height:min(48dvh,430px);overflow-y:auto;padding:4px 20px 16px;overscroll-behavior:contain}.tutorMessage{padding:12px 16px;border-radius:18px;background:white;line-height:1.7;margin:10px 0;border:1px solid #d5e7f0;white-space:pre-wrap}.tutorMessage.student{background:#e6efff;margin-left:40px}.tutorSource{background:white;border:1px solid #c8e1ed;border-radius:18px;padding:16px;margin:12px 0}.tutorSource small,.tutorSource strong{display:block;line-height:1.6}.tutorSource img{width:100px;height:100px;object-fit:contain;float:right;margin:8px}.tutorSource blockquote{margin:10px 0;padding:10px;background:#f3f9fc;line-height:1.7;white-space:pre-wrap}.tutorActions{clear:both;display:flex;gap:8px;flex-wrap:wrap}.tutorActions button,.tutorActions a{background:#edf6ff;border:1px solid #b8d8f4;color:#195985;text-decoration:none;box-sizing:border-box;display:flex;align-items:center}.tutorSuggestions{display:flex;gap:6px;flex-wrap:wrap;padding:8px 20px}.tutorSuggestions button{font-size:13px;background:#fff5df;border:1px solid #edd49b}.tutorDialog form{padding:14px 36px 20px 20px;background:white}.tutorDialog label{display:block;font-size:14px;margin-bottom:8px}.tutorInput{display:flex;gap:8px}.tutorInput input{font:inherit;min-width:0;flex:1;border:1px solid #aad2ed;border-radius:14px;padding:12px}.tutorInput button{background:#0784ec;color:white;border:0;flex-shrink:0}.tutorDialog button:focus-visible,.tutorDialog a:focus-visible,.tutorDialog input:focus-visible{outline:3px solid #ffba34;outline-offset:2px}@media(max-width:400px){.tutorDialog header{padding:14px}.tutorDialog header strong{font-size:21px}.tutorMessages{padding:4px 12px}.tutorDialog form,.tutorSuggestions{padding:10px 12px}.tutorInput button{padding:8px}.tutorSource img{width:80px;height:80px}}

.tutorDialog[open]{display:flex;flex-direction:column}.tutorMessages{flex:1 1 auto;min-height:100px}.tutorDialog header,.tutorDialog form,.tutorMode,.tutorSuggestions{flex-shrink:0}

.tutorLauncher{font:inherit;background:#f0eaff;border:1px solid #ceb9ec;border-radius:14px;padding:10px 16px;min-height:44px;color:#5d4385;cursor:pointer}

/* Student on the left, butterfly teacher on the right. */
.tutorMessage{position:relative;box-sizing:border-box;width:calc(100% - 66px);margin:18px 48px 18px 0;padding-top:30px;overflow-wrap:anywhere}
.tutorMessage::before{content:attr(data-speaker);position:absolute;top:7px;left:16px;font-size:12px;font-weight:700;color:#537085}
.tutorMessage::after{content:attr(data-avatar);position:absolute;top:5px;right:-43px;width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:#e5e0fc;font-size:25px}
.tutorMessage.teacher{margin-left:66px;margin-right:0;background:#fff8df;border-color:#eadbad;border-top-right-radius:4px}
.tutorMessage.student{margin-left:48px;margin-right:18px;background:#e6efff;border-top-left-radius:4px}
.tutorMessage.student::after{left:-43px;right:auto;background:#dcecf5}
.tutorMessage.system{width:auto;margin:10px 0;padding:6px 10px;border:0;background:transparent;text-align:center;font-size:13px;color:#537085}
.tutorMessage.system::before,.tutorMessage.system::after{display:none}
.tutorMessage.teacher{clip-path:polygon(0 0,calc(100% - 8px) 0,100% 8px,100% 100%,0 100%);overflow:visible}.tutorMessage.teacher{clip-path:none}.tutorMessage{filter:drop-shadow(0 1px 1px #19446b12)}

.tutorSource{cursor:pointer;min-height:100px}.tutorSource:focus-visible{outline:3px solid #ffba34}.tutorSource strong{font-size:17px}.tutorSource .tutorActions{padding-top:8px}
.tutorMessage.teacher{width:calc(100% - 110px);margin-left:66px;margin-right:44px}.tutorMessage.teacher::after{right:-43px}.tutorMessages{overflow-x:hidden}

.tutorDialog{resize:both;min-width:min(320px,calc(100vw - 24px));min-height:360px;max-width:calc(100vw - 24px)}
.tutorDialog header{cursor:move;touch-action:none;user-select:none}
.tutorDialog header button{cursor:pointer}

.tutorMemory{margin:4px 20px;font-size:13px;flex-shrink:0;max-height:26dvh;overflow:auto;background:#edf6ed;border-radius:12px;padding:8px}
.tutorMemory summary{cursor:pointer;font-weight:bold}.tutorMemory label{display:block;margin-top:8px}
.tutorMemory textarea{box-sizing:border-box;width:100%;font:inherit;border:1px solid #bdd4c6;border-radius:8px;padding:6px;resize:vertical}
.tutorMemory button{font-size:12px;margin:4px;min-height:36px}.tutorMemory .memoryStatus{line-height:1.5}

.tutorCardGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.tutorDialog .tutorCard{display:block;min-width:0;padding:8px;background:#fff;border:1px solid #b8d8ea;text-align:left;overflow:hidden;border-radius:16px}
.tutorCard>small{font-size:11px;display:block;color:#537085}.tutorCard>strong{display:block;font-size:14px;line-height:1.5;margin-top:6px}
.tutorCardViewport{height:135px;overflow:hidden;position:relative;margin-top:6px;pointer-events:none}
.tutorCardReplica.node{position:absolute;left:0;top:0;width:580px;height:auto;min-height:300px;transform:scale(.35);transform-origin:top left;--branch:#7fb5db;pointer-events:none;animation:none}
.tutorCardReplica .study{opacity:.65}.tutorArrival{animation:tutorArrivalGlow 1.8s ease-out!important}
.node.tutorFoundLecture{outline:4px solid #ffe45b;outline-offset:3px;box-shadow:0 0 0 3px #fff,0 0 0 7px #ffd342,0 0 24px 10px #ffdf7080;animation:tutorFoundLectureGlow 2.4s ease-in-out infinite!important}
@keyframes tutorFoundLectureGlow{0%,100%{box-shadow:0 0 0 3px #fff,0 0 0 7px #ffd342,0 0 20px 8px #ffdf7070}50%{box-shadow:0 0 0 3px #fff,0 0 0 7px #ffe55e,0 0 32px 14px #ffe877aa}}
@media(prefers-reduced-motion:reduce){.node.tutorFoundLecture{animation:none!important}}
@keyframes tutorArrivalGlow{0%,25%{box-shadow:0 0 0 12px #ffe47a,0 0 100px 50px #fff6c3}100%{box-shadow:0 0 0 0 transparent}}
.tutorTravelLight{position:absolute;pointer-events:none;left:50%;top:50%;z-index:15;width:1px;height:1px}.tutorTravelLight i{position:absolute;color:#ffd34b;font-size:22px;font-style:normal;animation:tutorStarTravel 1.2s ease-out both;transform:rotate(var(--angle))}
@keyframes tutorStarTravel{from{opacity:0;transform:rotate(var(--angle)) translateX(var(--distance)) scale(1.4)}30%{opacity:1}to{opacity:0;transform:rotate(var(--angle)) translateX(8px) scale(.1)}}
@media(max-width:400px){.tutorCardReplica.node{transform:scale(.24)}.tutorCardViewport{height:100px}}
@media(prefers-reduced-motion:reduce){.tutorArrival{animation:none!important}.tutorTravelLight{display:none}}

.tutorBubbleTail{position:absolute;top:22px;right:-9px;width:16px;height:16px;background:#fff8df;border-top:1px solid #eadbad;border-right:1px solid #eadbad;transform:rotate(45deg)}
.tutorMessage.student .tutorBubbleTail{right:auto;left:-9px;background:#e6efff;border-right:0;border-top:0;border-left:1px solid #d5e7f0;border-bottom:1px solid #d5e7f0}
.tutorMessage.system .tutorBubbleTail{display:none}.tutorMessage{animation:tutorBubblePop .28s cubic-bezier(.2,.8,.3,1.2);transform-origin:top right}.tutorMessage.student{transform-origin:top left}
@keyframes tutorBubblePop{from{opacity:0;transform:translateY(7px) scale(.94)}70%{opacity:1;transform:translate(-2px,-1px) scale(1.01)}to{transform:none}}
@media(prefers-reduced-motion:reduce){.tutorMessage{animation:none}}

.guardianMemoryDialog{width:min(540px,calc(100vw - 32px));max-height:85dvh;overflow:auto;border:2px solid #bdd4c6;border-radius:20px;background:#f5faf5;padding:16px;color:#204f72}
.guardianMemoryDialog .tutorMemory{max-height:none;margin:12px 0}.guardianMemoryDialog summary{display:none}.guardianMemoryDialog button{font:inherit;min-height:44px;padding:8px 12px;border:1px solid #bdd4c6;border-radius:10px;background:white;cursor:pointer}

/* Readable full cards without an extra frame; fit their complete natural height. */
.tutorCardGrid{grid-template-columns:repeat(auto-fit,minmax(min(260px,100%),1fr));gap:20px}
.tutorDialog .tutorCard{padding:0;background:transparent;border:0;border-radius:0;overflow:visible}
.tutorCardViewport{margin:0;width:100%;height:auto;overflow:visible}
.tutorCardReplica.node{min-height:0;box-sizing:border-box}
.tutorCard>strong{font-size:18px;line-height:1.45;margin-top:10px}
.tutorCard>small{font-size:13px;line-height:1.6;margin-top:5px}
.tutorDialog .tutorResizeGrip{position:absolute;right:3px;bottom:3px;z-index:5;box-sizing:border-box;width:24px;height:24px;min-width:0;min-height:24px;padding:0;border:1px solid #1784b5;border-radius:5px 0 9px 0;background:#d3efff;color:#09648f;font-size:17px;font-weight:bold;line-height:1;cursor:nwse-resize;touch-action:none}
.tutorDialog form{padding-right:42px;padding-bottom:24px}

.tutorDialog{position:fixed;z-index:1100;inset:0}
.tutorDialog.tutorMinimized{display:none!important}
.tutorDock{position:fixed;right:22px;bottom:24px;z-index:1101;width:64px;height:64px;border:3px solid #95bfe9;border-radius:50%;background:#fff4cc;box-shadow:0 5px 20px #17456e44;font-size:36px;cursor:pointer}
.tutorDock[hidden]{display:none}
.tutorDialog .tutorMinimize{margin-left:auto;background:white;border:0;font-size:24px;min-width:44px}
.tutorClose{margin-left:0}

.tutorDock{touch-action:none;user-select:none;cursor:grab}.tutorDock:active{cursor:grabbing}

.tutorDock{box-sizing:border-box;display:grid;place-items:center;padding:0;line-height:1;font-family:"Segoe UI Emoji","Apple Color Emoji",sans-serif}.tutorDock[hidden]{display:none}

.tutorDock>span{display:block;width:42px;height:42px;line-height:42px;text-align:center;font-size:36px;transform:translate(-2px,-1px)}

.tutorCardGrid{display:flex;flex-direction:column;align-items:flex-end;margin:12px 44px 18px 66px;gap:16px}
.tutorDialog .tutorCard{width:88%;max-width:360px}
.tutorCardReplica{position:absolute;left:0;top:0;transform-origin:top left;pointer-events:none}
.tutorCard>small{font-size:12px;line-height:1.5;margin-top:8px}

.tutorPortal{position:absolute;inset:0;z-index:18;pointer-events:none;overflow:hidden;background:radial-gradient(circle at center,#332a6c44 0,transparent 42%);animation:tutorPortalFade 1.2s ease-out both}
.tutorPortal i{position:absolute;left:50%;top:50%;width:80vmin;height:80vmin;margin:-40vmin;border:3px solid #b7b7ff;border-radius:50%;box-shadow:0 0 24px #c9c5ff,inset 0 0 28px #cff6ff;animation:tutorPortalDive 1s cubic-bezier(.35,.05,.8,.55) both}
.tutorPortal i:nth-child(2){animation-delay:.12s}.tutorPortal i:nth-child(3){animation-delay:.24s}.tutorPortal i:nth-child(4){animation-delay:.36s}
.tutorPortal span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:70px;color:#fff8ba;text-shadow:0 0 25px #fff}
@keyframes tutorPortalDive{from{opacity:0;transform:scale(1.6) rotate(0)}25%{opacity:.7}to{opacity:0;transform:scale(.025) rotate(100deg)}}
@keyframes tutorPortalFade{0%,100%{opacity:0}20%,65%{opacity:1}}


.tutorPortal b{position:absolute;left:50%;top:50%;transform-origin:0 50%;pointer-events:none;animation:tutorPortalRush 1.1s cubic-bezier(.35,.05,.8,.55) var(--delay) both}
.tutorPortalWind{width:28vmin;height:2px;background:linear-gradient(90deg,transparent,#d9faff);box-shadow:0 0 8px #a8b8ff;border-radius:100%}
.tutorPortalParticle{width:8px;height:8px;background:#fff7b7;border-radius:50%;box-shadow:0 0 13px #cff7ff}
@keyframes tutorPortalRush{0%{opacity:0;transform:rotate(var(--ray)) translateX(75vmin) scaleX(1.7)}18%{opacity:.95}85%{opacity:.8}100%{opacity:0;transform:rotate(calc(var(--ray) + 22deg)) translateX(0) scaleX(.05)}}

/* A brief invitation every twelve seconds, without moving the drag target. */

.tutorDock[data-dragging]>span,.tutorDock:hover>span,.tutorDock:focus-visible>span{animation:none}
@keyframes tutorDockInvite{0%,20%,100%{transform:translate(-2px,-1px) rotate(0)}2%,6%,10%,14%,18%{transform:translate(-6px,-2px) rotate(-18deg)}4%,8%,12%,16%{transform:translate(2px,-2px) rotate(18deg)}}
/* Compact phone tutor: enlarge controls by 150% and reserve a scrollable conversation. */
@media(max-width:900px){
 .tutorDialog{font-size:13.5px;-webkit-text-size-adjust:100%;text-size-adjust:100%;width:var(--tutor-mobile-width,90vw)!important;height:var(--tutor-mobile-height,90dvh)!important;min-width:0;min-height:0;max-width:var(--tutor-mobile-width,90vw)!important;max-height:var(--tutor-mobile-height,90dvh)!important;left:var(--tutor-mobile-left,5vw)!important;top:var(--tutor-mobile-top,5dvh)!important;right:auto!important;bottom:auto!important;margin:0!important;border-radius:21px;resize:none}
 .tutorDialog header{box-sizing:border-box;flex-wrap:nowrap;align-items:flex-start;gap:9px;padding:13.5px 15px;height:auto;min-height:0;cursor:move}
 .tutorDialog header>div{flex:1;min-width:0}
 .tutorDialog header strong{display:block;font-size:18px;line-height:1.4;overflow-wrap:anywhere}
 .tutorDialog header p{font-size:12px;line-height:1.5;margin:6px 0 0;overflow-wrap:anywhere}
 .tutorDialog button,.tutorDialog a{box-sizing:border-box;font-size:13.5px;min-height:42px;padding:7.5px 10.5px;border-radius:12px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
 .tutorDialog header .tutorClose,.tutorDialog header .tutorMinimize{flex:0 0 42px;min-width:42px;width:42px;height:42px;padding:0;font-size:21px!important;line-height:1;margin:0}
 .tutorMode{font-size:12px;line-height:1.5;margin:9px 15px;overflow-wrap:anywhere}
 .tutorMessages{height:auto;min-height:0;padding:0 15px 12px;flex:1 1 0;overflow-y:auto;overflow-x:hidden}
 .tutorMessage{font-size:13.5px;line-height:1.6;padding:30px 13.5px 13.5px;border-radius:16.5px;margin-top:15px;margin-bottom:15px}
 .tutorMessage::before{font-size:10.5px;top:7.5px;left:13.5px}
 .tutorMessage::after{width:30px;height:30px;font-size:24px;top:7.5px;right:-36px}
 .tutorMessage.teacher{width:calc(100% - 87px);margin-left:51px;margin-right:36px}
 .tutorMessage.student{width:calc(100% - 72px);margin-left:36px;margin-right:36px}
 .tutorMessage.student::after{left:-36px;right:auto}
 .tutorBubbleTail{width:13.5px;height:13.5px;top:22.5px;right:-7.5px}
 .tutorMessage.student .tutorBubbleTail{left:-7.5px}
 .tutorMessage.system{font-size:12px;line-height:1.5;width:auto;padding:6px;margin:7.5px 0}
 .tutorDialog>button:not(.tutorResizeGrip){flex-shrink:0;margin:4.5px 15px;min-height:45px;border-width:1.5px}
 .tutorSuggestions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:6px 15px;gap:6px}
 .tutorSuggestions button{font-size:12px;min-width:0;min-height:39px;padding:6px}
 .tutorDialog form{padding:10.5px 40px 13.5px 15px}
 .tutorDialog label{font-size:12px;line-height:1.5;margin-bottom:6px}
 .tutorInput{gap:6px}
 .tutorInput input{box-sizing:border-box;font-size:16px;width:0;min-width:0;padding:10.5px 12px;border-radius:13.5px;min-height:45px}
 .tutorInput button{font-size:13.5px;padding:7.5px 12px;min-height:45px}
 .tutorDialog .tutorResizeGrip{width:22px;height:22px;min-width:0;min-height:22px;padding:0;font-size:16px;border-radius:5px 0 9px 0}
 .tutorCardGrid{margin:9px 36px 15px 51px;gap:13.5px;min-width:0}
 .tutorDialog .tutorCard{width:88%;max-width:405px}
 .tutorCard>small{font-size:12px;line-height:1.5;margin-top:6px}
}
@media(max-width:600px) and (max-height:400px){
 .tutorDialog header p,.tutorMode,.tutorSuggestions{display:none}
 .tutorDialog header{padding:5px 10px}
 .tutorDialog form{padding-top:4px;padding-bottom:4px}
}
@media(max-width:600px){.tutorMessage.teacher::after{right:-36px}}

.tutorVoiceControls{flex-shrink:0;margin:4px 18px 0}
.tutorVoiceButtons{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:6px}
.tutorVoiceButtons button{min-width:0;padding:9px 5px;font-size:12px;line-height:1.4;border:1px solid #9ecbd8;border-radius:12px;background:#effaff;color:#175371}
.tutorHold{touch-action:none;user-select:none;-webkit-user-select:none}
.tutorVoiceButtons button[aria-pressed=true]{background:#087fc5;color:white;border-color:#087fc5}
.tutorVoiceButtons button:disabled{opacity:.55}
.tutorVoiceStatus{margin:4px 0;font-size:11px;line-height:1.4;color:#486979}
@media(max-width:600px){.tutorVoiceControls{margin:3px 10px 0}.tutorVoiceButtons{gap:4px}.tutorVoiceButtons button{font-size:13.5px;min-height:48px;padding:7.5px 4.5px;border-radius:8px}.tutorVoiceStatus{font-size:12px;margin:4.5px 0}}

.tutorMaterialsNew{animation:tutorMaterialReveal 1.1s ease-out;outline:2px solid #f0bc48;outline-offset:5px;border-radius:10px;scroll-margin-top:12px}@keyframes tutorMaterialReveal{0%{opacity:.3;transform:translateY(22px) scale(.94);filter:brightness(1.35)}50%{opacity:1;transform:translateY(-3px) scale(1.02)}100%{transform:none;filter:none}}

/* Pending cards take their turn after the teacher text. */
.tutorCard[hidden]{display:none!important}
.tutorMicHelp{flex-shrink:0;margin:3px 18px;color:#355c72;font-size:12px;line-height:1.55;max-height:230px;overflow:auto}
.tutorMicHelp summary{cursor:pointer;padding:5px 0;color:#ad3038;font-weight:600}
.tutorMicHelp[open]{color:#ad3038;background:#fff4f4;border-left:3px solid #dc6770;padding:0 8px;border-radius:6px}
.tutorMicHelp[hidden]{display:none!important}
.tutorMicHelp p{margin:5px 0}.tutorMicHelp ol{margin:5px 0;padding-left:22px}
@media(max-width:600px){.tutorMicHelp{margin:3px 15px;font-size:15px;max-height:26dvh}.tutorMicHelp summary{padding:4px 0}}

.tutorSuggestions:empty{display:none}

.catalogMobileLabel{display:none}.tutorInviteBubble{display:none}
@media(max-width:600px){
 .mainnavWrap .mainnav>.tutorLauncher{display:none}
 .mainnavWrap .mainnav>[data-screen=catalog]{display:flex;grid-column:auto;order:3!important;justify-content:center}
 .mainnavWrap .mainnav>[data-screen=notes]{order:1!important}.mainnavWrap .mainnav>[data-screen=helper]{order:2!important}
 .catalogDesktopLabel{display:none}.catalogMobileLabel{display:inline}
 .tutorDock,.tutorDock[hidden]{display:grid!important;right:12px;bottom:calc(90px + env(safe-area-inset-bottom));width:56px;height:56px;border-width:2px;overflow:visible}
 .tutorInviteBubble{position:absolute;right:0;bottom:calc(100% + 12px);width:190px;box-sizing:border-box;padding:12px 14px;border:1px solid #e5c96d;border-radius:18px;background:#fff9df;color:#355776;font:600 13px/1.5 'Malgun Gothic',sans-serif;text-align:center;box-shadow:0 4px 16px #16466c24;pointer-events:none}
 .tutorInviteBubble::after{content:'';position:absolute;right:19px;bottom:-7px;width:12px;height:12px;background:#fff9df;border-right:1px solid #e5c96d;border-bottom:1px solid #e5c96d;transform:rotate(45deg)}
 .tutorDock.showInvite .tutorInviteBubble{display:block;animation:tutorBubblePop .28s ease-out}
}

@media(max-width:600px){.tutorDock{display:none!important}}

.tutorBackgroundVoice{position:fixed;left:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:1002;max-width:calc(100vw - 180px);min-height:44px;padding:9px 13px;border:2px solid #69b8d2;border-radius:24px;background:#e7faff;color:#185774;font-size:14px;font-weight:700;box-shadow:0 3px 12px #20485b22;cursor:pointer}
.tutorBackgroundVoice[hidden]{display:none}

.tutorDialog.tutorMapTour{inset:auto 12px 12px auto!important;margin:0!important;width:min(360px,calc(100vw - 24px))!important;height:280px!important;max-height:35dvh!important}
.tutorMapTour header{padding:8px 12px}.tutorMapTour header strong{font-size:17px}.tutorMapTour header p,.tutorMapTour .tutorMode,.tutorMapTour .tutorSuggestions,.tutorMapTour form,.tutorMapTour .tutorVoiceButton,.tutorMapTour .tutorVoiceControls,.tutorMapTour .tutorMicHelp{display:none}
.tutorMapTour .tutorMessages{min-height:60px;padding:0 12px 8px}.tutorMapTour .tutorMessage{font-size:14px;line-height:1.5}
@media(max-width:600px){.tutorDialog.tutorMapTour{width:min(290px,calc(100vw - 24px))!important;height:210px!important;max-height:26dvh!important}}

.tutorTourExpand{display:none}.tutorMapTour .tutorTourExpand{display:block}.tutorMapTour header{align-items:center;gap:4px;padding:6px 10px}.tutorMapTour header strong{font-size:15px}.tutorMapTour header p{display:none}.tutorMapTour header button{padding:4px 8px}.tutorMapTour>.tutorVoiceConnect{display:none}
@media(max-width:600px){body.tutorFolded .tutorDock{display:grid!important}}
.tutorTranscriptActions{display:flex;flex-wrap:wrap;gap:8px;margin:8px 0;max-width:100%}
.tutorTranscriptActions button{max-width:100%;min-height:44px;white-space:normal}

/* Readable mobile teacher panel: ninety percent of the visible viewport. */
@media(max-width:900px){
 .tutorDialog{font-size:16px}
 .tutorDialog header strong{font-size:21px}
 .tutorDialog header p,.tutorMode,.tutorDialog label{font-size:14px}
 .tutorMessage{font-size:17px;line-height:1.7}
 .tutorMessage::before{font-size:12px}
 .tutorMessage.teacher{width:calc(100% - 50px);margin-left:14px;margin-right:36px}
 .tutorMessage.student{width:calc(100% - 44px);margin-left:36px;margin-right:8px}
 .tutorMessage.system{font-size:14px;line-height:1.6}
 .tutorDialog button,.tutorDialog a,.tutorVoiceButtons button,.tutorInput button{font-size:15px;min-height:44px}
 .tutorVoiceStatus,.tutorVoiceControls>small{font-size:13px;line-height:1.5}
 .tutorDialog form{padding:10px 15px 14px}
 .tutorCardGrid{margin-left:14px;margin-right:36px}
 .tutorDialog .tutorResizeGrip{display:none}
}

.tutorCardArrival{animation:tutorCardMagic 2.2s ease-out!important}.tutorStudyChoices{display:flex;gap:10px;flex-wrap:wrap;margin:12px 0}.tutorStudyChoices button{background:#e8f8ff;border:1px solid #8ccae7;color:#20556f;min-height:44px}@keyframes tutorCardMagic{0%,35%{box-shadow:0 0 8px 4px #c3abff,0 0 35px 12px #b8ecff}70%{box-shadow:0 0 14px 2px #e0ccff,0 0 28px 8px #f4df99}100%{box-shadow:0 3px 6px #38586718}}@media(prefers-reduced-motion:reduce){.tutorCardArrival{animation:none!important;outline:3px solid #b8a0ef}}


.tutorMessages .tutorMessage[hidden],.tutorMessages .tutorCard[hidden]{display:none!important}

/* Keep each arriving block's first line visible, including the last card. */
.tutorMessages::after{content:'';display:block;height:var(--tutor-reading-space,0px);pointer-events:none}

/* One temporary status, replaced by the answer when the request completes. */
.tutorMessage.system.tutorPending{display:flex;align-items:center;justify-content:center;gap:12px;padding:18px 12px;background:#eaf7fc;border:1px solid #cbe8f1;border-radius:18px;color:#37627a;font-size:14px;white-space:normal}
.tutorPendingGraphic{display:inline-flex;align-items:center;gap:5px;flex-shrink:0;height:24px}
.tutorPendingGraphic i{width:8px;height:8px;border-radius:50%;background:#149ec7;animation:tutorThinking .9s ease-in-out infinite}
.tutorPendingGraphic i:nth-child(2){animation-delay:.15s;background:#47b8af}.tutorPendingGraphic i:nth-child(3){animation-delay:.3s;background:#9a7bdf}
@keyframes tutorThinking{0%,80%,100%{transform:translateY(0);opacity:.4}40%{transform:translateY(-7px);opacity:1}}
@media(prefers-reduced-motion:reduce){.tutorPendingGraphic i{animation:none;opacity:.8}}

/* Cyclic thinking illustration, not a measured completion percentage. */
.tutorPendingGraphic{position:relative;display:inline-block;width:54px;height:54px}
.tutorBrainBase,.tutorBrainFill{position:absolute;inset:0;display:grid;place-items:center;font-size:38px;line-height:1}
.tutorBrainBase{filter:grayscale(1);opacity:.28}
.tutorBrainFill{animation:tutorBrainThinking 2.4s ease-in-out infinite}
.tutorBrainSpark{position:absolute;right:-2px;top:-2px;color:#7853cb;font-size:20px;animation:tutorBrainTwinkle 1.2s ease-in-out infinite}
@keyframes tutorBrainThinking{0%,100%{clip-path:inset(85% 0 0 0)}50%{clip-path:inset(0 0 0 0)}}
@keyframes tutorBrainTwinkle{0%,100%{opacity:.25;transform:scale(.75)}50%{opacity:1;transform:scale(1.15)}}
@media(prefers-reduced-motion:reduce){.tutorBrainFill,.tutorBrainSpark{animation:none}.tutorBrainFill{clip-path:none}}

/* Collect little knowledge pieces, assemble, then sparkle. Repeat while thinking. */
.tutorPendingGraphic{width:84px;height:72px;flex:0 0 84px}
.tutorBrainCharacter{position:absolute;left:15px;top:13px;width:54px;height:54px;animation:tutorBrainBounce 3.6s ease-in-out infinite}
.tutorBrainBase,.tutorBrainFill{font-size:47px}.tutorBrainBase{filter:saturate(.55);opacity:.7}
.tutorBrainFill{animation:tutorKnowledgeFill 3.6s ease-in-out infinite}
.tutorBrainFace{position:absolute;left:17px;top:26px;width:25px;height:17px;background:#ffe8f0;border-radius:45%}
.tutorBrainFace b{position:absolute;top:4px;left:5px;width:3px;height:4px;background:#62465f;border-radius:50%}.tutorBrainFace b:nth-child(2){left:17px}
.tutorBrainFace i{position:absolute;left:10px;top:9px;width:6px;height:4px;border-bottom:2px solid #b84c7c;border-radius:0 0 50% 50%}
.tutorKnowledgePiece{position:absolute;top:2px;left:2px;width:19px;height:19px;display:grid;place-items:center;border-radius:6px;background:#fff;color:#28a0bb;font-size:16px;font-weight:bold;box-shadow:0 2px 4px #5895ae22;animation:tutorKnowledgeGather 3.6s ease-in-out infinite;--gather-x:32px;--gather-y:30px}
.pieceStar{left:64px;top:5px;color:#dfaa20;--gather-x:-29px;--gather-y:27px;animation-delay:.35s}
.pieceIdea{left:3px;top:50px;color:#9170db;--gather-x:30px;--gather-y:-20px;animation-delay:.7s}
.tutorBrainSpark{right:4px;top:1px;animation:tutorKnowledgeComplete 3.6s ease-in-out infinite}
@keyframes tutorKnowledgeGather{0%,8%{opacity:0;transform:translate(0,0) scale(.65)}18%{opacity:1;transform:translate(0,0) scale(1)}48%,100%{opacity:0;transform:translate(var(--gather-x),var(--gather-y)) scale(.25)}}
@keyframes tutorKnowledgeFill{0%,10%{clip-path:inset(90% 0 0 0)}35%{clip-path:inset(55% 0 0 0)}55%{clip-path:inset(25% 0 0 0)}70%,90%{clip-path:inset(0 0 0 0)}100%{clip-path:inset(90% 0 0 0)}}
@keyframes tutorBrainBounce{0%,60%,100%{transform:translateY(0) scale(1)}74%{transform:translateY(-4px) scale(1.07)}85%{transform:translateY(0) scale(1)}}
@keyframes tutorKnowledgeComplete{0%,60%,100%{opacity:0;transform:scale(.4)}75%,85%{opacity:1;transform:scale(1.2)}}
@media(prefers-reduced-motion:reduce){.tutorBrainCharacter,.tutorKnowledgePiece,.tutorBrainFill,.tutorBrainSpark{animation:none}.tutorKnowledgePiece{opacity:.8}.tutorBrainFill{clip-path:none}.tutorBrainSpark{opacity:1}}

.tutorLaunching{filter:drop-shadow(0 0 9px #f1c44a);outline:3px solid #ffe48c;outline-offset:4px}

.tutorDialog label.tutorAwaitingReply{padding:8px 12px;border-radius:12px;background:#fff4cf;color:#185481;font-weight:700;border:1px solid #edcb74;line-height:1.5}

.guardianMemoryDialog .memoryActionStatus{line-height:1.6;font-weight:700;color:#174f70;background:#e6f3ff;border-radius:10px;padding:10px;margin:8px 4px;min-height:1.6em;overflow-wrap:anywhere}.guardianMemoryDialog .memoryActionStatus:empty{display:none}.guardianMemoryDialog button:disabled{opacity:.65;cursor:wait}.guardianMemoryDialog textarea[readonly]{background:#edf2ef}

/* A stable reply bubble above the input; hints stay with the teacher feedback. */
.tutorDialog label.tutorAwaitingReply{position:relative;display:block;background:#e5f3ff;border:2px solid #2182c0;color:#124c73;padding:12px 15px;margin-bottom:14px;font-size:16px;line-height:1.5}
.tutorDialog label.tutorAwaitingReply::after{content:'';position:absolute;bottom:-8px;left:26px;width:12px;height:12px;background:#e5f3ff;border-right:2px solid #2182c0;border-bottom:2px solid #2182c0;transform:rotate(45deg)}
.tutorMessage.teacher.tutorHint{border:2px solid #65a399;background:#edf9f3;color:#204d43}

/* Keep the teacher glyph unframed and centered beside the bubble tail. */
.tutorMessage.teacher::after{top:13px;right:-46px;width:36px;height:34px;display:flex;align-items:center;justify-content:center;background:transparent;border-radius:0;font-size:28px;line-height:1;white-space:nowrap;pointer-events:none}

.tutorEndAction{box-sizing:border-box;margin:18px 0 10px;padding:16px;text-align:center;background:#eaf5ef;border:1px solid #bad7c9;border-radius:16px;color:#315f50}.tutorEndAction p{margin:0 0 12px;font-size:15px;line-height:1.6}.tutorDialog .tutorEndAction button{min-width:96px;min-height:44px;border:1px solid #237c69;background:#27856e;color:white;font-weight:700}.tutorEndAction[hidden]{display:none!important}

/* Expanded maps occupy layer 100000; keep the same tutor above that map. */
body.mapHasExpanded .tutorDialog{z-index:100020}
body.mapHasExpanded .tutorDock{z-index:100021}
body.mapHasExpanded .studyFriend{z-index:100005}
body.mapHasExpanded #friendBubble,body.mapHasExpanded #overviewGuideBubble{z-index:100006}
body.mapHasExpanded .friendLaunchFlight{z-index:100022}

/* Selected child portrait uses the same approved artwork as home and reports. */
.tutorMessage.student.hasStudentPortrait::after{display:none}
.tutorMessage.student .tutorStudentPortrait{position:absolute;top:5px;left:-43px;width:34px;height:34px;display:block;border-radius:50%;background:#fff;box-shadow:0 0 0 2px #dcecf5;overflow:hidden}
.tutorStudentPortrait .profileAvatarPicture{display:block;width:100%;height:100%}

.tutorScanPreview{display:block;max-width:100%;max-height:160px;object-fit:contain;margin:10px auto;border:1px solid #cbe8f1;border-radius:12px;background:white}
.tutorPending button{flex:0 0 auto;min-width:76px;background:white;border:1px solid #b8d8f4;color:#195985}
