#hans-ai-root{position:fixed;right:18px;bottom:18px;z-index:999998;font:15px/1.45 system-ui,-apple-system,Segoe UI,sans-serif;color:#202b3a}#hans-ai-root *{box-sizing:border-box}#hans-ai-toggle{background:#145a96;color:#fff;border:0;border-radius:30px;padding:12px 18px;font:700 15px system-ui;box-shadow:0 5px 22px #0003;cursor:pointer}#hans-ai-panel{position:absolute;right:0;bottom:60px;width:min(375px,calc(100vw - 28px));height:min(570px,calc(100dvh - 110px));background:white;border:1px solid #d8e3ee;border-radius:16px;box-shadow:0 8px 35px #0003;overflow:hidden;display:flex;flex-direction:column}#hans-ai-panel[hidden]{display:none!important}#hans-ai-panel header{background:#145a96;color:#fff;padding:10px 14px;min-height:52px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0}#hans-ai-close{background:none;border:0;color:white;font-size:26px;cursor:pointer;line-height:1}#hans-ai-messages{flex:1;min-height:0;overflow-y:auto;padding:10px;background:#f7fafd}#hans-ai-root .hans-ai-msg{white-space:pre-wrap;overflow-wrap:anywhere;max-width:94%;padding:9px 11px;border-radius:12px;margin:0 0 9px;font-size:14px;line-height:1.5}#hans-ai-root .hans-ai-msg.assistant{background:white;border:1px solid #dbe6ef}#hans-ai-root .hans-ai-msg.user{background:#e2f0ff;margin-left:auto}#hans-ai-suggestions,#hans-ai-actions{display:flex;gap:6px;padding:5px 10px;overflow-x:auto;flex-shrink:0;scrollbar-width:thin}#hans-ai-suggestions button,#hans-ai-actions a{flex:0 0 auto;border:1px solid #c7d8e9;border-radius:16px;background:#f2f8ff;color:#145a96;padding:6px 9px;font:600 12px system-ui;text-decoration:none;cursor:pointer;white-space:nowrap}#hans-ai-actions a{background:#e9f7f2;color:#116b4a;border-color:#b7e2d2}#hans-ai-root .hans-ai-notice{font-size:10px;line-height:1.35;color:#475569;margin:0;padding:6px 10px;border-top:1px solid #ddd;flex-shrink:0}#hans-ai-form{display:flex;padding:8px;gap:6px;flex-shrink:0}#hans-ai-input{flex:1;min-width:0;border:1px solid #cbd5e1;border-radius:8px;padding:9px;font-size:14px}#hans-ai-form button{background:#145a96;color:white;border:0;border-radius:8px;padding:9px 12px;cursor:pointer}#hans-ai-form button:disabled{opacity:.5}@media(max-width:600px){#hans-ai-root{right:12px;bottom:12px}#hans-ai-panel{right:0;bottom:55px;width:calc(100vw - 24px);height:min(560px,calc(100dvh - 115px));border-radius:14px}#hans-ai-root .hans-ai-notice{font-size:10px;padding:5px 9px}#hans-ai-suggestions,#hans-ai-actions{padding:4px 8px}#hans-ai-root .hans-ai-msg{font-size:13px;padding:8px 10px}}

