/* Learning workspaces open edge to edge. Small confirmation/account dialogs
   keep their own dimensions; this does not request browser/OS fullscreen. */
:is(#favoriteNotesModal,#flashcardModal,#mistakeModal,#exerciseModal,#readingModal,#writingAssistantModal,#toolModal){
  position:fixed;
  inset:0;
  transform:none!important; /* Also override the generic dialog starting style. */
  width:100%;
  height:100dvh;
  margin:0;
  padding:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  box-sizing:border-box;
}
:is(#favoriteNotesModal,#flashcardModal,#mistakeModal,#exerciseModal,#readingModal,#writingAssistantModal,#toolModal)>:is(.favorite-notes-shell,.flashcard-shell,.exercise-shell,.reading-shell,.writing-assistant-shell,.tool-shell){
  position:relative;
  inset:auto;
  transform:none;
  width:100%;
  max-width:none;
  height:100%;
  max-height:none;
  min-height:0;
  margin:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  box-sizing:border-box;
}
:is(#studyPlanDialog,#myDialog,#dailyFortune,#magicCards,#aiPanel){
  position:fixed;
  inset:0;
  transform:none!important;
  width:100%;
  max-width:none;
  height:100dvh;
  max-height:none;
  margin:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  box-sizing:border-box;
  overscroll-behavior:contain;
}
:is(#studyPlanDialog,#myDialog){
  padding:max(24px,env(safe-area-inset-top)) max(20px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left));
}
#flashcardModal .flashcard-shell{
  padding:max(12px,env(safe-area-inset-top)) max(clamp(12px,2.4vw,34px),env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(clamp(12px,2.4vw,34px),env(safe-area-inset-left));
}
:is(#favoriteNotesModal,#mistakeModal,#exerciseModal,#readingModal,#writingAssistantModal,#toolModal) header{
  padding-top:max(12px,env(safe-area-inset-top));
  padding-left:max(16px,env(safe-area-inset-left));
  padding-right:max(16px,env(safe-area-inset-right));
}
body:has(:is(#favoriteNotesModal,#flashcardModal,#mistakeModal,#exerciseModal,#readingModal,#writingAssistantModal,#toolModal):not(.hidden)),
body:has(:is(#studyPlanDialog,#myDialog,#dailyFortune,#magicCards)[open]),
body:has(#aiPanel:not([hidden])){overflow:hidden}
body:has(:is(#favoriteNotesModal,#flashcardModal,#mistakeModal,#exerciseModal,#readingModal,#writingAssistantModal,#toolModal):not(.hidden)) #aiOrb{visibility:hidden;pointer-events:none}
@media(max-width:700px){
  :is(#favoriteNotesModal,#flashcardModal,#mistakeModal,#exerciseModal,#readingModal,#writingAssistantModal,#toolModal,#studyPlanDialog,#myDialog,#dailyFortune,#magicCards,#aiPanel){
    top:var(--visible-top,0px);
    bottom:auto;
    height:var(--visible-height,100dvh);
  }
}
