:root{--brain-red:#D91515;--portal-red:#D91515}
.mobile-more-toggle,.mobile-more-menu{display:none}

/* Official Brain Sensei identity wherever the product logo appears. */
.brand{display:flex;align-items:center;min-width:245px;grid-template:none}
.official-brand-logo{display:block;width:190px;max-width:100%;height:auto}
.portal-brand{display:flex;align-items:center}
.portal-logo{width:178px}
.login-brand{display:flex;align-items:center}
.login-logo{width:210px}
.course-cover-logo{width:82%;height:auto;margin:0 auto 6px}
.mobile-portal-logo{display:none;width:155px;height:auto;margin-right:18px}

/* One television-style cue at a time. */
.captions{position:fixed!important;z-index:45;left:calc(255px + (100vw - 570px)/2)!important;right:auto!important;bottom:92px!important;transform:translateX(-50%);width:min(680px,calc(100vw - 618px));height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding:8px 15px!important;border-radius:2px!important;background:#050505ed!important;color:#fff;font-size:18px!important;font-weight:500!important;line-height:1.25!important;text-align:center;text-shadow:0 1px 2px #000;box-shadow:none;display:block;white-space:normal;overflow:visible;opacity:1;transition:opacity .14s ease}
.captions.is-changing{opacity:0}
.captions.hidden{display:none!important}

/* Every visible brand-red treatment uses the approved value. */
.usage-panel{border-top-color:var(--brain-red)}
.usage-bar i,.login-brand>span,.portal-primary,.play,.ask,footer>button:last-child{background-color:var(--brain-red)}
.login-card{border-top-color:var(--brain-red)}
.text-button,.empty-certificate h2{color:var(--brain-red)}

@media(max-width:1050px) and (min-width:801px){
  .captions{left:calc(210px + (100vw - 210px)/2)!important;width:min(680px,calc(100vw - 258px))}
}

@media(max-width:800px){
  html{height:100%}
  body:has(.stage){height:100%;overflow:hidden}
  .stage{height:100dvh;min-height:100dvh;grid-template-rows:auto minmax(0,1fr) 76px;overflow:hidden}
  .stage>header{position:relative;z-index:55;display:grid;grid-template-columns:minmax(0,1fr) 44px;grid-template-rows:auto auto auto;height:auto;min-height:0;padding:10px 12px 9px;gap:7px 10px;background:#fff}
  .stage>header .brand{grid-column:1;grid-row:1;min-width:0;width:165px;display:flex}
  .stage>header .official-brand-logo{width:165px}
  .stage>header .course{grid-column:1/3;grid-row:2;display:grid;border-left:0;padding:0;line-height:1.15}
  .stage>header .course span{font-size:9px;letter-spacing:.08em}
  .stage>header .course b{font-size:16px;white-space:normal;line-height:1.18}
  .stage>header .header-actions{display:none!important}

  .mobile-more-toggle{grid-column:2;grid-row:1;display:grid!important;align-content:center;justify-items:center;gap:4px;width:44px;height:44px;border:1px solid #d5dce5;border-radius:9px;background:#fff;color:#071d37}
  .mobile-more-toggle span{display:block;width:20px;height:2px;border-radius:2px;background:currentColor}
  .mobile-course-nav{grid-column:1/3;grid-row:3;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1.25fr) minmax(50px,.5fr);gap:7px}
  .mobile-course-nav button{min-width:0;min-height:46px;border:1px solid #d3dae4;border-radius:9px;background:#fff;color:#071d37;font-size:12px;font-weight:800;line-height:1.1;padding:8px;display:flex;align-items:center;justify-content:center;gap:6px}
  .mobile-course-nav button i{width:8px;height:8px;border-radius:50%;background:#aab3bf}
  .mobile-course-nav button.active{background:#fff0f0!important;color:#071d37!important;border-color:#efaaaa;font-weight:800}
  .mobile-course-nav #mobileLive.active i{background:var(--brain-red)}
  .mobile-course-nav #mobileCc{background:#fff!important;color:#071d37!important;border-color:#d3dae4!important}
  .mobile-course-nav #mobileCc.active{background:#071d37!important;color:#fff!important;border-color:#071d37}

  .mobile-more-menu{display:none;position:absolute;z-index:58;right:12px;top:61px;width:min(285px,calc(100vw - 24px));padding:8px;background:#fff;border:1px solid #d8dfe8;border-radius:11px;box-shadow:0 18px 45px #071d3733}
  .stage.mobile-menu-open .mobile-more-menu{display:grid}
  .mobile-more-menu button{min-height:46px;border:0;border-bottom:1px solid #e4e8ee;background:#fff;color:#071d37;text-align:left;padding:10px 12px;font-weight:750}
  .mobile-more-menu button:last-child{border-bottom:0}

  .workspace main{padding:10px 10px calc(94px + env(safe-area-inset-bottom,0px));overflow-y:auto}
  .slide{min-height:auto;padding:23px 20px 29px}
  .captions{left:12px!important;right:12px!important;bottom:calc(84px + env(safe-area-inset-bottom,0px))!important;transform:none;width:auto!important;max-width:none;font-size:17px!important;padding:8px 12px!important}

  .stage>footer{position:fixed!important;z-index:46;left:0;right:0;bottom:0;display:grid;grid-template-columns:54px minmax(0,1fr) 54px;height:calc(76px + env(safe-area-inset-bottom,0px));min-height:calc(76px + env(safe-area-inset-bottom,0px));padding-bottom:env(safe-area-inset-bottom,0px);background:#fff;box-shadow:0 -4px 18px #071d3718}
  .stage>footer .audio{gap:8px;padding:0 5px}
  .stage>footer .audio .play{width:48px;height:48px;flex:0 0 48px;background:var(--brain-red)}
  .stage>footer .audio>div{display:grid;min-width:0;max-width:145px}
  .stage>footer .audio>div b{font-size:11px}
  .stage>footer .audio>div span{font-size:10px}
  .stage>footer .audio select{width:64px;padding:7px 4px;font-size:13px}
  .stage>footer>button:last-child{background:var(--brain-red)}
  .stage>footer>#prev:after{content:'←'}
  .stage>footer>#next:after{content:'→'}

  .workspace>aside,.workspace>.instructor{z-index:62}
  .mobile-panel-backdrop{z-index:60}
  .stage.mobile-menu-open>header{z-index:65}
  .stage.mobile-menu-open .mobile-panel-backdrop{opacity:1;pointer-events:auto}
  .mobile-portal-logo{display:block}
  .portal-main>header{height:auto;min-height:82px;display:grid;grid-template-columns:1fr auto;align-content:center}
  .portal-main>header .mobile-portal-logo{grid-column:1/3;margin-bottom:8px}
}

@media(max-width:390px){
  .stage>header .brand,.stage>header .official-brand-logo{width:148px}
  .mobile-course-nav button{font-size:11px;padding:7px 5px}
  .stage>footer .audio>div{display:grid;max-width:105px}
  .stage>footer .audio select{width:57px}
}

