/* MoneyBuddy student experience v60. Scoped refinements; original palette/artwork intact. */
:root { --mb-student-ink:#173e36; --mb-student-line:#e1e9e3; }
#mbMyBuddyShortcut { position:fixed; z-index:100; right:16px; top:86px; display:inline-flex; align-items:center; gap:8px; padding:7px 13px 7px 7px; color:#163b34; background:#fffefa; border:1px solid #d4e4d9; border-radius:999px; box-shadow:0 5px 19px rgba(22,52,42,.13); font:700 12px/1.2 Inter,system-ui,sans-serif; cursor:pointer; max-width:min(220px,calc(100vw - 32px)); }
#mbMyBuddyShortcut img { width:34px; height:34px; flex:0 0 34px; object-fit:contain; }
#mbMyBuddyShortcut:hover { border-color:#6a9c7b; box-shadow:0 6px 25px rgba(22,52,42,.19); }
#mbMyBuddyShortcut:focus-visible, .mb-student-path button:focus-visible, .mb-goal-option:focus-visible, #mbStudentGoalAction:focus-visible, .mb-lesson-practice:focus-visible { outline:3px solid #be9442!important; outline-offset:3px!important; }
.mb-savings-clarifier { display:block; font-size:12px; line-height:1.6; color:#476055; background:#f0f7f0; border:1px solid #cfe4d7; border-radius:12px; padding:10px 12px; margin:10px 0 2px; }
.mb-savings-clarifier[hidden] { display:none!important; }
.mb-afford-bills-context { padding:12px; margin-top:12px; background:#fffdf8; border:1px solid #e9dfc2; border-radius:12px; color:#354e46; font-size:12px; line-height:1.5; }
.mb-afford-bills-context>strong{font-size:13px;display:block;margin-bottom:4px}
.mb-afford-bills-context ul { list-style:disc; padding-left:18px; margin:5px 0 8px; }
.mb-afford-bills-context button {color:#134e43;text-decoration:underline;text-underline-offset:3px;font-weight:700; margin-top:6px;}
.mb-student-path { background:#fffdfa; border:1px solid #dfe8df; border-radius:22px; padding:22px; margin:20px 0; box-shadow:0 4px 20px rgba(36,70,52,.045); }
.mb-student-path-heading { display:flex;gap:15px;align-items:center;margin-bottom:18px; }
.mb-student-path-heading img { width:65px; height:65px; object-fit:contain;flex:none; }
.mb-student-path-heading h2 { font-size:20px; font-weight:800; color:#193d35; line-height:1.25; margin:2px 0 4px; }
.mb-student-path-heading p { color:#586b61;font-size:13px;line-height:1.5; }
.mb-student-path-steps { display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:9px;list-style:none;margin:0;padding:0; }
.mb-student-path-steps li {min-width:0}
.mb-student-path-steps button {width:100%;display:flex;align-items:center;gap:9px;text-align:left;background:#f4f8f2;border:1px solid #deeadf;border-radius:14px;padding:11px 9px;min-height:78px;cursor:pointer;color:#183c35;}
.mb-student-path-steps button:hover { background:#e9f4e8;border-color:#8aab93; }
.mb-student-path-steps button>span:last-child{margin-left:auto}
.mb-student-path-steps button strong{display:block;font-size:12px;line-height:1.32;overflow-wrap:break-word}
.mb-student-path-steps button small{display:block;font-size:10px;margin-top:4px;line-height:1.3;color:#547067}
.mb-path-number{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;width:27px;height:27px;flex:0 0 27px;background:#fff;color:#17634e;font-size:12px;font-weight:800;border:1px solid #c5dcca}
.mb-lesson-buddy-example{display:flex;align-items:flex-start;gap:11px;background:#f0f7ef;border:1px solid #dcebdc;border-radius:15px;padding:12px;margin-bottom:4px;color:#24503f}
.mb-lesson-buddy-example img{object-fit:contain; flex:0 0 54px;width:54px;height:54px}
.mb-lesson-buddy-example p{font-size:13px;line-height:1.6}
.mb-lesson-practice{display:block!important;width:max-content;max-width:100%;margin-top:13px;text-align:center;white-space:normal}
#mbStudentGoalBox{background:#fffdfa;border:1px solid #e4e8dd;border-radius:18px;padding:18px;margin:18px 0 10px}
#mbStudentGoalBox h3{font-size:17px;font-weight:800;color:#193d35}
#mbStudentGoalBox p{font-size:13px;color:#566c5c;margin:6px 0 12px}
.mb-goal-options{display:flex;gap:8px;flex-wrap:wrap}
.mb-goal-option{font:600 12px Inter,system-ui,sans-serif;border-radius:999px;padding:9px 12px;background:#f0f4ee;border:1px solid #d5e2d5;color:#264b3b;cursor:pointer}
.mb-goal-option[aria-pressed="true"]{background:#185043;color:#fff;border-color:#185043}
#mbStudentGoalAction{display:inline-flex;background:#e7ba55;color:#173c34;border-radius:999px;padding:10px 15px;font-weight:800;font-size:13px;margin-top:12px;cursor:pointer}
#mbSavingsEntryExplanation:where(p){max-width:100%}
#mbBuddyHub .mb-bh-feature-desc{overflow-wrap:anywhere}
#afford-result, #mbBuddyAnswer, #moneyBuddyFeatureContent, .mb-student-path{overflow-wrap:break-word}
#onboarding-buddy-grid button{align-items:flex-start;min-height:80px}
#onboarding-buddy-grid img{object-fit:contain}
@media(max-width:960px){.mb-student-path-steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767px){
 #mbMyBuddyShortcut {top:auto;bottom:101px;right:11px;z-index:140;padding:5px 10px 5px 5px;box-shadow:0 4px 16px rgba(20,60,43,.18)}
 #mbMyBuddyShortcut img{width:30px;height:30px;flex-basis:30px}
 .mb-student-path {padding:15px;margin:13px 0;border-radius:18px}
 .mb-student-path-heading img{width:54px;height:54px;flex-basis:54px}
 .mb-student-path-heading h2{font-size:17px}
 .mb-student-path-steps {grid-template-columns:1fr}
 .mb-student-path-steps button{min-height:59px}
 #mbStudentGoalBox{padding:14px}
 .mb-lesson-buddy-example img{width:44px;height:44px;flex-basis:44px}
 #onboarding-buddy-grid {max-height:min(42vh,310px)!important}
 #afford-modal #afford-result{max-height:min(47vh,430px);overflow-y:auto}
}
@media(prefers-reduced-motion: reduce){#mbMyBuddyShortcut,.mb-goal-option,.mb-student-path button{transition:none!important}}
/* Accessibility review: Buddy guidance on dark Money Pulse needs light text. */
#moneyBuddyPulse #mbPulseBuddyCaption { color:#e8f5df!important; opacity:1!important; font-weight:650; line-height:1.5; }
@media(max-width:767px){
  #mbMyBuddyShortcut {left:11px;right:auto;bottom:104px;}
}

/* v61: Learn stays scrollable on phones and desktop (including long lessons). */
@media (max-width:767px){
  body.mb-feature-view-open #moneyBuddyFeatureLayer.is-open{
    display:block!important; position:fixed!important; overflow-x:hidden!important;
    overflow-y:auto!important; -webkit-overflow-scrolling:touch!important;
    touch-action:pan-y!important; overscroll-behavior-y:auto!important;
    height:auto!important; max-height:none!important; min-height:0!important;
  }
  body.mb-feature-view-open #moneyBuddyFeatureContent{
    overflow:visible!important; touch-action:pan-y!important;
    padding-bottom:calc(115px + env(safe-area-inset-bottom))!important;
  }
}
@media(min-width:768px){
  html:has(body.mb-feature-view-open){overflow-y:auto!important;scroll-behavior:auto!important}
  body.mb-feature-view-open {overflow-y:visible!important; height:auto!important; position:static!important}
  body.mb-feature-view-open #moneyBuddyFeatureLayer.is-open {overflow:visible!important;position:relative!important}
}
#moneyBuddyProductModal.is-open .mb-product-modal-card{max-height:min(88dvh,840px)!important;overflow-y:auto!important;-webkit-overflow-scrolling:touch!important;touch-action:pan-y!important;overscroll-behavior-y:contain}
/* Atlas is a regular selectable illustrated Buddy, not an obscured reward. */
#mbBuddyHub .mb-bh-feature[data-rarity="legendary"] .mb-bh-feature-image,
#mbBuddyHub .mb-bh-card[data-rarity="legendary"] .mb-bh-card-image{filter:drop-shadow(0 8px 10px rgba(0,0,0,.14))!important;mix-blend-mode:normal!important}
/* v68.31: consistent document-based scrolling on all desktop pages.
   Learn previously used a fixed inner scroller that captured desktop wheel input. */
@media (min-width:768px){
 body.mb-feature-view-open #moneyBuddyFeatureLayer.is-open[data-view="learn"]{
  position:relative!important;inset:auto!important;top:auto!important;
  left:auto!important;right:auto!important;bottom:auto!important;
  height:auto!important;max-height:none!important;min-height:calc(100vh - 76px)!important;
  overflow:visible!important;overscroll-behavior:auto!important;
  touch-action:auto!important;z-index:1!important;
 }
 body.mb-feature-view-open #moneyBuddyFeatureLayer.is-open[data-view="learn"] .mb-feature-shell{
  min-height:0!important;padding-bottom:90px!important;
 }
}