#hans-ai-lead-open{flex-shrink:0;margin:4px 10px;padding:8px;background:#116b4a;color:white;border:0;border-radius:8px;cursor:pointer;font-weight:700}#hans-ai-lead-open[hidden],#hans-ai-lead-form[hidden]{display:none!important}#hans-ai-lead-form{overflow-y:auto;max-height:58%;flex-shrink:0;background:#fff;padding:10px;border-top:1px solid #d8e3ee;display:flex;flex-direction:column;gap:6px;font-size:12px}#hans-ai-lead-form label{display:flex;flex-direction:column;gap:3px}#hans-ai-lead-form input,#hans-ai-lead-form select,#hans-ai-lead-form textarea{font:inherit;border:1px solid #cbd5e1;border-radius:6px;padding:7px;width:100%}#hans-ai-lead-form .hans-ai-consent{flex-direction:row;align-items:flex-start}#hans-ai-lead-form .hans-ai-consent input{width:auto}#hans-ai-lead-form button{border:0;border-radius:6px;padding:8px;background:#145a96;color:white;cursor:pointer}#hans-ai-lead-form button:disabled{opacity:.5}#hans-ai-lead-form .hans-ai-hp{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important}#hans-ai-lead-result{margin:0;overflow-wrap:anywhere}
/* v1.2.2: keep HANS AI clear of Tutor LMS fixed lesson controls on all mobile pages. */
@media(max-width:600px){#hans-ai-root{bottom:110px;bottom:calc(110px + env(safe-area-inset-bottom, 0px))}#hans-ai-panel{height:min(560px,calc(100dvh - 215px))}}
/* Lead form takes the available chat space, rather than stacking underneath messages. */
#hans-ai-root.hans-ai-lead-mode #hans-ai-messages,#hans-ai-root.hans-ai-lead-mode #hans-ai-suggestions,#hans-ai-root.hans-ai-lead-mode #hans-ai-actions,#hans-ai-root.hans-ai-lead-mode #hans-ai-form{display:none!important}
#hans-ai-root.hans-ai-lead-mode #hans-ai-lead-form{flex:1;max-height:none;min-height:0;overflow-y:auto;padding:14px;gap:10px;font-size:14px}
#hans-ai-root.hans-ai-lead-mode #hans-ai-lead-form input,#hans-ai-root.hans-ai-lead-mode #hans-ai-lead-form select,#hans-ai-root.hans-ai-lead-mode #hans-ai-lead-form textarea{font-size:16px;min-height:42px}
#hans-ai-root.hans-ai-lead-mode #hans-ai-lead-form .hans-ai-consent input{min-height:initial;width:18px;height:18px;flex-shrink:0}
#hans-ai-root.hans-ai-lead-mode #hans-ai-lead-form button{min-height:42px;font-size:14px}
#hans-ai-lead-success[hidden]{display:none!important}
#hans-ai-lead-success{flex:1;min-height:0;overflow-y:auto;padding:20px 16px;background:#f0faf4;color:#174b34;font-size:15px;line-height:1.5}
#hans-ai-lead-success strong{display:block;font-size:20px}
#hans-ai-lead-success a{display:block;margin:15px 0;color:#145a96;font-weight:700}
#hans-ai-lead-success button{border:0;border-radius:8px;background:#145a96;color:#fff;padding:11px 15px;font-size:14px;cursor:pointer}
#hans-ai-root.hans-ai-lead-mode #hans-ai-lead-success:not([hidden])~.hans-ai-notice{font-size:10px}

/* v1.2.3: mobile-only dedicated new-tab chat; retain v1.2.2 lesson-navigation clearance. */
@media(max-width:600px){
 body.hans-ai-chat-page{margin:0!important;padding:0!important;overflow:hidden!important;background:#f7fafd!important;}
 body.hans-ai-chat-page #hans-ai-root{position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;z-index:2147483000!important;}
 body.hans-ai-chat-page #hans-ai-toggle{display:none!important;}
 body.hans-ai-chat-page #hans-ai-panel{position:fixed!important;inset:0!important;right:0!important;bottom:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;}
 body.hans-ai-chat-page #hans-ai-panel header{padding-top:calc(10px + env(safe-area-inset-top,0px));}
 body.hans-ai-chat-page #hans-ai-form{padding-bottom:calc(8px + env(safe-area-inset-bottom,0px));}
}

/* v1.2.4: dedicated mobile experience; desktop widget and lesson clearance unchanged. */
#hans-ai-mobile-hero[hidden]{display:none!important}
@media(max-width:600px){
body.hans-ai-chat-page #hans-ai-panel{background:#fff!important;}
body.hans-ai-chat-page #hans-ai-panel header{background:#112c4a!important;padding:14px 18px!important;min-height:62px!important;}
body.hans-ai-chat-page #hans-ai-mobile-hero{display:block!important;flex:0 0 auto;background:#112c4a;color:white;padding:16px 20px 18px;max-height:38dvh;overflow:auto;}
body.hans-ai-chat-page #hans-ai-mobile-hero .hans-ai-eyebrow{font-size:10px;letter-spacing:1.2px;font-weight:700;opacity:.75;margin:0 0 12px;}
body.hans-ai-chat-page #hans-ai-mobile-hero h1{font-size:clamp(23px,6vw,34px);font-weight:750;line-height:1.15;margin:0 0 5px;color:#fff;}
body.hans-ai-chat-page #hans-ai-mobile-hero h2{font-size:clamp(18px,4.7vw,25px);font-weight:700;line-height:1.2;margin:0 0 9px;color:#fff;}
body.hans-ai-chat-page #hans-ai-mobile-hero p:not(.hans-ai-eyebrow){font-size:13px;line-height:1.4;color:#e4edf7;margin:0 0 12px;}
body.hans-ai-chat-page #hans-ai-start{background:#fff;color:#112c4a;border:0;border-radius:11px;padding:10px 16px;font-weight:750;min-height:42px;cursor:pointer;}
body.hans-ai-chat-page #hans-ai-return{display:inline-block;color:#e4edf7;font-size:12px;margin-left:13px;text-decoration:underline;}
body.hans-ai-chat-page #hans-ai-messages{min-height:0;flex:1;}
body.hans-ai-chat-page #hans-ai-form{padding-bottom:calc(9px + env(safe-area-inset-bottom,0px));}
}
@media(max-width:600px) and (max-height:620px){body.hans-ai-chat-page #hans-ai-mobile-hero{max-height:26dvh;padding:8px 16px;}body.hans-ai-chat-page #hans-ai-mobile-hero .hans-ai-eyebrow,body.hans-ai-chat-page #hans-ai-mobile-hero p:not(.hans-ai-eyebrow){display:none;}body.hans-ai-chat-page #hans-ai-mobile-hero h1{font-size:20px;}body.hans-ai-chat-page #hans-ai-mobile-hero h2{font-size:16px;}}

/* v1.2.5: chat-first mobile layout. Hide onboarding shortcuts after first question. */
#hans-ai-root.hans-ai-chat-started #hans-ai-suggestions,
#hans-ai-root.hans-ai-chat-started #hans-ai-actions,
#hans-ai-root.hans-ai-chat-started #hans-ai-lead-open,
#hans-ai-root.hans-ai-chat-started #hans-ai-start{display:none!important;}
@media(max-width:600px){
 body.hans-ai-chat-page #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero{padding:8px 16px!important;max-height:none!important;overflow:visible!important;}
 body.hans-ai-chat-page #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero .hans-ai-eyebrow,
 body.hans-ai-chat-page #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero h2,
 body.hans-ai-chat-page #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero p:not(.hans-ai-eyebrow){display:none!important;}
 body.hans-ai-chat-page #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero h1{font-size:17px!important;display:inline-block!important;margin:0 10px 0 0!important;}
 body.hans-ai-chat-page #hans-ai-root.hans-ai-chat-started #hans-ai-return{margin:0!important;font-size:12px!important;}
 body.hans-ai-chat-page #hans-ai-input{font-size:16px;}
}

/* v1.2.6: synchronous full-viewport mobile overlay; never navigate to about:blank. */
@media(max-width:600px){
 body.hans-ai-overlay-open{overflow:hidden!important;}
 body.hans-ai-overlay-open #hans-ai-root{position:fixed!important;inset:0!important;right:0!important;bottom:0!important;width:100vw!important;height:100dvh!important;z-index:2147483000!important;}
 body.hans-ai-overlay-open #hans-ai-toggle{display:none!important;}
 body.hans-ai-overlay-open #hans-ai-panel{position:fixed!important;inset:0!important;right:0!important;bottom:0!important;width:100vw!important;height:100dvh!important;max-width:none!important;max-height:none!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;}
 body.hans-ai-overlay-open #hans-ai-panel header{background:#112c4a!important;padding:calc(14px + env(safe-area-inset-top,0px)) 18px 14px!important;min-height:62px!important;}
 body.hans-ai-overlay-open #hans-ai-mobile-hero{display:block!important;flex:0 0 auto;background:#112c4a;color:#fff;padding:16px 20px 18px;max-height:38dvh;overflow:auto;}
 body.hans-ai-overlay-open #hans-ai-mobile-hero .hans-ai-eyebrow{font-size:10px;letter-spacing:1.2px;font-weight:700;opacity:.75;margin:0 0 12px;}
 body.hans-ai-overlay-open #hans-ai-mobile-hero h1{font-size:clamp(23px,6vw,34px);font-weight:750;line-height:1.15;margin:0 0 5px;color:#fff;}
 body.hans-ai-overlay-open #hans-ai-mobile-hero h2{font-size:clamp(18px,4.7vw,25px);font-weight:700;line-height:1.2;margin:0 0 9px;color:#fff;}
 body.hans-ai-overlay-open #hans-ai-mobile-hero p:not(.hans-ai-eyebrow){font-size:13px;line-height:1.4;color:#e4edf7;margin:0 0 12px;}
 body.hans-ai-overlay-open #hans-ai-start{background:#fff;color:#112c4a;border:0;border-radius:11px;padding:10px 16px;font-weight:750;min-height:42px;cursor:pointer;}
 body.hans-ai-overlay-open #hans-ai-return{display:inline-block;color:#e4edf7;font-size:12px;margin-left:13px;text-decoration:underline;}
 body.hans-ai-overlay-open #hans-ai-form{padding-bottom:calc(9px + env(safe-area-inset-bottom,0px));}
 body.hans-ai-overlay-open #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero{padding:8px 16px!important;max-height:none!important;overflow:visible!important;}
 body.hans-ai-overlay-open #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero .hans-ai-eyebrow,
 body.hans-ai-overlay-open #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero h2,
 body.hans-ai-overlay-open #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero p:not(.hans-ai-eyebrow){display:none!important;}
 body.hans-ai-overlay-open #hans-ai-root.hans-ai-chat-started #hans-ai-mobile-hero h1{font-size:17px!important;display:inline-block!important;margin:0 10px 0 0!important;}
 body.hans-ai-overlay-open #hans-ai-root.hans-ai-chat-started #hans-ai-return{margin:0!important;font-size:12px!important;}
}
@media(max-width:600px) and (max-height:620px){body.hans-ai-overlay-open #hans-ai-mobile-hero{max-height:26dvh;padding:8px 16px;}body.hans-ai-overlay-open #hans-ai-mobile-hero .hans-ai-eyebrow,body.hans-ai-overlay-open #hans-ai-mobile-hero p:not(.hans-ai-eyebrow){display:none;}}

/* v1.2.7: on-demand actions are compact and remain accessible after chat starts. */
#hans-ai-recovered-actions{display:flex;flex-wrap:wrap;gap:7px;padding:7px 10px;max-height:110px;overflow-y:auto;flex-shrink:0;background:#f7fafd;border-top:1px solid #dbe6ef;}
#hans-ai-recovered-actions[hidden],#hans-ai-show-actions[hidden]{display:none!important;}
#hans-ai-recovered-actions a,#hans-ai-recovered-actions button{display:inline-block;max-width:100%;font:700 12px/1.35 system-ui,sans-serif;color:#fff;background:#116b4a;border:0;border-radius:8px;padding:10px 12px;text-decoration:none;cursor:pointer;white-space:normal;text-align:center;}
#hans-ai-show-actions{flex-shrink:0;align-self:center;border:1px solid #c7d8e9;border-radius:14px;background:#fff;color:#145a96;font:600 12px system-ui;padding:5px 12px;margin:3px 0;cursor:pointer;}
#hans-ai-root.hans-ai-lead-mode #hans-ai-recovered-actions,#hans-ai-root.hans-ai-lead-mode #hans-ai-show-actions{display:none!important;}

/* v1.2.8: accessible contact card, visible only when human support is requested. */
#hans-ai-recovered-actions:has(.hans-ai-desk){max-height:min(42dvh,340px);align-items:flex-start;overflow-y:auto;}
#hans-ai-recovered-actions .hans-ai-desk{flex:1 1 100%;min-width:0;background:#fff;border:1px solid #d4e3ed;border-radius:10px;padding:10px;color:#18324a;font:14px/1.45 system-ui,sans-serif;}
#hans-ai-recovered-actions .hans-ai-desk strong{display:block;margin-bottom:6px;font-size:15px;}
#hans-ai-recovered-actions .hans-ai-desk-group{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:7px 0;}
#hans-ai-recovered-actions .hans-ai-desk-group span{font-weight:700;min-width:75px;}
#hans-ai-recovered-actions .hans-ai-desk-group a{font-size:12px;padding:7px 9px;overflow-wrap:anywhere;}

/* v1.3.0: hide assistant during active Tutor LMS assessments only. */
body.hans-ai-exam-active #hans-ai-root{display:none!important;visibility:hidden!important;pointer-events:none!important;}

/* v1.3.1: small edge tab on mobile Tutor LMS quiz intro/history pages.
   Keep the entire results area readable; full assistant still opens on tap.
   The existing active-exam guard always takes precedence. */
@media(max-width:600px){
 body.single-tutor_quiz:not(.hans-ai-chat-page) #hans-ai-root:not(.hans-ai-lead-mode){
   right:0!important;bottom:auto!important;top:52dvh!important;
   transform:none!important;
 }
 body.single-tutor_quiz:not(.hans-ai-chat-page) #hans-ai-toggle{
   display:flex!important;align-items:center;justify-content:center;
   width:38px!important;height:48px!important;min-width:38px!important;
   padding:0!important;border-radius:12px 0 0 12px!important;
   font-size:0!important;line-height:1!important;
   box-shadow:0 3px 12px #0004!important;
 }
 body.single-tutor_quiz:not(.hans-ai-chat-page) #hans-ai-toggle::before{
   content:"✦";font-size:23px;line-height:1;color:#fff;
 }
 body.single-tutor_quiz:not(.hans-ai-chat-page) #hans-ai-panel{
   right:8px!important;bottom:auto!important;top:0!important;
 }
 body.hans-ai-exam-active #hans-ai-root{display:none!important;}
}


