/* ==========================================================================
   MF_MENTORIA V001.0.2.0 — A.8.14
   Shell mobile recolhível.
   Regra: somente apresentação responsiva; rotas/ações canônicas permanecem
   nos elementos originais e são reutilizadas pelo drawer.
   ========================================================================== */

.mentoria-mobile-nav-toggle{
  display:none;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:44px;
  padding:10px 15px;
  border:1px solid #bfd3e7;
  border-radius:12px;
  background:#fff;
  color:#12385f;
  font:inherit;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 3px 10px rgba(15,23,42,.06);
}
.mentoria-mobile-nav-toggle__icon{
  font-size:18px;
  line-height:1;
}
.mentoria-mobile-nav-root{
  position:fixed;
  inset:0;
  z-index:12000;
  pointer-events:none;
  visibility:hidden;
}
.mentoria-mobile-nav-root.is-open{
  pointer-events:auto;
  visibility:visible;
}
.mentoria-mobile-nav-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.52);
  opacity:0;
  transition:opacity .2s ease;
}
.mentoria-mobile-nav-root.is-open .mentoria-mobile-nav-backdrop{
  opacity:1;
}
.mentoria-mobile-nav-drawer{
  position:absolute;
  inset:0 auto 0 0;
  width:min(88vw,380px);
  max-width:100%;
  display:flex;
  flex-direction:column;
  background:#f8fbff;
  box-shadow:18px 0 42px rgba(15,23,42,.24);
  transform:translateX(-104%);
  transition:transform .22s ease;
  overflow:hidden;
}
.mentoria-mobile-nav-root.is-open .mentoria-mobile-nav-drawer{
  transform:translateX(0);
}
.mentoria-mobile-nav-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:16px 16px 13px;
  background:#fff;
  border-bottom:1px solid #dce7f1;
}
.mentoria-mobile-nav-head-copy{
  min-width:0;
}
.mentoria-mobile-nav-head-copy strong{
  display:block;
  color:#14365a;
  font-size:18px;
}
.mentoria-mobile-nav-head-copy small{
  display:block;
  margin-top:3px;
  color:#60758a;
  font-size:11px;
}
.mentoria-mobile-nav-close{
  flex:0 0 42px;
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid #c9d9e7;
  border-radius:12px;
  background:#fff;
  color:#14365a;
  font-size:23px;
  cursor:pointer;
}
.mentoria-mobile-nav-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:14px 14px 24px;
}
.mentoria-mobile-nav-profile{
  margin-bottom:14px;
}
.mentoria-mobile-nav-profile .mentoria-study-side-profile{
  margin:0;
}
.mentoria-mobile-nav-section{
  margin:0 0 15px;
  padding:12px;
  border:1px solid #dce7f1;
  border-radius:16px;
  background:#fff;
}
.mentoria-mobile-nav-section-title{
  display:block;
  margin:0 0 8px;
  color:#60758a;
  font-size:10px;
  font-weight:900;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.mentoria-mobile-nav-links{
  display:grid;
  gap:7px;
}
.mentoria-mobile-nav-link{
  width:100%;
  min-height:44px;
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid #d7e3ee;
  border-radius:11px;
  background:#fff;
  color:#173a5d;
  text-decoration:none;
  font-size:14px;
  font-weight:800;
  line-height:1.25;
}
.mentoria-mobile-nav-link:hover,
.mentoria-mobile-nav-link:focus-visible{
  border-color:#9fc5e8;
  background:#f4f9ff;
  outline:none;
}
.mentoria-mobile-nav-link.is-active,
.mentoria-mobile-nav-link.is-primary,
.mentoria-mobile-nav-link[aria-current="page"]{
  color:#0668c9;
  border-color:#a9cfef;
  background:#e7f3ff;
  box-shadow:inset 3px 0 0 #0b72d9;
}
.mentoria-mobile-nav-link.danger{
  color:#b42318;
  border-color:#f4c7c3;
  background:#fffafa;
}
.mentoria-mobile-nav-scope{
  margin-top:4px;
}
.mentoria-mobile-nav-scope .mentoria-study-scope{
  margin:0;
}
body.mentoria-mobile-nav-open{
  overflow:hidden !important;
  touch-action:none;
}

@media(max-width:768px){
  html.mentoria-mobile-nav-ready .mentoria-mobile-nav-toggle{
    display:inline-flex;
  }

  /* A navegação original continua no DOM e conserva os hrefs canônicos.
     Somente seus links ficam visualmente recolhidos após JS inicializado. */
  html.mentoria-mobile-nav-ready
  [data-mentoria-mobile-nav-source="primary"] > a{
    display:none !important;
  }

  html.mentoria-mobile-nav-ready
  [data-mentoria-mobile-nav-sidebar]{
    display:none !important;
  }

  html.mentoria-mobile-nav-ready .mentoria-professor-nav[
    data-mentoria-mobile-nav-source="primary"
  ]{
    display:block !important;
    margin:10px 0 14px;
  }

  html.mentoria-mobile-nav-ready .mentoria-professor-nav
  .mentoria-mobile-nav-toggle{
    width:100%;
  }

  html.mentoria-mobile-nav-ready .mentoria-mentorado-nav[
    data-mentoria-mobile-nav-source="primary"
  ]{
    display:block !important;
    width:auto;
  }

  html.mentoria-mobile-nav-ready .mentoria-mentorado-nav
  .mentoria-mobile-nav-toggle{
    width:100%;
    min-width:132px;
    color:#fff;
    border-color:rgba(255,255,255,.32);
    background:rgba(255,255,255,.16);
    box-shadow:none;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-topbar{
    display:grid !important;
    grid-template-columns:minmax(0,1fr) auto;
    align-items:center;
    gap:10px;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-brand{
    grid-column:1;
    width:auto;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-top-actions[
    data-mentoria-mobile-nav-source="primary"
  ]{
    grid-column:1/-1;
    display:flex !important;
    align-items:center;
    width:100%;
    gap:8px;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-top-actions
  .mentoria-study-context-chip{
    flex:1 1 auto;
    min-width:0;
    width:auto;
    grid-column:auto;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-top-actions
  .mentoria-mobile-nav-toggle{
    flex:0 0 auto;
    width:auto;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-workbench,
  html.mentoria-mobile-nav-ready .mentoria-study-workbench.admin{
    display:block !important;
    grid-template-columns:none !important;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-main-column{
    width:100%;
    max-width:100%;
    min-width:0;
  }

  html.mentoria-mobile-nav-ready .mentoria-toolbar[
    data-mentoria-mobile-nav-source="primary"
  ] > a{
    display:none !important;
  }

  html.mentoria-mobile-nav-ready .mentoria-toolbar[
    data-mentoria-mobile-nav-source="primary"
  ]{
    align-items:center;
  }

  html.mentoria-mobile-nav-ready .mentoria-toolbar
  .mentoria-mobile-nav-toggle{
    flex:1 1 180px;
  }
}

@media(max-width:420px){
  .mentoria-mobile-nav-drawer{
    width:92vw;
  }
  .mentoria-mobile-nav-head{
    padding:14px 12px 12px;
  }
  .mentoria-mobile-nav-scroll{
    padding:12px 10px 20px;
  }
  .mentoria-mobile-nav-section{
    padding:10px;
  }
  html.mentoria-mobile-nav-ready .mentoria-study-topbar{
    padding-left:10px !important;
    padding-right:10px !important;
  }
  html.mentoria-mobile-nav-ready .mentoria-study-top-actions{
    align-items:stretch !important;
  }
  html.mentoria-mobile-nav-ready .mentoria-study-top-actions
  .mentoria-study-context-chip{
    flex:1 1 100%;
  }
  html.mentoria-mobile-nav-ready .mentoria-study-top-actions
  .mentoria-mobile-nav-toggle{
    flex:1 1 100%;
  }
}

@media(prefers-reduced-motion:reduce){
  .mentoria-mobile-nav-backdrop,
  .mentoria-mobile-nav-drawer{
    transition:none;
  }
}


/* ==========================================================================
   MF_MENTORIA V001.0.2.0 — A.8.14.1
   Polimento mobile do drawer + hierarquia visual + área útil máxima.
   ========================================================================== */

.mentoria-mobile-nav-head{
  flex:0 0 auto;
  z-index:2;
  padding-top:max(14px, env(safe-area-inset-top));
  box-shadow:0 6px 18px rgba(15,23,42,.06);
}
.mentoria-mobile-nav-scroll{
  scrollbar-gutter:stable;
  padding-bottom:max(32px, calc(96px + env(safe-area-inset-bottom)));
}
.mentoria-mobile-nav-section[data-mentoria-mobile-nav-section="primary"]{
  border-color:#cfe0ef;
  box-shadow:0 5px 16px rgba(15,23,42,.04);
}
.mentoria-mobile-nav-section[data-mentoria-mobile-nav-section="primary"]
.mentoria-mobile-nav-link{
  min-height:46px;
  font-size:15px;
  padding-block:11px;
}
.mentoria-mobile-nav-section[data-mentoria-mobile-nav-section="contextual"]{
  padding:10px;
}
.mentoria-mobile-nav-section[data-mentoria-mobile-nav-section="contextual"]
.mentoria-mobile-nav-links{
  gap:5px;
}
.mentoria-mobile-nav-section[data-mentoria-mobile-nav-section="contextual"]
.mentoria-mobile-nav-link{
  min-height:40px;
  padding:8px 10px;
  font-size:13px;
}
.mentoria-mobile-nav-profile{
  margin-bottom:10px;
}
.mentoria-mobile-nav-profile .mentoria-study-side-profile{
  padding:12px;
  border-radius:14px;
}
.mentoria-mobile-nav-scope{
  margin-top:0;
  padding-bottom:4px;
}
.mentoria-mobile-nav-scope .mentoria-study-scope{
  padding:12px;
  border-radius:14px;
}
.mentoria-mobile-nav-scope .mentoria-study-scope p{
  margin-bottom:0;
}
.mentoria-mobile-nav-section-title{
  margin-bottom:7px;
  font-size:9px;
  letter-spacing:.075em;
}
.mentoria-mobile-nav-close{
  position:relative;
  z-index:3;
}

@media(max-width:768px){
  .mentoria-mobile-nav-drawer{
    width:min(calc(100vw - 16px),400px);
    border-radius:0 18px 18px 0;
  }

  html.mentoria-mobile-nav-ready .mentoria-mentor-shell{
    padding-left:8px;
    padding-right:8px;
    padding-bottom:max(92px, calc(28px + env(safe-area-inset-bottom)));
  }

  html.mentoria-mobile-nav-ready .mentoria-mentorado-container{
    padding-left:8px;
    padding-right:8px;
    padding-bottom:max(92px, calc(28px + env(safe-area-inset-bottom)));
  }

  html.mentoria-mobile-nav-ready .mentoria-shell{
    padding-left:10px;
    padding-right:10px;
    padding-bottom:max(92px, calc(28px + env(safe-area-inset-bottom)));
  }

  html.mentoria-mobile-nav-ready .mentoria-study-page{
    padding-left:6px !important;
    padding-right:6px !important;
    padding-bottom:max(92px, calc(28px + env(safe-area-inset-bottom))) !important;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-workbench,
  html.mentoria-mobile-nav-ready .mentoria-study-workbench.admin{
    padding-left:0 !important;
    padding-right:0 !important;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-main-column,
  html.mentoria-mobile-nav-ready .mentoria-mentorado-welcome,
  html.mentoria-mobile-nav-ready .mentoria-card{
    min-width:0;
    max-width:100%;
  }
}

@media(max-width:420px){
  .mentoria-mobile-nav-drawer{
    width:calc(100vw - 10px);
    max-width:none;
    border-radius:0 16px 16px 0;
  }

  .mentoria-mobile-nav-scroll{
    padding:10px 8px max(28px, calc(96px + env(safe-area-inset-bottom)));
  }

  .mentoria-mobile-nav-section{
    margin-bottom:10px;
    border-radius:14px;
  }

  .mentoria-mobile-nav-section[data-mentoria-mobile-nav-section="primary"]{
    padding:9px;
  }

  .mentoria-mobile-nav-section[data-mentoria-mobile-nav-section="primary"]
  .mentoria-mobile-nav-links{
    gap:6px;
  }

  .mentoria-mobile-nav-section[data-mentoria-mobile-nav-section="contextual"]{
    padding:8px;
  }

  .mentoria-mobile-nav-profile .mentoria-study-side-profile{
    padding:10px;
  }

  html.mentoria-mobile-nav-ready .mentoria-mentorado-topo{
    padding-left:12px;
    padding-right:12px;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-topbar{
    padding-left:8px !important;
    padding-right:8px !important;
  }

  html.mentoria-mobile-nav-ready .mentoria-study-page{
    padding-left:4px !important;
    padding-right:4px !important;
  }
}


/* ==========================================================================
   MF_MENTORIA V001.0.2.0 — A.8.14.2
   Reserva rolável para o launcher do MFChat no smartphone.
   ========================================================================== */
@media(max-width:768px){
  :root{
    --mentoria-mfchat-mobile-safe-zone:116px;
  }

  html.mentoria-mobile-nav-ready .mentoria-mentor-shell,
  html.mentoria-mobile-nav-ready .mentoria-mentorado-container,
  html.mentoria-mobile-nav-ready .mentoria-shell,
  html.mentoria-mobile-nav-ready .mentoria-study-page{
    padding-bottom:max(
      var(--mentoria-mfchat-mobile-safe-zone),
      calc(
        var(--mentoria-mfchat-mobile-safe-zone)
        + env(safe-area-inset-bottom)
      )
    )!important;
  }

  .mentoria-mobile-nav-scroll{
    padding-bottom:max(
      32px,
      calc(116px + env(safe-area-inset-bottom))
    );
  }
}

@media(max-width:420px){
  html.mentoria-mobile-nav-ready .mentoria-mentor-shell,
  html.mentoria-mobile-nav-ready .mentoria-mentorado-container,
  html.mentoria-mobile-nav-ready .mentoria-shell,
  html.mentoria-mobile-nav-ready .mentoria-study-page{
    padding-bottom:max(
      116px,
      calc(116px + env(safe-area-inset-bottom))
    )!important;
  }
}


/* ==========================================================================
   MF_MENTORIA V001.0.2.0 — A.8.14.2.1
   Dock Safe Mobile do MFChat: a área rolável termina antes do launcher.
   Mantém largura útil integral; nenhuma rota/ação do MFChat é alterada.
   ========================================================================== */
@media(max-width:768px){
  html.mentoria-mfchat-mobile-dock-ready{
    --mentoria-mfchat-mobile-dock-height:
      calc(82px + env(safe-area-inset-bottom));
  }

  html.mentoria-mfchat-mobile-dock-ready body{
    box-sizing:border-box;
    height:100dvh;
    min-height:100dvh;
    padding-bottom:var(--mentoria-mfchat-mobile-dock-height);
    overflow:hidden;
  }

  html.mentoria-mfchat-mobile-dock-ready
  body:not(.mentoria-study-body) > .mentoria-mentor-shell,
  html.mentoria-mfchat-mobile-dock-ready
  body:not(.mentoria-study-body) > .mentoria-mentorado-container,
  html.mentoria-mfchat-mobile-dock-ready
  body:not(.mentoria-study-body) > .mentoria-shell{
    box-sizing:border-box;
    height:100%;
    max-height:100%;
    min-height:0;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    padding-bottom:28px!important;
    scroll-padding-bottom:28px;
  }

  html.mentoria-mfchat-mobile-dock-ready
  body:not(.mentoria-study-body) > .mentoria-mentorado-container{
    margin-top:0!important;
    padding-top:18px!important;
  }

  html.mentoria-mfchat-mobile-dock-ready body.mentoria-study-body{
    display:flex;
    flex-direction:column;
  }

  html.mentoria-mfchat-mobile-dock-ready
  body.mentoria-study-body > .mentoria-study-topbar{
    flex:0 0 auto;
  }

  html.mentoria-mfchat-mobile-dock-ready
  body.mentoria-study-body > .mentoria-study-page{
    box-sizing:border-box;
    flex:1 1 auto;
    height:auto;
    min-height:0;
    max-height:none;
    overflow-x:hidden;
    overflow-y:auto;
    overscroll-behavior-y:contain;
    -webkit-overflow-scrolling:touch;
    padding-bottom:28px!important;
    scroll-padding-bottom:28px;
  }
}


/* A.8.17 — submenu de perfil canônico e estável em smartphones. */
@media(max-width:640px){
  html.mentoria-mobile-nav-ready [data-mfc-shell-profile-wrap]{
    display:flex;
    width:100%;
    max-width:100%;
    min-width:0;
    flex-direction:column;
    align-items:stretch;
  }

  html.mentoria-mobile-nav-ready [data-mfc-shell-profile]{
    width:100%;
    max-width:100%;
    min-width:0;
  }

  html.mentoria-mobile-nav-ready
  [data-mfc-shell-profile-wrap] > .mentoria-copilot-profile-popover{
    position:static;
    inset:auto;
    top:auto;
    right:auto;
    bottom:auto;
    left:auto;
    z-index:auto;
    width:100%;
    max-width:100%;
    margin:8px 0 0;
    box-sizing:border-box;
    box-shadow:0 10px 26px rgba(15,23,42,.16);
  }

  .mentoria-mobile-nav-profile [data-mfc-shell-profile-wrap]{
    width:100%;
  }

  .mentoria-mobile-nav-profile
  [data-mfc-shell-profile-wrap] > .mentoria-copilot-profile-popover{
    margin-top:8px;
    box-shadow:0 8px 20px rgba(15,23,42,.12);
  }
}