/* v1.3.2: Tutor LMS lesson reading view uses the same compact edge-tab
   as quiz introduction/results. The chat overlay itself is left untouched.
   Do not apply on the dashboard or ordinary site pages. */
@media (max-width:600px){
 body.single-tutor_lesson:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-root:not(.hans-ai-lead-mode){
   right:0!important;bottom:auto!important;top:52dvh!important;
   transform:none!important;
 }
 body.single-tutor_lesson:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-toggle{
   display:flex!important;align-items:center;justify-content:center;
   width:38px!important;height:48px!important;min-width:38px!important;
   padding:0!important;border-radius:12px 0 0 12px!important;
   font-size:0!important;line-height:1!important;
   box-shadow:0 3px 12px #0004!important;
 }
 body.single-tutor_lesson:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-toggle::before{
   content:"✦";font-size:23px;line-height:1;color:#fff;
 }
 body.single-tutor_lesson:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-panel{
   right:8px!important;bottom:auto!important;top:0!important;
 }
 body.hans-ai-exam-active #hans-ai-root{display:none!important;}
}

/* v1.3.3: robust compact tab on Tutor LMS mobile lesson-player pages.
   Uses URL/body detection rather than relying on a single WordPress body class. */
@media (max-width:600px){
 body.hans-ai-tutor-lesson:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-root:not(.hans-ai-lead-mode){
  right:0!important;left:auto!important;bottom:auto!important;top:52dvh!important;transform:none!important;
 }
 body.hans-ai-tutor-lesson:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-toggle{
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:38px!important;height:48px!important;min-width:38px!important;
  padding:0!important;border-radius:12px 0 0 12px!important;font-size:0!important;line-height:1!important;
  box-shadow:0 3px 12px #0004!important;
 }
 body.hans-ai-tutor-lesson:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-toggle::before{
  content:"✦";font-size:23px;line-height:1;color:#fff;
 }
 body.hans-ai-tutor-lesson:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-panel{
  right:8px!important;bottom:auto!important;top:0!important;
 }
 body.hans-ai-exam-active #hans-ai-root{display:none!important;}
}

/* v1.3.4: confirmed widget selectors; singular /lesson/ URLs get
   hans-ai-compact-lesson on the root. Leave the mobile chat overlay full size. */
@media (max-width:600px){
 body:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-root.hans-ai-compact-lesson:not(.hans-ai-lead-mode){
  position:fixed!important;right:0!important;left:auto!important;
  bottom:auto!important;top:52dvh!important;transform:none!important;
 }
 body:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-root.hans-ai-compact-lesson #hans-ai-toggle{
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:38px!important;height:48px!important;min-width:38px!important;
  max-width:38px!important;padding:0!important;
  border-radius:12px 0 0 12px!important;font-size:0!important;line-height:1!important;
  box-shadow:0 3px 12px #0004!important;
 }
 body:not(.hans-ai-chat-page):not(.hans-ai-overlay-open) #hans-ai-root.hans-ai-compact-lesson #hans-ai-toggle::before{
  content:"✦";font-size:23px;line-height:1;color:#fff;
 }
 body.hans-ai-exam-active #hans-ai-root{display:none!important;visibility:hidden!important;pointer-events:none!important;}
}
